@visitscotland/component-library 5.20.8 → 5.21.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/LICENSE.txt +21 -21
- package/dist/client/manifest.json +2308 -2308
- package/dist/client/scripts/{780756067403de777217.js → 146a7788732b7f073ac9.js} +1 -1
- package/dist/client/scripts/3cf61618bc3263a1c0c9.js +1 -0
- package/dist/client/scripts/4686de7ea799c8ec1c03.js +1 -0
- package/dist/client/scripts/4927a1ac02287057b8a5.js +1 -0
- package/dist/client/scripts/{891ca07460a5832f8df7.js → 86bfa431e2d44d78e145.js} +1 -1
- package/dist/client/scripts/b9cb221f563e1ae97305.js +1 -0
- package/dist/client/scripts/{b8910302df4d99f32bab.js → d8f36385fae4848561e8.js} +1 -1
- package/dist/client/styles/86bfa431e2d44d78e145.css +1 -0
- package/dist/components/{LoadingSpinner-BV9HMdg5.mjs → LoadingSpinner-Al46acPr.mjs} +72 -82
- package/dist/components/{LoadingSpinner-JuocvxQq.js → LoadingSpinner-Cmgcr11N.js} +7 -7
- package/dist/components/deprecated-B3DbN99Y.mjs +16 -0
- package/dist/components/{deprecated-BJ2e68Yo.js → deprecated-Cl9osRH8.js} +12 -12
- package/dist/components/{highland-cow-6AoCzBpF.mjs → highland-cow-BiKfZg7L.mjs} +14 -14
- package/dist/components/{highland-cow-DlMGnebG.js → highland-cow-CRm5ANrL.js} +14 -14
- package/dist/components/{iCentre-BnLcpIw8.js → iCentre-BeepnBTk.js} +42 -42
- package/dist/components/{iCentre-BLimkPxI.mjs → iCentre-DV4_tr7d.mjs} +42 -42
- package/dist/components/{os-logo-maps-DUN8X-lQ.mjs → os-logo-maps-B7DKWN7s.mjs} +9 -9
- package/dist/components/{os-logo-maps-QXAuept_.js → os-logo-maps-CF9QEvIX.js} +9 -9
- package/dist/components/{os-logo-maps-white-BTtf_Eki.js → os-logo-maps-white-DOUatF7F.js} +6 -6
- package/dist/components/{os-logo-maps-white-SKYtuD6d.mjs → os-logo-maps-white-Dl0tLZD_.mjs} +6 -6
- package/dist/components/{prototype-lvwJzV8T.mjs → prototype-8NKYzK-s.mjs} +13 -13
- package/dist/components/{prototype-DQocvgQh.js → prototype-ggLuAMuB.js} +12 -12
- package/dist/components/ready-DQA4tUcz.mjs +15 -0
- package/dist/components/{ready-D9pdKFkx.js → ready-DSUouF6L.js} +11 -11
- package/dist/components/{review-CknihZl_.mjs → review-B3KwWYuP.mjs} +11 -11
- package/dist/components/{review-7L3On10m.js → review-Bi0lAugE.js} +11 -11
- package/dist/components/src/components/form/Form.vue.d.ts +7 -3
- package/dist/components/src/components/select/Select.vue.d.ts +14 -14
- package/dist/components/src/custom-components/maps/MainMap.vue.d.ts +4 -0
- package/dist/components/src/custom-components/maps/index.d.ts +4 -0
- package/dist/components/src/utils/data-layer-templates.d.ts +0 -1
- package/dist/components/style.css +1 -1
- package/dist/components/{visitscotland-logo-BEiiuSpo.mjs → visitscotland-logo-BA7LkUJw.mjs} +3 -3
- package/dist/components/{visitscotland-logo-NoymCLtN.js → visitscotland-logo-yAzNpi5x.js} +3 -3
- package/dist/components/vs-component-library-maps.js +1 -1
- package/dist/components/vs-component-library-maps.mjs +1 -1
- package/dist/components/vs-component-library.js +221 -221
- package/dist/components/vs-component-library.mjs +3645 -3573
- package/dist/ssr/index.js +1 -1
- package/dist/ssr/manifest.json +1 -1
- package/dist/ssr/styles/{52a6cd350e88d6be7bf8.css → 0e016ca4b8686f6e805d.css} +1 -1
- package/package.json +231 -231
- package/dist/client/scripts/d913bde0420d1fc234d4.js +0 -1
- package/dist/client/scripts/ddb1fea40c338415285a.js +0 -1
- package/dist/client/scripts/e9e73c7dd25549beb2ce.js +0 -1
- package/dist/client/scripts/f63eafcdb6b94fd95198.js +0 -1
- package/dist/client/styles/891ca07460a5832f8df7.css +0 -1
- package/dist/components/deprecated-SV4OJNeR.mjs +0 -16
- package/dist/components/ready-CWPx4e9A.mjs +0 -15
- /package/dist/client/scripts/{6fc29b2e316a296f27b3.js → 0036243f84e83014237c.js} +0 -0
- /package/dist/client/scripts/{407c4cdbe305f30d4aae.js → 00ccd7949f170b3d738d.js} +0 -0
- /package/dist/client/scripts/{0e63f8b8378416581782.js → 02201764e0adf0d63538.js} +0 -0
- /package/dist/client/scripts/{82cff5a009d11a47c9b1.js → 0389a15654d3a45aab1a.js} +0 -0
- /package/dist/client/scripts/{54bf256155e551077ef4.js → 03be5e7637e3fc5b35f2.js} +0 -0
- /package/dist/client/scripts/{e147a51def3ab23ae656.js → 056cd8933beea0edc19e.js} +0 -0
- /package/dist/client/scripts/{aaccda3fa7fb0b1e4c76.js → 07f92cd6237e0c89e05f.js} +0 -0
- /package/dist/client/scripts/{a49c8ff1197214b8c2ec.js → 089accd171820ed54ff9.js} +0 -0
- /package/dist/client/scripts/{f6cb2798677ada41ec58.js → 093dbadb21acf4310ea2.js} +0 -0
- /package/dist/client/scripts/{30104934860fed5bc19c.js → 0965942c287f6c10c83a.js} +0 -0
- /package/dist/client/scripts/{247c689797a97059a7e0.js → 09efaf35581f94d9341a.js} +0 -0
- /package/dist/client/scripts/{24553449d3e0cde91619.js → 0adba95aa35ce3cf48a3.js} +0 -0
- /package/dist/client/scripts/{28fb27bc5806c768b30d.js → 0e8cc6787e102d95ccad.js} +0 -0
- /package/dist/client/scripts/{e74cb22d42037309926d.js → 0eccccf491d2d8c15ec2.js} +0 -0
- /package/dist/client/scripts/{c4d1c2c8dbf87da6d96f.js → 1262d9eb296be8be48b9.js} +0 -0
- /package/dist/client/scripts/{b4b5cb3c5ef635b2c861.js → 1402c958f118bbafb604.js} +0 -0
- /package/dist/client/scripts/{79eddfa24c7ea007b464.js → 16a3a76ec493d5af9559.js} +0 -0
- /package/dist/client/scripts/{41085f1d73bd0fa3c10a.js → 17bca51c0b3e12105894.js} +0 -0
- /package/dist/client/scripts/{faca18429fe2cbd475e2.js → 17f706d9450b7e231610.js} +0 -0
- /package/dist/client/scripts/{7d6b4b7afd5a8bd553da.js → 18be8c33f978d41c810c.js} +0 -0
- /package/dist/client/scripts/{72b1acbfc3c9b80b8d0d.js → 1b2ab22235289bb11413.js} +0 -0
- /package/dist/client/scripts/{319cce34e32e88725a45.js → 1c048832077af161ca70.js} +0 -0
- /package/dist/client/scripts/{7743945180a0c8015dcd.js → 1c32beef3128a72541fd.js} +0 -0
- /package/dist/client/scripts/{23ea5cdb4bd00312ad71.js → 1dab8b823a9fc7be9e7d.js} +0 -0
- /package/dist/client/scripts/{2426de8f0394d3b603f9.js → 205e2dbe4c3590fb0ca4.js} +0 -0
- /package/dist/client/scripts/{0f9d4e89ae9e875c4c2c.js → 21cac0ef61086a4aaa44.js} +0 -0
- /package/dist/client/scripts/{d43c1005ef0b2e384fdb.js → 23889a0a798b09d499c1.js} +0 -0
- /package/dist/client/scripts/{4fdaba171d92a49c5002.js → 2464bcc48b0bd7955c9f.js} +0 -0
- /package/dist/client/scripts/{8c72fca95c326a712f69.js → 28f7596c01dff2813e25.js} +0 -0
- /package/dist/client/scripts/{4be307902b6682456306.js → 2a0d066c05ce80ef84a2.js} +0 -0
- /package/dist/client/scripts/{335bb4f1c38a98d3a44d.js → 2d931eb506983939dee2.js} +0 -0
- /package/dist/client/scripts/{0fcf11c1fab34c75ad81.js → 34433c129bef8559d83f.js} +0 -0
- /package/dist/client/scripts/{973a0d7cba321ac1949b.js → 34c3288e431f8a0155e6.js} +0 -0
- /package/dist/client/scripts/{50e356fe6c0b2febc750.js → 378133b962494b0328be.js} +0 -0
- /package/dist/client/scripts/{93bde9d3da4e67262071.js → 38875405be2461bf6367.js} +0 -0
- /package/dist/client/scripts/{aed199f6a2d99ed2c6ed.js → 38d5589b9158ab8e7423.js} +0 -0
- /package/dist/client/scripts/{84222624315dca891314.js → 392a233a558e074c70d9.js} +0 -0
- /package/dist/client/scripts/{da2a562048bac8e8d949.js → 3a7baf62722abdc454d6.js} +0 -0
- /package/dist/client/scripts/{fda5178de10b894562eb.js → 3a800940b5afb5bfb8f5.js} +0 -0
- /package/dist/client/scripts/{f84229a0696a0096e336.js → 3ae3625c5b179d3021e9.js} +0 -0
- /package/dist/client/scripts/{9f5ae43cbfda2ce15ad0.js → 3c5baf37fc4cdec110f6.js} +0 -0
- /package/dist/client/scripts/{2b43a99e2018d0c84f18.js → 3ea2352e8a94ddc6dc8a.js} +0 -0
- /package/dist/client/scripts/{f5dd83c05af526500d98.js → 406e9909758efdb1ae29.js} +0 -0
- /package/dist/client/scripts/{ef1dd69cae444e50867a.js → 408bd09f6eb4f00d6659.js} +0 -0
- /package/dist/client/scripts/{0918c354e496ebc33a8e.js → 41188d492c5a77d87d02.js} +0 -0
- /package/dist/client/scripts/{7818ed43fdcd566ba3f8.js → 41dea7515c49fbb37cd0.js} +0 -0
- /package/dist/client/scripts/{255deca6193abf3e925a.js → 4584e1ddb5422604136f.js} +0 -0
- /package/dist/client/scripts/{e00a7a2a9ee3bd2c34c6.js → 4714fa29a82e1177d216.js} +0 -0
- /package/dist/client/scripts/{b5e9ab0705ea5f7c6033.js → 472436c55ce848b6e460.js} +0 -0
- /package/dist/client/scripts/{bc8c593bdc7f77961b3e.js → 4a7dd18ce8648d5f3748.js} +0 -0
- /package/dist/client/scripts/{d834a244045638c9ae0b.js → 4e6cf740114de50950d7.js} +0 -0
- /package/dist/client/scripts/{bdc263d85e27ed0985c8.js → 4fd8ff7fa8b4b36ef6bc.js} +0 -0
- /package/dist/client/scripts/{f29db69f95e75149e0e5.js → 4ffdfcf6a6eecdca5833.js} +0 -0
- /package/dist/client/scripts/{a16667b5a58ef75e0a65.js → 507ccdc5bf81d59adfb1.js} +0 -0
- /package/dist/client/scripts/{ec6fd2311481a0dfc9d1.js → 568f78f9b01fc9462683.js} +0 -0
- /package/dist/client/scripts/{025902a6e1e60501e418.js → 588b32ff5515fdd5707e.js} +0 -0
- /package/dist/client/scripts/{1bb081afaacdf19e137c.js → 59658d2a579def05efa0.js} +0 -0
- /package/dist/client/scripts/{093df1d5f4968f1a29eb.js → 59ab7b4a6827442b90c7.js} +0 -0
- /package/dist/client/scripts/{cb130f4f9c49c19655e7.js → 59f9a530612b9c11540e.js} +0 -0
- /package/dist/client/scripts/{6cf6cc6c2d13bfd50cdd.js → 5bfe1a52e5e438b16b80.js} +0 -0
- /package/dist/client/scripts/{f12e8d4deaddb3b26d58.js → 6011db9e93655179bce2.js} +0 -0
- /package/dist/client/scripts/{6b46c22ca1c92349b2f8.js → 6198cadc6ef977ea0b7f.js} +0 -0
- /package/dist/client/scripts/{fcca4ddacffe3f8cf584.js → 6231f7cde1c1a252e3ff.js} +0 -0
- /package/dist/client/scripts/{9eebe67b2504a3c1d87c.js → 6482c0db9dfb95939fd0.js} +0 -0
- /package/dist/client/scripts/{4b8ab89e3dadf71a555b.js → 662de3a6d0e84564965f.js} +0 -0
- /package/dist/client/scripts/{ea9c40e082d00151bcb2.js → 66d5a4a2cf08cdaa86bb.js} +0 -0
- /package/dist/client/scripts/{3339ab53ef97b3ccfa18.js → 69230c65912cdd38a584.js} +0 -0
- /package/dist/client/scripts/{c1d9299a2481f61b3e9b.js → 6f579b91d024f526a37f.js} +0 -0
- /package/dist/client/scripts/{1b671e76adf446fe7310.js → 6f97d59f13e103648e2b.js} +0 -0
- /package/dist/client/scripts/{9987d7d12d1a3b4a8eea.js → 701b3f29f72a42f4ba5b.js} +0 -0
- /package/dist/client/scripts/{c826e0cc20a2aa528853.js → 72709ccc1d539e0e7922.js} +0 -0
- /package/dist/client/scripts/{71a350a41f111577de16.js → 72b2000e26db0599329e.js} +0 -0
- /package/dist/client/scripts/{756275c6e26971186a7e.js → 7462753f35b4eef9f539.js} +0 -0
- /package/dist/client/scripts/{0d44aeaf665b9f76f1a3.js → 746da613bad15ee3dcff.js} +0 -0
- /package/dist/client/scripts/{1d1abb5e5dbc59ef9ba2.js → 74ecbb4b7b820d191d79.js} +0 -0
- /package/dist/client/scripts/{c2657529f0bd72c822ab.js → 7a555f60e9828f5791c4.js} +0 -0
- /package/dist/client/scripts/{b3866bf38c79001bc962.js → 7e388f3275fdd4ba4d75.js} +0 -0
- /package/dist/client/scripts/{5b8a2cea713d1756b7de.js → 7f740f4d4657aa579ccd.js} +0 -0
- /package/dist/client/scripts/{06e2a0dd3335dfc0e506.js → 804a497cb44fe949310e.js} +0 -0
- /package/dist/client/scripts/{64040fe43c85229d6c7e.js → 815b2ba5fab54eebb5ca.js} +0 -0
- /package/dist/client/scripts/{d7be84839eb13c10994d.js → 84e8cb222b65ef8c7fd7.js} +0 -0
- /package/dist/client/scripts/{d45a491bd98ee16dc921.js → 8537711ac020c8f29676.js} +0 -0
- /package/dist/client/scripts/{18b8732facc297fa275d.js → 86714d804290b9ba22f6.js} +0 -0
- /package/dist/client/scripts/{62f5709eb7cf0bee5308.js → 86814331153df2f74cb1.js} +0 -0
- /package/dist/client/scripts/{09b087ec0d366e0f4aab.js → 8773147ebc61bee2e1a6.js} +0 -0
- /package/dist/client/scripts/{f0a6732b51fe9c604843.js → 87bf4ef1e4c910a2c137.js} +0 -0
- /package/dist/client/scripts/{ced4071f764fa201e664.js → 88a48eba61706a1b38f7.js} +0 -0
- /package/dist/client/scripts/{4f227cf9d210a351d684.js → 88b02946d875717c7892.js} +0 -0
- /package/dist/client/scripts/{5e9e07ef4ddc7059f769.js → 89abc7e3a5eecf6b6014.js} +0 -0
- /package/dist/client/scripts/{2847077fc8b21eea9bc7.js → 8bbb03cef27adbf1052c.js} +0 -0
- /package/dist/client/scripts/{ede70c2797449c4d51a6.js → 914125d34a0c8421839d.js} +0 -0
- /package/dist/client/scripts/{230561f40b218ce33aa3.js → 91501cfefb3e9beeffa4.js} +0 -0
- /package/dist/client/scripts/{9212fa0c23e7fbc74fb7.js → 91f5a130ef63276c95f1.js} +0 -0
- /package/dist/client/scripts/{0fc32c57e4b4c007d86e.js → 92e2f55c77c0b9473c56.js} +0 -0
- /package/dist/client/scripts/{6995a6a5607ccfaef630.js → 92f88dfc1b040e6657db.js} +0 -0
- /package/dist/client/scripts/{943c207eed1ff2aa3f4b.js → 9324abfa574340eb6ede.js} +0 -0
- /package/dist/client/scripts/{e23286dae5ab566935f8.js → 933d633cb47a3304650c.js} +0 -0
- /package/dist/client/scripts/{d8cfe1555b7bcbacdef5.js → 96fcf998bf85267cee36.js} +0 -0
- /package/dist/client/scripts/{39ba7e46913442fd36d3.js → 980215f15338a4638935.js} +0 -0
- /package/dist/client/scripts/{ff3f98b95580dd1fde4c.js → 9865e2574c6d07158054.js} +0 -0
- /package/dist/client/scripts/{2bac5c7960d4e0987bf3.js → 99f43c4c4a9704f957a9.js} +0 -0
- /package/dist/client/scripts/{f25db0c188d1d6ae7dd7.js → 9c4c4822a484f5a5ad19.js} +0 -0
- /package/dist/client/scripts/{108eacd965f43203b161.js → a1f8e3bd33feb4f2ab92.js} +0 -0
- /package/dist/client/scripts/{d85446efe3a1470091cd.js → a277d05eb0162d8df8c1.js} +0 -0
- /package/dist/client/scripts/{68395bfe89565e0d1d79.js → a451e339bbbf4c755dd2.js} +0 -0
- /package/dist/client/scripts/{a06a68636bc8161710b5.js → a6d598ec76e67174f994.js} +0 -0
- /package/dist/client/scripts/{df5930c5f79402892064.js → a712d2e04a1b916faca6.js} +0 -0
- /package/dist/client/scripts/{7016d8a61690a15d03f9.js → a74cc1abc33d10c98576.js} +0 -0
- /package/dist/client/scripts/{170ca751557782434b86.js → a9887918f6748e99e5e6.js} +0 -0
- /package/dist/client/scripts/{eba32e7258bb2a7a1a2a.js → a98a1c78a6e495be1fe3.js} +0 -0
- /package/dist/client/scripts/{b55e02a32d90c14f4cbe.js → ab31c58b4b87e68b35fb.js} +0 -0
- /package/dist/client/scripts/{c78a6f94753c6c5d6a0d.js → ad6c8c5b4248c6242078.js} +0 -0
- /package/dist/client/scripts/{373129c3f6ff64209b21.js → ada91090ef1c52557dc9.js} +0 -0
- /package/dist/client/scripts/{beaf345e668e5858c6bd.js → ae547edbc8099702ba5a.js} +0 -0
- /package/dist/client/scripts/{f30fbd3d7d6421ff0d75.js → ae596ff1996c280c202c.js} +0 -0
- /package/dist/client/scripts/{9742df9b3b105d4cc277.js → affc2dc765c1741a7319.js} +0 -0
- /package/dist/client/scripts/{467ccdae7bcc2a1615bb.js → b5213fdbef77370db82d.js} +0 -0
- /package/dist/client/scripts/{a596a627aca89f5a6b1b.js → b78748f9969f7ea74694.js} +0 -0
- /package/dist/client/scripts/{43342b3ad25af480ac21.js → b7cc5ee25c7302916b09.js} +0 -0
- /package/dist/client/scripts/{77c36fabf7d4d9192e6c.js → b85d75a825b35c37debd.js} +0 -0
- /package/dist/client/scripts/{a73fba74b9519c977182.js → ba8379f7349980eced6b.js} +0 -0
- /package/dist/client/scripts/{7164a0309a6e67669529.js → bb8f78fd21453a818715.js} +0 -0
- /package/dist/client/scripts/{49ea1362a407d332ae50.js → bbb212b4be125e838441.js} +0 -0
- /package/dist/client/scripts/{80006a5fec335cb12b7c.js → becfc64a7cf18580f64b.js} +0 -0
- /package/dist/client/scripts/{80cddc196cc2b7002fd6.js → bf0781d3e1fda7aaf432.js} +0 -0
- /package/dist/client/scripts/{5a9f3609f8449b952b64.js → c07d2bb6aab9b5629d10.js} +0 -0
- /package/dist/client/scripts/{e73bc57a96ce8bc9f24d.js → c0916ba3df82723ef6e2.js} +0 -0
- /package/dist/client/scripts/{7e03a5d5a40ed66af4c5.js → c2c11ce041704882fd38.js} +0 -0
- /package/dist/client/scripts/{12c214803bb856eac25e.js → c3622d52d3929b8ce67a.js} +0 -0
- /package/dist/client/scripts/{565fe0111bdfe1faa81b.js → d014754e0eff762e6ca9.js} +0 -0
- /package/dist/client/scripts/{ca534726c8438931e48c.js → d2b70350d3fa2cef0e39.js} +0 -0
- /package/dist/client/scripts/{29fe5285a5534638e45b.js → d307d2e9cf655c179d77.js} +0 -0
- /package/dist/client/scripts/{18a0554f2d6d9bb11db8.js → d4fdfca319e908a2c80a.js} +0 -0
- /package/dist/client/scripts/{91f3984e40032bf924c1.js → d649ff9550b197262c78.js} +0 -0
- /package/dist/client/scripts/{7880369871d8c84cd0e7.js → d7a62916cee4d6e2b444.js} +0 -0
- /package/dist/client/scripts/{c62b762778316d2d5162.js → d7e1b77c4b3b1491114a.js} +0 -0
- /package/dist/client/scripts/{425798f1e769e3318588.js → d8479a09f285dd896e64.js} +0 -0
- /package/dist/client/scripts/{52a3b97165f405e63efb.js → d92b71a6a05b8f554c7e.js} +0 -0
- /package/dist/client/scripts/{bedf2af0b7bfe31d6095.js → db8435e74ec6a4493db1.js} +0 -0
- /package/dist/client/scripts/{4ad5d822d9c447ec26c9.js → dba10c026b8321623d2e.js} +0 -0
- /package/dist/client/scripts/{e82db7ecb8bd18986174.js → dca2c65879ee8c6fe5e7.js} +0 -0
- /package/dist/client/scripts/{0c6dfbf036b0371160cd.js → dd51706886e16b5f97be.js} +0 -0
- /package/dist/client/scripts/{29592daed7085fae2aff.js → ddc4d2ea575a50bc4ae3.js} +0 -0
- /package/dist/client/scripts/{69942f55e3b5bf6d503b.js → df120b5d2932d752a788.js} +0 -0
- /package/dist/client/scripts/{8fb6347aacc0d7a6e455.js → df56e8276b6973df6c3c.js} +0 -0
- /package/dist/client/scripts/{2f1b8a7fe67255cbe0ad.js → dfab0d5501435b36f6fb.js} +0 -0
- /package/dist/client/scripts/{6e83cdb8cf4a81b04610.js → e0ae6eb532e9deca95b9.js} +0 -0
- /package/dist/client/scripts/{05a1efe07f04c478155a.js → e0c5487ea1f49ba55654.js} +0 -0
- /package/dist/client/scripts/{5ca596aa3d93347cb166.js → e2b91f9e13b86ff8389c.js} +0 -0
- /package/dist/client/scripts/{ba513ff26457b9efc034.js → e5f69ed9d3c641d5cfeb.js} +0 -0
- /package/dist/client/scripts/{52c515514b241f01e737.js → e600798c21b1e4b3421a.js} +0 -0
- /package/dist/client/scripts/{c4948b2ac58d29eb2600.js → e794fc5005c252318257.js} +0 -0
- /package/dist/client/scripts/{c3527a51540c796aa210.js → e7b33c7b9c52aa2c42fb.js} +0 -0
- /package/dist/client/scripts/{b97f6a6153af68b5ee51.js → e8d5c21e03e6d57b5511.js} +0 -0
- /package/dist/client/scripts/{08755652b19e4b8cc3a6.js → e949a288ca740fd5e306.js} +0 -0
- /package/dist/client/scripts/{23e7e7801052da2ee7b1.js → e97cb8c56d2e5ca10a9b.js} +0 -0
- /package/dist/client/scripts/{2ddd806af85bc2956424.js → eb3bd92efead362fbc2c.js} +0 -0
- /package/dist/client/scripts/{cbaada8722a80b6bdaa1.js → eb3e702cdad4fa098d02.js} +0 -0
- /package/dist/client/scripts/{3d104d833e75a1ac1e4a.js → ebdce9568e760278f176.js} +0 -0
- /package/dist/client/scripts/{d9005ebbf3356c0044d1.js → ebde9babb291ce858d18.js} +0 -0
- /package/dist/client/scripts/{d4b9f2074063ed7456f0.js → ed4b2bf33dda868c13ee.js} +0 -0
- /package/dist/client/scripts/{454827facac3a7b5372d.js → eeaf7a5064376c23e2fd.js} +0 -0
- /package/dist/client/scripts/{327234381f9055359003.js → efe4a3c8ab1adefc03f2.js} +0 -0
- /package/dist/client/scripts/{652a5b87c018e27253cb.js → f16221d99c87c834338d.js} +0 -0
- /package/dist/client/scripts/{02cd01e4087e8d5aa492.js → f1fc1db1d8256f3c8b0f.js} +0 -0
- /package/dist/client/scripts/{5fe5fed299dd1686d8b6.js → f2995c12e4c7d9beeedc.js} +0 -0
- /package/dist/client/scripts/{cb7718d9829f07833d01.js → f2ef165911bb1b115aad.js} +0 -0
- /package/dist/client/scripts/{147acfad2826cadced1c.js → f75efc7d112f59f0bf9c.js} +0 -0
- /package/dist/client/scripts/{ba92be8988f6e7cd5e6f.js → fddbb5023e794ab0f98a.js} +0 -0
- /package/dist/client/scripts/{c033ed6d46bc42084b33.js → ff80131a5bed70291e0b.js} +0 -0
- /package/dist/client/styles/{6fc29b2e316a296f27b3.css → 0036243f84e83014237c.css} +0 -0
- /package/dist/client/styles/{407c4cdbe305f30d4aae.css → 00ccd7949f170b3d738d.css} +0 -0
- /package/dist/client/styles/{0e63f8b8378416581782.css → 02201764e0adf0d63538.css} +0 -0
- /package/dist/client/styles/{82cff5a009d11a47c9b1.css → 0389a15654d3a45aab1a.css} +0 -0
- /package/dist/client/styles/{54bf256155e551077ef4.css → 03be5e7637e3fc5b35f2.css} +0 -0
- /package/dist/client/styles/{e147a51def3ab23ae656.css → 056cd8933beea0edc19e.css} +0 -0
- /package/dist/client/styles/{aaccda3fa7fb0b1e4c76.css → 07f92cd6237e0c89e05f.css} +0 -0
- /package/dist/client/styles/{a49c8ff1197214b8c2ec.css → 089accd171820ed54ff9.css} +0 -0
- /package/dist/client/styles/{f6cb2798677ada41ec58.css → 093dbadb21acf4310ea2.css} +0 -0
- /package/dist/client/styles/{28fb27bc5806c768b30d.css → 0e8cc6787e102d95ccad.css} +0 -0
- /package/dist/client/styles/{e74cb22d42037309926d.css → 0eccccf491d2d8c15ec2.css} +0 -0
- /package/dist/client/styles/{c4d1c2c8dbf87da6d96f.css → 1262d9eb296be8be48b9.css} +0 -0
- /package/dist/client/styles/{b4b5cb3c5ef635b2c861.css → 1402c958f118bbafb604.css} +0 -0
- /package/dist/client/styles/{79eddfa24c7ea007b464.css → 16a3a76ec493d5af9559.css} +0 -0
- /package/dist/client/styles/{41085f1d73bd0fa3c10a.css → 17bca51c0b3e12105894.css} +0 -0
- /package/dist/client/styles/{7d6b4b7afd5a8bd553da.css → 18be8c33f978d41c810c.css} +0 -0
- /package/dist/client/styles/{72b1acbfc3c9b80b8d0d.css → 1b2ab22235289bb11413.css} +0 -0
- /package/dist/client/styles/{319cce34e32e88725a45.css → 1c048832077af161ca70.css} +0 -0
- /package/dist/client/styles/{7743945180a0c8015dcd.css → 1c32beef3128a72541fd.css} +0 -0
- /package/dist/client/styles/{23ea5cdb4bd00312ad71.css → 1dab8b823a9fc7be9e7d.css} +0 -0
- /package/dist/client/styles/{0f9d4e89ae9e875c4c2c.css → 21cac0ef61086a4aaa44.css} +0 -0
- /package/dist/client/styles/{d43c1005ef0b2e384fdb.css → 23889a0a798b09d499c1.css} +0 -0
- /package/dist/client/styles/{4fdaba171d92a49c5002.css → 2464bcc48b0bd7955c9f.css} +0 -0
- /package/dist/client/styles/{8c72fca95c326a712f69.css → 28f7596c01dff2813e25.css} +0 -0
- /package/dist/client/styles/{4be307902b6682456306.css → 2a0d066c05ce80ef84a2.css} +0 -0
- /package/dist/client/styles/{0fcf11c1fab34c75ad81.css → 34433c129bef8559d83f.css} +0 -0
- /package/dist/client/styles/{973a0d7cba321ac1949b.css → 34c3288e431f8a0155e6.css} +0 -0
- /package/dist/client/styles/{50e356fe6c0b2febc750.css → 378133b962494b0328be.css} +0 -0
- /package/dist/client/styles/{93bde9d3da4e67262071.css → 38875405be2461bf6367.css} +0 -0
- /package/dist/client/styles/{aed199f6a2d99ed2c6ed.css → 38d5589b9158ab8e7423.css} +0 -0
- /package/dist/client/styles/{84222624315dca891314.css → 392a233a558e074c70d9.css} +0 -0
- /package/dist/client/styles/{da2a562048bac8e8d949.css → 3a7baf62722abdc454d6.css} +0 -0
- /package/dist/client/styles/{fda5178de10b894562eb.css → 3a800940b5afb5bfb8f5.css} +0 -0
- /package/dist/client/styles/{f84229a0696a0096e336.css → 3ae3625c5b179d3021e9.css} +0 -0
- /package/dist/client/styles/{9f5ae43cbfda2ce15ad0.css → 3c5baf37fc4cdec110f6.css} +0 -0
- /package/dist/client/styles/{f63eafcdb6b94fd95198.css → 3cf61618bc3263a1c0c9.css} +0 -0
- /package/dist/client/styles/{2b43a99e2018d0c84f18.css → 3ea2352e8a94ddc6dc8a.css} +0 -0
- /package/dist/client/styles/{0918c354e496ebc33a8e.css → 41188d492c5a77d87d02.css} +0 -0
- /package/dist/client/styles/{7818ed43fdcd566ba3f8.css → 41dea7515c49fbb37cd0.css} +0 -0
- /package/dist/client/styles/{e00a7a2a9ee3bd2c34c6.css → 4714fa29a82e1177d216.css} +0 -0
- /package/dist/client/styles/{b5e9ab0705ea5f7c6033.css → 472436c55ce848b6e460.css} +0 -0
- /package/dist/client/styles/{bc8c593bdc7f77961b3e.css → 4a7dd18ce8648d5f3748.css} +0 -0
- /package/dist/client/styles/{d834a244045638c9ae0b.css → 4e6cf740114de50950d7.css} +0 -0
- /package/dist/client/styles/{bdc263d85e27ed0985c8.css → 4fd8ff7fa8b4b36ef6bc.css} +0 -0
- /package/dist/client/styles/{a16667b5a58ef75e0a65.css → 507ccdc5bf81d59adfb1.css} +0 -0
- /package/dist/client/styles/{ec6fd2311481a0dfc9d1.css → 568f78f9b01fc9462683.css} +0 -0
- /package/dist/client/styles/{025902a6e1e60501e418.css → 588b32ff5515fdd5707e.css} +0 -0
- /package/dist/client/styles/{1bb081afaacdf19e137c.css → 59658d2a579def05efa0.css} +0 -0
- /package/dist/client/styles/{093df1d5f4968f1a29eb.css → 59ab7b4a6827442b90c7.css} +0 -0
- /package/dist/client/styles/{cb130f4f9c49c19655e7.css → 59f9a530612b9c11540e.css} +0 -0
- /package/dist/client/styles/{6cf6cc6c2d13bfd50cdd.css → 5bfe1a52e5e438b16b80.css} +0 -0
- /package/dist/client/styles/{f12e8d4deaddb3b26d58.css → 6011db9e93655179bce2.css} +0 -0
- /package/dist/client/styles/{6b46c22ca1c92349b2f8.css → 6198cadc6ef977ea0b7f.css} +0 -0
- /package/dist/client/styles/{fcca4ddacffe3f8cf584.css → 6231f7cde1c1a252e3ff.css} +0 -0
- /package/dist/client/styles/{9eebe67b2504a3c1d87c.css → 6482c0db9dfb95939fd0.css} +0 -0
- /package/dist/client/styles/{4b8ab89e3dadf71a555b.css → 662de3a6d0e84564965f.css} +0 -0
- /package/dist/client/styles/{ea9c40e082d00151bcb2.css → 66d5a4a2cf08cdaa86bb.css} +0 -0
- /package/dist/client/styles/{3339ab53ef97b3ccfa18.css → 69230c65912cdd38a584.css} +0 -0
- /package/dist/client/styles/{c1d9299a2481f61b3e9b.css → 6f579b91d024f526a37f.css} +0 -0
- /package/dist/client/styles/{1b671e76adf446fe7310.css → 6f97d59f13e103648e2b.css} +0 -0
- /package/dist/client/styles/{9987d7d12d1a3b4a8eea.css → 701b3f29f72a42f4ba5b.css} +0 -0
- /package/dist/client/styles/{c826e0cc20a2aa528853.css → 72709ccc1d539e0e7922.css} +0 -0
- /package/dist/client/styles/{71a350a41f111577de16.css → 72b2000e26db0599329e.css} +0 -0
- /package/dist/client/styles/{756275c6e26971186a7e.css → 7462753f35b4eef9f539.css} +0 -0
- /package/dist/client/styles/{0d44aeaf665b9f76f1a3.css → 746da613bad15ee3dcff.css} +0 -0
- /package/dist/client/styles/{1d1abb5e5dbc59ef9ba2.css → 74ecbb4b7b820d191d79.css} +0 -0
- /package/dist/client/styles/{c2657529f0bd72c822ab.css → 7a555f60e9828f5791c4.css} +0 -0
- /package/dist/client/styles/{b3866bf38c79001bc962.css → 7e388f3275fdd4ba4d75.css} +0 -0
- /package/dist/client/styles/{06e2a0dd3335dfc0e506.css → 804a497cb44fe949310e.css} +0 -0
- /package/dist/client/styles/{64040fe43c85229d6c7e.css → 815b2ba5fab54eebb5ca.css} +0 -0
- /package/dist/client/styles/{d7be84839eb13c10994d.css → 84e8cb222b65ef8c7fd7.css} +0 -0
- /package/dist/client/styles/{d45a491bd98ee16dc921.css → 8537711ac020c8f29676.css} +0 -0
- /package/dist/client/styles/{18b8732facc297fa275d.css → 86714d804290b9ba22f6.css} +0 -0
- /package/dist/client/styles/{62f5709eb7cf0bee5308.css → 86814331153df2f74cb1.css} +0 -0
- /package/dist/client/styles/{09b087ec0d366e0f4aab.css → 8773147ebc61bee2e1a6.css} +0 -0
- /package/dist/client/styles/{f0a6732b51fe9c604843.css → 87bf4ef1e4c910a2c137.css} +0 -0
- /package/dist/client/styles/{ced4071f764fa201e664.css → 88a48eba61706a1b38f7.css} +0 -0
- /package/dist/client/styles/{4f227cf9d210a351d684.css → 88b02946d875717c7892.css} +0 -0
- /package/dist/client/styles/{5e9e07ef4ddc7059f769.css → 89abc7e3a5eecf6b6014.css} +0 -0
- /package/dist/client/styles/{2847077fc8b21eea9bc7.css → 8bbb03cef27adbf1052c.css} +0 -0
- /package/dist/client/styles/{ede70c2797449c4d51a6.css → 914125d34a0c8421839d.css} +0 -0
- /package/dist/client/styles/{230561f40b218ce33aa3.css → 91501cfefb3e9beeffa4.css} +0 -0
- /package/dist/client/styles/{9212fa0c23e7fbc74fb7.css → 91f5a130ef63276c95f1.css} +0 -0
- /package/dist/client/styles/{0fc32c57e4b4c007d86e.css → 92e2f55c77c0b9473c56.css} +0 -0
- /package/dist/client/styles/{6995a6a5607ccfaef630.css → 92f88dfc1b040e6657db.css} +0 -0
- /package/dist/client/styles/{943c207eed1ff2aa3f4b.css → 9324abfa574340eb6ede.css} +0 -0
- /package/dist/client/styles/{d8cfe1555b7bcbacdef5.css → 96fcf998bf85267cee36.css} +0 -0
- /package/dist/client/styles/{39ba7e46913442fd36d3.css → 980215f15338a4638935.css} +0 -0
- /package/dist/client/styles/{ff3f98b95580dd1fde4c.css → 9865e2574c6d07158054.css} +0 -0
- /package/dist/client/styles/{2bac5c7960d4e0987bf3.css → 99f43c4c4a9704f957a9.css} +0 -0
- /package/dist/client/styles/{f25db0c188d1d6ae7dd7.css → 9c4c4822a484f5a5ad19.css} +0 -0
- /package/dist/client/styles/{108eacd965f43203b161.css → a1f8e3bd33feb4f2ab92.css} +0 -0
- /package/dist/client/styles/{68395bfe89565e0d1d79.css → a451e339bbbf4c755dd2.css} +0 -0
- /package/dist/client/styles/{a06a68636bc8161710b5.css → a6d598ec76e67174f994.css} +0 -0
- /package/dist/client/styles/{df5930c5f79402892064.css → a712d2e04a1b916faca6.css} +0 -0
- /package/dist/client/styles/{7016d8a61690a15d03f9.css → a74cc1abc33d10c98576.css} +0 -0
- /package/dist/client/styles/{170ca751557782434b86.css → a9887918f6748e99e5e6.css} +0 -0
- /package/dist/client/styles/{eba32e7258bb2a7a1a2a.css → a98a1c78a6e495be1fe3.css} +0 -0
- /package/dist/client/styles/{b55e02a32d90c14f4cbe.css → ab31c58b4b87e68b35fb.css} +0 -0
- /package/dist/client/styles/{373129c3f6ff64209b21.css → ada91090ef1c52557dc9.css} +0 -0
- /package/dist/client/styles/{beaf345e668e5858c6bd.css → ae547edbc8099702ba5a.css} +0 -0
- /package/dist/client/styles/{f30fbd3d7d6421ff0d75.css → ae596ff1996c280c202c.css} +0 -0
- /package/dist/client/styles/{9742df9b3b105d4cc277.css → affc2dc765c1741a7319.css} +0 -0
- /package/dist/client/styles/{467ccdae7bcc2a1615bb.css → b5213fdbef77370db82d.css} +0 -0
- /package/dist/client/styles/{a596a627aca89f5a6b1b.css → b78748f9969f7ea74694.css} +0 -0
- /package/dist/client/styles/{43342b3ad25af480ac21.css → b7cc5ee25c7302916b09.css} +0 -0
- /package/dist/client/styles/{77c36fabf7d4d9192e6c.css → b85d75a825b35c37debd.css} +0 -0
- /package/dist/client/styles/{e9e73c7dd25549beb2ce.css → b9cb221f563e1ae97305.css} +0 -0
- /package/dist/client/styles/{a73fba74b9519c977182.css → ba8379f7349980eced6b.css} +0 -0
- /package/dist/client/styles/{7164a0309a6e67669529.css → bb8f78fd21453a818715.css} +0 -0
- /package/dist/client/styles/{49ea1362a407d332ae50.css → bbb212b4be125e838441.css} +0 -0
- /package/dist/client/styles/{80006a5fec335cb12b7c.css → becfc64a7cf18580f64b.css} +0 -0
- /package/dist/client/styles/{80cddc196cc2b7002fd6.css → bf0781d3e1fda7aaf432.css} +0 -0
- /package/dist/client/styles/{5a9f3609f8449b952b64.css → c07d2bb6aab9b5629d10.css} +0 -0
- /package/dist/client/styles/{e73bc57a96ce8bc9f24d.css → c0916ba3df82723ef6e2.css} +0 -0
- /package/dist/client/styles/{7e03a5d5a40ed66af4c5.css → c2c11ce041704882fd38.css} +0 -0
- /package/dist/client/styles/{12c214803bb856eac25e.css → c3622d52d3929b8ce67a.css} +0 -0
- /package/dist/client/styles/{565fe0111bdfe1faa81b.css → d014754e0eff762e6ca9.css} +0 -0
- /package/dist/client/styles/{ca534726c8438931e48c.css → d2b70350d3fa2cef0e39.css} +0 -0
- /package/dist/client/styles/{29fe5285a5534638e45b.css → d307d2e9cf655c179d77.css} +0 -0
- /package/dist/client/styles/{18a0554f2d6d9bb11db8.css → d4fdfca319e908a2c80a.css} +0 -0
- /package/dist/client/styles/{91f3984e40032bf924c1.css → d649ff9550b197262c78.css} +0 -0
- /package/dist/client/styles/{7880369871d8c84cd0e7.css → d7a62916cee4d6e2b444.css} +0 -0
- /package/dist/client/styles/{c62b762778316d2d5162.css → d7e1b77c4b3b1491114a.css} +0 -0
- /package/dist/client/styles/{b8910302df4d99f32bab.css → d8f36385fae4848561e8.css} +0 -0
- /package/dist/client/styles/{52a3b97165f405e63efb.css → d92b71a6a05b8f554c7e.css} +0 -0
- /package/dist/client/styles/{bedf2af0b7bfe31d6095.css → db8435e74ec6a4493db1.css} +0 -0
- /package/dist/client/styles/{4ad5d822d9c447ec26c9.css → dba10c026b8321623d2e.css} +0 -0
- /package/dist/client/styles/{e82db7ecb8bd18986174.css → dca2c65879ee8c6fe5e7.css} +0 -0
- /package/dist/client/styles/{0c6dfbf036b0371160cd.css → dd51706886e16b5f97be.css} +0 -0
- /package/dist/client/styles/{29592daed7085fae2aff.css → ddc4d2ea575a50bc4ae3.css} +0 -0
- /package/dist/client/styles/{69942f55e3b5bf6d503b.css → df120b5d2932d752a788.css} +0 -0
- /package/dist/client/styles/{8fb6347aacc0d7a6e455.css → df56e8276b6973df6c3c.css} +0 -0
- /package/dist/client/styles/{2f1b8a7fe67255cbe0ad.css → dfab0d5501435b36f6fb.css} +0 -0
- /package/dist/client/styles/{6e83cdb8cf4a81b04610.css → e0ae6eb532e9deca95b9.css} +0 -0
- /package/dist/client/styles/{05a1efe07f04c478155a.css → e0c5487ea1f49ba55654.css} +0 -0
- /package/dist/client/styles/{5ca596aa3d93347cb166.css → e2b91f9e13b86ff8389c.css} +0 -0
- /package/dist/client/styles/{ba513ff26457b9efc034.css → e5f69ed9d3c641d5cfeb.css} +0 -0
- /package/dist/client/styles/{52c515514b241f01e737.css → e600798c21b1e4b3421a.css} +0 -0
- /package/dist/client/styles/{c4948b2ac58d29eb2600.css → e794fc5005c252318257.css} +0 -0
- /package/dist/client/styles/{c3527a51540c796aa210.css → e7b33c7b9c52aa2c42fb.css} +0 -0
- /package/dist/client/styles/{b97f6a6153af68b5ee51.css → e8d5c21e03e6d57b5511.css} +0 -0
- /package/dist/client/styles/{08755652b19e4b8cc3a6.css → e949a288ca740fd5e306.css} +0 -0
- /package/dist/client/styles/{23e7e7801052da2ee7b1.css → e97cb8c56d2e5ca10a9b.css} +0 -0
- /package/dist/client/styles/{2ddd806af85bc2956424.css → eb3bd92efead362fbc2c.css} +0 -0
- /package/dist/client/styles/{cbaada8722a80b6bdaa1.css → eb3e702cdad4fa098d02.css} +0 -0
- /package/dist/client/styles/{d9005ebbf3356c0044d1.css → ebde9babb291ce858d18.css} +0 -0
- /package/dist/client/styles/{d4b9f2074063ed7456f0.css → ed4b2bf33dda868c13ee.css} +0 -0
- /package/dist/client/styles/{454827facac3a7b5372d.css → eeaf7a5064376c23e2fd.css} +0 -0
- /package/dist/client/styles/{327234381f9055359003.css → efe4a3c8ab1adefc03f2.css} +0 -0
- /package/dist/client/styles/{652a5b87c018e27253cb.css → f16221d99c87c834338d.css} +0 -0
- /package/dist/client/styles/{02cd01e4087e8d5aa492.css → f1fc1db1d8256f3c8b0f.css} +0 -0
- /package/dist/client/styles/{5fe5fed299dd1686d8b6.css → f2995c12e4c7d9beeedc.css} +0 -0
- /package/dist/client/styles/{cb7718d9829f07833d01.css → f2ef165911bb1b115aad.css} +0 -0
- /package/dist/client/styles/{147acfad2826cadced1c.css → f75efc7d112f59f0bf9c.css} +0 -0
- /package/dist/client/styles/{ba92be8988f6e7cd5e6f.css → fddbb5023e794ab0f98a.css} +0 -0
- /package/dist/client/styles/{c033ed6d46bc42084b33.css → ff80131a5bed70291e0b.css} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("./LoadingSpinner-JuocvxQq.js"),R=require("vue"),Jo=require("pinia");let Ua=null;typeof window<"u"&&(Ua=document.currentScript);const Hd={options:{div:"map",logo:"os-logo-maps",statement:"Contains OS data © Crown copyright and database rights YYYY",prefix:"",suffix:""},init(m){if(typeof window<"u"){Ua&&(this.options.div=Ua.getAttribute("data-div")||this.options.div,this.options.logo=Ua.getAttribute("data-logo")||this.options.logo,this.options.statement=Ua.getAttribute("data-statement")||this.options.statement,this.options.prefix=Ua.getAttribute("data-prefix")||this.options.prefix,this.options.suffix=Ua.getAttribute("data-suffix")||this.options.suffix),m=typeof m<"u"?m:{},Object.assign(this.options,m);const d=document.getElementById(this.options.div);let b="os-api-branding logo";this.options.logo==="os-logo-maps-white"&&(b="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=b,d.appendChild(O);const G=document.createElement("div");G.className="os-api-branding copyright",G.innerHTML=M,d.appendChild(G)}}},$i=Jo.defineStore("map",()=>{const m=R.ref([]),d=R.ref([]),b=R.ref(null),M=R.ref(null),O=R.ref(null);function G(Re){m.value.push({id:Re.id,filters:Re.filters,places:Re.places,activePins:Re.activePins,hovered:"",activePlace:null})}function l(Re){m.value.forEach(Ye=>{Ye.id===Re.mapId&&(Ye.hovered=Re.hoveredFeature)})}function ae(Re){m.value.forEach(Ye=>{Ye.id===Re.mapId&&(Ye.activePlace=Re.activeFeature)})}function W(Re){d.value=Re}function ve(Re){b.value=Re}function me(Re){M.value=Re}function Le(Re){return m.value.find(Ye=>Ye.id===Re)}function le(Re){return m.value.find(je=>je.id===Re).hovered}function ge(Re){return m.value.find(je=>je.id===Re).activePlace}return{maps:m,activeSubcatFilters:d,selectedSubCategory:b,activeMarkerPos:M,activePlace:O,addMapInstance:G,setHoveredPlace:l,setActivePlace:ae,setActiveSubcatFilters:W,setSelectedSubcat:ve,setActiveMarkerPos:me,getMapById:Le,getHoveredStop:le,getActivePlace:ge}});var av={exports:{}};(function(m,d){(function(b,M){m.exports=M()})(Y.commonjsGlobal,function(){var b,M,O;function G(l,ae){if(!b)b=ae;else if(!M)M=ae;else{var W="var sharedChunk = {}; ("+b+")(sharedChunk); ("+M+")(sharedChunk);",ve={};b(ve),O=ae(ve),typeof window<"u"&&(O.workerUrl=window.URL.createObjectURL(new Blob([W],{type:"text/javascript"})))}}return G(["exports"],function(l){function ae(e,t){return e(t={exports:{}},t.exports),t.exports}var W=ve;function ve(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}ve.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},ve.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},ve.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},ve.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 v=this.sampleCurveDerivativeX(u);if(Math.abs(v)<1e-6)break;u-=c/v}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},ve.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var me=Le;function Le(e,t){this.x=e,this.y=t}Le.prototype={clone:function(){return new Le(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}},Le.convert=function(e){return e instanceof Le?e:Array.isArray(e)?new Le(e[0],e[1]):e};var le=typeof self<"u"?self:{},ge=Math.pow(2,53)-1;function Re(e,t,r,a){var u=new W(e,t,r,a);return function(c){return u.solve(c)}}var Ye=Re(.25,.1,.25,1);function je(e,t,r){return Math.min(r,Math.max(t,e))}function It(e,t,r){var a=r-t,u=((e-t)%a+a)%a+t;return u===t?r:u}function tt(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 dt=1;function Dt(){return dt++}function Xt(){return function e(t){return t?(t^16*Math.random()>>t/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}()}function Kt(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 ur(e,t){e.forEach(function(r){t[r]&&(t[r]=t[r].bind(t))})}function Sr(e,t){return e.indexOf(t,e.length-t.length)!==-1}function cr(e,t,r){var a={};for(var u in e)a[u]=t.call(r||this,e[u],u,e);return a}function Xr(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 gr(e){return Array.isArray(e)?e.map(gr):typeof e=="object"&&e?cr(e,gr):e}var gi={};function Lt(e){gi[e]||(typeof console<"u"&&console.warn(e),gi[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 v=c||h;return t[u]=!v||v.toLowerCase(),""}),t["max-age"]){var r=parseInt(t["max-age"],10);isNaN(r)?delete t["max-age"]:t["max-age"]=r}return t}var Ao=null;function ja(e){if(Ao==null){var t=e.navigator?e.navigator.userAgent:null;Ao=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return Ao}function dn(e){try{var t=le[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch{return!1}}var Bi,Zi,qn,jn,mn=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:mn,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 Bi||(Bi=le.document.createElement("a")),Bi.href=e,Bi.href},hardwareConcurrency:le.navigator&&le.navigator.hardwareConcurrency||4,get devicePixelRatio(){return le.devicePixelRatio},get prefersReducedMotion(){return!!le.matchMedia&&(Zi==null&&(Zi=le.matchMedia("(prefers-reduced-motion: reduce)")),Zi.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},Gi={supported:!1,testSupport:function(e){!Eo&&jn&&(Di?yt(e):qn=e)}},Eo=!1,Di=!1;function yt(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,jn),e.isContextLost())return;Gi.supported=!0}catch{}e.deleteTexture(t),Eo=!0}le.document&&((jn=le.document.createElement("img")).onload=function(){qn&&yt(qn),qn=null,Di=!0},jn.onerror=function(){Eo=!0,qn=null},jn.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var yn="01",Kr=function(e,t){this._transformRequestFn=e,this._customAccessToken=t,this._createSkuToken()};function _i(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",yn,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(!_i(e))return e;var r=xi(e);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},Kr.prototype.normalizeGlyphsURL=function(e,t){if(!_i(e))return e;var r=xi(e);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},Kr.prototype.normalizeSourceURL=function(e,t){if(!_i(e))return e;var r=xi(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=xi(e);return _i(e)?(u.path="/styles/v1"+u.path+"/sprite"+t+r,this._makeAPIURL(u,this._customAccessToken||a)):(u.path+=""+t+r,$n(u))},Kr.prototype.normalizeTileURL=function(e,t){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!_i(e))return e;var r=xi(e);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(rn.devicePixelRatio>=2||t===512?"@2x":"")+(Gi.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 v=h[c].match(/^access_token=(.*)$/);if(v)return v[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=xi(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&&_i(t),a=[],u=0,c=e.tiles||[];u<c.length;u+=1){var h=c[u];Li(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=xi(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 $n(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),$n(e)};var Js=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Li(e){return Js.test(e)}var ta=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function xi(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 $n(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 bi=function(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};bi.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},bi.prototype.fetchEventData=function(){var e=dn("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")}},bi.prototype.saveEventData=function(){var e=dn("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")}},bi.prototype.processRequests=function(e){},bi.prototype.postEvent=function(e,t,r,a){var u=this;if(Rt.EVENTS_URL){var c=xi(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:yn,userId:this.anonId},v=t?tt(h,t):h,_={url:$n(c),headers:{"Content-Type":"text/plain"},body:JSON.stringify([v])};this.pendingRequest=rr(_,function(x){u.pendingRequest=null,r(x),u.saveEventData(),u.processRequests(a)})}},bi.prototype.queueRequest=function(e,t){this.queue.push(e),this.processRequests(t)};var wi,Zn,Ri=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),v=Array.isArray(r)&&r.some(function(_){return _i(_)||Li(_)});Rt.EVENTS_URL&&h&&v&&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(),Kt(this.anonId)||(this.anonId=Xt()),this.postEvent(h,{skuToken:this.skuToken},function(v){v||c&&(a.success[c]=!0)},r))}},t}(bi),$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 _i(u)||Li(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;Kt(this.anonId)||(this.anonId=Xt(),h=!0);var v=this.queue.shift();if(this.eventData.lastSuccess){var _=new Date(this.eventData.lastSuccess),x=new Date(v),S=(v-this.eventData.lastSuccess)/864e5;h=h||S>=1||S<-1||_.getDate()!==x.getDate()}else h=!0;if(!h)return this.processRequests();this.postEvent(v,{"enabled.telemetry":!1},function(T){T||(a.eventData.lastSuccess=v,a.eventData.tokenU=c)},r)}},t}(bi)),Za=$a.postTurnstileEvent.bind($a),ra=new Ri,ia=ra.postMapLoadEvent.bind(ra),Po=500,Ga=50;function ko(){le.caches&&!wi&&(wi=le.caches.open("mapbox-tiles"))}function na(e){var t=e.indexOf("?");return t<0?e:e.slice(0,t)}var Gn,oa=1/0;function aa(){return Gn==null&&(Gn=le.OffscreenCanvas&&new le.OffscreenCanvas(1,1).getContext("2d")&&typeof le.createImageBitmap=="function"),Gn}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 Ha=function(e){function t(r,a,u){a===401&&Li(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),Wn=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(Wn())&&!/^\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,v=new le.Request(a.url,{method:a.method||"GET",body:a.body,credentials:a.credentials,headers:a.headers,referrer:Wn(),signal:h.signal}),_=!1,x=!1,S=(c=v.url).indexOf("sku=")>0&&Li(c);a.type==="json"&&v.headers.set("Accept","application/json");var T=function(k,U,N){if(!x){if(k&&k.message!=="SecurityError"&&Lt(k),U&&N)return E(U);var J=Date.now();le.fetch(v).then(function(H){if(H.ok){var re=S?H.clone():null;return E(H,re,J)}return u(new Ha(H.statusText,H.status,a.url))}).catch(function(H){H.code!==20&&u(new Error(H.message))})}},E=function(k,U,N){(a.type==="arrayBuffer"?k.arrayBuffer():a.type==="json"?k.json():k.text()).then(function(J){x||(U&&N&&function(H,re,oe){if(ko(),wi){var se={status:re.status,statusText:re.statusText,headers:new le.Headers};re.headers.forEach(function(ye,Se){return se.headers.set(Se,ye)});var ce=Io(re.headers.get("Cache-Control")||"");ce["no-store"]||(ce["max-age"]&&se.headers.set("Expires",new Date(oe+1e3*ce["max-age"]).toUTCString()),new Date(se.headers.get("Expires")).getTime()-oe<42e4||function(ye,Se){if(Zn===void 0)try{new Response(new ReadableStream),Zn=!0}catch{Zn=!1}Zn?Se(ye.body):ye.blob().then(Se)}(re,function(ye){var Se=new le.Response(ye,se);ko(),wi&&wi.then(function(Ae){return Ae.put(na(H.url),Se)}).catch(function(Ae){return Lt(Ae.message)})}))}}(v,U,N),_=!0,u(null,J,k.headers.get("Cache-Control"),k.headers.get("Expires")))}).catch(function(J){x||u(new Error(J.message))})};return S?function(k,U){if(ko(),!wi)return U(null);var N=na(k.url);wi.then(function(J){J.match(N).then(function(H){var re=function(oe){if(!oe)return!1;var se=new Date(oe.headers.get("Expires")||0),ce=Io(oe.headers.get("Cache-Control")||"");return se>Date.now()&&!ce["no-cache"]}(H);J.delete(N),re&&J.put(N,H.clone()),U(null,H,re)}).catch(U)}).catch(U)}(v,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 v=c.response;if(a.type==="json")try{v=JSON.parse(c.response)}catch(_){return u(_)}u(null,v,c.getResponseHeader("Cache-Control"),c.getResponseHeader("Expires"))}else u(new Ha(c.statusText,c.status,a.url))},c.send(a.body),{cancel:function(){return c.abort()}}}(e,t)},sa=function(e,t){return Mo(tt(e,{type:"arrayBuffer"}),t)},rr=function(e,t){return Mo(tt(e,{method:"POST"}),t)},I="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";nn=[],on=0;var C=function(e,t){if(Gi.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=C(h.requestParameters,h.callback).cancel)}},c=sa(e,function(h,v,_,x){u(),h?t(h):v&&(aa()?function(S,T){var E=new le.Blob([new Uint8Array(S)],{type:"image/png"});le.createImageBitmap(E).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."))})}(v,t):function(S,T,E,k){var U=new le.Image,N=le.URL;U.onload=function(){T(null,U),N.revokeObjectURL(U.src),U.onload=null,le.requestAnimationFrame(function(){U.src=I})},U.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 J=new le.Blob([new Uint8Array(S)],{type:"image/png"});U.cacheControl=E,U.expires=k,U.src=S.byteLength?N.createObjectURL(J):I}(v,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={}),tt(this,t),this.type=e},Q=function(e){function t(r,a){a===void 0&&(a={}),e.call(this,"error",tt({error:r},a))}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(j),te=function(){};te.prototype.on=function(e,t){return this._listeners=this._listeners||{},P(e,t,this._listeners),this},te.prototype.off=function(e,t){return F(e,t,this._listeners),F(e,t,this._oneTimeListeners),this},te.prototype.once=function(e,t){return this._oneTimeListeners=this._oneTimeListeners||{},P(e,t,this._oneTimeListeners),this},te.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 v=h[c];F(r,v,this._oneTimeListeners),v.call(this,e)}var _=this._eventedParent;_&&(tt(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),_.fire(e))}else e instanceof Q&&console.error(e.error);return this},te.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)},te.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"}}},Z=function(e,t,r,a){this.message=(e?e+": ":"")+r,a&&(this.identifier=a),t!=null&&t.__line__&&(this.line=t.__line__)};function ne(e){var t=e.value;return t?[new Z(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"},Be={kind:"string"},Ee={kind:"boolean"},Pe={kind:"color"},ut={kind:"object"},Me={kind:"value"},vt={kind:"collator"},Ft={kind:"formatted"},pt={kind:"resolvedImage"};function At(e,t){return{kind:"array",itemType:e,N:t}}function _t(e){if(e.kind==="array"){var t=_t(e.itemType);return typeof e.N=="number"?"array<"+t+", "+e.N+">":e.itemType.kind==="value"?"array":"array<"+t+">"}return e.kind}var Ur=[Oe,de,Be,Ee,Pe,Ft,ut,At(Me),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=Ur;r<a.length;r+=1)if(!Pt(a[r],t))return null}}return"Expected "+_t(e)+" but found "+_t(t)+" instead."}function ir(e,t){return t.some(function(r){return r.kind===e.kind})}function zt(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 mt=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(v){return(v=Math.round(v))<0?0:v>255?255:v}function u(v){return a(v[v.length-1]==="%"?parseFloat(v)/100*255:parseInt(v))}function c(v){return(_=v[v.length-1]==="%"?parseFloat(v)/100:parseFloat(v))<0?0:_>1?1:_;var _}function h(v,_,x){return x<0?x+=1:x>1&&(x-=1),6*x<1?v+(_-v)*x*6:2*x<1?_:3*x<2?v+(_-v)*(2/3-x)*6:v}try{t.parseCSSColor=function(v){var _,x=v.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 S=x.indexOf("("),T=x.indexOf(")");if(S!==-1&&T+1===x.length){var E=x.substr(0,S),k=x.substr(S+1,T-(S+1)).split(","),U=1;switch(E){case"rgba":if(k.length!==4)return null;U=c(k.pop());case"rgb":return k.length!==3?null:[u(k[0]),u(k[1]),u(k[2]),U];case"hsla":if(k.length!==4)return null;U=c(k.pop());case"hsl":if(k.length!==3)return null;var N=(parseFloat(k[0])%360+360)%360/360,J=c(k[1]),H=c(k[2]),re=H<=.5?H*(J+1):H+J-H*J,oe=2*H-re;return[a(255*h(oe,re,N+1/3)),a(255*h(oe,re,N)),a(255*h(oe,re,N-1/3)),U];default:return null}}return null}}catch{}}).parseCSSColor,Et=function(e,t,r,a){a===void 0&&(a=1),this.r=e,this.g=t,this.b=r,this.a=a};Et.parse=function(e){if(e){if(e instanceof Et)return e;if(typeof e=="string"){var t=mt(e);if(t)return new Et(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}},Et.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+")"},Et.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]},Et.black=new Et(0,0,0,1),Et.white=new Et(1,1,1,1),Et.transparent=new Et(0,0,0,0),Et.red=new Et(1,0,0,1);var Jr=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"})};Jr.prototype.compare=function(e,t){return this.collator.compare(e,t)},Jr.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 Yr=function(e){this.name=e.name,this.available=e.available};function Ys(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 Et||e instanceof Jr||e instanceof Ir||e instanceof Yr)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 nr(e){if(e===null)return Oe;if(typeof e=="string")return Be;if(typeof e=="boolean")return Ee;if(typeof e=="number")return de;if(e instanceof Et)return Pe;if(e instanceof Jr)return vt;if(e instanceof Ir)return Ft;if(e instanceof Yr)return pt;if(Array.isArray(e)){for(var t,r=e.length,a=0,u=e;a<u.length;a+=1){var c=nr(u[a]);if(t){if(t===c)continue;t=Me;break}t=c}return At(t||Me,r)}return ut}function ca(e){var t=typeof e;return e===null?"":t==="string"||t==="number"||t==="boolean"?String(e):e instanceof Et||e instanceof Ir||e instanceof Yr?e.toString():JSON.stringify(e)}Yr.prototype.toString=function(){return this.name},Yr.fromString=function(e){return e?new Yr({name:e,available:!1}):null},Yr.prototype.serialize=function(){return["image",this.name]};var Nr=function(e,t){this.type=e,this.value=t};Nr.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=nr(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 Nr(a,r)},Nr.prototype.evaluate=function(){return this.value},Nr.prototype.eachChild=function(){},Nr.prototype.outputDefined=function(){return!0},Nr.prototype.serialize=function(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Et?["rgba"].concat(this.value.toArray()):this.value instanceof Ir?this.value.serialize():this.value};var Ar=function(e){this.name="ExpressionEvaluationError",this.message=e};Ar.prototype.toJSON=function(){return this.message};var Si={string:Be,number:de,boolean:Ee,object:ut},$t=function(e,t){this.type=e,this.args=t};$t.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 v=e[1];if(typeof v!="string"||!(v in Si)||v==="object")return t.error('The item type argument of "array" must be one of string, number, boolean',1);c=Si[v],a++}else c=Me;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=At(c,h)}else r=Si[u];for(var _=[];a<e.length;a++){var x=t.parse(e[a],a,Me);if(!x)return null;_.push(x)}return new $t(r,_)},$t.prototype.evaluate=function(e){for(var t=0;t<this.args.length;t++){var r=this.args[t].evaluate(e);if(!Pt(this.type,nr(r)))return r;if(t===this.args.length-1)throw new Ar("Expected value to be of type "+_t(this.type)+", but found "+_t(nr(r))+" instead.")}return null},$t.prototype.eachChild=function(e){this.args.forEach(e)},$t.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},$t.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 Fi=function(e){this.type=Ft,this.sections=e};Fi.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 v=null;if(h["font-scale"]&&!(v=t.parse(h["font-scale"],1,de)))return null;var _=null;if(h["text-font"]&&!(_=t.parse(h["text-font"],1,At(Be))))return null;var x=null;if(h["text-color"]&&!(x=t.parse(h["text-color"],1,Pe)))return null;var S=a[a.length-1];S.scale=v,S.font=_,S.textColor=x}else{var T=t.parse(e[c],1,Me);if(!T)return null;var E=T.type.kind;if(E!=="string"&&E!=="value"&&E!=="null"&&E!=="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 Fi(a)},Fi.prototype.evaluate=function(e){return new Ir(this.sections.map(function(t){var r=t.content.evaluate(e);return nr(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)}))},Fi.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)}},Fi.prototype.outputDefined=function(){return!1},Fi.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 hi=function(e){this.type=pt,this.input=e};hi.parse=function(e,t){if(e.length!==2)return t.error("Expected two arguments.");var r=t.parse(e[1],1,Be);return r?new hi(r):t.error("No image name provided.")},hi.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=Yr.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r},hi.prototype.eachChild=function(e){e(this.input)},hi.prototype.outputDefined=function(){return!1},hi.prototype.serialize=function(){return["image",this.input.serialize()]};var iu={"to-boolean":Ee,"to-color":Pe,"to-number":de,"to-string":Be},Ti=function(e,t){this.type=e,this.args=t};Ti.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=iu[r],u=[],c=1;c<e.length;c++){var h=t.parse(e[c],c,Me);if(!h)return null;u.push(h)}return new Ti(a,u)},Ti.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 Et)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.":Ys(t[0],t[1],t[2],t[3])))return new Et(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Ar(r||"Could not parse color from value '"+(typeof t=="string"?t:String(JSON.stringify(t)))+"'")}if(this.type.kind==="number"){for(var h=null,v=0,_=this.args;v<_.length;v+=1){if((h=_[v].evaluate(e))===null)return 0;var x=Number(h);if(!isNaN(x))return x}throw new Ar("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"?Yr.fromString(ca(this.args[0].evaluate(e))):ca(this.args[0].evaluate(e))},Ti.prototype.eachChild=function(e){this.args.forEach(e)},Ti.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},Ti.prototype.serialize=function(){if(this.type.kind==="formatted")return new Fi([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new hi(this.args[0]).serialize();var e=["to-"+this.type.kind];return this.eachChild(function(t){e.push(t.serialize())}),e};var jc=["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"?jc[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]=Et.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,v=h.filter(function(We){var ze=We[0];return!Array.isArray(ze)||ze.length===e.length-1}),_=null,x=0,S=v;x<S.length;x+=1){var T=S[x],E=T[0],k=T[1];_=new xn(t.registry,t.path,null,t.scope);for(var U=[],N=!1,J=1;J<e.length;J++){var H=e[J],re=Array.isArray(E)?E[J-1]:E.type,oe=_.parse(H,1+U.length,re);if(!oe){N=!0;break}U.push(oe)}if(!N)if(Array.isArray(E)&&E.length!==U.length)_.error("Expected "+E.length+" arguments, but found "+U.length+" instead.");else{for(var se=0;se<U.length;se++){var ce=Array.isArray(E)?E[se]:E.type,ye=U[se];_.concat(se+1).checkSubtype(ce,ye.type)}if(_.errors.length===0)return new zr(a,c,k,U)}}if(v.length===1)(r=t.errors).push.apply(r,_.errors);else{for(var Se=(v.length?v:h).map(function(We){var ze;return ze=We[0],Array.isArray(ze)?"("+ze.map(_t).join(", ")+")":"("+_t(ze.type)+"...)"}).join(" | "),Ae=[],$e=1;$e<e.length;$e++){var ke=t.parse(e[$e],1+Ae.length);if(!ke)return null;Ae.push(_t(ke.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 Wi=function(e,t,r){this.type=vt,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 $c(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 Zc(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,v,_,x=!1,S=0,T=t.length;S<T;S++)for(var E=t[S],k=0,U=E.length;k<U-1;k++){if((c=(r=e)[0]-(a=E[k])[0])*(_=r[1]-(u=E[k+1])[1])-(v=r[0]-u[0])*(h=r[1]-a[1])==0&&c*v<=0&&h*_<=0)return!1;Zc(e,E[k],E[k+1])&&(x=!x)}return x}function Gc(e,t){for(var r=0;r<t.length;r++)if(Qs(e,t[r]))return!0;return!1}function nu(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]),v=(t[0]-r[0])*c-u*(t[1]-r[1]);return h>0&&v<0||h<0&&v>0}function Wc(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=[(S=c[h+1])[0]-(x=c[h])[0],S[1]-x[1]])[0]*(E=[(_=t)[0]-(v=e)[0],_[1]-v[1]])[1]-T[1]*E[0]!=0&&nu(v,_,x,S)&&nu(x,S,v,_))return!0;var v,_,x,S,T,E;return!1}function ou(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(Wc(e[a],e[a+1],t))return!1;return!0}function au(e,t){for(var r=0;r<t.length;r++)if(ou(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 v=$c(e[u][h],r);qr(t,v),c.push(v)}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 su(e,t,r,a){for(var u=8192*Math.pow(2,a.z),c=[8192*a.x,8192*a.y],h=[],v=0,_=e;v<_.length;v+=1)for(var x=0,S=_[v];x<S.length;x+=1){var T=S[x],E=[T.x+c[0],T.y+c[1]];pa(E,t,r,u),h.push(E)}return h}function Xa(e,t,r,a){for(var u,c=8192*Math.pow(2,a.z),h=[8192*a.x,8192*a.y],v=[],_=0,x=e;_<x.length;_+=1){for(var S=[],T=0,E=x[_];T<E.length;T+=1){var k=E[T],U=[k.x+h[0],k.y+h[1]];qr(t,U),S.push(U)}v.push(S)}if(t[2]-t[0]<=c/2){(u=t)[0]=u[1]=1/0,u[2]=u[3]=-1/0;for(var N=0,J=v;N<J.length;N+=1)for(var H=0,re=J[N];H<re.length;H+=1)pa(re[H],t,r,c)}return v}Wi.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,Ee);if(!a)return null;var u=t.parse(r["diacritic-sensitive"]!==void 0&&r["diacritic-sensitive"],1,Ee);if(!u)return null;var c=null;return r.locale&&!(c=t.parse(r.locale,1,Be))?null:new Wi(a,u,c)},Wi.prototype.evaluate=function(e){return new Jr(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)},Wi.prototype.eachChild=function(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)},Wi.prototype.outputDefined=function(){return!1},Wi.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 Ii=function(e,t){this.type=Ee,this.geojson=e,this.geometries=t};function vn(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 Ii)return!1;var t=!0;return e.eachChild(function(r){t&&!vn(r)&&(t=!1)}),t}function gn(e){if(e instanceof zr&&e.name==="feature-state")return!1;var t=!0;return e.eachChild(function(r){t&&!gn(r)&&(t=!1)}),t}function Xn(e,t){if(e instanceof zr&&t.indexOf(e.name)>=0)return!1;var r=!0;return e.eachChild(function(a){r&&!Xn(a,t)&&(r=!1)}),r}Ii.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 Ii(r,r.features[a].geometry)}else if(r.type==="Feature"){var c=r.geometry.type;if(c==="Polygon"||c==="MultiPolygon")return new Ii(r,r.geometry)}else if(r.type==="Polygon"||r.type==="MultiPolygon")return new Ii(r,r)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Ii.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),v=su(t.geometry(),a,u,c);if(!Hn(a,u))return!1;for(var _=0,x=v;_<x.length;_+=1)if(!Qs(x[_],h))return!1}if(r.type==="MultiPolygon"){var S=el(r.coordinates,u,c),T=su(t.geometry(),a,u,c);if(!Hn(a,u))return!1;for(var E=0,k=T;E<k.length;E+=1)if(!Gc(k[E],S))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),v=Xa(t.geometry(),a,u,c);if(!Hn(a,u))return!1;for(var _=0,x=v;_<x.length;_+=1)if(!ou(x[_],h))return!1}if(r.type==="MultiPolygon"){var S=el(r.coordinates,u,c),T=Xa(t.geometry(),a,u,c);if(!Hn(a,u))return!1;for(var E=0,k=T;E<k.length;E+=1)if(!au(k[E],S))return!1}return!0}(e,this.geometries)}return!1},Ii.prototype.eachChild=function(){},Ii.prototype.outputDefined=function(){return!0},Ii.prototype.serialize=function(){return["within",this.geojson]};var _n=function(e,t){this.type=t.type,this.name=e,this.boundExpression=t};_n.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 _n(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)},_n.prototype.evaluate=function(e){return this.boundExpression.evaluate(e)},_n.prototype.eachChild=function(){},_n.prototype.outputDefined=function(){return!1},_n.prototype.serialize=function(){return["var",this.name]};var xn=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 Ar("Input is not a number.");c=h-1}return 0}xn.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)},xn.prototype._parse=function(e,t){function r(x,S,T){return T==="assert"?new $t(S,[x]):T==="coerce"?new Ti(S,[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,v=c.type;if(h.kind!=="string"&&h.kind!=="number"&&h.kind!=="boolean"&&h.kind!=="object"&&h.kind!=="array"||v.kind!=="value")if(h.kind!=="color"&&h.kind!=="formatted"&&h.kind!=="resolvedImage"||v.kind!=="value"&&v.kind!=="string"){if(this.checkSubtype(h,v))return null}else c=r(c,h,t.typeAnnotation||"coerce");else c=r(c,h,t.typeAnnotation||"assert")}if(!(c instanceof Nr)&&c.type.kind!=="resolvedImage"&&function x(S){if(S instanceof _n)return x(S.boundExpression);if(S instanceof zr&&S.name==="error"||S instanceof Wi||S instanceof Ii)return!1;var T=S instanceof Ti||S instanceof $t,E=!0;return S.eachChild(function(k){E=T?E&&x(k):E&&k instanceof Nr}),!!E&&vn(S)&&Xn(S,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(c)){var _=new an;try{c=new Nr(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.")},xn.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 xn(this.registry,a,t||null,u,this.errors)},xn.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))},xn.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 pr(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],v=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 S=t.parse(v,x,u);if(!S)return null;u=u||S.type,a.push([h,S])}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:pr,color:function(e,t,r){return new Et(pr(e.r,t.r,r),pr(e.g,t.g,r),pr(e.b,t.b,r),pr(e.a,t.a,r))},array:function(e,t,r){return e.map(function(a,u){return pr(a,t[u],r)})}}),lu=6/29*3*(6/29),Hc=Math.PI/180,Xc=180/Math.PI;function tl(e){return e>.008856451679035631?Math.pow(e,1/3):e/lu+4/29}function rl(e){return e>6/29?e*e*e:lu*(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 uu(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 cu(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 Et(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 Kc(e,t,r){var a=t-e;return e+r*(a>180||a<-180?a-360*Math.round(a/360):a)}var ha={forward:uu,reverse:cu,interpolate:function(e,t,r){return{l:pr(e.l,t.l,r),a:pr(e.a,t.a,r),b:pr(e.b,t.b,r),alpha:pr(e.alpha,t.alpha,r)}}},fa={forward:function(e){var t=uu(e),r=t.l,a=t.a,u=t.b,c=Math.atan2(u,a)*Xc;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*Hc,r=e.c;return cu({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:Kc(e.h,t.h,r),c:pr(e.c,t.c,r),l:pr(e.l,t.l,r),alpha:pr(e.alpha,t.alpha,r)}}},pu=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 v=h[c],_=v[1];this.labels.push(v[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 W(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 v=a.slice(1);if(v.length!==4||v.some(function(J){return typeof J!="number"||J<0||J>1}))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:v}}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=Pe:t.expectedType&&t.expectedType.kind!=="value"&&(x=t.expectedType);for(var S=0;S<c.length;S+=2){var T=c[S],E=c[S+1],k=S+3,U=S+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 N=t.parse(E,U,x);if(!N)return null;x=x||N.type,_.push([T,N])}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 "+_t(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]),v=r[c].evaluate(e),_=r[c+1].evaluate(e);return this.operator==="interpolate"?Bo[this.type.kind.toLowerCase()](v,_,h):this.operator==="interpolate-hcl"?fa.reverse(fa.interpolate(fa.forward(v),fa.forward(_),h)):ha.reverse(ha.interpolate(ha.forward(v),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 bn=function(e,t){this.type=e,this.args=t};bn.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 v=t.parse(h[c],1+u.length,r,void 0,{typeAnnotation:"omit"});if(!v)return null;r=r||v.type,u.push(v)}var _=a&&u.some(function(x){return Pt(a,x.type)});return new bn(_?Me:r,u)},bn.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 Yr&&!r.available&&(t||(t=r.name),r=null,a===this.args.length&&(r=t)),r===null);u+=1);return r},bn.prototype.eachChild=function(e){this.args.forEach(e)},bn.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},bn.prototype.serialize=function(){var e=["coalesce"];return this.eachChild(function(t){e.push(t.serialize())}),e};var wn=function(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t};wn.prototype.evaluate=function(e){return this.result.evaluate(e)},wn.prototype.eachChild=function(e){for(var t=0,r=this.bindings;t<r.length;t+=1)e(r[t][1]);e(this.result)},wn.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 wn(r,h):null},wn.prototype.outputDefined=function(){return this.result.outputDefined()},wn.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 Kn=function(e,t,r){this.type=e,this.index=t,this.input=r};Kn.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,At(t.expectedType||Me));return r&&a?new Kn(a.type.itemType,r,a):null},Kn.prototype.evaluate=function(e){var t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new Ar("Array index out of bounds: "+t+" < 0.");if(t>=r.length)throw new Ar("Array index out of bounds: "+t+" > "+(r.length-1)+".");if(t!==Math.floor(t))throw new Ar("Array index must be an integer, but found "+t+" instead.");return r[t]},Kn.prototype.eachChild=function(e){e(this.index),e(this.input)},Kn.prototype.outputDefined=function(){return!1},Kn.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Jn=function(e,t){this.type=Ee,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,Me),a=t.parse(e[2],2,Me);return r&&a?ir(r.type,[Ee,Be,de,Oe,Me])?new Jn(r,a):t.error("Expected first argument to be of type boolean, string, number or null, but found "+_t(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(!zt(t,["boolean","string","number","null"]))throw new Ar("Expected first argument to be of type boolean, string, number or null, but found "+_t(nr(t))+" instead.");if(!zt(r,["string","array"]))throw new Ar("Expected second argument to be of type array or string, but found "+_t(nr(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 Sn=function(e,t,r){this.type=de,this.needle=e,this.haystack=t,this.fromIndex=r};Sn.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,Me),a=t.parse(e[2],2,Me);if(!r||!a)return null;if(!ir(r.type,[Ee,Be,de,Oe,Me]))return t.error("Expected first argument to be of type boolean, string, number or null, but found "+_t(r.type)+" instead");if(e.length===4){var u=t.parse(e[3],3,de);return u?new Sn(r,a,u):null}return new Sn(r,a)},Sn.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!zt(t,["boolean","string","number","null"]))throw new Ar("Expected first argument to be of type boolean, string, number or null, but found "+_t(nr(t))+" instead.");if(!zt(r,["string","array"]))throw new Ar("Expected second argument to be of type array or string, but found "+_t(nr(r))+" instead.");if(this.fromIndex){var a=this.fromIndex.evaluate(e);return r.indexOf(t,a)}return r.indexOf(t)},Sn.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},Sn.prototype.outputDefined=function(){return!1},Sn.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 Yn=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};Yn.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 v=e[h],_=e[h+1];Array.isArray(v)||(v=[v]);var x=t.concat(h);if(v.length===0)return x.error("Expected at least one branch label.");for(var S=0,T=v;S<T.length;S+=1){var E=T[S];if(typeof E!="number"&&typeof E!="string")return x.error("Branch labels must be numbers or strings.");if(typeof E=="number"&&Math.abs(E)>Number.MAX_SAFE_INTEGER)return x.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof E=="number"&&Math.floor(E)!==E)return x.error("Numeric branch labels must be integer values.");if(r){if(x.checkSubtype(r,nr(E)))return null}else r=nr(E);if(u[String(E)]!==void 0)return x.error("Branch labels must be unique.");u[String(E)]=c.length}var k=t.parse(_,h,a);if(!k)return null;a=a||k.type,c.push(k)}var U=t.parse(e[1],1,Me);if(!U)return null;var N=t.parse(e[e.length-1],e.length-1,a);return N?U.type.kind!=="value"&&t.concat(1).checkSubtype(r,U.type)?null:new Yn(r,a,U,u,c,N):null},Yn.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(nr(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},Yn.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},Yn.prototype.outputDefined=function(){return this.outputs.every(function(e){return e.outputDefined()})&&this.otherwise.outputDefined()},Yn.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 v=function(k){return e.inputType.kind==="number"?Number(k):k},_=0,x=r;_<x.length;_+=1){var S=x[_],T=S[0],E=S[1];t.push(E.length===1?v(E[0]):E.map(v)),t.push(this.outputs[outputIndex$1].serialize())}return t.push(this.otherwise.serialize()),t};var Qn=function(e,t,r){this.type=e,this.branches=t,this.otherwise=r};Qn.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,Ee);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 v=t.parse(e[e.length-1],e.length-1,r);return v?new Qn(r,a,v):null},Qn.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)},Qn.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)},Qn.prototype.outputDefined=function(){return this.branches.every(function(e){return e[1].outputDefined()})&&this.otherwise.outputDefined()},Qn.prototype.serialize=function(){var e=["case"];return this.eachChild(function(t){e.push(t.serialize())}),e};var Tn=function(e,t,r,a){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=a};function hu(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 fu(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,v){this.type=Ee,this.lhs=c,this.rhs=h,this.collator=v,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 v=c[0],_=h.parse(c[1],1,Me);if(!_)return null;if(!hu(v,_.type))return h.concat(1).error('"'+v+`" comparisons are not supported for type '`+_t(_.type)+"'.");var x=h.parse(c[2],2,Me);if(!x)return null;if(!hu(v,x.type))return h.concat(2).error('"'+v+`" comparisons are not supported for type '`+_t(x.type)+"'.");if(_.type.kind!==x.type.kind&&_.type.kind!=="value"&&x.type.kind!=="value")return h.error("Cannot compare types '"+_t(_.type)+"' and '"+_t(x.type)+"'.");a&&(_.type.kind==="value"&&x.type.kind!=="value"?_=new $t(x.type,[_]):_.type.kind!=="value"&&x.type.kind==="value"&&(x=new $t(_.type,[x])));var S=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(!(S=h.parse(c[3],3,vt)))return null}return new u(_,x,S)},u.prototype.evaluate=function(c){var h=this.lhs.evaluate(c),v=this.rhs.evaluate(c);if(a&&this.hasUntypedArgument){var _=nr(h),x=nr(v);if(_.kind!==x.kind||_.kind!=="string"&&_.kind!=="number")throw new Ar('Expected arguments for "'+e+'" to be (string, string) or (number, number), but found ('+_.kind+", "+x.kind+") instead.")}if(this.collator&&!a&&this.hasUntypedArgument){var S=nr(h),T=nr(v);if(S.kind!=="string"||T.kind!=="string")return t(c,h,v)}return this.collator?r(c,h,v,this.collator.evaluate(c)):t(c,h,v)},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}()}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,Me),a=t.parse(e[2],2,de);if(!r||!a)return null;if(!ir(r.type,[At(Me),Be,Me]))return t.error("Expected first argument to be of type array or string, but found "+_t(r.type)+" instead");if(e.length===4){var u=t.parse(e[3],3,de);return u?new Tn(r.type,r,a,u):null}return new Tn(r.type,r,a)},Tn.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!zt(t,["string","array"]))throw new Ar("Expected first argument to be of type array or string, but found "+_t(nr(t))+" instead.");if(this.endIndex){var a=this.endIndex.evaluate(e);return t.slice(r,a)}return t.slice(r)},Tn.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},Tn.prototype.outputDefined=function(){return!1},Tn.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 Jc=Ot("==",function(e,t,r){return t===r},fu),Ja=Ot("!=",function(e,t,r){return t!==r},function(e,t,r,a){return!fu(0,t,r,a)}),du=Ot("<",function(e,t,r){return t<r},function(e,t,r,a){return a.compare(t,r)<0}),mu=Ot(">",function(e,t,r){return t>r},function(e,t,r,a){return a.compare(t,r)>0}),yu=Ot("<=",function(e,t,r){return t<=r},function(e,t,r,a){return a.compare(t,r)<=0}),vu=Ot(">=",function(e,t,r){return t>=r},function(e,t,r,a){return a.compare(t,r)>=0}),eo=function(e,t,r,a,u){this.type=Be,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=a,this.maxFractionDigits=u};eo.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,Be)))return null;var c=null;if(a.currency&&!(c=t.parse(a.currency,1,Be)))return null;var h=null;if(a["min-fraction-digits"]&&!(h=t.parse(a["min-fraction-digits"],1,de)))return null;var v=null;return a["max-fraction-digits"]&&!(v=t.parse(a["max-fraction-digits"],1,de))?null:new eo(r,u,c,h,v)},eo.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))},eo.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)},eo.prototype.outputDefined=function(){return!1},eo.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 In=function(e){this.type=de,this.input=e};In.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 "+_t(r.type)+" instead."):new In(r):null},In.prototype.evaluate=function(e){var t=this.input.evaluate(e);if(typeof t=="string"||Array.isArray(t))return t.length;throw new Ar("Expected value to be of type string or array, but found "+_t(nr(t))+" instead.")},In.prototype.eachChild=function(e){e(this.input)},In.prototype.outputDefined=function(){return!1},In.prototype.serialize=function(){var e=["length"];return this.eachChild(function(t){e.push(t.serialize())}),e};var to={"==":Jc,"!=":Ja,">":mu,"<":du,">=":vu,"<=":yu,array:$t,at:Kn,boolean:$t,case:Qn,coalesce:bn,collator:Wi,format:Fi,image:hi,in:Jn,"index-of":Sn,interpolate:Br,"interpolate-hcl":Br,"interpolate-lab":Br,length:In,let:wn,literal:Nr,match:Yn,number:$t,"number-format":eo,object:$t,slice:Tn,step:ni,string:$t,"to-boolean":Ti,"to-color":Ti,"to-number":Ti,"to-string":Ti,var:_n,within:Ii};function gu(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,v=Ys(r,a,u,h);if(v)throw new Ar(v);return new Et(r/255*h,a/255*h,u/255*h,h)}function _u(e,t){return e in t}function al(e,t){var r=t[e];return r===void 0?null:r}function ro(e){return{type:e}}function xu(e){return{result:"success",value:e}}function io(e){return{result:"error",value:e}}function no(e){return e["property-type"]==="data-driven"||e["property-type"]==="cross-faded-data-driven"}function bu(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 Ya(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Yc(e){return e}function Do(e,t,r){return e!==void 0?e:t!==void 0?t:r!==void 0?r:void 0}function wu(e,t,r,a,u){return Do(typeof r===u?a[r]:void 0,e.default,t.default)}function Qc(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 Su(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,E,k,U){var N=U-k,J=T-k;return N===0?0:E===1?J/N:(Math.pow(E,J)-1)/(Math.pow(E,N)-1)}(r,a,e.stops[c][0],e.stops[c+1][0]),v=e.stops[c][1],_=e.stops[c+1][1],x=Bo[t.type]||Yc;if(e.colorSpace&&e.colorSpace!=="rgb"){var S=pu[e.colorSpace];x=function(T,E){return S.reverse(S.interpolate(S.forward(T),S.forward(E),h))}}return typeof v.evaluate=="function"?{evaluate:function(){for(var T=[],E=arguments.length;E--;)T[E]=arguments[E];var k=v.evaluate.apply(void 0,T),U=_.evaluate.apply(void 0,T);if(k!==void 0&&U!==void 0)return x(k,U,h)}}:x(v,_,h)}function Qa(e,t,r){return t.type==="color"?r=Et.parse(r):t.type==="formatted"?r=Ir.fromString(r.toString()):t.type==="resolvedImage"?r=Yr.fromString(r.toString()):Ut(r)===t.type||t.type==="enum"&&t.values[r]||(r=void 0),Do(r,e.default,t.default)}zr.register(to,{error:[{kind:"error"},[Be],function(e,t){throw new Ar(t[0].evaluate(e))}],typeof:[Be,[Me],function(e,t){return _t(nr(t[0].evaluate(e)))}],"to-rgba":[At(de,4),[Pe],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[Pe,[de,de,de],gu],rgba:[Pe,[de,de,de,de],gu],has:{type:Ee,overloads:[[[Be],function(e,t){return _u(t[0].evaluate(e),e.properties())}],[[Be,ut],function(e,t){var r=t[1];return _u(t[0].evaluate(e),r.evaluate(e))}]]},get:{type:Me,overloads:[[[Be],function(e,t){return al(t[0].evaluate(e),e.properties())}],[[Be,ut],function(e,t){var r=t[1];return al(t[0].evaluate(e),r.evaluate(e))}]]},"feature-state":[Me,[Be],function(e,t){return al(t[0].evaluate(e),e.featureState||{})}],properties:[ut,[],function(e){return e.properties()}],"geometry-type":[Be,[],function(e){return e.geometryType()}],id:[Me,[],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:[Me,[],function(e){return e.globals.accumulated===void 0?null:e.globals.accumulated}],"+":[de,ro(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,ro(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,ro(de),function(e,t){return Math.min.apply(Math,t.map(function(r){return r.evaluate(e)}))}],max:[de,ro(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-==":[Ee,[Be,Me],function(e,t){var r=t[0],a=t[1];return e.properties()[r.value]===a.value}],"filter-id-==":[Ee,[Me],function(e,t){var r=t[0];return e.id()===r.value}],"filter-type-==":[Ee,[Be],function(e,t){var r=t[0];return e.geometryType()===r.value}],"filter-<":[Ee,[Be,Me],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-<":[Ee,[Me],function(e,t){var r=t[0],a=e.id(),u=r.value;return typeof a==typeof u&&a<u}],"filter->":[Ee,[Be,Me],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->":[Ee,[Me],function(e,t){var r=t[0],a=e.id(),u=r.value;return typeof a==typeof u&&a>u}],"filter-<=":[Ee,[Be,Me],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-<=":[Ee,[Me],function(e,t){var r=t[0],a=e.id(),u=r.value;return typeof a==typeof u&&a<=u}],"filter->=":[Ee,[Be,Me],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->=":[Ee,[Me],function(e,t){var r=t[0],a=e.id(),u=r.value;return typeof a==typeof u&&a>=u}],"filter-has":[Ee,[Me],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[Ee,[],function(e){return e.id()!==null&&e.id()!==void 0}],"filter-type-in":[Ee,[At(Be)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[Ee,[At(Me)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[Ee,[Be,At(Me)],function(e,t){var r=t[0];return t[1].value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[Ee,[Be,At(Me)],function(e,t){var r=t[0],a=t[1];return function(u,c,h,v){for(;h<=v;){var _=h+v>>1;if(c[_]===u)return!0;c[_]>u?v=_-1:h=_+1}return!1}(e.properties()[r.value],a.value,0,a.value.length-1)}],all:{type:Ee,overloads:[[[Ee,Ee],function(e,t){var r=t[1];return t[0].evaluate(e)&&r.evaluate(e)}],[ro(Ee),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:Ee,overloads:[[[Ee,Ee],function(e,t){var r=t[1];return t[0].evaluate(e)||r.evaluate(e)}],[ro(Ee),function(e,t){for(var r=0,a=t;r<a.length;r+=1)if(a[r].evaluate(e))return!0;return!1}]]},"!":[Ee,[Ee],function(e,t){return!t[0].evaluate(e)}],"is-supported-script":[Ee,[Be],function(e,t){var r=e.globals&&e.globals.isSupportedScript;return!r||r(t[0].evaluate(e))}],upcase:[Be,[Be],function(e,t){return t[0].evaluate(e).toUpperCase()}],downcase:[Be,[Be],function(e,t){return t[0].evaluate(e).toLowerCase()}],concat:[Be,ro(Me),function(e,t){return t.map(function(r){return ca(r.evaluate(e))}).join("")}],"resolved-locale":[Be,[vt],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"&&Ya(r.default)?new Et(0,0,0,0):r.type==="color"?Et.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 to}function es(e,t){var r=new xn(to,[],t?function(u){var c={color:Pe,string:Be,number:de,enum:Be,boolean:Ee,formatted:Ft,resolvedImage:pt};return u.type==="array"?At(c[u.value]||Me,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?xu(new Lo(a,t)):io(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 Ar("Expected value to be one of "+Object.keys(this._enumValues).map(function(v){return JSON.stringify(v)}).join(", ")+", but found "+JSON.stringify(h)+" instead.");return h}catch(v){return this._warningHistory[v.message]||(this._warningHistory[v.message]=!0,typeof console<"u"&&console.warn(v.message)),this._defaultValue}};var ya=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!=="constant"&&!gn(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"&&!gn(t.expression),this.interpolationType=a};function Tu(e,t){if((e=es(e,t)).result==="error")return e;var r=e.value.expression,a=vn(r);if(!a&&!no(t))return io([new be("","data expressions not supported")]);var u=Xn(r,["zoom"]);if(!u&&!bu(t))return io([new be("","zoom expressions not supported")]);var c=function h(v){var _=null;if(v instanceof wn)_=h(v.result);else if(v instanceof bn)for(var x=0,S=v.args;x<S.length&&!(_=h(S[x]));x+=1);else(v instanceof ni||v instanceof Br)&&v.input instanceof zr&&v.input.name==="zoom"&&(_=v);return _ instanceof be||v.eachChild(function(T){var E=h(T);E instanceof be?_=E:!_&&E?_=new be("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):_&&E&&_!==E&&(_=new be("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),_}(r);return c||u?c instanceof be?io([c]):c instanceof Br&&!da(t)?io([new be("",'"interpolate" expressions cannot be used with this property')]):xu(c?new Ro(a?"camera":"composite",e.value,c.labels,c instanceof Br?c.interpolation:void 0):new ya(a?"constant":"source",e.value)):io([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,v,_=u.type==="color",x=a.stops&&typeof a.stops[0][0]=="object",S=x||!(x||a.property!==void 0),T=a.type||(da(u)?"exponential":"interval");if(_&&((a=xe({},a)).stops&&(a.stops=a.stops.map(function(ke){return[ke[0],Et.parse(ke[1])]})),a.default=Et.parse(a.default?a.default:u.default)),a.colorSpace&&a.colorSpace!=="rgb"&&!pu[a.colorSpace])throw new Error("Unknown color space: "+a.colorSpace);if(T==="exponential")c=Su;else if(T==="interval")c=Qc;else if(T==="categorical"){c=wu,h=Object.create(null);for(var E=0,k=a.stops;E<k.length;E+=1){var U=k[E];h[U[0]]=U[1]}v=typeof a.stops[0][0]}else{if(T!=="identity")throw new Error('Unknown function type "'+T+'"');c=Qa}if(x){for(var N={},J=[],H=0;H<a.stops.length;H++){var re=a.stops[H],oe=re[0].zoom;N[oe]===void 0&&(N[oe]={zoom:oe,type:a.type,property:a.property,default:a.default,stops:[]},J.push(oe)),N[oe].stops.push([re[0].value,re[1]])}for(var se=[],ce=0,ye=J;ce<ye.length;ce+=1){var Se=ye[ce];se.push([N[Se].zoom,r(N[Se],u)])}var Ae={name:"linear"};return{kind:"composite",interpolationType:Ae,interpolationFactor:Br.interpolationFactor.bind(void 0,Ae),zoomStops:se.map(function(ke){return ke[0]}),evaluate:function(ke,We){var ze=ke.zoom;return Su({stops:se,base:a.base},u,ze).evaluate(ze,We)}}}if(S){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(ke){return ke[0]}),evaluate:function(ke){return c(a,u,ke.zoom,h,v)}}}return{kind:"source",evaluate:function(ke,We){var ze=We&&We.properties?We.properties[a.property]:void 0;return ze===void 0?Do(a.default,u.default):c(a,u,ze,h,v)}}}(this._parameters,this._specification))};function Oi(e){var t=e.key,r=e.value,a=e.valueSpec||{},u=e.objectElementValidators||{},c=e.style,h=e.styleSpec,v=[],_=Ut(r);if(_!=="object")return[new Z(t,r,"object expected, "+_+" found")];for(var x in r){var S=x.split(".")[0],T=a[S]||a["*"],E=void 0;if(u[S])E=u[S];else if(a[S])E=gt;else if(u["*"])E=u["*"];else{if(!a["*"]){v.push(new Z(t,r[x],'unknown property "'+x+'"'));continue}E=gt}v=v.concat(E({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&&v.push(new Z(t,r,'missing required property "'+k+'"'));return v}function Iu(e){var t=e.value,r=e.valueSpec,a=e.style,u=e.styleSpec,c=e.key,h=e.arrayElementValidator||gt;if(Ut(t)!=="array")return[new Z(c,t,"array expected, "+Ut(t)+" found")];if(r.length&&t.length!==r.length)return[new Z(c,t,"array length "+r.length+" expected, length "+t.length+" found")];if(r["min-length"]&&t.length<r["min-length"])return[new Z(c,t,"array length at least "+r["min-length"]+" expected, length "+t.length+" found")];var v={type:r.value,values:r.values};u.$version<7&&(v.function=r.function),Ut(r.value)==="object"&&(v=r.value);for(var _=[],x=0;x<t.length;x++)_=_.concat(h({array:t,arrayIndex:x,value:t[x],valueSpec:v,style:a,styleSpec:u,key:c+"["+x+"]"}));return _}function Au(e){var t=e.key,r=e.value,a=e.valueSpec,u=Ut(r);return u==="number"&&r!=r&&(u="NaN"),u!=="number"?[new Z(t,r,"number expected, "+u+" found")]:"minimum"in a&&r<a.minimum?[new Z(t,r,r+" is less than the minimum value "+a.minimum)]:"maximum"in a&&r>a.maximum?[new Z(t,r,r+" is greater than the maximum value "+a.maximum)]:[]}function Eu(e){var t,r,a,u=e.valueSpec,c=we(e.value.type),h={},v=c!=="categorical"&&e.value.property===void 0,_=!v,x=Ut(e.value.stops)==="array"&&Ut(e.value.stops[0])==="array"&&Ut(e.value.stops[0][0])==="object",S=Oi({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 Z(k.key,k.value,'identity function may not have a "stops" property')];var U=[],N=k.value;return U=U.concat(Iu({key:k.key,value:N,valueSpec:k.valueSpec,style:k.style,styleSpec:k.styleSpec,arrayElementValidator:T})),Ut(N)==="array"&&N.length===0&&U.push(new Z(k.key,N,"array must have at least one stop")),U},default:function(k){return gt({key:k.key,value:k.value,valueSpec:u,style:k.style,styleSpec:k.styleSpec})}}});return c==="identity"&&v&&S.push(new Z(e.key,e.value,'missing required property "property"')),c==="identity"||e.value.stops||S.push(new Z(e.key,e.value,'missing required property "stops"')),c==="exponential"&&e.valueSpec.expression&&!da(e.valueSpec)&&S.push(new Z(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(_&&!no(e.valueSpec)?S.push(new Z(e.key,e.value,"property functions not supported")):v&&!bu(e.valueSpec)&&S.push(new Z(e.key,e.value,"zoom functions not supported"))),c!=="categorical"&&!x||e.value.property!==void 0||S.push(new Z(e.key,e.value,'"property" property is required')),S;function T(k){var U=[],N=k.value,J=k.key;if(Ut(N)!=="array")return[new Z(J,N,"array expected, "+Ut(N)+" found")];if(N.length!==2)return[new Z(J,N,"array length 2 expected, length "+N.length+" found")];if(x){if(Ut(N[0])!=="object")return[new Z(J,N,"object expected, "+Ut(N[0])+" found")];if(N[0].zoom===void 0)return[new Z(J,N,"object stop key must have zoom")];if(N[0].value===void 0)return[new Z(J,N,"object stop key must have value")];if(a&&a>we(N[0].zoom))return[new Z(J,N[0].zoom,"stop zoom values must appear in ascending order")];we(N[0].zoom)!==a&&(a=we(N[0].zoom),r=void 0,h={}),U=U.concat(Oi({key:J+"[0]",value:N[0],valueSpec:{zoom:{}},style:k.style,styleSpec:k.styleSpec,objectElementValidators:{zoom:Au,value:E}}))}else U=U.concat(E({key:J+"[0]",value:N[0],style:k.style,styleSpec:k.styleSpec},N));return ma(fe(N[1]))?U.concat([new Z(J+"[1]",N[1],"expressions are not allowed in function stops.")]):U.concat(gt({key:J+"[1]",value:N[1],valueSpec:u,style:k.style,styleSpec:k.styleSpec}))}function E(k,U){var N=Ut(k.value),J=we(k.value),H=k.value!==null?k.value:U;if(t){if(N!==t)return[new Z(k.key,H,N+" stop domain type must match previous stop domain type "+t)]}else t=N;if(N!=="number"&&N!=="string"&&N!=="boolean")return[new Z(k.key,H,"stop domain value must be a number, string, or boolean")];if(N!=="number"&&c!=="categorical"){var re="number expected, "+N+" found";return no(u)&&c===void 0&&(re+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Z(k.key,H,re)]}return c!=="categorical"||N!=="number"||isFinite(J)&&Math.floor(J)===J?c!=="categorical"&&N==="number"&&r!==void 0&&J<r?[new Z(k.key,H,"stop domain values must appear in ascending order")]:(r=J,c==="categorical"&&J in h?[new Z(k.key,H,"stop domain values must be unique")]:(h[J]=!0,[])):[new Z(k.key,H,"integer expected, found "+J)]}}function oo(e){var t=(e.expressionContext==="property"?Tu:es)(fe(e.value),e.valueSpec);if(t.result==="error")return t.value.map(function(a){return new Z(""+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 Z(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"&&!gn(r))return[new Z(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if(e.expressionContext==="filter"&&!gn(r))return[new Z(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&e.expressionContext.indexOf("cluster")===0){if(!Xn(r,["zoom","feature-state"]))return[new Z(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(e.expressionContext==="cluster-initial"&&!vn(r))return[new Z(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 Z(t,r,"expected one of ["+a.values.join(", ")+"], "+JSON.stringify(r)+" found")):Object.keys(a.values).indexOf(we(r))===-1&&u.push(new Z(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};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 ep(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"?Cu(e[1],e.slice(2)):r==="!in"?ns(Cu(e[1],e.slice(2))):r==="has"?Pu(e[1]):r==="!has"?ns(Pu(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 Cu(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(ep)]]:["filter-in-small",e,["literal",t]]}}function Pu(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))?oo(xe({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(r){var a=r.value,u=r.key;if(Ut(a)!=="array")return[new Z(u,a,"array expected, "+Ut(a)+" found")];var c,h=r.styleSpec,v=[];if(a.length<1)return[new Z(u,a,"filter array must have at least 1 element")];switch(v=v.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"&&v.push(new Z(u,a,'"$type" cannot be use with operator "'+a[0]+'"'));case"==":case"!=":a.length!==3&&v.push(new Z(u,a,'filter array for operator "'+a[0]+'" must have 3 elements'));case"in":case"!in":a.length>=2&&(c=Ut(a[1]))!=="string"&&v.push(new Z(u+"[1]",a[1],"string expected, "+c+" found"));for(var _=2;_<a.length;_++)c=Ut(a[_]),we(a[1])==="$type"?v=v.concat(va({key:u+"["+_+"]",value:a[_],valueSpec:h.geometry_type,style:r.style,styleSpec:r.styleSpec})):c!=="string"&&c!=="number"&&c!=="boolean"&&v.push(new Z(u+"["+_+"]",a[_],"string, number, or boolean expected, "+c+" found"));break;case"any":case"all":case"none":for(var x=1;x<a.length;x++)v=v.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?v.push(new Z(u,a,'filter array for "'+a[0]+'" operator must have 2 elements')):c!=="string"&&v.push(new Z(u+"[1]",a[1],"string expected, "+c+" found"));break;case"within":c=Ut(a[1]),a.length!==2?v.push(new Z(u,a,'filter array for "'+a[0]+'" operator must have 2 elements')):c!=="object"&&v.push(new Z(u+"[1]",a[1],"object expected, "+c+" found"))}return v}(e)}function cl(e,t){var r=e.key,a=e.style,u=e.styleSpec,c=e.value,h=e.objectKey,v=u[t+"_"+e.layerType];if(!v)return[];var _=h.match(/^(.*)-transition$/);if(t==="paint"&&_&&v[_[1]]&&v[_[1]].transition)return gt({key:r,value:c,valueSpec:u.transition,style:a,styleSpec:u});var x,S=e.valueSpec||v[h];if(!S)return[new Z(r,c,'unknown property "'+h+'"')];if(Ut(c)==="string"&&no(S)&&!S.tokens&&(x=/^{([^}]+)}$/.exec(c)))return[new Z(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 Z(r,c,'use of "text-field" requires a style "glyphs" property')),h==="text-font"&&Ya(fe(c))&&we(c.type)==="identity"&&T.push(new Z(r,c,'"text-font" does not support identity functions'))),T.concat(gt({key:e.key,value:c,valueSpec:S,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 ku(e){var t=[],r=e.value,a=e.key,u=e.style,c=e.styleSpec;r.type||r.ref||t.push(new Z(a,r,'either "type" or "ref" is required'));var h,v=we(r.type),_=we(r.ref);if(r.id)for(var x=we(r.id),S=0;S<e.arrayIndex;S++){var T=u.layers[S];we(T.id)===x&&t.push(new Z(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(U){U in r&&t.push(new Z(a,r[U],'"'+U+'" is prohibited for ref layers'))}),u.layers.forEach(function(U){we(U.id)===_&&(h=U)}),h?h.ref?t.push(new Z(a,r.ref,"ref cannot reference another ref layer")):v=we(h.type):t.push(new Z(a,r.ref,'ref layer "'+_+'" not found'));else if(v!=="background")if(r.source){var E=u.sources&&u.sources[r.source],k=E&&we(E.type);E?k==="vector"&&v==="raster"?t.push(new Z(a,r.source,'layer "'+r.id+'" requires a raster source')):k==="raster"&&v!=="raster"?t.push(new Z(a,r.source,'layer "'+r.id+'" requires a vector source')):k!=="vector"||r["source-layer"]?k==="raster-dem"&&v!=="hillshade"?t.push(new Z(a,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):v!=="line"||!r.paint||!r.paint["line-gradient"]||k==="geojson"&&E.lineMetrics||t.push(new Z(a,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):t.push(new Z(a,r,'layer "'+r.id+'" must specify a "source-layer"')):t.push(new Z(a,r.source,'source "'+r.source+'" not found'))}else t.push(new Z(a,r,'missing required property "source"'));return t=t.concat(Oi({key:a,value:r,valueSpec:c.layer,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return gt({key:a+".type",value:r.type,valueSpec:c.layer.type,style:e.style,styleSpec:e.styleSpec,object:r,objectKey:"type"})},filter:ul,layout:function(U){return Oi({layer:r,key:U.key,value:U.value,style:U.style,styleSpec:U.styleSpec,objectElementValidators:{"*":function(N){return ga(xe({layerType:v},N))}}})},paint:function(U){return Oi({layer:r,key:U.key,value:U.value,style:U.style,styleSpec:U.styleSpec,objectElementValidators:{"*":function(N){return pl(xe({layerType:v},N))}}})}}}))}function ao(e){var t=e.value,r=e.key,a=Ut(t);return a!=="string"?[new Z(r,t,"string expected, "+a+" found")]:[]}var Zt={promoteId:function(e){var t=e.key,r=e.value;if(Ut(r)==="string")return ao({key:t,value:r});var a=[];for(var u in r)a.push.apply(a,ao({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 Z(r,t,'"type" is required')];var c,h=we(t.type);switch(h){case"vector":case"raster":case"raster-dem":return Oi({key:r,value:t,valueSpec:a["source_"+h.replace("-","_")],style:e.style,styleSpec:a,objectElementValidators:Zt});case"geojson":if(c=Oi({key:r,value:t,valueSpec:a.source_geojson,style:u,styleSpec:a,objectElementValidators:Zt}),t.cluster)for(var v in t.clusterProperties){var _=t.clusterProperties[v],x=_[0],S=typeof x=="string"?[x,["accumulated"],["get",v]]:x;c.push.apply(c,oo({key:r+"."+v+".map",value:_[1],expressionContext:"cluster-map"})),c.push.apply(c,oo({key:r+"."+v+".reduce",value:S,expressionContext:"cluster-reduce"}))}return c;case"video":return Oi({key:r,value:t,valueSpec:a.source_video,style:u,styleSpec:a});case"image":return Oi({key:r,value:t,valueSpec:a.source_image,style:u,styleSpec:a});case"canvas":return[new Z(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"]}})}}function so(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 Z("light",t,"object expected, "+h+" found")]);for(var v in t){var _=v.match(/^(.*)-transition$/);c=c.concat(_&&a[_[1]]&&a[_[1]].transition?gt({key:v,value:t[v],valueSpec:r.transition,style:u,styleSpec:r}):a[v]?gt({key:v,value:t[v],valueSpec:a[v],style:u,styleSpec:r}):[new Z(v,t[v],'unknown property "'+v+'"')])}return c}var An={"*":function(){return[]},array:Iu,boolean:function(e){var t=e.value,r=e.key,a=Ut(t);return a!=="boolean"?[new Z(r,t,"boolean expected, "+a+" found")]:[]},number:Au,color:function(e){var t=e.key,r=e.value,a=Ut(r);return a!=="string"?[new Z(t,r,"color expected, "+a+" found")]:mt(r)===null?[new Z(t,r,'color expected, "'+r+'" found')]:[]},constants:ne,enum:va,filter:ul,function:Eu,layer:ku,object:Oi,source:os,light:so,string:ao,formatted:function(e){return ao(e).length===0?[]:oo(e)},resolvedImage:function(e){return ao(e).length===0?[]:oo(e)}};function gt(e){var t=e.value,r=e.valueSpec,a=e.styleSpec;return r.expression&&Ya(we(t))?Eu(e):r.expression&&ma(fe(t))?oo(e):r.type&&An[r.type]?An[r.type](e):Oi(xe({},e,{valueSpec:r.type?a[r.type]:r}))}function Nt(e){var t=e.value,r=e.key,a=ao(e);return a.length||(t.indexOf("{fontstack}")===-1&&a.push(new Z(r,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&a.push(new Z(r,t,'"glyphs" url must include a "{range}" token'))),a}function fi(e,t){t===void 0&&(t=B);var r=[];return r=r.concat(gt({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,objectElementValidators:{glyphs:Nt,"*":function(){return[]}}})),e.constants&&(r=r.concat(ne({key:"constants",value:e.constants}))),_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))}}fi.source=Oo(os),fi.light=Oo(so),fi.layer=Oo(ku),fi.filter=Oo(ul),fi.paintProperty=Oo(pl),fi.layoutProperty=Oo(ga);var xa=fi,tp=xa.light,rp=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 Q(new Error(u[a].message))),r=!0;return r}var sn=dr;function dr(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],v=u[3+c+1];a.push(h===v?null:u.subarray(h,v))}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 S=r/t*e;this.min=-S,this.max=e+S}dr.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)},dr.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},dr.prototype._insertCell=function(e,t,r,a,u,c){this.cells[u].push(c)},dr.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 v=[];return this._forEachCell(e,t,r,a,this._queryCell,v,{},u),v},dr.prototype._queryCell=function(e,t,r,a,u,c,h,v){var _=this.cells[u];if(_!==null)for(var x=this.keys,S=this.bboxes,T=0;T<_.length;T++){var E=_[T];if(h[E]===void 0){var k=4*E;(v?v(S[k+0],S[k+1],S[k+2],S[k+3]):e<=S[k+2]&&t<=S[k+3]&&r>=S[k+0]&&a>=S[k+1])?(h[E]=!0,c.push(x[E])):h[E]=!1}}},dr.prototype._forEachCell=function(e,t,r,a,u,c,h,v){for(var _=this._convertToCellCoord(e),x=this._convertToCellCoord(t),S=this._convertToCellCoord(r),T=this._convertToCellCoord(a),E=_;E<=S;E++)for(var k=x;k<=T;k++){var U=this.d*k+E;if((!v||v(this._convertFromCellCoord(E),this._convertFromCellCoord(k),this._convertFromCellCoord(E+1),this._convertFromCellCoord(k+1)))&&u.call(this,e,t,r,a,U,c,h,v))return}},dr.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},dr.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},dr.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 v=e[h];u[3+h]=c,u.set(v,c),c+=v.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,Mu=le.ImageBitmap,hr={};function Ve(e,t,r){r===void 0&&(r={}),Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),hr[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",Et),Ve("Error",Error),Ve("ResolvedImage",Yr),Ve("StylePropertyFunction",Fo),Ve("StyleExpression",Lo,{omit:["_evaluator"]}),Ve("ZoomDependentExpression",Ro),Ve("ZoomConstantExpression",ya),Ve("CompoundExpression",zr,{omit:["_evaluate"]}),to)to[oi]._classRegistryKey||Ve("Expression_"+oi,to[oi]);function as(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor&&e.constructor.name==="ArrayBuffer")}function Vo(e){return Mu&&e instanceof Mu}function Vi(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(Vi(c[u],t));return a}if(typeof e=="object"){var h=e.constructor,v=h._classRegistryKey;if(!v)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)&&!(hr[v].omit.indexOf(x)>=0)){var S=e[x];_[x]=hr[v].shallow.indexOf(x)>=0?S:Vi(S,t)}e instanceof Error&&(_.message=e.message)}if(_.$name)throw new Error("$name property is reserved for worker serialization logic.");return v!=="Object"&&(_.$name=v),_}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=hr[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 v=e[h];a[h]=hr[t].shallow.indexOf(h)>=0?v:ai(v)}}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 Ce={"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||!(Ce["Bopomofo Extended"](e)||Ce.Bopomofo(e)||Ce["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||Ce["CJK Compatibility Ideographs"](e)||Ce["CJK Compatibility"](e)||Ce["CJK Radicals Supplement"](e)||Ce["CJK Strokes"](e)||!(!Ce["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||e===12336)||Ce["CJK Unified Ideographs Extension A"](e)||Ce["CJK Unified Ideographs"](e)||Ce["Enclosed CJK Letters and Months"](e)||Ce["Hangul Compatibility Jamo"](e)||Ce["Hangul Jamo Extended-A"](e)||Ce["Hangul Jamo Extended-B"](e)||Ce["Hangul Jamo"](e)||Ce["Hangul Syllables"](e)||Ce.Hiragana(e)||Ce["Ideographic Description Characters"](e)||Ce.Kanbun(e)||Ce["Kangxi Radicals"](e)||Ce["Katakana Phonetic Extensions"](e)||Ce.Katakana(e)&&e!==12540||!(!Ce["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)||!(!Ce["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||Ce["Unified Canadian Aboriginal Syllabics"](e)||Ce["Unified Canadian Aboriginal Syllabics Extended"](e)||Ce["Vertical Forms"](e)||Ce["Yijing Hexagram Symbols"](e)||Ce["Yi Syllables"](e)||Ce["Yi Radicals"](e))))}function dl(e){return!(ss(e)||function(t){return!!(Ce["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||Ce["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)||Ce["Letterlike Symbols"](t)||Ce["Number Forms"](t)||Ce["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)||Ce["Control Pictures"](t)&&t!==9251||Ce["Optical Character Recognition"](t)||Ce["Enclosed Alphanumerics"](t)||Ce["Geometric Shapes"](t)||Ce["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Ce["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Ce["CJK Symbols and Punctuation"](t)||Ce.Katakana(t)||Ce["Private Use Area"](t)||Ce["CJK Compatibility Forms"](t)||Ce["Small Form Variants"](t)||Ce["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||Ce["Arabic Presentation Forms-A"](e)||Ce["Arabic Presentation Forms-B"](e)}function si(e,t){return!(!t&&Ai(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||Ce.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,zu=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 te,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?zu(e):(li="loaded",Ta())})},di={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return li==="loaded"||di.applyArabicShaping!=null},isLoading:function(){return li==="loading"},setState:function(e){li=e.pluginStatus,ln=e.pluginURL},isParsed:function(){return di.applyArabicShaping!=null&&di.processBidirectionalText!=null&&di.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,di.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(Ya(r))return new Fo(r,a);if(ma(r)){var u=Tu(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=Et.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 Ei=function(e){this.property=e,this.value=new Hi(e,void 0)};Ei.prototype.transitioned=function(e,t){return new lo(this.property,this.value,t,tt({},e.transition,this.transition),e.now)},Ei.prototype.untransitioned=function(){return new lo(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 gr(this._values[e].value.value)},Dr.prototype.setValue=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Ei(this._values[e].property)),this._values[e].value=new Hi(this._values[e].property,t===null?void 0:gr(t))},Dr.prototype.getTransition=function(e){return gr(this._values[e].transition)},Dr.prototype.setTransition=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Ei(this._values[e].property)),this._values[e].transition=gr(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 En(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 En(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 lo=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)};lo.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(v){if(v<=0)return 0;if(v>=1)return 1;var _=v*v,x=_*v;return 4*(v<.5?x:3*(v-_)+x-.75)}(h))}return u};var En=function(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)};En.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},En.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 Ni=function(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)};Ni.prototype.getValue=function(e){return gr(this._values[e].value)},Ni.prototype.setValue=function(e,t){this._values[e]=new Hi(this._values[e].property,t===null?void 0:gr(t))},Ni.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},Ni.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 Ne=function(e,t){this.specification=e,this.overrides=t};Ne.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)},Ne.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},Ne.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),v=r.property.specification.type==="resolvedImage"&&typeof h!="string"?h.name:h,_=this._calculate(v,v,v,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,v){if(r.kind==="source"){var _=r.evaluate(a,u,c,h,v);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}(Ne),$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 qi=function(e){this.specification=e};qi.prototype.possiblyEvaluate=function(e,t,r,a){return!!e.expression.evaluate(t,null,{},r,a)},qi.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 Ei(r);this.defaultTransitioningPropertyValues[t]=u.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=a.possiblyEvaluate({})}};Ve("DataDrivenProperty",Ne),Ve("DataConstantProperty",Ze),Ve("CrossFadedDataDrivenProperty",cs),Ve("CrossFadedProperty",$r),Ve("ColorRampProperty",qi);var Xi=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 Ni(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 Sr(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(rp,"layers."+this.id+".paint."+r,r,a,u))return!1;if(Sr(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",v=c.value.isDataDriven(),_=c.value;this._transitionablePaint.setValue(r,a),this._handleSpecialPaintPropertyUpdate(r);var x=this._transitionablePaint._values[r].value;return x.isDataDriven()||v||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),Xr(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&&no(a.property.specification)&&(a.value.kind==="source"||a.value.kind==="composite")&&a.value.isStateDependent)return!0}return!1},t}(te),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 Er(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=Bu(r,Math.max(t,c)),v=u.components||1;return a=Math.max(a,c),r+=c*v,{name:u.name,type:u.type,components:v,offset:h}}),size:Bu(r,Math.max(a,t)),alignment:t}}function Bu(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 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.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);uo.prototype.bytesPerElement=4,Ve("StructArrayLayout2i4",uo);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 v=4*r;return this.int16[v+0]=a,this.int16[v+1]=u,this.int16[v+2]=c,this.int16[v+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,v){var _=this.length;return this.resize(_+1),this.emplace(_,r,a,u,c,h,v)},t.prototype.emplace=function(r,a,u,c,h,v,_){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]=v,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,v){var _=this.length;return this.resize(_+1),this.emplace(_,r,a,u,c,h,v)},t.prototype.emplace=function(r,a,u,c,h,v,_){var x=4*r,S=8*r;return this.int16[x+0]=a,this.int16[x+1]=u,this.uint8[S+4]=c,this.uint8[S+5]=h,this.uint8[S+6]=v,this.uint8[S+7]=_,r},t}(kt);ui.prototype.bytesPerElement=8,Ve("StructArrayLayout2i4ub8",ui);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){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);Uo.prototype.bytesPerElement=8,Ve("StructArrayLayout2f8",Uo);var Ki=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,v,_,x,S,T){var E=this.length;return this.resize(E+1),this.emplace(E,r,a,u,c,h,v,_,x,S,T)},t.prototype.emplace=function(r,a,u,c,h,v,_,x,S,T,E){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]=v,this.uint16[k+5]=_,this.uint16[k+6]=x,this.uint16[k+7]=S,this.uint16[k+8]=T,this.uint16[k+9]=E,r},t}(kt);Ki.prototype.bytesPerElement=20,Ve("StructArrayLayout10ui20",Ki);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,v,_,x,S,T,E,k){var U=this.length;return this.resize(U+1),this.emplace(U,r,a,u,c,h,v,_,x,S,T,E,k)},t.prototype.emplace=function(r,a,u,c,h,v,_,x,S,T,E,k,U){var N=12*r;return this.int16[N+0]=a,this.int16[N+1]=u,this.int16[N+2]=c,this.int16[N+3]=h,this.uint16[N+4]=v,this.uint16[N+5]=_,this.uint16[N+6]=x,this.uint16[N+7]=S,this.int16[N+8]=T,this.int16[N+9]=E,this.int16[N+10]=k,this.int16[N+11]=U,r},t}(kt);hs.prototype.bytesPerElement=24,Ve("StructArrayLayout4i4ui4i24",hs);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,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);No.prototype.bytesPerElement=12,Ve("StructArrayLayout3f12",No);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.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);Aa.prototype.bytesPerElement=4,Ve("StructArrayLayout1ul4",Aa);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,v,_,x,S){var T=this.length;return this.resize(T+1),this.emplace(T,r,a,u,c,h,v,_,x,S)},t.prototype.emplace=function(r,a,u,c,h,v,_,x,S,T){var E=10*r,k=5*r;return this.int16[E+0]=a,this.int16[E+1]=u,this.int16[E+2]=c,this.int16[E+3]=h,this.int16[E+4]=v,this.int16[E+5]=_,this.uint32[k+3]=x,this.uint16[E+8]=S,this.uint16[E+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,v){var _=this.length;return this.resize(_+1),this.emplace(_,r,a,u,c,h,v)},t.prototype.emplace=function(r,a,u,c,h,v,_){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]=v,this.int16[x+5]=_,r},t}(kt);qo.prototype.bytesPerElement=12,Ve("StructArrayLayout2i2i2i12",qo);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.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,h){var v=this.length;return this.resize(v+1),this.emplace(v,r,a,u,c,h)},t.prototype.emplace=function(r,a,u,c,h,v){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]=v,r},t}(kt);co.prototype.bytesPerElement=16,Ve("StructArrayLayout2f1f2i16",co);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 v=12*r,_=3*r;return this.uint8[v+0]=a,this.uint8[v+1]=u,this.float32[_+1]=c,this.float32[_+2]=h,r},t}(kt);xl.prototype.bytesPerElement=12,Ve("StructArrayLayout2ub2f12",xl);var Cn=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);Cn.prototype.bytesPerElement=6,Ve("StructArrayLayout3ui6",Cn);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.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,v,_,x,S,T,E,k,U,N,J,H,re){var oe=this.length;return this.resize(oe+1),this.emplace(oe,r,a,u,c,h,v,_,x,S,T,E,k,U,N,J,H,re)},t.prototype.emplace=function(r,a,u,c,h,v,_,x,S,T,E,k,U,N,J,H,re,oe){var se=24*r,ce=12*r,ye=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]=v,this.uint32[ce+3]=_,this.uint32[ce+4]=x,this.uint16[se+10]=S,this.uint16[se+11]=T,this.uint16[se+12]=E,this.float32[ce+7]=k,this.float32[ce+8]=U,this.uint8[ye+36]=N,this.uint8[ye+37]=J,this.uint8[ye+38]=H,this.uint32[ce+10]=re,this.int16[se+22]=oe,r},t}(kt);Pn.prototype.bytesPerElement=48,Ve("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Pn);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,v,_,x,S,T,E,k,U,N,J,H,re,oe,se,ce,ye,Se,Ae,$e,ke,We,ze,lt){var Qe=this.length;return this.resize(Qe+1),this.emplace(Qe,r,a,u,c,h,v,_,x,S,T,E,k,U,N,J,H,re,oe,se,ce,ye,Se,Ae,$e,ke,We,ze,lt)},t.prototype.emplace=function(r,a,u,c,h,v,_,x,S,T,E,k,U,N,J,H,re,oe,se,ce,ye,Se,Ae,$e,ke,We,ze,lt,Qe){var qe=34*r,ct=17*r;return this.int16[qe+0]=a,this.int16[qe+1]=u,this.int16[qe+2]=c,this.int16[qe+3]=h,this.int16[qe+4]=v,this.int16[qe+5]=_,this.int16[qe+6]=x,this.int16[qe+7]=S,this.uint16[qe+8]=T,this.uint16[qe+9]=E,this.uint16[qe+10]=k,this.uint16[qe+11]=U,this.uint16[qe+12]=N,this.uint16[qe+13]=J,this.uint16[qe+14]=H,this.uint16[qe+15]=re,this.uint16[qe+16]=oe,this.uint16[qe+17]=se,this.uint16[qe+18]=ce,this.uint16[qe+19]=ye,this.uint16[qe+20]=Se,this.uint16[qe+21]=Ae,this.uint16[qe+22]=$e,this.uint32[ct+12]=ke,this.float32[ct+13]=We,this.float32[ct+14]=ze,this.float32[ct+15]=lt,this.float32[ct+16]=Qe,r},t}(kt);fs.prototype.bytesPerElement=68,Ve("StructArrayLayout8i15ui1ul4f68",fs);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.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);kn.prototype.bytesPerElement=4,Ve("StructArrayLayout1f4",kn);var Ci=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);Ci.prototype.bytesPerElement=6,Ve("StructArrayLayout3i6",Ci);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 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.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);Ea.prototype.bytesPerElement=4,Ve("StructArrayLayout2ui4",Ea);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 v=4*r;return this.float32[v+0]=a,this.float32[v+1]=u,this.float32[v+2]=c,this.float32[v+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}(Pn);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 y=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}(kn);Ve("GlyphOffsetArray",y);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}(Ci);Ve("SymbolLineVertexArray",g);var w=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);w.prototype.size=8;var A=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 w(this,r)},t}(bl);Ve("FeatureIndexArray",A);var z=Er([{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=je(Math.floor(e),0,255))+je(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 $=Er([{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,v,_,x,S;for(u=t.length-(a=3&t.length),c=r,v=3432918353,_=461845907,S=0;S<u;)x=255&t.charCodeAt(S)|(255&t.charCodeAt(++S))<<8|(255&t.charCodeAt(++S))<<16|(255&t.charCodeAt(++S))<<24,++S,c=27492+(65535&(h=5*(65535&(c=(c^=x=(65535&(x=(x=(65535&x)*v+(((x>>>16)*v&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(S+2))<<16;case 2:x^=(255&t.charCodeAt(S+1))<<8;case 1:c^=x=(65535&(x=(x=(65535&(x^=255&t.charCodeAt(S)))*v+(((x>>>16)*v&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}}),K=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=K;V.murmur3=q,V.murmur2=X;var ee=function(){this.ids=[],this.positions=[],this.indexed=!1};ee.prototype.add=function(e,t,r,a){this.ids.push(pe(e)),this.positions.push(t,r,a)},ee.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},ee.serialize=function(e,t){var r=new Float64Array(e.ids),a=new Uint32Array(e.positions);return function u(c,h,v,_){for(;v<_;){for(var x=c[v+_>>1],S=v-1,T=_+1;;){do S++;while(c[S]<x);do T--;while(c[T]>x);if(S>=T)break;ue(c,S,T),ue(h,3*S,3*T),ue(h,3*S+1,3*T+1),ue(h,3*S+2,3*T+2)}T-v<_-T?(u(c,h,v,T),v=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}},ee.deserialize=function(e){var t=new ee;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t};var ie=Math.pow(2,53)-1;function pe(e){var t=+e;return!isNaN(t)&&t<=ie?t:V(String(e))}function ue(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}Ve("FeaturePositionMap",ee);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),De=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=Et.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),Xe=new Float32Array(16),bt=function(e){function t(r,a){e.call(this,r,a),this.current=Xe}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 Fe(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=Fe(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),v=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(v,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=Fe(r),c=Fe(a),h=e;h<t;h++)this.paintVertexArray.emplace(h,u[0],u[1],c[0],c[1]);else{for(var v=e;v<t;v++)this.paintVertexArray.emplace(v,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=je(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 v=e;v<t;v++)this.zoomInPaintVertexArray.emplace(v,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(v,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&&no(c.property.specification)){var h=_r(u,e.type),v=c.value,_=c.property.specification.type,x=c.property.useIntegerZoom,S=c.property.specification["property-type"],T=S==="cross-faded"||S==="cross-faded-data-driven";if(v.kind==="constant")this.binders[u]=T?new st(v.value,h):new nt(v.value,h,_),a.push("/u_"+u);else if(v.kind==="source"||T){var E=Qt(u,_,"source");this.binders[u]=T?new at(v,_,x,t,E,e.id):new it(v,h,_,E),a.push("/a_"+u)}else{var k=Qt(u,_,"composite");this.binders[u]=new rt(v,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 v=0,_=t.getPositions(h);v<_.length;v+=1){var x=_[v],S=r.feature(x.index);for(var T in this.binders){var E=this.binders[T];if((E instanceof it||E instanceof rt||E instanceof at)&&E.expression.isStateDependent===!0){var k=a.paint.get(T);E.expression=k.value,E.updatePaintArray(x.start,x.end,S,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 v=h[c];if(t[v]){var _=u.getBinding(e,t[v],v);r.push({name:v,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],v=h.name,_=h.property;this.binders[_].setUniform(h.binding,a,r.get(_),v)}},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 ee,this._bufferOffset=0};function _r(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:Uo,composite:ds},number:{source:kn,composite:Uo}},u=function(c){return{"line-pattern":{source:Ki,composite:Ki},"fill-pattern":{source:Ki,composite:Ki},"fill-extrusion-pattern":{source:Ki,composite:Ki}}[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 Jt(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],v=Math.round(h.x*t),_=Math.round(h.y*t);h.x=je(v,Cr,Rr),h.y=je(_,Cr,Rr),(v<h.x||v>h.x+1||_<h.y||_>h.y+1)&&Lt("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function or(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?Jt(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 uo,this.indexArray=new Cn,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 Mn(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)||!!zn(t,e,r)}function ji(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 Pi(e,t,r){if(e.length>1){if(Ca(e,t))return!0;for(var a=0;a<t.length;a++)if(zn(t[a],e,r))return!0}for(var u=0;u<e.length;u++)if(zn(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 zn(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 v=0,_=(r=e[h]).length-1;v<r.length;_=v++)(a=r[v]).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 Yi(e,t,r){var a=t.paint.get(e).value;return a.kind==="constant"?a.value:r.programConfigurations.get(t.id).getMaxValue(e)}function xr(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=[],v=0;v<e.length;v++)h.push(e[v].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,v=e;h<v.length;h+=1){var _=v[h],x=_.feature,S=_.id,T=_.index,E=_.sourceLayerIndex,k=this.layers[0]._featureFilter.needGeometry,U=or(x,k);if(this.layers[0]._featureFilter.filter(new ht(this.zoom),U,r)){var N=c?c.evaluate(U,{},r):void 0,J={id:S,properties:x.properties,type:x.type,sourceLayerIndex:E,index:T,geometry:k?U.geometry:Jt(x),patterns:{},sortKey:N};u.push(J)}}c&&u.sort(function(Ae,$e){return Ae.sortKey-$e.sortKey});for(var H=0,re=u;H<re.length;H+=1){var oe=re[H],se=oe.geometry,ce=oe.index,ye=oe.sourceLayerIndex,Se=e[ce].feature;this.addFeature(oe,se,ce,r),t.featureIndex.insert(Se,se,ce,ye,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,v=c[u];h<v.length;h+=1){var _=v[h],x=_.x,S=_.y;if(!(x<0||x>=8192||S<0||S>=8192)){var T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),E=T.vertexLength;ci(this.layoutVertexArray,x,S,-1,-1),ci(this.layoutVertexArray,x,S,1,-1),ci(this.layoutVertexArray,x,S,1,1),ci(this.layoutVertexArray,x,S,-1,1),this.indexArray.emplaceBack(E,E+1,E+2),this.indexArray.emplaceBack(E,E+3,E+2),T.vertexLength+=4,T.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},a)},Ve("CircleBucket",Zr,{omit:["layers"]});var Bn=new Lr({"circle-sort-key":new Ne(B.layout_circle["circle-sort-key"])}),po={paint:new Lr({"circle-radius":new Ne(B.paint_circle["circle-radius"]),"circle-color":new Ne(B.paint_circle["circle-color"]),"circle-blur":new Ne(B.paint_circle["circle-blur"]),"circle-opacity":new Ne(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 Ne(B.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ne(B.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ne(B.paint_circle["circle-stroke-opacity"])}),layout:Bn},Ct=typeof Float32Array<"u"?Float32Array:Array;function mi(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],v=t[4],_=t[5],x=t[6],S=t[7],T=t[8],E=t[9],k=t[10],U=t[11],N=t[12],J=t[13],H=t[14],re=t[15],oe=r[0],se=r[1],ce=r[2],ye=r[3];return e[0]=oe*a+se*v+ce*T+ye*N,e[1]=oe*u+se*_+ce*E+ye*J,e[2]=oe*c+se*x+ce*k+ye*H,e[3]=oe*h+se*S+ce*U+ye*re,e[4]=(oe=r[4])*a+(se=r[5])*v+(ce=r[6])*T+(ye=r[7])*N,e[5]=oe*u+se*_+ce*E+ye*J,e[6]=oe*c+se*x+ce*k+ye*H,e[7]=oe*h+se*S+ce*U+ye*re,e[8]=(oe=r[8])*a+(se=r[9])*v+(ce=r[10])*T+(ye=r[11])*N,e[9]=oe*u+se*_+ce*E+ye*J,e[10]=oe*c+se*x+ce*k+ye*H,e[11]=oe*h+se*S+ce*U+ye*re,e[12]=(oe=r[12])*a+(se=r[13])*v+(ce=r[14])*T+(ye=r[15])*N,e[13]=oe*u+se*_+ce*E+ye*J,e[14]=oe*c+se*x+ce*k+ye*H,e[15]=oe*h+se*S+ce*U+ye*re,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 ho,ip=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}ho=new Ct(3),Ct!=Float32Array&&(ho[0]=0,ho[1]=0,ho[2]=0),function(){var e=new Ct(4);Ct!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0)}();var np=(function(){var e=new Ct(2);Ct!=Float32Array&&(e[0]=0,e[1]=0)}(),function(e){function t(r){e.call(this,r,po)}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 Yi("circle-radius",this,a)+Yi("circle-stroke-width",this,a)+xr(this.paint.get("circle-translate"))},t.prototype.queryIntersectsFeature=function(r,a,u,c,h,v,_,x){for(var S=cn(r,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),v.angle,_),T=this.paint.get("circle-radius").evaluate(a,u)+this.paint.get("circle-stroke-width").evaluate(a,u),E=this.paint.get("circle-pitch-alignment")==="map",k=E?S:function(Se,Ae){return Se.map(function($e){return Ma($e,Ae)})}(S,x),U=E?T*_:T,N=0,J=c;N<J.length;N+=1)for(var H=0,re=J[N];H<re.length;H+=1){var oe=re[H],se=E?oe:Ma(oe,x),ce=U,ye=ms([],[oe.x,oe.y,0,1],x);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?ce*=ye[3]/v.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(ce*=v.cameraToCenterDistance/ye[3]),Qr(k,se,ce))return!0}return!1},t}(Xi));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 Du=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);op(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 op(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,v=t.data,_=0;_<u.height;_++)for(var x=((r.y+_)*e.width+r.x)*c,S=((a.y+_)*t.width+a.x)*c,T=0;T<u.width*c;T++)v[S+T]=h[x+T];return t}Ve("HeatmapBucket",Du,{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){op(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){op(e,t,r,a,u,4)},Ve("AlphaImage",za),Ve("RGBAImage",pi);var Sg={paint:new Lr({"heatmap-radius":new Ne(B.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ne(B.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ze(B.paint_heatmap["heatmap-intensity"]),"heatmap-color":new qi(B.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ze(B.paint_heatmap["heatmap-opacity"])})};function Cf(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(U,N,J){t[e.evaluationKey]=J;var H=e.expression.evaluate(t);u.data[U+N+0]=Math.floor(255*H.r/H.a),u.data[U+N+1]=Math.floor(255*H.g/H.a),u.data[U+N+2]=Math.floor(255*H.b/H.a),u.data[U+N+3]=Math.floor(255*H.a)};if(e.clips)for(var h=0,v=0;h<a;++h,v+=4*r)for(var _=0,x=0;_<r;_++,x+=4){var S=_/(r-1),T=e.clips[h];c(v,x,T.start*(1-S)+T.end*S)}else for(var E=0,k=0;E<r;E++,k+=4)c(0,k,E/(r-1));return u}var Tg=function(e){function t(r){e.call(this,r,Sg),this._updateColorRamp()}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new Du(r)},t.prototype._handleSpecialPaintPropertyUpdate=function(r){r==="heatmap-color"&&this._updateColorRamp()},t.prototype._updateColorRamp=function(){this.colorRamp=Cf({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}(Xi),Ig={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"])})},Ag=function(e){function t(r){e.call(this,r,Ig)}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}(Xi),Eg=Er([{name:"a_pos",components:2,type:"Int16"}],4).members,ap=Lu,Cg=Lu;function Lu(e,t,r){r=r||2;var a,u,c,h,v,_,x,S=t&&t.length,T=S?t[0]*r:e.length,E=Pf(e,0,T,r,!0),k=[];if(!E||E.next===E.prev)return k;if(S&&(E=function(N,J,H,re){var oe,se,ce,ye=[];for(oe=0,se=J.length;oe<se;oe++)(ce=Pf(N,J[oe]*re,oe<se-1?J[oe+1]*re:N.length,re,!1))===ce.next&&(ce.steiner=!0),ye.push(Rg(ce));for(ye.sort(Bg),oe=0;oe<ye.length;oe++)Dg(ye[oe],H),H=Go(H,H.next);return H}(e,t,E,r)),e.length>80*r){a=c=e[0],u=h=e[1];for(var U=r;U<T;U+=r)(v=e[U])<a&&(a=v),(_=e[U+1])<u&&(u=_),v>c&&(c=v),_>h&&(h=_);x=(x=Math.max(c-a,h-u))!==0?1/x:0}return Sl(E,k,r,a,u,x),k}function Pf(e,t,r,a,u){var c,h;if(u===up(e,t,r,a)>0)for(c=t;c<r;c+=a)h=zf(c,e[c],e[c+1],h);else for(c=r-a;c>=t;c-=a)h=zf(c,e[c],e[c+1],h);return h&&Ru(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||!Ru(a,a.next)&&mr(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(S,T,E,k){var U=S;do U.z===null&&(U.z=sp(U.x,U.y,T,E,k)),U.prevZ=U.prev,U.nextZ=U.next,U=U.next;while(U!==S);U.prevZ.nextZ=null,U.prevZ=null,function(N){var J,H,re,oe,se,ce,ye,Se,Ae=1;do{for(H=N,N=null,se=null,ce=0;H;){for(ce++,re=H,ye=0,J=0;J<Ae&&(ye++,re=re.nextZ);J++);for(Se=Ae;ye>0||Se>0&&re;)ye!==0&&(Se===0||!re||H.z<=re.z)?(oe=H,H=H.nextZ,ye--):(oe=re,re=re.nextZ,Se--),se?se.nextZ=oe:N=oe,oe.prevZ=se,se=oe;H=re}se.nextZ=null,Ae*=2}while(ce>1)}(U)}(e,a,u,c);for(var v,_,x=e;e.prev!==e.next;)if(v=e.prev,_=e.next,c?kg(e,a,u,c):Pg(e))t.push(v.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=Mg(Go(e),t,r),t,r,a,u,c,2):h===2&&zg(e,t,r,a,u,c):Sl(Go(e),t,r,a,u,c,1);break}}}function Pg(e){var t=e.prev,r=e,a=e.next;if(mr(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)&&mr(u.prev,u,u.next)>=0)return!1;u=u.next}return!0}function kg(e,t,r,a){var u=e.prev,c=e,h=e.next;if(mr(u,c,h)>=0)return!1;for(var v=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=sp(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),S=sp(v,_,t,r,a),T=e.prevZ,E=e.nextZ;T&&T.z>=x&&E&&E.z<=S;){if(T!==e.prev&&T!==e.next&&vs(u.x,u.y,c.x,c.y,h.x,h.y,T.x,T.y)&&mr(T.prev,T,T.next)>=0||(T=T.prevZ,E!==e.prev&&E!==e.next&&vs(u.x,u.y,c.x,c.y,h.x,h.y,E.x,E.y)&&mr(E.prev,E,E.next)>=0))return!1;E=E.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)&&mr(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;E&&E.z<=S;){if(E!==e.prev&&E!==e.next&&vs(u.x,u.y,c.x,c.y,h.x,h.y,E.x,E.y)&&mr(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function Mg(e,t,r){var a=e;do{var u=a.prev,c=a.next.next;!Ru(u,c)&&kf(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 zg(e,t,r,a,u,c){var h=e;do{for(var v=h.next.next;v!==h.prev;){if(h.i!==v.i&&Fg(h,v)){var _=Mf(h,v);return h=Go(h,h.next),_=Go(_,_.next),Sl(h,t,r,a,u,c),void Sl(_,t,r,a,u,c)}v=v.next}h=h.next}while(h!==e)}function Bg(e,t){return e.x-t.x}function Dg(e,t){if(t=function(a,u){var c,h=u,v=a.x,_=a.y,x=-1/0;do{if(_<=h.y&&_>=h.next.y&&h.next.y!==h.y){var S=h.x+(_-h.y)*(h.next.x-h.x)/(h.next.y-h.y);if(S<=v&&S>x){if(x=S,S===v){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(v===x)return c;var T,E=c,k=c.x,U=c.y,N=1/0;h=c;do v>=h.x&&h.x>=k&&v!==h.x&&vs(_<U?v:x,_,k,U,_<U?x:v,_,h.x,h.y)&&(T=Math.abs(_-h.y)/(v-h.x),Tl(h,a)&&(T<N||T===N&&(h.x>c.x||h.x===c.x&&Lg(c,h)))&&(c=h,N=T)),h=h.next;while(h!==E);return c}(e,t)){var r=Mf(t,e);Go(t,t.next),Go(r,r.next)}}function Lg(e,t){return mr(e.prev,e,t.prev)<0&&mr(t.next,e,e.next)<0}function sp(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 Rg(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,v){return(u-h)*(t-v)-(e-h)*(c-v)>=0&&(e-h)*(a-v)-(r-h)*(t-v)>=0&&(r-h)*(c-v)-(u-h)*(a-v)>=0}function Fg(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&&kf(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,v=(r.y+a.y)/2;do u.y>v!=u.next.y>v&&u.next.y!==u.y&&h<(u.next.x-u.x)*(v-u.y)/(u.next.y-u.y)+u.x&&(c=!c),u=u.next;while(u!==r);return c}(e,t)&&(mr(e.prev,e,t.prev)||mr(e,t.prev,t))||Ru(e,t)&&mr(e.prev,e,e.next)>0&&mr(t.prev,t,t.next)>0)}function mr(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Ru(e,t){return e.x===t.x&&e.y===t.y}function kf(e,t,r,a){var u=Ou(mr(e,t,r)),c=Ou(mr(e,t,a)),h=Ou(mr(r,a,e)),v=Ou(mr(r,a,t));return u!==c&&h!==v||!(u!==0||!Fu(e,r,t))||!(c!==0||!Fu(e,a,t))||!(h!==0||!Fu(r,e,a))||!(v!==0||!Fu(r,t,a))}function Fu(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 Ou(e){return e>0?1:e<0?-1:0}function Tl(e,t){return mr(e.prev,e,e.next)<0?mr(e,t,e.next)>=0&&mr(e,e.prev,t)>=0:mr(e,t,e.prev)<0||mr(e,e.next,t)<0}function Mf(e,t){var r=new lp(e.i,e.x,e.y),a=new lp(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 zf(e,t,r,a){var u=new lp(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 lp(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 up(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 Og(e,t,r,a,u){(function c(h,v,_,x,S){for(;x>_;){if(x-_>600){var T=x-_+1,E=v-_+1,k=Math.log(T),U=.5*Math.exp(2*k/3),N=.5*Math.sqrt(k*U*(T-U)/T)*(E-T/2<0?-1:1);c(h,v,Math.max(_,Math.floor(v-E*U/T+N)),Math.min(x,Math.floor(v+(T-E)*U/T+N)),S)}var J=h[v],H=_,re=x;for(Al(h,_,v),S(h[x],J)>0&&Al(h,_,x);H<re;){for(Al(h,H,re),H++,re--;S(h[H],J)<0;)H++;for(;S(h[re],J)>0;)re--}S(h[_],J)===0?Al(h,_,re):Al(h,++re,x),re<=v&&(_=re+1),v<=re&&(x=re-1)}})(e,t,r,a||e.length-1,u||Vg)}function Al(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function Vg(e,t){return e<t?-1:e>t?1:0}function cp(e,t){var r=e.length;if(r<=1)return[e];for(var a,u,c=[],h=0;h<r;h++){var v=To(e[h]);v!==0&&(e[h].area=Math.abs(v),u===void 0&&(u=v<0),u===v<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||(Og(c[_],t,1,c[_].length-1,Ug),c[_]=c[_].slice(0,t));return c}function Ug(e,t){return t.area-e.area}function pp(e,t,r){for(var a=r.patternDependencies,u=!1,c=0,h=t;c<h.length;c+=1){var v=h[c].paint.get(e+"-pattern");v.isConstant()||(u=!0);var _=v.constantOr(null);_&&(u=!0,a[_.to]=!0,a[_.from]=!0)}return u}function hp(e,t,r,a,u){for(var c=u.patternDependencies,h=0,v=t;h<v.length;h+=1){var _=v[h],x=_.paint.get(e+"-pattern").value;if(x.kind!=="constant"){var S=x.evaluate({zoom:a-1},r,{},u.availableImages),T=x.evaluate({zoom:a},r,{},u.availableImages),E=x.evaluate({zoom:a+1},r,{},u.availableImages);T=T&&T.name?T.name:T,E=E&&E.name?E.name:E,c[S=S&&S.name?S.name:S]=!0,c[T]=!0,c[E]=!0,r.patterns[_.id]={min:S,mid:T,max:E}}}return r}Lu.deviation=function(e,t,r,a){var u=t&&t.length,c=Math.abs(up(e,0,u?t[0]*r:e.length,r));if(u)for(var h=0,v=t.length;h<v;h++)c-=Math.abs(up(e,t[h]*r,h<v-1?t[h+1]*r:e.length,r));var _=0;for(h=0;h<a.length;h+=3){var x=a[h]*r,S=a[h+1]*r,T=a[h+2]*r;_+=Math.abs((e[x]-e[T])*(e[S+1]-e[x+1])-(e[x]-e[S])*(e[T+1]-e[x+1]))}return c===0&&_===0?0:Math.abs((_-c)/c)},Lu.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},ap.default=Cg;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 uo,this.indexArray=new Cn,this.indexArray2=new Ea,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=pp("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 v=h[c],_=v.feature,x=v.id,S=v.index,T=v.sourceLayerIndex,E=this.layers[0]._featureFilter.needGeometry,k=or(_,E);if(this.layers[0]._featureFilter.filter(new ht(this.zoom),k,r)){var U=a?a.evaluate(k,{},r,t.availableImages):void 0,N={id:x,properties:_.properties,type:_.type,sourceLayerIndex:T,index:S,geometry:E?k.geometry:Jt(_),patterns:{},sortKey:U};u.push(N)}}a&&u.sort(function(Se,Ae){return Se.sortKey-Ae.sortKey});for(var J=0,H=u;J<H.length;J+=1){var re=H[J],oe=re.geometry,se=re.index,ce=re.sourceLayerIndex;if(this.hasPattern){var ye=hp("fill",this.layers,re,this.zoom,t);this.patternFeatures.push(ye)}else this.addFeature(re,oe,se,r,{});t.featureIndex.insert(e[se].feature,oe,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,Eg),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=cp(t,500);c<h.length;c+=1){for(var v=h[c],_=0,x=0,S=v;x<S.length;x+=1)_+=S[x].length;for(var T=this.segments.prepareSegment(_,this.layoutVertexArray,this.indexArray),E=T.vertexLength,k=[],U=[],N=0,J=v;N<J.length;N+=1){var H=J[N];if(H.length!==0){H!==v[0]&&U.push(k.length/2);var re=this.segments2.prepareSegment(H.length,this.layoutVertexArray,this.indexArray2),oe=re.vertexLength;this.layoutVertexArray.emplaceBack(H[0].x,H[0].y),this.indexArray2.emplaceBack(oe+H.length-1,oe),k.push(H[0].x),k.push(H[0].y);for(var se=1;se<H.length;se++)this.layoutVertexArray.emplaceBack(H[se].x,H[se].y),this.indexArray2.emplaceBack(oe+se-1,oe+se),k.push(H[se].x),k.push(H[se].y);re.vertexLength+=H.length,re.primitiveLength+=H.length}}for(var ce=ap(k,U),ye=0;ye<ce.length;ye+=3)this.indexArray.emplaceBack(E+ce[ye],E+ce[ye+1],E+ce[ye+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 Ng=new Lr({"fill-sort-key":new Ne(B.layout_fill["fill-sort-key"])}),qg={paint:new Lr({"fill-antialias":new Ze(B.paint_fill["fill-antialias"]),"fill-opacity":new Ne(B.paint_fill["fill-opacity"]),"fill-color":new Ne(B.paint_fill["fill-color"]),"fill-outline-color":new Ne(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:Ng},jg=function(e){function t(r){e.call(this,r,qg)}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 xr(this.paint.get("fill-translate"))},t.prototype.queryIntersectsFeature=function(r,a,u,c,h,v,_){return ji(cn(r,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),v.angle,_),c)},t.prototype.isTileClipped=function(){return!0},t}(Xi),$g=Er([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,Bf=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(Zg,this,t)}function Zg(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()],v=u._values[a.readVarint()];u.properties[h]=v}}(r,t):e==3?t.type=r.readVarint():e==4&&(t._geometry=r.pos)}function Gg(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,v=[];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&&v.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&&v.push(t),v},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,v=-1/0,_=1/0,x=-1/0;e.pos<t;){if(a<=0){var S=e.readVarint();r=7&S,a=S>>3}if(a--,r===1||r===2)(u+=e.readSVarint())<h&&(h=u),u>v&&(v=u),(c+=e.readSVarint())<_&&(_=c),c>x&&(x=c);else if(r!==7)throw new Error("unknown command "+r)}return[h,_,v,x]},gs.prototype.toGeoJSON=function(e,t,r){var a,u,c=this.extent*Math.pow(2,r),h=this.extent*e,v=this.extent*t,_=this.loadGeometry(),x=gs.types[this.type];function S(k){for(var U=0;U<k.length;U++){var N=k[U];k[U]=[360*(N.x+h)/c-180,360/Math.PI*Math.atan(Math.exp((180-360*(N.y+v)/c)*Math.PI/180))-90]}}switch(this.type){case 1:var T=[];for(a=0;a<_.length;a++)T[a]=_[a][0];S(_=T);break;case 2:for(a=0;a<_.length;a++)S(_[a]);break;case 3:for(_=function(k){var U=k.length;if(U<=1)return[k];for(var N,J,H=[],re=0;re<U;re++){var oe=Gg(k[re]);oe!==0&&(J===void 0&&(J=oe<0),J===oe<0?(N&&H.push(N),N=[k[re]]):N.push(k[re]))}return N&&H.push(N),H}(_),a=0;a<_.length;a++)for(u=0;u<_[a].length;u++)S(_[a][u])}_.length===1?_=_[0]:x="Multi"+x;var E={type:"Feature",geometry:{type:x,coordinates:_},properties:this.properties};return"id"in this&&(E.id=this.id),E};var Df=Lf;function Lf(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(Wg,this,t),this.length=this._features.length}function Wg(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 Hg(e,t,r){if(e===3){var a=new Df(r,r.readVarint()+r.pos);a.length&&(t[a.name]=a)}}Lf.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 Bf(this._pbf,t,this.extent,this._keys,this._values)};var _s={VectorTile:function(e,t){this.layers=e.readFields(Hg,{},t)},VectorTileFeature:Bf,VectorTileLayer:Df},Xg=_s.VectorTileFeature.types,fp=Math.pow(2,13);function El(e,t,r,a,u,c,h,v){e.emplaceBack(t,r,2*Math.floor(a*fp)+h,u*fp*2,c*fp*2,Math.round(v))}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 Cn,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 Kg(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=pp("fill-extrusion",this.layers,t);for(var a=0,u=e;a<u.length;a+=1){var c=u[a],h=c.feature,v=c.id,_=c.index,x=c.sourceLayerIndex,S=this.layers[0]._featureFilter.needGeometry,T=or(h,S);if(this.layers[0]._featureFilter.filter(new ht(this.zoom),T,r)){var E={id:v,sourceLayerIndex:x,index:_,geometry:S?T.geometry:Jt(h),properties:h.properties,type:h.type,patterns:{}};this.hasPattern?this.features.push(hp("fill-extrusion",this.layers,E,this.zoom,t)):this.addFeature(E,E.geometry,_,r,{}),t.featureIndex.insert(h,E.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,$g),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=cp(t,500);c<h.length;c+=1){for(var v=h[c],_=0,x=0,S=v;x<S.length;x+=1)_+=S[x].length;for(var T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),E=0,k=v;E<k.length;E+=1){var U=k[E];if(U.length!==0&&!((ct=U).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 N=0,J=0;J<U.length;J++){var H=U[J];if(J>=1){var re=U[J-1];if(!Kg(H,re)){T.vertexLength+4>D.MAX_VERTEX_ARRAY_LENGTH&&(T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var oe=H.sub(re)._perp()._unit(),se=re.dist(H);N+se>32768&&(N=0),El(this.layoutVertexArray,H.x,H.y,oe.x,oe.y,0,0,N),El(this.layoutVertexArray,H.x,H.y,oe.x,oe.y,0,1,N),El(this.layoutVertexArray,re.x,re.y,oe.x,oe.y,0,0,N+=se),El(this.layoutVertexArray,re.x,re.y,oe.x,oe.y,0,1,N);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)),Xg[e.type]==="Polygon"){for(var ye=[],Se=[],Ae=T.vertexLength,$e=0,ke=v;$e<ke.length;$e+=1){var We=ke[$e];if(We.length!==0){We!==v[0]&&Se.push(ye.length/2);for(var ze=0;ze<We.length;ze++){var lt=We[ze];El(this.layoutVertexArray,lt.x,lt.y,0,0,1,1,0),ye.push(lt.x),ye.push(lt.y)}}}for(var Qe=ap(ye,Se),qe=0;qe<Qe.length;qe+=3)this.indexArray.emplaceBack(Ae+Qe[qe],Ae+Qe[qe+2],Ae+Qe[qe+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 Jg={paint:new Lr({"fill-extrusion-opacity":new Ze(B["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ne(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 Ne(B["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ne(B["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ze(B["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},Yg=function(e){function t(r){e.call(this,r,Jg)}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 xr(this.paint.get("fill-extrusion-translate"))},t.prototype.is3D=function(){return!0},t.prototype.queryIntersectsFeature=function(r,a,u,c,h,v,_,x){var S=cn(r,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),v.angle,_),T=this.paint.get("fill-extrusion-height").evaluate(a,u),E=this.paint.get("fill-extrusion-base").evaluate(a,u),k=function(N,J,H,re){for(var oe=[],se=0,ce=N;se<ce.length;se+=1){var ye=ce[se],Se=[ye.x,ye.y,0,1];ms(Se,Se,J),oe.push(new me(Se[0]/Se[3],Se[1]/Se[3]))}return oe}(S,x),U=function(N,J,H,re){for(var oe=[],se=[],ce=re[8]*J,ye=re[9]*J,Se=re[10]*J,Ae=re[11]*J,$e=re[8]*H,ke=re[9]*H,We=re[10]*H,ze=re[11]*H,lt=0,Qe=N;lt<Qe.length;lt+=1){for(var qe=[],ct=[],ot=0,xt=Qe[lt];ot<xt.length;ot+=1){var He=xt[ot],St=He.x,Wt=He.y,er=re[0]*St+re[4]*Wt+re[12],Yt=re[1]*St+re[5]*Wt+re[13],Ht=re[2]*St+re[6]*Wt+re[14],tr=re[3]*St+re[7]*Wt+re[15],br=Ht+Se,wr=tr+Ae,Wr=er+$e,kr=Yt+ke,Hr=Ht+We,ar=tr+ze,Mr=new me((er+ce)/wr,(Yt+ye)/wr);Mr.z=br/wr,qe.push(Mr);var ft=new me(Wr/ar,kr/ar);ft.z=Hr/ar,ct.push(ft)}oe.push(qe),se.push(ct)}return[oe,se]}(c,E,T,x);return function(N,J,H){var re=1/0;ji(H,J)&&(re=Rf(H,J[0]));for(var oe=0;oe<J.length;oe++)for(var se=J[oe],ce=N[oe],ye=0;ye<se.length-1;ye++){var Se=se[ye],Ae=[Se,se[ye+1],ce[ye+1],ce[ye],Se];Mn(H,Ae)&&(re=Math.min(re,Rf(H,Ae)))}return re!==1/0&&re}(U[0],U[1],k)},t}(Xi);function Cl(e,t){return e.x*t.x+e.y*t.y}function Rf(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],v=r.sub(u),_=c.sub(u),x=h.sub(u),S=Cl(v,v),T=Cl(v,_),E=Cl(_,_),k=Cl(x,v),U=Cl(x,_),N=S*E-T*T,J=(E*k-T*U)/N,H=(S*U-T*k)/N,re=u.z*(1-J-H)+r.z*J+c.z*H;if(isFinite(re))return re}return 1/0}for(var oe=1/0,se=0,ce=t;se<ce.length;se+=1)oe=Math.min(oe,ce[se].z);return oe}var Qg=Er([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,e_=Er([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,t_=_s.VectorTileFeature.types,r_=Math.cos(Math.PI/180*37.5),Ff=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 Uo,this.indexArray=new Cn,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=pp("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 v=h[c],_=v.feature,x=v.id,S=v.index,T=v.sourceLayerIndex,E=this.layers[0]._featureFilter.needGeometry,k=or(_,E);if(this.layers[0]._featureFilter.filter(new ht(this.zoom),k,r)){var U=a?a.evaluate(k,{},r):void 0,N={id:x,properties:_.properties,type:_.type,sourceLayerIndex:T,index:S,geometry:E?k.geometry:Jt(_),patterns:{},sortKey:U};u.push(N)}}a&&u.sort(function(Se,Ae){return Se.sortKey-Ae.sortKey});for(var J=0,H=u;J<H.length;J+=1){var re=H[J],oe=re.geometry,se=re.index,ce=re.sourceLayerIndex;if(this.hasPattern){var ye=hp("line",this.layers,re,this.zoom,t);this.patternFeatures.push(ye)}else this.addFeature(re,oe,se,r,{});t.featureIndex.insert(e[se].feature,oe,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,e_)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Qg),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,{}),v=c.get("line-cap"),_=c.get("line-miter-limit"),x=c.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(var S=0,T=t;S<T.length;S+=1)this.addLine(T[S],e,h,v,_,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 v=t_[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(!(_<(v?3:2))){r==="bevel"&&(u=1.05);var S,T=this.overscaling<=16?122880/(512*this.overscaling):0,E=this.segments.prepareSegment(10*_,this.layoutVertexArray,this.indexArray),k=void 0,U=void 0,N=void 0,J=void 0;this.e1=this.e2=-1,v&&(J=e[x].sub(S=e[_-2])._unit()._perp());for(var H=x;H<_;H++)if(!(U=H===_-1?v?e[x+1]:void 0:e[H+1])||!e[H].equals(U)){J&&(N=J),S&&(k=S),S=e[H],J=U?U.sub(S)._unit()._perp():N;var re=(N=N||J).add(J);re.x===0&&re.y===0||re._unit();var oe=N.x*J.x+N.y*J.y,se=re.x*J.x+re.y*J.y,ce=se!==0?1/se:1/0,ye=2*Math.sqrt(2-2*se),Se=se<r_&&k&&U,Ae=N.x*J.y-N.y*J.x>0;if(Se&&H>x){var $e=S.dist(k);if($e>2*T){var ke=S.sub(S.sub(k)._mult(T/$e)._round());this.updateDistance(k,ke),this.addCurrentVertex(ke,N,0,0,E),k=ke}}var We=k&&U,ze=We?r:v?"butt":a;if(We&&ze==="round"&&(ce<c?ze="miter":ce<=2&&(ze="fakeround")),ze==="miter"&&ce>u&&(ze="bevel"),ze==="bevel"&&(ce>2&&(ze="flipbevel"),ce<u&&(ze="miter")),k&&this.updateDistance(k,S),ze==="miter")re._mult(ce),this.addCurrentVertex(S,re,0,0,E);else if(ze==="flipbevel"){if(ce>100)re=J.mult(-1);else{var lt=ce*N.add(J).mag()/N.sub(J).mag();re._perp()._mult(lt*(Ae?-1:1))}this.addCurrentVertex(S,re,0,0,E),this.addCurrentVertex(S,re.mult(-1),0,0,E)}else if(ze==="bevel"||ze==="fakeround"){var Qe=-Math.sqrt(ce*ce-1),qe=Ae?Qe:0,ct=Ae?0:Qe;if(k&&this.addCurrentVertex(S,N,qe,ct,E),ze==="fakeround")for(var ot=Math.round(180*ye/Math.PI/20),xt=1;xt<ot;xt++){var He=xt/ot;if(He!==.5){var St=He-.5;He+=He*St*(He-1)*((1.0904+oe*(oe*(3.55645-1.43519*oe)-3.2452))*St*St+(.848013+oe*(.215638*oe-1.06021)))}var Wt=J.sub(N)._mult(He)._add(N)._unit()._mult(Ae?-1:1);this.addHalfVertex(S,Wt.x,Wt.y,!1,Ae,0,E)}U&&this.addCurrentVertex(S,J,-qe,-ct,E)}else if(ze==="butt")this.addCurrentVertex(S,re,0,0,E);else if(ze==="square"){var er=k?1:-1;this.addCurrentVertex(S,re,er,er,E)}else ze==="round"&&(k&&(this.addCurrentVertex(S,N,0,0,E),this.addCurrentVertex(S,N,1,1,E,!0)),U&&(this.addCurrentVertex(S,J,-1,-1,E,!0),this.addCurrentVertex(S,J,0,0,E)));if(Se&&H<_-1){var Yt=S.dist(U);if(Yt>2*T){var Ht=S.add(U.sub(S)._mult(T/Yt)._round());this.updateDistance(S,Ht),this.addCurrentVertex(Ht,J,0,0,E),S=Ht}}}}},ti.prototype.addCurrentVertex=function(e,t,r,a,u,c){c===void 0&&(c=!1);var h=t.y*a-t.x,v=-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,v,c,!0,-a,u),this.distance>Ff/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 v=.5*(this.lineClips?this.scaledDistance*(Ff-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&v)<<2,v>>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 i_=new Lr({"line-cap":new Ze(B.layout_line["line-cap"]),"line-join":new Ne(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 Ne(B.layout_line["line-sort-key"])}),Of={paint:new Lr({"line-opacity":new Ne(B.paint_line["line-opacity"]),"line-color":new Ne(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 Ne(B.paint_line["line-width"]),"line-gap-width":new Ne(B.paint_line["line-gap-width"]),"line-offset":new Ne(B.paint_line["line-offset"]),"line-blur":new Ne(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 qi(B.paint_line["line-gradient"])}),layout:i_},Vf=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=tt({},a,{zoom:Math.floor(a.zoom)}),e.prototype.evaluate.call(this,r,a,u,c)},t}(Ne))(Of.paint.properties["line-width"].specification);Vf.useIntegerZoom=!0;var n_=function(e){function t(r){e.call(this,r,Of),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"]=Vf.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=Uf(Yi("line-width",this,a),Yi("line-gap-width",this,a)),c=Yi("line-offset",this,a);return u/2+Math.abs(c)+xr(this.paint.get("line-translate"))},t.prototype.queryIntersectsFeature=function(r,a,u,c,h,v,_){var x=cn(r,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),v.angle,_),S=_/2*Uf(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(E,k){for(var U=[],N=new me(0,0),J=0;J<E.length;J++){for(var H=E[J],re=[],oe=0;oe<H.length;oe++){var se=H[oe],ce=H[oe+1],ye=oe===0?N:se.sub(H[oe-1])._unit()._perp(),Se=oe===H.length-1?N:ce.sub(se)._unit()._perp(),Ae=ye._add(Se)._unit();Ae._mult(1/(Ae.x*Se.x+Ae.y*Se.y)),re.push(Ae._mult(k)._add(se))}U.push(re)}return U}(c,T*_)),function(E,k,U){for(var N=0;N<k.length;N++){var J=k[N];if(E.length>=3){for(var H=0;H<J.length;H++)if(Ji(E,J[H]))return!0}if(Pi(E,J,U))return!0}return!1}(x,c,S)},t.prototype.isTileClipped=function(){return!0},t}(Xi);function Uf(e,t){return t>0?t+2*e:e}var o_=Er([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),a_=Er([{name:"a_projected_pos",components:3,type:"Float32"}],4),s_=(Er([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Er([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Nf=(Er([{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"}]),Er([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),l_=Er([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function u_(e,t,r){return e.sections.forEach(function(a){a.text=function(u,c,h){var v=c.layout.get("text-transform").evaluate(h,{});return v==="uppercase"?u=u.toLocaleUpperCase():v==="lowercase"&&(u=u.toLocaleLowerCase()),di.applyArabicShaping&&(u=di.applyArabicShaping(u)),u}(a.text,t,r)}),e}Er([{name:"triangle",components:3,type:"Uint16"}]),Er([{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"}]),Er([{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"}]),Er([{type:"Float32",name:"offsetX"}]),Er([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Pl={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},qf=function(e,t,r,a,u){var c,h,v=8*u-a-1,_=(1<<v)-1,x=_>>1,S=-7,T=u-1,E=-1,k=e[t+T];for(T+=E,c=k&(1<<-S)-1,k>>=-S,S+=v;S>0;c=256*c+e[t+T],T+=E,S-=8);for(h=c&(1<<-S)-1,c>>=-S,S+=a;S>0;h=256*h+e[t+T],T+=E,S-=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)},jf=function(e,t,r,a,u,c){var h,v,_,x=8*c-u-1,S=(1<<x)-1,T=S>>1,E=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,k=0,U=1,N=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(v=isNaN(t)?1:0,h=S):(h=Math.floor(Math.log(t)/Math.LN2),t*(_=Math.pow(2,-h))<1&&(h--,_*=2),(t+=h+T>=1?E/_:E*Math.pow(2,1-T))*_>=2&&(h++,_/=2),h+T>=S?(v=0,h=S):h+T>=1?(v=(t*_-1)*Math.pow(2,u),h+=T):(v=t*Math.pow(2,T-1)*Math.pow(2,u),h=0));u>=8;e[r+k]=255&v,k+=U,v/=256,u-=8);for(h=h<<u|v,x+=u;x>0;e[r+k]=255&h,k+=U,h/=256,x-=8);e[r+k-U]|=128*N},Vu=qt;function qt(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}qt.Varint=0,qt.Fixed64=1,qt.Bytes=2,qt.Fixed32=5;var $f=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function fo(e){return e.type===qt.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 Zf(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 c_(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function p_(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function h_(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function f_(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function d_(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function m_(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function y_(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function v_(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function g_(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function Uu(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 Gf(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function __(e,t,r){e===1&&r.readMessage(x_,t)}function x_(e,t,r){if(e===3){var a=r.readMessage(b_,{}),u=a.width,c=a.height,h=a.left,v=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:v,advance:_}})}}function b_(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 Wf(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(N,J){return J.h-N.h});for(var h=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}],v=0,_=0,x=0,S=e;x<S.length;x+=1)for(var T=S[x],E=h.length-1;E>=0;E--){var k=h[E];if(!(T.w>k.w||T.h>k.h)){if(T.x=k.x,T.y=k.y,_=Math.max(_,T.y+T.h),v=Math.max(v,T.x+T.w),T.w===k.w&&T.h===k.h){var U=h.pop();E<h.length&&(h[E]=U)}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:v,h:_,fill:t/(v*_)||0}}qt.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=Uu(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=Gf(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=Uu(this.buf,this.pos)+4294967296*Uu(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=Uu(this.buf,this.pos)+4294967296*Gf(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=qf(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=qf(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 v,_,x=h.buf;if(v=(112&(_=x[h.pos++]))>>4,_<128||(v|=(127&(_=x[h.pos++]))<<3,_<128)||(v|=(127&(_=x[h.pos++]))<<10,_<128)||(v|=(127&(_=x[h.pos++]))<<17,_<128)||(v|=(127&(_=x[h.pos++]))<<24,_<128)||(v|=(1&(_=x[h.pos++]))<<31,_<128))return xs(u,v,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&&$f?function(r,a,u){return $f.decode(r.subarray(a,u))}(this.buf,t,e):function(r,a,u){for(var c="",h=a;h<u;){var v,_,x,S=r[h],T=null,E=S>239?4:S>223?3:S>191?2:1;if(h+E>u)break;E===1?S<128&&(T=S):E===2?(192&(v=r[h+1]))==128&&(T=(31&S)<<6|63&v)<=127&&(T=null):E===3?(_=r[h+2],(192&(v=r[h+1]))==128&&(192&_)==128&&((T=(15&S)<<12|(63&v)<<6|63&_)<=2047||T>=55296&&T<=57343)&&(T=null)):E===4&&(_=r[h+2],x=r[h+3],(192&(v=r[h+1]))==128&&(192&_)==128&&(192&x)==128&&((T=(15&S)<<18|(63&v)<<12|(63&_)<<6|63&x)<=65535||T>=1114112)&&(T=null)),T===null?(T=65533,E=1):T>65535&&(T-=65536,c+=String.fromCharCode(T>>>10&1023|55296),T=56320|1023&T),c+=String.fromCharCode(T),h+=E}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!==qt.Bytes)return e.push(this.readVarint(t));var r=fo(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==qt.Bytes)return e.push(this.readSVarint());var t=fo(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==qt.Bytes)return e.push(this.readBoolean());var t=fo(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==qt.Bytes)return e.push(this.readFloat());var t=fo(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==qt.Bytes)return e.push(this.readDouble());var t=fo(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==qt.Bytes)return e.push(this.readFixed32());var t=fo(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==qt.Bytes)return e.push(this.readSFixed32());var t=fo(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==qt.Bytes)return e.push(this.readFixed64());var t=fo(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==qt.Bytes)return e.push(this.readSFixed64());var t=fo(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===qt.Varint)for(;this.buf[this.pos++]>127;);else if(t===qt.Bytes)this.pos=this.readVarint()+this.pos;else if(t===qt.Fixed32)this.pos+=4;else{if(t!==qt.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,v){v.buf[v.pos++]=127&c|128,c>>>=7,v.buf[v.pos++]=127&c|128,c>>>=7,v.buf[v.pos++]=127&c|128,c>>>=7,v.buf[v.pos++]=127&c|128,v.buf[v.pos]=127&(c>>>=7)}(a,0,r),function(c,h){var v=(7&c)<<4;h.buf[h.pos++]|=v|((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,v,_=0;_<u.length;_++){if((h=u.charCodeAt(_))>55295&&h<57344){if(!v){h>56319||_+1===u.length?(a[c++]=239,a[c++]=191,a[c++]=189):v=h;continue}if(h<56320){a[c++]=239,a[c++]=191,a[c++]=189,v=h;continue}h=v-55296<<10|h-56320|65536,v=null}else v&&(a[c++]=239,a[c++]=191,a[c++]=189,v=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&&Zf(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),jf(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),jf(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&&Zf(r,a,this),this.pos=r-1,this.writeVarint(a),this.pos+=a},writeMessage:function(e,t,r){this.writeTag(e,qt.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,c_,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,p_,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,d_,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,h_,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,f_,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,m_,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,y_,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,v_,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,g_,t)},writeBytesField:function(e,t){this.writeTag(e,qt.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,qt.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,qt.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,qt.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,qt.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,qt.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,qt.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,qt.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,qt.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,qt.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,!!t)}};var Nu=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(Nu.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=Wf(u),h=new pi({width:c.w||1,height:c.h||1});for(var v in e){var _=e[v],x=r[v].paddedRect;pi.copy(_.data,h,{x:0,y:0},{x:x.x+1,y:x.y+1},_.data)}for(var S in t){var T=t[S],E=a[S].paddedRect,k=E.x+1,U=E.y+1,N=T.data.width,J=T.data.height;pi.copy(T.data,h,{x:0,y:0},{x:k,y:U},T.data),pi.copy(T.data,h,{x:0,y:J-1},{x:k,y:U-1},{width:N,height:1}),pi.copy(T.data,h,{x:0,y:0},{x:k,y:U+J},{width:N,height:1}),pi.copy(T.data,h,{x:N-1,y:0},{x:k-1,y:U},{width:1,height:J}),pi.copy(T.data,h,{x:0,y:0},{x:k+N,y:U},{width:1,height:J})}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 Nu(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",Nu),Ve("ImageAtlas",Ml);var ki={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 qu(e,t,r,a,u,c,h,v,_,x,S,T,E,k,U,N){var J,H=Gr.fromFeature(e,u);T===ki.vertical&&H.verticalizePunctuation();var re=di.processBidirectionalText,oe=di.processStyledBidirectionalText;if(re&&H.sections.length===1){J=[];for(var se=0,ce=re(H.toString(),dp(H,x,c,t,a,k,U));se<ce.length;se+=1){var ye=ce[se],Se=new Gr;Se.text=ye,Se.sections=H.sections;for(var Ae=0;Ae<ye.length;Ae++)Se.sectionIndex.push(0);J.push(Se)}}else if(oe){J=[];for(var $e=0,ke=oe(H.text,H.sectionIndex,dp(H,x,c,t,a,k,U));$e<ke.length;$e+=1){var We=ke[$e],ze=new Gr;ze.text=We[0],ze.sectionIndex=We[1],ze.sections=H.sections,J.push(ze)}}else J=function(qe,ct){for(var ot=[],xt=qe.text,He=0,St=0,Wt=ct;St<Wt.length;St+=1){var er=Wt[St];ot.push(qe.substring(He,er)),He=er}return He<xt.length&&ot.push(qe.substring(He,xt.length)),ot}(H,dp(H,x,c,t,a,k,U));var lt=[],Qe={positionedLines:lt,text:H.toString(),top:S[1],bottom:S[1],left:S[0],right:S[0],writingMode:T,iconsInText:!1,verticalizable:!1};return function(qe,ct,ot,xt,He,St,Wt,er,Yt,Ht,tr,br){for(var wr=0,Wr=-17,kr=0,Hr=0,ar=er==="right"?1:er==="left"?0:.5,Mr=0,ft=0,Vt=He;ft<Vt.length;ft+=1){var Mt=Vt[ft];Mt.trim();var wt=Mt.getMaxScale(),ri=24*(wt-1),Fr={positionedGlyphs:[],lineOffset:0};qe.positionedLines[Mr]=Fr;var jt=Fr.positionedGlyphs,fr=0;if(Mt.length()){for(var Or=0;Or<Mt.length();Or++){var Tt=Mt.getSection(Or),Dn=Mt.getSectionIndex(Or),Mi=Mt.getCharCode(Or),Ln=0,sr=null,Rn=null,Qi=null,ks=24,Ra=!(Yt===ki.horizontal||!tr&&!ss(Mi)||tr&&(ju[Mi]||(go=Mi,Ce.Arabic(go)||Ce["Arabic Supplement"](go)||Ce["Arabic Extended-A"](go)||Ce["Arabic Presentation Forms-A"](go)||Ce["Arabic Presentation Forms-B"](go))));if(Tt.imageName){var Ms=xt[Tt.imageName];if(!Ms)continue;Qi=Tt.imageName,qe.iconsInText=qe.iconsInText||!0,Rn=Ms.paddedRect;var vo=Ms.displaySize;Tt.scale=24*Tt.scale/br,Ln=ri+(24-vo[1]*Tt.scale),ks=(sr={width:vo[0],height:vo[1],left:1,top:-3,advance:Ra?vo[1]:vo[0]}).advance;var zs=Ra?vo[0]*Tt.scale-24*wt:vo[1]*Tt.scale-24*wt;zs>0&&zs>fr&&(fr=zs)}else{var Yu=ot[Tt.fontStack],Bs=Yu&&Yu[Mi];if(Bs&&Bs.rect)Rn=Bs.rect,sr=Bs.metrics;else{var Dl=ct[Tt.fontStack],Qu=Dl&&Dl[Mi];if(!Qu)continue;sr=Qu.metrics}Ln=24*(wt-Tt.scale)}Ra?(qe.verticalizable=!0,jt.push({glyph:Mi,imageName:Qi,x:wr,y:Wr+Ln,vertical:Ra,scale:Tt.scale,fontStack:Tt.fontStack,sectionIndex:Dn,metrics:sr,rect:Rn}),wr+=ks*Tt.scale+Ht):(jt.push({glyph:Mi,imageName:Qi,x:wr,y:Wr+Ln,vertical:Ra,scale:Tt.scale,fontStack:Tt.fontStack,sectionIndex:Dn,metrics:sr,rect:Rn}),wr+=sr.advance*Tt.scale+Ht)}jt.length!==0&&(kr=Math.max(wr-Ht,kr),S_(jt,0,jt.length-1,ar,fr)),wr=0;var ec=St*wt+fr;Fr.lineOffset=Math.max(fr,ri),Wr+=ec,Hr=Math.max(ec,Hr),++Mr}else Wr+=St,++Mr}var go,Ll=Wr- -17,Ds=mp(Wt),Ho=Ds.horizontalAlign,Ls=Ds.verticalAlign;(function(tc,rc,Rl,Fl,ic,Ol,Vl,Ul,nc){var Rs,oc=(rc-Rl)*ic;Rs=Ol!==Vl?-Ul*Fl- -17:(-Fl*nc+.5)*Vl;for(var Fs=0,Nl=tc;Fs<Nl.length;Fs+=1)for(var Fa=0,ql=Nl[Fs].positionedGlyphs;Fa<ql.length;Fa+=1){var Os=ql[Fa];Os.x+=oc,Os.y+=Rs}})(qe.positionedLines,ar,Ho,Ls,kr,Hr,St,Ll,He.length),qe.top+=-Ls*Ll,qe.bottom=qe.top+Ll,qe.left+=-Ho*kr,qe.right=qe.left+kr}(Qe,t,r,a,J,h,v,_,T,x,E,N),!function(qe){for(var ct=0,ot=qe;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&&ju[this.text.charCodeAt(t)];t++)e++;for(var r=this.text.length,a=this.text.length-1;a>=0&&a>=e&&ju[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 ju={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},yi={};function Hf(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 v=r[t.fontStack],_=v&&v[e];return _?_.metrics.advance*t.scale+u:0}function Xf(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 w_(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 Kf(e,t,r,a,u,c){for(var h=null,v=Xf(t,r,u,c),_=0,x=a;_<x.length;_+=1){var S=x[_],T=Xf(t-S.x,r,u,c)+S.badness;T<=v&&(h=S,v=T)}return{index:e,x:t,priorBreak:h,badness:v}}function dp(e,t,r,a,u,c,h){if(c!=="point")return[];if(!e)return[];for(var v,_=[],x=function(J,H,re,oe,se,ce){for(var ye=0,Se=0;Se<J.length();Se++){var Ae=J.getSection(Se);ye+=Hf(J.getCharCode(Se),Ae,oe,se,H,ce)}return ye/Math.max(1,Math.ceil(ye/re))}(e,t,r,a,u,h),S=e.text.indexOf("")>=0,T=0,E=0;E<e.length();E++){var k=e.getSection(E),U=e.getCharCode(E);if(ju[U]||(T+=Hf(U,k,a,u,t,h)),E<e.length()-1){var N=!((v=U)<11904||!(Ce["Bopomofo Extended"](v)||Ce.Bopomofo(v)||Ce["CJK Compatibility Forms"](v)||Ce["CJK Compatibility Ideographs"](v)||Ce["CJK Compatibility"](v)||Ce["CJK Radicals Supplement"](v)||Ce["CJK Strokes"](v)||Ce["CJK Symbols and Punctuation"](v)||Ce["CJK Unified Ideographs Extension A"](v)||Ce["CJK Unified Ideographs"](v)||Ce["Enclosed CJK Letters and Months"](v)||Ce["Halfwidth and Fullwidth Forms"](v)||Ce.Hiragana(v)||Ce["Ideographic Description Characters"](v)||Ce["Kangxi Radicals"](v)||Ce["Katakana Phonetic Extensions"](v)||Ce.Katakana(v)||Ce["Vertical Forms"](v)||Ce["Yi Radicals"](v)||Ce["Yi Syllables"](v)));(yi[U]||N||k.imageName)&&_.push(Kf(E+1,T,x,_,w_(U,e.getCharCode(E+1),N&&S),!1))}}return function J(H){return H?J(H.priorBreak).concat(H.index):[]}(Kf(e.length(),T,x,_,0,!0))}function mp(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 S_(e,t,r,a,u){if(a||u)for(var c=e[r],h=(e[r].x+c.metrics.advance*c.scale)*a,v=t;v<=r;v++)e[v].x-=h,e[v].y+=u}function Jf(e,t,r,a,u,c){var h,v=e.image;if(v.content){var _=v.content,x=v.pixelRatio||1;h=[_[0]/x,_[1]/x,v.displaySize[0]-_[2]/x,v.displaySize[1]-_[3]/x]}var S,T,E,k,U=t.left*c,N=t.right*c;r==="width"||r==="both"?(k=u[0]+U-a[3],T=u[0]+N+a[1]):T=(k=u[0]+(U+N-v.displaySize[0])/2)+v.displaySize[0];var J=t.top*c,H=t.bottom*c;return r==="height"||r==="both"?(S=u[1]+J-a[0],E=u[1]+H+a[2]):E=(S=u[1]+(J+H-v.displaySize[1])/2)+v.displaySize[1],{image:v,top:S,right:T,bottom:E,left:k,collisionPadding:h}}yi[10]=!0,yi[32]=!0,yi[38]=!0,yi[40]=!0,yi[41]=!0,yi[43]=!0,yi[45]=!0,yi[47]=!0,yi[173]=!0,yi[183]=!0,yi[8203]=!0,yi[8208]=!0,yi[8211]=!0,yi[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 yp(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 v=a[c],_=a[h];return r.kind==="composite"?{kind:"composite",minZoom:v,maxZoom:_,interpolationType:u}:{kind:"camera",minZoom:v,maxZoom:_,minSize:r.evaluate(new ht(v)),maxSize:r.evaluate(new ht(_)),interpolationType:u}}function Yf(e,t,r){var a=t.uSize,u=r.lowerSize;return e.kind==="source"?u/128:e.kind==="composite"?pr(u/128,r.upperSize/128,t.uSizeT):a}function Qf(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?je(Br.interpolationFactor(u,t,e.minZoom,e.maxZoom),0,1):0;e.kind==="camera"?a=pr(e.minSize,e.maxSize,c):r=c}return{uSizeT:r,uSize:a}}Ve("Anchor",Ss);var T_=Object.freeze({__proto__:null,getSizeData:yp,evaluateSizeForFeature:Yf,evaluateSizeForZoom:Qf,SIZE_PACK_FACTOR:128});function ed(e,t,r,a,u){if(t.segment===void 0)return!0;for(var c=t,h=t.segment+1,v=0;v>-r/2;){if(--h<0)return!1;v-=e[h].dist(c),c=e[h]}v+=e[h].dist(e[h+1]),h++;for(var _=[],x=0;v<r/2;){var S=e[h],T=e[h+1];if(!T)return!1;var E=e[h-1].angleTo(S)-S.angleTo(T);for(E=Math.abs((E+3*Math.PI)%(2*Math.PI)-Math.PI),_.push({distance:v,angleDelta:E}),x+=E;v-_[0].distance>a;)x-=_.shift().angleDelta;if(x>u)return!1;h++,v+=S.dist(T)}return!0}function td(e){for(var t=0,r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function rd(e,t,r){return e?.6*t*r:0}function id(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function I_(e,t,r,a,u,c){for(var h=rd(r,u,c),v=id(r,a)*c,_=0,x=td(e)/2,S=0;S<e.length-1;S++){var T=e[S],E=e[S+1],k=T.dist(E);if(_+k>x){var U=(x-_)/k,N=pr(T.x,E.x,U),J=pr(T.y,E.y,U),H=new Ss(N,J,E.angleTo(T),S);return H._round(),!h||ed(e,H,v,h,t)?H:void 0}_+=k}}function A_(e,t,r,a,u,c,h,v,_){var x=rd(a,c,h),S=id(a,u),T=S*h,E=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(U,N,J,H,re,oe,se,ce,ye){for(var Se=oe/2,Ae=td(U),$e=0,ke=N-J,We=[],ze=0;ze<U.length-1;ze++){for(var lt=U[ze],Qe=U[ze+1],qe=lt.dist(Qe),ct=Qe.angleTo(lt);ke+J<$e+qe;){var ot=((ke+=J)-$e)/qe,xt=pr(lt.x,Qe.x,ot),He=pr(lt.y,Qe.y,ot);if(xt>=0&&xt<ye&&He>=0&&He<ye&&ke-Se>=0&&ke+Se<=Ae){var St=new Ss(xt,He,ct,ze);St._round(),H&&!ed(U,St,oe,H,re)||We.push(St)}}$e+=qe}return ce||We.length||se||(We=k(U,$e/2,J,H,re,oe,se,!0,ye)),We}(e,E?t/2*v%t:(S/2+2*c)*h*v%t,t,x,r,T,E,!1,_)}function nd(e,t,r,a,u){for(var c=[],h=0;h<e.length;h++)for(var v=e[h],_=void 0,x=0;x<v.length-1;x++){var S=v[x],T=v[x+1];S.x<t&&T.x<t||(S.x<t?S=new me(t,S.y+(t-S.x)/(T.x-S.x)*(T.y-S.y))._round():T.x<t&&(T=new me(t,S.y+(t-S.x)/(T.x-S.x)*(T.y-S.y))._round()),S.y<r&&T.y<r||(S.y<r?S=new me(S.x+(r-S.y)/(T.y-S.y)*(T.x-S.x),r)._round():T.y<r&&(T=new me(S.x+(r-S.y)/(T.y-S.y)*(T.x-S.x),r)._round()),S.x>=a&&T.x>=a||(S.x>=a?S=new me(a,S.y+(a-S.x)/(T.x-S.x)*(T.y-S.y))._round():T.x>=a&&(T=new me(a,S.y+(a-S.x)/(T.x-S.x)*(T.y-S.y))._round()),S.y>=u&&T.y>=u||(S.y>=u?S=new me(S.x+(u-S.y)/(T.y-S.y)*(T.x-S.x),u)._round():T.y>=u&&(T=new me(S.x+(u-S.y)/(T.y-S.y)*(T.x-S.x),u)._round()),_&&S.equals(_[_.length-1])||c.push(_=[S]),_.push(T)))))}return c}function od(e,t,r,a){var u=[],c=e.image,h=c.pixelRatio,v=c.paddedRect.w-2,_=c.paddedRect.h-2,x=e.right-e.left,S=e.bottom-e.top,T=c.stretchX||[[0,v]],E=c.stretchY||[[0,_]],k=function(xt,He){return xt+He[1]-He[0]},U=T.reduce(k,0),N=E.reduce(k,0),J=v-U,H=_-N,re=0,oe=U,se=0,ce=N,ye=0,Se=J,Ae=0,$e=H;if(c.content&&a){var ke=c.content;re=$u(T,0,ke[0]),se=$u(E,0,ke[1]),oe=$u(T,ke[0],ke[2]),ce=$u(E,ke[1],ke[3]),ye=ke[0]-re,Ae=ke[1]-se,Se=ke[2]-ke[0]-oe,$e=ke[3]-ke[1]-ce}var We=function(xt,He,St,Wt){var er=Zu(xt.stretch-re,oe,x,e.left),Yt=Gu(xt.fixed-ye,Se,xt.stretch,U),Ht=Zu(He.stretch-se,ce,S,e.top),tr=Gu(He.fixed-Ae,$e,He.stretch,N),br=Zu(St.stretch-re,oe,x,e.left),wr=Gu(St.fixed-ye,Se,St.stretch,U),Wr=Zu(Wt.stretch-se,ce,S,e.top),kr=Gu(Wt.fixed-Ae,$e,Wt.stretch,N),Hr=new me(er,Ht),ar=new me(br,Ht),Mr=new me(br,Wr),ft=new me(er,Wr),Vt=new me(Yt/h,tr/h),Mt=new me(wr/h,kr/h),wt=t*Math.PI/180;if(wt){var ri=Math.sin(wt),Fr=Math.cos(wt),jt=[Fr,-ri,ri,Fr];Hr._matMult(jt),ar._matMult(jt),ft._matMult(jt),Mr._matMult(jt)}var fr=xt.stretch+xt.fixed,Or=He.stretch+He.fixed;return{tl:Hr,tr:ar,bl:ft,br:Mr,tex:{x:c.paddedRect.x+1+fr,y:c.paddedRect.y+1+Or,w:St.stretch+St.fixed-fr,h:Wt.stretch+Wt.fixed-Or},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Vt,pixelOffsetBR:Mt,minFontScaleX:Se/h/x,minFontScaleY:$e/h/S,isSDF:r}};if(a&&(c.stretchX||c.stretchY))for(var ze=ad(T,J,U),lt=ad(E,H,N),Qe=0;Qe<ze.length-1;Qe++)for(var qe=ze[Qe],ct=ze[Qe+1],ot=0;ot<lt.length-1;ot++)u.push(We(qe,lt[ot],ct,lt[ot+1]));else u.push(We({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:v+1},{fixed:0,stretch:_+1}));return u}function $u(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 ad(e,t,r){for(var a=[{fixed:-1,stretch:0}],u=0,c=e;u<c.length;u+=1){var h=c[u],v=h[0],_=h[1],x=a[a.length-1];a.push({fixed:v-x.stretch,stretch:x.stretch}),a.push({fixed:v-x.stretch,stretch:x.stretch+(_-v)})}return a.push({fixed:t+1,stretch:r}),a}function Zu(e,t,r,a){return e/t*r+a}function Gu(e,t,r,a){return e-t*r/a}var Wu=function(e,t,r,a,u,c,h,v,_,x){if(this.boxStartIndex=e.length,_){var S=c.top,T=c.bottom,E=c.collisionPadding;E&&(S-=E[1],T+=E[3]);var k=T-S;k>0&&(k=Math.max(10,k),this.circleDiameter=k)}else{var U=c.top*h-v,N=c.bottom*h+v,J=c.left*h-v,H=c.right*h+v,re=c.collisionPadding;if(re&&(J-=re[0]*h,U-=re[1]*h,H+=re[2]*h,N+=re[3]*h),x){var oe=new me(J,U),se=new me(H,U),ce=new me(J,N),ye=new me(H,N),Se=x*Math.PI/180;oe._rotate(Se),se._rotate(Se),ce._rotate(Se),ye._rotate(Se),J=Math.min(oe.x,se.x,ce.x,ye.x),H=Math.max(oe.x,se.x,ce.x,ye.x),U=Math.min(oe.y,se.y,ce.y,ye.y),N=Math.max(oe.y,se.y,ce.y,ye.y)}e.emplaceBack(t.x,t.y,J,U,H,N,r,a,u)}this.boxEndIndex=e.length},Ts=function(e,t){if(e===void 0&&(e=[]),t===void 0&&(t=E_),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 E_(e,t){return e<t?-1:e>t?1:0}function C_(e,t,r){r===void 0&&(r=!1);for(var a=1/0,u=1/0,c=-1/0,h=-1/0,v=e[0],_=0;_<v.length;_++){var x=v[_];(!_||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 S=Math.min(c-a,h-u),T=S/2,E=new Ts([],P_);if(S===0)return new me(a,u);for(var k=a;k<c;k+=S)for(var U=u;U<h;U+=S)E.push(new Is(k+T,U+T,T,e));for(var N=function(re){for(var oe=0,se=0,ce=0,ye=re[0],Se=0,Ae=ye.length,$e=Ae-1;Se<Ae;$e=Se++){var ke=ye[Se],We=ye[$e],ze=ke.x*We.y-We.x*ke.y;se+=(ke.x+We.x)*ze,ce+=(ke.y+We.y)*ze,oe+=3*ze}return new Is(se/oe,ce/oe,0,re)}(e),J=E.length;E.length;){var H=E.pop();(H.d>N.d||!N.d)&&(N=H,r&&console.log("found best %d after %d probes",Math.round(1e4*H.d)/1e4,J)),H.max-N.d<=t||(E.push(new Is(H.p.x-(T=H.h/2),H.p.y-T,T,e)),E.push(new Is(H.p.x+T,H.p.y-T,T,e)),E.push(new Is(H.p.x-T,H.p.y+T,T,e)),E.push(new Is(H.p.x+T,H.p.y+T,T,e)),J+=4)}return r&&(console.log("num probes: "+J),console.log("best distance: "+N.d)),N.p}function P_(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,v=1/0,_=0;_<c.length;_++)for(var x=c[_],S=0,T=x.length,E=T-1;S<T;E=S++){var k=x[S],U=x[E];k.y>u.y!=U.y>u.y&&u.x<(U.x-k.x)*(u.y-k.y)/(U.y-k.y)+k.x&&(h=!h),v=Math.min(v,$o(u,k,U))}return(h?1:-1)*Math.sqrt(v)}(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],v=c+1;if(v<this.length&&r(t[v],h)<0&&(c=v,h=t[v]),r(h,u)>=0)break;t[e]=h,e=c}t[e]=u};var vp=Number.POSITIVE_INFINITY;function sd(e,t){return t[1]!==vp?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 gp(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 ld(e,t,r,a,u,c,h,v,_,x,S,T,E,k,U){var N=function(se,ce,ye,Se,Ae,$e,ke,We){for(var ze=Se.layout.get("text-rotate").evaluate($e,{})*Math.PI/180,lt=[],Qe=0,qe=ce.positionedLines;Qe<qe.length;Qe+=1)for(var ct=qe[Qe],ot=0,xt=ct.positionedGlyphs;ot<xt.length;ot+=1){var He=xt[ot];if(He.rect){var St=He.rect||{},Wt=4,er=!0,Yt=1,Ht=0,tr=(Ae||We)&&He.vertical,br=He.metrics.advance*He.scale/2;if(We&&ce.verticalizable&&(Ht=ct.lineOffset/2-(He.imageName?-(24-He.metrics.width*He.scale)/2:24*(He.scale-1))),He.imageName){var wr=ke[He.imageName];er=wr.sdf,Wt=1/(Yt=wr.pixelRatio)}var Wr=Ae?[He.x+br,He.y]:[0,0],kr=Ae?[0,0]:[He.x+br+ye[0],He.y+ye[1]-Ht],Hr=[0,0];tr&&(Hr=kr,kr=[0,0]);var ar=(He.metrics.left-Wt)*He.scale-br+kr[0],Mr=(-He.metrics.top-Wt)*He.scale+kr[1],ft=ar+St.w*He.scale/Yt,Vt=Mr+St.h*He.scale/Yt,Mt=new me(ar,Mr),wt=new me(ft,Mr),ri=new me(ar,Vt),Fr=new me(ft,Vt);if(tr){var jt=new me(-br,br- -17),fr=-Math.PI/2,Or=12-br,Tt=new me(22-Or,-(He.imageName?Or:0)),Dn=new(Function.prototype.bind.apply(me,[null].concat(Hr)));Mt._rotateAround(fr,jt)._add(Tt)._add(Dn),wt._rotateAround(fr,jt)._add(Tt)._add(Dn),ri._rotateAround(fr,jt)._add(Tt)._add(Dn),Fr._rotateAround(fr,jt)._add(Tt)._add(Dn)}if(ze){var Mi=Math.sin(ze),Ln=Math.cos(ze),sr=[Ln,-Mi,Mi,Ln];Mt._matMult(sr),wt._matMult(sr),ri._matMult(sr),Fr._matMult(sr)}var Rn=new me(0,0),Qi=new me(0,0);lt.push({tl:Mt,tr:wt,bl:ri,br:Fr,tex:St,writingMode:ce.writingMode,glyphOffset:Wr,sectionIndex:He.sectionIndex,isSDF:er,pixelOffsetTL:Rn,pixelOffsetBR:Qi,minFontScaleX:0,minFontScaleY:0})}}return lt}(0,r,v,u,c,h,a,e.allowVerticalPlacement),J=e.textSizeData,H=null;J.kind==="source"?(H=[128*u.layout.get("text-size").evaluate(h,{})])[0]>32640&&Lt(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):J.kind==="composite"&&((H=[128*k.compositeTextSizes[0].evaluate(h,{},U),128*k.compositeTextSizes[1].evaluate(h,{},U)])[0]>32640||H[1]>32640)&&Lt(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),e.addSymbols(e.text,N,H,v,c,h,x,t,_.lineStartIndex,_.lineLength,E,U);for(var re=0,oe=S;re<oe.length;re+=1)T[oe[re]]=e.text.placedSymbolArray.length-1;return 4*N.length}function ud(e){for(var t in e)return e[t];return null}function k_(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 M_=_s.VectorTileFeature.types,z_=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Hu(e,t,r,a,u,c,h,v,_,x,S,T,E){var k=v?Math.min(32640,Math.round(v[0])):0,U=v?Math.min(32640,Math.round(v[1])):0;e.emplaceBack(t,r,Math.round(32*a),Math.round(32*u),c,h,(k<<1)+(_?1:0),U,16*x,16*S,256*T,256*E)}function _p(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 B_(e){for(var t=0,r=e.sections;t<r.length;t+=1)if(ls(r[t].text))return!0;return!1}var As=function(e){this.layoutVertexArray=new hs,this.indexArray=new Cn,this.programConfigurations=e,this.segments=new D,this.dynamicLayoutVertexArray=new No,this.opacityVertexArray=new Aa,this.placedSymbolArray=new s};As.prototype.isEmpty=function(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0},As.prototype.upload=function(e,t,r,a){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,o_.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,a_.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,z_,!0),this.opacityVertexBuffer.itemSize=1),(r||a)&&this.programConfigurations.upload(e))},As.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",As);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,s_.members,!0)},zl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Ve("CollisionBuffers",zl);var Bt=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=mi([]),this.placementViewportMatrix=mi([]);var t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=yp(this.zoom,t["text-size"]),this.iconSizeData=yp(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 ki[c]})),this.stateDependentLayerIds=this.layers.filter(function(c){return c.isStateDependent()}).map(function(c){return c.id}),this.sourceID=e.sourceID};Bt.prototype.createArrays=function(){this.text=new As(new Je(this.layers,this.zoom,function(e){return/^text/.test(e)})),this.icon=new As(new Je(this.layers,this.zoom,function(e){return/^icon/.test(e)})),this.glyphOffsetArray=new y,this.lineVertexArray=new g,this.symbolInstances=new f},Bt.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)}},Bt.prototype.populate=function(e,t,r){var a=this.layers[0],u=a.layout,c=u.get("text-font"),h=u.get("text-field"),v=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=v.value.kind!=="constant"||!!v.value.value||Object.keys(v.parameters).length>0,S=u.get("symbol-sort-key");if(this.features=[],_||x){for(var T=t.iconDependencies,E=t.glyphDependencies,k=t.availableImages,U=new ht(this.zoom),N=0,J=e;N<J.length;N+=1){var H=J[N],re=H.feature,oe=H.id,se=H.index,ce=H.sourceLayerIndex,ye=a._featureFilter.needGeometry,Se=or(re,ye);if(a._featureFilter.filter(U,Se,r)){ye||(Se.geometry=Jt(re));var Ae=void 0;if(_){var $e=a.getValueAndResolveTokens("text-field",Se,r,k),ke=Ir.factory($e);B_(ke)&&(this.hasRTLText=!0),(!this.hasRTLText||yl()==="unavailable"||this.hasRTLText&&di.isParsed())&&(Ae=u_(ke,a,Se))}var We=void 0;if(x){var ze=a.getValueAndResolveTokens("icon-image",Se,r,k);We=ze instanceof Yr?ze:Yr.fromString(ze)}if(Ae||We){var lt=this.sortFeaturesByKey?S.evaluate(Se,{},r):void 0;if(this.features.push({id:oe,text:Ae,icon:We,index:se,sourceLayerIndex:ce,geometry:Se.geometry,properties:re.properties,type:M_[re.type],sortKey:lt}),We&&(T[We.name]=!0),Ae){var Qe=c.evaluate(Se,{},r).join(","),qe=u.get("text-rotation-alignment")==="map"&&u.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(ki.vertical)>=0;for(var ct=0,ot=Ae.sections;ct<ot.length;ct+=1){var xt=ot[ct];if(xt.image)T[xt.image.name]=!0;else{var He=fl(Ae.toString()),St=xt.fontStack||Qe,Wt=E[St]=E[St]||{};this.calculateGlyphDependencies(xt.text,Wt,qe,this.allowVerticalPlacement,He)}}}}}}u.get("symbol-placement")==="line"&&(this.features=function(er){var Yt={},Ht={},tr=[],br=0;function wr(jt){tr.push(er[jt]),br++}function Wr(jt,fr,Or){var Tt=Ht[jt];return delete Ht[jt],Ht[fr]=Tt,tr[Tt].geometry[0].pop(),tr[Tt].geometry[0]=tr[Tt].geometry[0].concat(Or[0]),Tt}function kr(jt,fr,Or){var Tt=Yt[fr];return delete Yt[fr],Yt[jt]=Tt,tr[Tt].geometry[0].shift(),tr[Tt].geometry[0]=Or[0].concat(tr[Tt].geometry[0]),Tt}function Hr(jt,fr,Or){var Tt=Or?fr[0][fr[0].length-1]:fr[0][0];return jt+":"+Tt.x+":"+Tt.y}for(var ar=0;ar<er.length;ar++){var Mr=er[ar],ft=Mr.geometry,Vt=Mr.text?Mr.text.toString():null;if(Vt){var Mt=Hr(Vt,ft),wt=Hr(Vt,ft,!0);if(Mt in Ht&&wt in Yt&&Ht[Mt]!==Yt[wt]){var ri=kr(Mt,wt,ft),Fr=Wr(Mt,wt,tr[ri].geometry);delete Yt[Mt],delete Ht[wt],Ht[Hr(Vt,tr[Fr].geometry,!0)]=Fr,tr[ri].geometry=null}else Mt in Ht?Wr(Mt,wt,ft):wt in Yt?kr(Mt,wt,ft):(wr(ar),Yt[Mt]=br-1,Ht[wt]=br-1)}else wr(ar)}return tr.filter(function(jt){return jt.geometry})}(this.features)),this.sortFeaturesByKey&&this.features.sort(function(er,Yt){return er.sortKey-Yt.sortKey})}},Bt.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))},Bt.prototype.isEmpty=function(){return this.symbolInstances.length===0&&!this.hasRTLText},Bt.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},Bt.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},Bt.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},Bt.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},Bt.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 v=e.segment||0;v>=0;v--)c[v]={x:t[v].x,y:t[v].y,tileUnitDistanceFromAnchor:u},v>0&&(u+=t[v-1].dist(t[v]));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}},Bt.prototype.addSymbols=function(e,t,r,a,u,c,h,v,_,x,S,T){for(var E=e.indexArray,k=e.layoutVertexArray,U=e.segments.prepareSegment(4*t.length,k,E,this.canOverlap?c.sortKey:void 0),N=this.glyphOffsetArray.length,J=U.vertexLength,H=this.allowVerticalPlacement&&h===ki.vertical?Math.PI/2:0,re=c.text&&c.text.sections,oe=0;oe<t.length;oe++){var se=t[oe],ce=se.tl,ye=se.tr,Se=se.bl,Ae=se.br,$e=se.tex,ke=se.pixelOffsetTL,We=se.pixelOffsetBR,ze=se.minFontScaleX,lt=se.minFontScaleY,Qe=se.glyphOffset,qe=se.isSDF,ct=se.sectionIndex,ot=U.vertexLength,xt=Qe[1];Hu(k,v.x,v.y,ce.x,xt+ce.y,$e.x,$e.y,r,qe,ke.x,ke.y,ze,lt),Hu(k,v.x,v.y,ye.x,xt+ye.y,$e.x+$e.w,$e.y,r,qe,We.x,ke.y,ze,lt),Hu(k,v.x,v.y,Se.x,xt+Se.y,$e.x,$e.y+$e.h,r,qe,ke.x,We.y,ze,lt),Hu(k,v.x,v.y,Ae.x,xt+Ae.y,$e.x+$e.w,$e.y+$e.h,r,qe,We.x,We.y,ze,lt),_p(e.dynamicLayoutVertexArray,v,H),E.emplaceBack(ot,ot+1,ot+2),E.emplaceBack(ot+1,ot+2,ot+3),U.vertexLength+=4,U.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Qe[0]),oe!==t.length-1&&ct===t[oe+1].sectionIndex||e.programConfigurations.populatePaintArrays(k.length,c,c.index,{},T,re&&re[ct])}e.placedSymbolArray.emplaceBack(v.x,v.y,N,this.glyphOffsetArray.length-N,J,_,x,v.segment,r?r[0]:0,r?r[1]:0,a[0],a[1],h,0,!1,0,S)},Bt.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))},Bt.prototype.addCollisionDebugVertices=function(e,t,r,a,u,c,h){var v=u.segments.prepareSegment(4,u.layoutVertexArray,u.indexArray),_=v.vertexLength,x=u.layoutVertexArray,S=u.collisionVertexArray,T=h.anchorX,E=h.anchorY;this._addCollisionDebugVertex(x,S,c,T,E,new me(e,t)),this._addCollisionDebugVertex(x,S,c,T,E,new me(r,t)),this._addCollisionDebugVertex(x,S,c,T,E,new me(r,a)),this._addCollisionDebugVertex(x,S,c,T,E,new me(e,a)),v.vertexLength+=4;var k=u.indexArray;k.emplaceBack(_,_+1),k.emplaceBack(_+1,_+2),k.emplaceBack(_+2,_+3),k.emplaceBack(_+3,_),v.primitiveLength+=4},Bt.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)}},Bt.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new zl(qo,Nf.members,Ea),this.iconCollisionBox=new zl(qo,Nf.members,Ea);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)}},Bt.prototype._deserializeCollisionBoxesForSymbol=function(e,t,r,a,u,c,h,v,_){for(var x={},S=t;S<r;S++){var T=e.get(S);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 E=a;E<u;E++){var k=e.get(E);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 U=c;U<h;U++){var N=e.get(U);x.iconBox={x1:N.x1,y1:N.y1,x2:N.x2,y2:N.y2,anchorPointX:N.anchorPointX,anchorPointY:N.anchorPointY},x.iconFeatureIndex=N.featureIndex;break}for(var J=v;J<_;J++){var H=e.get(J);x.verticalIconBox={x1:H.x1,y1:H.y1,x2:H.x2,y2:H.y2,anchorPointX:H.anchorPointX,anchorPointY:H.anchorPointY},x.verticalIconFeatureIndex=H.featureIndex;break}return x},Bt.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))}},Bt.prototype.hasTextData=function(){return this.text.segments.get().length>0},Bt.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Bt.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Bt.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Bt.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Bt.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)},Bt.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 v=this.symbolInstances.get(h);a.push(0|Math.round(t*v.anchorX+r*v.anchorY)),u.push(v.featureIndex)}return c.sort(function(_,x){return a[_]-a[x]||u[x]-u[_]}),c},Bt.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})},Bt.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,v){c>=0&&v.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",Bt,{omit:["layers","collisionBoxArray","features","compareText"]}),Bt.MAX_GLYPHS=65535,Bt.addDynamicAttributes=_p;var D_=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 Ne(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 Ne(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 Ne(B.layout_symbol["icon-image"]),"icon-rotate":new Ne(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 Ne(B.layout_symbol["icon-offset"]),"icon-anchor":new Ne(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 Ne(B.layout_symbol["text-field"]),"text-font":new Ne(B.layout_symbol["text-font"]),"text-size":new Ne(B.layout_symbol["text-size"]),"text-max-width":new Ne(B.layout_symbol["text-max-width"]),"text-line-height":new Ze(B.layout_symbol["text-line-height"]),"text-letter-spacing":new Ne(B.layout_symbol["text-letter-spacing"]),"text-justify":new Ne(B.layout_symbol["text-justify"]),"text-radial-offset":new Ne(B.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ze(B.layout_symbol["text-variable-anchor"]),"text-anchor":new Ne(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 Ne(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 Ne(B.layout_symbol["text-transform"]),"text-offset":new Ne(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"])}),xp={paint:new Lr({"icon-opacity":new Ne(B.paint_symbol["icon-opacity"]),"icon-color":new Ne(B.paint_symbol["icon-color"]),"icon-halo-color":new Ne(B.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ne(B.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ne(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 Ne(B.paint_symbol["text-opacity"]),"text-color":new Ne(B.paint_symbol["text-color"],{runtimeType:Pe,getOverride:function(e){return e.textColor},hasOverride:function(e){return!!e.textColor}}),"text-halo-color":new Ne(B.paint_symbol["text-halo-color"]),"text-halo-width":new Ne(B.paint_symbol["text-halo-width"]),"text-halo-blur":new Ne(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:D_},Es=function(e){this.type=e.property.overrides?e.property.overrides.runtimeType:Oe,this.defaultValue=e};Es.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},Es.prototype.eachChild=function(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)},Es.prototype.outputDefined=function(){return!1},Es.prototype.serialize=function(){return null},Ve("FormatSectionOverride",Es,{omit:["defaultValue"]});var L_=function(e){function t(r){e.call(this,r,xp)}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,v=u;h<v.length;h+=1){var _=v[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),v=this._unevaluatedLayout._values[r];return v.isDataDriven()||ma(v.value)||!h?h:function(_,x){return x.replace(/{([^{}]+)}/g,function(S,T){return T in _?String(_[T]):""})}(a.properties,h)},t.prototype.createBucket=function(r){return new Bt(r)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype._setPaintOverrides=function(){for(var r=0,a=xp.paint.overridableProperties;r<a.length;r+=1){var u=a[r];if(t.hasPaintOverride(this.layout,u)){var c,h=this.paint.get(u),v=new Es(h),_=new Lo(v,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=xp.paint.properties[a],h=!1,v=function(S){for(var T=0,E=S;T<E.length;T+=1)if(c.overrides&&c.overrides.hasOverride(E[T]))return void(h=!0)};if(u.value.kind==="constant"&&u.value.value instanceof Ir)v(u.value.value.sections);else if(u.value.kind==="source"){var _=function(S){h||(S instanceof Nr&&nr(S.value)===Ft?v(S.value.sections):S instanceof Fi?v(S.sections):S.eachChild(_))},x=u.value;x._styleExpression&&_(x._styleExpression.expression)}return h},t}(Xi),R_={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"])})},F_=function(e){function t(r){e.call(this,r,R_)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(Xi),O_={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"])})},V_=function(e){function t(r){e.call(this,r,O_)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(Xi),U_=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}(Xi),N_={circle:np,heatmap:Tg,hillshade:Ag,fill:jg,"fill-extrusion":Yg,line:n_,symbol:L_,background:F_,raster:V_},cd=le.HTMLImageElement,pd=le.HTMLCanvasElement,hd=le.HTMLVideoElement,fd=le.ImageData,Xu=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,v=h.gl;if(this.useMipmap=!!(t&&t.useMipmap),v.bindTexture(v.TEXTURE_2D,this.texture),h.pixelStoreUnpackFlipY.set(!1),h.pixelStoreUnpack.set(1),h.pixelStoreUnpackPremultiplyAlpha.set(this.format===v.RGBA&&(!t||t.premultiply!==!1)),c)this.size=[a,u],e instanceof cd||e instanceof pd||e instanceof hd||e instanceof fd||Xu&&e instanceof Xu?v.texImage2D(v.TEXTURE_2D,0,this.format,this.format,v.UNSIGNED_BYTE,e):v.texImage2D(v.TEXTURE_2D,0,this.format,a,u,0,this.format,v.UNSIGNED_BYTE,e.data);else{var _=r||{x:0,y:0},x=_.x,S=_.y;e instanceof cd||e instanceof pd||e instanceof hd||e instanceof fd||Xu&&e instanceof Xu?v.texSubImage2D(v.TEXTURE_2D,0,x,S,v.RGBA,v.UNSIGNED_BYTE,e):v.texSubImage2D(v.TEXTURE_2D,0,x,S,a,u,v.RGBA,v.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&v.generateMipmap(v.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 bp=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()})};bp.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))},bp.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={},ur(["receive","process"],this),this.invoker=new bp(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=ii()?e:le};function dd(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 v=ja(this.globalScope)?void 0:[];return this.target.postMessage({id:h,type:e,hasCallback:!!r,targetMapId:a,mustQueue:u,sourceMapId:this.mapId,data:Vi(t,v)},v),{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(S,T){u=!0,delete r.cancelCallbacks[e],r.target.postMessage({id:e,type:"<response>",sourceMapId:r.mapId,error:S?Vi(S):null,data:Vi(T,c)},c)}:function(S){u=!0},v=null,_=ai(t.data);if(this.parent[t.type])v=this.parent[t.type](t.sourceMapId,_,h);else if(this.parent.getWorkerSource){var x=t.type.split(".");v=this.parent.getWorkerSource(t.sourceMapId,x[0],_.source)[x[1]](_,h)}else h(new Error("Could not find function "+t.type));!u&&v&&v.cancel&&(this.cancelCallbacks[e]=v.cancel)}},Cs.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var yr=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]))};yr.prototype.setNorthEast=function(e){return this._ne=e instanceof Gt?new Gt(e.lng,e.lat):Gt.convert(e),this},yr.prototype.setSouthWest=function(e){return this._sw=e instanceof Gt?new Gt(e.lng,e.lat):Gt.convert(e),this},yr.prototype.extend=function(e){var t,r,a=this._sw,u=this._ne;if(e instanceof Gt)t=e,r=e;else{if(!(e instanceof yr))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(yr.convert(e)):this.extend(Gt.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 Gt(t.lng,t.lat),this._ne=new Gt(r.lng,r.lat)),this},yr.prototype.getCenter=function(){return new Gt((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},yr.prototype.getSouthWest=function(){return this._sw},yr.prototype.getNorthEast=function(){return this._ne},yr.prototype.getNorthWest=function(){return new Gt(this.getWest(),this.getNorth())},yr.prototype.getSouthEast=function(){return new Gt(this.getEast(),this.getSouth())},yr.prototype.getWest=function(){return this._sw.lng},yr.prototype.getSouth=function(){return this._sw.lat},yr.prototype.getEast=function(){return this._ne.lng},yr.prototype.getNorth=function(){return this._ne.lat},yr.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},yr.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},yr.prototype.isEmpty=function(){return!(this._sw&&this._ne)},yr.prototype.contains=function(e){var t=Gt.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},yr.convert=function(e){return!e||e instanceof yr?e:new yr(e)};var Gt=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")};Gt.prototype.wrap=function(){return new Gt(It(this.lng,-180,180),this.lat)},Gt.prototype.toArray=function(){return[this.lng,this.lat]},Gt.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Gt.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))},Gt.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 yr(new Gt(this.lng-r,this.lat-t),new Gt(this.lng+r,this.lat+t))},Gt.convert=function(e){if(e instanceof Gt)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Gt(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new Gt(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 md=2*Math.PI*63710088e-1;function yd(e){return md*Math.cos(e*Math.PI/180)}function vd(e){return(180+e)/360}function gd(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function _d(e,t){return e/yd(t)}function wp(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=Gt.convert(e);return new Da(vd(r.lng),gd(r.lat),_d(t,r.lat))},Da.prototype.toLngLat=function(){return new Gt(360*this.x-180,wp(this.y))},Da.prototype.toAltitude=function(){return this.z*yd(wp(this.y))},Da.prototype.meterInMercatorCoordinateUnits=function(){return 1/md*(e=wp(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,v=(a=this.y,u=this.z,c=dd(256*(r=this.x),256*(a=Math.pow(2,u)-a-1),u),h=dd(256*(r+1),256*(a+1),u),c[0]+","+c[1]+","+h[0]+","+h[1]),_=function(x,S,T){for(var E,k="",U=x;U>0;U--)k+=(S&(E=1<<U-1)?1:0)+(T&E?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}",v)},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 xd=function(e,t){this.wrap=e,this.canonical=t,this.key=Bl(e,t.z,t.z,t.x,t.y)},vr=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)}vr.prototype.equals=function(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)},vr.prototype.scaledTo=function(e){var t=this.canonical.z-e;return e>this.canonical.z?new vr(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new vr(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)},vr.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)},vr.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},vr.prototype.children=function(e){if(this.overscaledZ>=e)return[new vr(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 vr(t,this.wrap,t,r,a),new vr(t,this.wrap,t,r+1,a),new vr(t,this.wrap,t,r,a+1),new vr(t,this.wrap,t,r+1,a+1)]},vr.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))},vr.prototype.wrapped=function(){return new vr(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},vr.prototype.unwrapTo=function(e){return new vr(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)},vr.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},vr.prototype.toUnwrapped=function(){return new xd(this.wrap,this.canonical)},vr.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},vr.prototype.getTilePoint=function(e){return this.canonical.getTilePoint(new Da(e.x-this.wrap,e.y))},Ve("CanonicalTileID",La),Ve("OverscaledTileID",vr,{omit:["posMatrix"]});var mo=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)]};mo.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])},mo.prototype.getUnpackVector=function(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},mo.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)},mo.prototype._unpackMapbox=function(e,t,r){return(256*e*256+256*t+r)/10-1e4},mo.prototype._unpackTerrarium=function(e,t,r){return 256*e+t+r/256-32768},mo.prototype.getPixels=function(){return new pi({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},mo.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 v=-t*this.dim,_=-r*this.dim,x=c;x<h;x++)for(var S=a;S<u;S++)this.data[this._idx(S,x)]=e.data[this._idx(S+v,x+_)]},Ve("DEMData",mo);var Ku=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}};Ku.prototype.encode=function(e){return this._stringToNumber[e]},Ku.prototype.decode=function(e){return this._numberToString[e]};var Ju=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},Sp={geometry:{configurable:!0}};Sp.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},Sp.geometry.set=function(e){this._geometry=e},Ju.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(Ju.prototype,Sp);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]||{},tt(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=tt({},(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]={}),tt(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 v={};if(this.deletedStates[h]===null)for(var _ in this.state[h])v[_]={},this.state[h][_]={};else for(var x in this.deletedStates[h]){if(this.deletedStates[h][x]===null)this.state[h][x]={};else for(var S=0,T=Object.keys(this.deletedStates[h][x]);S<T.length;S+=1)delete this.state[h][x][T[S]];v[x]=this.state[h][x]}r[h]=r[h]||{},tt(r[h],v)}if(this.stateChanges={},this.deletedStates={},Object.keys(r).length!==0)for(var E in e)e[E].setFeatureState(r,t)};var yo=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 A,this.promoteId=t};function bd(e,t,r,a,u){return cr(e,function(c,h){var v=t instanceof Ia?t.get(h):null;return v&&v.evaluate?v.evaluate(r,a,u):v})}function wd(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 v=h[c];t=Math.min(t,v.x),r=Math.min(r,v.y),a=Math.max(a,v.x),u=Math.max(u,v.y)}return{minX:t,minY:r,maxX:a,maxY:u}}function q_(e,t){return t-e}yo.prototype.insert=function(e,t,r,a,u,c){var h=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,a,u);for(var v=c?this.grid3D:this.grid,_=0;_<t.length;_++){for(var x=t[_],S=[1/0,1/0,-1/0,-1/0],T=0;T<x.length;T++){var E=x[T];S[0]=Math.min(S[0],E.x),S[1]=Math.min(S[1],E.y),S[2]=Math.max(S[2],E.x),S[3]=Math.max(S[3],E.y)}S[0]<8192&&S[1]<8192&&S[2]>=0&&S[3]>=0&&v.insert(h,S[0],S[1],S[2],S[3])}},yo.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new _s.VectorTile(new Vu(this.rawTileData)).layers,this.sourceLayerCoder=new Ku(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},yo.prototype.query=function(e,t,r,a){var u=this;this.loadVTLayers();for(var c=e.params||{},h=8192/e.tileSize/e.scale,v=rs(c.filter),_=e.queryGeometry,x=e.queryPadding*h,S=wd(_),T=this.grid.query(S.minX-x,S.minY-x,S.maxX+x,S.maxY+x),E=wd(e.cameraQueryGeometry),k=this.grid3D.query(E.minX-x,E.minY-x,E.maxX+x,E.maxY+x,function(se,ce,ye,Se){return function(Ae,$e,ke,We,ze){for(var lt=0,Qe=Ae;lt<Qe.length;lt+=1){var qe=Qe[lt];if($e<=qe.x&&ke<=qe.y&&We>=qe.x&&ze>=qe.y)return!0}var ct=[new me($e,ke),new me($e,ze),new me(We,ze),new me(We,ke)];if(Ae.length>2){for(var ot=0,xt=ct;ot<xt.length;ot+=1)if(Ji(Ae,xt[ot]))return!0}for(var He=0;He<Ae.length-1;He++)if(ka(Ae[He],Ae[He+1],ct))return!0;return!1}(e.cameraQueryGeometry,se-x,ce-x,ye+x,Se+x)}),U=0,N=k;U<N.length;U+=1)T.push(N[U]);T.sort(q_);for(var J,H={},re=function(se){var ce=T[se];if(ce!==J){J=ce;var ye=u.featureIndexArray.get(ce),Se=null;u.loadMatchingFeature(H,ye.bucketIndex,ye.sourceLayerIndex,ye.featureIndex,v,c.layers,c.availableImages,t,r,a,function(Ae,$e,ke){return Se||(Se=Jt(Ae)),$e.queryIntersectsFeature(_,Ae,ke,Se,u.z,e.transform,h,e.pixelPosMatrix)})}},oe=0;oe<T.length;oe++)re(oe);return H},yo.prototype.loadMatchingFeature=function(e,t,r,a,u,c,h,v,_,x,S){var T=this.bucketLayerIDs[t];if(!c||function(Ae,$e){for(var ke=0;ke<Ae.length;ke++)if($e.indexOf(Ae[ke])>=0)return!0;return!1}(c,T)){var E=this.sourceLayerCoder.decode(r),k=this.vtLayers[E].feature(a);if(u.needGeometry){var U=or(k,!0);if(!u.filter(new ht(this.tileID.overscaledZ),U,this.tileID.canonical))return}else if(!u.filter(new ht(this.tileID.overscaledZ),k))return;for(var N=this.getId(k,E),J=0;J<T.length;J++){var H=T[J];if(!(c&&c.indexOf(H)<0)){var re=v[H];if(re){var oe={};N!==void 0&&x&&(oe=x.getState(re.sourceLayer||"_geojsonTileLayer",N));var se=tt({},_[H]);se.paint=bd(se.paint,re.paint,k,oe,h),se.layout=bd(se.layout,re.layout,k,oe,h);var ce=!S||S(k,re,oe);if(ce){var ye=new Ju(k,this.z,this.x,this.y,N);ye.layer=se;var Se=e[H];Se===void 0&&(Se=e[H]=[]),Se.push({featureIndex:a,feature:ye,intersectionZ:ce})}}}}}},yo.prototype.lookupSymbolFeatures=function(e,t,r,a,u,c,h,v){var _={};this.loadVTLayers();for(var x=rs(u),S=0,T=e;S<T.length;S+=1)this.loadMatchingFeature(_,r,a,T[S],x,c,h,v,t);return _},yo.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},yo.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",yo,{omit:["rawTileData","sourceLayerCoder"]});var Pr=function(e,t){this.tileID=e,this.uid=Dt(),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,S){var T={};if(!S)return T;for(var E=function(){var N=U[k],J=N.layerIds.map(function(oe){return S.getLayer(oe)}).filter(Boolean);if(J.length!==0){N.layers=J,N.stateDependentLayerIds&&(N.stateDependentLayers=N.stateDependentLayerIds.map(function(oe){return J.filter(function(se){return se.id===oe})[0]}));for(var H=0,re=J;H<re.length;H+=1)T[re[H].id]=N}},k=0,U=x;k<U.length;k+=1)E();return T}(e.buckets,t.style),this.hasSymbolBuckets=!1,this.buckets){var u=this.buckets[a];if(u instanceof Bt){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 Bt&&h.hasRTLText){this.hasRTLText=!0,di.isLoading()||di.isLoaded()||yl()!=="deferred"||Ui();break}}for(var v in this.queryPadding=0,this.buckets){var _=this.buckets[v];this.queryPadding=Math.max(this.queryPadding,t.style.getLayer(v).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,v,_,x){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:a,cameraQueryGeometry:u,scale:c,tileSize:this.tileSize,pixelPosMatrix:x,transform:v,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),v=this.tileID.canonical,_=v.z,x=v.x,S=v.y,T={z:_,x,y:S},E=0;E<c.length;E++){var k=c.feature(E);if(h.needGeometry){var U=or(k,!0);if(!h.filter(new ht(this.tileID.overscaledZ),U,this.tileID.canonical))continue}else if(!h.filter(new ht(this.tileID.overscaledZ),k))continue;var N=r.getId(k,u),J=new Ju(k,_,x,S,N);J.tile=T,e.push(J)}}},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],v=e[c];if(h&&v&&Object.keys(v).length!==0){u.update(v,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,Sd=function(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},Wo.mark(this._marks.start)};Sd.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=Et,l.DEMData=mo,l.DataConstantProperty=Ze,l.DictionaryCoder=Ku,l.EXTENT=8192,l.ErrorEvent=Q,l.EvaluationParameters=ht,l.Event=j,l.Evented=te,l.FeatureIndex=yo,l.FillBucket=pn,l.FillExtrusionBucket=hn,l.ImageAtlas=Ml,l.ImagePosition=Nu,l.LineBucket=ti,l.LngLat=Gt,l.LngLatBounds=yr,l.MercatorCoordinate=Da,l.ONE_EM=24,l.OverscaledTileID=vr,l.Point=me,l.Point$1=me,l.Properties=Lr,l.Protobuf=Vu,l.RGBAImage=pi,l.RequestManager=Kr,l.RequestPerformance=Sd,l.ResourceType=Wa,l.SegmentVector=D,l.SourceFeatureState=Ps,l.StructArrayLayout1ui2=wl,l.StructArrayLayout2f1f2i16=co,l.StructArrayLayout2i4=uo,l.StructArrayLayout3ui6=Cn,l.StructArrayLayout4i8=gl,l.SymbolBucket=Bt,l.Texture=Ba,l.Tile=Pr,l.Transitionable=Dr,l.Uniform1f=Ie,l.Uniform1i=_e,l.Uniform2f=Te,l.Uniform3f=De,l.Uniform4f=Ge,l.UniformColor=Ke,l.UniformMatrix4f=bt,l.UnwrappedTileID=xd,l.ValidationError=Z,l.WritingMode=ki,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=_p,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,v){t(h,function(_,x){_&&(c=_),u[v]=x,--a==0&&r(c,u)})})},l.bezier=Re,l.bindAll=ur,l.browser=rn,l.cacheEntryPossiblyAdded=function(e){++oa>Ga&&(e.getActor().send("enforceCacheSizeLimit",Po),oa=0)},l.clamp=je,l.clearTileCache=function(e){var t=le.caches.delete("mapbox-tiles");e&&t.catch(e).then(function(){return e()})},l.clipLine=nd,l.clone=function(e){var t=new Ct(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=gr,l.clone$2=function(e){var t=new Ct(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},l.collisionCircleLayout=l_,l.config=Rt,l.create=function(){var e=new Ct(16);return Ct!=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 Ct(9);return Ct!=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 Ct(4);return Ct!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},l.createCommonjsModule=ae,l.createExpression=es,l.createLayout=Er,l.createStyleLayer=function(e){return e.type==="custom"?new U_(e):new N_[e.type](e)},l.cross=function(e,t,r){var a=t[0],u=t[1],c=t[2],h=r[0],v=r[1],_=r[2];return e[0]=u*_-c*v,e[1]=c*h-a*_,e[2]=a*v-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=Ye,l.emitValidationErrors=wa,l.endsWith=Sr,l.enforceCacheSizeLimit=function(e){ko(),wi&&wi.then(function(t){t.keys().then(function(r){for(var a=0;a<r.length-e;a++)t.delete(r[a])})})},l.evaluateSizeForFeature=Yf,l.evaluateSizeForZoom=Qf,l.evaluateVariableOffset=sd,l.evented=ml,l.extend=tt,l.featureFilter=rs,l.filterObject=Xr,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=mp,l.getAnchorJustification=gp,l.getArrayBuffer=sa,l.getImage=C,l.getJSON=function(e,t){return Mo(tt(e,{type:"json"}),t)},l.getRTLTextPluginStatus=yl,l.getReferrer=Wn,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=mi,l.invert=function(e,t){var r=t[0],a=t[1],u=t[2],c=t[3],h=t[4],v=t[5],_=t[6],x=t[7],S=t[8],T=t[9],E=t[10],k=t[11],U=t[12],N=t[13],J=t[14],H=t[15],re=r*v-a*h,oe=r*_-u*h,se=r*x-c*h,ce=a*_-u*v,ye=a*x-c*v,Se=u*x-c*_,Ae=S*N-T*U,$e=S*J-E*U,ke=S*H-k*U,We=T*J-E*N,ze=T*H-k*N,lt=E*H-k*J,Qe=re*lt-oe*ze+se*We+ce*ke-ye*$e+Se*Ae;return Qe?(e[0]=(v*lt-_*ze+x*We)*(Qe=1/Qe),e[1]=(u*ze-a*lt-c*We)*Qe,e[2]=(N*Se-J*ye+H*ce)*Qe,e[3]=(E*ye-T*Se-k*ce)*Qe,e[4]=(_*ke-h*lt-x*$e)*Qe,e[5]=(r*lt-u*ke+c*$e)*Qe,e[6]=(J*se-U*Se-H*oe)*Qe,e[7]=(S*Se-E*se+k*oe)*Qe,e[8]=(h*ze-v*ke+x*Ae)*Qe,e[9]=(a*ke-r*ze-c*Ae)*Qe,e[10]=(U*ye-N*se+H*re)*Qe,e[11]=(T*se-S*ye-k*re)*Qe,e[12]=(v*$e-h*We-_*Ae)*Qe,e[13]=(r*We-a*$e+u*Ae)*Qe,e[14]=(N*oe-U*ce-J*re)*Qe,e[15]=(S*ce-T*oe+E*re)*Qe,e):null},l.isChar=Ce,l.isMapboxURL=_i,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=cr,l.mercatorXfromLng=vd,l.mercatorYfromLat=gd,l.mercatorZfromAltitude=_d,l.mul=ip,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=pr,l.offscreenCanvasSupported=aa,l.ortho=function(e,t,r,a,u,c,h){var v=1/(t-r),_=1/(a-u),x=1/(c-h);return e[0]=-2*v,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)*v,e[13]=(u+a)*_,e[14]=(h+c)*x,e[15]=1,e},l.parseGlyphPBF=function(e){return new Vu(e).readFields(__,[])},l.pbf=Vu,l.performSymbolLayout=function(e,t,r,a,u,c,h){e.createArrays(),e.tilePixelRatio=8192/(512*e.overscaling),e.compareText={},e.iconsNeedLinear=!1;var v=e.layers[0].layout,_=e.layers[0]._unevaluatedLayout._values,x={};if(e.textSizeData.kind==="composite"){var S=e.textSizeData,T=S.maxZoom;x.compositeTextSizes=[_["text-size"].possiblyEvaluate(new ht(S.minZoom),h),_["text-size"].possiblyEvaluate(new ht(T),h)]}if(e.iconSizeData.kind==="composite"){var E=e.iconSizeData,k=E.maxZoom;x.compositeIconSizes=[_["icon-size"].possiblyEvaluate(new ht(E.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 U=24*v.get("text-line-height"),N=v.get("text-rotation-alignment")==="map"&&v.get("symbol-placement")!=="point",J=v.get("text-keep-upright"),H=v.get("text-size"),re=function(){var ce=se[oe],ye=v.get("text-font").evaluate(ce,{},h).join(","),Se=H.evaluate(ce,{},h),Ae=x.layoutTextSize.evaluate(ce,{},h),$e=x.layoutIconSize.evaluate(ce,{},h),ke={horizontal:{},vertical:void 0},We=ce.text,ze=[0,0];if(We){var lt=We.toString(),Qe=24*v.get("text-letter-spacing").evaluate(ce,{},h),qe=function(ft){for(var Vt=0,Mt=ft;Vt<Mt.length;Vt+=1)if(wt=Mt[Vt].charCodeAt(0),Ce.Arabic(wt)||Ce["Arabic Supplement"](wt)||Ce["Arabic Extended-A"](wt)||Ce["Arabic Presentation Forms-A"](wt)||Ce["Arabic Presentation Forms-B"](wt))return!1;var wt;return!0}(lt)?Qe:0,ct=v.get("text-anchor").evaluate(ce,{},h),ot=v.get("text-variable-anchor");if(!ot){var xt=v.get("text-radial-offset").evaluate(ce,{},h);ze=xt?sd(ct,[24*xt,vp]):v.get("text-offset").evaluate(ce,{},h).map(function(ft){return 24*ft})}var He=N?"center":v.get("text-justify").evaluate(ce,{},h),St=v.get("symbol-placement"),Wt=St==="point"?24*v.get("text-max-width").evaluate(ce,{},h):0,er=function(){e.allowVerticalPlacement&&fl(lt)&&(ke.vertical=qu(We,t,r,u,ye,Wt,U,ct,"left",qe,ze,ki.vertical,!0,St,Ae,Se))};if(!N&&ot){for(var Yt=He==="auto"?ot.map(function(ft){return gp(ft)}):[He],Ht=!1,tr=0;tr<Yt.length;tr++){var br=Yt[tr];if(!ke.horizontal[br])if(Ht)ke.horizontal[br]=ke.horizontal[0];else{var wr=qu(We,t,r,u,ye,Wt,U,"center",br,qe,ze,ki.horizontal,!1,St,Ae,Se);wr&&(ke.horizontal[br]=wr,Ht=wr.positionedLines.length===1)}}er()}else{He==="auto"&&(He=gp(ct));var Wr=qu(We,t,r,u,ye,Wt,U,ct,He,qe,ze,ki.horizontal,!1,St,Ae,Se);Wr&&(ke.horizontal[He]=Wr),er(),fl(lt)&&N&&J&&(ke.vertical=qu(We,t,r,u,ye,Wt,U,ct,He,qe,ze,ki.vertical,!1,St,Ae,Se))}}var kr=void 0,Hr=!1;if(ce.icon&&ce.icon.name){var ar=a[ce.icon.name];ar&&(kr=function(ft,Vt,Mt){var wt=mp(Mt),ri=Vt[0]-ft.displaySize[0]*wt.horizontalAlign,Fr=Vt[1]-ft.displaySize[1]*wt.verticalAlign;return{image:ft,top:Fr,bottom:Fr+ft.displaySize[1],left:ri,right:ri+ft.displaySize[0]}}(u[ce.icon.name],v.get("icon-offset").evaluate(ce,{},h),v.get("icon-anchor").evaluate(ce,{},h)),Hr=ar.sdf,e.sdfIcons===void 0?e.sdfIcons=ar.sdf:e.sdfIcons!==ar.sdf&&Lt("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(ar.pixelRatio!==e.pixelRatio||v.get("icon-rotate").constantOr(1)!==0)&&(e.iconsNeedLinear=!0))}var Mr=ud(ke.horizontal)||ke.vertical;e.iconsInText=!!Mr&&Mr.iconsInText,(Mr||kr)&&function(ft,Vt,Mt,wt,ri,Fr,jt,fr,Or,Tt,Dn){var Mi=Fr.textMaxSize.evaluate(Vt,{});Mi===void 0&&(Mi=jt);var Ln,sr=ft.layers[0].layout,Rn=sr.get("icon-offset").evaluate(Vt,{},Dn),Qi=ud(Mt.horizontal),ks=jt/24,Ra=ft.tilePixelRatio*ks,Ms=ft.tilePixelRatio*Mi/24,vo=ft.tilePixelRatio*fr,zs=ft.tilePixelRatio*sr.get("symbol-spacing"),Yu=sr.get("text-padding")*ft.tilePixelRatio,Bs=sr.get("icon-padding")*ft.tilePixelRatio,Dl=sr.get("text-max-angle")/180*Math.PI,Qu=sr.get("text-rotation-alignment")==="map"&&sr.get("symbol-placement")!=="point",ec=sr.get("icon-rotation-alignment")==="map"&&sr.get("symbol-placement")!=="point",go=sr.get("symbol-placement"),Ll=zs/2,Ds=sr.get("icon-text-fit");wt&&Ds!=="none"&&(ft.allowVerticalPlacement&&Mt.vertical&&(Ln=Jf(wt,Mt.vertical,Ds,sr.get("icon-text-fit-padding"),Rn,ks)),Qi&&(wt=Jf(wt,Qi,Ds,sr.get("icon-text-fit-padding"),Rn,ks)));var Ho=function(j_,jl){jl.x<0||jl.x>=8192||jl.y<0||jl.y>=8192||function(lr,fn,$_,Xo,Ep,Ad,ac,Fn,sc,$l,lc,uc,Cp,Ed,Zl,Cd,Pd,kd,Md,zd,zi,cc,Bd,On,Z_){var Dd,Oa,Vs,Us,Ns,qs=lr.addToLineVertexArray(fn,$_),Ld=0,Rd=0,Fd=0,Od=0,Pp=-1,kp=-1,_o={},Vd=V(""),Mp=0,zp=0;if(Fn._unevaluatedLayout.getValue("text-radial-offset")===void 0?(Mp=(Dd=Fn.layout.get("text-offset").evaluate(zi,{},On).map(function(Wl){return 24*Wl}))[0],zp=Dd[1]):(Mp=24*Fn.layout.get("text-radial-offset").evaluate(zi,{},On),zp=vp),lr.allowVerticalPlacement&&Xo.vertical){var Ud=Fn.layout.get("text-rotate").evaluate(zi,{},On)+90;Us=new Wu(sc,fn,$l,lc,uc,Xo.vertical,Cp,Ed,Zl,Ud),ac&&(Ns=new Wu(sc,fn,$l,lc,uc,ac,Pd,kd,Zl,Ud))}if(Ep){var Bp=Fn.layout.get("icon-rotate").evaluate(zi,{}),Nd=Fn.layout.get("icon-text-fit")!=="none",qd=od(Ep,Bp,Bd,Nd),Dp=ac?od(ac,Bp,Bd,Nd):void 0;Vs=new Wu(sc,fn,$l,lc,uc,Ep,Pd,kd,!1,Bp),Ld=4*qd.length;var jd=lr.iconSizeData,Gl=null;jd.kind==="source"?(Gl=[128*Fn.layout.get("icon-size").evaluate(zi,{})])[0]>32640&&Lt(lr.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):jd.kind==="composite"&&((Gl=[128*cc.compositeIconSizes[0].evaluate(zi,{},On),128*cc.compositeIconSizes[1].evaluate(zi,{},On)])[0]>32640||Gl[1]>32640)&&Lt(lr.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),lr.addSymbols(lr.icon,qd,Gl,zd,Md,zi,!1,fn,qs.lineStartIndex,qs.lineLength,-1,On),Pp=lr.icon.placedSymbolArray.length-1,Dp&&(Rd=4*Dp.length,lr.addSymbols(lr.icon,Dp,Gl,zd,Md,zi,ki.vertical,fn,qs.lineStartIndex,qs.lineLength,-1,On),kp=lr.icon.placedSymbolArray.length-1)}for(var $d in Xo.horizontal){var pc=Xo.horizontal[$d];if(!Oa){Vd=V(pc.text);var G_=Fn.layout.get("text-rotate").evaluate(zi,{},On);Oa=new Wu(sc,fn,$l,lc,uc,pc,Cp,Ed,Zl,G_)}var Zd=pc.positionedLines.length===1;if(Fd+=ld(lr,fn,pc,Ad,Fn,Zl,zi,Cd,qs,Xo.vertical?ki.horizontal:ki.horizontalOnly,Zd?Object.keys(Xo.horizontal):[$d],_o,Pp,cc,On),Zd)break}Xo.vertical&&(Od+=ld(lr,fn,Xo.vertical,Ad,Fn,Zl,zi,Cd,qs,ki.vertical,["vertical"],_o,kp,cc,On));var W_=Oa?Oa.boxStartIndex:lr.collisionBoxArray.length,H_=Oa?Oa.boxEndIndex:lr.collisionBoxArray.length,X_=Us?Us.boxStartIndex:lr.collisionBoxArray.length,K_=Us?Us.boxEndIndex:lr.collisionBoxArray.length,J_=Vs?Vs.boxStartIndex:lr.collisionBoxArray.length,Y_=Vs?Vs.boxEndIndex:lr.collisionBoxArray.length,Q_=Ns?Ns.boxStartIndex:lr.collisionBoxArray.length,ex=Ns?Ns.boxEndIndex:lr.collisionBoxArray.length,Vn=-1,hc=function(Wl,Wd){return Wl&&Wl.circleDiameter?Math.max(Wl.circleDiameter,Wd):Wd};Vn=hc(Oa,Vn),Vn=hc(Us,Vn),Vn=hc(Vs,Vn);var Gd=(Vn=hc(Ns,Vn))>-1?1:0;Gd&&(Vn*=Z_/24),lr.glyphOffsetArray.length>=Bt.MAX_GLYPHS&&Lt("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),zi.sortKey!==void 0&&lr.addToSortKeyRanges(lr.symbolInstances.length,zi.sortKey),lr.symbolInstances.emplaceBack(fn.x,fn.y,_o.right>=0?_o.right:-1,_o.center>=0?_o.center:-1,_o.left>=0?_o.left:-1,_o.vertical||-1,Pp,kp,Vd,W_,H_,X_,K_,J_,Y_,Q_,ex,$l,Fd,Od,Ld,Rd,Gd,0,Cp,Mp,zp,Vn)}(ft,jl,j_,Mt,wt,ri,Ln,ft.layers[0],ft.collisionBoxArray,Vt.index,Vt.sourceLayerIndex,ft.index,Ra,Yu,Qu,Or,vo,Bs,ec,Rn,Vt,Fr,Tt,Dn,jt)};if(go==="line")for(var Ls=0,tc=nd(Vt.geometry,0,0,8192,8192);Ls<tc.length;Ls+=1)for(var rc=tc[Ls],Rl=0,Fl=A_(rc,zs,Dl,Mt.vertical||Qi,wt,24,Ms,ft.overscaling,8192);Rl<Fl.length;Rl+=1){var ic=Fl[Rl];Qi&&k_(ft,Qi.text,Ll,ic)||Ho(rc,ic)}else if(go==="line-center")for(var Ol=0,Vl=Vt.geometry;Ol<Vl.length;Ol+=1){var Ul=Vl[Ol];if(Ul.length>1){var nc=I_(Ul,Dl,Mt.vertical||Qi,wt,24,Ms);nc&&Ho(Ul,nc)}}else if(Vt.type==="Polygon")for(var Rs=0,oc=cp(Vt.geometry,0);Rs<oc.length;Rs+=1){var Fs=oc[Rs],Nl=C_(Fs,16);Ho(Fs[0],new Ss(Nl.x,Nl.y,0))}else if(Vt.type==="LineString")for(var Fa=0,ql=Vt.geometry;Fa<ql.length;Fa+=1){var Os=ql[Fa];Ho(Os,new Ss(Os[0].x,Os[0].y,0))}else if(Vt.type==="Point")for(var Tp=0,Td=Vt.geometry;Tp<Td.length;Tp+=1)for(var Ip=0,Id=Td[Tp];Ip<Id.length;Ip+=1){var Ap=Id[Ip];Ho([Ap],new Ss(Ap.x,Ap.y,0))}}(e,ce,ke,kr,a,x,Ae,$e,ze,Hr,h)},oe=0,se=e.features;oe<se.length;oe+=1)re();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=di,l.polygonIntersectsPolygon=Mn,l.postMapLoadEvent=ia,l.postTurnstileEvent=Za,l.potpack=Wf,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=Cf,l.rotate=function(e,t,r){var a=t[0],u=t[1],c=t[2],h=t[3],v=Math.sin(r),_=Math.cos(r);return e[0]=a*_+c*v,e[1]=u*_+h*v,e[2]=a*-v+c*_,e[3]=u*-v+h*_,e},l.rotateX=function(e,t,r){var a=Math.sin(r),u=Math.cos(r),c=t[4],h=t[5],v=t[6],_=t[7],x=t[8],S=t[9],T=t[10],E=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+S*a,e[6]=v*u+T*a,e[7]=_*u+E*a,e[8]=x*u-c*a,e[9]=S*u-h*a,e[10]=T*u-v*a,e[11]=E*u-_*a,e},l.rotateZ=function(e,t,r){var a=Math.sin(r),u=Math.cos(r),c=t[0],h=t[1],v=t[2],_=t[3],x=t[4],S=t[5],T=t[6],E=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+S*a,e[2]=v*u+T*a,e[3]=_*u+E*a,e[4]=x*u-c*a,e[5]=S*u-h*a,e[6]=T*u-v*a,e[7]=E*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=T_,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,v,_,x,S,T,E,k,U,N=r[0],J=r[1],H=r[2];return t===e?(e[12]=t[0]*N+t[4]*J+t[8]*H+t[12],e[13]=t[1]*N+t[5]*J+t[9]*H+t[13],e[14]=t[2]*N+t[6]*J+t[10]*H+t[14],e[15]=t[3]*N+t[7]*J+t[11]*H+t[15]):(u=t[1],c=t[2],h=t[3],v=t[4],_=t[5],x=t[6],S=t[7],T=t[8],E=t[9],k=t[10],U=t[11],e[0]=a=t[0],e[1]=u,e[2]=c,e[3]=h,e[4]=v,e[5]=_,e[6]=x,e[7]=S,e[8]=T,e[9]=E,e[10]=k,e[11]=U,e[12]=a*N+v*J+T*H+t[12],e[13]=u*N+_*J+E*H+t[13],e[14]=c*N+x*J+k*H+t[14],e[15]=h*N+S*J+U*H+t[15]),e},l.triggerPluginCompletionEvent=zu,l.uniqueId=Dt,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=tp,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=Gi,l.window=le,l.wrap=It}),G(["./shared"],function(l){function ae(I){var C=typeof I;if(C==="number"||C==="boolean"||C==="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 Q=Object.keys(I).sort(),te="{",B=0;B<Q.length;B++)te+=JSON.stringify(Q[B])+":"+ae(I[Q[B]])+",";return te+"}"}function W(I){for(var C="",P=0,F=l.refProperties;P<F.length;P+=1)C+="/"+ae(I[F[P]]);return C}var ve=function(I){this.keyCache={},I&&this.replace(I)};ve.prototype.replace=function(I){this._layerConfigs={},this._layers={},this.update(I,[])},ve.prototype.update=function(I,C){for(var P=this,F=0,j=I;F<j.length;F+=1){var Q=j[F];this._layerConfigs[Q.id]=Q;var te=this._layers[Q.id]=l.createStyleLayer(Q);te._featureFilter=l.featureFilter(te.filter),this.keyCache[Q.id]&&delete this.keyCache[Q.id]}for(var B=0,Z=C;B<Z.length;B+=1){var ne=Z[B];delete this.keyCache[ne],delete this._layerConfigs[ne],delete this._layers[ne]}this.familiesBySource={};for(var xe=0,we=function(Ee,Pe){for(var ut={},Me=0;Me<Ee.length;Me++){var vt=Pe&&Pe[Ee[Me].id]||W(Ee[Me]);Pe&&(Pe[Ee[Me].id]=vt);var Ft=ut[vt];Ft||(Ft=ut[vt]=[]),Ft.push(Ee[Me])}var pt=[];for(var At in ut)pt.push(ut[At]);return pt}(l.values(this._layerConfigs),this.keyCache);xe<we.length;xe+=1){var fe=we[xe].map(function(Ee){return P._layers[Ee.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",Be=Oe[de];Be||(Be=Oe[de]=[]),Be.push(fe)}}};var me=function(I){var C={},P=[];for(var F in I){var j=I[F],Q=C[F]={};for(var te in j){var B=j[+te];if(B&&B.bitmap.width!==0&&B.bitmap.height!==0){var Z={x:0,y:0,w:B.bitmap.width+2,h:B.bitmap.height+2};P.push(Z),Q[te]={rect:Z,metrics:B.metrics}}}}var ne=l.potpack(P),xe=new l.AlphaImage({width:ne.w||1,height:ne.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=C[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=C};l.register("GlyphAtlas",me);var Le=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,C,P){for(var F=new l.EvaluationParameters(C),j=0,Q=I;j<Q.length;j+=1)Q[j].recalculate(F,P)}function ge(I,C){var P=l.getArrayBuffer(I.request,function(F,j,Q,te){F?C(F):j&&C(null,{vectorTile:new l.vectorTile.VectorTile(new l.pbf(j)),rawData:j,cacheControl:Q,expires:te})});return function(){P.cancel(),C()}}Le.prototype.parse=function(I,C,P,F,j){var Q=this;this.status="parsing",this.data=I,this.collisionBoxArray=new l.CollisionBoxArray;var te=new l.DictionaryCoder(Object.keys(I.layers).sort()),B=new l.FeatureIndex(this.tileID,this.promoteId);B.bucketLayerIDs=[];var Z,ne,xe,we,fe={},be={featureIndex:B,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:P},Ue=C.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 Be=te.encode(Oe),Ee=[],Pe=0;Pe<de.length;Pe++){var ut=de.feature(Pe),Me=B.getId(ut,Oe);Ee.push({feature:ut,id:Me,index:Pe,sourceLayerIndex:Be})}for(var vt=0,Ft=Ue[Oe];vt<Ft.length;vt+=1){var pt=Ft[vt],At=pt[0];At.minzoom&&this.zoom<Math.floor(At.minzoom)||At.maxzoom&&this.zoom>=At.maxzoom||At.visibility!=="none"&&(le(pt,this.zoom,P),(fe[At.id]=At.createBucket({index:B.bucketLayerIDs.length,layers:pt,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Be,sourceID:this.source})).populate(Ee,be,this.tileID.canonical),B.bucketLayerIDs.push(pt.map(function(zt){return zt.id})))}}}var _t=l.mapObject(be.glyphDependencies,function(zt){return Object.keys(zt).map(Number)});Object.keys(_t).length?F.send("getGlyphs",{uid:this.uid,stacks:_t},function(zt,mt){Z||(Z=zt,ne=mt,ir.call(Q))}):ne={};var Ur=Object.keys(be.iconDependencies);Ur.length?F.send("getImages",{icons:Ur,source:this.source,tileID:this.tileID,type:"icons"},function(zt,mt){Z||(Z=zt,xe=mt,ir.call(Q))}):xe={};var Pt=Object.keys(be.patternDependencies);function ir(){if(Z)return j(Z);if(ne&&xe&&we){var zt=new me(ne),mt=new l.ImageAtlas(xe,we);for(var Et in fe){var Jr=fe[Et];Jr instanceof l.SymbolBucket?(le(Jr.layers,this.zoom,P),l.performSymbolLayout(Jr,ne,zt.positions,xe,mt.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):Jr.hasPattern&&(Jr instanceof l.LineBucket||Jr instanceof l.FillBucket||Jr instanceof l.FillExtrusionBucket)&&(le(Jr.layers,this.zoom,P),Jr.addFeatures(be,this.tileID.canonical,mt.patternPositions))}this.status="done",j(null,{buckets:l.values(fe).filter(function(la){return!la.isEmpty()}),featureIndex:B,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:zt.image,imageAtlas:mt,glyphMap:this.returnDependencies?ne:null,iconMap:this.returnDependencies?xe:null,glyphPositions:this.returnDependencies?zt.positions:null})}}Pt.length?F.send("getImages",{icons:Pt,source:this.source,tileID:this.tileID,type:"patterns"},function(zt,mt){Z||(Z=zt,we=mt,ir.call(Q))}):we={},ir.call(this)};var Re=function(I,C,P,F){this.actor=I,this.layerIndex=C,this.availableImages=P,this.loadVectorData=F||ge,this.loading={},this.loaded={}};Re.prototype.loadTile=function(I,C){var P=this,F=I.uid;this.loading||(this.loading={});var j=!!(I&&I.request&&I.request.collectResourceTiming)&&new l.RequestPerformance(I.request),Q=this.loading[F]=new Le(I);Q.abort=this.loadVectorData(I,function(te,B){if(delete P.loading[F],te||!B)return Q.status="done",P.loaded[F]=Q,C(te);var Z=B.rawData,ne={};B.expires&&(ne.expires=B.expires),B.cacheControl&&(ne.cacheControl=B.cacheControl);var xe={};if(j){var we=j.finish();we&&(xe.resourceTiming=JSON.parse(JSON.stringify(we)))}Q.vectorTile=B.vectorTile,Q.parse(B.vectorTile,P.layerIndex,P.availableImages,P.actor,function(fe,be){if(fe||!be)return C(fe);C(null,l.extend({rawTileData:Z.slice(0)},be,ne,xe))}),P.loaded=P.loaded||{},P.loaded[F]=Q})},Re.prototype.reloadTile=function(I,C){var P=this,F=this.loaded,j=I.uid,Q=this;if(F&&F[j]){var te=F[j];te.showCollisionBoxes=I.showCollisionBoxes;var B=function(Z,ne){var xe=te.reloadCallback;xe&&(delete te.reloadCallback,te.parse(te.vectorTile,Q.layerIndex,P.availableImages,Q.actor,xe)),C(Z,ne)};te.status==="parsing"?te.reloadCallback=B:te.status==="done"&&(te.vectorTile?te.parse(te.vectorTile,this.layerIndex,this.availableImages,this.actor,B):B())}},Re.prototype.abortTile=function(I,C){var P=this.loading,F=I.uid;P&&P[F]&&P[F].abort&&(P[F].abort(),delete P[F]),C()},Re.prototype.removeTile=function(I,C){var P=this.loaded,F=I.uid;P&&P[F]&&delete P[F],C()};var Ye=l.window.ImageBitmap,je=function(){this.loaded={}};function It(I,C){if(I.length!==0){tt(I[0],C);for(var P=1;P<I.length;P++)tt(I[P],!1)}}function tt(I,C){for(var P=0,F=0,j=0,Q=I.length,te=Q-1;j<Q;te=j++){var B=(I[j][0]-I[te][0])*(I[te][1]+I[j][1]),Z=P+B;F+=Math.abs(P)>=Math.abs(B)?P-Z+B:B-Z+P,P=Z}P+F>=0!=!!C&&I.reverse()}je.prototype.loadTile=function(I,C){var P=I.uid,F=I.encoding,j=I.rawImageData,Q=Ye&&j instanceof Ye?this.getImageData(j):j,te=new l.DEMData(P,Q,F);this.loaded=this.loaded||{},this.loaded[P]=te,C(null,te)},je.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 C=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:C.width,height:C.height},C.data)},je.prototype.removeTile=function(I){var C=this.loaded,P=I.uid;C&&C[P]&&delete C[P]};var dt=l.vectorTile.VectorTileFeature.prototype.toGeoJSON,Dt=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))};Dt.prototype.loadGeometry=function(){if(this._feature.type===1){for(var I=[],C=0,P=this._feature.geometry;C<P.length;C+=1){var F=P[C];I.push([new l.Point$1(F[0],F[1])])}return I}for(var j=[],Q=0,te=this._feature.geometry;Q<te.length;Q+=1){for(var B=[],Z=0,ne=te[Q];Z<ne.length;Z+=1){var xe=ne[Z];B.push(new l.Point$1(xe[0],xe[1]))}j.push(B)}return j},Dt.prototype.toGeoJSON=function(I,C,P){return dt.call(this,I,C,P)};var Xt=function(I){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=l.EXTENT,this.length=I.length,this._features=I};Xt.prototype.feature=function(I){return new Dt(this._features[I])};var Kt=l.vectorTile.VectorTileFeature,ur=Sr;function Sr(I,C){this.options=C||{},this.features=I,this.length=I.length}function cr(I,C){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=C||4096}Sr.prototype.feature=function(I){return new cr(this.features[I],this.options.extent)},cr.prototype.loadGeometry=function(){var I=this.rawGeometry;this.geometry=[];for(var C=0;C<I.length;C++){for(var P=I[C],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},cr.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var I=this.geometry,C=1/0,P=-1/0,F=1/0,j=-1/0,Q=0;Q<I.length;Q++)for(var te=I[Q],B=0;B<te.length;B++){var Z=te[B];C=Math.min(C,Z.x),P=Math.max(P,Z.x),F=Math.min(F,Z.y),j=Math.max(j,Z.y)}return[C,F,P,j]},cr.prototype.toGeoJSON=Kt.prototype.toGeoJSON;var Xr=gi,gr=ur;function gi(I){var C=new l.pbf;return function(P,F){for(var j in P.layers)F.writeMessage(3,Lt,P.layers[j])}(I,C),C.finish()}function Lt(I,C){var P;C.writeVarintField(15,I.version||1),C.writeStringField(1,I.name||""),C.writeVarintField(5,I.extent||4096);var F={keys:[],values:[],keycache:{},valuecache:{}};for(P=0;P<I.length;P++)F.feature=I.feature(P),C.writeMessage(2,Tr,F);var j=F.keys;for(P=0;P<j.length;P++)C.writeStringField(3,j[P]);var Q=F.values;for(P=0;P<Q.length;P++)C.writeMessage(4,ja,Q[P])}function Tr(I,C){var P=I.feature;P.id!==void 0&&C.writeVarintField(1,P.id),C.writeMessage(2,To,I),C.writeVarintField(3,P.type),C.writeMessage(4,Ao,P)}function To(I,C){var P=I.feature,F=I.keys,j=I.values,Q=I.keycache,te=I.valuecache;for(var B in P.properties){var Z=Q[B];Z===void 0&&(F.push(B),Q[B]=Z=F.length-1),C.writeVarint(Z);var ne=P.properties[B],xe=typeof ne;xe!=="string"&&xe!=="boolean"&&xe!=="number"&&(ne=JSON.stringify(ne));var we=xe+":"+ne,fe=te[we];fe===void 0&&(j.push(ne),te[we]=fe=j.length-1),C.writeVarint(fe)}}function ii(I,C){return(C<<3)+(7&I)}function Io(I){return I<<1^I>>31}function Ao(I,C){for(var P=I.loadGeometry(),F=I.type,j=0,Q=0,te=P.length,B=0;B<te;B++){var Z=P[B],ne=1;F===1&&(ne=Z.length),C.writeVarint(ii(1,ne));for(var xe=F===3?Z.length-1:Z.length,we=0;we<xe;we++){we===1&&F!==1&&C.writeVarint(ii(2,xe-1));var fe=Z[we].x-j,be=Z[we].y-Q;C.writeVarint(Io(fe)),C.writeVarint(Io(be)),j+=fe,Q+=be}F===3&&C.writeVarint(ii(7,1))}}function ja(I,C){var P=typeof I;P==="string"?C.writeStringField(1,I):P==="boolean"?C.writeBooleanField(7,I):P==="number"&&(I%1!=0?C.writeDoubleField(3,I):I<0?C.writeSVarintField(6,I):C.writeVarintField(5,I))}function dn(I,C,P,F){Bi(I,P,F),Bi(C,2*P,2*F),Bi(C,2*P+1,2*F+1)}function Bi(I,C,P){var F=I[C];I[C]=I[P],I[P]=F}function Zi(I,C,P,F){var j=I-P,Q=C-F;return j*j+Q*Q}Xr.fromVectorTileJs=gi,Xr.fromGeojsonVt=function(I,C){C=C||{};var P={};for(var F in I)P[F]=new ur(I[F].features,C),P[F].name=F,P[F].version=C.version,P[F].extent=C.extent;return gi({layers:P})},Xr.GeoJSONWrapper=gr;var qn=function(I){return I[0]},jn=function(I){return I[1]},mn=function(I,C,P,F,j){C===void 0&&(C=qn),P===void 0&&(P=jn),F===void 0&&(F=64),j===void 0&&(j=Float64Array),this.nodeSize=F,this.points=I;for(var Q=I.length<65536?Uint16Array:Uint32Array,te=this.ids=new Q(I.length),B=this.coords=new j(2*I.length),Z=0;Z<I.length;Z++)te[Z]=Z,B[2*Z]=C(I[Z]),B[2*Z+1]=P(I[Z]);(function ne(xe,we,fe,be,Ue,Oe){if(!(Ue-be<=fe)){var de=be+Ue>>1;(function Be(Ee,Pe,ut,Me,vt,Ft){for(;vt>Me;){if(vt-Me>600){var pt=vt-Me+1,At=ut-Me+1,_t=Math.log(pt),Ur=.5*Math.exp(2*_t/3),Pt=.5*Math.sqrt(_t*Ur*(pt-Ur)/pt)*(At-pt/2<0?-1:1);Be(Ee,Pe,ut,Math.max(Me,Math.floor(ut-At*Ur/pt+Pt)),Math.min(vt,Math.floor(ut+(pt-At)*Ur/pt+Pt)),Ft)}var ir=Pe[2*ut+Ft],zt=Me,mt=vt;for(dn(Ee,Pe,Me,ut),Pe[2*vt+Ft]>ir&&dn(Ee,Pe,Me,vt);zt<mt;){for(dn(Ee,Pe,zt,mt),zt++,mt--;Pe[2*zt+Ft]<ir;)zt++;for(;Pe[2*mt+Ft]>ir;)mt--}Pe[2*Me+Ft]===ir?dn(Ee,Pe,Me,mt):dn(Ee,Pe,++mt,vt),mt<=ut&&(Me=mt+1),ut<=mt&&(vt=mt-1)}})(xe,we,de,be,Ue,Oe%2),ne(xe,we,fe,be,de-1,Oe+1),ne(xe,we,fe,de+1,Ue,Oe+1)}})(te,B,F,0,te.length-1,0)};mn.prototype.range=function(I,C,P,F){return function(j,Q,te,B,Z,ne,xe){for(var we,fe,be=[0,j.length-1,0],Ue=[];be.length;){var Oe=be.pop(),de=be.pop(),Be=be.pop();if(de-Be<=xe)for(var Ee=Be;Ee<=de;Ee++)fe=Q[2*Ee+1],(we=Q[2*Ee])>=te&&we<=Z&&fe>=B&&fe<=ne&&Ue.push(j[Ee]);else{var Pe=Math.floor((Be+de)/2);fe=Q[2*Pe+1],(we=Q[2*Pe])>=te&&we<=Z&&fe>=B&&fe<=ne&&Ue.push(j[Pe]);var ut=(Oe+1)%2;(Oe===0?te<=we:B<=fe)&&(be.push(Be),be.push(Pe-1),be.push(ut)),(Oe===0?Z>=we:ne>=fe)&&(be.push(Pe+1),be.push(de),be.push(ut))}}return Ue}(this.ids,this.coords,I,C,P,F,this.nodeSize)},mn.prototype.within=function(I,C,P){return function(F,j,Q,te,B,Z){for(var ne=[0,F.length-1,0],xe=[],we=B*B;ne.length;){var fe=ne.pop(),be=ne.pop(),Ue=ne.pop();if(be-Ue<=Z)for(var Oe=Ue;Oe<=be;Oe++)Zi(j[2*Oe],j[2*Oe+1],Q,te)<=we&&xe.push(F[Oe]);else{var de=Math.floor((Ue+be)/2),Be=j[2*de],Ee=j[2*de+1];Zi(Be,Ee,Q,te)<=we&&xe.push(F[de]);var Pe=(fe+1)%2;(fe===0?Q-B<=Be:te-B<=Ee)&&(ne.push(Ue),ne.push(de-1),ne.push(Pe)),(fe===0?Q+B>=Be:te+B>=Ee)&&(ne.push(de+1),ne.push(be),ne.push(Pe))}}return xe}(this.ids,this.coords,I,C,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=yn(Object.create(Ks),I),this.trees=new Array(this.options.maxZoom+1)};function rn(I,C,P,F,j){return{x:I,y:C,zoom:1/0,id:P,parentId:-1,numPoints:F,properties:j}}function Rt(I,C){var P=I.geometry.coordinates,F=P[1];return{x:Di(P[0]),y:yt(F),zoom:1/0,index:C,parentId:-1}}function Gi(I){return{type:"Feature",id:I.id,properties:Eo(I),geometry:{type:"Point",coordinates:[(F=I.x,360*(F-.5)),(C=I.y,P=(180-360*C)*Math.PI/180,360*Math.atan(Math.exp(P))/Math.PI-90)]}};var C,P,F}function Eo(I){var C=I.numPoints,P=C>=1e4?Math.round(C/1e3)+"k":C>=1e3?Math.round(C/100)/10+"k":C;return yn(yn({},I.properties),{cluster:!0,cluster_id:I.id,point_count:C,point_count_abbreviated:P})}function Di(I){return I/360+.5}function yt(I){var C=Math.sin(I*Math.PI/180),P=.5-.25*Math.log((1+C)/(1-C))/Math.PI;return P<0?0:P>1?1:P}function yn(I,C){for(var P in C)I[P]=C[P];return I}function Kr(I){return I.x}function _i(I){return I.y}function Js(I,C,P,F,j,Q){var te=j-P,B=Q-F;if(te!==0||B!==0){var Z=((I-P)*te+(C-F)*B)/(te*te+B*B);Z>1?(P=j,F=Q):Z>0&&(P+=te*Z,F+=B*Z)}return(te=I-P)*te+(B=C-F)*B}function Li(I,C,P,F){var j={id:I===void 0?null:I,type:C,geometry:P,tags:F,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(Q){var te=Q.geometry,B=Q.type;if(B==="Point"||B==="MultiPoint"||B==="LineString")ta(Q,te);else if(B==="Polygon"||B==="MultiLineString")for(var Z=0;Z<te.length;Z++)ta(Q,te[Z]);else if(B==="MultiPolygon")for(Z=0;Z<te.length;Z++)for(var ne=0;ne<te[Z].length;ne++)ta(Q,te[Z][ne])}(j),j}function ta(I,C){for(var P=0;P<C.length;P+=3)I.minX=Math.min(I.minX,C[P]),I.minY=Math.min(I.minY,C[P+1]),I.maxX=Math.max(I.maxX,C[P]),I.maxY=Math.max(I.maxY,C[P+1])}function xi(I,C,P,F){if(C.geometry){var j=C.geometry.coordinates,Q=C.geometry.type,te=Math.pow(P.tolerance/((1<<P.maxZoom)*P.extent),2),B=[],Z=C.id;if(P.promoteId?Z=C.properties[P.promoteId]:P.generateId&&(Z=F||0),Q==="Point")$n(j,B);else if(Q==="MultiPoint")for(var ne=0;ne<j.length;ne++)$n(j[ne],B);else if(Q==="LineString")Co(j,B,te,!1);else if(Q==="MultiLineString"){if(P.lineMetrics){for(ne=0;ne<j.length;ne++)Co(j[ne],B=[],te,!1),I.push(Li(Z,"LineString",B,C.properties));return}bi(j,B,te,!1)}else if(Q==="Polygon")bi(j,B,te,!0);else{if(Q!=="MultiPolygon"){if(Q==="GeometryCollection"){for(ne=0;ne<C.geometry.geometries.length;ne++)xi(I,{id:Z,geometry:C.geometry.geometries[ne],properties:C.properties},P,F);return}throw new Error("Input data is not a valid GeoJSON object.")}for(ne=0;ne<j.length;ne++){var xe=[];bi(j[ne],xe,te,!0),B.push(xe)}}I.push(Li(Z,Q,B,C.properties))}}function $n(I,C){C.push(wi(I[0])),C.push(Zn(I[1])),C.push(0)}function Co(I,C,P,F){for(var j,Q,te=0,B=0;B<I.length;B++){var Z=wi(I[B][0]),ne=Zn(I[B][1]);C.push(Z),C.push(ne),C.push(0),B>0&&(te+=F?(j*ne-Z*Q)/2:Math.sqrt(Math.pow(Z-j,2)+Math.pow(ne-Q,2))),j=Z,Q=ne}var xe=C.length-3;C[2]=1,function we(fe,be,Ue,Oe){for(var de,Be=Oe,Ee=Ue-be>>1,Pe=Ue-be,ut=fe[be],Me=fe[be+1],vt=fe[Ue],Ft=fe[Ue+1],pt=be+3;pt<Ue;pt+=3){var At=Js(fe[pt],fe[pt+1],ut,Me,vt,Ft);if(At>Be)de=pt,Be=At;else if(At===Be){var _t=Math.abs(pt-Ee);_t<Pe&&(de=pt,Pe=_t)}}Be>Oe&&(de-be>3&&we(fe,be,de,Oe),fe[de+2]=Be,Ue-de>3&&we(fe,de,Ue,Oe))}(C,0,xe,P),C[xe+2]=1,C.size=Math.abs(te),C.start=0,C.end=C.size}function bi(I,C,P,F){for(var j=0;j<I.length;j++){var Q=[];Co(I[j],Q,P,F),C.push(Q)}}function wi(I){return I/360+.5}function Zn(I){var C=Math.sin(I*Math.PI/180),P=.5-.25*Math.log((1+C)/(1-C))/Math.PI;return P<0?0:P>1?1:P}function Ri(I,C,P,F,j,Q,te,B){if(F/=C,Q>=(P/=C)&&te<F)return I;if(te<P||Q>=F)return null;for(var Z=[],ne=0;ne<I.length;ne++){var xe=I[ne],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)Z.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 Be=[];ia(we[de],Be,P,F,j,!0),Be.length&&Oe.push(Be)}if(Oe.length){if(B.lineMetrics&&fe==="LineString"){for(de=0;de<Oe.length;de++)Z.push(Li(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"),Z.push(Li(xe.id,fe,Oe,xe.tags))}}}return Z.length?Z:null}function $a(I,C,P,F,j){for(var Q=0;Q<I.length;Q+=3){var te=I[Q+j];te>=P&&te<=F&&(C.push(I[Q]),C.push(I[Q+1]),C.push(I[Q+2]))}}function Za(I,C,P,F,j,Q,te){for(var B,Z,ne=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],Be=I[fe+4],Ee=j===0?be:Ue,Pe=j===0?de:Be,ut=!1;te&&(B=Math.sqrt(Math.pow(be-de,2)+Math.pow(Ue-Be,2))),Ee<P?Pe>P&&(Z=xe(ne,be,Ue,de,Be,P),te&&(ne.start=we+B*Z)):Ee>F?Pe<F&&(Z=xe(ne,be,Ue,de,Be,F),te&&(ne.start=we+B*Z)):Po(ne,be,Ue,Oe),Pe<P&&Ee>=P&&(Z=xe(ne,be,Ue,de,Be,P),ut=!0),Pe>F&&Ee<=F&&(Z=xe(ne,be,Ue,de,Be,F),ut=!0),!Q&&ut&&(te&&(ne.end=we+B*Z),C.push(ne),ne=ra(I)),te&&(we+=B)}var Me=I.length-3;be=I[Me],Ue=I[Me+1],Oe=I[Me+2],(Ee=j===0?be:Ue)>=P&&Ee<=F&&Po(ne,be,Ue,Oe),Me=ne.length-3,Q&&Me>=3&&(ne[Me]!==ne[0]||ne[Me+1]!==ne[1])&&Po(ne,ne[0],ne[1],ne[2]),ne.length&&C.push(ne)}function ra(I){var C=[];return C.size=I.size,C.start=I.start,C.end=I.end,C}function ia(I,C,P,F,j,Q){for(var te=0;te<I.length;te++)Za(I[te],C,P,F,j,Q,!1)}function Po(I,C,P,F){I.push(C),I.push(P),I.push(F)}function Ga(I,C,P,F,j,Q){var te=(Q-C)/(F-C);return I.push(Q),I.push(P+(j-P)*te),I.push(1),te}function ko(I,C,P,F,j,Q){var te=(Q-P)/(j-P);return I.push(C+(F-C)*te),I.push(Q),I.push(1),te}function na(I,C){for(var P=[],F=0;F<I.length;F++){var j,Q=I[F],te=Q.type;if(te==="Point"||te==="MultiPoint"||te==="LineString")j=Gn(Q.geometry,C);else if(te==="MultiLineString"||te==="Polygon"){j=[];for(var B=0;B<Q.geometry.length;B++)j.push(Gn(Q.geometry[B],C))}else if(te==="MultiPolygon")for(j=[],B=0;B<Q.geometry.length;B++){for(var Z=[],ne=0;ne<Q.geometry[B].length;ne++)Z.push(Gn(Q.geometry[B][ne],C));j.push(Z)}P.push(Li(Q.id,te,j,Q.tags))}return P}function Gn(I,C){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]+C,I[F+1],I[F+2]);return P}function oa(I,C){if(I.transformed)return I;var P,F,j,Q=1<<I.z,te=I.x,B=I.y;for(P=0;P<I.features.length;P++){var Z=I.features[P],ne=Z.geometry,xe=Z.type;if(Z.geometry=[],xe===1)for(F=0;F<ne.length;F+=2)Z.geometry.push(aa(ne[F],ne[F+1],C,Q,te,B));else for(F=0;F<ne.length;F++){var we=[];for(j=0;j<ne[F].length;j+=2)we.push(aa(ne[F][j],ne[F][j+1],C,Q,te,B));Z.geometry.push(we)}}return I.transformed=!0,I}function aa(I,C,P,F,j,Q){return[Math.round(P*(I*F-j)),Math.round(P*(C*F-Q))]}function Wa(I,C,P,F,j){for(var Q=C===j.maxZoom?0:j.tolerance/((1<<C)*j.extent),te={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:P,y:F,z:C,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},B=0;B<I.length;B++){te.numFeatures++,Ha(te,I[B],Q,j);var Z=I[B].minX,ne=I[B].minY,xe=I[B].maxX,we=I[B].maxY;Z<te.minX&&(te.minX=Z),ne<te.minY&&(te.minY=ne),xe>te.maxX&&(te.maxX=xe),we>te.maxY&&(te.maxY=we)}return te}function Ha(I,C,P,F){var j=C.geometry,Q=C.type,te=[];if(Q==="Point"||Q==="MultiPoint")for(var B=0;B<j.length;B+=3)te.push(j[B]),te.push(j[B+1]),I.numPoints++,I.numSimplified++;else if(Q==="LineString")Wn(te,j,I,P,!1,!1);else if(Q==="MultiLineString"||Q==="Polygon")for(B=0;B<j.length;B++)Wn(te,j[B],I,P,Q==="Polygon",B===0);else if(Q==="MultiPolygon")for(var Z=0;Z<j.length;Z++){var ne=j[Z];for(B=0;B<ne.length;B++)Wn(te,ne[B],I,P,!0,B===0)}if(te.length){var xe=C.tags||null;if(Q==="LineString"&&F.lineMetrics){for(var we in xe={},C.tags)xe[we]=C.tags[we];xe.mapbox_clip_start=j.start/j.size,xe.mapbox_clip_end=j.end/j.size}var fe={geometry:te,type:Q==="Polygon"||Q==="MultiPolygon"?3:Q==="LineString"||Q==="MultiLineString"?2:1,tags:xe};C.id!==null&&(fe.id=C.id),I.features.push(fe)}}function Wn(I,C,P,F,j,Q){var te=F*F;if(F>0&&C.size<(j?te:F))P.numPoints+=C.length/3;else{for(var B=[],Z=0;Z<C.length;Z+=3)(F===0||C[Z+2]>te)&&(P.numSimplified++,B.push(C[Z]),B.push(C[Z+1])),P.numPoints++;j&&function(ne,xe){for(var we=0,fe=0,be=ne.length,Ue=be-2;fe<be;Ue=fe,fe+=2)we+=(ne[fe]-ne[Ue])*(ne[fe+1]+ne[Ue+1]);if(we>0===xe)for(fe=0,be=ne.length;fe<be/2;fe+=2){var Oe=ne[fe],de=ne[fe+1];ne[fe]=ne[be-2-fe],ne[fe+1]=ne[be-1-fe],ne[be-2-fe]=Oe,ne[be-1-fe]=de}}(B,Q),I.push(B)}}function nn(I,C){var P=(C=this.options=function(j,Q){for(var te in Q)j[te]=Q[te];return j}(Object.create(this.options),C)).debug;if(P&&console.time("preprocess data"),C.maxZoom<0||C.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(C.promoteId&&C.generateId)throw new Error("promoteId and generateId cannot be used together.");var F=function(j,Q){var te=[];if(j.type==="FeatureCollection")for(var B=0;B<j.features.length;B++)xi(te,j.features[B],Q,B);else xi(te,j.type==="Feature"?j:{geometry:j},Q);return te}(I,C);this.tiles={},this.tileCoords=[],P&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",C.indexMaxZoom,C.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(F=function(j,Q){var te=Q.buffer/Q.extent,B=j,Z=Ri(j,1,-1-te,te,0,-1,2,Q),ne=Ri(j,1,1-te,2+te,0,-1,2,Q);return(Z||ne)&&(B=Ri(j,1,-te,1+te,0,-1,2,Q)||[],Z&&(B=na(Z,1).concat(B)),ne&&(B=B.concat(na(ne,-1)))),B}(F,C)).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,C,P){return 32*((1<<I)*P+C)+I}function Mo(I,C){var P=I.tileID.canonical;if(!this._geoJSONIndex)return C(null,null);var F=this._geoJSONIndex.getTile(P.z,P.x,P.y);if(!F)return C(null,null);var j=new Xt(F.features),Q=Xr(j);Q.byteOffset===0&&Q.byteLength===Q.buffer.byteLength||(Q=new Uint8Array(Q)),C(null,{vectorTile:j,rawData:Q.buffer})}Vr.prototype.load=function(I){var C=this.options,P=C.log,F=C.minZoom,j=C.maxZoom,Q=C.nodeSize;P&&console.time("total time");var te="prepare "+I.length+" points";P&&console.time(te),this.points=I;for(var B=[],Z=0;Z<I.length;Z++)I[Z].geometry&&B.push(Rt(I[Z],Z));this.trees[j+1]=new mn(B,Kr,_i,Q,Float32Array),P&&console.timeEnd(te);for(var ne=j;ne>=F;ne--){var xe=+Date.now();B=this._cluster(B,ne),this.trees[ne]=new mn(B,Kr,_i,Q,Float32Array),P&&console.log("z%d: %d clusters in %dms",ne,B.length,+Date.now()-xe)}return P&&console.timeEnd("total time"),this},Vr.prototype.getClusters=function(I,C){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,Q=Math.max(-90,Math.min(90,I[3]));if(I[2]-I[0]>=360)P=-180,j=180;else if(P>j){var te=this.getClusters([P,F,180,Q],C),B=this.getClusters([-180,F,j,Q],C);return te.concat(B)}for(var Z=this.trees[this._limitZoom(C)],ne=[],xe=0,we=Z.range(Di(P),yt(Q),Di(j),yt(F));xe<we.length;xe+=1){var fe=Z.points[we[xe]];ne.push(fe.numPoints?Gi(fe):this.points[fe.index])}return ne},Vr.prototype.getChildren=function(I){var C=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 Q=j.points[C];if(!Q)throw new Error(F);for(var te=this.options.radius/(this.options.extent*Math.pow(2,P-1)),B=[],Z=0,ne=j.within(Q.x,Q.y,te);Z<ne.length;Z+=1){var xe=j.points[ne[Z]];xe.parentId===I&&B.push(xe.numPoints?Gi(xe):this.points[xe.index])}if(B.length===0)throw new Error(F);return B},Vr.prototype.getLeaves=function(I,C,P){var F=[];return this._appendLeaves(F,I,C=C||10,P=P||0,0),F},Vr.prototype.getTile=function(I,C,P){var F=this.trees[this._limitZoom(I)],j=Math.pow(2,I),Q=this.options,te=Q.radius/Q.extent,B=(P-te)/j,Z=(P+1+te)/j,ne={features:[]};return this._addTileFeatures(F.range((C-te)/j,B,(C+1+te)/j,Z),F.points,C,P,j,ne),C===0&&this._addTileFeatures(F.range(1-te/j,B,1,Z),F.points,j,P,j,ne),C===j-1&&this._addTileFeatures(F.range(0,B,te/j,Z),F.points,-1,P,j,ne),ne.features.length?ne:null},Vr.prototype.getClusterExpansionZoom=function(I){for(var C=this._getOriginZoom(I)-1;C<=this.options.maxZoom;){var P=this.getChildren(I);if(C++,P.length!==1)break;I=P[0].properties.cluster_id}return C},Vr.prototype._appendLeaves=function(I,C,P,F,j){for(var Q=0,te=this.getChildren(C);Q<te.length;Q+=1){var B=te[Q],Z=B.properties;if(Z&&Z.cluster?j+Z.point_count<=F?j+=Z.point_count:j=this._appendLeaves(I,Z.cluster_id,P,F,j):j<F?j++:I.push(B),I.length===P)break}return j},Vr.prototype._addTileFeatures=function(I,C,P,F,j,Q){for(var te=0,B=I;te<B.length;te+=1){var Z=C[B[te]],ne=Z.numPoints,xe={type:1,geometry:[[Math.round(this.options.extent*(Z.x*j-P)),Math.round(this.options.extent*(Z.y*j-F))]],tags:ne?Eo(Z):this.points[Z.index].properties},we=void 0;ne?we=Z.id:this.options.generateId?we=Z.index:this.points[Z.index].id&&(we=this.points[Z.index].id),we!==void 0&&(xe.id=we),Q.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,C){for(var P=[],F=this.options,j=F.reduce,Q=F.minPoints,te=F.radius/(F.extent*Math.pow(2,C)),B=0;B<I.length;B++){var Z=I[B];if(!(Z.zoom<=C)){Z.zoom=C;for(var ne=this.trees[C+1],xe=ne.within(Z.x,Z.y,te),we=Z.numPoints||1,fe=we,be=0,Ue=xe;be<Ue.length;be+=1){var Oe=ne.points[Ue[be]];Oe.zoom>C&&(fe+=Oe.numPoints||1)}if(fe>=Q){for(var de=Z.x*we,Be=Z.y*we,Ee=j&&we>1?this._map(Z,!0):null,Pe=(B<<5)+(C+1)+this.points.length,ut=0,Me=xe;ut<Me.length;ut+=1){var vt=ne.points[Me[ut]];if(!(vt.zoom<=C)){vt.zoom=C;var Ft=vt.numPoints||1;de+=vt.x*Ft,Be+=vt.y*Ft,vt.parentId=Pe,j&&(Ee||(Ee=this._map(Z,!0)),j(Ee,this._map(vt)))}}Z.parentId=Pe,P.push(rn(de/fe,Be/fe,Pe,fe,Ee))}else if(P.push(Z),fe>1)for(var pt=0,At=xe;pt<At.length;pt+=1){var _t=ne.points[At[pt]];_t.zoom<=C||(_t.zoom=C,P.push(_t))}}}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,C){if(I.numPoints)return C?yn({},I.properties):I.properties;var P=this.points[I.index].properties,F=this.options.map(P);return C&&F===P?yn({},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,C,P,F,j,Q,te){for(var B=[I,C,P,F],Z=this.options,ne=Z.debug;B.length;){F=B.pop(),P=B.pop(),C=B.pop(),I=B.pop();var xe=1<<C,we=on(C,P,F),fe=this.tiles[we];if(!fe&&(ne>1&&console.time("creation"),fe=this.tiles[we]=Wa(I,C,P,F,Z),this.tileCoords.push({z:C,x:P,y:F}),ne)){ne>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",C,P,F,fe.numFeatures,fe.numPoints,fe.numSimplified),console.timeEnd("creation"));var be="z"+C;this.stats[be]=(this.stats[be]||0)+1,this.total++}if(fe.source=I,j){if(C===Z.maxZoom||C===j)continue;var Ue=1<<j-C;if(P!==Math.floor(Q/Ue)||F!==Math.floor(te/Ue))continue}else if(C===Z.indexMaxZoom||fe.numPoints<=Z.indexMaxPoints)continue;if(fe.source=null,I.length!==0){ne>1&&console.time("clipping");var Oe,de,Be,Ee,Pe,ut,Me=.5*Z.buffer/Z.extent,vt=.5-Me,Ft=.5+Me,pt=1+Me;Oe=de=Be=Ee=null,Pe=Ri(I,xe,P-Me,P+Ft,0,fe.minX,fe.maxX,Z),ut=Ri(I,xe,P+vt,P+pt,0,fe.minX,fe.maxX,Z),I=null,Pe&&(Oe=Ri(Pe,xe,F-Me,F+Ft,1,fe.minY,fe.maxY,Z),de=Ri(Pe,xe,F+vt,F+pt,1,fe.minY,fe.maxY,Z),Pe=null),ut&&(Be=Ri(ut,xe,F-Me,F+Ft,1,fe.minY,fe.maxY,Z),Ee=Ri(ut,xe,F+vt,F+pt,1,fe.minY,fe.maxY,Z),ut=null),ne>1&&console.timeEnd("clipping"),B.push(Oe||[],C+1,2*P,2*F),B.push(de||[],C+1,2*P,2*F+1),B.push(Be||[],C+1,2*P+1,2*F),B.push(Ee||[],C+1,2*P+1,2*F+1)}}},nn.prototype.getTile=function(I,C,P){var F=this.options,j=F.extent,Q=F.debug;if(I<0||I>24)return null;var te=1<<I,B=on(I,C=(C%te+te)%te,P);if(this.tiles[B])return oa(this.tiles[B],j);Q>1&&console.log("drilling down to z%d-%d-%d",I,C,P);for(var Z,ne=I,xe=C,we=P;!Z&&ne>0;)ne--,xe=Math.floor(xe/2),we=Math.floor(we/2),Z=this.tiles[on(ne,xe,we)];return Z&&Z.source?(Q>1&&console.log("found parent tile z%d-%d-%d",ne,xe,we),Q>1&&console.time("drilling down"),this.splitTile(Z.source,ne,xe,we,I,C,P),Q>1&&console.timeEnd("drilling down"),this.tiles[B]?oa(this.tiles[B],j):null):null};var sa=function(I){function C(P,F,j,Q){I.call(this,P,F,j,Mo),Q&&(this.loadGeoJSON=Q)}return I&&(C.__proto__=I),(C.prototype=Object.create(I&&I.prototype)).constructor=C,C.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())},C.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 Q=!!(j&&j.request&&j.request.collectResourceTiming)&&new l.RequestPerformance(j.request);this.loadGeoJSON(j,function(te,B){if(te||!B)return F(te);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")It(be.coordinates,Ue);else if(de==="MultiPolygon")for(Oe=0;Oe<be.coordinates.length;Oe++)It(be.coordinates[Oe],Ue);return be})(B,!0);try{if(j.filter){var Z=l.createExpression(j.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Z.result==="error")throw new Error(Z.value.map(function(fe){return fe.key+": "+fe.message}).join(", "));var ne=B.features.filter(function(fe){return Z.value.evaluate({zoom:0},fe)});B={type:"FeatureCollection",features:ne}}P._geoJSONIndex=j.cluster?new Vr(function(fe){var be=fe.superclusterOptions,Ue=fe.clusterProperties;if(!Ue||!be)return be;for(var Oe={},de={},Be={accumulated:null,zoom:0},Ee={properties:null},Pe=Object.keys(Ue),ut=0,Me=Pe;ut<Me.length;ut+=1){var vt=Me[ut],Ft=Ue[vt],pt=Ft[0],At=l.createExpression(Ft[1]),_t=l.createExpression(typeof pt=="string"?[pt,["accumulated"],["get",vt]]:pt);Oe[vt]=At.value,de[vt]=_t.value}return be.map=function(Ur){Ee.properties=Ur;for(var Pt={},ir=0,zt=Pe;ir<zt.length;ir+=1){var mt=zt[ir];Pt[mt]=Oe[mt].evaluate(Be,Ee)}return Pt},be.reduce=function(Ur,Pt){Ee.properties=Pt;for(var ir=0,zt=Pe;ir<zt.length;ir+=1){var mt=zt[ir];Be.accumulated=Ur[mt],Ur[mt]=de[mt].evaluate(Be,Ee)}},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(Q){var we=Q.finish();we&&(xe.resourceTiming={},xe.resourceTiming[j.source]=JSON.parse(JSON.stringify(we)))}F(null,xe)})}},C.prototype.coalesce=function(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())},C.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)},C.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."))}}},C.prototype.removeSource=function(P,F){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),F()},C.prototype.getClusterExpansionZoom=function(P,F){try{F(null,this._geoJSONIndex.getClusterExpansionZoom(P.clusterId))}catch(j){F(j)}},C.prototype.getClusterChildren=function(P,F){try{F(null,this._geoJSONIndex.getChildren(P.clusterId))}catch(j){F(j)}},C.prototype.getClusterLeaves=function(P,F){try{F(null,this._geoJSONIndex.getLeaves(P.clusterId,P.limit,P.offset))}catch(j){F(j)}},C}(Re),rr=function(I){var C=this;this.self=I,this.actor=new l.Actor(I,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:Re,geojson:sa},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(P,F){if(C.workerSourceTypes[P])throw new Error('Worker source with name "'+P+'" already registered.');C.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 rr.prototype.setReferrer=function(I,C){this.referrer=C},rr.prototype.setImages=function(I,C,P){for(var F in this.availableImages[I]=C,this.workerSources[I]){var j=this.workerSources[I][F];for(var Q in j)j[Q].availableImages=C}P()},rr.prototype.setLayers=function(I,C,P){this.getLayerIndex(I).replace(C),P()},rr.prototype.updateLayers=function(I,C,P){this.getLayerIndex(I).update(C.layers,C.removedIds),P()},rr.prototype.loadTile=function(I,C,P){this.getWorkerSource(I,C.type,C.source).loadTile(C,P)},rr.prototype.loadDEMTile=function(I,C,P){this.getDEMWorkerSource(I,C.source).loadTile(C,P)},rr.prototype.reloadTile=function(I,C,P){this.getWorkerSource(I,C.type,C.source).reloadTile(C,P)},rr.prototype.abortTile=function(I,C,P){this.getWorkerSource(I,C.type,C.source).abortTile(C,P)},rr.prototype.removeTile=function(I,C,P){this.getWorkerSource(I,C.type,C.source).removeTile(C,P)},rr.prototype.removeDEMTile=function(I,C){this.getDEMWorkerSource(I,C.source).removeTile(C)},rr.prototype.removeSource=function(I,C,P){if(this.workerSources[I]&&this.workerSources[I][C.type]&&this.workerSources[I][C.type][C.source]){var F=this.workerSources[I][C.type][C.source];delete this.workerSources[I][C.type][C.source],F.removeSource!==void 0?F.removeSource(C,P):P()}},rr.prototype.loadWorkerSource=function(I,C,P){try{this.self.importScripts(C.url),P()}catch(F){P(F.toString())}},rr.prototype.syncRTLPluginState=function(I,C,P){try{l.plugin.setState(C);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(Q){P(Q.toString())}},rr.prototype.getAvailableImages=function(I){var C=this.availableImages[I];return C||(C=[]),C},rr.prototype.getLayerIndex=function(I){var C=this.layerIndexes[I];return C||(C=this.layerIndexes[I]=new ve),C},rr.prototype.getWorkerSource=function(I,C,P){var F=this;return this.workerSources[I]||(this.workerSources[I]={}),this.workerSources[I][C]||(this.workerSources[I][C]={}),this.workerSources[I][C][P]||(this.workerSources[I][C][P]=new this.workerSourceTypes[C]({send:function(j,Q,te){F.actor.send(j,Q,te,I)}},this.getLayerIndex(I),this.getAvailableImages(I))),this.workerSources[I][C][P]},rr.prototype.getDEMWorkerSource=function(I,C){return this.demWorkerSources[I]||(this.demWorkerSources[I]={}),this.demWorkerSources[I][C]||(this.demWorkerSources[I][C]=new je),this.demWorkerSources[I][C]},rr.prototype.enforceCacheSizeLimit=function(I,C){l.enforceCacheSizeLimit(C)},typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new rr(self)),rr}),G(["./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 y,g,w=new Blob([""],{type:"text/javascript"}),A=URL.createObjectURL(w);try{g=new Worker(A),y=!0}catch{y=!1}return g&&g.terminate(),URL.revokeObjectURL(A),y}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var y=document.createElement("canvas");y.width=y.height=1;var g=y.getContext("2d");if(!g)return!1;var w=g.getImageData(0,0,1,1);return w&&w.width===y.width}()?(s[f=p&&p.failIfMajorPerformanceCaveat]===void 0&&(s[f]=function(y){var g=function(A){var z=document.createElement("canvas"),D=Object.create(o.webGLContextAttributes);return D.failIfMajorPerformanceCaveat=A,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)}(y);if(!g)return!1;var w=g.createShader(g.VERTEX_SHADER);return!(!w||g.isContextLost())&&(g.shaderSource(w,"void main() {}"),g.compileShader(w),g.getShaderParameter(w,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}}),W={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)}},ve=l.window.document&&l.window.document.documentElement.style;function me(i){if(!ve)return i[0];for(var o=0;o<i.length;o++)if(i[o]in ve)return i[o];return i[0]}var Le,le=me(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);W.disableDrag=function(){ve&&le&&(Le=ve[le],ve[le]="none")},W.enableDrag=function(){ve&&le&&(ve[le]=Le)};var ge=me(["transform","WebkitTransform"]);W.setTransform=function(i,o){i.style[ge]=o};var Re=!1;try{var Ye=Object.defineProperty({},"passive",{get:function(){Re=!0}});l.window.addEventListener("test",Ye,Ye),l.window.removeEventListener("test",Ye,Ye)}catch{Re=!1}W.addEventListener=function(i,o,n,s){s===void 0&&(s={}),i.addEventListener(o,n,"passive"in s&&Re?s:s.capture)},W.removeEventListener=function(i,o,n,s){s===void 0&&(s={}),i.removeEventListener(o,n,"passive"in s&&Re?s:s.capture)};var je=function(i){i.preventDefault(),i.stopPropagation(),l.window.removeEventListener("click",je,!0)};function It(i){var o=i.userImage;return!!(o&&o.render&&o.render())&&(i.data.replace(new Uint8Array(o.data.buffer)),!0)}W.suppressClick=function(){l.window.addEventListener("click",je,!0),l.window.setTimeout(function(){l.window.removeEventListener("click",je,!0)},0)},W.mousePos=function(i,o){var n=i.getBoundingClientRect();return new l.Point(o.clientX-n.left-i.clientLeft,o.clientY-n.top-i.clientTop)},W.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},W.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},W.remove=function(i){i.parentNode&&i.parentNode.removeChild(i)};var tt=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,y=n;f<y.length;f+=1){var g=y[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,y=n;f<y.length;f+=1)this.images[y[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,y=n;f<y.length;f+=1){var g=y[f];this.images[g]||this.fire(new l.Event("styleimagemissing",{id:g}));var w=this.images[g];w?p[g]={data:w.data.clone(),pixelRatio:w.pixelRatio,sdf:w.sdf,version:w.version,stretchX:w.stretchX,stretchY:w.stretchY,content:w.content,hasRenderCallback:!!(w.userImage&&w.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},y=new l.ImagePosition(f,p);this.patterns[n]={bin:f,position:y}}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,y=p.h,g=this.atlasImage;for(var w in g.resize({width:f||1,height:y||1}),this.patterns){var A=this.patterns[w].bin,z=A.x+1,D=A.y+1,L=this.images[w].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 y=this.images[f];It(y)&&this.updateImage(f,y)}}},o}(l.Evented),dt=Kt,Dt=Kt,Xt=1e20;function Kt(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 y=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=y,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(y*y),this.gridInner=new Float64Array(y*y),this.f=new Float64Array(y),this.d=new Float64Array(y),this.z=new Float64Array(y+1),this.v=new Int16Array(y),this.middle=Math.round(y/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function ur(i,o,n,s,p,f,y){for(var g=0;g<o;g++){for(var w=0;w<n;w++)s[w]=i[w*o+g];for(Sr(s,p,f,y,n),w=0;w<n;w++)i[w*o+g]=p[w]}for(w=0;w<n;w++){for(g=0;g<o;g++)s[g]=i[w*o+g];for(Sr(s,p,f,y,o),g=0;g<o;g++)i[w*o+g]=Math.sqrt(p[g])}}function Sr(i,o,n,s,p){n[0]=0,s[0]=-1e20,s[1]=1e20;for(var f=1,y=0;f<p;f++){for(var g=(i[f]+f*f-(i[n[y]]+n[y]*n[y]))/(2*f-2*n[y]);g<=s[y];)y--,g=(i[f]+f*f-(i[n[y]]+n[y]*n[y]))/(2*f-2*n[y]);n[++y]=f,s[y]=g,s[y+1]=1e20}for(f=0,y=0;f<p;f++){for(;s[y+1]<f;)y++;o[f]=(f-n[y])*(f-n[y])+i[n[y]]}}Kt.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?Xt:Math.pow(Math.max(0,.5-p),2),this.gridInner[s]=p===1?Xt:p===0?0:Math.pow(Math.max(0,p-.5),2)}for(ur(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),ur(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},dt.default=Dt;var cr=function(i,o){this.requestManager=i,this.localIdeographFontFamily=o,this.entries={}};cr.prototype.setURL=function(i){this.url=i},cr.prototype.getGlyphs=function(i,o){var n=this,s=[];for(var p in i)for(var f=0,y=i[p];f<y.length;f+=1)s.push({stack:p,id:y[f]});l.asyncAll(s,function(g,w){var A=g.stack,z=g.id,D=n.entries[A];D||(D=n.entries[A]={glyphs:{},requests:{},ranges:{}});var L=D.glyphs[z];if(L===void 0){if(L=n._tinySDF(D,A,z))return D.glyphs[z]=L,void w(null,{stack:A,id:z,glyph:L});var $=Math.floor(z/256);if(256*$>65535)w(new Error("glyphs > 65535 not supported"));else if(D.ranges[$])w(null,{stack:A,id:z,glyph:L});else{var q=D.requests[$];q||(q=D.requests[$]=[],cr.loadGlyphRange(A,$,n.url,n.requestManager,function(K,V){if(V){for(var X in V)n._doesCharSupportLocalGlyph(+X)||(D.glyphs[+X]=V[+X]);D.ranges[$]=!0}for(var ee=0,ie=q;ee<ie.length;ee+=1)(0,ie[ee])(K,V);delete D.requests[$]})),q.push(function(K,V){K?w(K):V&&w(null,{stack:A,id:z,glyph:V[z]||null})})}}else w(null,{stack:A,id:z,glyph:L})},function(g,w){if(g)o(g);else if(w){for(var A={},z=0,D=w;z<D.length;z+=1){var L=D[z],$=L.stack,q=L.id,K=L.glyph;(A[$]||(A[$]={}))[q]=K&&{id:K.id,bitmap:K.bitmap.clone(),metrics:K.metrics}}o(null,A)}})},cr.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))},cr.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 cr.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}}}},cr.loadGlyphRange=function(i,o,n,s,p){var f=256*o,y=f+255,g=s.transformRequest(s.normalizeGlyphsURL(n).replace("{fontstack}",i).replace("{range}",f+"-"+y),l.ResourceType.Glyphs);l.getArrayBuffer(g,function(w,A){if(w)p(w);else if(A){for(var z={},D=0,L=l.parseGlyphPBF(A);D<L.length;D+=1){var $=L[D];z[$.id]=$}p(null,z)}})},cr.TinySDF=dt;var Xr=function(){this.specification=l.styleSpec.light.position};Xr.prototype.possiblyEvaluate=function(i,o){return l.sphericalToCartesian(i.expression.evaluate(o))},Xr.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 gr=new l.Properties({anchor:new l.DataConstantProperty(l.styleSpec.light.anchor),position:new Xr,color:new l.DataConstantProperty(l.styleSpec.light.color),intensity:new l.DataConstantProperty(l.styleSpec.light.intensity)}),gi=function(i){function o(n){i.call(this),this._transitionable=new l.Transitionable(gr),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,y=!0;s.push({left:p,right:f,isDash:y,zeroLength:i[0]===0});for(var g=i[0],w=1;w<i.length;w++){var A=i[w];s.push({left:p=g*n,right:f=(g+=A)*n,isDash:y=!y,zeroLength:A===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),y=0,g=i[y],w=0;w<this.width;w++){w/g.right>1&&(g=i[++y]);var A=Math.abs(w-g.left),z=Math.abs(w-g.right),D=Math.min(A,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+w]=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 y=this.width*this.nextRow,g=0,w=i[g],A=0;A<this.width;A++){A/w.right>1&&(w=i[++g]);var z=Math.abs(A-w.left),D=Math.abs(A-w.right),L=Math.min(z,D);this.data[y+A]=Math.max(0,Math.min(255,(w.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 y=this.width/p,g=this.getDashRanges(i,this.width,y);o?this.addRoundDash(g,y,n):this.addRegularDash(g)}var w={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:p};return this.nextRow+=s,this.dirty=!0,w},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 y=l.pick(l.extend(f,i),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);f.vector_layers&&(y.vectorLayers=f.vector_layers,y.vectorLayerIds=y.vectorLayers.map(function(g){return g.id})),y.tiles=o.canonicalizeTileset(y,i.url),n(null,y)}};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 y(g,w){return delete n.request,n.aborted?s(null):g&&g.status!==404?s(g):(w&&w.resourceTiming&&(n.resourceTiming=w.resourceTiming),this.map._refreshExpiredTiles&&w&&n.setExpiryData(w),n.loadVectorData(w,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,y.bind(this)):(n.actor=this.dispatcher.getActor(),n.request=n.actor.send("loadTile",f,y.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),Ao=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(y,g){if(delete n.request,n.aborted)n.state="unloaded",s(null);else if(y)n.state="errored",s(y);else if(g){p.map._refreshExpiredTiles&&n.setExpiryData(g),delete g.cacheControl,delete g.expires;var w=p.map.painter.context,A=w.gl;n.texture=p.map.painter.getTileTexture(g.width),n.texture?n.texture.update(g,{useMipmap:!0}):(n.texture=new l.Texture(w,g,A.RGBA,{useMipmap:!0}),n.texture.bind(A.LINEAR,A.CLAMP_TO_EDGE,A.LINEAR_MIPMAP_NEAREST),w.extTextureFilterAnisotropic&&A.texParameterf(A.TEXTURE_2D,w.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,w.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(y,g){y&&(n.state="errored",s(y)),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(y,g){if(delete n.request,n.aborted)n.state="unloaded",s(null);else if(y)n.state="errored",s(y);else if(g){this.map._refreshExpiredTiles&&n.setExpiryData(g),delete g.cacheControl,delete g.expires;var w=l.window.ImageBitmap&&g instanceof l.window.ImageBitmap&&l.offscreenCanvasSupported()?g:l.browser.getImageData(g,1),A={uid:n.uid,coord:n.tileID,source:this.id,rawImageData:w,encoding:this.encoding};n.actor&&n.state!=="expired"||(n.actor=this.dispatcher.getActor(),n.actor.send("loadDEMTile",A,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,y=s.x===0?n.wrap-1:n.wrap,g=(s.x+1+p)%p,w=s.x+1===p?n.wrap+1:n.wrap,A={};return A[new l.OverscaledTileID(n.overscaledZ,y,s.z,f,s.y).key]={backfilled:!1},A[new l.OverscaledTileID(n.overscaledZ,w,s.z,g,s.y).key]={backfilled:!1},s.y>0&&(A[new l.OverscaledTileID(n.overscaledZ,y,s.z,f,s.y-1).key]={backfilled:!1},A[new l.OverscaledTileID(n.overscaledZ,n.wrap,s.z,s.x,s.y-1).key]={backfilled:!1},A[new l.OverscaledTileID(n.overscaledZ,w,s.z,g,s.y-1).key]={backfilled:!1}),s.y+1<p&&(A[new l.OverscaledTileID(n.overscaledZ,y,s.z,f,s.y+1).key]={backfilled:!1},A[new l.OverscaledTileID(n.overscaledZ,n.wrap,s.z,s.x,s.y+1).key]={backfilled:!1},A[new l.OverscaledTileID(n.overscaledZ,w,s.z,g,s.y+1).key]={backfilled:!1}),A},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}(Ao),dn=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 y=l.EXTENT/this.tileSize;this.workerOptions=l.extend({source:this.id,cluster:s.cluster||!1,geojsonVtOptions:{buffer:(s.buffer!==void 0?s.buffer:128)*y,tolerance:(s.tolerance!==void 0?s.tolerance:.375)*y,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)*y,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(y,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(y))})},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(y,g){return delete n.request,n.unloadVectorData(),n.aborted?s(null):y?s(y):(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),Bi=l.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),Zi=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,y){p._loaded=!0,f?p.fire(new l.ErrorEvent(f)):y&&(p.image=y,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(y){for(var g=1/0,w=1/0,A=-1/0,z=-1/0,D=0,L=y;D<L.length;D+=1){var $=L[D];g=Math.min(g,$.x),w=Math.min(w,$.y),A=Math.max(A,$.x),z=Math.max(z,$.y)}var q=Math.max(A-g,z-w),K=Math.max(0,Math.floor(-Math.log(q)/Math.LN2)),V=Math.pow(2,K);return new l.CanonicalTileID(K,Math.floor((g+A)/2*V),Math.floor((w+z)/2*V))}(p),this.minzoom=this.maxzoom=this.tileID.z;var f=p.map(function(y){return s.tileID.getTilePoint(y)._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,Bi.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),qn=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(y,g){n._loaded=!0,y?n.fire(new l.ErrorEvent(y)):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,Bi.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}(Zi),jn=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(y){return!Array.isArray(y)||y.length!==2||y.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,Bi.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 y=this.tiles[f];y.state!=="loaded"&&(y.state="loaded",y.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}(Zi),mn={vector:Io,raster:Ao,"raster-dem":ja,geojson:dn,video:qn,image:Zi,canvas:jn};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 y=function(K,V,X){if(K)for(var ee=0,ie=K;ee<ie.length;ee+=1){var pe=V[ie[ee]];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(),w=i.tilesIn(s,g,y);w.sort(rn);for(var A=[],z=0,D=w;z<D.length;z+=1){var L=D[z];A.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(K){for(var V={},X={},ee=0,ie=K;ee<ie.length;ee+=1){var pe=ie[ee],ue=pe.queryResults,he=pe.wrappedTileID,_e=X[he]=X[he]||{};for(var Ie in ue)for(var Te=ue[Ie],De=_e[Ie]=_e[Ie]||{},Ge=V[Ie]=V[Ie]||[],Ke=0,Xe=Te;Ke<Xe.length;Ke+=1){var bt=Xe[Ke];De[bt.featureIndex]||(De[bt.featureIndex]=!0,Ge.push(bt))}}return V}(A);for(var q in $)$[q].forEach(function(K){var V=K.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 y=this._getAndRemoveByKey(this.order[0]);y&&this.onRemove(y)}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 y=0,g=o;y<g.length;y+=1){var w=g[y];this.remove(w.value.tileID,w)}};var Gi=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};Gi.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Gi.prototype.updateData=function(i){var o=this.context.gl;this.context.unbindVAO(),this.bind(),o.bufferSubData(o.ELEMENT_ARRAY_BUFFER,0,i.arrayBuffer)},Gi.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var Eo={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},Di=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};Di.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},Di.prototype.updateData=function(i){var o=this.context.gl;this.bind(),o.bufferSubData(o.ARRAY_BUFFER,0,i.arrayBuffer)},Di.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)}},Di.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[Eo[p.type]],!1,this.itemSize,p.offset+this.itemSize*(n||0))}},Di.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var yt=function(i){this.gl=i.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};yt.prototype.get=function(){return this.current},yt.prototype.set=function(i){},yt.prototype.getDefault=function(){return this.default},yt.prototype.setDefault=function(){this.set(this.default)};var yn=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}(yt),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}(yt),_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.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}(yt),Js=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}(yt),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.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}(yt),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}(yt),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{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}(yt),$n=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}(yt),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}(yt),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[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}(yt),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!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}(yt),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(){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}(yt),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!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}(yt),$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}(yt),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}(yt),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}(yt),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}(yt),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}(yt),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}(yt),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}(yt),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}(yt),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(){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}(yt),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}(yt),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}(yt),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}(yt),Ha=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}(yt),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(){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}(yt),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}(yt),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}(yt),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}(yt),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}(yt),rr=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}(yt),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}(rr),C=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}(rr),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 C(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 Q=function(i,o,n){this.blendFunction=i,this.blendColor=o,this.mask=n};Q.disabled=new Q(Q.Replace=[1,0],l.Color.transparent,[!1,!1,!1,!1]),Q.unblended=new Q(Q.Replace,l.Color.transparent,[!0,!0,!0,!0]),Q.alphaBlended=new Q([1,771],l.Color.transparent,[!0,!0,!0,!0]);var te=function(i,o,n){this.enable=i,this.mode=o,this.frontFace=n};te.disabled=new te(!1,1029,2305),te.backCCW=new te(!0,1029,2305);var B=function(i){this.gl=i,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new yn(this),this.clearDepth=new Kr(this),this.clearStencil=new _i(this),this.colorMask=new Js(this),this.depthMask=new Li(this),this.stencilMask=new ta(this),this.stencilFunc=new xi(this),this.stencilOp=new $n(this),this.stencilTest=new Co(this),this.depthRange=new bi(this),this.depthTest=new wi(this),this.depthFunc=new Zn(this),this.blend=new Ri(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 Gn(this),this.bindFramebuffer=new oa(this),this.bindRenderbuffer=new aa(this),this.bindTexture=new Wa(this),this.bindVertexBuffer=new Ha(this),this.bindElementBuffer=new Wn(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 Gi(this,i,o)},B.prototype.createVertexBuffer=function(i,o,n){return new Di(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,Q.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 Z=function(i){function o(n,s,p){var f=this;i.call(this),this.id=n,this.dispatcher=p,this.on("data",function(y){y.dataType==="source"&&y.sourceDataType==="metadata"&&(f._sourceLoaded=!0),f._sourceLoaded&&!f._paused&&y.dataType==="source"&&y.sourceDataType==="content"&&(f.reload(),f.transform&&f.update(f.transform))}),this.on("error",function(){f._sourceErrored=!0}),this._source=function(y,g,w,A){var z=new mn[g.type](y,g,w,A);if(z.id!==y)throw new Error("Expected Source id to be "+y+" 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(ne).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(y,g){var w=y.tileID,A=g.tileID,z=new l.Point(w.canonical.x,w.canonical.y)._rotate(s.transform.angle),D=new l.Point(A.canonical.x,A.canonical.y)._rotate(s.transform.angle);return w.overscaledZ-A.overscaledZ||D.y-z.y||D.x-z.x}).map(function(y){return y.tileID.key}):p.map(function(y){return y.tileID}).sort(ne).map(function(y){return y.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 y=this.getTileByID(f);g(n,y),g(y,n)}}function g(w,A){w.needsHillshadePrepare=!0;var z=A.tileID.canonical.x-w.tileID.canonical.x,D=A.tileID.canonical.y-w.tileID.canonical.y,L=Math.pow(2,w.tileID.canonical.z),$=A.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)),A.dem&&w.dem&&(w.dem.backfillBorder(A.dem,z,D),w.neighboringTiles&&w.neighboringTiles[$]&&(w.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 y in this._tiles){var g=this._tiles[y];if(!(f[y]||!g.hasData()||g.tileID.overscaledZ<=s||g.tileID.overscaledZ>p)){for(var w=g.tileID;g&&g.tileID.overscaledZ>s+1;){var A=g.tileID.scaledTo(g.tileID.overscaledZ-1);(g=this._tiles[A.key])&&g.hasData()&&(w=A)}for(var z=w;z.overscaledZ>s;)if(n[(z=z.scaledTo(z.overscaledZ-1)).key]){f[w.key]=w;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 y=n.scaledTo(f),g=this._getLoadedTile(y);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),y=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,f):f;this._cache.setMaxSize(y)},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 y=this._tiles[f];y.tileID=y.tileID.unwrapTo(y.tileID.wrap+s),p[y.tileID.key]=y}for(var g in this._tiles=p,this._timers)clearTimeout(this._timers[g]),delete this._timers[g];for(var w in this._tiles)this._setTileReloadTimer(w,this._tiles[w])}},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),y=Math.max(f-o.maxOverzooming,this._source.minzoom),g=Math.max(f+o.maxUnderzooming,this._source.minzoom),w=this._updateRetainedTiles(p,f);if(xe(this._source.type)){for(var A={},z={},D=0,L=Object.keys(w);D<L.length;D+=1){var $=L[D],q=w[$],K=this._tiles[$];if(K&&!(K.fadeEndTime&&K.fadeEndTime<=l.browser.now())){var V=this.findLoadedParent(q,y);V&&(this._addTile(V.tileID),A[V.tileID.key]=V.tileID),z[$]=q}}for(var X in this._retainLoadedChildren(z,f,g,w),A)w[X]||(this._coveredTiles[X]=!0,w[X]=A[X])}for(var ee in w)this._tiles[ee].clearFadeHold();for(var ie=0,pe=l.keysDifference(this._tiles,w);ie<pe.length;ie+=1){var ue=pe[ie],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={},y=Math.max(s-o.maxOverzooming,this._source.minzoom),g=Math.max(s+o.maxUnderzooming,this._source.minzoom),w={},A=0,z=n;A<z.length;A+=1){var D=z[A],L=this._addTile(D);p[D.key]=D,L.hasData()||s<this._source.maxzoom&&(w[D.key]=D)}this._retainLoadedChildren(w,s,g,p);for(var $=0,q=n;$<q.length;$+=1){var K=q[$],V=this._tiles[K.key];if(!V.hasData()){if(s+1>this._source.maxzoom){var X=K.children(this._source.maxzoom)[0],ee=this.getTile(X);if(ee&&ee.hasData()){p[X.key]=X;continue}}else{var ie=K.children(this._source.maxzoom);if(p[ie[0].key]&&p[ie[1].key]&&p[ie[2].key]&&p[ie[3].key])continue}for(var pe=V.wasRequested(),ue=K.overscaledZ-1;ue>=y;--ue){var he=K.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 y=f.scaledTo(f.overscaledZ-1);if(p=this._getLoadedTile(y))break;f=y}for(var g=0,w=s;g<w.length;g+=1)this._loadedParentTiles[w[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,y=[],g=this.transform;if(!g)return y;for(var w=p?g.getCameraQueryGeometry(n):n,A=n.map(function(ue){return g.pointCoordinate(ue)}),z=w.map(function(ue){return g.pointCoordinate(ue)}),D=this.getIds(),L=1/0,$=1/0,q=-1/0,K=-1/0,V=0,X=z;V<X.length;V+=1){var ee=X[V];L=Math.min(L,ee.x),$=Math.min($,ee.y),q=Math.max(q,ee.x),K=Math.max(K,ee.y)}for(var ie=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,De=[_e.getTilePoint(new l.MercatorCoordinate(L,$)),_e.getTilePoint(new l.MercatorCoordinate(q,K))];if(De[0].x-Te<l.EXTENT&&De[0].y-Te<l.EXTENT&&De[1].x+Te>=0&&De[1].y+Te>=0){var Ge=A.map(function(Xe){return _e.getTilePoint(Xe)}),Ke=z.map(function(Xe){return _e.getTilePoint(Xe)});y.push({tile:he,tileID:_e,queryGeometry:Ge,cameraQueryGeometry:Ke,scale:Ie})}}},pe=0;pe<D.length;pe++)ie(pe);return y},o.prototype.getVisibleCoordinates=function(n){for(var s=this,p=this.getRenderableIds(n).map(function(w){return s._tiles[w].tileID}),f=0,y=p;f<y.length;f+=1){var g=y[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 ne(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)}Z.maxOverzooming=10,Z.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 Be(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 Ee(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]=Be(i[s],o[i[s].ref]));return i}be.workerCount=Math.max(Math.min(Oe,6),1);var Pe={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:Pe.addSource,args:[i,o[i]]})}function Me(i,o,n){o.push({command:Pe.removeSource,args:[i]}),n[i]=!0}function vt(i,o,n,s){Me(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 y;for(y in o=o||{},i=i||{})i.hasOwnProperty(y)&&(l.deepEqual(i[y],o[y])||n.push({command:f,args:[s,y,o[y],p]}));for(y in o)o.hasOwnProperty(y)&&!i.hasOwnProperty(y)&&(l.deepEqual(i[y],o[y])||n.push({command:f,args:[s,y,o[y],p]}))}function At(i){return i.id}function _t(i,o){return i[o.id]=o,i}var Ur=function(i,o){this.reset(i,o)};Ur.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},Ur.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],y=n-f,g=y>0?(s-f)/y: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 ir(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 zt(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 mt(i,o){var n=[i.x,i.y,0,1];Ar(n,n,o);var s=n[3];return{point:new l.Point(n[0]/s,n[1]/s),signedDistanceFromCamera:s}}function Et(i,o){return .5+i/o*.5}function Jr(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,y,g){var w=s?i.textSizeData:i.iconSizeData,A=l.evaluateSizeForZoom(w,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,K=!1,V=0;V<$.length;V++){var X=$.get(V);if(X.hidden||X.writingMode===l.WritingMode.vertical&&!K)Nr(X.numGlyphs,D);else{K=!1;var ee=[X.anchorX,X.anchorY,0,1];if(l.transformMat4(ee,ee,o),Jr(ee,z)){var ie=Et(n.transform.cameraToCenterDistance,ee[3]),pe=l.evaluateSizeForFeature(w,A,X),ue=y?pe/ie:pe*ie,he=new l.Point(X.anchorX,X.anchorY),_e=mt(he,p).point,Ie={},Te=Ys(X,ue,!1,g,o,p,f,i.glyphOffsetArray,L,D,_e,he,Ie,q);K=Te.useVertical,(Te.notEnoughRoom||K||Te.needsFlipping&&Ys(X,ue,!0,g,o,p,f,i.glyphOffsetArray,L,D,_e,he,Ie,q).notEnoughRoom)&&Nr(X.numGlyphs,D)}else Nr(X.numGlyphs,D)}}s?i.text.dynamicLayoutVertexBuffer.updateData(D):i.icon.dynamicLayoutVertexBuffer.updateData(D)}function Ir(i,o,n,s,p,f,y,g,w,A,z){var D=g.glyphStartIndex+g.numGlyphs,L=g.lineStartIndex,$=g.lineStartIndex+g.lineLength,q=o.getoffsetX(g.glyphStartIndex),K=o.getoffsetX(D-1),V=nr(i*q,n,s,p,f,y,g.segment,L,$,w,A,z);if(!V)return null;var X=nr(i*K,n,s,p,f,y,g.segment,L,$,w,A,z);return X?{first:V,last:X}:null}function Yr(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 Ys(i,o,n,s,p,f,y,g,w,A,z,D,L,$){var q,K=o/24,V=i.lineOffsetX*K,X=i.lineOffsetY*K;if(i.numGlyphs>1){var ee=i.glyphStartIndex+i.numGlyphs,ie=i.lineStartIndex,pe=i.lineStartIndex+i.lineLength,ue=Ir(K,g,V,X,n,z,D,i,w,f,L);if(!ue)return{notEnoughRoom:!0};var he=mt(ue.first.point,y).point,_e=mt(ue.last.point,y).point;if(s&&!n){var Ie=Yr(i.writingMode,he,_e,$);if(Ie)return Ie}q=[ue.first];for(var Te=i.glyphStartIndex+1;Te<ee-1;Te++)q.push(nr(K*g.getoffsetX(Te),V,X,n,z,D,i.segment,ie,pe,w,f,L));q.push(ue.last)}else{if(s&&!n){var De=mt(D,p).point,Ge=i.lineStartIndex+i.segment+1,Ke=new l.Point(w.getx(Ge),w.gety(Ge)),Xe=mt(Ke,p),bt=Xe.signedDistanceFromCamera>0?Xe.point:ua(D,Ke,De,1,p),Fe=Yr(i.writingMode,De,bt,$);if(Fe)return Fe}var nt=nr(K*g.getoffsetX(i.glyphStartIndex),V,X,n,z,D,i.segment,i.lineStartIndex,i.lineStartIndex+i.lineLength,w,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(A,rt.point,rt.angle)}return{}}function ua(i,o,n,s,p){var f=mt(i.add(i.sub(o)._unit()),p).point,y=n.sub(f);return n.add(y._mult(s/y.mag()))}function nr(i,o,n,s,p,f,y,g,w,A,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 K=$>0?g+y:g+y+1,V=p,X=p,ee=0,ie=0,pe=Math.abs(L),ue=[];ee+ie<=pe;){if((K+=$)<g||K>=w)return null;if(X=V,ue.push(V),(V=D[K])===void 0){var he=new l.Point(A.getx(K),A.gety(K)),_e=mt(he,z);if(_e.signedDistanceFromCamera>0)V=D[K]=_e.point;else{var Ie=K-$;V=ua(ee===0?f:new l.Point(A.getx(Ie),A.gety(Ie)),he,X,pe-ee+1,z)}}ee+=ie,ie=X.dist(V)}var Te=(pe-ee)/ie,De=V.sub(X),Ge=De.mult(Te)._add(X);Ge._add(De._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 y=[];if(i<=0&&o<=0&&this.width<=n&&this.height<=s){if(p)return!0;for(var g=0;g<this.boxKeys.length;g++)y.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 w=0;w<this.circleKeys.length;w++){var A=this.circles[3*w],z=this.circles[3*w+1],D=this.circles[3*w+2];y.push({key:this.circleKeys[w],x1:A-D,y1:z-D,x2:A+D,y2:z+D})}return f?y.filter(f):y}return this._forEachCell(i,o,n,s,this._queryCell,y,{hitTest:p,seenUids:{box:{},circle:{}}},f),p?y.length>0:y},Pt.prototype._queryCircle=function(i,o,n,s,p){var f=i-n,y=i+n,g=o-n,w=o+n;if(y<0||f>this.width||w<0||g>this.height)return!s&&[];var A=[];return this._forEachCell(f,g,y,w,this._queryCellCircle,A,{hitTest:s,circle:{x:i,y:o,radius:n},seenUids:{box:{},circle:{}}},p),s?A.length>0:A},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,y,g){var w=y.seenUids,A=this.boxCells[p];if(A!==null)for(var z=this.bboxes,D=0,L=A;D<L.length;D+=1){var $=L[D];if(!w.box[$]){w.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(y.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 K=this.circleCells[p];if(K!==null)for(var V=this.circles,X=0,ee=K;X<ee.length;X+=1){var ie=ee[X];if(!w.circle[ie]){w.circle[ie]=!0;var pe=3*ie;if(this._circleAndRectCollide(V[pe],V[pe+1],V[pe+2],i,o,n,s)&&(!g||g(this.circleKeys[ie]))){if(y.hitTest)return f.push(!0),!0;var ue=V[pe],he=V[pe+1],_e=V[pe+2];f.push({key:this.circleKeys[ie],x1:ue-_e,y1:he-_e,x2:ue+_e,y2:he+_e})}}}},Pt.prototype._queryCellCircle=function(i,o,n,s,p,f,y,g){var w=y.circle,A=y.seenUids,z=this.boxCells[p];if(z!==null)for(var D=this.bboxes,L=0,$=z;L<$.length;L+=1){var q=$[L];if(!A.box[q]){A.box[q]=!0;var K=4*q;if(this._circleAndRectCollide(w.x,w.y,w.radius,D[K+0],D[K+1],D[K+2],D[K+3])&&(!g||g(this.boxKeys[q])))return f.push(!0),!0}}var V=this.circleCells[p];if(V!==null)for(var X=this.circles,ee=0,ie=V;ee<ie.length;ee+=1){var pe=ie[ee];if(!A.circle[pe]){A.circle[pe]=!0;var ue=3*pe;if(this._circlesCollide(X[ue],X[ue+1],X[ue+2],w.x,w.y,w.radius)&&(!g||g(this.circleKeys[pe])))return f.push(!0),!0}}},Pt.prototype._forEachCell=function(i,o,n,s,p,f,y,g){for(var w=this._convertToXCellCoord(i),A=this._convertToYCellCoord(o),z=this._convertToXCellCoord(n),D=this._convertToYCellCoord(s),L=w;L<=z;L++)for(var $=A;$<=D;$++)if(p.call(this,i,o,n,s,this.xCellCount*$+L,f,y,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 y=s-i,g=p-o,w=n+f;return w*w>y*y+g*g},Pt.prototype._circleAndRectCollide=function(i,o,n,s,p,f,y){var g=(f-s)/2,w=Math.abs(i-(s+g));if(w>g+n)return!1;var A=(y-p)/2,z=Math.abs(o-(p+A));if(z>A+n)return!1;if(w<=g||z<=A)return!0;var D=w-g,L=z-A;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 Nr(i,o){for(var n=0;n<i;n++){var s=o.length;o.resize(s+4),o.float32.set(ca,3*s)}}function Ar(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 Si=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 $t(i,o,n){return o*(l.EXTENT/(i.tileSize*Math.pow(2,n-i.tileID.overscaledZ)))}Si.prototype.placeCollisionBox=function(i,o,n,s,p){var f=this.projectAndGetPerspectiveRatio(s,i.anchorPointX,i.anchorPointY),y=n*f.perspectiveRatio,g=i.x1*y+f.point.x,w=i.y1*y+f.point.y,A=i.x2*y+f.point.x,z=i.y2*y+f.point.y;return!this.isInsideGrid(g,w,A,z)||!o&&this.grid.hitTest(g,w,A,z,p)?{box:[],offscreen:!1}:{box:[g,w,A,z],offscreen:this.isOffscreen(g,w,A,z)}},Si.prototype.placeCollisionCircles=function(i,o,n,s,p,f,y,g,w,A,z,D,L){var $=[],q=new l.Point(o.anchorX,o.anchorY),K=mt(q,f),V=Et(this.transform.cameraToCenterDistance,K.signedDistanceFromCamera),X=(A?p/V:p*V)/l.ONE_EM,ee=mt(q,y).point,ie=Ir(X,s,o.lineOffsetX*X,o.lineOffsetY*X,!1,ee,q,o,n,y,{}),pe=!1,ue=!1,he=!0;if(ie){for(var _e=.5*D*V+L,Ie=new l.Point(-100,-100),Te=new l.Point(this.screenRightBoundary,this.screenBottomBoundary),De=new Ur,Ge=ie.first,Ke=ie.last,Xe=[],bt=Ge.path.length-1;bt>=1;bt--)Xe.push(Ge.path[bt]);for(var Fe=1;Fe<Ke.path.length;Fe++)Xe.push(Ke.path[Fe]);var nt=2.5*_e;if(g){var st=Xe.map(function(Pi){return mt(Pi,g)});Xe=st.some(function(Pi){return Pi.signedDistanceFromCamera<=0})?[]:st.map(function(Pi){return Pi.point})}var it=[];if(Xe.length>0){for(var rt=Xe[0].clone(),at=Xe[0].clone(),et=1;et<Xe.length;et++)rt.x=Math.min(rt.x,Xe[et].x),rt.y=Math.min(rt.y,Xe[et].y),at.x=Math.max(at.x,Xe[et].x),at.y=Math.max(at.y,Xe[et].y);it=rt.x>=Ie.x&&at.x<=Te.x&&rt.y>=Ie.y&&at.y<=Te.y?[Xe]:at.x<Ie.x||rt.x>Te.x||at.y<Ie.y||rt.y>Te.y?[]:l.clipLine([Xe],Ie.x,Ie.y,Te.x,Te.y)}for(var Je=0,_r=it;Je<_r.length;Je+=1){var Qt;De.reset(_r[Je],.25*_e),Qt=De.length<=.5*_e?1:Math.ceil(De.paddedLength/nt)+1;for(var Rr=0;Rr<Qt;Rr++){var Cr=Rr/Math.max(Qt-1,1),Jt=De.lerp(Cr),or=Jt.x+100,ci=Jt.y+100;$.push(or,ci,_e,0);var Zr=or-_e,Mn=ci-_e,Qr=or+_e,ji=ci+_e;if(he=he&&this.isOffscreen(Zr,Mn,Qr,ji),ue=ue||this.isInsideGrid(Zr,Mn,Qr,ji),!i&&this.grid.hitTestCircle(or,ci,_e,z)&&(pe=!0,!w))return{circles:[],offscreen:!1,collisionDetected:pe}}}}return{circles:!w&&pe||!ue?[]:$,offscreen:he,collisionDetected:pe}},Si.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,y=0,g=i;y<g.length;y+=1){var w=g[y],A=new l.Point(w.x+100,w.y+100);n=Math.min(n,A.x),s=Math.min(s,A.y),p=Math.max(p,A.x),f=Math.max(f,A.y),o.push(A)}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],K=q.key;if(z[K.bucketInstanceId]===void 0&&(z[K.bucketInstanceId]={}),!z[K.bucketInstanceId][K.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[K.bucketInstanceId][K.featureIndex]=!0,D[K.bucketInstanceId]===void 0&&(D[K.bucketInstanceId]=[]),D[K.bucketInstanceId].push(K.featureIndex))}}return D},Si.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])},Si.prototype.insertCollisionCircles=function(i,o,n,s,p){for(var f=o?this.ignoredGrid:this.grid,y={bucketInstanceId:n,featureIndex:s,collisionGroupID:p},g=0;g<i.length;g+=4)f.insertCircle(y,i[g],i[g+1],i[g+2])},Si.prototype.projectAndGetPerspectiveRatio=function(i,o,n){var s=[o,n,0,1];return Ar(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}},Si.prototype.isOffscreen=function(i,o,n,s){return n<100||i>=this.screenRightBoundary||s<100||o>this.screenBottomBoundary},Si.prototype.isInsideGrid=function(i,o,n,s){return n>=0&&i<this.gridRightBoundary&&s>=0&&o<this.gridBottomBoundary},Si.prototype.getViewportMatrix=function(){var i=l.identity([]);return l.translate(i,i,[-100,-100,0]),i};var Fi=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};Fi.prototype.isHidden=function(){return this.opacity===0&&!this.placed};var hi=function(i,o,n,s,p){this.text=new Fi(i?i.text:null,o,n,p),this.icon=new Fi(i?i.icon:null,o,s,p)};hi.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var iu=function(i,o,n){this.text=i,this.icon=o,this.skipFade=n},Ti=function(){this.invProjMatrix=l.create(),this.viewportMatrix=l.create(),this.circles=[]},jc=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),y=-(f.horizontalAlign-.5)*o,g=-(f.verticalAlign-.5)*n,w=l.evaluateVariableOffset(i,s);return new l.Point(y+w[0]*p,g+w[1]*p)}function Wi(i,o,n,s,p,f){var y=i.x1,g=i.x2,w=i.y1,A=i.y2,z=i.anchorPointX,D=i.anchorPointY,L=new l.Point(o,n);return s&&L._rotate(p?f:-f),{x1:y+L.x,y1:w+L.y,x2:g+L.x,y2:A+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 Si(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 y=n.collisionBoxArray,g=p.layers[0].layout,w=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),A=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",$=$t(n,1,this.transform.zoom),q=ir(z,D,L,this.transform,$),K=null;if(D){var V=zt(z,D,L,this.transform,$);K=l.multiply([],this.transform.labelPlaneMatrix,V)}this.retainedQueryData[p.bucketInstanceId]=new jc(p.bucketInstanceId,f,p.sourceLayerIndex,p.index,n.tileID);var X={bucket:p,layout:g,posMatrix:z,textLabelPlaneMatrix:q,labelToScreenMatrix:K,scale:w,textPixelRatio:A,holdingForFade:n.holdingForFade(),collisionBoxArray:y,partiallyEvaluatedTextSize:l.evaluateSizeForZoom(p.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(p.sourceID)};if(s)for(var ee=0,ie=p.sortKeyRanges;ee<ie.length;ee+=1){var pe=ie[ee];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,y,g,w,A,z,D,L,$,q){var K,V=[D.textOffset0,D.textOffset1],X=zr(i,n,s,V,p),ee=this.collisionIndex.placeCollisionBox(Wi(o,X.x,X.y,f,y,this.transform.angle),z,g,w,A.predicate);if(!q||this.collisionIndex.placeCollisionBox(Wi(q,X.x,X.y,f,y,this.transform.angle),z,g,w,A.predicate).box.length!==0)return ee.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[D.crossTileID]&&this.prevPlacement.placements[D.crossTileID]&&this.prevPlacement.placements[D.crossTileID].text&&(K=this.prevPlacement.variableOffsets[D.crossTileID].anchor),this.variableOffsets[D.crossTileID]={textOffset:V,width:n,height:s,anchor:i,textBoxScale:p,prevAnchor:K},this.markUsedJustification(L,i,D,$),L.allowVerticalPlacement&&(this.markUsedOrientation(L,$,D),this.placedOrientations[D.crossTileID]=$),{shift:X,placedGlyphBoxes:ee}):void 0},qr.prototype.placeLayerBucketPart=function(i,o,n){var s=this,p=i.parameters,f=p.bucket,y=p.layout,g=p.posMatrix,w=p.textLabelPlaneMatrix,A=p.labelToScreenMatrix,z=p.textPixelRatio,D=p.holdingForFade,L=p.collisionBoxArray,$=p.partiallyEvaluatedTextSize,q=p.collisionGroup,K=y.get("text-optional"),V=y.get("icon-optional"),X=y.get("text-allow-overlap"),ee=y.get("icon-allow-overlap"),ie=y.get("text-rotation-alignment")==="map",pe=y.get("text-pitch-alignment")==="map",ue=y.get("icon-text-fit")!=="none",he=y.get("symbol-z-order")==="viewport-y",_e=X&&(ee||!f.hasIconData()||V),Ie=ee&&(X||!f.hasTextData()||K);!f.collisionArrays&&L&&f.deserializeCollisionBoxes(L);var Te=function(Fe,nt){if(!o[Fe.crossTileID])if(D)s.placements[Fe.crossTileID]=new iu(!1,!1,!1);else{var st,it=!1,rt=!1,at=!0,et=null,Je={box:null,offscreen:null},_r={box:null,offscreen:null},Qt=null,Rr=null,Cr=0,Jt=0,or=0;nt.textFeatureIndex?Cr=nt.textFeatureIndex:Fe.useRuntimeCollisionCircles&&(Cr=Fe.featureIndex),nt.verticalTextFeatureIndex&&(Jt=nt.verticalTextFeatureIndex);var ci=nt.textBox;if(ci){var Zr=function(Ct){var mi=l.WritingMode.horizontal;if(f.allowVerticalPlacement&&!Ct&&s.prevPlacement){var ei=s.prevPlacement.placedOrientations[Fe.crossTileID];ei&&(s.placedOrientations[Fe.crossTileID]=ei,s.markUsedOrientation(f,mi=ei,Fe))}return mi},Mn=function(Ct,mi){if(f.allowVerticalPlacement&&Fe.numVerticalGlyphVertices>0&&nt.verticalTextBox)for(var ei=0,ho=f.writingModes;ei<ho.length&&(ho[ei]===l.WritingMode.vertical?(Je=mi(),_r=Je):Je=Ct(),!(Je&&Je.box&&Je.box.length));ei+=1);else Je=Ct()};if(y.get("text-variable-anchor")){var Qr=y.get("text-variable-anchor");if(s.prevPlacement&&s.prevPlacement.variableOffsets[Fe.crossTileID]){var ji=s.prevPlacement.variableOffsets[Fe.crossTileID];Qr.indexOf(ji.anchor)>0&&(Qr=Qr.filter(function(Ct){return Ct!==ji.anchor})).unshift(ji.anchor)}var Pi=function(Ct,mi,ei){for(var ho=Ct.x2-Ct.x1,ip=Ct.y2-Ct.y1,ms=Fe.textBoxScale,np=ue&&!ee?mi:null,Ma={box:[],offscreen:!1},Du=X?2*Qr.length:Qr.length,Zo=0;Zo<Du;++Zo){var ys=s.attemptAnchorPlacement(Qr[Zo%Qr.length],Ct,ho,ip,ms,ie,pe,z,g,q,Zo>=Qr.length,Fe,f,ei,np);if(ys&&(Ma=ys.placedGlyphBoxes)&&Ma.box&&Ma.box.length){it=!0,et=ys.shift;break}}return Ma};Mn(function(){return Pi(ci,nt.iconBox,l.WritingMode.horizontal)},function(){var Ct=nt.verticalTextBox;return f.allowVerticalPlacement&&!(Je&&Je.box&&Je.box.length)&&Fe.numVerticalGlyphVertices>0&&Ct?Pi(Ct,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[Fe.crossTileID];jo&&(s.variableOffsets[Fe.crossTileID]=jo,s.markUsedJustification(f,jo.anchor,Fe,Ca))}}else{var zn=function(Ct,mi){var ei=s.collisionIndex.placeCollisionBox(Ct,X,z,g,q.predicate);return ei&&ei.box&&ei.box.length&&(s.markUsedOrientation(f,mi,Fe),s.placedOrientations[Fe.crossTileID]=mi),ei};Mn(function(){return zn(ci,l.WritingMode.horizontal)},function(){var Ct=nt.verticalTextBox;return f.allowVerticalPlacement&&Fe.numVerticalGlyphVertices>0&&Ct?zn(Ct,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,Fe.useRuntimeCollisionCircles){var $o=f.text.placedSymbolArray.get(Fe.centerJustifiedTextSymbolIndex),Pa=l.evaluateSizeForFeature(f.textSizeData,$,$o),Ji=y.get("text-padding");Qt=s.collisionIndex.placeCollisionCircles(X,$o,f.lineVertexArray,f.glyphOffsetArray,Pa,g,w,A,n,pe,q.predicate,Fe.collisionCircleDiameter,Ji),it=X||Qt.circles.length>0&&!Qt.collisionDetected,at=at&&Qt.offscreen}if(nt.iconFeatureIndex&&(or=nt.iconFeatureIndex),nt.iconBox){var ka=function(Ct){var mi=ue&&et?Wi(Ct,et.x,et.y,ie,pe,s.transform.angle):Ct;return s.collisionIndex.placeCollisionBox(mi,ee,z,g,q.predicate)};rt=_r&&_r.box&&_r.box.length&&nt.verticalIconBox?(Rr=ka(nt.verticalIconBox)).box.length>0:(Rr=ka(nt.iconBox)).box.length>0,at=at&&Rr.offscreen}var Yi=K||Fe.numHorizontalGlyphVertices===0&&Fe.numVerticalGlyphVertices===0,xr=V||Fe.numIconVertices===0;if(Yi||xr?xr?Yi||(rt=rt&&it):it=rt&&it:rt=it=rt&&it,it&&st&&st.box&&s.collisionIndex.insertCollisionBox(st.box,y.get("text-ignore-placement"),f.bucketInstanceId,_r&&_r.box&&Jt?Jt:Cr,q.ID),rt&&Rr&&s.collisionIndex.insertCollisionBox(Rr.box,y.get("icon-ignore-placement"),f.bucketInstanceId,or,q.ID),Qt&&(it&&s.collisionIndex.insertCollisionCircles(Qt.circles,y.get("text-ignore-placement"),f.bucketInstanceId,Cr,q.ID),n)){var cn=f.bucketInstanceId,Bn=s.collisionCircleArrays[cn];Bn===void 0&&(Bn=s.collisionCircleArrays[cn]=new Ti);for(var po=0;po<Qt.circles.length;po+=4)Bn.circles.push(Qt.circles[po+0]),Bn.circles.push(Qt.circles[po+1]),Bn.circles.push(Qt.circles[po+2]),Bn.circles.push(Qt.collisionDetected?1:0)}s.placements[Fe.crossTileID]=new iu(it||_e,rt||Ie,at||f.justReloaded),o[Fe.crossTileID]=!0}};if(he)for(var De=f.getSortedSymbolIndexes(this.transform.angle),Ge=De.length-1;Ge>=0;--Ge){var Ke=De[Ge];Te(f.symbolInstances.get(Ke),f.collisionArrays[Ke])}else for(var Xe=i.symbolInstanceStart;Xe<i.symbolInstanceEnd;Xe++)Te(f.symbolInstances.get(Xe),f.collisionArrays[Xe]);if(n&&f.bucketInstanceId in this.collisionCircleArrays){var bt=this.collisionCircleArrays[f.bucketInstanceId];l.invert(bt.invProjMatrix,g),bt.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,y=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];f<y.length;f+=1){var g=y[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,y=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];f<y.length;f+=1)i.text.placedSymbolArray.get(y[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:{},y=o?o.placedOrientations:{};for(var g in this.placements){var w=this.placements[g],A=p[g];A?(this.opacities[g]=new hi(A,s,w.text,w.icon),n=n||w.text!==A.text.placed||w.icon!==A.icon.placed):(this.opacities[g]=new hi(null,s,w.text,w.icon,w.skipFade),n=n||w.text||w.icon)}for(var z in p){var D=p[z];if(!this.opacities[z]){var L=new hi(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 y)this.placedOrientations[q]||!this.opacities[q]||this.opacities[q].isHidden()||(this.placedOrientations[q]=y[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],y=f.getBucket(i);y&&f.latestFeatureIndex&&i.id===y.layerIds[0]&&this.updateBucketOpacities(y,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 hi(null,0,!1,!1,!0),y=p.get("text-allow-overlap"),g=p.get("icon-allow-overlap"),w=p.get("text-variable-anchor"),A=p.get("text-rotation-alignment")==="map",z=p.get("text-pitch-alignment")==="map",D=p.get("icon-text-fit")!=="none",L=new hi(null,0,y&&(g||!i.hasIconData()||p.get("icon-optional")),g&&(y||!i.hasTextData()||p.get("text-optional")),!0);!i.collisionArrays&&n&&(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData())&&i.deserializeCollisionBoxes(n);for(var $=function(X,ee,ie){for(var pe=0;pe<ee/4;pe++)X.opacityVertexArray.emplaceBack(ie)},q=function(X){var ee=i.symbolInstances.get(X),ie=ee.numHorizontalGlyphVertices,pe=ee.numVerticalGlyphVertices,ue=ee.crossTileID,he=s.opacities[ue];o[ue]?he=f:he||(s.opacities[ue]=he=L),o[ue]=!0;var _e=ee.numIconVertices>0,Ie=s.placedOrientations[ee.crossTileID],Te=Ie===l.WritingMode.vertical,De=Ie===l.WritingMode.horizontal||Ie===l.WritingMode.horizontalOnly;if(ie>0||pe>0){var Ge=au(he.text);$(i.text,ie,Te?zo:Ge),$(i.text,pe,De?zo:Ge);var Ke=he.text.isHidden();[ee.rightJustifiedTextSymbolIndex,ee.centerJustifiedTextSymbolIndex,ee.leftJustifiedTextSymbolIndex].forEach(function(Je){Je>=0&&(i.text.placedSymbolArray.get(Je).hidden=Ke||Te?1:0)}),ee.verticalPlacedTextSymbolIndex>=0&&(i.text.placedSymbolArray.get(ee.verticalPlacedTextSymbolIndex).hidden=Ke||De?1:0);var Xe=s.variableOffsets[ee.crossTileID];Xe&&s.markUsedJustification(i,Xe.anchor,ee,Ie);var bt=s.placedOrientations[ee.crossTileID];bt&&(s.markUsedJustification(i,"left",ee,bt),s.markUsedOrientation(i,bt,ee))}if(_e){var Fe=au(he.icon),nt=!(D&&ee.verticalPlacedIconSymbolIndex&&Te);ee.placedIconSymbolIndex>=0&&($(i.icon,ee.numIconVertices,nt?Fe:zo),i.icon.placedSymbolArray.get(ee.placedIconSymbolIndex).hidden=he.icon.isHidden()),ee.verticalPlacedIconSymbolIndex>=0&&($(i.icon,ee.numVerticalIconVertices,nt?zo:Fe),i.icon.placedSymbolArray.get(ee.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(w){var at=s.variableOffsets[ue];at?(it=zr(at.anchor,at.width,at.height,at.textOffset,at.textBoxScale),A&&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||De,it.x,it.y)}var et=!!(!De&&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)}}},K=0;K<i.symbolInstances.length;K++)q(K);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 $c=Math.pow(2,25),Zc=Math.pow(2,24),Qs=Math.pow(2,17),Gc=Math.pow(2,16),nu=Math.pow(2,9),Wc=Math.pow(2,8),ou=Math.pow(2,1);function au(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*$c+o*Zc+n*Qs+o*Gc+n*nu+o*Wc+n*ou+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(y,g){return y.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,y){this.placement=new qr(i,p,f,y),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 w=l.browser.now()-p;return!s._forceFullPlacement&&w>2};this._currentPlacementIndex>=0;){var y=o[i[this._currentPlacementIndex]],g=this.placement.collisionIndex.transform.zoom;if(y.type==="symbol"&&(!y.minzoom||y.minzoom<=g)&&(!y.maxzoom||y.maxzoom>g)){if(this._inProgressLayer||(this._inProgressLayer=new el(y)),this._inProgressLayer.continuePlacement(n[y.source],this.placement,this._showCollisionBoxes,y,f))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},pa.prototype.commit=function(i){return this.placement.commit(i),this.placement};var su=512/l.EXTENT/2,Xa=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)})}};Xa.prototype.getScaledCoordinates=function(i,o){var n=su/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)}},Xa.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 y=this.indexedSymbolInstances[f.key];if(y)for(var g=this.getScaledCoordinates(f,o),w=0,A=y;w<A.length;w+=1){var z=A[w];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 Ii=function(){this.maxCrossTileID=0};Ii.prototype.generate=function(){return++this.maxCrossTileID};var vn=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};vn.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 y=s[f];y.tileID=y.tileID.unwrapTo(y.tileID.wrap+o),p[y.tileID.key]=y}this.indexes[n]=p}this.lng=i},vn.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 y=this.indexes[f];if(Number(f)>i.overscaledZ)for(var g in y){var w=y[g];w.tileID.isChildOf(i)&&w.findMatches(o.symbolInstances,i,p)}else{var A=y[i.scaledTo(Number(f)).key];A&&A.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 Xa(i,o.symbolInstances,o.bucketInstanceId),!0},vn.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]},vn.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 gn=function(){this.layerIndexes={},this.crossTileIDs=new Ii,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};gn.prototype.addLayer=function(i,o,n){var s=this.layerIndexes[i.id];s===void 0&&(s=this.layerIndexes[i.id]=new vn);var p=!1,f={};s.handleWrapJump(n);for(var y=0,g=o;y<g.length;y+=1){var w=g[y],A=w.getBucket(i);A&&i.id===A.layerIds[0]&&(A.bucketInstanceId||(A.bucketInstanceId=++this.maxBucketInstanceId),s.addBucket(w.tileID,A,this.crossTileIDs)&&(p=!0),f[A.bucketInstanceId]=!0)}return s.removeStaleBuckets(f)&&(p=!0),p},gn.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 Xn=function(i,o){return l.emitValidationErrors(i,o&&o.filter(function(n){return n.identifier!=="source.canvas"}))},_n=l.pick(Pe,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),xn=l.pick(Pe,["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 tt,this.imageManager.setEventedParent(this),this.glyphManager=new cr(n._requestManager,s.localIdeographFontFamily),this.lineAtlas=new Lt(256,512),this.crossTileSymbolIndex=new gn,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(y){f.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:y.pluginStatus,pluginURL:y.pluginURL},function(g,w){if(l.triggerPluginCompletionEvent(g),w&&w.every(function(z){return z}))for(var A in f.sourceCaches)f.sourceCaches[A].reload()})}),this.on("data",function(y){if(y.dataType==="source"&&y.sourceDataType==="metadata"){var g=p.sourceCaches[y.sourceId];if(g){var w=g.getSource();if(w&&w.vectorLayerIds)for(var A in p._layers){var z=p._layers[A];z.source===w.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 y=this.map._requestManager.transformRequest(n,l.ResourceType.Style);this._request=l.getJSON(y,function(g,w){p._request=null,g?p.fire(new l.ErrorEvent(g)):w&&p._load(w,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||!Xn(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=Ee(this.stylesheet.layers);this._order=f.map(function(A){return A.id}),this._layers={},this._serializedLayers={};for(var y=0,g=f;y<g.length;y+=1){var w=g[y];(w=l.createStyleLayer(w)).setEventedParent(this,{layer:{id:w.id}}),this._layers[w.id]=w,this._serializedLayers[w.id]=w.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new gi(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,y){var g,w,A,z=l.browser.devicePixelRatio>1?"@2x":"",D=l.getJSON(f.transformRequest(f.normalizeSpriteURL(p,z,".json"),l.ResourceType.SpriteJSON),function(q,K){D=null,A||(A=q,g=K,$())}),L=l.getImage(f.transformRequest(f.normalizeSpriteURL(p,z,".png"),l.ResourceType.SpriteImage),function(q,K){L=null,A||(A=q,w=K,$())});function $(){if(A)y(A);else if(g&&w){var q=l.browser.getImageData(w),K={};for(var V in g){var X=g[V],ee=X.width,ie=X.height,pe=X.x,ue=X.y,he=X.sdf,_e=X.pixelRatio,Ie=X.stretchX,Te=X.stretchY,De=X.content,Ge=new l.RGBAImage({width:ee,height:ie});l.RGBAImage.copy(q,Ge,{x:pe,y:ue},{x:0,y:0},{width:ee,height:ie}),K[V]={data:Ge,pixelRatio:_e,sdf:he,stretchX:Ie,stretchY:Te,content:De}}y(null,K)}}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 y in f)s.imageManager.addImage(y,f[y]);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 y=this._layers[f[p]];y.type!=="custom"&&s.push(y.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 y in(p.length||f.length)&&this._updateWorkerLayers(p,f),this._updatedSources){var g=this._updatedSources[y];g==="reload"?this._reloadSource(y):g==="clear"&&this._clearSource(y)}for(var w in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[w].updateTransitions(n);this.light.updateTransitions(n),this._resetUpdates()}var A={};for(var z in this.sourceCaches){var D=this.sourceCaches[z];A[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 K in A){var V=this.sourceCaches[K];A[K]!==V.used&&V.fire(new l.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:K}))}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(),Xn(this,l.validateStyle(n)))return!1;(n=l.clone$1(n)).layers=Ee(n.layers);var p=function(y,g){if(!y)return[{command:Pe.setStyle,args:[g]}];var w=[];try{if(!l.deepEqual(y.version,g.version))return[{command:Pe.setStyle,args:[g]}];l.deepEqual(y.center,g.center)||w.push({command:Pe.setCenter,args:[g.center]}),l.deepEqual(y.zoom,g.zoom)||w.push({command:Pe.setZoom,args:[g.zoom]}),l.deepEqual(y.bearing,g.bearing)||w.push({command:Pe.setBearing,args:[g.bearing]}),l.deepEqual(y.pitch,g.pitch)||w.push({command:Pe.setPitch,args:[g.pitch]}),l.deepEqual(y.sprite,g.sprite)||w.push({command:Pe.setSprite,args:[g.sprite]}),l.deepEqual(y.glyphs,g.glyphs)||w.push({command:Pe.setGlyphs,args:[g.glyphs]}),l.deepEqual(y.transition,g.transition)||w.push({command:Pe.setTransition,args:[g.transition]}),l.deepEqual(y.light,g.light)||w.push({command:Pe.setLight,args:[g.light]});var A={},z=[];(function(L,$,q,K){var V;for(V in $=$||{},L=L||{})L.hasOwnProperty(V)&&($.hasOwnProperty(V)||Me(V,q,K));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:Pe.setGeoJSONSourceData,args:[V,$[V].data]}):vt(V,$,q,K)):ut(V,$,q))})(y.sources,g.sources,z,A);var D=[];y.layers&&y.layers.forEach(function(L){A[L.source]?w.push({command:Pe.removeLayer,args:[L.id]}):D.push(L)}),w=w.concat(z),function(L,$,q){$=$||[];var K,V,X,ee,ie,pe,ue,he=(L=L||[]).map(At),_e=$.map(At),Ie=L.reduce(_t,{}),Te=$.reduce(_t,{}),De=he.slice(),Ge=Object.create(null);for(K=0,V=0;K<he.length;K++)Te.hasOwnProperty(X=he[K])?V++:(q.push({command:Pe.removeLayer,args:[X]}),De.splice(De.indexOf(X,V),1));for(K=0,V=0;K<_e.length;K++)De[De.length-1-K]!==(X=_e[_e.length-1-K])&&(Ie.hasOwnProperty(X)?(q.push({command:Pe.removeLayer,args:[X]}),De.splice(De.lastIndexOf(X,De.length-V),1)):V++,q.push({command:Pe.addLayer,args:[Te[X],pe=De[De.length-K]]}),De.splice(De.length-K,0,X),Ge[X]=!0);for(K=0;K<_e.length;K++)if(ee=Ie[X=_e[K]],ie=Te[X],!Ge[X]&&!l.deepEqual(ee,ie))if(l.deepEqual(ee.source,ie.source)&&l.deepEqual(ee["source-layer"],ie["source-layer"])&&l.deepEqual(ee.type,ie.type)){for(ue in pt(ee.layout,ie.layout,q,X,null,Pe.setLayoutProperty),pt(ee.paint,ie.paint,q,X,null,Pe.setPaintProperty),l.deepEqual(ee.filter,ie.filter)||q.push({command:Pe.setFilter,args:[X,ie.filter]}),l.deepEqual(ee.minzoom,ie.minzoom)&&l.deepEqual(ee.maxzoom,ie.maxzoom)||q.push({command:Pe.setLayerZoomRange,args:[X,ie.minzoom,ie.maxzoom]}),ee)ee.hasOwnProperty(ue)&&ue!=="layout"&&ue!=="paint"&&ue!=="filter"&&ue!=="metadata"&&ue!=="minzoom"&&ue!=="maxzoom"&&(ue.indexOf("paint.")===0?pt(ee[ue],ie[ue],q,X,ue.slice(6),Pe.setPaintProperty):l.deepEqual(ee[ue],ie[ue])||q.push({command:Pe.setLayerProperty,args:[X,ue,ie[ue]]}));for(ue in ie)ie.hasOwnProperty(ue)&&!ee.hasOwnProperty(ue)&&ue!=="layout"&&ue!=="paint"&&ue!=="filter"&&ue!=="metadata"&&ue!=="minzoom"&&ue!=="maxzoom"&&(ue.indexOf("paint.")===0?pt(ee[ue],ie[ue],q,X,ue.slice(6),Pe.setPaintProperty):l.deepEqual(ee[ue],ie[ue])||q.push({command:Pe.setLayerProperty,args:[X,ue,ie[ue]]}))}else q.push({command:Pe.removeLayer,args:[X]}),pe=De[De.lastIndexOf(X)+1],q.push({command:Pe.addLayer,args:[ie,pe]})}(D,g.layers,w)}catch(L){console.warn("Unable to compute style diff:",L),w=[{command:Pe.setStyle,args:[g]}]}return w}(this.serialize(),n).filter(function(y){return!(y.command in xn)});if(p.length===0)return!1;var f=p.filter(function(y){return!(y.command in _n)});if(f.length>0)throw new Error("Unimplemented: "+f.map(function(y){return y.command}).join(", ")+".");return p.forEach(function(y){y.command!=="setTransition"&&s[y.command].apply(s,y.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 y=this.sourceCaches[n]=new Z(n,s,this.dispatcher);y.style=this,y.setEventedParent(this,function(){return{isSourceLoaded:f.loaded(),source:y.serialize(),sourceId:n}}),y.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 y;if(n.type==="custom"){if(Xn(this,l.validateCustomStyleLayer(n)))return;y=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;y=l.createStyleLayer(n),this._validateLayer(y),y.setEventedParent(this,{layer:{id:f}}),this._serializedLayers[y.id]=y.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]=y,this._removedLayers[f]&&y.source&&y.type!=="custom"){var w=this._removedLayers[f];delete this._removedLayers[f],w.type!==y.type?this._updatedSources[y.source]="clear":(this._updatedSources[y.source]="reload",this.sourceCaches[y.source].pause())}this._updateLayer(y),y.onAdd&&y.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 y=this.getLayer(n);y?l.deepEqual(y.getLayoutProperty(s),p)||(y.setLayoutProperty(s,p,f),this._updateLayer(y)):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 y=this.getLayer(n);y?l.deepEqual(y.getPaintProperty(s),p)||(y.setPaintProperty(s,p,f)&&this._updateLayer(y),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,y=this.sourceCaches[p];if(y!==void 0){var g=y.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."))),y.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 y=f.getSource().type,g=y==="vector"?n.sourceLayer:void 0;y!=="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={},y=[],g=this._order.length-1;g>=0;g--){var w=this._order[g];if(p(w)){f[w]=g;for(var A=0,z=n;A<z.length;A+=1){var D=z[A][w];if(D)for(var L=0,$=D;L<$.length;L+=1)y.push($[L])}}}y.sort(function(Ie,Te){return Te.intersectionZ-Ie.intersectionZ});for(var q=[],K=this._order.length-1;K>=0;K--){var V=this._order[K];if(p(V))for(var X=y.length-1;X>=0;X--){var ee=y[X].feature;if(f[ee.layer.id]<K)break;q.push(ee),y.pop()}else for(var ie=0,pe=n;ie<pe.length;ie+=1){var ue=pe[ie][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 y=0,g=s.layers;y<g.length;y+=1){var w=g[y],A=this._layers[w];if(!A)return this.fire(new l.ErrorEvent(new Error("The layer '"+w+"' does not exist in the map's style and cannot be queried for features."))),[];f[A.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,K,V,X,ee){for(var ie={},pe=X.queryRenderedSymbols(K),ue=[],he=0,_e=Object.keys(pe).map(Number);he<_e.length;he+=1)ue.push(ee[_e[he]]);ue.sort(rn);for(var Ie=function(){var Xe=De[Te],bt=Xe.featureIndex.lookupSymbolFeatures(pe[Xe.bucketInstanceId],$,Xe.bucketIndex,Xe.sourceLayerIndex,V.filter,V.layers,V.availableImages,L);for(var Fe in bt){var nt=ie[Fe]=ie[Fe]||[],st=bt[Fe];st.sort(function(at,et){var Je=Xe.featureSortOrder;if(Je){var _r=Je.indexOf(at.featureIndex);return Je.indexOf(et.featureIndex)-_r}return et.featureIndex-at.featureIndex});for(var it=0,rt=st;it<rt.length;it+=1)nt.push(rt[it])}},Te=0,De=ue;Te<De.length;Te+=1)Ie();var Ge=function(Xe){ie[Xe].forEach(function(bt){var Fe=bt.feature,nt=q[L[Xe].source].getFeatureState(Fe.layer["source-layer"],Fe.id);Fe.source=Fe.layer.source,Fe.layer["source-layer"]&&(Fe.sourceLayer=Fe.layer["source-layer"]),Fe.state=nt})};for(var Ke in ie)Ge(Ke);return ie}(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,y){for(var g=f.getRenderableIds().map(function($){return f.getTileByID($)}),w=[],A={},z=0;z<g.length;z++){var D=g[z],L=D.tileID.canonical.key;A[L]||(A[L]=!0,D.querySourceFeatures(w,y))}return w}(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 y in n)if(!l.deepEqual(n[y],p[y])){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,y){return y===void 0&&(y={}),(!y||y.validate!==!1)&&Xn(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,y){y===void 0&&(y=!1);for(var g=!1,w=!1,A={},z=0,D=this._order;z<D.length;z+=1){var L=this._layers[D[z]];if(L.type==="symbol"){if(!A[L.source]){var $=this.sourceCaches[L.source];A[L.source]=$.getRenderableIds(!0).map(function(ee){return $.getTileByID(ee)}).sort(function(ee,ie){return ie.tileID.overscaledZ-ee.tileID.overscaledZ||(ee.tileID.isLessThan(ie.tileID)?-1:1)})}var q=this.crossTileSymbolIndex.addLayer(L,A[L.source],n.center.lng);g=g||q}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((y=y||this._layerOrderChanged||p===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(l.browser.now(),n.zoom))&&(this.pauseablePlacement=new pa(n,this._order,y,s,p,f,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,A),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(l.browser.now()),w=!0),g&&this.pauseablePlacement.placement.setStale()),w||g)for(var K=0,V=this._order;K<V.length;K+=1){var X=this._layers[V[K]];X.type==="symbol"&&this.placement.updateLayerOpacities(X,A[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 mn[i]},ni.setSourceType=function(i,o){mn[i]=o},ni.registerForPluginStateChange=l.registerForPluginStateChange;var pr=l.createLayout([{name:"a_pos",type:"Int16",components:2}]),Bo=Ot(`#ifdef GL_ES
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("./LoadingSpinner-Cmgcr11N.js"),R=require("vue"),Jo=require("pinia");let Ua=null;typeof window<"u"&&(Ua=document.currentScript);const Hd={options:{div:"map",logo:"os-logo-maps",statement:"Contains OS data © Crown copyright and database rights YYYY",prefix:"",suffix:""},init(m){if(typeof window<"u"){Ua&&(this.options.div=Ua.getAttribute("data-div")||this.options.div,this.options.logo=Ua.getAttribute("data-logo")||this.options.logo,this.options.statement=Ua.getAttribute("data-statement")||this.options.statement,this.options.prefix=Ua.getAttribute("data-prefix")||this.options.prefix,this.options.suffix=Ua.getAttribute("data-suffix")||this.options.suffix),m=typeof m<"u"?m:{},Object.assign(this.options,m);const d=document.getElementById(this.options.div);let b="os-api-branding logo";this.options.logo==="os-logo-maps-white"&&(b="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=b,d.appendChild(O);const G=document.createElement("div");G.className="os-api-branding copyright",G.innerHTML=M,d.appendChild(G)}}},$i=Jo.defineStore("map",()=>{const m=R.ref([]),d=R.ref([]),b=R.ref(null),M=R.ref(null),O=R.ref(null);function G(Re){m.value.push({id:Re.id,filters:Re.filters,places:Re.places,activePins:Re.activePins,hovered:"",activePlace:null})}function l(Re){m.value.forEach(Ye=>{Ye.id===Re.mapId&&(Ye.hovered=Re.hoveredFeature)})}function ae(Re){m.value.forEach(Ye=>{Ye.id===Re.mapId&&(Ye.activePlace=Re.activeFeature)})}function W(Re){d.value=Re}function ve(Re){b.value=Re}function me(Re){M.value=Re}function Le(Re){return m.value.find(Ye=>Ye.id===Re)}function le(Re){return m.value.find(je=>je.id===Re).hovered}function ge(Re){return m.value.find(je=>je.id===Re).activePlace}return{maps:m,activeSubcatFilters:d,selectedSubCategory:b,activeMarkerPos:M,activePlace:O,addMapInstance:G,setHoveredPlace:l,setActivePlace:ae,setActiveSubcatFilters:W,setSelectedSubcat:ve,setActiveMarkerPos:me,getMapById:Le,getHoveredStop:le,getActivePlace:ge}});var av={exports:{}};(function(m,d){(function(b,M){m.exports=M()})(Y.commonjsGlobal,function(){var b,M,O;function G(l,ae){if(!b)b=ae;else if(!M)M=ae;else{var W="var sharedChunk = {}; ("+b+")(sharedChunk); ("+M+")(sharedChunk);",ve={};b(ve),O=ae(ve),typeof window<"u"&&(O.workerUrl=window.URL.createObjectURL(new Blob([W],{type:"text/javascript"})))}}return G(["exports"],function(l){function ae(e,t){return e(t={exports:{}},t.exports),t.exports}var W=ve;function ve(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}ve.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},ve.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},ve.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},ve.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 v=this.sampleCurveDerivativeX(u);if(Math.abs(v)<1e-6)break;u-=c/v}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},ve.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var me=Le;function Le(e,t){this.x=e,this.y=t}Le.prototype={clone:function(){return new Le(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}},Le.convert=function(e){return e instanceof Le?e:Array.isArray(e)?new Le(e[0],e[1]):e};var le=typeof self<"u"?self:{},ge=Math.pow(2,53)-1;function Re(e,t,r,a){var u=new W(e,t,r,a);return function(c){return u.solve(c)}}var Ye=Re(.25,.1,.25,1);function je(e,t,r){return Math.min(r,Math.max(t,e))}function It(e,t,r){var a=r-t,u=((e-t)%a+a)%a+t;return u===t?r:u}function tt(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 dt=1;function Dt(){return dt++}function Xt(){return function e(t){return t?(t^16*Math.random()>>t/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}()}function Kt(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 ur(e,t){e.forEach(function(r){t[r]&&(t[r]=t[r].bind(t))})}function Sr(e,t){return e.indexOf(t,e.length-t.length)!==-1}function cr(e,t,r){var a={};for(var u in e)a[u]=t.call(r||this,e[u],u,e);return a}function Xr(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 gr(e){return Array.isArray(e)?e.map(gr):typeof e=="object"&&e?cr(e,gr):e}var gi={};function Lt(e){gi[e]||(typeof console<"u"&&console.warn(e),gi[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 v=c||h;return t[u]=!v||v.toLowerCase(),""}),t["max-age"]){var r=parseInt(t["max-age"],10);isNaN(r)?delete t["max-age"]:t["max-age"]=r}return t}var Ao=null;function ja(e){if(Ao==null){var t=e.navigator?e.navigator.userAgent:null;Ao=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return Ao}function dn(e){try{var t=le[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch{return!1}}var Bi,Zi,qn,jn,mn=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:mn,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 Bi||(Bi=le.document.createElement("a")),Bi.href=e,Bi.href},hardwareConcurrency:le.navigator&&le.navigator.hardwareConcurrency||4,get devicePixelRatio(){return le.devicePixelRatio},get prefersReducedMotion(){return!!le.matchMedia&&(Zi==null&&(Zi=le.matchMedia("(prefers-reduced-motion: reduce)")),Zi.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},Gi={supported:!1,testSupport:function(e){!Eo&&jn&&(Di?yt(e):qn=e)}},Eo=!1,Di=!1;function yt(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,jn),e.isContextLost())return;Gi.supported=!0}catch{}e.deleteTexture(t),Eo=!0}le.document&&((jn=le.document.createElement("img")).onload=function(){qn&&yt(qn),qn=null,Di=!0},jn.onerror=function(){Eo=!0,qn=null},jn.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var yn="01",Kr=function(e,t){this._transformRequestFn=e,this._customAccessToken=t,this._createSkuToken()};function _i(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",yn,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(!_i(e))return e;var r=xi(e);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},Kr.prototype.normalizeGlyphsURL=function(e,t){if(!_i(e))return e;var r=xi(e);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},Kr.prototype.normalizeSourceURL=function(e,t){if(!_i(e))return e;var r=xi(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=xi(e);return _i(e)?(u.path="/styles/v1"+u.path+"/sprite"+t+r,this._makeAPIURL(u,this._customAccessToken||a)):(u.path+=""+t+r,$n(u))},Kr.prototype.normalizeTileURL=function(e,t){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!_i(e))return e;var r=xi(e);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(rn.devicePixelRatio>=2||t===512?"@2x":"")+(Gi.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 v=h[c].match(/^access_token=(.*)$/);if(v)return v[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=xi(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&&_i(t),a=[],u=0,c=e.tiles||[];u<c.length;u+=1){var h=c[u];Li(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=xi(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 $n(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),$n(e)};var Js=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Li(e){return Js.test(e)}var ta=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function xi(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 $n(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 bi=function(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};bi.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},bi.prototype.fetchEventData=function(){var e=dn("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")}},bi.prototype.saveEventData=function(){var e=dn("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")}},bi.prototype.processRequests=function(e){},bi.prototype.postEvent=function(e,t,r,a){var u=this;if(Rt.EVENTS_URL){var c=xi(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:yn,userId:this.anonId},v=t?tt(h,t):h,_={url:$n(c),headers:{"Content-Type":"text/plain"},body:JSON.stringify([v])};this.pendingRequest=rr(_,function(x){u.pendingRequest=null,r(x),u.saveEventData(),u.processRequests(a)})}},bi.prototype.queueRequest=function(e,t){this.queue.push(e),this.processRequests(t)};var wi,Zn,Ri=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),v=Array.isArray(r)&&r.some(function(_){return _i(_)||Li(_)});Rt.EVENTS_URL&&h&&v&&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(),Kt(this.anonId)||(this.anonId=Xt()),this.postEvent(h,{skuToken:this.skuToken},function(v){v||c&&(a.success[c]=!0)},r))}},t}(bi),$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 _i(u)||Li(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;Kt(this.anonId)||(this.anonId=Xt(),h=!0);var v=this.queue.shift();if(this.eventData.lastSuccess){var _=new Date(this.eventData.lastSuccess),x=new Date(v),S=(v-this.eventData.lastSuccess)/864e5;h=h||S>=1||S<-1||_.getDate()!==x.getDate()}else h=!0;if(!h)return this.processRequests();this.postEvent(v,{"enabled.telemetry":!1},function(T){T||(a.eventData.lastSuccess=v,a.eventData.tokenU=c)},r)}},t}(bi)),Za=$a.postTurnstileEvent.bind($a),ra=new Ri,ia=ra.postMapLoadEvent.bind(ra),Po=500,Ga=50;function ko(){le.caches&&!wi&&(wi=le.caches.open("mapbox-tiles"))}function na(e){var t=e.indexOf("?");return t<0?e:e.slice(0,t)}var Gn,oa=1/0;function aa(){return Gn==null&&(Gn=le.OffscreenCanvas&&new le.OffscreenCanvas(1,1).getContext("2d")&&typeof le.createImageBitmap=="function"),Gn}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 Ha=function(e){function t(r,a,u){a===401&&Li(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),Wn=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(Wn())&&!/^\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,v=new le.Request(a.url,{method:a.method||"GET",body:a.body,credentials:a.credentials,headers:a.headers,referrer:Wn(),signal:h.signal}),_=!1,x=!1,S=(c=v.url).indexOf("sku=")>0&&Li(c);a.type==="json"&&v.headers.set("Accept","application/json");var T=function(k,U,N){if(!x){if(k&&k.message!=="SecurityError"&&Lt(k),U&&N)return E(U);var J=Date.now();le.fetch(v).then(function(H){if(H.ok){var re=S?H.clone():null;return E(H,re,J)}return u(new Ha(H.statusText,H.status,a.url))}).catch(function(H){H.code!==20&&u(new Error(H.message))})}},E=function(k,U,N){(a.type==="arrayBuffer"?k.arrayBuffer():a.type==="json"?k.json():k.text()).then(function(J){x||(U&&N&&function(H,re,oe){if(ko(),wi){var se={status:re.status,statusText:re.statusText,headers:new le.Headers};re.headers.forEach(function(ye,Se){return se.headers.set(Se,ye)});var ce=Io(re.headers.get("Cache-Control")||"");ce["no-store"]||(ce["max-age"]&&se.headers.set("Expires",new Date(oe+1e3*ce["max-age"]).toUTCString()),new Date(se.headers.get("Expires")).getTime()-oe<42e4||function(ye,Se){if(Zn===void 0)try{new Response(new ReadableStream),Zn=!0}catch{Zn=!1}Zn?Se(ye.body):ye.blob().then(Se)}(re,function(ye){var Se=new le.Response(ye,se);ko(),wi&&wi.then(function(Ae){return Ae.put(na(H.url),Se)}).catch(function(Ae){return Lt(Ae.message)})}))}}(v,U,N),_=!0,u(null,J,k.headers.get("Cache-Control"),k.headers.get("Expires")))}).catch(function(J){x||u(new Error(J.message))})};return S?function(k,U){if(ko(),!wi)return U(null);var N=na(k.url);wi.then(function(J){J.match(N).then(function(H){var re=function(oe){if(!oe)return!1;var se=new Date(oe.headers.get("Expires")||0),ce=Io(oe.headers.get("Cache-Control")||"");return se>Date.now()&&!ce["no-cache"]}(H);J.delete(N),re&&J.put(N,H.clone()),U(null,H,re)}).catch(U)}).catch(U)}(v,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 v=c.response;if(a.type==="json")try{v=JSON.parse(c.response)}catch(_){return u(_)}u(null,v,c.getResponseHeader("Cache-Control"),c.getResponseHeader("Expires"))}else u(new Ha(c.statusText,c.status,a.url))},c.send(a.body),{cancel:function(){return c.abort()}}}(e,t)},sa=function(e,t){return Mo(tt(e,{type:"arrayBuffer"}),t)},rr=function(e,t){return Mo(tt(e,{method:"POST"}),t)},I="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";nn=[],on=0;var C=function(e,t){if(Gi.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=C(h.requestParameters,h.callback).cancel)}},c=sa(e,function(h,v,_,x){u(),h?t(h):v&&(aa()?function(S,T){var E=new le.Blob([new Uint8Array(S)],{type:"image/png"});le.createImageBitmap(E).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."))})}(v,t):function(S,T,E,k){var U=new le.Image,N=le.URL;U.onload=function(){T(null,U),N.revokeObjectURL(U.src),U.onload=null,le.requestAnimationFrame(function(){U.src=I})},U.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 J=new le.Blob([new Uint8Array(S)],{type:"image/png"});U.cacheControl=E,U.expires=k,U.src=S.byteLength?N.createObjectURL(J):I}(v,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={}),tt(this,t),this.type=e},Q=function(e){function t(r,a){a===void 0&&(a={}),e.call(this,"error",tt({error:r},a))}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(j),te=function(){};te.prototype.on=function(e,t){return this._listeners=this._listeners||{},P(e,t,this._listeners),this},te.prototype.off=function(e,t){return F(e,t,this._listeners),F(e,t,this._oneTimeListeners),this},te.prototype.once=function(e,t){return this._oneTimeListeners=this._oneTimeListeners||{},P(e,t,this._oneTimeListeners),this},te.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 v=h[c];F(r,v,this._oneTimeListeners),v.call(this,e)}var _=this._eventedParent;_&&(tt(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),_.fire(e))}else e instanceof Q&&console.error(e.error);return this},te.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)},te.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"}}},Z=function(e,t,r,a){this.message=(e?e+": ":"")+r,a&&(this.identifier=a),t!=null&&t.__line__&&(this.line=t.__line__)};function ne(e){var t=e.value;return t?[new Z(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"},Be={kind:"string"},Ee={kind:"boolean"},Pe={kind:"color"},ut={kind:"object"},Me={kind:"value"},vt={kind:"collator"},Ft={kind:"formatted"},pt={kind:"resolvedImage"};function At(e,t){return{kind:"array",itemType:e,N:t}}function _t(e){if(e.kind==="array"){var t=_t(e.itemType);return typeof e.N=="number"?"array<"+t+", "+e.N+">":e.itemType.kind==="value"?"array":"array<"+t+">"}return e.kind}var Ur=[Oe,de,Be,Ee,Pe,Ft,ut,At(Me),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=Ur;r<a.length;r+=1)if(!Pt(a[r],t))return null}}return"Expected "+_t(e)+" but found "+_t(t)+" instead."}function ir(e,t){return t.some(function(r){return r.kind===e.kind})}function zt(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 mt=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(v){return(v=Math.round(v))<0?0:v>255?255:v}function u(v){return a(v[v.length-1]==="%"?parseFloat(v)/100*255:parseInt(v))}function c(v){return(_=v[v.length-1]==="%"?parseFloat(v)/100:parseFloat(v))<0?0:_>1?1:_;var _}function h(v,_,x){return x<0?x+=1:x>1&&(x-=1),6*x<1?v+(_-v)*x*6:2*x<1?_:3*x<2?v+(_-v)*(2/3-x)*6:v}try{t.parseCSSColor=function(v){var _,x=v.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 S=x.indexOf("("),T=x.indexOf(")");if(S!==-1&&T+1===x.length){var E=x.substr(0,S),k=x.substr(S+1,T-(S+1)).split(","),U=1;switch(E){case"rgba":if(k.length!==4)return null;U=c(k.pop());case"rgb":return k.length!==3?null:[u(k[0]),u(k[1]),u(k[2]),U];case"hsla":if(k.length!==4)return null;U=c(k.pop());case"hsl":if(k.length!==3)return null;var N=(parseFloat(k[0])%360+360)%360/360,J=c(k[1]),H=c(k[2]),re=H<=.5?H*(J+1):H+J-H*J,oe=2*H-re;return[a(255*h(oe,re,N+1/3)),a(255*h(oe,re,N)),a(255*h(oe,re,N-1/3)),U];default:return null}}return null}}catch{}}).parseCSSColor,Et=function(e,t,r,a){a===void 0&&(a=1),this.r=e,this.g=t,this.b=r,this.a=a};Et.parse=function(e){if(e){if(e instanceof Et)return e;if(typeof e=="string"){var t=mt(e);if(t)return new Et(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}},Et.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+")"},Et.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]},Et.black=new Et(0,0,0,1),Et.white=new Et(1,1,1,1),Et.transparent=new Et(0,0,0,0),Et.red=new Et(1,0,0,1);var Jr=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"})};Jr.prototype.compare=function(e,t){return this.collator.compare(e,t)},Jr.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 Yr=function(e){this.name=e.name,this.available=e.available};function Ys(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 Et||e instanceof Jr||e instanceof Ir||e instanceof Yr)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 nr(e){if(e===null)return Oe;if(typeof e=="string")return Be;if(typeof e=="boolean")return Ee;if(typeof e=="number")return de;if(e instanceof Et)return Pe;if(e instanceof Jr)return vt;if(e instanceof Ir)return Ft;if(e instanceof Yr)return pt;if(Array.isArray(e)){for(var t,r=e.length,a=0,u=e;a<u.length;a+=1){var c=nr(u[a]);if(t){if(t===c)continue;t=Me;break}t=c}return At(t||Me,r)}return ut}function ca(e){var t=typeof e;return e===null?"":t==="string"||t==="number"||t==="boolean"?String(e):e instanceof Et||e instanceof Ir||e instanceof Yr?e.toString():JSON.stringify(e)}Yr.prototype.toString=function(){return this.name},Yr.fromString=function(e){return e?new Yr({name:e,available:!1}):null},Yr.prototype.serialize=function(){return["image",this.name]};var Nr=function(e,t){this.type=e,this.value=t};Nr.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=nr(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 Nr(a,r)},Nr.prototype.evaluate=function(){return this.value},Nr.prototype.eachChild=function(){},Nr.prototype.outputDefined=function(){return!0},Nr.prototype.serialize=function(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Et?["rgba"].concat(this.value.toArray()):this.value instanceof Ir?this.value.serialize():this.value};var Ar=function(e){this.name="ExpressionEvaluationError",this.message=e};Ar.prototype.toJSON=function(){return this.message};var Si={string:Be,number:de,boolean:Ee,object:ut},$t=function(e,t){this.type=e,this.args=t};$t.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 v=e[1];if(typeof v!="string"||!(v in Si)||v==="object")return t.error('The item type argument of "array" must be one of string, number, boolean',1);c=Si[v],a++}else c=Me;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=At(c,h)}else r=Si[u];for(var _=[];a<e.length;a++){var x=t.parse(e[a],a,Me);if(!x)return null;_.push(x)}return new $t(r,_)},$t.prototype.evaluate=function(e){for(var t=0;t<this.args.length;t++){var r=this.args[t].evaluate(e);if(!Pt(this.type,nr(r)))return r;if(t===this.args.length-1)throw new Ar("Expected value to be of type "+_t(this.type)+", but found "+_t(nr(r))+" instead.")}return null},$t.prototype.eachChild=function(e){this.args.forEach(e)},$t.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},$t.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 Fi=function(e){this.type=Ft,this.sections=e};Fi.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 v=null;if(h["font-scale"]&&!(v=t.parse(h["font-scale"],1,de)))return null;var _=null;if(h["text-font"]&&!(_=t.parse(h["text-font"],1,At(Be))))return null;var x=null;if(h["text-color"]&&!(x=t.parse(h["text-color"],1,Pe)))return null;var S=a[a.length-1];S.scale=v,S.font=_,S.textColor=x}else{var T=t.parse(e[c],1,Me);if(!T)return null;var E=T.type.kind;if(E!=="string"&&E!=="value"&&E!=="null"&&E!=="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 Fi(a)},Fi.prototype.evaluate=function(e){return new Ir(this.sections.map(function(t){var r=t.content.evaluate(e);return nr(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)}))},Fi.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)}},Fi.prototype.outputDefined=function(){return!1},Fi.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 hi=function(e){this.type=pt,this.input=e};hi.parse=function(e,t){if(e.length!==2)return t.error("Expected two arguments.");var r=t.parse(e[1],1,Be);return r?new hi(r):t.error("No image name provided.")},hi.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=Yr.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r},hi.prototype.eachChild=function(e){e(this.input)},hi.prototype.outputDefined=function(){return!1},hi.prototype.serialize=function(){return["image",this.input.serialize()]};var iu={"to-boolean":Ee,"to-color":Pe,"to-number":de,"to-string":Be},Ti=function(e,t){this.type=e,this.args=t};Ti.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=iu[r],u=[],c=1;c<e.length;c++){var h=t.parse(e[c],c,Me);if(!h)return null;u.push(h)}return new Ti(a,u)},Ti.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 Et)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.":Ys(t[0],t[1],t[2],t[3])))return new Et(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Ar(r||"Could not parse color from value '"+(typeof t=="string"?t:String(JSON.stringify(t)))+"'")}if(this.type.kind==="number"){for(var h=null,v=0,_=this.args;v<_.length;v+=1){if((h=_[v].evaluate(e))===null)return 0;var x=Number(h);if(!isNaN(x))return x}throw new Ar("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"?Yr.fromString(ca(this.args[0].evaluate(e))):ca(this.args[0].evaluate(e))},Ti.prototype.eachChild=function(e){this.args.forEach(e)},Ti.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},Ti.prototype.serialize=function(){if(this.type.kind==="formatted")return new Fi([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new hi(this.args[0]).serialize();var e=["to-"+this.type.kind];return this.eachChild(function(t){e.push(t.serialize())}),e};var jc=["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"?jc[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]=Et.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,v=h.filter(function(We){var ze=We[0];return!Array.isArray(ze)||ze.length===e.length-1}),_=null,x=0,S=v;x<S.length;x+=1){var T=S[x],E=T[0],k=T[1];_=new xn(t.registry,t.path,null,t.scope);for(var U=[],N=!1,J=1;J<e.length;J++){var H=e[J],re=Array.isArray(E)?E[J-1]:E.type,oe=_.parse(H,1+U.length,re);if(!oe){N=!0;break}U.push(oe)}if(!N)if(Array.isArray(E)&&E.length!==U.length)_.error("Expected "+E.length+" arguments, but found "+U.length+" instead.");else{for(var se=0;se<U.length;se++){var ce=Array.isArray(E)?E[se]:E.type,ye=U[se];_.concat(se+1).checkSubtype(ce,ye.type)}if(_.errors.length===0)return new zr(a,c,k,U)}}if(v.length===1)(r=t.errors).push.apply(r,_.errors);else{for(var Se=(v.length?v:h).map(function(We){var ze;return ze=We[0],Array.isArray(ze)?"("+ze.map(_t).join(", ")+")":"("+_t(ze.type)+"...)"}).join(" | "),Ae=[],$e=1;$e<e.length;$e++){var ke=t.parse(e[$e],1+Ae.length);if(!ke)return null;Ae.push(_t(ke.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 Wi=function(e,t,r){this.type=vt,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 $c(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 Zc(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,v,_,x=!1,S=0,T=t.length;S<T;S++)for(var E=t[S],k=0,U=E.length;k<U-1;k++){if((c=(r=e)[0]-(a=E[k])[0])*(_=r[1]-(u=E[k+1])[1])-(v=r[0]-u[0])*(h=r[1]-a[1])==0&&c*v<=0&&h*_<=0)return!1;Zc(e,E[k],E[k+1])&&(x=!x)}return x}function Gc(e,t){for(var r=0;r<t.length;r++)if(Qs(e,t[r]))return!0;return!1}function nu(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]),v=(t[0]-r[0])*c-u*(t[1]-r[1]);return h>0&&v<0||h<0&&v>0}function Wc(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=[(S=c[h+1])[0]-(x=c[h])[0],S[1]-x[1]])[0]*(E=[(_=t)[0]-(v=e)[0],_[1]-v[1]])[1]-T[1]*E[0]!=0&&nu(v,_,x,S)&&nu(x,S,v,_))return!0;var v,_,x,S,T,E;return!1}function ou(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(Wc(e[a],e[a+1],t))return!1;return!0}function au(e,t){for(var r=0;r<t.length;r++)if(ou(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 v=$c(e[u][h],r);qr(t,v),c.push(v)}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 su(e,t,r,a){for(var u=8192*Math.pow(2,a.z),c=[8192*a.x,8192*a.y],h=[],v=0,_=e;v<_.length;v+=1)for(var x=0,S=_[v];x<S.length;x+=1){var T=S[x],E=[T.x+c[0],T.y+c[1]];pa(E,t,r,u),h.push(E)}return h}function Xa(e,t,r,a){for(var u,c=8192*Math.pow(2,a.z),h=[8192*a.x,8192*a.y],v=[],_=0,x=e;_<x.length;_+=1){for(var S=[],T=0,E=x[_];T<E.length;T+=1){var k=E[T],U=[k.x+h[0],k.y+h[1]];qr(t,U),S.push(U)}v.push(S)}if(t[2]-t[0]<=c/2){(u=t)[0]=u[1]=1/0,u[2]=u[3]=-1/0;for(var N=0,J=v;N<J.length;N+=1)for(var H=0,re=J[N];H<re.length;H+=1)pa(re[H],t,r,c)}return v}Wi.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,Ee);if(!a)return null;var u=t.parse(r["diacritic-sensitive"]!==void 0&&r["diacritic-sensitive"],1,Ee);if(!u)return null;var c=null;return r.locale&&!(c=t.parse(r.locale,1,Be))?null:new Wi(a,u,c)},Wi.prototype.evaluate=function(e){return new Jr(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)},Wi.prototype.eachChild=function(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)},Wi.prototype.outputDefined=function(){return!1},Wi.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 Ii=function(e,t){this.type=Ee,this.geojson=e,this.geometries=t};function vn(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 Ii)return!1;var t=!0;return e.eachChild(function(r){t&&!vn(r)&&(t=!1)}),t}function gn(e){if(e instanceof zr&&e.name==="feature-state")return!1;var t=!0;return e.eachChild(function(r){t&&!gn(r)&&(t=!1)}),t}function Xn(e,t){if(e instanceof zr&&t.indexOf(e.name)>=0)return!1;var r=!0;return e.eachChild(function(a){r&&!Xn(a,t)&&(r=!1)}),r}Ii.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 Ii(r,r.features[a].geometry)}else if(r.type==="Feature"){var c=r.geometry.type;if(c==="Polygon"||c==="MultiPolygon")return new Ii(r,r.geometry)}else if(r.type==="Polygon"||r.type==="MultiPolygon")return new Ii(r,r)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Ii.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),v=su(t.geometry(),a,u,c);if(!Hn(a,u))return!1;for(var _=0,x=v;_<x.length;_+=1)if(!Qs(x[_],h))return!1}if(r.type==="MultiPolygon"){var S=el(r.coordinates,u,c),T=su(t.geometry(),a,u,c);if(!Hn(a,u))return!1;for(var E=0,k=T;E<k.length;E+=1)if(!Gc(k[E],S))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),v=Xa(t.geometry(),a,u,c);if(!Hn(a,u))return!1;for(var _=0,x=v;_<x.length;_+=1)if(!ou(x[_],h))return!1}if(r.type==="MultiPolygon"){var S=el(r.coordinates,u,c),T=Xa(t.geometry(),a,u,c);if(!Hn(a,u))return!1;for(var E=0,k=T;E<k.length;E+=1)if(!au(k[E],S))return!1}return!0}(e,this.geometries)}return!1},Ii.prototype.eachChild=function(){},Ii.prototype.outputDefined=function(){return!0},Ii.prototype.serialize=function(){return["within",this.geojson]};var _n=function(e,t){this.type=t.type,this.name=e,this.boundExpression=t};_n.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 _n(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)},_n.prototype.evaluate=function(e){return this.boundExpression.evaluate(e)},_n.prototype.eachChild=function(){},_n.prototype.outputDefined=function(){return!1},_n.prototype.serialize=function(){return["var",this.name]};var xn=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 Ar("Input is not a number.");c=h-1}return 0}xn.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)},xn.prototype._parse=function(e,t){function r(x,S,T){return T==="assert"?new $t(S,[x]):T==="coerce"?new Ti(S,[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,v=c.type;if(h.kind!=="string"&&h.kind!=="number"&&h.kind!=="boolean"&&h.kind!=="object"&&h.kind!=="array"||v.kind!=="value")if(h.kind!=="color"&&h.kind!=="formatted"&&h.kind!=="resolvedImage"||v.kind!=="value"&&v.kind!=="string"){if(this.checkSubtype(h,v))return null}else c=r(c,h,t.typeAnnotation||"coerce");else c=r(c,h,t.typeAnnotation||"assert")}if(!(c instanceof Nr)&&c.type.kind!=="resolvedImage"&&function x(S){if(S instanceof _n)return x(S.boundExpression);if(S instanceof zr&&S.name==="error"||S instanceof Wi||S instanceof Ii)return!1;var T=S instanceof Ti||S instanceof $t,E=!0;return S.eachChild(function(k){E=T?E&&x(k):E&&k instanceof Nr}),!!E&&vn(S)&&Xn(S,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(c)){var _=new an;try{c=new Nr(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.")},xn.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 xn(this.registry,a,t||null,u,this.errors)},xn.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))},xn.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 pr(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],v=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 S=t.parse(v,x,u);if(!S)return null;u=u||S.type,a.push([h,S])}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:pr,color:function(e,t,r){return new Et(pr(e.r,t.r,r),pr(e.g,t.g,r),pr(e.b,t.b,r),pr(e.a,t.a,r))},array:function(e,t,r){return e.map(function(a,u){return pr(a,t[u],r)})}}),lu=6/29*3*(6/29),Hc=Math.PI/180,Xc=180/Math.PI;function tl(e){return e>.008856451679035631?Math.pow(e,1/3):e/lu+4/29}function rl(e){return e>6/29?e*e*e:lu*(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 uu(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 cu(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 Et(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 Kc(e,t,r){var a=t-e;return e+r*(a>180||a<-180?a-360*Math.round(a/360):a)}var ha={forward:uu,reverse:cu,interpolate:function(e,t,r){return{l:pr(e.l,t.l,r),a:pr(e.a,t.a,r),b:pr(e.b,t.b,r),alpha:pr(e.alpha,t.alpha,r)}}},fa={forward:function(e){var t=uu(e),r=t.l,a=t.a,u=t.b,c=Math.atan2(u,a)*Xc;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*Hc,r=e.c;return cu({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:Kc(e.h,t.h,r),c:pr(e.c,t.c,r),l:pr(e.l,t.l,r),alpha:pr(e.alpha,t.alpha,r)}}},pu=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 v=h[c],_=v[1];this.labels.push(v[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 W(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 v=a.slice(1);if(v.length!==4||v.some(function(J){return typeof J!="number"||J<0||J>1}))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:v}}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=Pe:t.expectedType&&t.expectedType.kind!=="value"&&(x=t.expectedType);for(var S=0;S<c.length;S+=2){var T=c[S],E=c[S+1],k=S+3,U=S+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 N=t.parse(E,U,x);if(!N)return null;x=x||N.type,_.push([T,N])}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 "+_t(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]),v=r[c].evaluate(e),_=r[c+1].evaluate(e);return this.operator==="interpolate"?Bo[this.type.kind.toLowerCase()](v,_,h):this.operator==="interpolate-hcl"?fa.reverse(fa.interpolate(fa.forward(v),fa.forward(_),h)):ha.reverse(ha.interpolate(ha.forward(v),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 bn=function(e,t){this.type=e,this.args=t};bn.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 v=t.parse(h[c],1+u.length,r,void 0,{typeAnnotation:"omit"});if(!v)return null;r=r||v.type,u.push(v)}var _=a&&u.some(function(x){return Pt(a,x.type)});return new bn(_?Me:r,u)},bn.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 Yr&&!r.available&&(t||(t=r.name),r=null,a===this.args.length&&(r=t)),r===null);u+=1);return r},bn.prototype.eachChild=function(e){this.args.forEach(e)},bn.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},bn.prototype.serialize=function(){var e=["coalesce"];return this.eachChild(function(t){e.push(t.serialize())}),e};var wn=function(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t};wn.prototype.evaluate=function(e){return this.result.evaluate(e)},wn.prototype.eachChild=function(e){for(var t=0,r=this.bindings;t<r.length;t+=1)e(r[t][1]);e(this.result)},wn.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 wn(r,h):null},wn.prototype.outputDefined=function(){return this.result.outputDefined()},wn.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 Kn=function(e,t,r){this.type=e,this.index=t,this.input=r};Kn.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,At(t.expectedType||Me));return r&&a?new Kn(a.type.itemType,r,a):null},Kn.prototype.evaluate=function(e){var t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new Ar("Array index out of bounds: "+t+" < 0.");if(t>=r.length)throw new Ar("Array index out of bounds: "+t+" > "+(r.length-1)+".");if(t!==Math.floor(t))throw new Ar("Array index must be an integer, but found "+t+" instead.");return r[t]},Kn.prototype.eachChild=function(e){e(this.index),e(this.input)},Kn.prototype.outputDefined=function(){return!1},Kn.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Jn=function(e,t){this.type=Ee,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,Me),a=t.parse(e[2],2,Me);return r&&a?ir(r.type,[Ee,Be,de,Oe,Me])?new Jn(r,a):t.error("Expected first argument to be of type boolean, string, number or null, but found "+_t(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(!zt(t,["boolean","string","number","null"]))throw new Ar("Expected first argument to be of type boolean, string, number or null, but found "+_t(nr(t))+" instead.");if(!zt(r,["string","array"]))throw new Ar("Expected second argument to be of type array or string, but found "+_t(nr(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 Sn=function(e,t,r){this.type=de,this.needle=e,this.haystack=t,this.fromIndex=r};Sn.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,Me),a=t.parse(e[2],2,Me);if(!r||!a)return null;if(!ir(r.type,[Ee,Be,de,Oe,Me]))return t.error("Expected first argument to be of type boolean, string, number or null, but found "+_t(r.type)+" instead");if(e.length===4){var u=t.parse(e[3],3,de);return u?new Sn(r,a,u):null}return new Sn(r,a)},Sn.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!zt(t,["boolean","string","number","null"]))throw new Ar("Expected first argument to be of type boolean, string, number or null, but found "+_t(nr(t))+" instead.");if(!zt(r,["string","array"]))throw new Ar("Expected second argument to be of type array or string, but found "+_t(nr(r))+" instead.");if(this.fromIndex){var a=this.fromIndex.evaluate(e);return r.indexOf(t,a)}return r.indexOf(t)},Sn.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},Sn.prototype.outputDefined=function(){return!1},Sn.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 Yn=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};Yn.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 v=e[h],_=e[h+1];Array.isArray(v)||(v=[v]);var x=t.concat(h);if(v.length===0)return x.error("Expected at least one branch label.");for(var S=0,T=v;S<T.length;S+=1){var E=T[S];if(typeof E!="number"&&typeof E!="string")return x.error("Branch labels must be numbers or strings.");if(typeof E=="number"&&Math.abs(E)>Number.MAX_SAFE_INTEGER)return x.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof E=="number"&&Math.floor(E)!==E)return x.error("Numeric branch labels must be integer values.");if(r){if(x.checkSubtype(r,nr(E)))return null}else r=nr(E);if(u[String(E)]!==void 0)return x.error("Branch labels must be unique.");u[String(E)]=c.length}var k=t.parse(_,h,a);if(!k)return null;a=a||k.type,c.push(k)}var U=t.parse(e[1],1,Me);if(!U)return null;var N=t.parse(e[e.length-1],e.length-1,a);return N?U.type.kind!=="value"&&t.concat(1).checkSubtype(r,U.type)?null:new Yn(r,a,U,u,c,N):null},Yn.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(nr(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},Yn.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},Yn.prototype.outputDefined=function(){return this.outputs.every(function(e){return e.outputDefined()})&&this.otherwise.outputDefined()},Yn.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 v=function(k){return e.inputType.kind==="number"?Number(k):k},_=0,x=r;_<x.length;_+=1){var S=x[_],T=S[0],E=S[1];t.push(E.length===1?v(E[0]):E.map(v)),t.push(this.outputs[outputIndex$1].serialize())}return t.push(this.otherwise.serialize()),t};var Qn=function(e,t,r){this.type=e,this.branches=t,this.otherwise=r};Qn.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,Ee);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 v=t.parse(e[e.length-1],e.length-1,r);return v?new Qn(r,a,v):null},Qn.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)},Qn.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)},Qn.prototype.outputDefined=function(){return this.branches.every(function(e){return e[1].outputDefined()})&&this.otherwise.outputDefined()},Qn.prototype.serialize=function(){var e=["case"];return this.eachChild(function(t){e.push(t.serialize())}),e};var Tn=function(e,t,r,a){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=a};function hu(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 fu(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,v){this.type=Ee,this.lhs=c,this.rhs=h,this.collator=v,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 v=c[0],_=h.parse(c[1],1,Me);if(!_)return null;if(!hu(v,_.type))return h.concat(1).error('"'+v+`" comparisons are not supported for type '`+_t(_.type)+"'.");var x=h.parse(c[2],2,Me);if(!x)return null;if(!hu(v,x.type))return h.concat(2).error('"'+v+`" comparisons are not supported for type '`+_t(x.type)+"'.");if(_.type.kind!==x.type.kind&&_.type.kind!=="value"&&x.type.kind!=="value")return h.error("Cannot compare types '"+_t(_.type)+"' and '"+_t(x.type)+"'.");a&&(_.type.kind==="value"&&x.type.kind!=="value"?_=new $t(x.type,[_]):_.type.kind!=="value"&&x.type.kind==="value"&&(x=new $t(_.type,[x])));var S=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(!(S=h.parse(c[3],3,vt)))return null}return new u(_,x,S)},u.prototype.evaluate=function(c){var h=this.lhs.evaluate(c),v=this.rhs.evaluate(c);if(a&&this.hasUntypedArgument){var _=nr(h),x=nr(v);if(_.kind!==x.kind||_.kind!=="string"&&_.kind!=="number")throw new Ar('Expected arguments for "'+e+'" to be (string, string) or (number, number), but found ('+_.kind+", "+x.kind+") instead.")}if(this.collator&&!a&&this.hasUntypedArgument){var S=nr(h),T=nr(v);if(S.kind!=="string"||T.kind!=="string")return t(c,h,v)}return this.collator?r(c,h,v,this.collator.evaluate(c)):t(c,h,v)},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}()}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,Me),a=t.parse(e[2],2,de);if(!r||!a)return null;if(!ir(r.type,[At(Me),Be,Me]))return t.error("Expected first argument to be of type array or string, but found "+_t(r.type)+" instead");if(e.length===4){var u=t.parse(e[3],3,de);return u?new Tn(r.type,r,a,u):null}return new Tn(r.type,r,a)},Tn.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!zt(t,["string","array"]))throw new Ar("Expected first argument to be of type array or string, but found "+_t(nr(t))+" instead.");if(this.endIndex){var a=this.endIndex.evaluate(e);return t.slice(r,a)}return t.slice(r)},Tn.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},Tn.prototype.outputDefined=function(){return!1},Tn.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 Jc=Ot("==",function(e,t,r){return t===r},fu),Ja=Ot("!=",function(e,t,r){return t!==r},function(e,t,r,a){return!fu(0,t,r,a)}),du=Ot("<",function(e,t,r){return t<r},function(e,t,r,a){return a.compare(t,r)<0}),mu=Ot(">",function(e,t,r){return t>r},function(e,t,r,a){return a.compare(t,r)>0}),yu=Ot("<=",function(e,t,r){return t<=r},function(e,t,r,a){return a.compare(t,r)<=0}),vu=Ot(">=",function(e,t,r){return t>=r},function(e,t,r,a){return a.compare(t,r)>=0}),eo=function(e,t,r,a,u){this.type=Be,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=a,this.maxFractionDigits=u};eo.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,Be)))return null;var c=null;if(a.currency&&!(c=t.parse(a.currency,1,Be)))return null;var h=null;if(a["min-fraction-digits"]&&!(h=t.parse(a["min-fraction-digits"],1,de)))return null;var v=null;return a["max-fraction-digits"]&&!(v=t.parse(a["max-fraction-digits"],1,de))?null:new eo(r,u,c,h,v)},eo.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))},eo.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)},eo.prototype.outputDefined=function(){return!1},eo.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 In=function(e){this.type=de,this.input=e};In.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 "+_t(r.type)+" instead."):new In(r):null},In.prototype.evaluate=function(e){var t=this.input.evaluate(e);if(typeof t=="string"||Array.isArray(t))return t.length;throw new Ar("Expected value to be of type string or array, but found "+_t(nr(t))+" instead.")},In.prototype.eachChild=function(e){e(this.input)},In.prototype.outputDefined=function(){return!1},In.prototype.serialize=function(){var e=["length"];return this.eachChild(function(t){e.push(t.serialize())}),e};var to={"==":Jc,"!=":Ja,">":mu,"<":du,">=":vu,"<=":yu,array:$t,at:Kn,boolean:$t,case:Qn,coalesce:bn,collator:Wi,format:Fi,image:hi,in:Jn,"index-of":Sn,interpolate:Br,"interpolate-hcl":Br,"interpolate-lab":Br,length:In,let:wn,literal:Nr,match:Yn,number:$t,"number-format":eo,object:$t,slice:Tn,step:ni,string:$t,"to-boolean":Ti,"to-color":Ti,"to-number":Ti,"to-string":Ti,var:_n,within:Ii};function gu(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,v=Ys(r,a,u,h);if(v)throw new Ar(v);return new Et(r/255*h,a/255*h,u/255*h,h)}function _u(e,t){return e in t}function al(e,t){var r=t[e];return r===void 0?null:r}function ro(e){return{type:e}}function xu(e){return{result:"success",value:e}}function io(e){return{result:"error",value:e}}function no(e){return e["property-type"]==="data-driven"||e["property-type"]==="cross-faded-data-driven"}function bu(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 Ya(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Yc(e){return e}function Do(e,t,r){return e!==void 0?e:t!==void 0?t:r!==void 0?r:void 0}function wu(e,t,r,a,u){return Do(typeof r===u?a[r]:void 0,e.default,t.default)}function Qc(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 Su(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,E,k,U){var N=U-k,J=T-k;return N===0?0:E===1?J/N:(Math.pow(E,J)-1)/(Math.pow(E,N)-1)}(r,a,e.stops[c][0],e.stops[c+1][0]),v=e.stops[c][1],_=e.stops[c+1][1],x=Bo[t.type]||Yc;if(e.colorSpace&&e.colorSpace!=="rgb"){var S=pu[e.colorSpace];x=function(T,E){return S.reverse(S.interpolate(S.forward(T),S.forward(E),h))}}return typeof v.evaluate=="function"?{evaluate:function(){for(var T=[],E=arguments.length;E--;)T[E]=arguments[E];var k=v.evaluate.apply(void 0,T),U=_.evaluate.apply(void 0,T);if(k!==void 0&&U!==void 0)return x(k,U,h)}}:x(v,_,h)}function Qa(e,t,r){return t.type==="color"?r=Et.parse(r):t.type==="formatted"?r=Ir.fromString(r.toString()):t.type==="resolvedImage"?r=Yr.fromString(r.toString()):Ut(r)===t.type||t.type==="enum"&&t.values[r]||(r=void 0),Do(r,e.default,t.default)}zr.register(to,{error:[{kind:"error"},[Be],function(e,t){throw new Ar(t[0].evaluate(e))}],typeof:[Be,[Me],function(e,t){return _t(nr(t[0].evaluate(e)))}],"to-rgba":[At(de,4),[Pe],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[Pe,[de,de,de],gu],rgba:[Pe,[de,de,de,de],gu],has:{type:Ee,overloads:[[[Be],function(e,t){return _u(t[0].evaluate(e),e.properties())}],[[Be,ut],function(e,t){var r=t[1];return _u(t[0].evaluate(e),r.evaluate(e))}]]},get:{type:Me,overloads:[[[Be],function(e,t){return al(t[0].evaluate(e),e.properties())}],[[Be,ut],function(e,t){var r=t[1];return al(t[0].evaluate(e),r.evaluate(e))}]]},"feature-state":[Me,[Be],function(e,t){return al(t[0].evaluate(e),e.featureState||{})}],properties:[ut,[],function(e){return e.properties()}],"geometry-type":[Be,[],function(e){return e.geometryType()}],id:[Me,[],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:[Me,[],function(e){return e.globals.accumulated===void 0?null:e.globals.accumulated}],"+":[de,ro(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,ro(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,ro(de),function(e,t){return Math.min.apply(Math,t.map(function(r){return r.evaluate(e)}))}],max:[de,ro(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-==":[Ee,[Be,Me],function(e,t){var r=t[0],a=t[1];return e.properties()[r.value]===a.value}],"filter-id-==":[Ee,[Me],function(e,t){var r=t[0];return e.id()===r.value}],"filter-type-==":[Ee,[Be],function(e,t){var r=t[0];return e.geometryType()===r.value}],"filter-<":[Ee,[Be,Me],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-<":[Ee,[Me],function(e,t){var r=t[0],a=e.id(),u=r.value;return typeof a==typeof u&&a<u}],"filter->":[Ee,[Be,Me],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->":[Ee,[Me],function(e,t){var r=t[0],a=e.id(),u=r.value;return typeof a==typeof u&&a>u}],"filter-<=":[Ee,[Be,Me],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-<=":[Ee,[Me],function(e,t){var r=t[0],a=e.id(),u=r.value;return typeof a==typeof u&&a<=u}],"filter->=":[Ee,[Be,Me],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->=":[Ee,[Me],function(e,t){var r=t[0],a=e.id(),u=r.value;return typeof a==typeof u&&a>=u}],"filter-has":[Ee,[Me],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[Ee,[],function(e){return e.id()!==null&&e.id()!==void 0}],"filter-type-in":[Ee,[At(Be)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[Ee,[At(Me)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[Ee,[Be,At(Me)],function(e,t){var r=t[0];return t[1].value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[Ee,[Be,At(Me)],function(e,t){var r=t[0],a=t[1];return function(u,c,h,v){for(;h<=v;){var _=h+v>>1;if(c[_]===u)return!0;c[_]>u?v=_-1:h=_+1}return!1}(e.properties()[r.value],a.value,0,a.value.length-1)}],all:{type:Ee,overloads:[[[Ee,Ee],function(e,t){var r=t[1];return t[0].evaluate(e)&&r.evaluate(e)}],[ro(Ee),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:Ee,overloads:[[[Ee,Ee],function(e,t){var r=t[1];return t[0].evaluate(e)||r.evaluate(e)}],[ro(Ee),function(e,t){for(var r=0,a=t;r<a.length;r+=1)if(a[r].evaluate(e))return!0;return!1}]]},"!":[Ee,[Ee],function(e,t){return!t[0].evaluate(e)}],"is-supported-script":[Ee,[Be],function(e,t){var r=e.globals&&e.globals.isSupportedScript;return!r||r(t[0].evaluate(e))}],upcase:[Be,[Be],function(e,t){return t[0].evaluate(e).toUpperCase()}],downcase:[Be,[Be],function(e,t){return t[0].evaluate(e).toLowerCase()}],concat:[Be,ro(Me),function(e,t){return t.map(function(r){return ca(r.evaluate(e))}).join("")}],"resolved-locale":[Be,[vt],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"&&Ya(r.default)?new Et(0,0,0,0):r.type==="color"?Et.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 to}function es(e,t){var r=new xn(to,[],t?function(u){var c={color:Pe,string:Be,number:de,enum:Be,boolean:Ee,formatted:Ft,resolvedImage:pt};return u.type==="array"?At(c[u.value]||Me,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?xu(new Lo(a,t)):io(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 Ar("Expected value to be one of "+Object.keys(this._enumValues).map(function(v){return JSON.stringify(v)}).join(", ")+", but found "+JSON.stringify(h)+" instead.");return h}catch(v){return this._warningHistory[v.message]||(this._warningHistory[v.message]=!0,typeof console<"u"&&console.warn(v.message)),this._defaultValue}};var ya=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!=="constant"&&!gn(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"&&!gn(t.expression),this.interpolationType=a};function Tu(e,t){if((e=es(e,t)).result==="error")return e;var r=e.value.expression,a=vn(r);if(!a&&!no(t))return io([new be("","data expressions not supported")]);var u=Xn(r,["zoom"]);if(!u&&!bu(t))return io([new be("","zoom expressions not supported")]);var c=function h(v){var _=null;if(v instanceof wn)_=h(v.result);else if(v instanceof bn)for(var x=0,S=v.args;x<S.length&&!(_=h(S[x]));x+=1);else(v instanceof ni||v instanceof Br)&&v.input instanceof zr&&v.input.name==="zoom"&&(_=v);return _ instanceof be||v.eachChild(function(T){var E=h(T);E instanceof be?_=E:!_&&E?_=new be("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):_&&E&&_!==E&&(_=new be("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),_}(r);return c||u?c instanceof be?io([c]):c instanceof Br&&!da(t)?io([new be("",'"interpolate" expressions cannot be used with this property')]):xu(c?new Ro(a?"camera":"composite",e.value,c.labels,c instanceof Br?c.interpolation:void 0):new ya(a?"constant":"source",e.value)):io([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,v,_=u.type==="color",x=a.stops&&typeof a.stops[0][0]=="object",S=x||!(x||a.property!==void 0),T=a.type||(da(u)?"exponential":"interval");if(_&&((a=xe({},a)).stops&&(a.stops=a.stops.map(function(ke){return[ke[0],Et.parse(ke[1])]})),a.default=Et.parse(a.default?a.default:u.default)),a.colorSpace&&a.colorSpace!=="rgb"&&!pu[a.colorSpace])throw new Error("Unknown color space: "+a.colorSpace);if(T==="exponential")c=Su;else if(T==="interval")c=Qc;else if(T==="categorical"){c=wu,h=Object.create(null);for(var E=0,k=a.stops;E<k.length;E+=1){var U=k[E];h[U[0]]=U[1]}v=typeof a.stops[0][0]}else{if(T!=="identity")throw new Error('Unknown function type "'+T+'"');c=Qa}if(x){for(var N={},J=[],H=0;H<a.stops.length;H++){var re=a.stops[H],oe=re[0].zoom;N[oe]===void 0&&(N[oe]={zoom:oe,type:a.type,property:a.property,default:a.default,stops:[]},J.push(oe)),N[oe].stops.push([re[0].value,re[1]])}for(var se=[],ce=0,ye=J;ce<ye.length;ce+=1){var Se=ye[ce];se.push([N[Se].zoom,r(N[Se],u)])}var Ae={name:"linear"};return{kind:"composite",interpolationType:Ae,interpolationFactor:Br.interpolationFactor.bind(void 0,Ae),zoomStops:se.map(function(ke){return ke[0]}),evaluate:function(ke,We){var ze=ke.zoom;return Su({stops:se,base:a.base},u,ze).evaluate(ze,We)}}}if(S){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(ke){return ke[0]}),evaluate:function(ke){return c(a,u,ke.zoom,h,v)}}}return{kind:"source",evaluate:function(ke,We){var ze=We&&We.properties?We.properties[a.property]:void 0;return ze===void 0?Do(a.default,u.default):c(a,u,ze,h,v)}}}(this._parameters,this._specification))};function Oi(e){var t=e.key,r=e.value,a=e.valueSpec||{},u=e.objectElementValidators||{},c=e.style,h=e.styleSpec,v=[],_=Ut(r);if(_!=="object")return[new Z(t,r,"object expected, "+_+" found")];for(var x in r){var S=x.split(".")[0],T=a[S]||a["*"],E=void 0;if(u[S])E=u[S];else if(a[S])E=gt;else if(u["*"])E=u["*"];else{if(!a["*"]){v.push(new Z(t,r[x],'unknown property "'+x+'"'));continue}E=gt}v=v.concat(E({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&&v.push(new Z(t,r,'missing required property "'+k+'"'));return v}function Iu(e){var t=e.value,r=e.valueSpec,a=e.style,u=e.styleSpec,c=e.key,h=e.arrayElementValidator||gt;if(Ut(t)!=="array")return[new Z(c,t,"array expected, "+Ut(t)+" found")];if(r.length&&t.length!==r.length)return[new Z(c,t,"array length "+r.length+" expected, length "+t.length+" found")];if(r["min-length"]&&t.length<r["min-length"])return[new Z(c,t,"array length at least "+r["min-length"]+" expected, length "+t.length+" found")];var v={type:r.value,values:r.values};u.$version<7&&(v.function=r.function),Ut(r.value)==="object"&&(v=r.value);for(var _=[],x=0;x<t.length;x++)_=_.concat(h({array:t,arrayIndex:x,value:t[x],valueSpec:v,style:a,styleSpec:u,key:c+"["+x+"]"}));return _}function Au(e){var t=e.key,r=e.value,a=e.valueSpec,u=Ut(r);return u==="number"&&r!=r&&(u="NaN"),u!=="number"?[new Z(t,r,"number expected, "+u+" found")]:"minimum"in a&&r<a.minimum?[new Z(t,r,r+" is less than the minimum value "+a.minimum)]:"maximum"in a&&r>a.maximum?[new Z(t,r,r+" is greater than the maximum value "+a.maximum)]:[]}function Eu(e){var t,r,a,u=e.valueSpec,c=we(e.value.type),h={},v=c!=="categorical"&&e.value.property===void 0,_=!v,x=Ut(e.value.stops)==="array"&&Ut(e.value.stops[0])==="array"&&Ut(e.value.stops[0][0])==="object",S=Oi({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 Z(k.key,k.value,'identity function may not have a "stops" property')];var U=[],N=k.value;return U=U.concat(Iu({key:k.key,value:N,valueSpec:k.valueSpec,style:k.style,styleSpec:k.styleSpec,arrayElementValidator:T})),Ut(N)==="array"&&N.length===0&&U.push(new Z(k.key,N,"array must have at least one stop")),U},default:function(k){return gt({key:k.key,value:k.value,valueSpec:u,style:k.style,styleSpec:k.styleSpec})}}});return c==="identity"&&v&&S.push(new Z(e.key,e.value,'missing required property "property"')),c==="identity"||e.value.stops||S.push(new Z(e.key,e.value,'missing required property "stops"')),c==="exponential"&&e.valueSpec.expression&&!da(e.valueSpec)&&S.push(new Z(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(_&&!no(e.valueSpec)?S.push(new Z(e.key,e.value,"property functions not supported")):v&&!bu(e.valueSpec)&&S.push(new Z(e.key,e.value,"zoom functions not supported"))),c!=="categorical"&&!x||e.value.property!==void 0||S.push(new Z(e.key,e.value,'"property" property is required')),S;function T(k){var U=[],N=k.value,J=k.key;if(Ut(N)!=="array")return[new Z(J,N,"array expected, "+Ut(N)+" found")];if(N.length!==2)return[new Z(J,N,"array length 2 expected, length "+N.length+" found")];if(x){if(Ut(N[0])!=="object")return[new Z(J,N,"object expected, "+Ut(N[0])+" found")];if(N[0].zoom===void 0)return[new Z(J,N,"object stop key must have zoom")];if(N[0].value===void 0)return[new Z(J,N,"object stop key must have value")];if(a&&a>we(N[0].zoom))return[new Z(J,N[0].zoom,"stop zoom values must appear in ascending order")];we(N[0].zoom)!==a&&(a=we(N[0].zoom),r=void 0,h={}),U=U.concat(Oi({key:J+"[0]",value:N[0],valueSpec:{zoom:{}},style:k.style,styleSpec:k.styleSpec,objectElementValidators:{zoom:Au,value:E}}))}else U=U.concat(E({key:J+"[0]",value:N[0],style:k.style,styleSpec:k.styleSpec},N));return ma(fe(N[1]))?U.concat([new Z(J+"[1]",N[1],"expressions are not allowed in function stops.")]):U.concat(gt({key:J+"[1]",value:N[1],valueSpec:u,style:k.style,styleSpec:k.styleSpec}))}function E(k,U){var N=Ut(k.value),J=we(k.value),H=k.value!==null?k.value:U;if(t){if(N!==t)return[new Z(k.key,H,N+" stop domain type must match previous stop domain type "+t)]}else t=N;if(N!=="number"&&N!=="string"&&N!=="boolean")return[new Z(k.key,H,"stop domain value must be a number, string, or boolean")];if(N!=="number"&&c!=="categorical"){var re="number expected, "+N+" found";return no(u)&&c===void 0&&(re+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Z(k.key,H,re)]}return c!=="categorical"||N!=="number"||isFinite(J)&&Math.floor(J)===J?c!=="categorical"&&N==="number"&&r!==void 0&&J<r?[new Z(k.key,H,"stop domain values must appear in ascending order")]:(r=J,c==="categorical"&&J in h?[new Z(k.key,H,"stop domain values must be unique")]:(h[J]=!0,[])):[new Z(k.key,H,"integer expected, found "+J)]}}function oo(e){var t=(e.expressionContext==="property"?Tu:es)(fe(e.value),e.valueSpec);if(t.result==="error")return t.value.map(function(a){return new Z(""+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 Z(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"&&!gn(r))return[new Z(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if(e.expressionContext==="filter"&&!gn(r))return[new Z(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&e.expressionContext.indexOf("cluster")===0){if(!Xn(r,["zoom","feature-state"]))return[new Z(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(e.expressionContext==="cluster-initial"&&!vn(r))return[new Z(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 Z(t,r,"expected one of ["+a.values.join(", ")+"], "+JSON.stringify(r)+" found")):Object.keys(a.values).indexOf(we(r))===-1&&u.push(new Z(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};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 ep(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"?Cu(e[1],e.slice(2)):r==="!in"?ns(Cu(e[1],e.slice(2))):r==="has"?Pu(e[1]):r==="!has"?ns(Pu(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 Cu(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(ep)]]:["filter-in-small",e,["literal",t]]}}function Pu(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))?oo(xe({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(r){var a=r.value,u=r.key;if(Ut(a)!=="array")return[new Z(u,a,"array expected, "+Ut(a)+" found")];var c,h=r.styleSpec,v=[];if(a.length<1)return[new Z(u,a,"filter array must have at least 1 element")];switch(v=v.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"&&v.push(new Z(u,a,'"$type" cannot be use with operator "'+a[0]+'"'));case"==":case"!=":a.length!==3&&v.push(new Z(u,a,'filter array for operator "'+a[0]+'" must have 3 elements'));case"in":case"!in":a.length>=2&&(c=Ut(a[1]))!=="string"&&v.push(new Z(u+"[1]",a[1],"string expected, "+c+" found"));for(var _=2;_<a.length;_++)c=Ut(a[_]),we(a[1])==="$type"?v=v.concat(va({key:u+"["+_+"]",value:a[_],valueSpec:h.geometry_type,style:r.style,styleSpec:r.styleSpec})):c!=="string"&&c!=="number"&&c!=="boolean"&&v.push(new Z(u+"["+_+"]",a[_],"string, number, or boolean expected, "+c+" found"));break;case"any":case"all":case"none":for(var x=1;x<a.length;x++)v=v.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?v.push(new Z(u,a,'filter array for "'+a[0]+'" operator must have 2 elements')):c!=="string"&&v.push(new Z(u+"[1]",a[1],"string expected, "+c+" found"));break;case"within":c=Ut(a[1]),a.length!==2?v.push(new Z(u,a,'filter array for "'+a[0]+'" operator must have 2 elements')):c!=="object"&&v.push(new Z(u+"[1]",a[1],"object expected, "+c+" found"))}return v}(e)}function cl(e,t){var r=e.key,a=e.style,u=e.styleSpec,c=e.value,h=e.objectKey,v=u[t+"_"+e.layerType];if(!v)return[];var _=h.match(/^(.*)-transition$/);if(t==="paint"&&_&&v[_[1]]&&v[_[1]].transition)return gt({key:r,value:c,valueSpec:u.transition,style:a,styleSpec:u});var x,S=e.valueSpec||v[h];if(!S)return[new Z(r,c,'unknown property "'+h+'"')];if(Ut(c)==="string"&&no(S)&&!S.tokens&&(x=/^{([^}]+)}$/.exec(c)))return[new Z(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 Z(r,c,'use of "text-field" requires a style "glyphs" property')),h==="text-font"&&Ya(fe(c))&&we(c.type)==="identity"&&T.push(new Z(r,c,'"text-font" does not support identity functions'))),T.concat(gt({key:e.key,value:c,valueSpec:S,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 ku(e){var t=[],r=e.value,a=e.key,u=e.style,c=e.styleSpec;r.type||r.ref||t.push(new Z(a,r,'either "type" or "ref" is required'));var h,v=we(r.type),_=we(r.ref);if(r.id)for(var x=we(r.id),S=0;S<e.arrayIndex;S++){var T=u.layers[S];we(T.id)===x&&t.push(new Z(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(U){U in r&&t.push(new Z(a,r[U],'"'+U+'" is prohibited for ref layers'))}),u.layers.forEach(function(U){we(U.id)===_&&(h=U)}),h?h.ref?t.push(new Z(a,r.ref,"ref cannot reference another ref layer")):v=we(h.type):t.push(new Z(a,r.ref,'ref layer "'+_+'" not found'));else if(v!=="background")if(r.source){var E=u.sources&&u.sources[r.source],k=E&&we(E.type);E?k==="vector"&&v==="raster"?t.push(new Z(a,r.source,'layer "'+r.id+'" requires a raster source')):k==="raster"&&v!=="raster"?t.push(new Z(a,r.source,'layer "'+r.id+'" requires a vector source')):k!=="vector"||r["source-layer"]?k==="raster-dem"&&v!=="hillshade"?t.push(new Z(a,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):v!=="line"||!r.paint||!r.paint["line-gradient"]||k==="geojson"&&E.lineMetrics||t.push(new Z(a,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):t.push(new Z(a,r,'layer "'+r.id+'" must specify a "source-layer"')):t.push(new Z(a,r.source,'source "'+r.source+'" not found'))}else t.push(new Z(a,r,'missing required property "source"'));return t=t.concat(Oi({key:a,value:r,valueSpec:c.layer,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return gt({key:a+".type",value:r.type,valueSpec:c.layer.type,style:e.style,styleSpec:e.styleSpec,object:r,objectKey:"type"})},filter:ul,layout:function(U){return Oi({layer:r,key:U.key,value:U.value,style:U.style,styleSpec:U.styleSpec,objectElementValidators:{"*":function(N){return ga(xe({layerType:v},N))}}})},paint:function(U){return Oi({layer:r,key:U.key,value:U.value,style:U.style,styleSpec:U.styleSpec,objectElementValidators:{"*":function(N){return pl(xe({layerType:v},N))}}})}}}))}function ao(e){var t=e.value,r=e.key,a=Ut(t);return a!=="string"?[new Z(r,t,"string expected, "+a+" found")]:[]}var Zt={promoteId:function(e){var t=e.key,r=e.value;if(Ut(r)==="string")return ao({key:t,value:r});var a=[];for(var u in r)a.push.apply(a,ao({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 Z(r,t,'"type" is required')];var c,h=we(t.type);switch(h){case"vector":case"raster":case"raster-dem":return Oi({key:r,value:t,valueSpec:a["source_"+h.replace("-","_")],style:e.style,styleSpec:a,objectElementValidators:Zt});case"geojson":if(c=Oi({key:r,value:t,valueSpec:a.source_geojson,style:u,styleSpec:a,objectElementValidators:Zt}),t.cluster)for(var v in t.clusterProperties){var _=t.clusterProperties[v],x=_[0],S=typeof x=="string"?[x,["accumulated"],["get",v]]:x;c.push.apply(c,oo({key:r+"."+v+".map",value:_[1],expressionContext:"cluster-map"})),c.push.apply(c,oo({key:r+"."+v+".reduce",value:S,expressionContext:"cluster-reduce"}))}return c;case"video":return Oi({key:r,value:t,valueSpec:a.source_video,style:u,styleSpec:a});case"image":return Oi({key:r,value:t,valueSpec:a.source_image,style:u,styleSpec:a});case"canvas":return[new Z(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"]}})}}function so(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 Z("light",t,"object expected, "+h+" found")]);for(var v in t){var _=v.match(/^(.*)-transition$/);c=c.concat(_&&a[_[1]]&&a[_[1]].transition?gt({key:v,value:t[v],valueSpec:r.transition,style:u,styleSpec:r}):a[v]?gt({key:v,value:t[v],valueSpec:a[v],style:u,styleSpec:r}):[new Z(v,t[v],'unknown property "'+v+'"')])}return c}var An={"*":function(){return[]},array:Iu,boolean:function(e){var t=e.value,r=e.key,a=Ut(t);return a!=="boolean"?[new Z(r,t,"boolean expected, "+a+" found")]:[]},number:Au,color:function(e){var t=e.key,r=e.value,a=Ut(r);return a!=="string"?[new Z(t,r,"color expected, "+a+" found")]:mt(r)===null?[new Z(t,r,'color expected, "'+r+'" found')]:[]},constants:ne,enum:va,filter:ul,function:Eu,layer:ku,object:Oi,source:os,light:so,string:ao,formatted:function(e){return ao(e).length===0?[]:oo(e)},resolvedImage:function(e){return ao(e).length===0?[]:oo(e)}};function gt(e){var t=e.value,r=e.valueSpec,a=e.styleSpec;return r.expression&&Ya(we(t))?Eu(e):r.expression&&ma(fe(t))?oo(e):r.type&&An[r.type]?An[r.type](e):Oi(xe({},e,{valueSpec:r.type?a[r.type]:r}))}function Nt(e){var t=e.value,r=e.key,a=ao(e);return a.length||(t.indexOf("{fontstack}")===-1&&a.push(new Z(r,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&a.push(new Z(r,t,'"glyphs" url must include a "{range}" token'))),a}function fi(e,t){t===void 0&&(t=B);var r=[];return r=r.concat(gt({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,objectElementValidators:{glyphs:Nt,"*":function(){return[]}}})),e.constants&&(r=r.concat(ne({key:"constants",value:e.constants}))),_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))}}fi.source=Oo(os),fi.light=Oo(so),fi.layer=Oo(ku),fi.filter=Oo(ul),fi.paintProperty=Oo(pl),fi.layoutProperty=Oo(ga);var xa=fi,tp=xa.light,rp=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 Q(new Error(u[a].message))),r=!0;return r}var sn=dr;function dr(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],v=u[3+c+1];a.push(h===v?null:u.subarray(h,v))}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 S=r/t*e;this.min=-S,this.max=e+S}dr.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)},dr.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},dr.prototype._insertCell=function(e,t,r,a,u,c){this.cells[u].push(c)},dr.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 v=[];return this._forEachCell(e,t,r,a,this._queryCell,v,{},u),v},dr.prototype._queryCell=function(e,t,r,a,u,c,h,v){var _=this.cells[u];if(_!==null)for(var x=this.keys,S=this.bboxes,T=0;T<_.length;T++){var E=_[T];if(h[E]===void 0){var k=4*E;(v?v(S[k+0],S[k+1],S[k+2],S[k+3]):e<=S[k+2]&&t<=S[k+3]&&r>=S[k+0]&&a>=S[k+1])?(h[E]=!0,c.push(x[E])):h[E]=!1}}},dr.prototype._forEachCell=function(e,t,r,a,u,c,h,v){for(var _=this._convertToCellCoord(e),x=this._convertToCellCoord(t),S=this._convertToCellCoord(r),T=this._convertToCellCoord(a),E=_;E<=S;E++)for(var k=x;k<=T;k++){var U=this.d*k+E;if((!v||v(this._convertFromCellCoord(E),this._convertFromCellCoord(k),this._convertFromCellCoord(E+1),this._convertFromCellCoord(k+1)))&&u.call(this,e,t,r,a,U,c,h,v))return}},dr.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},dr.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},dr.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 v=e[h];u[3+h]=c,u.set(v,c),c+=v.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,Mu=le.ImageBitmap,hr={};function Ve(e,t,r){r===void 0&&(r={}),Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),hr[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",Et),Ve("Error",Error),Ve("ResolvedImage",Yr),Ve("StylePropertyFunction",Fo),Ve("StyleExpression",Lo,{omit:["_evaluator"]}),Ve("ZoomDependentExpression",Ro),Ve("ZoomConstantExpression",ya),Ve("CompoundExpression",zr,{omit:["_evaluate"]}),to)to[oi]._classRegistryKey||Ve("Expression_"+oi,to[oi]);function as(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor&&e.constructor.name==="ArrayBuffer")}function Vo(e){return Mu&&e instanceof Mu}function Vi(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(Vi(c[u],t));return a}if(typeof e=="object"){var h=e.constructor,v=h._classRegistryKey;if(!v)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)&&!(hr[v].omit.indexOf(x)>=0)){var S=e[x];_[x]=hr[v].shallow.indexOf(x)>=0?S:Vi(S,t)}e instanceof Error&&(_.message=e.message)}if(_.$name)throw new Error("$name property is reserved for worker serialization logic.");return v!=="Object"&&(_.$name=v),_}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=hr[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 v=e[h];a[h]=hr[t].shallow.indexOf(h)>=0?v:ai(v)}}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 Ce={"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||!(Ce["Bopomofo Extended"](e)||Ce.Bopomofo(e)||Ce["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||Ce["CJK Compatibility Ideographs"](e)||Ce["CJK Compatibility"](e)||Ce["CJK Radicals Supplement"](e)||Ce["CJK Strokes"](e)||!(!Ce["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||e===12336)||Ce["CJK Unified Ideographs Extension A"](e)||Ce["CJK Unified Ideographs"](e)||Ce["Enclosed CJK Letters and Months"](e)||Ce["Hangul Compatibility Jamo"](e)||Ce["Hangul Jamo Extended-A"](e)||Ce["Hangul Jamo Extended-B"](e)||Ce["Hangul Jamo"](e)||Ce["Hangul Syllables"](e)||Ce.Hiragana(e)||Ce["Ideographic Description Characters"](e)||Ce.Kanbun(e)||Ce["Kangxi Radicals"](e)||Ce["Katakana Phonetic Extensions"](e)||Ce.Katakana(e)&&e!==12540||!(!Ce["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)||!(!Ce["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||Ce["Unified Canadian Aboriginal Syllabics"](e)||Ce["Unified Canadian Aboriginal Syllabics Extended"](e)||Ce["Vertical Forms"](e)||Ce["Yijing Hexagram Symbols"](e)||Ce["Yi Syllables"](e)||Ce["Yi Radicals"](e))))}function dl(e){return!(ss(e)||function(t){return!!(Ce["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||Ce["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)||Ce["Letterlike Symbols"](t)||Ce["Number Forms"](t)||Ce["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)||Ce["Control Pictures"](t)&&t!==9251||Ce["Optical Character Recognition"](t)||Ce["Enclosed Alphanumerics"](t)||Ce["Geometric Shapes"](t)||Ce["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Ce["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Ce["CJK Symbols and Punctuation"](t)||Ce.Katakana(t)||Ce["Private Use Area"](t)||Ce["CJK Compatibility Forms"](t)||Ce["Small Form Variants"](t)||Ce["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||Ce["Arabic Presentation Forms-A"](e)||Ce["Arabic Presentation Forms-B"](e)}function si(e,t){return!(!t&&Ai(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||Ce.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,zu=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 te,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?zu(e):(li="loaded",Ta())})},di={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return li==="loaded"||di.applyArabicShaping!=null},isLoading:function(){return li==="loading"},setState:function(e){li=e.pluginStatus,ln=e.pluginURL},isParsed:function(){return di.applyArabicShaping!=null&&di.processBidirectionalText!=null&&di.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,di.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(Ya(r))return new Fo(r,a);if(ma(r)){var u=Tu(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=Et.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 Ei=function(e){this.property=e,this.value=new Hi(e,void 0)};Ei.prototype.transitioned=function(e,t){return new lo(this.property,this.value,t,tt({},e.transition,this.transition),e.now)},Ei.prototype.untransitioned=function(){return new lo(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 gr(this._values[e].value.value)},Dr.prototype.setValue=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Ei(this._values[e].property)),this._values[e].value=new Hi(this._values[e].property,t===null?void 0:gr(t))},Dr.prototype.getTransition=function(e){return gr(this._values[e].transition)},Dr.prototype.setTransition=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Ei(this._values[e].property)),this._values[e].transition=gr(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 En(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 En(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 lo=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)};lo.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(v){if(v<=0)return 0;if(v>=1)return 1;var _=v*v,x=_*v;return 4*(v<.5?x:3*(v-_)+x-.75)}(h))}return u};var En=function(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)};En.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},En.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 Ni=function(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)};Ni.prototype.getValue=function(e){return gr(this._values[e].value)},Ni.prototype.setValue=function(e,t){this._values[e]=new Hi(this._values[e].property,t===null?void 0:gr(t))},Ni.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},Ni.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 Ne=function(e,t){this.specification=e,this.overrides=t};Ne.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)},Ne.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},Ne.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),v=r.property.specification.type==="resolvedImage"&&typeof h!="string"?h.name:h,_=this._calculate(v,v,v,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,v){if(r.kind==="source"){var _=r.evaluate(a,u,c,h,v);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}(Ne),$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 qi=function(e){this.specification=e};qi.prototype.possiblyEvaluate=function(e,t,r,a){return!!e.expression.evaluate(t,null,{},r,a)},qi.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 Ei(r);this.defaultTransitioningPropertyValues[t]=u.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=a.possiblyEvaluate({})}};Ve("DataDrivenProperty",Ne),Ve("DataConstantProperty",Ze),Ve("CrossFadedDataDrivenProperty",cs),Ve("CrossFadedProperty",$r),Ve("ColorRampProperty",qi);var Xi=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 Ni(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 Sr(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(rp,"layers."+this.id+".paint."+r,r,a,u))return!1;if(Sr(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",v=c.value.isDataDriven(),_=c.value;this._transitionablePaint.setValue(r,a),this._handleSpecialPaintPropertyUpdate(r);var x=this._transitionablePaint._values[r].value;return x.isDataDriven()||v||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),Xr(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&&no(a.property.specification)&&(a.value.kind==="source"||a.value.kind==="composite")&&a.value.isStateDependent)return!0}return!1},t}(te),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 Er(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=Bu(r,Math.max(t,c)),v=u.components||1;return a=Math.max(a,c),r+=c*v,{name:u.name,type:u.type,components:v,offset:h}}),size:Bu(r,Math.max(a,t)),alignment:t}}function Bu(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 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.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);uo.prototype.bytesPerElement=4,Ve("StructArrayLayout2i4",uo);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 v=4*r;return this.int16[v+0]=a,this.int16[v+1]=u,this.int16[v+2]=c,this.int16[v+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,v){var _=this.length;return this.resize(_+1),this.emplace(_,r,a,u,c,h,v)},t.prototype.emplace=function(r,a,u,c,h,v,_){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]=v,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,v){var _=this.length;return this.resize(_+1),this.emplace(_,r,a,u,c,h,v)},t.prototype.emplace=function(r,a,u,c,h,v,_){var x=4*r,S=8*r;return this.int16[x+0]=a,this.int16[x+1]=u,this.uint8[S+4]=c,this.uint8[S+5]=h,this.uint8[S+6]=v,this.uint8[S+7]=_,r},t}(kt);ui.prototype.bytesPerElement=8,Ve("StructArrayLayout2i4ub8",ui);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){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);Uo.prototype.bytesPerElement=8,Ve("StructArrayLayout2f8",Uo);var Ki=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,v,_,x,S,T){var E=this.length;return this.resize(E+1),this.emplace(E,r,a,u,c,h,v,_,x,S,T)},t.prototype.emplace=function(r,a,u,c,h,v,_,x,S,T,E){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]=v,this.uint16[k+5]=_,this.uint16[k+6]=x,this.uint16[k+7]=S,this.uint16[k+8]=T,this.uint16[k+9]=E,r},t}(kt);Ki.prototype.bytesPerElement=20,Ve("StructArrayLayout10ui20",Ki);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,v,_,x,S,T,E,k){var U=this.length;return this.resize(U+1),this.emplace(U,r,a,u,c,h,v,_,x,S,T,E,k)},t.prototype.emplace=function(r,a,u,c,h,v,_,x,S,T,E,k,U){var N=12*r;return this.int16[N+0]=a,this.int16[N+1]=u,this.int16[N+2]=c,this.int16[N+3]=h,this.uint16[N+4]=v,this.uint16[N+5]=_,this.uint16[N+6]=x,this.uint16[N+7]=S,this.int16[N+8]=T,this.int16[N+9]=E,this.int16[N+10]=k,this.int16[N+11]=U,r},t}(kt);hs.prototype.bytesPerElement=24,Ve("StructArrayLayout4i4ui4i24",hs);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,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);No.prototype.bytesPerElement=12,Ve("StructArrayLayout3f12",No);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.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);Aa.prototype.bytesPerElement=4,Ve("StructArrayLayout1ul4",Aa);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,v,_,x,S){var T=this.length;return this.resize(T+1),this.emplace(T,r,a,u,c,h,v,_,x,S)},t.prototype.emplace=function(r,a,u,c,h,v,_,x,S,T){var E=10*r,k=5*r;return this.int16[E+0]=a,this.int16[E+1]=u,this.int16[E+2]=c,this.int16[E+3]=h,this.int16[E+4]=v,this.int16[E+5]=_,this.uint32[k+3]=x,this.uint16[E+8]=S,this.uint16[E+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,v){var _=this.length;return this.resize(_+1),this.emplace(_,r,a,u,c,h,v)},t.prototype.emplace=function(r,a,u,c,h,v,_){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]=v,this.int16[x+5]=_,r},t}(kt);qo.prototype.bytesPerElement=12,Ve("StructArrayLayout2i2i2i12",qo);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.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,h){var v=this.length;return this.resize(v+1),this.emplace(v,r,a,u,c,h)},t.prototype.emplace=function(r,a,u,c,h,v){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]=v,r},t}(kt);co.prototype.bytesPerElement=16,Ve("StructArrayLayout2f1f2i16",co);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 v=12*r,_=3*r;return this.uint8[v+0]=a,this.uint8[v+1]=u,this.float32[_+1]=c,this.float32[_+2]=h,r},t}(kt);xl.prototype.bytesPerElement=12,Ve("StructArrayLayout2ub2f12",xl);var Cn=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);Cn.prototype.bytesPerElement=6,Ve("StructArrayLayout3ui6",Cn);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.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,v,_,x,S,T,E,k,U,N,J,H,re){var oe=this.length;return this.resize(oe+1),this.emplace(oe,r,a,u,c,h,v,_,x,S,T,E,k,U,N,J,H,re)},t.prototype.emplace=function(r,a,u,c,h,v,_,x,S,T,E,k,U,N,J,H,re,oe){var se=24*r,ce=12*r,ye=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]=v,this.uint32[ce+3]=_,this.uint32[ce+4]=x,this.uint16[se+10]=S,this.uint16[se+11]=T,this.uint16[se+12]=E,this.float32[ce+7]=k,this.float32[ce+8]=U,this.uint8[ye+36]=N,this.uint8[ye+37]=J,this.uint8[ye+38]=H,this.uint32[ce+10]=re,this.int16[se+22]=oe,r},t}(kt);Pn.prototype.bytesPerElement=48,Ve("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Pn);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,v,_,x,S,T,E,k,U,N,J,H,re,oe,se,ce,ye,Se,Ae,$e,ke,We,ze,lt){var Qe=this.length;return this.resize(Qe+1),this.emplace(Qe,r,a,u,c,h,v,_,x,S,T,E,k,U,N,J,H,re,oe,se,ce,ye,Se,Ae,$e,ke,We,ze,lt)},t.prototype.emplace=function(r,a,u,c,h,v,_,x,S,T,E,k,U,N,J,H,re,oe,se,ce,ye,Se,Ae,$e,ke,We,ze,lt,Qe){var qe=34*r,ct=17*r;return this.int16[qe+0]=a,this.int16[qe+1]=u,this.int16[qe+2]=c,this.int16[qe+3]=h,this.int16[qe+4]=v,this.int16[qe+5]=_,this.int16[qe+6]=x,this.int16[qe+7]=S,this.uint16[qe+8]=T,this.uint16[qe+9]=E,this.uint16[qe+10]=k,this.uint16[qe+11]=U,this.uint16[qe+12]=N,this.uint16[qe+13]=J,this.uint16[qe+14]=H,this.uint16[qe+15]=re,this.uint16[qe+16]=oe,this.uint16[qe+17]=se,this.uint16[qe+18]=ce,this.uint16[qe+19]=ye,this.uint16[qe+20]=Se,this.uint16[qe+21]=Ae,this.uint16[qe+22]=$e,this.uint32[ct+12]=ke,this.float32[ct+13]=We,this.float32[ct+14]=ze,this.float32[ct+15]=lt,this.float32[ct+16]=Qe,r},t}(kt);fs.prototype.bytesPerElement=68,Ve("StructArrayLayout8i15ui1ul4f68",fs);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.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);kn.prototype.bytesPerElement=4,Ve("StructArrayLayout1f4",kn);var Ci=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);Ci.prototype.bytesPerElement=6,Ve("StructArrayLayout3i6",Ci);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 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.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);Ea.prototype.bytesPerElement=4,Ve("StructArrayLayout2ui4",Ea);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 v=4*r;return this.float32[v+0]=a,this.float32[v+1]=u,this.float32[v+2]=c,this.float32[v+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}(Pn);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 y=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}(kn);Ve("GlyphOffsetArray",y);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}(Ci);Ve("SymbolLineVertexArray",g);var w=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);w.prototype.size=8;var A=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 w(this,r)},t}(bl);Ve("FeatureIndexArray",A);var z=Er([{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=je(Math.floor(e),0,255))+je(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 $=Er([{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,v,_,x,S;for(u=t.length-(a=3&t.length),c=r,v=3432918353,_=461845907,S=0;S<u;)x=255&t.charCodeAt(S)|(255&t.charCodeAt(++S))<<8|(255&t.charCodeAt(++S))<<16|(255&t.charCodeAt(++S))<<24,++S,c=27492+(65535&(h=5*(65535&(c=(c^=x=(65535&(x=(x=(65535&x)*v+(((x>>>16)*v&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(S+2))<<16;case 2:x^=(255&t.charCodeAt(S+1))<<8;case 1:c^=x=(65535&(x=(x=(65535&(x^=255&t.charCodeAt(S)))*v+(((x>>>16)*v&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}}),K=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=K;V.murmur3=q,V.murmur2=X;var ee=function(){this.ids=[],this.positions=[],this.indexed=!1};ee.prototype.add=function(e,t,r,a){this.ids.push(pe(e)),this.positions.push(t,r,a)},ee.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},ee.serialize=function(e,t){var r=new Float64Array(e.ids),a=new Uint32Array(e.positions);return function u(c,h,v,_){for(;v<_;){for(var x=c[v+_>>1],S=v-1,T=_+1;;){do S++;while(c[S]<x);do T--;while(c[T]>x);if(S>=T)break;ue(c,S,T),ue(h,3*S,3*T),ue(h,3*S+1,3*T+1),ue(h,3*S+2,3*T+2)}T-v<_-T?(u(c,h,v,T),v=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}},ee.deserialize=function(e){var t=new ee;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t};var ie=Math.pow(2,53)-1;function pe(e){var t=+e;return!isNaN(t)&&t<=ie?t:V(String(e))}function ue(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}Ve("FeaturePositionMap",ee);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),De=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=Et.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),Xe=new Float32Array(16),bt=function(e){function t(r,a){e.call(this,r,a),this.current=Xe}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 Fe(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=Fe(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),v=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(v,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=Fe(r),c=Fe(a),h=e;h<t;h++)this.paintVertexArray.emplace(h,u[0],u[1],c[0],c[1]);else{for(var v=e;v<t;v++)this.paintVertexArray.emplace(v,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=je(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 v=e;v<t;v++)this.zoomInPaintVertexArray.emplace(v,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(v,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&&no(c.property.specification)){var h=_r(u,e.type),v=c.value,_=c.property.specification.type,x=c.property.useIntegerZoom,S=c.property.specification["property-type"],T=S==="cross-faded"||S==="cross-faded-data-driven";if(v.kind==="constant")this.binders[u]=T?new st(v.value,h):new nt(v.value,h,_),a.push("/u_"+u);else if(v.kind==="source"||T){var E=Qt(u,_,"source");this.binders[u]=T?new at(v,_,x,t,E,e.id):new it(v,h,_,E),a.push("/a_"+u)}else{var k=Qt(u,_,"composite");this.binders[u]=new rt(v,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 v=0,_=t.getPositions(h);v<_.length;v+=1){var x=_[v],S=r.feature(x.index);for(var T in this.binders){var E=this.binders[T];if((E instanceof it||E instanceof rt||E instanceof at)&&E.expression.isStateDependent===!0){var k=a.paint.get(T);E.expression=k.value,E.updatePaintArray(x.start,x.end,S,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 v=h[c];if(t[v]){var _=u.getBinding(e,t[v],v);r.push({name:v,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],v=h.name,_=h.property;this.binders[_].setUniform(h.binding,a,r.get(_),v)}},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 ee,this._bufferOffset=0};function _r(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:Uo,composite:ds},number:{source:kn,composite:Uo}},u=function(c){return{"line-pattern":{source:Ki,composite:Ki},"fill-pattern":{source:Ki,composite:Ki},"fill-extrusion-pattern":{source:Ki,composite:Ki}}[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 Jt(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],v=Math.round(h.x*t),_=Math.round(h.y*t);h.x=je(v,Cr,Rr),h.y=je(_,Cr,Rr),(v<h.x||v>h.x+1||_<h.y||_>h.y+1)&&Lt("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function or(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?Jt(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 uo,this.indexArray=new Cn,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 Mn(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)||!!zn(t,e,r)}function ji(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 Pi(e,t,r){if(e.length>1){if(Ca(e,t))return!0;for(var a=0;a<t.length;a++)if(zn(t[a],e,r))return!0}for(var u=0;u<e.length;u++)if(zn(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 zn(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 v=0,_=(r=e[h]).length-1;v<r.length;_=v++)(a=r[v]).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 Yi(e,t,r){var a=t.paint.get(e).value;return a.kind==="constant"?a.value:r.programConfigurations.get(t.id).getMaxValue(e)}function xr(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=[],v=0;v<e.length;v++)h.push(e[v].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,v=e;h<v.length;h+=1){var _=v[h],x=_.feature,S=_.id,T=_.index,E=_.sourceLayerIndex,k=this.layers[0]._featureFilter.needGeometry,U=or(x,k);if(this.layers[0]._featureFilter.filter(new ht(this.zoom),U,r)){var N=c?c.evaluate(U,{},r):void 0,J={id:S,properties:x.properties,type:x.type,sourceLayerIndex:E,index:T,geometry:k?U.geometry:Jt(x),patterns:{},sortKey:N};u.push(J)}}c&&u.sort(function(Ae,$e){return Ae.sortKey-$e.sortKey});for(var H=0,re=u;H<re.length;H+=1){var oe=re[H],se=oe.geometry,ce=oe.index,ye=oe.sourceLayerIndex,Se=e[ce].feature;this.addFeature(oe,se,ce,r),t.featureIndex.insert(Se,se,ce,ye,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,v=c[u];h<v.length;h+=1){var _=v[h],x=_.x,S=_.y;if(!(x<0||x>=8192||S<0||S>=8192)){var T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),E=T.vertexLength;ci(this.layoutVertexArray,x,S,-1,-1),ci(this.layoutVertexArray,x,S,1,-1),ci(this.layoutVertexArray,x,S,1,1),ci(this.layoutVertexArray,x,S,-1,1),this.indexArray.emplaceBack(E,E+1,E+2),this.indexArray.emplaceBack(E,E+3,E+2),T.vertexLength+=4,T.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},a)},Ve("CircleBucket",Zr,{omit:["layers"]});var Bn=new Lr({"circle-sort-key":new Ne(B.layout_circle["circle-sort-key"])}),po={paint:new Lr({"circle-radius":new Ne(B.paint_circle["circle-radius"]),"circle-color":new Ne(B.paint_circle["circle-color"]),"circle-blur":new Ne(B.paint_circle["circle-blur"]),"circle-opacity":new Ne(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 Ne(B.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ne(B.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ne(B.paint_circle["circle-stroke-opacity"])}),layout:Bn},Ct=typeof Float32Array<"u"?Float32Array:Array;function mi(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],v=t[4],_=t[5],x=t[6],S=t[7],T=t[8],E=t[9],k=t[10],U=t[11],N=t[12],J=t[13],H=t[14],re=t[15],oe=r[0],se=r[1],ce=r[2],ye=r[3];return e[0]=oe*a+se*v+ce*T+ye*N,e[1]=oe*u+se*_+ce*E+ye*J,e[2]=oe*c+se*x+ce*k+ye*H,e[3]=oe*h+se*S+ce*U+ye*re,e[4]=(oe=r[4])*a+(se=r[5])*v+(ce=r[6])*T+(ye=r[7])*N,e[5]=oe*u+se*_+ce*E+ye*J,e[6]=oe*c+se*x+ce*k+ye*H,e[7]=oe*h+se*S+ce*U+ye*re,e[8]=(oe=r[8])*a+(se=r[9])*v+(ce=r[10])*T+(ye=r[11])*N,e[9]=oe*u+se*_+ce*E+ye*J,e[10]=oe*c+se*x+ce*k+ye*H,e[11]=oe*h+se*S+ce*U+ye*re,e[12]=(oe=r[12])*a+(se=r[13])*v+(ce=r[14])*T+(ye=r[15])*N,e[13]=oe*u+se*_+ce*E+ye*J,e[14]=oe*c+se*x+ce*k+ye*H,e[15]=oe*h+se*S+ce*U+ye*re,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 ho,ip=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}ho=new Ct(3),Ct!=Float32Array&&(ho[0]=0,ho[1]=0,ho[2]=0),function(){var e=new Ct(4);Ct!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0)}();var np=(function(){var e=new Ct(2);Ct!=Float32Array&&(e[0]=0,e[1]=0)}(),function(e){function t(r){e.call(this,r,po)}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 Yi("circle-radius",this,a)+Yi("circle-stroke-width",this,a)+xr(this.paint.get("circle-translate"))},t.prototype.queryIntersectsFeature=function(r,a,u,c,h,v,_,x){for(var S=cn(r,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),v.angle,_),T=this.paint.get("circle-radius").evaluate(a,u)+this.paint.get("circle-stroke-width").evaluate(a,u),E=this.paint.get("circle-pitch-alignment")==="map",k=E?S:function(Se,Ae){return Se.map(function($e){return Ma($e,Ae)})}(S,x),U=E?T*_:T,N=0,J=c;N<J.length;N+=1)for(var H=0,re=J[N];H<re.length;H+=1){var oe=re[H],se=E?oe:Ma(oe,x),ce=U,ye=ms([],[oe.x,oe.y,0,1],x);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?ce*=ye[3]/v.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(ce*=v.cameraToCenterDistance/ye[3]),Qr(k,se,ce))return!0}return!1},t}(Xi));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 Du=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);op(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 op(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,v=t.data,_=0;_<u.height;_++)for(var x=((r.y+_)*e.width+r.x)*c,S=((a.y+_)*t.width+a.x)*c,T=0;T<u.width*c;T++)v[S+T]=h[x+T];return t}Ve("HeatmapBucket",Du,{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){op(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){op(e,t,r,a,u,4)},Ve("AlphaImage",za),Ve("RGBAImage",pi);var Sg={paint:new Lr({"heatmap-radius":new Ne(B.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ne(B.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ze(B.paint_heatmap["heatmap-intensity"]),"heatmap-color":new qi(B.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ze(B.paint_heatmap["heatmap-opacity"])})};function Cf(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(U,N,J){t[e.evaluationKey]=J;var H=e.expression.evaluate(t);u.data[U+N+0]=Math.floor(255*H.r/H.a),u.data[U+N+1]=Math.floor(255*H.g/H.a),u.data[U+N+2]=Math.floor(255*H.b/H.a),u.data[U+N+3]=Math.floor(255*H.a)};if(e.clips)for(var h=0,v=0;h<a;++h,v+=4*r)for(var _=0,x=0;_<r;_++,x+=4){var S=_/(r-1),T=e.clips[h];c(v,x,T.start*(1-S)+T.end*S)}else for(var E=0,k=0;E<r;E++,k+=4)c(0,k,E/(r-1));return u}var Tg=function(e){function t(r){e.call(this,r,Sg),this._updateColorRamp()}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new Du(r)},t.prototype._handleSpecialPaintPropertyUpdate=function(r){r==="heatmap-color"&&this._updateColorRamp()},t.prototype._updateColorRamp=function(){this.colorRamp=Cf({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}(Xi),Ig={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"])})},Ag=function(e){function t(r){e.call(this,r,Ig)}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}(Xi),Eg=Er([{name:"a_pos",components:2,type:"Int16"}],4).members,ap=Lu,Cg=Lu;function Lu(e,t,r){r=r||2;var a,u,c,h,v,_,x,S=t&&t.length,T=S?t[0]*r:e.length,E=Pf(e,0,T,r,!0),k=[];if(!E||E.next===E.prev)return k;if(S&&(E=function(N,J,H,re){var oe,se,ce,ye=[];for(oe=0,se=J.length;oe<se;oe++)(ce=Pf(N,J[oe]*re,oe<se-1?J[oe+1]*re:N.length,re,!1))===ce.next&&(ce.steiner=!0),ye.push(Rg(ce));for(ye.sort(Bg),oe=0;oe<ye.length;oe++)Dg(ye[oe],H),H=Go(H,H.next);return H}(e,t,E,r)),e.length>80*r){a=c=e[0],u=h=e[1];for(var U=r;U<T;U+=r)(v=e[U])<a&&(a=v),(_=e[U+1])<u&&(u=_),v>c&&(c=v),_>h&&(h=_);x=(x=Math.max(c-a,h-u))!==0?1/x:0}return Sl(E,k,r,a,u,x),k}function Pf(e,t,r,a,u){var c,h;if(u===up(e,t,r,a)>0)for(c=t;c<r;c+=a)h=zf(c,e[c],e[c+1],h);else for(c=r-a;c>=t;c-=a)h=zf(c,e[c],e[c+1],h);return h&&Ru(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||!Ru(a,a.next)&&mr(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(S,T,E,k){var U=S;do U.z===null&&(U.z=sp(U.x,U.y,T,E,k)),U.prevZ=U.prev,U.nextZ=U.next,U=U.next;while(U!==S);U.prevZ.nextZ=null,U.prevZ=null,function(N){var J,H,re,oe,se,ce,ye,Se,Ae=1;do{for(H=N,N=null,se=null,ce=0;H;){for(ce++,re=H,ye=0,J=0;J<Ae&&(ye++,re=re.nextZ);J++);for(Se=Ae;ye>0||Se>0&&re;)ye!==0&&(Se===0||!re||H.z<=re.z)?(oe=H,H=H.nextZ,ye--):(oe=re,re=re.nextZ,Se--),se?se.nextZ=oe:N=oe,oe.prevZ=se,se=oe;H=re}se.nextZ=null,Ae*=2}while(ce>1)}(U)}(e,a,u,c);for(var v,_,x=e;e.prev!==e.next;)if(v=e.prev,_=e.next,c?kg(e,a,u,c):Pg(e))t.push(v.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=Mg(Go(e),t,r),t,r,a,u,c,2):h===2&&zg(e,t,r,a,u,c):Sl(Go(e),t,r,a,u,c,1);break}}}function Pg(e){var t=e.prev,r=e,a=e.next;if(mr(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)&&mr(u.prev,u,u.next)>=0)return!1;u=u.next}return!0}function kg(e,t,r,a){var u=e.prev,c=e,h=e.next;if(mr(u,c,h)>=0)return!1;for(var v=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=sp(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),S=sp(v,_,t,r,a),T=e.prevZ,E=e.nextZ;T&&T.z>=x&&E&&E.z<=S;){if(T!==e.prev&&T!==e.next&&vs(u.x,u.y,c.x,c.y,h.x,h.y,T.x,T.y)&&mr(T.prev,T,T.next)>=0||(T=T.prevZ,E!==e.prev&&E!==e.next&&vs(u.x,u.y,c.x,c.y,h.x,h.y,E.x,E.y)&&mr(E.prev,E,E.next)>=0))return!1;E=E.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)&&mr(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;E&&E.z<=S;){if(E!==e.prev&&E!==e.next&&vs(u.x,u.y,c.x,c.y,h.x,h.y,E.x,E.y)&&mr(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function Mg(e,t,r){var a=e;do{var u=a.prev,c=a.next.next;!Ru(u,c)&&kf(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 zg(e,t,r,a,u,c){var h=e;do{for(var v=h.next.next;v!==h.prev;){if(h.i!==v.i&&Fg(h,v)){var _=Mf(h,v);return h=Go(h,h.next),_=Go(_,_.next),Sl(h,t,r,a,u,c),void Sl(_,t,r,a,u,c)}v=v.next}h=h.next}while(h!==e)}function Bg(e,t){return e.x-t.x}function Dg(e,t){if(t=function(a,u){var c,h=u,v=a.x,_=a.y,x=-1/0;do{if(_<=h.y&&_>=h.next.y&&h.next.y!==h.y){var S=h.x+(_-h.y)*(h.next.x-h.x)/(h.next.y-h.y);if(S<=v&&S>x){if(x=S,S===v){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(v===x)return c;var T,E=c,k=c.x,U=c.y,N=1/0;h=c;do v>=h.x&&h.x>=k&&v!==h.x&&vs(_<U?v:x,_,k,U,_<U?x:v,_,h.x,h.y)&&(T=Math.abs(_-h.y)/(v-h.x),Tl(h,a)&&(T<N||T===N&&(h.x>c.x||h.x===c.x&&Lg(c,h)))&&(c=h,N=T)),h=h.next;while(h!==E);return c}(e,t)){var r=Mf(t,e);Go(t,t.next),Go(r,r.next)}}function Lg(e,t){return mr(e.prev,e,t.prev)<0&&mr(t.next,e,e.next)<0}function sp(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 Rg(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,v){return(u-h)*(t-v)-(e-h)*(c-v)>=0&&(e-h)*(a-v)-(r-h)*(t-v)>=0&&(r-h)*(c-v)-(u-h)*(a-v)>=0}function Fg(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&&kf(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,v=(r.y+a.y)/2;do u.y>v!=u.next.y>v&&u.next.y!==u.y&&h<(u.next.x-u.x)*(v-u.y)/(u.next.y-u.y)+u.x&&(c=!c),u=u.next;while(u!==r);return c}(e,t)&&(mr(e.prev,e,t.prev)||mr(e,t.prev,t))||Ru(e,t)&&mr(e.prev,e,e.next)>0&&mr(t.prev,t,t.next)>0)}function mr(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Ru(e,t){return e.x===t.x&&e.y===t.y}function kf(e,t,r,a){var u=Ou(mr(e,t,r)),c=Ou(mr(e,t,a)),h=Ou(mr(r,a,e)),v=Ou(mr(r,a,t));return u!==c&&h!==v||!(u!==0||!Fu(e,r,t))||!(c!==0||!Fu(e,a,t))||!(h!==0||!Fu(r,e,a))||!(v!==0||!Fu(r,t,a))}function Fu(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 Ou(e){return e>0?1:e<0?-1:0}function Tl(e,t){return mr(e.prev,e,e.next)<0?mr(e,t,e.next)>=0&&mr(e,e.prev,t)>=0:mr(e,t,e.prev)<0||mr(e,e.next,t)<0}function Mf(e,t){var r=new lp(e.i,e.x,e.y),a=new lp(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 zf(e,t,r,a){var u=new lp(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 lp(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 up(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 Og(e,t,r,a,u){(function c(h,v,_,x,S){for(;x>_;){if(x-_>600){var T=x-_+1,E=v-_+1,k=Math.log(T),U=.5*Math.exp(2*k/3),N=.5*Math.sqrt(k*U*(T-U)/T)*(E-T/2<0?-1:1);c(h,v,Math.max(_,Math.floor(v-E*U/T+N)),Math.min(x,Math.floor(v+(T-E)*U/T+N)),S)}var J=h[v],H=_,re=x;for(Al(h,_,v),S(h[x],J)>0&&Al(h,_,x);H<re;){for(Al(h,H,re),H++,re--;S(h[H],J)<0;)H++;for(;S(h[re],J)>0;)re--}S(h[_],J)===0?Al(h,_,re):Al(h,++re,x),re<=v&&(_=re+1),v<=re&&(x=re-1)}})(e,t,r,a||e.length-1,u||Vg)}function Al(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function Vg(e,t){return e<t?-1:e>t?1:0}function cp(e,t){var r=e.length;if(r<=1)return[e];for(var a,u,c=[],h=0;h<r;h++){var v=To(e[h]);v!==0&&(e[h].area=Math.abs(v),u===void 0&&(u=v<0),u===v<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||(Og(c[_],t,1,c[_].length-1,Ug),c[_]=c[_].slice(0,t));return c}function Ug(e,t){return t.area-e.area}function pp(e,t,r){for(var a=r.patternDependencies,u=!1,c=0,h=t;c<h.length;c+=1){var v=h[c].paint.get(e+"-pattern");v.isConstant()||(u=!0);var _=v.constantOr(null);_&&(u=!0,a[_.to]=!0,a[_.from]=!0)}return u}function hp(e,t,r,a,u){for(var c=u.patternDependencies,h=0,v=t;h<v.length;h+=1){var _=v[h],x=_.paint.get(e+"-pattern").value;if(x.kind!=="constant"){var S=x.evaluate({zoom:a-1},r,{},u.availableImages),T=x.evaluate({zoom:a},r,{},u.availableImages),E=x.evaluate({zoom:a+1},r,{},u.availableImages);T=T&&T.name?T.name:T,E=E&&E.name?E.name:E,c[S=S&&S.name?S.name:S]=!0,c[T]=!0,c[E]=!0,r.patterns[_.id]={min:S,mid:T,max:E}}}return r}Lu.deviation=function(e,t,r,a){var u=t&&t.length,c=Math.abs(up(e,0,u?t[0]*r:e.length,r));if(u)for(var h=0,v=t.length;h<v;h++)c-=Math.abs(up(e,t[h]*r,h<v-1?t[h+1]*r:e.length,r));var _=0;for(h=0;h<a.length;h+=3){var x=a[h]*r,S=a[h+1]*r,T=a[h+2]*r;_+=Math.abs((e[x]-e[T])*(e[S+1]-e[x+1])-(e[x]-e[S])*(e[T+1]-e[x+1]))}return c===0&&_===0?0:Math.abs((_-c)/c)},Lu.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},ap.default=Cg;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 uo,this.indexArray=new Cn,this.indexArray2=new Ea,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=pp("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 v=h[c],_=v.feature,x=v.id,S=v.index,T=v.sourceLayerIndex,E=this.layers[0]._featureFilter.needGeometry,k=or(_,E);if(this.layers[0]._featureFilter.filter(new ht(this.zoom),k,r)){var U=a?a.evaluate(k,{},r,t.availableImages):void 0,N={id:x,properties:_.properties,type:_.type,sourceLayerIndex:T,index:S,geometry:E?k.geometry:Jt(_),patterns:{},sortKey:U};u.push(N)}}a&&u.sort(function(Se,Ae){return Se.sortKey-Ae.sortKey});for(var J=0,H=u;J<H.length;J+=1){var re=H[J],oe=re.geometry,se=re.index,ce=re.sourceLayerIndex;if(this.hasPattern){var ye=hp("fill",this.layers,re,this.zoom,t);this.patternFeatures.push(ye)}else this.addFeature(re,oe,se,r,{});t.featureIndex.insert(e[se].feature,oe,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,Eg),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=cp(t,500);c<h.length;c+=1){for(var v=h[c],_=0,x=0,S=v;x<S.length;x+=1)_+=S[x].length;for(var T=this.segments.prepareSegment(_,this.layoutVertexArray,this.indexArray),E=T.vertexLength,k=[],U=[],N=0,J=v;N<J.length;N+=1){var H=J[N];if(H.length!==0){H!==v[0]&&U.push(k.length/2);var re=this.segments2.prepareSegment(H.length,this.layoutVertexArray,this.indexArray2),oe=re.vertexLength;this.layoutVertexArray.emplaceBack(H[0].x,H[0].y),this.indexArray2.emplaceBack(oe+H.length-1,oe),k.push(H[0].x),k.push(H[0].y);for(var se=1;se<H.length;se++)this.layoutVertexArray.emplaceBack(H[se].x,H[se].y),this.indexArray2.emplaceBack(oe+se-1,oe+se),k.push(H[se].x),k.push(H[se].y);re.vertexLength+=H.length,re.primitiveLength+=H.length}}for(var ce=ap(k,U),ye=0;ye<ce.length;ye+=3)this.indexArray.emplaceBack(E+ce[ye],E+ce[ye+1],E+ce[ye+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 Ng=new Lr({"fill-sort-key":new Ne(B.layout_fill["fill-sort-key"])}),qg={paint:new Lr({"fill-antialias":new Ze(B.paint_fill["fill-antialias"]),"fill-opacity":new Ne(B.paint_fill["fill-opacity"]),"fill-color":new Ne(B.paint_fill["fill-color"]),"fill-outline-color":new Ne(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:Ng},jg=function(e){function t(r){e.call(this,r,qg)}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 xr(this.paint.get("fill-translate"))},t.prototype.queryIntersectsFeature=function(r,a,u,c,h,v,_){return ji(cn(r,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),v.angle,_),c)},t.prototype.isTileClipped=function(){return!0},t}(Xi),$g=Er([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,Bf=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(Zg,this,t)}function Zg(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()],v=u._values[a.readVarint()];u.properties[h]=v}}(r,t):e==3?t.type=r.readVarint():e==4&&(t._geometry=r.pos)}function Gg(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,v=[];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&&v.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&&v.push(t),v},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,v=-1/0,_=1/0,x=-1/0;e.pos<t;){if(a<=0){var S=e.readVarint();r=7&S,a=S>>3}if(a--,r===1||r===2)(u+=e.readSVarint())<h&&(h=u),u>v&&(v=u),(c+=e.readSVarint())<_&&(_=c),c>x&&(x=c);else if(r!==7)throw new Error("unknown command "+r)}return[h,_,v,x]},gs.prototype.toGeoJSON=function(e,t,r){var a,u,c=this.extent*Math.pow(2,r),h=this.extent*e,v=this.extent*t,_=this.loadGeometry(),x=gs.types[this.type];function S(k){for(var U=0;U<k.length;U++){var N=k[U];k[U]=[360*(N.x+h)/c-180,360/Math.PI*Math.atan(Math.exp((180-360*(N.y+v)/c)*Math.PI/180))-90]}}switch(this.type){case 1:var T=[];for(a=0;a<_.length;a++)T[a]=_[a][0];S(_=T);break;case 2:for(a=0;a<_.length;a++)S(_[a]);break;case 3:for(_=function(k){var U=k.length;if(U<=1)return[k];for(var N,J,H=[],re=0;re<U;re++){var oe=Gg(k[re]);oe!==0&&(J===void 0&&(J=oe<0),J===oe<0?(N&&H.push(N),N=[k[re]]):N.push(k[re]))}return N&&H.push(N),H}(_),a=0;a<_.length;a++)for(u=0;u<_[a].length;u++)S(_[a][u])}_.length===1?_=_[0]:x="Multi"+x;var E={type:"Feature",geometry:{type:x,coordinates:_},properties:this.properties};return"id"in this&&(E.id=this.id),E};var Df=Lf;function Lf(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(Wg,this,t),this.length=this._features.length}function Wg(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 Hg(e,t,r){if(e===3){var a=new Df(r,r.readVarint()+r.pos);a.length&&(t[a.name]=a)}}Lf.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 Bf(this._pbf,t,this.extent,this._keys,this._values)};var _s={VectorTile:function(e,t){this.layers=e.readFields(Hg,{},t)},VectorTileFeature:Bf,VectorTileLayer:Df},Xg=_s.VectorTileFeature.types,fp=Math.pow(2,13);function El(e,t,r,a,u,c,h,v){e.emplaceBack(t,r,2*Math.floor(a*fp)+h,u*fp*2,c*fp*2,Math.round(v))}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 Cn,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 Kg(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=pp("fill-extrusion",this.layers,t);for(var a=0,u=e;a<u.length;a+=1){var c=u[a],h=c.feature,v=c.id,_=c.index,x=c.sourceLayerIndex,S=this.layers[0]._featureFilter.needGeometry,T=or(h,S);if(this.layers[0]._featureFilter.filter(new ht(this.zoom),T,r)){var E={id:v,sourceLayerIndex:x,index:_,geometry:S?T.geometry:Jt(h),properties:h.properties,type:h.type,patterns:{}};this.hasPattern?this.features.push(hp("fill-extrusion",this.layers,E,this.zoom,t)):this.addFeature(E,E.geometry,_,r,{}),t.featureIndex.insert(h,E.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,$g),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=cp(t,500);c<h.length;c+=1){for(var v=h[c],_=0,x=0,S=v;x<S.length;x+=1)_+=S[x].length;for(var T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),E=0,k=v;E<k.length;E+=1){var U=k[E];if(U.length!==0&&!((ct=U).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 N=0,J=0;J<U.length;J++){var H=U[J];if(J>=1){var re=U[J-1];if(!Kg(H,re)){T.vertexLength+4>D.MAX_VERTEX_ARRAY_LENGTH&&(T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var oe=H.sub(re)._perp()._unit(),se=re.dist(H);N+se>32768&&(N=0),El(this.layoutVertexArray,H.x,H.y,oe.x,oe.y,0,0,N),El(this.layoutVertexArray,H.x,H.y,oe.x,oe.y,0,1,N),El(this.layoutVertexArray,re.x,re.y,oe.x,oe.y,0,0,N+=se),El(this.layoutVertexArray,re.x,re.y,oe.x,oe.y,0,1,N);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)),Xg[e.type]==="Polygon"){for(var ye=[],Se=[],Ae=T.vertexLength,$e=0,ke=v;$e<ke.length;$e+=1){var We=ke[$e];if(We.length!==0){We!==v[0]&&Se.push(ye.length/2);for(var ze=0;ze<We.length;ze++){var lt=We[ze];El(this.layoutVertexArray,lt.x,lt.y,0,0,1,1,0),ye.push(lt.x),ye.push(lt.y)}}}for(var Qe=ap(ye,Se),qe=0;qe<Qe.length;qe+=3)this.indexArray.emplaceBack(Ae+Qe[qe],Ae+Qe[qe+2],Ae+Qe[qe+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 Jg={paint:new Lr({"fill-extrusion-opacity":new Ze(B["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ne(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 Ne(B["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ne(B["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ze(B["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},Yg=function(e){function t(r){e.call(this,r,Jg)}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 xr(this.paint.get("fill-extrusion-translate"))},t.prototype.is3D=function(){return!0},t.prototype.queryIntersectsFeature=function(r,a,u,c,h,v,_,x){var S=cn(r,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),v.angle,_),T=this.paint.get("fill-extrusion-height").evaluate(a,u),E=this.paint.get("fill-extrusion-base").evaluate(a,u),k=function(N,J,H,re){for(var oe=[],se=0,ce=N;se<ce.length;se+=1){var ye=ce[se],Se=[ye.x,ye.y,0,1];ms(Se,Se,J),oe.push(new me(Se[0]/Se[3],Se[1]/Se[3]))}return oe}(S,x),U=function(N,J,H,re){for(var oe=[],se=[],ce=re[8]*J,ye=re[9]*J,Se=re[10]*J,Ae=re[11]*J,$e=re[8]*H,ke=re[9]*H,We=re[10]*H,ze=re[11]*H,lt=0,Qe=N;lt<Qe.length;lt+=1){for(var qe=[],ct=[],ot=0,xt=Qe[lt];ot<xt.length;ot+=1){var He=xt[ot],St=He.x,Wt=He.y,er=re[0]*St+re[4]*Wt+re[12],Yt=re[1]*St+re[5]*Wt+re[13],Ht=re[2]*St+re[6]*Wt+re[14],tr=re[3]*St+re[7]*Wt+re[15],br=Ht+Se,wr=tr+Ae,Wr=er+$e,kr=Yt+ke,Hr=Ht+We,ar=tr+ze,Mr=new me((er+ce)/wr,(Yt+ye)/wr);Mr.z=br/wr,qe.push(Mr);var ft=new me(Wr/ar,kr/ar);ft.z=Hr/ar,ct.push(ft)}oe.push(qe),se.push(ct)}return[oe,se]}(c,E,T,x);return function(N,J,H){var re=1/0;ji(H,J)&&(re=Rf(H,J[0]));for(var oe=0;oe<J.length;oe++)for(var se=J[oe],ce=N[oe],ye=0;ye<se.length-1;ye++){var Se=se[ye],Ae=[Se,se[ye+1],ce[ye+1],ce[ye],Se];Mn(H,Ae)&&(re=Math.min(re,Rf(H,Ae)))}return re!==1/0&&re}(U[0],U[1],k)},t}(Xi);function Cl(e,t){return e.x*t.x+e.y*t.y}function Rf(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],v=r.sub(u),_=c.sub(u),x=h.sub(u),S=Cl(v,v),T=Cl(v,_),E=Cl(_,_),k=Cl(x,v),U=Cl(x,_),N=S*E-T*T,J=(E*k-T*U)/N,H=(S*U-T*k)/N,re=u.z*(1-J-H)+r.z*J+c.z*H;if(isFinite(re))return re}return 1/0}for(var oe=1/0,se=0,ce=t;se<ce.length;se+=1)oe=Math.min(oe,ce[se].z);return oe}var Qg=Er([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,e_=Er([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,t_=_s.VectorTileFeature.types,r_=Math.cos(Math.PI/180*37.5),Ff=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 Uo,this.indexArray=new Cn,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=pp("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 v=h[c],_=v.feature,x=v.id,S=v.index,T=v.sourceLayerIndex,E=this.layers[0]._featureFilter.needGeometry,k=or(_,E);if(this.layers[0]._featureFilter.filter(new ht(this.zoom),k,r)){var U=a?a.evaluate(k,{},r):void 0,N={id:x,properties:_.properties,type:_.type,sourceLayerIndex:T,index:S,geometry:E?k.geometry:Jt(_),patterns:{},sortKey:U};u.push(N)}}a&&u.sort(function(Se,Ae){return Se.sortKey-Ae.sortKey});for(var J=0,H=u;J<H.length;J+=1){var re=H[J],oe=re.geometry,se=re.index,ce=re.sourceLayerIndex;if(this.hasPattern){var ye=hp("line",this.layers,re,this.zoom,t);this.patternFeatures.push(ye)}else this.addFeature(re,oe,se,r,{});t.featureIndex.insert(e[se].feature,oe,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,e_)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Qg),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,{}),v=c.get("line-cap"),_=c.get("line-miter-limit"),x=c.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(var S=0,T=t;S<T.length;S+=1)this.addLine(T[S],e,h,v,_,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 v=t_[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(!(_<(v?3:2))){r==="bevel"&&(u=1.05);var S,T=this.overscaling<=16?122880/(512*this.overscaling):0,E=this.segments.prepareSegment(10*_,this.layoutVertexArray,this.indexArray),k=void 0,U=void 0,N=void 0,J=void 0;this.e1=this.e2=-1,v&&(J=e[x].sub(S=e[_-2])._unit()._perp());for(var H=x;H<_;H++)if(!(U=H===_-1?v?e[x+1]:void 0:e[H+1])||!e[H].equals(U)){J&&(N=J),S&&(k=S),S=e[H],J=U?U.sub(S)._unit()._perp():N;var re=(N=N||J).add(J);re.x===0&&re.y===0||re._unit();var oe=N.x*J.x+N.y*J.y,se=re.x*J.x+re.y*J.y,ce=se!==0?1/se:1/0,ye=2*Math.sqrt(2-2*se),Se=se<r_&&k&&U,Ae=N.x*J.y-N.y*J.x>0;if(Se&&H>x){var $e=S.dist(k);if($e>2*T){var ke=S.sub(S.sub(k)._mult(T/$e)._round());this.updateDistance(k,ke),this.addCurrentVertex(ke,N,0,0,E),k=ke}}var We=k&&U,ze=We?r:v?"butt":a;if(We&&ze==="round"&&(ce<c?ze="miter":ce<=2&&(ze="fakeround")),ze==="miter"&&ce>u&&(ze="bevel"),ze==="bevel"&&(ce>2&&(ze="flipbevel"),ce<u&&(ze="miter")),k&&this.updateDistance(k,S),ze==="miter")re._mult(ce),this.addCurrentVertex(S,re,0,0,E);else if(ze==="flipbevel"){if(ce>100)re=J.mult(-1);else{var lt=ce*N.add(J).mag()/N.sub(J).mag();re._perp()._mult(lt*(Ae?-1:1))}this.addCurrentVertex(S,re,0,0,E),this.addCurrentVertex(S,re.mult(-1),0,0,E)}else if(ze==="bevel"||ze==="fakeround"){var Qe=-Math.sqrt(ce*ce-1),qe=Ae?Qe:0,ct=Ae?0:Qe;if(k&&this.addCurrentVertex(S,N,qe,ct,E),ze==="fakeround")for(var ot=Math.round(180*ye/Math.PI/20),xt=1;xt<ot;xt++){var He=xt/ot;if(He!==.5){var St=He-.5;He+=He*St*(He-1)*((1.0904+oe*(oe*(3.55645-1.43519*oe)-3.2452))*St*St+(.848013+oe*(.215638*oe-1.06021)))}var Wt=J.sub(N)._mult(He)._add(N)._unit()._mult(Ae?-1:1);this.addHalfVertex(S,Wt.x,Wt.y,!1,Ae,0,E)}U&&this.addCurrentVertex(S,J,-qe,-ct,E)}else if(ze==="butt")this.addCurrentVertex(S,re,0,0,E);else if(ze==="square"){var er=k?1:-1;this.addCurrentVertex(S,re,er,er,E)}else ze==="round"&&(k&&(this.addCurrentVertex(S,N,0,0,E),this.addCurrentVertex(S,N,1,1,E,!0)),U&&(this.addCurrentVertex(S,J,-1,-1,E,!0),this.addCurrentVertex(S,J,0,0,E)));if(Se&&H<_-1){var Yt=S.dist(U);if(Yt>2*T){var Ht=S.add(U.sub(S)._mult(T/Yt)._round());this.updateDistance(S,Ht),this.addCurrentVertex(Ht,J,0,0,E),S=Ht}}}}},ti.prototype.addCurrentVertex=function(e,t,r,a,u,c){c===void 0&&(c=!1);var h=t.y*a-t.x,v=-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,v,c,!0,-a,u),this.distance>Ff/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 v=.5*(this.lineClips?this.scaledDistance*(Ff-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&v)<<2,v>>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 i_=new Lr({"line-cap":new Ze(B.layout_line["line-cap"]),"line-join":new Ne(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 Ne(B.layout_line["line-sort-key"])}),Of={paint:new Lr({"line-opacity":new Ne(B.paint_line["line-opacity"]),"line-color":new Ne(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 Ne(B.paint_line["line-width"]),"line-gap-width":new Ne(B.paint_line["line-gap-width"]),"line-offset":new Ne(B.paint_line["line-offset"]),"line-blur":new Ne(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 qi(B.paint_line["line-gradient"])}),layout:i_},Vf=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=tt({},a,{zoom:Math.floor(a.zoom)}),e.prototype.evaluate.call(this,r,a,u,c)},t}(Ne))(Of.paint.properties["line-width"].specification);Vf.useIntegerZoom=!0;var n_=function(e){function t(r){e.call(this,r,Of),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"]=Vf.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=Uf(Yi("line-width",this,a),Yi("line-gap-width",this,a)),c=Yi("line-offset",this,a);return u/2+Math.abs(c)+xr(this.paint.get("line-translate"))},t.prototype.queryIntersectsFeature=function(r,a,u,c,h,v,_){var x=cn(r,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),v.angle,_),S=_/2*Uf(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(E,k){for(var U=[],N=new me(0,0),J=0;J<E.length;J++){for(var H=E[J],re=[],oe=0;oe<H.length;oe++){var se=H[oe],ce=H[oe+1],ye=oe===0?N:se.sub(H[oe-1])._unit()._perp(),Se=oe===H.length-1?N:ce.sub(se)._unit()._perp(),Ae=ye._add(Se)._unit();Ae._mult(1/(Ae.x*Se.x+Ae.y*Se.y)),re.push(Ae._mult(k)._add(se))}U.push(re)}return U}(c,T*_)),function(E,k,U){for(var N=0;N<k.length;N++){var J=k[N];if(E.length>=3){for(var H=0;H<J.length;H++)if(Ji(E,J[H]))return!0}if(Pi(E,J,U))return!0}return!1}(x,c,S)},t.prototype.isTileClipped=function(){return!0},t}(Xi);function Uf(e,t){return t>0?t+2*e:e}var o_=Er([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),a_=Er([{name:"a_projected_pos",components:3,type:"Float32"}],4),s_=(Er([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Er([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Nf=(Er([{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"}]),Er([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),l_=Er([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function u_(e,t,r){return e.sections.forEach(function(a){a.text=function(u,c,h){var v=c.layout.get("text-transform").evaluate(h,{});return v==="uppercase"?u=u.toLocaleUpperCase():v==="lowercase"&&(u=u.toLocaleLowerCase()),di.applyArabicShaping&&(u=di.applyArabicShaping(u)),u}(a.text,t,r)}),e}Er([{name:"triangle",components:3,type:"Uint16"}]),Er([{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"}]),Er([{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"}]),Er([{type:"Float32",name:"offsetX"}]),Er([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Pl={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},qf=function(e,t,r,a,u){var c,h,v=8*u-a-1,_=(1<<v)-1,x=_>>1,S=-7,T=u-1,E=-1,k=e[t+T];for(T+=E,c=k&(1<<-S)-1,k>>=-S,S+=v;S>0;c=256*c+e[t+T],T+=E,S-=8);for(h=c&(1<<-S)-1,c>>=-S,S+=a;S>0;h=256*h+e[t+T],T+=E,S-=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)},jf=function(e,t,r,a,u,c){var h,v,_,x=8*c-u-1,S=(1<<x)-1,T=S>>1,E=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,k=0,U=1,N=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(v=isNaN(t)?1:0,h=S):(h=Math.floor(Math.log(t)/Math.LN2),t*(_=Math.pow(2,-h))<1&&(h--,_*=2),(t+=h+T>=1?E/_:E*Math.pow(2,1-T))*_>=2&&(h++,_/=2),h+T>=S?(v=0,h=S):h+T>=1?(v=(t*_-1)*Math.pow(2,u),h+=T):(v=t*Math.pow(2,T-1)*Math.pow(2,u),h=0));u>=8;e[r+k]=255&v,k+=U,v/=256,u-=8);for(h=h<<u|v,x+=u;x>0;e[r+k]=255&h,k+=U,h/=256,x-=8);e[r+k-U]|=128*N},Vu=qt;function qt(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}qt.Varint=0,qt.Fixed64=1,qt.Bytes=2,qt.Fixed32=5;var $f=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function fo(e){return e.type===qt.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 Zf(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 c_(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function p_(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function h_(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function f_(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function d_(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function m_(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function y_(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function v_(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function g_(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function Uu(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 Gf(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function __(e,t,r){e===1&&r.readMessage(x_,t)}function x_(e,t,r){if(e===3){var a=r.readMessage(b_,{}),u=a.width,c=a.height,h=a.left,v=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:v,advance:_}})}}function b_(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 Wf(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(N,J){return J.h-N.h});for(var h=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}],v=0,_=0,x=0,S=e;x<S.length;x+=1)for(var T=S[x],E=h.length-1;E>=0;E--){var k=h[E];if(!(T.w>k.w||T.h>k.h)){if(T.x=k.x,T.y=k.y,_=Math.max(_,T.y+T.h),v=Math.max(v,T.x+T.w),T.w===k.w&&T.h===k.h){var U=h.pop();E<h.length&&(h[E]=U)}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:v,h:_,fill:t/(v*_)||0}}qt.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=Uu(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=Gf(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=Uu(this.buf,this.pos)+4294967296*Uu(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=Uu(this.buf,this.pos)+4294967296*Gf(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=qf(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=qf(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 v,_,x=h.buf;if(v=(112&(_=x[h.pos++]))>>4,_<128||(v|=(127&(_=x[h.pos++]))<<3,_<128)||(v|=(127&(_=x[h.pos++]))<<10,_<128)||(v|=(127&(_=x[h.pos++]))<<17,_<128)||(v|=(127&(_=x[h.pos++]))<<24,_<128)||(v|=(1&(_=x[h.pos++]))<<31,_<128))return xs(u,v,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&&$f?function(r,a,u){return $f.decode(r.subarray(a,u))}(this.buf,t,e):function(r,a,u){for(var c="",h=a;h<u;){var v,_,x,S=r[h],T=null,E=S>239?4:S>223?3:S>191?2:1;if(h+E>u)break;E===1?S<128&&(T=S):E===2?(192&(v=r[h+1]))==128&&(T=(31&S)<<6|63&v)<=127&&(T=null):E===3?(_=r[h+2],(192&(v=r[h+1]))==128&&(192&_)==128&&((T=(15&S)<<12|(63&v)<<6|63&_)<=2047||T>=55296&&T<=57343)&&(T=null)):E===4&&(_=r[h+2],x=r[h+3],(192&(v=r[h+1]))==128&&(192&_)==128&&(192&x)==128&&((T=(15&S)<<18|(63&v)<<12|(63&_)<<6|63&x)<=65535||T>=1114112)&&(T=null)),T===null?(T=65533,E=1):T>65535&&(T-=65536,c+=String.fromCharCode(T>>>10&1023|55296),T=56320|1023&T),c+=String.fromCharCode(T),h+=E}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!==qt.Bytes)return e.push(this.readVarint(t));var r=fo(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==qt.Bytes)return e.push(this.readSVarint());var t=fo(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==qt.Bytes)return e.push(this.readBoolean());var t=fo(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==qt.Bytes)return e.push(this.readFloat());var t=fo(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==qt.Bytes)return e.push(this.readDouble());var t=fo(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==qt.Bytes)return e.push(this.readFixed32());var t=fo(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==qt.Bytes)return e.push(this.readSFixed32());var t=fo(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==qt.Bytes)return e.push(this.readFixed64());var t=fo(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==qt.Bytes)return e.push(this.readSFixed64());var t=fo(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===qt.Varint)for(;this.buf[this.pos++]>127;);else if(t===qt.Bytes)this.pos=this.readVarint()+this.pos;else if(t===qt.Fixed32)this.pos+=4;else{if(t!==qt.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,v){v.buf[v.pos++]=127&c|128,c>>>=7,v.buf[v.pos++]=127&c|128,c>>>=7,v.buf[v.pos++]=127&c|128,c>>>=7,v.buf[v.pos++]=127&c|128,v.buf[v.pos]=127&(c>>>=7)}(a,0,r),function(c,h){var v=(7&c)<<4;h.buf[h.pos++]|=v|((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,v,_=0;_<u.length;_++){if((h=u.charCodeAt(_))>55295&&h<57344){if(!v){h>56319||_+1===u.length?(a[c++]=239,a[c++]=191,a[c++]=189):v=h;continue}if(h<56320){a[c++]=239,a[c++]=191,a[c++]=189,v=h;continue}h=v-55296<<10|h-56320|65536,v=null}else v&&(a[c++]=239,a[c++]=191,a[c++]=189,v=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&&Zf(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),jf(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),jf(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&&Zf(r,a,this),this.pos=r-1,this.writeVarint(a),this.pos+=a},writeMessage:function(e,t,r){this.writeTag(e,qt.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,c_,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,p_,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,d_,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,h_,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,f_,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,m_,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,y_,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,v_,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,g_,t)},writeBytesField:function(e,t){this.writeTag(e,qt.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,qt.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,qt.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,qt.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,qt.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,qt.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,qt.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,qt.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,qt.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,qt.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,!!t)}};var Nu=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(Nu.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=Wf(u),h=new pi({width:c.w||1,height:c.h||1});for(var v in e){var _=e[v],x=r[v].paddedRect;pi.copy(_.data,h,{x:0,y:0},{x:x.x+1,y:x.y+1},_.data)}for(var S in t){var T=t[S],E=a[S].paddedRect,k=E.x+1,U=E.y+1,N=T.data.width,J=T.data.height;pi.copy(T.data,h,{x:0,y:0},{x:k,y:U},T.data),pi.copy(T.data,h,{x:0,y:J-1},{x:k,y:U-1},{width:N,height:1}),pi.copy(T.data,h,{x:0,y:0},{x:k,y:U+J},{width:N,height:1}),pi.copy(T.data,h,{x:N-1,y:0},{x:k-1,y:U},{width:1,height:J}),pi.copy(T.data,h,{x:0,y:0},{x:k+N,y:U},{width:1,height:J})}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 Nu(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",Nu),Ve("ImageAtlas",Ml);var ki={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 qu(e,t,r,a,u,c,h,v,_,x,S,T,E,k,U,N){var J,H=Gr.fromFeature(e,u);T===ki.vertical&&H.verticalizePunctuation();var re=di.processBidirectionalText,oe=di.processStyledBidirectionalText;if(re&&H.sections.length===1){J=[];for(var se=0,ce=re(H.toString(),dp(H,x,c,t,a,k,U));se<ce.length;se+=1){var ye=ce[se],Se=new Gr;Se.text=ye,Se.sections=H.sections;for(var Ae=0;Ae<ye.length;Ae++)Se.sectionIndex.push(0);J.push(Se)}}else if(oe){J=[];for(var $e=0,ke=oe(H.text,H.sectionIndex,dp(H,x,c,t,a,k,U));$e<ke.length;$e+=1){var We=ke[$e],ze=new Gr;ze.text=We[0],ze.sectionIndex=We[1],ze.sections=H.sections,J.push(ze)}}else J=function(qe,ct){for(var ot=[],xt=qe.text,He=0,St=0,Wt=ct;St<Wt.length;St+=1){var er=Wt[St];ot.push(qe.substring(He,er)),He=er}return He<xt.length&&ot.push(qe.substring(He,xt.length)),ot}(H,dp(H,x,c,t,a,k,U));var lt=[],Qe={positionedLines:lt,text:H.toString(),top:S[1],bottom:S[1],left:S[0],right:S[0],writingMode:T,iconsInText:!1,verticalizable:!1};return function(qe,ct,ot,xt,He,St,Wt,er,Yt,Ht,tr,br){for(var wr=0,Wr=-17,kr=0,Hr=0,ar=er==="right"?1:er==="left"?0:.5,Mr=0,ft=0,Vt=He;ft<Vt.length;ft+=1){var Mt=Vt[ft];Mt.trim();var wt=Mt.getMaxScale(),ri=24*(wt-1),Fr={positionedGlyphs:[],lineOffset:0};qe.positionedLines[Mr]=Fr;var jt=Fr.positionedGlyphs,fr=0;if(Mt.length()){for(var Or=0;Or<Mt.length();Or++){var Tt=Mt.getSection(Or),Dn=Mt.getSectionIndex(Or),Mi=Mt.getCharCode(Or),Ln=0,sr=null,Rn=null,Qi=null,ks=24,Ra=!(Yt===ki.horizontal||!tr&&!ss(Mi)||tr&&(ju[Mi]||(go=Mi,Ce.Arabic(go)||Ce["Arabic Supplement"](go)||Ce["Arabic Extended-A"](go)||Ce["Arabic Presentation Forms-A"](go)||Ce["Arabic Presentation Forms-B"](go))));if(Tt.imageName){var Ms=xt[Tt.imageName];if(!Ms)continue;Qi=Tt.imageName,qe.iconsInText=qe.iconsInText||!0,Rn=Ms.paddedRect;var vo=Ms.displaySize;Tt.scale=24*Tt.scale/br,Ln=ri+(24-vo[1]*Tt.scale),ks=(sr={width:vo[0],height:vo[1],left:1,top:-3,advance:Ra?vo[1]:vo[0]}).advance;var zs=Ra?vo[0]*Tt.scale-24*wt:vo[1]*Tt.scale-24*wt;zs>0&&zs>fr&&(fr=zs)}else{var Yu=ot[Tt.fontStack],Bs=Yu&&Yu[Mi];if(Bs&&Bs.rect)Rn=Bs.rect,sr=Bs.metrics;else{var Dl=ct[Tt.fontStack],Qu=Dl&&Dl[Mi];if(!Qu)continue;sr=Qu.metrics}Ln=24*(wt-Tt.scale)}Ra?(qe.verticalizable=!0,jt.push({glyph:Mi,imageName:Qi,x:wr,y:Wr+Ln,vertical:Ra,scale:Tt.scale,fontStack:Tt.fontStack,sectionIndex:Dn,metrics:sr,rect:Rn}),wr+=ks*Tt.scale+Ht):(jt.push({glyph:Mi,imageName:Qi,x:wr,y:Wr+Ln,vertical:Ra,scale:Tt.scale,fontStack:Tt.fontStack,sectionIndex:Dn,metrics:sr,rect:Rn}),wr+=sr.advance*Tt.scale+Ht)}jt.length!==0&&(kr=Math.max(wr-Ht,kr),S_(jt,0,jt.length-1,ar,fr)),wr=0;var ec=St*wt+fr;Fr.lineOffset=Math.max(fr,ri),Wr+=ec,Hr=Math.max(ec,Hr),++Mr}else Wr+=St,++Mr}var go,Ll=Wr- -17,Ds=mp(Wt),Ho=Ds.horizontalAlign,Ls=Ds.verticalAlign;(function(tc,rc,Rl,Fl,ic,Ol,Vl,Ul,nc){var Rs,oc=(rc-Rl)*ic;Rs=Ol!==Vl?-Ul*Fl- -17:(-Fl*nc+.5)*Vl;for(var Fs=0,Nl=tc;Fs<Nl.length;Fs+=1)for(var Fa=0,ql=Nl[Fs].positionedGlyphs;Fa<ql.length;Fa+=1){var Os=ql[Fa];Os.x+=oc,Os.y+=Rs}})(qe.positionedLines,ar,Ho,Ls,kr,Hr,St,Ll,He.length),qe.top+=-Ls*Ll,qe.bottom=qe.top+Ll,qe.left+=-Ho*kr,qe.right=qe.left+kr}(Qe,t,r,a,J,h,v,_,T,x,E,N),!function(qe){for(var ct=0,ot=qe;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&&ju[this.text.charCodeAt(t)];t++)e++;for(var r=this.text.length,a=this.text.length-1;a>=0&&a>=e&&ju[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 ju={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},yi={};function Hf(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 v=r[t.fontStack],_=v&&v[e];return _?_.metrics.advance*t.scale+u:0}function Xf(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 w_(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 Kf(e,t,r,a,u,c){for(var h=null,v=Xf(t,r,u,c),_=0,x=a;_<x.length;_+=1){var S=x[_],T=Xf(t-S.x,r,u,c)+S.badness;T<=v&&(h=S,v=T)}return{index:e,x:t,priorBreak:h,badness:v}}function dp(e,t,r,a,u,c,h){if(c!=="point")return[];if(!e)return[];for(var v,_=[],x=function(J,H,re,oe,se,ce){for(var ye=0,Se=0;Se<J.length();Se++){var Ae=J.getSection(Se);ye+=Hf(J.getCharCode(Se),Ae,oe,se,H,ce)}return ye/Math.max(1,Math.ceil(ye/re))}(e,t,r,a,u,h),S=e.text.indexOf("")>=0,T=0,E=0;E<e.length();E++){var k=e.getSection(E),U=e.getCharCode(E);if(ju[U]||(T+=Hf(U,k,a,u,t,h)),E<e.length()-1){var N=!((v=U)<11904||!(Ce["Bopomofo Extended"](v)||Ce.Bopomofo(v)||Ce["CJK Compatibility Forms"](v)||Ce["CJK Compatibility Ideographs"](v)||Ce["CJK Compatibility"](v)||Ce["CJK Radicals Supplement"](v)||Ce["CJK Strokes"](v)||Ce["CJK Symbols and Punctuation"](v)||Ce["CJK Unified Ideographs Extension A"](v)||Ce["CJK Unified Ideographs"](v)||Ce["Enclosed CJK Letters and Months"](v)||Ce["Halfwidth and Fullwidth Forms"](v)||Ce.Hiragana(v)||Ce["Ideographic Description Characters"](v)||Ce["Kangxi Radicals"](v)||Ce["Katakana Phonetic Extensions"](v)||Ce.Katakana(v)||Ce["Vertical Forms"](v)||Ce["Yi Radicals"](v)||Ce["Yi Syllables"](v)));(yi[U]||N||k.imageName)&&_.push(Kf(E+1,T,x,_,w_(U,e.getCharCode(E+1),N&&S),!1))}}return function J(H){return H?J(H.priorBreak).concat(H.index):[]}(Kf(e.length(),T,x,_,0,!0))}function mp(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 S_(e,t,r,a,u){if(a||u)for(var c=e[r],h=(e[r].x+c.metrics.advance*c.scale)*a,v=t;v<=r;v++)e[v].x-=h,e[v].y+=u}function Jf(e,t,r,a,u,c){var h,v=e.image;if(v.content){var _=v.content,x=v.pixelRatio||1;h=[_[0]/x,_[1]/x,v.displaySize[0]-_[2]/x,v.displaySize[1]-_[3]/x]}var S,T,E,k,U=t.left*c,N=t.right*c;r==="width"||r==="both"?(k=u[0]+U-a[3],T=u[0]+N+a[1]):T=(k=u[0]+(U+N-v.displaySize[0])/2)+v.displaySize[0];var J=t.top*c,H=t.bottom*c;return r==="height"||r==="both"?(S=u[1]+J-a[0],E=u[1]+H+a[2]):E=(S=u[1]+(J+H-v.displaySize[1])/2)+v.displaySize[1],{image:v,top:S,right:T,bottom:E,left:k,collisionPadding:h}}yi[10]=!0,yi[32]=!0,yi[38]=!0,yi[40]=!0,yi[41]=!0,yi[43]=!0,yi[45]=!0,yi[47]=!0,yi[173]=!0,yi[183]=!0,yi[8203]=!0,yi[8208]=!0,yi[8211]=!0,yi[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 yp(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 v=a[c],_=a[h];return r.kind==="composite"?{kind:"composite",minZoom:v,maxZoom:_,interpolationType:u}:{kind:"camera",minZoom:v,maxZoom:_,minSize:r.evaluate(new ht(v)),maxSize:r.evaluate(new ht(_)),interpolationType:u}}function Yf(e,t,r){var a=t.uSize,u=r.lowerSize;return e.kind==="source"?u/128:e.kind==="composite"?pr(u/128,r.upperSize/128,t.uSizeT):a}function Qf(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?je(Br.interpolationFactor(u,t,e.minZoom,e.maxZoom),0,1):0;e.kind==="camera"?a=pr(e.minSize,e.maxSize,c):r=c}return{uSizeT:r,uSize:a}}Ve("Anchor",Ss);var T_=Object.freeze({__proto__:null,getSizeData:yp,evaluateSizeForFeature:Yf,evaluateSizeForZoom:Qf,SIZE_PACK_FACTOR:128});function ed(e,t,r,a,u){if(t.segment===void 0)return!0;for(var c=t,h=t.segment+1,v=0;v>-r/2;){if(--h<0)return!1;v-=e[h].dist(c),c=e[h]}v+=e[h].dist(e[h+1]),h++;for(var _=[],x=0;v<r/2;){var S=e[h],T=e[h+1];if(!T)return!1;var E=e[h-1].angleTo(S)-S.angleTo(T);for(E=Math.abs((E+3*Math.PI)%(2*Math.PI)-Math.PI),_.push({distance:v,angleDelta:E}),x+=E;v-_[0].distance>a;)x-=_.shift().angleDelta;if(x>u)return!1;h++,v+=S.dist(T)}return!0}function td(e){for(var t=0,r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function rd(e,t,r){return e?.6*t*r:0}function id(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function I_(e,t,r,a,u,c){for(var h=rd(r,u,c),v=id(r,a)*c,_=0,x=td(e)/2,S=0;S<e.length-1;S++){var T=e[S],E=e[S+1],k=T.dist(E);if(_+k>x){var U=(x-_)/k,N=pr(T.x,E.x,U),J=pr(T.y,E.y,U),H=new Ss(N,J,E.angleTo(T),S);return H._round(),!h||ed(e,H,v,h,t)?H:void 0}_+=k}}function A_(e,t,r,a,u,c,h,v,_){var x=rd(a,c,h),S=id(a,u),T=S*h,E=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(U,N,J,H,re,oe,se,ce,ye){for(var Se=oe/2,Ae=td(U),$e=0,ke=N-J,We=[],ze=0;ze<U.length-1;ze++){for(var lt=U[ze],Qe=U[ze+1],qe=lt.dist(Qe),ct=Qe.angleTo(lt);ke+J<$e+qe;){var ot=((ke+=J)-$e)/qe,xt=pr(lt.x,Qe.x,ot),He=pr(lt.y,Qe.y,ot);if(xt>=0&&xt<ye&&He>=0&&He<ye&&ke-Se>=0&&ke+Se<=Ae){var St=new Ss(xt,He,ct,ze);St._round(),H&&!ed(U,St,oe,H,re)||We.push(St)}}$e+=qe}return ce||We.length||se||(We=k(U,$e/2,J,H,re,oe,se,!0,ye)),We}(e,E?t/2*v%t:(S/2+2*c)*h*v%t,t,x,r,T,E,!1,_)}function nd(e,t,r,a,u){for(var c=[],h=0;h<e.length;h++)for(var v=e[h],_=void 0,x=0;x<v.length-1;x++){var S=v[x],T=v[x+1];S.x<t&&T.x<t||(S.x<t?S=new me(t,S.y+(t-S.x)/(T.x-S.x)*(T.y-S.y))._round():T.x<t&&(T=new me(t,S.y+(t-S.x)/(T.x-S.x)*(T.y-S.y))._round()),S.y<r&&T.y<r||(S.y<r?S=new me(S.x+(r-S.y)/(T.y-S.y)*(T.x-S.x),r)._round():T.y<r&&(T=new me(S.x+(r-S.y)/(T.y-S.y)*(T.x-S.x),r)._round()),S.x>=a&&T.x>=a||(S.x>=a?S=new me(a,S.y+(a-S.x)/(T.x-S.x)*(T.y-S.y))._round():T.x>=a&&(T=new me(a,S.y+(a-S.x)/(T.x-S.x)*(T.y-S.y))._round()),S.y>=u&&T.y>=u||(S.y>=u?S=new me(S.x+(u-S.y)/(T.y-S.y)*(T.x-S.x),u)._round():T.y>=u&&(T=new me(S.x+(u-S.y)/(T.y-S.y)*(T.x-S.x),u)._round()),_&&S.equals(_[_.length-1])||c.push(_=[S]),_.push(T)))))}return c}function od(e,t,r,a){var u=[],c=e.image,h=c.pixelRatio,v=c.paddedRect.w-2,_=c.paddedRect.h-2,x=e.right-e.left,S=e.bottom-e.top,T=c.stretchX||[[0,v]],E=c.stretchY||[[0,_]],k=function(xt,He){return xt+He[1]-He[0]},U=T.reduce(k,0),N=E.reduce(k,0),J=v-U,H=_-N,re=0,oe=U,se=0,ce=N,ye=0,Se=J,Ae=0,$e=H;if(c.content&&a){var ke=c.content;re=$u(T,0,ke[0]),se=$u(E,0,ke[1]),oe=$u(T,ke[0],ke[2]),ce=$u(E,ke[1],ke[3]),ye=ke[0]-re,Ae=ke[1]-se,Se=ke[2]-ke[0]-oe,$e=ke[3]-ke[1]-ce}var We=function(xt,He,St,Wt){var er=Zu(xt.stretch-re,oe,x,e.left),Yt=Gu(xt.fixed-ye,Se,xt.stretch,U),Ht=Zu(He.stretch-se,ce,S,e.top),tr=Gu(He.fixed-Ae,$e,He.stretch,N),br=Zu(St.stretch-re,oe,x,e.left),wr=Gu(St.fixed-ye,Se,St.stretch,U),Wr=Zu(Wt.stretch-se,ce,S,e.top),kr=Gu(Wt.fixed-Ae,$e,Wt.stretch,N),Hr=new me(er,Ht),ar=new me(br,Ht),Mr=new me(br,Wr),ft=new me(er,Wr),Vt=new me(Yt/h,tr/h),Mt=new me(wr/h,kr/h),wt=t*Math.PI/180;if(wt){var ri=Math.sin(wt),Fr=Math.cos(wt),jt=[Fr,-ri,ri,Fr];Hr._matMult(jt),ar._matMult(jt),ft._matMult(jt),Mr._matMult(jt)}var fr=xt.stretch+xt.fixed,Or=He.stretch+He.fixed;return{tl:Hr,tr:ar,bl:ft,br:Mr,tex:{x:c.paddedRect.x+1+fr,y:c.paddedRect.y+1+Or,w:St.stretch+St.fixed-fr,h:Wt.stretch+Wt.fixed-Or},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Vt,pixelOffsetBR:Mt,minFontScaleX:Se/h/x,minFontScaleY:$e/h/S,isSDF:r}};if(a&&(c.stretchX||c.stretchY))for(var ze=ad(T,J,U),lt=ad(E,H,N),Qe=0;Qe<ze.length-1;Qe++)for(var qe=ze[Qe],ct=ze[Qe+1],ot=0;ot<lt.length-1;ot++)u.push(We(qe,lt[ot],ct,lt[ot+1]));else u.push(We({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:v+1},{fixed:0,stretch:_+1}));return u}function $u(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 ad(e,t,r){for(var a=[{fixed:-1,stretch:0}],u=0,c=e;u<c.length;u+=1){var h=c[u],v=h[0],_=h[1],x=a[a.length-1];a.push({fixed:v-x.stretch,stretch:x.stretch}),a.push({fixed:v-x.stretch,stretch:x.stretch+(_-v)})}return a.push({fixed:t+1,stretch:r}),a}function Zu(e,t,r,a){return e/t*r+a}function Gu(e,t,r,a){return e-t*r/a}var Wu=function(e,t,r,a,u,c,h,v,_,x){if(this.boxStartIndex=e.length,_){var S=c.top,T=c.bottom,E=c.collisionPadding;E&&(S-=E[1],T+=E[3]);var k=T-S;k>0&&(k=Math.max(10,k),this.circleDiameter=k)}else{var U=c.top*h-v,N=c.bottom*h+v,J=c.left*h-v,H=c.right*h+v,re=c.collisionPadding;if(re&&(J-=re[0]*h,U-=re[1]*h,H+=re[2]*h,N+=re[3]*h),x){var oe=new me(J,U),se=new me(H,U),ce=new me(J,N),ye=new me(H,N),Se=x*Math.PI/180;oe._rotate(Se),se._rotate(Se),ce._rotate(Se),ye._rotate(Se),J=Math.min(oe.x,se.x,ce.x,ye.x),H=Math.max(oe.x,se.x,ce.x,ye.x),U=Math.min(oe.y,se.y,ce.y,ye.y),N=Math.max(oe.y,se.y,ce.y,ye.y)}e.emplaceBack(t.x,t.y,J,U,H,N,r,a,u)}this.boxEndIndex=e.length},Ts=function(e,t){if(e===void 0&&(e=[]),t===void 0&&(t=E_),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 E_(e,t){return e<t?-1:e>t?1:0}function C_(e,t,r){r===void 0&&(r=!1);for(var a=1/0,u=1/0,c=-1/0,h=-1/0,v=e[0],_=0;_<v.length;_++){var x=v[_];(!_||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 S=Math.min(c-a,h-u),T=S/2,E=new Ts([],P_);if(S===0)return new me(a,u);for(var k=a;k<c;k+=S)for(var U=u;U<h;U+=S)E.push(new Is(k+T,U+T,T,e));for(var N=function(re){for(var oe=0,se=0,ce=0,ye=re[0],Se=0,Ae=ye.length,$e=Ae-1;Se<Ae;$e=Se++){var ke=ye[Se],We=ye[$e],ze=ke.x*We.y-We.x*ke.y;se+=(ke.x+We.x)*ze,ce+=(ke.y+We.y)*ze,oe+=3*ze}return new Is(se/oe,ce/oe,0,re)}(e),J=E.length;E.length;){var H=E.pop();(H.d>N.d||!N.d)&&(N=H,r&&console.log("found best %d after %d probes",Math.round(1e4*H.d)/1e4,J)),H.max-N.d<=t||(E.push(new Is(H.p.x-(T=H.h/2),H.p.y-T,T,e)),E.push(new Is(H.p.x+T,H.p.y-T,T,e)),E.push(new Is(H.p.x-T,H.p.y+T,T,e)),E.push(new Is(H.p.x+T,H.p.y+T,T,e)),J+=4)}return r&&(console.log("num probes: "+J),console.log("best distance: "+N.d)),N.p}function P_(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,v=1/0,_=0;_<c.length;_++)for(var x=c[_],S=0,T=x.length,E=T-1;S<T;E=S++){var k=x[S],U=x[E];k.y>u.y!=U.y>u.y&&u.x<(U.x-k.x)*(u.y-k.y)/(U.y-k.y)+k.x&&(h=!h),v=Math.min(v,$o(u,k,U))}return(h?1:-1)*Math.sqrt(v)}(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],v=c+1;if(v<this.length&&r(t[v],h)<0&&(c=v,h=t[v]),r(h,u)>=0)break;t[e]=h,e=c}t[e]=u};var vp=Number.POSITIVE_INFINITY;function sd(e,t){return t[1]!==vp?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 gp(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 ld(e,t,r,a,u,c,h,v,_,x,S,T,E,k,U){var N=function(se,ce,ye,Se,Ae,$e,ke,We){for(var ze=Se.layout.get("text-rotate").evaluate($e,{})*Math.PI/180,lt=[],Qe=0,qe=ce.positionedLines;Qe<qe.length;Qe+=1)for(var ct=qe[Qe],ot=0,xt=ct.positionedGlyphs;ot<xt.length;ot+=1){var He=xt[ot];if(He.rect){var St=He.rect||{},Wt=4,er=!0,Yt=1,Ht=0,tr=(Ae||We)&&He.vertical,br=He.metrics.advance*He.scale/2;if(We&&ce.verticalizable&&(Ht=ct.lineOffset/2-(He.imageName?-(24-He.metrics.width*He.scale)/2:24*(He.scale-1))),He.imageName){var wr=ke[He.imageName];er=wr.sdf,Wt=1/(Yt=wr.pixelRatio)}var Wr=Ae?[He.x+br,He.y]:[0,0],kr=Ae?[0,0]:[He.x+br+ye[0],He.y+ye[1]-Ht],Hr=[0,0];tr&&(Hr=kr,kr=[0,0]);var ar=(He.metrics.left-Wt)*He.scale-br+kr[0],Mr=(-He.metrics.top-Wt)*He.scale+kr[1],ft=ar+St.w*He.scale/Yt,Vt=Mr+St.h*He.scale/Yt,Mt=new me(ar,Mr),wt=new me(ft,Mr),ri=new me(ar,Vt),Fr=new me(ft,Vt);if(tr){var jt=new me(-br,br- -17),fr=-Math.PI/2,Or=12-br,Tt=new me(22-Or,-(He.imageName?Or:0)),Dn=new(Function.prototype.bind.apply(me,[null].concat(Hr)));Mt._rotateAround(fr,jt)._add(Tt)._add(Dn),wt._rotateAround(fr,jt)._add(Tt)._add(Dn),ri._rotateAround(fr,jt)._add(Tt)._add(Dn),Fr._rotateAround(fr,jt)._add(Tt)._add(Dn)}if(ze){var Mi=Math.sin(ze),Ln=Math.cos(ze),sr=[Ln,-Mi,Mi,Ln];Mt._matMult(sr),wt._matMult(sr),ri._matMult(sr),Fr._matMult(sr)}var Rn=new me(0,0),Qi=new me(0,0);lt.push({tl:Mt,tr:wt,bl:ri,br:Fr,tex:St,writingMode:ce.writingMode,glyphOffset:Wr,sectionIndex:He.sectionIndex,isSDF:er,pixelOffsetTL:Rn,pixelOffsetBR:Qi,minFontScaleX:0,minFontScaleY:0})}}return lt}(0,r,v,u,c,h,a,e.allowVerticalPlacement),J=e.textSizeData,H=null;J.kind==="source"?(H=[128*u.layout.get("text-size").evaluate(h,{})])[0]>32640&&Lt(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):J.kind==="composite"&&((H=[128*k.compositeTextSizes[0].evaluate(h,{},U),128*k.compositeTextSizes[1].evaluate(h,{},U)])[0]>32640||H[1]>32640)&&Lt(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),e.addSymbols(e.text,N,H,v,c,h,x,t,_.lineStartIndex,_.lineLength,E,U);for(var re=0,oe=S;re<oe.length;re+=1)T[oe[re]]=e.text.placedSymbolArray.length-1;return 4*N.length}function ud(e){for(var t in e)return e[t];return null}function k_(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 M_=_s.VectorTileFeature.types,z_=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Hu(e,t,r,a,u,c,h,v,_,x,S,T,E){var k=v?Math.min(32640,Math.round(v[0])):0,U=v?Math.min(32640,Math.round(v[1])):0;e.emplaceBack(t,r,Math.round(32*a),Math.round(32*u),c,h,(k<<1)+(_?1:0),U,16*x,16*S,256*T,256*E)}function _p(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 B_(e){for(var t=0,r=e.sections;t<r.length;t+=1)if(ls(r[t].text))return!0;return!1}var As=function(e){this.layoutVertexArray=new hs,this.indexArray=new Cn,this.programConfigurations=e,this.segments=new D,this.dynamicLayoutVertexArray=new No,this.opacityVertexArray=new Aa,this.placedSymbolArray=new s};As.prototype.isEmpty=function(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0},As.prototype.upload=function(e,t,r,a){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,o_.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,a_.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,z_,!0),this.opacityVertexBuffer.itemSize=1),(r||a)&&this.programConfigurations.upload(e))},As.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",As);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,s_.members,!0)},zl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Ve("CollisionBuffers",zl);var Bt=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=mi([]),this.placementViewportMatrix=mi([]);var t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=yp(this.zoom,t["text-size"]),this.iconSizeData=yp(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 ki[c]})),this.stateDependentLayerIds=this.layers.filter(function(c){return c.isStateDependent()}).map(function(c){return c.id}),this.sourceID=e.sourceID};Bt.prototype.createArrays=function(){this.text=new As(new Je(this.layers,this.zoom,function(e){return/^text/.test(e)})),this.icon=new As(new Je(this.layers,this.zoom,function(e){return/^icon/.test(e)})),this.glyphOffsetArray=new y,this.lineVertexArray=new g,this.symbolInstances=new f},Bt.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)}},Bt.prototype.populate=function(e,t,r){var a=this.layers[0],u=a.layout,c=u.get("text-font"),h=u.get("text-field"),v=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=v.value.kind!=="constant"||!!v.value.value||Object.keys(v.parameters).length>0,S=u.get("symbol-sort-key");if(this.features=[],_||x){for(var T=t.iconDependencies,E=t.glyphDependencies,k=t.availableImages,U=new ht(this.zoom),N=0,J=e;N<J.length;N+=1){var H=J[N],re=H.feature,oe=H.id,se=H.index,ce=H.sourceLayerIndex,ye=a._featureFilter.needGeometry,Se=or(re,ye);if(a._featureFilter.filter(U,Se,r)){ye||(Se.geometry=Jt(re));var Ae=void 0;if(_){var $e=a.getValueAndResolveTokens("text-field",Se,r,k),ke=Ir.factory($e);B_(ke)&&(this.hasRTLText=!0),(!this.hasRTLText||yl()==="unavailable"||this.hasRTLText&&di.isParsed())&&(Ae=u_(ke,a,Se))}var We=void 0;if(x){var ze=a.getValueAndResolveTokens("icon-image",Se,r,k);We=ze instanceof Yr?ze:Yr.fromString(ze)}if(Ae||We){var lt=this.sortFeaturesByKey?S.evaluate(Se,{},r):void 0;if(this.features.push({id:oe,text:Ae,icon:We,index:se,sourceLayerIndex:ce,geometry:Se.geometry,properties:re.properties,type:M_[re.type],sortKey:lt}),We&&(T[We.name]=!0),Ae){var Qe=c.evaluate(Se,{},r).join(","),qe=u.get("text-rotation-alignment")==="map"&&u.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(ki.vertical)>=0;for(var ct=0,ot=Ae.sections;ct<ot.length;ct+=1){var xt=ot[ct];if(xt.image)T[xt.image.name]=!0;else{var He=fl(Ae.toString()),St=xt.fontStack||Qe,Wt=E[St]=E[St]||{};this.calculateGlyphDependencies(xt.text,Wt,qe,this.allowVerticalPlacement,He)}}}}}}u.get("symbol-placement")==="line"&&(this.features=function(er){var Yt={},Ht={},tr=[],br=0;function wr(jt){tr.push(er[jt]),br++}function Wr(jt,fr,Or){var Tt=Ht[jt];return delete Ht[jt],Ht[fr]=Tt,tr[Tt].geometry[0].pop(),tr[Tt].geometry[0]=tr[Tt].geometry[0].concat(Or[0]),Tt}function kr(jt,fr,Or){var Tt=Yt[fr];return delete Yt[fr],Yt[jt]=Tt,tr[Tt].geometry[0].shift(),tr[Tt].geometry[0]=Or[0].concat(tr[Tt].geometry[0]),Tt}function Hr(jt,fr,Or){var Tt=Or?fr[0][fr[0].length-1]:fr[0][0];return jt+":"+Tt.x+":"+Tt.y}for(var ar=0;ar<er.length;ar++){var Mr=er[ar],ft=Mr.geometry,Vt=Mr.text?Mr.text.toString():null;if(Vt){var Mt=Hr(Vt,ft),wt=Hr(Vt,ft,!0);if(Mt in Ht&&wt in Yt&&Ht[Mt]!==Yt[wt]){var ri=kr(Mt,wt,ft),Fr=Wr(Mt,wt,tr[ri].geometry);delete Yt[Mt],delete Ht[wt],Ht[Hr(Vt,tr[Fr].geometry,!0)]=Fr,tr[ri].geometry=null}else Mt in Ht?Wr(Mt,wt,ft):wt in Yt?kr(Mt,wt,ft):(wr(ar),Yt[Mt]=br-1,Ht[wt]=br-1)}else wr(ar)}return tr.filter(function(jt){return jt.geometry})}(this.features)),this.sortFeaturesByKey&&this.features.sort(function(er,Yt){return er.sortKey-Yt.sortKey})}},Bt.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))},Bt.prototype.isEmpty=function(){return this.symbolInstances.length===0&&!this.hasRTLText},Bt.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},Bt.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},Bt.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},Bt.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},Bt.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 v=e.segment||0;v>=0;v--)c[v]={x:t[v].x,y:t[v].y,tileUnitDistanceFromAnchor:u},v>0&&(u+=t[v-1].dist(t[v]));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}},Bt.prototype.addSymbols=function(e,t,r,a,u,c,h,v,_,x,S,T){for(var E=e.indexArray,k=e.layoutVertexArray,U=e.segments.prepareSegment(4*t.length,k,E,this.canOverlap?c.sortKey:void 0),N=this.glyphOffsetArray.length,J=U.vertexLength,H=this.allowVerticalPlacement&&h===ki.vertical?Math.PI/2:0,re=c.text&&c.text.sections,oe=0;oe<t.length;oe++){var se=t[oe],ce=se.tl,ye=se.tr,Se=se.bl,Ae=se.br,$e=se.tex,ke=se.pixelOffsetTL,We=se.pixelOffsetBR,ze=se.minFontScaleX,lt=se.minFontScaleY,Qe=se.glyphOffset,qe=se.isSDF,ct=se.sectionIndex,ot=U.vertexLength,xt=Qe[1];Hu(k,v.x,v.y,ce.x,xt+ce.y,$e.x,$e.y,r,qe,ke.x,ke.y,ze,lt),Hu(k,v.x,v.y,ye.x,xt+ye.y,$e.x+$e.w,$e.y,r,qe,We.x,ke.y,ze,lt),Hu(k,v.x,v.y,Se.x,xt+Se.y,$e.x,$e.y+$e.h,r,qe,ke.x,We.y,ze,lt),Hu(k,v.x,v.y,Ae.x,xt+Ae.y,$e.x+$e.w,$e.y+$e.h,r,qe,We.x,We.y,ze,lt),_p(e.dynamicLayoutVertexArray,v,H),E.emplaceBack(ot,ot+1,ot+2),E.emplaceBack(ot+1,ot+2,ot+3),U.vertexLength+=4,U.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Qe[0]),oe!==t.length-1&&ct===t[oe+1].sectionIndex||e.programConfigurations.populatePaintArrays(k.length,c,c.index,{},T,re&&re[ct])}e.placedSymbolArray.emplaceBack(v.x,v.y,N,this.glyphOffsetArray.length-N,J,_,x,v.segment,r?r[0]:0,r?r[1]:0,a[0],a[1],h,0,!1,0,S)},Bt.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))},Bt.prototype.addCollisionDebugVertices=function(e,t,r,a,u,c,h){var v=u.segments.prepareSegment(4,u.layoutVertexArray,u.indexArray),_=v.vertexLength,x=u.layoutVertexArray,S=u.collisionVertexArray,T=h.anchorX,E=h.anchorY;this._addCollisionDebugVertex(x,S,c,T,E,new me(e,t)),this._addCollisionDebugVertex(x,S,c,T,E,new me(r,t)),this._addCollisionDebugVertex(x,S,c,T,E,new me(r,a)),this._addCollisionDebugVertex(x,S,c,T,E,new me(e,a)),v.vertexLength+=4;var k=u.indexArray;k.emplaceBack(_,_+1),k.emplaceBack(_+1,_+2),k.emplaceBack(_+2,_+3),k.emplaceBack(_+3,_),v.primitiveLength+=4},Bt.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)}},Bt.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new zl(qo,Nf.members,Ea),this.iconCollisionBox=new zl(qo,Nf.members,Ea);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)}},Bt.prototype._deserializeCollisionBoxesForSymbol=function(e,t,r,a,u,c,h,v,_){for(var x={},S=t;S<r;S++){var T=e.get(S);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 E=a;E<u;E++){var k=e.get(E);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 U=c;U<h;U++){var N=e.get(U);x.iconBox={x1:N.x1,y1:N.y1,x2:N.x2,y2:N.y2,anchorPointX:N.anchorPointX,anchorPointY:N.anchorPointY},x.iconFeatureIndex=N.featureIndex;break}for(var J=v;J<_;J++){var H=e.get(J);x.verticalIconBox={x1:H.x1,y1:H.y1,x2:H.x2,y2:H.y2,anchorPointX:H.anchorPointX,anchorPointY:H.anchorPointY},x.verticalIconFeatureIndex=H.featureIndex;break}return x},Bt.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))}},Bt.prototype.hasTextData=function(){return this.text.segments.get().length>0},Bt.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Bt.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Bt.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Bt.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Bt.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)},Bt.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 v=this.symbolInstances.get(h);a.push(0|Math.round(t*v.anchorX+r*v.anchorY)),u.push(v.featureIndex)}return c.sort(function(_,x){return a[_]-a[x]||u[x]-u[_]}),c},Bt.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})},Bt.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,v){c>=0&&v.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",Bt,{omit:["layers","collisionBoxArray","features","compareText"]}),Bt.MAX_GLYPHS=65535,Bt.addDynamicAttributes=_p;var D_=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 Ne(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 Ne(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 Ne(B.layout_symbol["icon-image"]),"icon-rotate":new Ne(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 Ne(B.layout_symbol["icon-offset"]),"icon-anchor":new Ne(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 Ne(B.layout_symbol["text-field"]),"text-font":new Ne(B.layout_symbol["text-font"]),"text-size":new Ne(B.layout_symbol["text-size"]),"text-max-width":new Ne(B.layout_symbol["text-max-width"]),"text-line-height":new Ze(B.layout_symbol["text-line-height"]),"text-letter-spacing":new Ne(B.layout_symbol["text-letter-spacing"]),"text-justify":new Ne(B.layout_symbol["text-justify"]),"text-radial-offset":new Ne(B.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ze(B.layout_symbol["text-variable-anchor"]),"text-anchor":new Ne(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 Ne(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 Ne(B.layout_symbol["text-transform"]),"text-offset":new Ne(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"])}),xp={paint:new Lr({"icon-opacity":new Ne(B.paint_symbol["icon-opacity"]),"icon-color":new Ne(B.paint_symbol["icon-color"]),"icon-halo-color":new Ne(B.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ne(B.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ne(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 Ne(B.paint_symbol["text-opacity"]),"text-color":new Ne(B.paint_symbol["text-color"],{runtimeType:Pe,getOverride:function(e){return e.textColor},hasOverride:function(e){return!!e.textColor}}),"text-halo-color":new Ne(B.paint_symbol["text-halo-color"]),"text-halo-width":new Ne(B.paint_symbol["text-halo-width"]),"text-halo-blur":new Ne(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:D_},Es=function(e){this.type=e.property.overrides?e.property.overrides.runtimeType:Oe,this.defaultValue=e};Es.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},Es.prototype.eachChild=function(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)},Es.prototype.outputDefined=function(){return!1},Es.prototype.serialize=function(){return null},Ve("FormatSectionOverride",Es,{omit:["defaultValue"]});var L_=function(e){function t(r){e.call(this,r,xp)}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,v=u;h<v.length;h+=1){var _=v[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),v=this._unevaluatedLayout._values[r];return v.isDataDriven()||ma(v.value)||!h?h:function(_,x){return x.replace(/{([^{}]+)}/g,function(S,T){return T in _?String(_[T]):""})}(a.properties,h)},t.prototype.createBucket=function(r){return new Bt(r)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype._setPaintOverrides=function(){for(var r=0,a=xp.paint.overridableProperties;r<a.length;r+=1){var u=a[r];if(t.hasPaintOverride(this.layout,u)){var c,h=this.paint.get(u),v=new Es(h),_=new Lo(v,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=xp.paint.properties[a],h=!1,v=function(S){for(var T=0,E=S;T<E.length;T+=1)if(c.overrides&&c.overrides.hasOverride(E[T]))return void(h=!0)};if(u.value.kind==="constant"&&u.value.value instanceof Ir)v(u.value.value.sections);else if(u.value.kind==="source"){var _=function(S){h||(S instanceof Nr&&nr(S.value)===Ft?v(S.value.sections):S instanceof Fi?v(S.sections):S.eachChild(_))},x=u.value;x._styleExpression&&_(x._styleExpression.expression)}return h},t}(Xi),R_={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"])})},F_=function(e){function t(r){e.call(this,r,R_)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(Xi),O_={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"])})},V_=function(e){function t(r){e.call(this,r,O_)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(Xi),U_=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}(Xi),N_={circle:np,heatmap:Tg,hillshade:Ag,fill:jg,"fill-extrusion":Yg,line:n_,symbol:L_,background:F_,raster:V_},cd=le.HTMLImageElement,pd=le.HTMLCanvasElement,hd=le.HTMLVideoElement,fd=le.ImageData,Xu=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,v=h.gl;if(this.useMipmap=!!(t&&t.useMipmap),v.bindTexture(v.TEXTURE_2D,this.texture),h.pixelStoreUnpackFlipY.set(!1),h.pixelStoreUnpack.set(1),h.pixelStoreUnpackPremultiplyAlpha.set(this.format===v.RGBA&&(!t||t.premultiply!==!1)),c)this.size=[a,u],e instanceof cd||e instanceof pd||e instanceof hd||e instanceof fd||Xu&&e instanceof Xu?v.texImage2D(v.TEXTURE_2D,0,this.format,this.format,v.UNSIGNED_BYTE,e):v.texImage2D(v.TEXTURE_2D,0,this.format,a,u,0,this.format,v.UNSIGNED_BYTE,e.data);else{var _=r||{x:0,y:0},x=_.x,S=_.y;e instanceof cd||e instanceof pd||e instanceof hd||e instanceof fd||Xu&&e instanceof Xu?v.texSubImage2D(v.TEXTURE_2D,0,x,S,v.RGBA,v.UNSIGNED_BYTE,e):v.texSubImage2D(v.TEXTURE_2D,0,x,S,a,u,v.RGBA,v.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&v.generateMipmap(v.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 bp=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()})};bp.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))},bp.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={},ur(["receive","process"],this),this.invoker=new bp(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=ii()?e:le};function dd(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 v=ja(this.globalScope)?void 0:[];return this.target.postMessage({id:h,type:e,hasCallback:!!r,targetMapId:a,mustQueue:u,sourceMapId:this.mapId,data:Vi(t,v)},v),{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(S,T){u=!0,delete r.cancelCallbacks[e],r.target.postMessage({id:e,type:"<response>",sourceMapId:r.mapId,error:S?Vi(S):null,data:Vi(T,c)},c)}:function(S){u=!0},v=null,_=ai(t.data);if(this.parent[t.type])v=this.parent[t.type](t.sourceMapId,_,h);else if(this.parent.getWorkerSource){var x=t.type.split(".");v=this.parent.getWorkerSource(t.sourceMapId,x[0],_.source)[x[1]](_,h)}else h(new Error("Could not find function "+t.type));!u&&v&&v.cancel&&(this.cancelCallbacks[e]=v.cancel)}},Cs.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var yr=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]))};yr.prototype.setNorthEast=function(e){return this._ne=e instanceof Gt?new Gt(e.lng,e.lat):Gt.convert(e),this},yr.prototype.setSouthWest=function(e){return this._sw=e instanceof Gt?new Gt(e.lng,e.lat):Gt.convert(e),this},yr.prototype.extend=function(e){var t,r,a=this._sw,u=this._ne;if(e instanceof Gt)t=e,r=e;else{if(!(e instanceof yr))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(yr.convert(e)):this.extend(Gt.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 Gt(t.lng,t.lat),this._ne=new Gt(r.lng,r.lat)),this},yr.prototype.getCenter=function(){return new Gt((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},yr.prototype.getSouthWest=function(){return this._sw},yr.prototype.getNorthEast=function(){return this._ne},yr.prototype.getNorthWest=function(){return new Gt(this.getWest(),this.getNorth())},yr.prototype.getSouthEast=function(){return new Gt(this.getEast(),this.getSouth())},yr.prototype.getWest=function(){return this._sw.lng},yr.prototype.getSouth=function(){return this._sw.lat},yr.prototype.getEast=function(){return this._ne.lng},yr.prototype.getNorth=function(){return this._ne.lat},yr.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},yr.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},yr.prototype.isEmpty=function(){return!(this._sw&&this._ne)},yr.prototype.contains=function(e){var t=Gt.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},yr.convert=function(e){return!e||e instanceof yr?e:new yr(e)};var Gt=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")};Gt.prototype.wrap=function(){return new Gt(It(this.lng,-180,180),this.lat)},Gt.prototype.toArray=function(){return[this.lng,this.lat]},Gt.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Gt.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))},Gt.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 yr(new Gt(this.lng-r,this.lat-t),new Gt(this.lng+r,this.lat+t))},Gt.convert=function(e){if(e instanceof Gt)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Gt(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new Gt(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 md=2*Math.PI*63710088e-1;function yd(e){return md*Math.cos(e*Math.PI/180)}function vd(e){return(180+e)/360}function gd(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function _d(e,t){return e/yd(t)}function wp(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=Gt.convert(e);return new Da(vd(r.lng),gd(r.lat),_d(t,r.lat))},Da.prototype.toLngLat=function(){return new Gt(360*this.x-180,wp(this.y))},Da.prototype.toAltitude=function(){return this.z*yd(wp(this.y))},Da.prototype.meterInMercatorCoordinateUnits=function(){return 1/md*(e=wp(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,v=(a=this.y,u=this.z,c=dd(256*(r=this.x),256*(a=Math.pow(2,u)-a-1),u),h=dd(256*(r+1),256*(a+1),u),c[0]+","+c[1]+","+h[0]+","+h[1]),_=function(x,S,T){for(var E,k="",U=x;U>0;U--)k+=(S&(E=1<<U-1)?1:0)+(T&E?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}",v)},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 xd=function(e,t){this.wrap=e,this.canonical=t,this.key=Bl(e,t.z,t.z,t.x,t.y)},vr=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)}vr.prototype.equals=function(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)},vr.prototype.scaledTo=function(e){var t=this.canonical.z-e;return e>this.canonical.z?new vr(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new vr(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)},vr.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)},vr.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},vr.prototype.children=function(e){if(this.overscaledZ>=e)return[new vr(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 vr(t,this.wrap,t,r,a),new vr(t,this.wrap,t,r+1,a),new vr(t,this.wrap,t,r,a+1),new vr(t,this.wrap,t,r+1,a+1)]},vr.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))},vr.prototype.wrapped=function(){return new vr(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},vr.prototype.unwrapTo=function(e){return new vr(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)},vr.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},vr.prototype.toUnwrapped=function(){return new xd(this.wrap,this.canonical)},vr.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},vr.prototype.getTilePoint=function(e){return this.canonical.getTilePoint(new Da(e.x-this.wrap,e.y))},Ve("CanonicalTileID",La),Ve("OverscaledTileID",vr,{omit:["posMatrix"]});var mo=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)]};mo.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])},mo.prototype.getUnpackVector=function(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},mo.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)},mo.prototype._unpackMapbox=function(e,t,r){return(256*e*256+256*t+r)/10-1e4},mo.prototype._unpackTerrarium=function(e,t,r){return 256*e+t+r/256-32768},mo.prototype.getPixels=function(){return new pi({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},mo.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 v=-t*this.dim,_=-r*this.dim,x=c;x<h;x++)for(var S=a;S<u;S++)this.data[this._idx(S,x)]=e.data[this._idx(S+v,x+_)]},Ve("DEMData",mo);var Ku=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}};Ku.prototype.encode=function(e){return this._stringToNumber[e]},Ku.prototype.decode=function(e){return this._numberToString[e]};var Ju=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},Sp={geometry:{configurable:!0}};Sp.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},Sp.geometry.set=function(e){this._geometry=e},Ju.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(Ju.prototype,Sp);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]||{},tt(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=tt({},(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]={}),tt(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 v={};if(this.deletedStates[h]===null)for(var _ in this.state[h])v[_]={},this.state[h][_]={};else for(var x in this.deletedStates[h]){if(this.deletedStates[h][x]===null)this.state[h][x]={};else for(var S=0,T=Object.keys(this.deletedStates[h][x]);S<T.length;S+=1)delete this.state[h][x][T[S]];v[x]=this.state[h][x]}r[h]=r[h]||{},tt(r[h],v)}if(this.stateChanges={},this.deletedStates={},Object.keys(r).length!==0)for(var E in e)e[E].setFeatureState(r,t)};var yo=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 A,this.promoteId=t};function bd(e,t,r,a,u){return cr(e,function(c,h){var v=t instanceof Ia?t.get(h):null;return v&&v.evaluate?v.evaluate(r,a,u):v})}function wd(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 v=h[c];t=Math.min(t,v.x),r=Math.min(r,v.y),a=Math.max(a,v.x),u=Math.max(u,v.y)}return{minX:t,minY:r,maxX:a,maxY:u}}function q_(e,t){return t-e}yo.prototype.insert=function(e,t,r,a,u,c){var h=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,a,u);for(var v=c?this.grid3D:this.grid,_=0;_<t.length;_++){for(var x=t[_],S=[1/0,1/0,-1/0,-1/0],T=0;T<x.length;T++){var E=x[T];S[0]=Math.min(S[0],E.x),S[1]=Math.min(S[1],E.y),S[2]=Math.max(S[2],E.x),S[3]=Math.max(S[3],E.y)}S[0]<8192&&S[1]<8192&&S[2]>=0&&S[3]>=0&&v.insert(h,S[0],S[1],S[2],S[3])}},yo.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new _s.VectorTile(new Vu(this.rawTileData)).layers,this.sourceLayerCoder=new Ku(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},yo.prototype.query=function(e,t,r,a){var u=this;this.loadVTLayers();for(var c=e.params||{},h=8192/e.tileSize/e.scale,v=rs(c.filter),_=e.queryGeometry,x=e.queryPadding*h,S=wd(_),T=this.grid.query(S.minX-x,S.minY-x,S.maxX+x,S.maxY+x),E=wd(e.cameraQueryGeometry),k=this.grid3D.query(E.minX-x,E.minY-x,E.maxX+x,E.maxY+x,function(se,ce,ye,Se){return function(Ae,$e,ke,We,ze){for(var lt=0,Qe=Ae;lt<Qe.length;lt+=1){var qe=Qe[lt];if($e<=qe.x&&ke<=qe.y&&We>=qe.x&&ze>=qe.y)return!0}var ct=[new me($e,ke),new me($e,ze),new me(We,ze),new me(We,ke)];if(Ae.length>2){for(var ot=0,xt=ct;ot<xt.length;ot+=1)if(Ji(Ae,xt[ot]))return!0}for(var He=0;He<Ae.length-1;He++)if(ka(Ae[He],Ae[He+1],ct))return!0;return!1}(e.cameraQueryGeometry,se-x,ce-x,ye+x,Se+x)}),U=0,N=k;U<N.length;U+=1)T.push(N[U]);T.sort(q_);for(var J,H={},re=function(se){var ce=T[se];if(ce!==J){J=ce;var ye=u.featureIndexArray.get(ce),Se=null;u.loadMatchingFeature(H,ye.bucketIndex,ye.sourceLayerIndex,ye.featureIndex,v,c.layers,c.availableImages,t,r,a,function(Ae,$e,ke){return Se||(Se=Jt(Ae)),$e.queryIntersectsFeature(_,Ae,ke,Se,u.z,e.transform,h,e.pixelPosMatrix)})}},oe=0;oe<T.length;oe++)re(oe);return H},yo.prototype.loadMatchingFeature=function(e,t,r,a,u,c,h,v,_,x,S){var T=this.bucketLayerIDs[t];if(!c||function(Ae,$e){for(var ke=0;ke<Ae.length;ke++)if($e.indexOf(Ae[ke])>=0)return!0;return!1}(c,T)){var E=this.sourceLayerCoder.decode(r),k=this.vtLayers[E].feature(a);if(u.needGeometry){var U=or(k,!0);if(!u.filter(new ht(this.tileID.overscaledZ),U,this.tileID.canonical))return}else if(!u.filter(new ht(this.tileID.overscaledZ),k))return;for(var N=this.getId(k,E),J=0;J<T.length;J++){var H=T[J];if(!(c&&c.indexOf(H)<0)){var re=v[H];if(re){var oe={};N!==void 0&&x&&(oe=x.getState(re.sourceLayer||"_geojsonTileLayer",N));var se=tt({},_[H]);se.paint=bd(se.paint,re.paint,k,oe,h),se.layout=bd(se.layout,re.layout,k,oe,h);var ce=!S||S(k,re,oe);if(ce){var ye=new Ju(k,this.z,this.x,this.y,N);ye.layer=se;var Se=e[H];Se===void 0&&(Se=e[H]=[]),Se.push({featureIndex:a,feature:ye,intersectionZ:ce})}}}}}},yo.prototype.lookupSymbolFeatures=function(e,t,r,a,u,c,h,v){var _={};this.loadVTLayers();for(var x=rs(u),S=0,T=e;S<T.length;S+=1)this.loadMatchingFeature(_,r,a,T[S],x,c,h,v,t);return _},yo.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},yo.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",yo,{omit:["rawTileData","sourceLayerCoder"]});var Pr=function(e,t){this.tileID=e,this.uid=Dt(),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,S){var T={};if(!S)return T;for(var E=function(){var N=U[k],J=N.layerIds.map(function(oe){return S.getLayer(oe)}).filter(Boolean);if(J.length!==0){N.layers=J,N.stateDependentLayerIds&&(N.stateDependentLayers=N.stateDependentLayerIds.map(function(oe){return J.filter(function(se){return se.id===oe})[0]}));for(var H=0,re=J;H<re.length;H+=1)T[re[H].id]=N}},k=0,U=x;k<U.length;k+=1)E();return T}(e.buckets,t.style),this.hasSymbolBuckets=!1,this.buckets){var u=this.buckets[a];if(u instanceof Bt){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 Bt&&h.hasRTLText){this.hasRTLText=!0,di.isLoading()||di.isLoaded()||yl()!=="deferred"||Ui();break}}for(var v in this.queryPadding=0,this.buckets){var _=this.buckets[v];this.queryPadding=Math.max(this.queryPadding,t.style.getLayer(v).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,v,_,x){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:a,cameraQueryGeometry:u,scale:c,tileSize:this.tileSize,pixelPosMatrix:x,transform:v,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),v=this.tileID.canonical,_=v.z,x=v.x,S=v.y,T={z:_,x,y:S},E=0;E<c.length;E++){var k=c.feature(E);if(h.needGeometry){var U=or(k,!0);if(!h.filter(new ht(this.tileID.overscaledZ),U,this.tileID.canonical))continue}else if(!h.filter(new ht(this.tileID.overscaledZ),k))continue;var N=r.getId(k,u),J=new Ju(k,_,x,S,N);J.tile=T,e.push(J)}}},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],v=e[c];if(h&&v&&Object.keys(v).length!==0){u.update(v,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,Sd=function(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},Wo.mark(this._marks.start)};Sd.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=Et,l.DEMData=mo,l.DataConstantProperty=Ze,l.DictionaryCoder=Ku,l.EXTENT=8192,l.ErrorEvent=Q,l.EvaluationParameters=ht,l.Event=j,l.Evented=te,l.FeatureIndex=yo,l.FillBucket=pn,l.FillExtrusionBucket=hn,l.ImageAtlas=Ml,l.ImagePosition=Nu,l.LineBucket=ti,l.LngLat=Gt,l.LngLatBounds=yr,l.MercatorCoordinate=Da,l.ONE_EM=24,l.OverscaledTileID=vr,l.Point=me,l.Point$1=me,l.Properties=Lr,l.Protobuf=Vu,l.RGBAImage=pi,l.RequestManager=Kr,l.RequestPerformance=Sd,l.ResourceType=Wa,l.SegmentVector=D,l.SourceFeatureState=Ps,l.StructArrayLayout1ui2=wl,l.StructArrayLayout2f1f2i16=co,l.StructArrayLayout2i4=uo,l.StructArrayLayout3ui6=Cn,l.StructArrayLayout4i8=gl,l.SymbolBucket=Bt,l.Texture=Ba,l.Tile=Pr,l.Transitionable=Dr,l.Uniform1f=Ie,l.Uniform1i=_e,l.Uniform2f=Te,l.Uniform3f=De,l.Uniform4f=Ge,l.UniformColor=Ke,l.UniformMatrix4f=bt,l.UnwrappedTileID=xd,l.ValidationError=Z,l.WritingMode=ki,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=_p,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,v){t(h,function(_,x){_&&(c=_),u[v]=x,--a==0&&r(c,u)})})},l.bezier=Re,l.bindAll=ur,l.browser=rn,l.cacheEntryPossiblyAdded=function(e){++oa>Ga&&(e.getActor().send("enforceCacheSizeLimit",Po),oa=0)},l.clamp=je,l.clearTileCache=function(e){var t=le.caches.delete("mapbox-tiles");e&&t.catch(e).then(function(){return e()})},l.clipLine=nd,l.clone=function(e){var t=new Ct(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=gr,l.clone$2=function(e){var t=new Ct(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},l.collisionCircleLayout=l_,l.config=Rt,l.create=function(){var e=new Ct(16);return Ct!=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 Ct(9);return Ct!=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 Ct(4);return Ct!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},l.createCommonjsModule=ae,l.createExpression=es,l.createLayout=Er,l.createStyleLayer=function(e){return e.type==="custom"?new U_(e):new N_[e.type](e)},l.cross=function(e,t,r){var a=t[0],u=t[1],c=t[2],h=r[0],v=r[1],_=r[2];return e[0]=u*_-c*v,e[1]=c*h-a*_,e[2]=a*v-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=Ye,l.emitValidationErrors=wa,l.endsWith=Sr,l.enforceCacheSizeLimit=function(e){ko(),wi&&wi.then(function(t){t.keys().then(function(r){for(var a=0;a<r.length-e;a++)t.delete(r[a])})})},l.evaluateSizeForFeature=Yf,l.evaluateSizeForZoom=Qf,l.evaluateVariableOffset=sd,l.evented=ml,l.extend=tt,l.featureFilter=rs,l.filterObject=Xr,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=mp,l.getAnchorJustification=gp,l.getArrayBuffer=sa,l.getImage=C,l.getJSON=function(e,t){return Mo(tt(e,{type:"json"}),t)},l.getRTLTextPluginStatus=yl,l.getReferrer=Wn,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=mi,l.invert=function(e,t){var r=t[0],a=t[1],u=t[2],c=t[3],h=t[4],v=t[5],_=t[6],x=t[7],S=t[8],T=t[9],E=t[10],k=t[11],U=t[12],N=t[13],J=t[14],H=t[15],re=r*v-a*h,oe=r*_-u*h,se=r*x-c*h,ce=a*_-u*v,ye=a*x-c*v,Se=u*x-c*_,Ae=S*N-T*U,$e=S*J-E*U,ke=S*H-k*U,We=T*J-E*N,ze=T*H-k*N,lt=E*H-k*J,Qe=re*lt-oe*ze+se*We+ce*ke-ye*$e+Se*Ae;return Qe?(e[0]=(v*lt-_*ze+x*We)*(Qe=1/Qe),e[1]=(u*ze-a*lt-c*We)*Qe,e[2]=(N*Se-J*ye+H*ce)*Qe,e[3]=(E*ye-T*Se-k*ce)*Qe,e[4]=(_*ke-h*lt-x*$e)*Qe,e[5]=(r*lt-u*ke+c*$e)*Qe,e[6]=(J*se-U*Se-H*oe)*Qe,e[7]=(S*Se-E*se+k*oe)*Qe,e[8]=(h*ze-v*ke+x*Ae)*Qe,e[9]=(a*ke-r*ze-c*Ae)*Qe,e[10]=(U*ye-N*se+H*re)*Qe,e[11]=(T*se-S*ye-k*re)*Qe,e[12]=(v*$e-h*We-_*Ae)*Qe,e[13]=(r*We-a*$e+u*Ae)*Qe,e[14]=(N*oe-U*ce-J*re)*Qe,e[15]=(S*ce-T*oe+E*re)*Qe,e):null},l.isChar=Ce,l.isMapboxURL=_i,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=cr,l.mercatorXfromLng=vd,l.mercatorYfromLat=gd,l.mercatorZfromAltitude=_d,l.mul=ip,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=pr,l.offscreenCanvasSupported=aa,l.ortho=function(e,t,r,a,u,c,h){var v=1/(t-r),_=1/(a-u),x=1/(c-h);return e[0]=-2*v,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)*v,e[13]=(u+a)*_,e[14]=(h+c)*x,e[15]=1,e},l.parseGlyphPBF=function(e){return new Vu(e).readFields(__,[])},l.pbf=Vu,l.performSymbolLayout=function(e,t,r,a,u,c,h){e.createArrays(),e.tilePixelRatio=8192/(512*e.overscaling),e.compareText={},e.iconsNeedLinear=!1;var v=e.layers[0].layout,_=e.layers[0]._unevaluatedLayout._values,x={};if(e.textSizeData.kind==="composite"){var S=e.textSizeData,T=S.maxZoom;x.compositeTextSizes=[_["text-size"].possiblyEvaluate(new ht(S.minZoom),h),_["text-size"].possiblyEvaluate(new ht(T),h)]}if(e.iconSizeData.kind==="composite"){var E=e.iconSizeData,k=E.maxZoom;x.compositeIconSizes=[_["icon-size"].possiblyEvaluate(new ht(E.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 U=24*v.get("text-line-height"),N=v.get("text-rotation-alignment")==="map"&&v.get("symbol-placement")!=="point",J=v.get("text-keep-upright"),H=v.get("text-size"),re=function(){var ce=se[oe],ye=v.get("text-font").evaluate(ce,{},h).join(","),Se=H.evaluate(ce,{},h),Ae=x.layoutTextSize.evaluate(ce,{},h),$e=x.layoutIconSize.evaluate(ce,{},h),ke={horizontal:{},vertical:void 0},We=ce.text,ze=[0,0];if(We){var lt=We.toString(),Qe=24*v.get("text-letter-spacing").evaluate(ce,{},h),qe=function(ft){for(var Vt=0,Mt=ft;Vt<Mt.length;Vt+=1)if(wt=Mt[Vt].charCodeAt(0),Ce.Arabic(wt)||Ce["Arabic Supplement"](wt)||Ce["Arabic Extended-A"](wt)||Ce["Arabic Presentation Forms-A"](wt)||Ce["Arabic Presentation Forms-B"](wt))return!1;var wt;return!0}(lt)?Qe:0,ct=v.get("text-anchor").evaluate(ce,{},h),ot=v.get("text-variable-anchor");if(!ot){var xt=v.get("text-radial-offset").evaluate(ce,{},h);ze=xt?sd(ct,[24*xt,vp]):v.get("text-offset").evaluate(ce,{},h).map(function(ft){return 24*ft})}var He=N?"center":v.get("text-justify").evaluate(ce,{},h),St=v.get("symbol-placement"),Wt=St==="point"?24*v.get("text-max-width").evaluate(ce,{},h):0,er=function(){e.allowVerticalPlacement&&fl(lt)&&(ke.vertical=qu(We,t,r,u,ye,Wt,U,ct,"left",qe,ze,ki.vertical,!0,St,Ae,Se))};if(!N&&ot){for(var Yt=He==="auto"?ot.map(function(ft){return gp(ft)}):[He],Ht=!1,tr=0;tr<Yt.length;tr++){var br=Yt[tr];if(!ke.horizontal[br])if(Ht)ke.horizontal[br]=ke.horizontal[0];else{var wr=qu(We,t,r,u,ye,Wt,U,"center",br,qe,ze,ki.horizontal,!1,St,Ae,Se);wr&&(ke.horizontal[br]=wr,Ht=wr.positionedLines.length===1)}}er()}else{He==="auto"&&(He=gp(ct));var Wr=qu(We,t,r,u,ye,Wt,U,ct,He,qe,ze,ki.horizontal,!1,St,Ae,Se);Wr&&(ke.horizontal[He]=Wr),er(),fl(lt)&&N&&J&&(ke.vertical=qu(We,t,r,u,ye,Wt,U,ct,He,qe,ze,ki.vertical,!1,St,Ae,Se))}}var kr=void 0,Hr=!1;if(ce.icon&&ce.icon.name){var ar=a[ce.icon.name];ar&&(kr=function(ft,Vt,Mt){var wt=mp(Mt),ri=Vt[0]-ft.displaySize[0]*wt.horizontalAlign,Fr=Vt[1]-ft.displaySize[1]*wt.verticalAlign;return{image:ft,top:Fr,bottom:Fr+ft.displaySize[1],left:ri,right:ri+ft.displaySize[0]}}(u[ce.icon.name],v.get("icon-offset").evaluate(ce,{},h),v.get("icon-anchor").evaluate(ce,{},h)),Hr=ar.sdf,e.sdfIcons===void 0?e.sdfIcons=ar.sdf:e.sdfIcons!==ar.sdf&&Lt("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(ar.pixelRatio!==e.pixelRatio||v.get("icon-rotate").constantOr(1)!==0)&&(e.iconsNeedLinear=!0))}var Mr=ud(ke.horizontal)||ke.vertical;e.iconsInText=!!Mr&&Mr.iconsInText,(Mr||kr)&&function(ft,Vt,Mt,wt,ri,Fr,jt,fr,Or,Tt,Dn){var Mi=Fr.textMaxSize.evaluate(Vt,{});Mi===void 0&&(Mi=jt);var Ln,sr=ft.layers[0].layout,Rn=sr.get("icon-offset").evaluate(Vt,{},Dn),Qi=ud(Mt.horizontal),ks=jt/24,Ra=ft.tilePixelRatio*ks,Ms=ft.tilePixelRatio*Mi/24,vo=ft.tilePixelRatio*fr,zs=ft.tilePixelRatio*sr.get("symbol-spacing"),Yu=sr.get("text-padding")*ft.tilePixelRatio,Bs=sr.get("icon-padding")*ft.tilePixelRatio,Dl=sr.get("text-max-angle")/180*Math.PI,Qu=sr.get("text-rotation-alignment")==="map"&&sr.get("symbol-placement")!=="point",ec=sr.get("icon-rotation-alignment")==="map"&&sr.get("symbol-placement")!=="point",go=sr.get("symbol-placement"),Ll=zs/2,Ds=sr.get("icon-text-fit");wt&&Ds!=="none"&&(ft.allowVerticalPlacement&&Mt.vertical&&(Ln=Jf(wt,Mt.vertical,Ds,sr.get("icon-text-fit-padding"),Rn,ks)),Qi&&(wt=Jf(wt,Qi,Ds,sr.get("icon-text-fit-padding"),Rn,ks)));var Ho=function(j_,jl){jl.x<0||jl.x>=8192||jl.y<0||jl.y>=8192||function(lr,fn,$_,Xo,Ep,Ad,ac,Fn,sc,$l,lc,uc,Cp,Ed,Zl,Cd,Pd,kd,Md,zd,zi,cc,Bd,On,Z_){var Dd,Oa,Vs,Us,Ns,qs=lr.addToLineVertexArray(fn,$_),Ld=0,Rd=0,Fd=0,Od=0,Pp=-1,kp=-1,_o={},Vd=V(""),Mp=0,zp=0;if(Fn._unevaluatedLayout.getValue("text-radial-offset")===void 0?(Mp=(Dd=Fn.layout.get("text-offset").evaluate(zi,{},On).map(function(Wl){return 24*Wl}))[0],zp=Dd[1]):(Mp=24*Fn.layout.get("text-radial-offset").evaluate(zi,{},On),zp=vp),lr.allowVerticalPlacement&&Xo.vertical){var Ud=Fn.layout.get("text-rotate").evaluate(zi,{},On)+90;Us=new Wu(sc,fn,$l,lc,uc,Xo.vertical,Cp,Ed,Zl,Ud),ac&&(Ns=new Wu(sc,fn,$l,lc,uc,ac,Pd,kd,Zl,Ud))}if(Ep){var Bp=Fn.layout.get("icon-rotate").evaluate(zi,{}),Nd=Fn.layout.get("icon-text-fit")!=="none",qd=od(Ep,Bp,Bd,Nd),Dp=ac?od(ac,Bp,Bd,Nd):void 0;Vs=new Wu(sc,fn,$l,lc,uc,Ep,Pd,kd,!1,Bp),Ld=4*qd.length;var jd=lr.iconSizeData,Gl=null;jd.kind==="source"?(Gl=[128*Fn.layout.get("icon-size").evaluate(zi,{})])[0]>32640&&Lt(lr.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):jd.kind==="composite"&&((Gl=[128*cc.compositeIconSizes[0].evaluate(zi,{},On),128*cc.compositeIconSizes[1].evaluate(zi,{},On)])[0]>32640||Gl[1]>32640)&&Lt(lr.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),lr.addSymbols(lr.icon,qd,Gl,zd,Md,zi,!1,fn,qs.lineStartIndex,qs.lineLength,-1,On),Pp=lr.icon.placedSymbolArray.length-1,Dp&&(Rd=4*Dp.length,lr.addSymbols(lr.icon,Dp,Gl,zd,Md,zi,ki.vertical,fn,qs.lineStartIndex,qs.lineLength,-1,On),kp=lr.icon.placedSymbolArray.length-1)}for(var $d in Xo.horizontal){var pc=Xo.horizontal[$d];if(!Oa){Vd=V(pc.text);var G_=Fn.layout.get("text-rotate").evaluate(zi,{},On);Oa=new Wu(sc,fn,$l,lc,uc,pc,Cp,Ed,Zl,G_)}var Zd=pc.positionedLines.length===1;if(Fd+=ld(lr,fn,pc,Ad,Fn,Zl,zi,Cd,qs,Xo.vertical?ki.horizontal:ki.horizontalOnly,Zd?Object.keys(Xo.horizontal):[$d],_o,Pp,cc,On),Zd)break}Xo.vertical&&(Od+=ld(lr,fn,Xo.vertical,Ad,Fn,Zl,zi,Cd,qs,ki.vertical,["vertical"],_o,kp,cc,On));var W_=Oa?Oa.boxStartIndex:lr.collisionBoxArray.length,H_=Oa?Oa.boxEndIndex:lr.collisionBoxArray.length,X_=Us?Us.boxStartIndex:lr.collisionBoxArray.length,K_=Us?Us.boxEndIndex:lr.collisionBoxArray.length,J_=Vs?Vs.boxStartIndex:lr.collisionBoxArray.length,Y_=Vs?Vs.boxEndIndex:lr.collisionBoxArray.length,Q_=Ns?Ns.boxStartIndex:lr.collisionBoxArray.length,ex=Ns?Ns.boxEndIndex:lr.collisionBoxArray.length,Vn=-1,hc=function(Wl,Wd){return Wl&&Wl.circleDiameter?Math.max(Wl.circleDiameter,Wd):Wd};Vn=hc(Oa,Vn),Vn=hc(Us,Vn),Vn=hc(Vs,Vn);var Gd=(Vn=hc(Ns,Vn))>-1?1:0;Gd&&(Vn*=Z_/24),lr.glyphOffsetArray.length>=Bt.MAX_GLYPHS&&Lt("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),zi.sortKey!==void 0&&lr.addToSortKeyRanges(lr.symbolInstances.length,zi.sortKey),lr.symbolInstances.emplaceBack(fn.x,fn.y,_o.right>=0?_o.right:-1,_o.center>=0?_o.center:-1,_o.left>=0?_o.left:-1,_o.vertical||-1,Pp,kp,Vd,W_,H_,X_,K_,J_,Y_,Q_,ex,$l,Fd,Od,Ld,Rd,Gd,0,Cp,Mp,zp,Vn)}(ft,jl,j_,Mt,wt,ri,Ln,ft.layers[0],ft.collisionBoxArray,Vt.index,Vt.sourceLayerIndex,ft.index,Ra,Yu,Qu,Or,vo,Bs,ec,Rn,Vt,Fr,Tt,Dn,jt)};if(go==="line")for(var Ls=0,tc=nd(Vt.geometry,0,0,8192,8192);Ls<tc.length;Ls+=1)for(var rc=tc[Ls],Rl=0,Fl=A_(rc,zs,Dl,Mt.vertical||Qi,wt,24,Ms,ft.overscaling,8192);Rl<Fl.length;Rl+=1){var ic=Fl[Rl];Qi&&k_(ft,Qi.text,Ll,ic)||Ho(rc,ic)}else if(go==="line-center")for(var Ol=0,Vl=Vt.geometry;Ol<Vl.length;Ol+=1){var Ul=Vl[Ol];if(Ul.length>1){var nc=I_(Ul,Dl,Mt.vertical||Qi,wt,24,Ms);nc&&Ho(Ul,nc)}}else if(Vt.type==="Polygon")for(var Rs=0,oc=cp(Vt.geometry,0);Rs<oc.length;Rs+=1){var Fs=oc[Rs],Nl=C_(Fs,16);Ho(Fs[0],new Ss(Nl.x,Nl.y,0))}else if(Vt.type==="LineString")for(var Fa=0,ql=Vt.geometry;Fa<ql.length;Fa+=1){var Os=ql[Fa];Ho(Os,new Ss(Os[0].x,Os[0].y,0))}else if(Vt.type==="Point")for(var Tp=0,Td=Vt.geometry;Tp<Td.length;Tp+=1)for(var Ip=0,Id=Td[Tp];Ip<Id.length;Ip+=1){var Ap=Id[Ip];Ho([Ap],new Ss(Ap.x,Ap.y,0))}}(e,ce,ke,kr,a,x,Ae,$e,ze,Hr,h)},oe=0,se=e.features;oe<se.length;oe+=1)re();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=di,l.polygonIntersectsPolygon=Mn,l.postMapLoadEvent=ia,l.postTurnstileEvent=Za,l.potpack=Wf,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=Cf,l.rotate=function(e,t,r){var a=t[0],u=t[1],c=t[2],h=t[3],v=Math.sin(r),_=Math.cos(r);return e[0]=a*_+c*v,e[1]=u*_+h*v,e[2]=a*-v+c*_,e[3]=u*-v+h*_,e},l.rotateX=function(e,t,r){var a=Math.sin(r),u=Math.cos(r),c=t[4],h=t[5],v=t[6],_=t[7],x=t[8],S=t[9],T=t[10],E=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+S*a,e[6]=v*u+T*a,e[7]=_*u+E*a,e[8]=x*u-c*a,e[9]=S*u-h*a,e[10]=T*u-v*a,e[11]=E*u-_*a,e},l.rotateZ=function(e,t,r){var a=Math.sin(r),u=Math.cos(r),c=t[0],h=t[1],v=t[2],_=t[3],x=t[4],S=t[5],T=t[6],E=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+S*a,e[2]=v*u+T*a,e[3]=_*u+E*a,e[4]=x*u-c*a,e[5]=S*u-h*a,e[6]=T*u-v*a,e[7]=E*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=T_,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,v,_,x,S,T,E,k,U,N=r[0],J=r[1],H=r[2];return t===e?(e[12]=t[0]*N+t[4]*J+t[8]*H+t[12],e[13]=t[1]*N+t[5]*J+t[9]*H+t[13],e[14]=t[2]*N+t[6]*J+t[10]*H+t[14],e[15]=t[3]*N+t[7]*J+t[11]*H+t[15]):(u=t[1],c=t[2],h=t[3],v=t[4],_=t[5],x=t[6],S=t[7],T=t[8],E=t[9],k=t[10],U=t[11],e[0]=a=t[0],e[1]=u,e[2]=c,e[3]=h,e[4]=v,e[5]=_,e[6]=x,e[7]=S,e[8]=T,e[9]=E,e[10]=k,e[11]=U,e[12]=a*N+v*J+T*H+t[12],e[13]=u*N+_*J+E*H+t[13],e[14]=c*N+x*J+k*H+t[14],e[15]=h*N+S*J+U*H+t[15]),e},l.triggerPluginCompletionEvent=zu,l.uniqueId=Dt,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=tp,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=Gi,l.window=le,l.wrap=It}),G(["./shared"],function(l){function ae(I){var C=typeof I;if(C==="number"||C==="boolean"||C==="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 Q=Object.keys(I).sort(),te="{",B=0;B<Q.length;B++)te+=JSON.stringify(Q[B])+":"+ae(I[Q[B]])+",";return te+"}"}function W(I){for(var C="",P=0,F=l.refProperties;P<F.length;P+=1)C+="/"+ae(I[F[P]]);return C}var ve=function(I){this.keyCache={},I&&this.replace(I)};ve.prototype.replace=function(I){this._layerConfigs={},this._layers={},this.update(I,[])},ve.prototype.update=function(I,C){for(var P=this,F=0,j=I;F<j.length;F+=1){var Q=j[F];this._layerConfigs[Q.id]=Q;var te=this._layers[Q.id]=l.createStyleLayer(Q);te._featureFilter=l.featureFilter(te.filter),this.keyCache[Q.id]&&delete this.keyCache[Q.id]}for(var B=0,Z=C;B<Z.length;B+=1){var ne=Z[B];delete this.keyCache[ne],delete this._layerConfigs[ne],delete this._layers[ne]}this.familiesBySource={};for(var xe=0,we=function(Ee,Pe){for(var ut={},Me=0;Me<Ee.length;Me++){var vt=Pe&&Pe[Ee[Me].id]||W(Ee[Me]);Pe&&(Pe[Ee[Me].id]=vt);var Ft=ut[vt];Ft||(Ft=ut[vt]=[]),Ft.push(Ee[Me])}var pt=[];for(var At in ut)pt.push(ut[At]);return pt}(l.values(this._layerConfigs),this.keyCache);xe<we.length;xe+=1){var fe=we[xe].map(function(Ee){return P._layers[Ee.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",Be=Oe[de];Be||(Be=Oe[de]=[]),Be.push(fe)}}};var me=function(I){var C={},P=[];for(var F in I){var j=I[F],Q=C[F]={};for(var te in j){var B=j[+te];if(B&&B.bitmap.width!==0&&B.bitmap.height!==0){var Z={x:0,y:0,w:B.bitmap.width+2,h:B.bitmap.height+2};P.push(Z),Q[te]={rect:Z,metrics:B.metrics}}}}var ne=l.potpack(P),xe=new l.AlphaImage({width:ne.w||1,height:ne.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=C[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=C};l.register("GlyphAtlas",me);var Le=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,C,P){for(var F=new l.EvaluationParameters(C),j=0,Q=I;j<Q.length;j+=1)Q[j].recalculate(F,P)}function ge(I,C){var P=l.getArrayBuffer(I.request,function(F,j,Q,te){F?C(F):j&&C(null,{vectorTile:new l.vectorTile.VectorTile(new l.pbf(j)),rawData:j,cacheControl:Q,expires:te})});return function(){P.cancel(),C()}}Le.prototype.parse=function(I,C,P,F,j){var Q=this;this.status="parsing",this.data=I,this.collisionBoxArray=new l.CollisionBoxArray;var te=new l.DictionaryCoder(Object.keys(I.layers).sort()),B=new l.FeatureIndex(this.tileID,this.promoteId);B.bucketLayerIDs=[];var Z,ne,xe,we,fe={},be={featureIndex:B,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:P},Ue=C.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 Be=te.encode(Oe),Ee=[],Pe=0;Pe<de.length;Pe++){var ut=de.feature(Pe),Me=B.getId(ut,Oe);Ee.push({feature:ut,id:Me,index:Pe,sourceLayerIndex:Be})}for(var vt=0,Ft=Ue[Oe];vt<Ft.length;vt+=1){var pt=Ft[vt],At=pt[0];At.minzoom&&this.zoom<Math.floor(At.minzoom)||At.maxzoom&&this.zoom>=At.maxzoom||At.visibility!=="none"&&(le(pt,this.zoom,P),(fe[At.id]=At.createBucket({index:B.bucketLayerIDs.length,layers:pt,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Be,sourceID:this.source})).populate(Ee,be,this.tileID.canonical),B.bucketLayerIDs.push(pt.map(function(zt){return zt.id})))}}}var _t=l.mapObject(be.glyphDependencies,function(zt){return Object.keys(zt).map(Number)});Object.keys(_t).length?F.send("getGlyphs",{uid:this.uid,stacks:_t},function(zt,mt){Z||(Z=zt,ne=mt,ir.call(Q))}):ne={};var Ur=Object.keys(be.iconDependencies);Ur.length?F.send("getImages",{icons:Ur,source:this.source,tileID:this.tileID,type:"icons"},function(zt,mt){Z||(Z=zt,xe=mt,ir.call(Q))}):xe={};var Pt=Object.keys(be.patternDependencies);function ir(){if(Z)return j(Z);if(ne&&xe&&we){var zt=new me(ne),mt=new l.ImageAtlas(xe,we);for(var Et in fe){var Jr=fe[Et];Jr instanceof l.SymbolBucket?(le(Jr.layers,this.zoom,P),l.performSymbolLayout(Jr,ne,zt.positions,xe,mt.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):Jr.hasPattern&&(Jr instanceof l.LineBucket||Jr instanceof l.FillBucket||Jr instanceof l.FillExtrusionBucket)&&(le(Jr.layers,this.zoom,P),Jr.addFeatures(be,this.tileID.canonical,mt.patternPositions))}this.status="done",j(null,{buckets:l.values(fe).filter(function(la){return!la.isEmpty()}),featureIndex:B,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:zt.image,imageAtlas:mt,glyphMap:this.returnDependencies?ne:null,iconMap:this.returnDependencies?xe:null,glyphPositions:this.returnDependencies?zt.positions:null})}}Pt.length?F.send("getImages",{icons:Pt,source:this.source,tileID:this.tileID,type:"patterns"},function(zt,mt){Z||(Z=zt,we=mt,ir.call(Q))}):we={},ir.call(this)};var Re=function(I,C,P,F){this.actor=I,this.layerIndex=C,this.availableImages=P,this.loadVectorData=F||ge,this.loading={},this.loaded={}};Re.prototype.loadTile=function(I,C){var P=this,F=I.uid;this.loading||(this.loading={});var j=!!(I&&I.request&&I.request.collectResourceTiming)&&new l.RequestPerformance(I.request),Q=this.loading[F]=new Le(I);Q.abort=this.loadVectorData(I,function(te,B){if(delete P.loading[F],te||!B)return Q.status="done",P.loaded[F]=Q,C(te);var Z=B.rawData,ne={};B.expires&&(ne.expires=B.expires),B.cacheControl&&(ne.cacheControl=B.cacheControl);var xe={};if(j){var we=j.finish();we&&(xe.resourceTiming=JSON.parse(JSON.stringify(we)))}Q.vectorTile=B.vectorTile,Q.parse(B.vectorTile,P.layerIndex,P.availableImages,P.actor,function(fe,be){if(fe||!be)return C(fe);C(null,l.extend({rawTileData:Z.slice(0)},be,ne,xe))}),P.loaded=P.loaded||{},P.loaded[F]=Q})},Re.prototype.reloadTile=function(I,C){var P=this,F=this.loaded,j=I.uid,Q=this;if(F&&F[j]){var te=F[j];te.showCollisionBoxes=I.showCollisionBoxes;var B=function(Z,ne){var xe=te.reloadCallback;xe&&(delete te.reloadCallback,te.parse(te.vectorTile,Q.layerIndex,P.availableImages,Q.actor,xe)),C(Z,ne)};te.status==="parsing"?te.reloadCallback=B:te.status==="done"&&(te.vectorTile?te.parse(te.vectorTile,this.layerIndex,this.availableImages,this.actor,B):B())}},Re.prototype.abortTile=function(I,C){var P=this.loading,F=I.uid;P&&P[F]&&P[F].abort&&(P[F].abort(),delete P[F]),C()},Re.prototype.removeTile=function(I,C){var P=this.loaded,F=I.uid;P&&P[F]&&delete P[F],C()};var Ye=l.window.ImageBitmap,je=function(){this.loaded={}};function It(I,C){if(I.length!==0){tt(I[0],C);for(var P=1;P<I.length;P++)tt(I[P],!1)}}function tt(I,C){for(var P=0,F=0,j=0,Q=I.length,te=Q-1;j<Q;te=j++){var B=(I[j][0]-I[te][0])*(I[te][1]+I[j][1]),Z=P+B;F+=Math.abs(P)>=Math.abs(B)?P-Z+B:B-Z+P,P=Z}P+F>=0!=!!C&&I.reverse()}je.prototype.loadTile=function(I,C){var P=I.uid,F=I.encoding,j=I.rawImageData,Q=Ye&&j instanceof Ye?this.getImageData(j):j,te=new l.DEMData(P,Q,F);this.loaded=this.loaded||{},this.loaded[P]=te,C(null,te)},je.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 C=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:C.width,height:C.height},C.data)},je.prototype.removeTile=function(I){var C=this.loaded,P=I.uid;C&&C[P]&&delete C[P]};var dt=l.vectorTile.VectorTileFeature.prototype.toGeoJSON,Dt=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))};Dt.prototype.loadGeometry=function(){if(this._feature.type===1){for(var I=[],C=0,P=this._feature.geometry;C<P.length;C+=1){var F=P[C];I.push([new l.Point$1(F[0],F[1])])}return I}for(var j=[],Q=0,te=this._feature.geometry;Q<te.length;Q+=1){for(var B=[],Z=0,ne=te[Q];Z<ne.length;Z+=1){var xe=ne[Z];B.push(new l.Point$1(xe[0],xe[1]))}j.push(B)}return j},Dt.prototype.toGeoJSON=function(I,C,P){return dt.call(this,I,C,P)};var Xt=function(I){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=l.EXTENT,this.length=I.length,this._features=I};Xt.prototype.feature=function(I){return new Dt(this._features[I])};var Kt=l.vectorTile.VectorTileFeature,ur=Sr;function Sr(I,C){this.options=C||{},this.features=I,this.length=I.length}function cr(I,C){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=C||4096}Sr.prototype.feature=function(I){return new cr(this.features[I],this.options.extent)},cr.prototype.loadGeometry=function(){var I=this.rawGeometry;this.geometry=[];for(var C=0;C<I.length;C++){for(var P=I[C],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},cr.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var I=this.geometry,C=1/0,P=-1/0,F=1/0,j=-1/0,Q=0;Q<I.length;Q++)for(var te=I[Q],B=0;B<te.length;B++){var Z=te[B];C=Math.min(C,Z.x),P=Math.max(P,Z.x),F=Math.min(F,Z.y),j=Math.max(j,Z.y)}return[C,F,P,j]},cr.prototype.toGeoJSON=Kt.prototype.toGeoJSON;var Xr=gi,gr=ur;function gi(I){var C=new l.pbf;return function(P,F){for(var j in P.layers)F.writeMessage(3,Lt,P.layers[j])}(I,C),C.finish()}function Lt(I,C){var P;C.writeVarintField(15,I.version||1),C.writeStringField(1,I.name||""),C.writeVarintField(5,I.extent||4096);var F={keys:[],values:[],keycache:{},valuecache:{}};for(P=0;P<I.length;P++)F.feature=I.feature(P),C.writeMessage(2,Tr,F);var j=F.keys;for(P=0;P<j.length;P++)C.writeStringField(3,j[P]);var Q=F.values;for(P=0;P<Q.length;P++)C.writeMessage(4,ja,Q[P])}function Tr(I,C){var P=I.feature;P.id!==void 0&&C.writeVarintField(1,P.id),C.writeMessage(2,To,I),C.writeVarintField(3,P.type),C.writeMessage(4,Ao,P)}function To(I,C){var P=I.feature,F=I.keys,j=I.values,Q=I.keycache,te=I.valuecache;for(var B in P.properties){var Z=Q[B];Z===void 0&&(F.push(B),Q[B]=Z=F.length-1),C.writeVarint(Z);var ne=P.properties[B],xe=typeof ne;xe!=="string"&&xe!=="boolean"&&xe!=="number"&&(ne=JSON.stringify(ne));var we=xe+":"+ne,fe=te[we];fe===void 0&&(j.push(ne),te[we]=fe=j.length-1),C.writeVarint(fe)}}function ii(I,C){return(C<<3)+(7&I)}function Io(I){return I<<1^I>>31}function Ao(I,C){for(var P=I.loadGeometry(),F=I.type,j=0,Q=0,te=P.length,B=0;B<te;B++){var Z=P[B],ne=1;F===1&&(ne=Z.length),C.writeVarint(ii(1,ne));for(var xe=F===3?Z.length-1:Z.length,we=0;we<xe;we++){we===1&&F!==1&&C.writeVarint(ii(2,xe-1));var fe=Z[we].x-j,be=Z[we].y-Q;C.writeVarint(Io(fe)),C.writeVarint(Io(be)),j+=fe,Q+=be}F===3&&C.writeVarint(ii(7,1))}}function ja(I,C){var P=typeof I;P==="string"?C.writeStringField(1,I):P==="boolean"?C.writeBooleanField(7,I):P==="number"&&(I%1!=0?C.writeDoubleField(3,I):I<0?C.writeSVarintField(6,I):C.writeVarintField(5,I))}function dn(I,C,P,F){Bi(I,P,F),Bi(C,2*P,2*F),Bi(C,2*P+1,2*F+1)}function Bi(I,C,P){var F=I[C];I[C]=I[P],I[P]=F}function Zi(I,C,P,F){var j=I-P,Q=C-F;return j*j+Q*Q}Xr.fromVectorTileJs=gi,Xr.fromGeojsonVt=function(I,C){C=C||{};var P={};for(var F in I)P[F]=new ur(I[F].features,C),P[F].name=F,P[F].version=C.version,P[F].extent=C.extent;return gi({layers:P})},Xr.GeoJSONWrapper=gr;var qn=function(I){return I[0]},jn=function(I){return I[1]},mn=function(I,C,P,F,j){C===void 0&&(C=qn),P===void 0&&(P=jn),F===void 0&&(F=64),j===void 0&&(j=Float64Array),this.nodeSize=F,this.points=I;for(var Q=I.length<65536?Uint16Array:Uint32Array,te=this.ids=new Q(I.length),B=this.coords=new j(2*I.length),Z=0;Z<I.length;Z++)te[Z]=Z,B[2*Z]=C(I[Z]),B[2*Z+1]=P(I[Z]);(function ne(xe,we,fe,be,Ue,Oe){if(!(Ue-be<=fe)){var de=be+Ue>>1;(function Be(Ee,Pe,ut,Me,vt,Ft){for(;vt>Me;){if(vt-Me>600){var pt=vt-Me+1,At=ut-Me+1,_t=Math.log(pt),Ur=.5*Math.exp(2*_t/3),Pt=.5*Math.sqrt(_t*Ur*(pt-Ur)/pt)*(At-pt/2<0?-1:1);Be(Ee,Pe,ut,Math.max(Me,Math.floor(ut-At*Ur/pt+Pt)),Math.min(vt,Math.floor(ut+(pt-At)*Ur/pt+Pt)),Ft)}var ir=Pe[2*ut+Ft],zt=Me,mt=vt;for(dn(Ee,Pe,Me,ut),Pe[2*vt+Ft]>ir&&dn(Ee,Pe,Me,vt);zt<mt;){for(dn(Ee,Pe,zt,mt),zt++,mt--;Pe[2*zt+Ft]<ir;)zt++;for(;Pe[2*mt+Ft]>ir;)mt--}Pe[2*Me+Ft]===ir?dn(Ee,Pe,Me,mt):dn(Ee,Pe,++mt,vt),mt<=ut&&(Me=mt+1),ut<=mt&&(vt=mt-1)}})(xe,we,de,be,Ue,Oe%2),ne(xe,we,fe,be,de-1,Oe+1),ne(xe,we,fe,de+1,Ue,Oe+1)}})(te,B,F,0,te.length-1,0)};mn.prototype.range=function(I,C,P,F){return function(j,Q,te,B,Z,ne,xe){for(var we,fe,be=[0,j.length-1,0],Ue=[];be.length;){var Oe=be.pop(),de=be.pop(),Be=be.pop();if(de-Be<=xe)for(var Ee=Be;Ee<=de;Ee++)fe=Q[2*Ee+1],(we=Q[2*Ee])>=te&&we<=Z&&fe>=B&&fe<=ne&&Ue.push(j[Ee]);else{var Pe=Math.floor((Be+de)/2);fe=Q[2*Pe+1],(we=Q[2*Pe])>=te&&we<=Z&&fe>=B&&fe<=ne&&Ue.push(j[Pe]);var ut=(Oe+1)%2;(Oe===0?te<=we:B<=fe)&&(be.push(Be),be.push(Pe-1),be.push(ut)),(Oe===0?Z>=we:ne>=fe)&&(be.push(Pe+1),be.push(de),be.push(ut))}}return Ue}(this.ids,this.coords,I,C,P,F,this.nodeSize)},mn.prototype.within=function(I,C,P){return function(F,j,Q,te,B,Z){for(var ne=[0,F.length-1,0],xe=[],we=B*B;ne.length;){var fe=ne.pop(),be=ne.pop(),Ue=ne.pop();if(be-Ue<=Z)for(var Oe=Ue;Oe<=be;Oe++)Zi(j[2*Oe],j[2*Oe+1],Q,te)<=we&&xe.push(F[Oe]);else{var de=Math.floor((Ue+be)/2),Be=j[2*de],Ee=j[2*de+1];Zi(Be,Ee,Q,te)<=we&&xe.push(F[de]);var Pe=(fe+1)%2;(fe===0?Q-B<=Be:te-B<=Ee)&&(ne.push(Ue),ne.push(de-1),ne.push(Pe)),(fe===0?Q+B>=Be:te+B>=Ee)&&(ne.push(de+1),ne.push(be),ne.push(Pe))}}return xe}(this.ids,this.coords,I,C,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=yn(Object.create(Ks),I),this.trees=new Array(this.options.maxZoom+1)};function rn(I,C,P,F,j){return{x:I,y:C,zoom:1/0,id:P,parentId:-1,numPoints:F,properties:j}}function Rt(I,C){var P=I.geometry.coordinates,F=P[1];return{x:Di(P[0]),y:yt(F),zoom:1/0,index:C,parentId:-1}}function Gi(I){return{type:"Feature",id:I.id,properties:Eo(I),geometry:{type:"Point",coordinates:[(F=I.x,360*(F-.5)),(C=I.y,P=(180-360*C)*Math.PI/180,360*Math.atan(Math.exp(P))/Math.PI-90)]}};var C,P,F}function Eo(I){var C=I.numPoints,P=C>=1e4?Math.round(C/1e3)+"k":C>=1e3?Math.round(C/100)/10+"k":C;return yn(yn({},I.properties),{cluster:!0,cluster_id:I.id,point_count:C,point_count_abbreviated:P})}function Di(I){return I/360+.5}function yt(I){var C=Math.sin(I*Math.PI/180),P=.5-.25*Math.log((1+C)/(1-C))/Math.PI;return P<0?0:P>1?1:P}function yn(I,C){for(var P in C)I[P]=C[P];return I}function Kr(I){return I.x}function _i(I){return I.y}function Js(I,C,P,F,j,Q){var te=j-P,B=Q-F;if(te!==0||B!==0){var Z=((I-P)*te+(C-F)*B)/(te*te+B*B);Z>1?(P=j,F=Q):Z>0&&(P+=te*Z,F+=B*Z)}return(te=I-P)*te+(B=C-F)*B}function Li(I,C,P,F){var j={id:I===void 0?null:I,type:C,geometry:P,tags:F,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(Q){var te=Q.geometry,B=Q.type;if(B==="Point"||B==="MultiPoint"||B==="LineString")ta(Q,te);else if(B==="Polygon"||B==="MultiLineString")for(var Z=0;Z<te.length;Z++)ta(Q,te[Z]);else if(B==="MultiPolygon")for(Z=0;Z<te.length;Z++)for(var ne=0;ne<te[Z].length;ne++)ta(Q,te[Z][ne])}(j),j}function ta(I,C){for(var P=0;P<C.length;P+=3)I.minX=Math.min(I.minX,C[P]),I.minY=Math.min(I.minY,C[P+1]),I.maxX=Math.max(I.maxX,C[P]),I.maxY=Math.max(I.maxY,C[P+1])}function xi(I,C,P,F){if(C.geometry){var j=C.geometry.coordinates,Q=C.geometry.type,te=Math.pow(P.tolerance/((1<<P.maxZoom)*P.extent),2),B=[],Z=C.id;if(P.promoteId?Z=C.properties[P.promoteId]:P.generateId&&(Z=F||0),Q==="Point")$n(j,B);else if(Q==="MultiPoint")for(var ne=0;ne<j.length;ne++)$n(j[ne],B);else if(Q==="LineString")Co(j,B,te,!1);else if(Q==="MultiLineString"){if(P.lineMetrics){for(ne=0;ne<j.length;ne++)Co(j[ne],B=[],te,!1),I.push(Li(Z,"LineString",B,C.properties));return}bi(j,B,te,!1)}else if(Q==="Polygon")bi(j,B,te,!0);else{if(Q!=="MultiPolygon"){if(Q==="GeometryCollection"){for(ne=0;ne<C.geometry.geometries.length;ne++)xi(I,{id:Z,geometry:C.geometry.geometries[ne],properties:C.properties},P,F);return}throw new Error("Input data is not a valid GeoJSON object.")}for(ne=0;ne<j.length;ne++){var xe=[];bi(j[ne],xe,te,!0),B.push(xe)}}I.push(Li(Z,Q,B,C.properties))}}function $n(I,C){C.push(wi(I[0])),C.push(Zn(I[1])),C.push(0)}function Co(I,C,P,F){for(var j,Q,te=0,B=0;B<I.length;B++){var Z=wi(I[B][0]),ne=Zn(I[B][1]);C.push(Z),C.push(ne),C.push(0),B>0&&(te+=F?(j*ne-Z*Q)/2:Math.sqrt(Math.pow(Z-j,2)+Math.pow(ne-Q,2))),j=Z,Q=ne}var xe=C.length-3;C[2]=1,function we(fe,be,Ue,Oe){for(var de,Be=Oe,Ee=Ue-be>>1,Pe=Ue-be,ut=fe[be],Me=fe[be+1],vt=fe[Ue],Ft=fe[Ue+1],pt=be+3;pt<Ue;pt+=3){var At=Js(fe[pt],fe[pt+1],ut,Me,vt,Ft);if(At>Be)de=pt,Be=At;else if(At===Be){var _t=Math.abs(pt-Ee);_t<Pe&&(de=pt,Pe=_t)}}Be>Oe&&(de-be>3&&we(fe,be,de,Oe),fe[de+2]=Be,Ue-de>3&&we(fe,de,Ue,Oe))}(C,0,xe,P),C[xe+2]=1,C.size=Math.abs(te),C.start=0,C.end=C.size}function bi(I,C,P,F){for(var j=0;j<I.length;j++){var Q=[];Co(I[j],Q,P,F),C.push(Q)}}function wi(I){return I/360+.5}function Zn(I){var C=Math.sin(I*Math.PI/180),P=.5-.25*Math.log((1+C)/(1-C))/Math.PI;return P<0?0:P>1?1:P}function Ri(I,C,P,F,j,Q,te,B){if(F/=C,Q>=(P/=C)&&te<F)return I;if(te<P||Q>=F)return null;for(var Z=[],ne=0;ne<I.length;ne++){var xe=I[ne],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)Z.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 Be=[];ia(we[de],Be,P,F,j,!0),Be.length&&Oe.push(Be)}if(Oe.length){if(B.lineMetrics&&fe==="LineString"){for(de=0;de<Oe.length;de++)Z.push(Li(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"),Z.push(Li(xe.id,fe,Oe,xe.tags))}}}return Z.length?Z:null}function $a(I,C,P,F,j){for(var Q=0;Q<I.length;Q+=3){var te=I[Q+j];te>=P&&te<=F&&(C.push(I[Q]),C.push(I[Q+1]),C.push(I[Q+2]))}}function Za(I,C,P,F,j,Q,te){for(var B,Z,ne=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],Be=I[fe+4],Ee=j===0?be:Ue,Pe=j===0?de:Be,ut=!1;te&&(B=Math.sqrt(Math.pow(be-de,2)+Math.pow(Ue-Be,2))),Ee<P?Pe>P&&(Z=xe(ne,be,Ue,de,Be,P),te&&(ne.start=we+B*Z)):Ee>F?Pe<F&&(Z=xe(ne,be,Ue,de,Be,F),te&&(ne.start=we+B*Z)):Po(ne,be,Ue,Oe),Pe<P&&Ee>=P&&(Z=xe(ne,be,Ue,de,Be,P),ut=!0),Pe>F&&Ee<=F&&(Z=xe(ne,be,Ue,de,Be,F),ut=!0),!Q&&ut&&(te&&(ne.end=we+B*Z),C.push(ne),ne=ra(I)),te&&(we+=B)}var Me=I.length-3;be=I[Me],Ue=I[Me+1],Oe=I[Me+2],(Ee=j===0?be:Ue)>=P&&Ee<=F&&Po(ne,be,Ue,Oe),Me=ne.length-3,Q&&Me>=3&&(ne[Me]!==ne[0]||ne[Me+1]!==ne[1])&&Po(ne,ne[0],ne[1],ne[2]),ne.length&&C.push(ne)}function ra(I){var C=[];return C.size=I.size,C.start=I.start,C.end=I.end,C}function ia(I,C,P,F,j,Q){for(var te=0;te<I.length;te++)Za(I[te],C,P,F,j,Q,!1)}function Po(I,C,P,F){I.push(C),I.push(P),I.push(F)}function Ga(I,C,P,F,j,Q){var te=(Q-C)/(F-C);return I.push(Q),I.push(P+(j-P)*te),I.push(1),te}function ko(I,C,P,F,j,Q){var te=(Q-P)/(j-P);return I.push(C+(F-C)*te),I.push(Q),I.push(1),te}function na(I,C){for(var P=[],F=0;F<I.length;F++){var j,Q=I[F],te=Q.type;if(te==="Point"||te==="MultiPoint"||te==="LineString")j=Gn(Q.geometry,C);else if(te==="MultiLineString"||te==="Polygon"){j=[];for(var B=0;B<Q.geometry.length;B++)j.push(Gn(Q.geometry[B],C))}else if(te==="MultiPolygon")for(j=[],B=0;B<Q.geometry.length;B++){for(var Z=[],ne=0;ne<Q.geometry[B].length;ne++)Z.push(Gn(Q.geometry[B][ne],C));j.push(Z)}P.push(Li(Q.id,te,j,Q.tags))}return P}function Gn(I,C){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]+C,I[F+1],I[F+2]);return P}function oa(I,C){if(I.transformed)return I;var P,F,j,Q=1<<I.z,te=I.x,B=I.y;for(P=0;P<I.features.length;P++){var Z=I.features[P],ne=Z.geometry,xe=Z.type;if(Z.geometry=[],xe===1)for(F=0;F<ne.length;F+=2)Z.geometry.push(aa(ne[F],ne[F+1],C,Q,te,B));else for(F=0;F<ne.length;F++){var we=[];for(j=0;j<ne[F].length;j+=2)we.push(aa(ne[F][j],ne[F][j+1],C,Q,te,B));Z.geometry.push(we)}}return I.transformed=!0,I}function aa(I,C,P,F,j,Q){return[Math.round(P*(I*F-j)),Math.round(P*(C*F-Q))]}function Wa(I,C,P,F,j){for(var Q=C===j.maxZoom?0:j.tolerance/((1<<C)*j.extent),te={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:P,y:F,z:C,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},B=0;B<I.length;B++){te.numFeatures++,Ha(te,I[B],Q,j);var Z=I[B].minX,ne=I[B].minY,xe=I[B].maxX,we=I[B].maxY;Z<te.minX&&(te.minX=Z),ne<te.minY&&(te.minY=ne),xe>te.maxX&&(te.maxX=xe),we>te.maxY&&(te.maxY=we)}return te}function Ha(I,C,P,F){var j=C.geometry,Q=C.type,te=[];if(Q==="Point"||Q==="MultiPoint")for(var B=0;B<j.length;B+=3)te.push(j[B]),te.push(j[B+1]),I.numPoints++,I.numSimplified++;else if(Q==="LineString")Wn(te,j,I,P,!1,!1);else if(Q==="MultiLineString"||Q==="Polygon")for(B=0;B<j.length;B++)Wn(te,j[B],I,P,Q==="Polygon",B===0);else if(Q==="MultiPolygon")for(var Z=0;Z<j.length;Z++){var ne=j[Z];for(B=0;B<ne.length;B++)Wn(te,ne[B],I,P,!0,B===0)}if(te.length){var xe=C.tags||null;if(Q==="LineString"&&F.lineMetrics){for(var we in xe={},C.tags)xe[we]=C.tags[we];xe.mapbox_clip_start=j.start/j.size,xe.mapbox_clip_end=j.end/j.size}var fe={geometry:te,type:Q==="Polygon"||Q==="MultiPolygon"?3:Q==="LineString"||Q==="MultiLineString"?2:1,tags:xe};C.id!==null&&(fe.id=C.id),I.features.push(fe)}}function Wn(I,C,P,F,j,Q){var te=F*F;if(F>0&&C.size<(j?te:F))P.numPoints+=C.length/3;else{for(var B=[],Z=0;Z<C.length;Z+=3)(F===0||C[Z+2]>te)&&(P.numSimplified++,B.push(C[Z]),B.push(C[Z+1])),P.numPoints++;j&&function(ne,xe){for(var we=0,fe=0,be=ne.length,Ue=be-2;fe<be;Ue=fe,fe+=2)we+=(ne[fe]-ne[Ue])*(ne[fe+1]+ne[Ue+1]);if(we>0===xe)for(fe=0,be=ne.length;fe<be/2;fe+=2){var Oe=ne[fe],de=ne[fe+1];ne[fe]=ne[be-2-fe],ne[fe+1]=ne[be-1-fe],ne[be-2-fe]=Oe,ne[be-1-fe]=de}}(B,Q),I.push(B)}}function nn(I,C){var P=(C=this.options=function(j,Q){for(var te in Q)j[te]=Q[te];return j}(Object.create(this.options),C)).debug;if(P&&console.time("preprocess data"),C.maxZoom<0||C.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(C.promoteId&&C.generateId)throw new Error("promoteId and generateId cannot be used together.");var F=function(j,Q){var te=[];if(j.type==="FeatureCollection")for(var B=0;B<j.features.length;B++)xi(te,j.features[B],Q,B);else xi(te,j.type==="Feature"?j:{geometry:j},Q);return te}(I,C);this.tiles={},this.tileCoords=[],P&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",C.indexMaxZoom,C.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(F=function(j,Q){var te=Q.buffer/Q.extent,B=j,Z=Ri(j,1,-1-te,te,0,-1,2,Q),ne=Ri(j,1,1-te,2+te,0,-1,2,Q);return(Z||ne)&&(B=Ri(j,1,-te,1+te,0,-1,2,Q)||[],Z&&(B=na(Z,1).concat(B)),ne&&(B=B.concat(na(ne,-1)))),B}(F,C)).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,C,P){return 32*((1<<I)*P+C)+I}function Mo(I,C){var P=I.tileID.canonical;if(!this._geoJSONIndex)return C(null,null);var F=this._geoJSONIndex.getTile(P.z,P.x,P.y);if(!F)return C(null,null);var j=new Xt(F.features),Q=Xr(j);Q.byteOffset===0&&Q.byteLength===Q.buffer.byteLength||(Q=new Uint8Array(Q)),C(null,{vectorTile:j,rawData:Q.buffer})}Vr.prototype.load=function(I){var C=this.options,P=C.log,F=C.minZoom,j=C.maxZoom,Q=C.nodeSize;P&&console.time("total time");var te="prepare "+I.length+" points";P&&console.time(te),this.points=I;for(var B=[],Z=0;Z<I.length;Z++)I[Z].geometry&&B.push(Rt(I[Z],Z));this.trees[j+1]=new mn(B,Kr,_i,Q,Float32Array),P&&console.timeEnd(te);for(var ne=j;ne>=F;ne--){var xe=+Date.now();B=this._cluster(B,ne),this.trees[ne]=new mn(B,Kr,_i,Q,Float32Array),P&&console.log("z%d: %d clusters in %dms",ne,B.length,+Date.now()-xe)}return P&&console.timeEnd("total time"),this},Vr.prototype.getClusters=function(I,C){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,Q=Math.max(-90,Math.min(90,I[3]));if(I[2]-I[0]>=360)P=-180,j=180;else if(P>j){var te=this.getClusters([P,F,180,Q],C),B=this.getClusters([-180,F,j,Q],C);return te.concat(B)}for(var Z=this.trees[this._limitZoom(C)],ne=[],xe=0,we=Z.range(Di(P),yt(Q),Di(j),yt(F));xe<we.length;xe+=1){var fe=Z.points[we[xe]];ne.push(fe.numPoints?Gi(fe):this.points[fe.index])}return ne},Vr.prototype.getChildren=function(I){var C=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 Q=j.points[C];if(!Q)throw new Error(F);for(var te=this.options.radius/(this.options.extent*Math.pow(2,P-1)),B=[],Z=0,ne=j.within(Q.x,Q.y,te);Z<ne.length;Z+=1){var xe=j.points[ne[Z]];xe.parentId===I&&B.push(xe.numPoints?Gi(xe):this.points[xe.index])}if(B.length===0)throw new Error(F);return B},Vr.prototype.getLeaves=function(I,C,P){var F=[];return this._appendLeaves(F,I,C=C||10,P=P||0,0),F},Vr.prototype.getTile=function(I,C,P){var F=this.trees[this._limitZoom(I)],j=Math.pow(2,I),Q=this.options,te=Q.radius/Q.extent,B=(P-te)/j,Z=(P+1+te)/j,ne={features:[]};return this._addTileFeatures(F.range((C-te)/j,B,(C+1+te)/j,Z),F.points,C,P,j,ne),C===0&&this._addTileFeatures(F.range(1-te/j,B,1,Z),F.points,j,P,j,ne),C===j-1&&this._addTileFeatures(F.range(0,B,te/j,Z),F.points,-1,P,j,ne),ne.features.length?ne:null},Vr.prototype.getClusterExpansionZoom=function(I){for(var C=this._getOriginZoom(I)-1;C<=this.options.maxZoom;){var P=this.getChildren(I);if(C++,P.length!==1)break;I=P[0].properties.cluster_id}return C},Vr.prototype._appendLeaves=function(I,C,P,F,j){for(var Q=0,te=this.getChildren(C);Q<te.length;Q+=1){var B=te[Q],Z=B.properties;if(Z&&Z.cluster?j+Z.point_count<=F?j+=Z.point_count:j=this._appendLeaves(I,Z.cluster_id,P,F,j):j<F?j++:I.push(B),I.length===P)break}return j},Vr.prototype._addTileFeatures=function(I,C,P,F,j,Q){for(var te=0,B=I;te<B.length;te+=1){var Z=C[B[te]],ne=Z.numPoints,xe={type:1,geometry:[[Math.round(this.options.extent*(Z.x*j-P)),Math.round(this.options.extent*(Z.y*j-F))]],tags:ne?Eo(Z):this.points[Z.index].properties},we=void 0;ne?we=Z.id:this.options.generateId?we=Z.index:this.points[Z.index].id&&(we=this.points[Z.index].id),we!==void 0&&(xe.id=we),Q.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,C){for(var P=[],F=this.options,j=F.reduce,Q=F.minPoints,te=F.radius/(F.extent*Math.pow(2,C)),B=0;B<I.length;B++){var Z=I[B];if(!(Z.zoom<=C)){Z.zoom=C;for(var ne=this.trees[C+1],xe=ne.within(Z.x,Z.y,te),we=Z.numPoints||1,fe=we,be=0,Ue=xe;be<Ue.length;be+=1){var Oe=ne.points[Ue[be]];Oe.zoom>C&&(fe+=Oe.numPoints||1)}if(fe>=Q){for(var de=Z.x*we,Be=Z.y*we,Ee=j&&we>1?this._map(Z,!0):null,Pe=(B<<5)+(C+1)+this.points.length,ut=0,Me=xe;ut<Me.length;ut+=1){var vt=ne.points[Me[ut]];if(!(vt.zoom<=C)){vt.zoom=C;var Ft=vt.numPoints||1;de+=vt.x*Ft,Be+=vt.y*Ft,vt.parentId=Pe,j&&(Ee||(Ee=this._map(Z,!0)),j(Ee,this._map(vt)))}}Z.parentId=Pe,P.push(rn(de/fe,Be/fe,Pe,fe,Ee))}else if(P.push(Z),fe>1)for(var pt=0,At=xe;pt<At.length;pt+=1){var _t=ne.points[At[pt]];_t.zoom<=C||(_t.zoom=C,P.push(_t))}}}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,C){if(I.numPoints)return C?yn({},I.properties):I.properties;var P=this.points[I.index].properties,F=this.options.map(P);return C&&F===P?yn({},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,C,P,F,j,Q,te){for(var B=[I,C,P,F],Z=this.options,ne=Z.debug;B.length;){F=B.pop(),P=B.pop(),C=B.pop(),I=B.pop();var xe=1<<C,we=on(C,P,F),fe=this.tiles[we];if(!fe&&(ne>1&&console.time("creation"),fe=this.tiles[we]=Wa(I,C,P,F,Z),this.tileCoords.push({z:C,x:P,y:F}),ne)){ne>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",C,P,F,fe.numFeatures,fe.numPoints,fe.numSimplified),console.timeEnd("creation"));var be="z"+C;this.stats[be]=(this.stats[be]||0)+1,this.total++}if(fe.source=I,j){if(C===Z.maxZoom||C===j)continue;var Ue=1<<j-C;if(P!==Math.floor(Q/Ue)||F!==Math.floor(te/Ue))continue}else if(C===Z.indexMaxZoom||fe.numPoints<=Z.indexMaxPoints)continue;if(fe.source=null,I.length!==0){ne>1&&console.time("clipping");var Oe,de,Be,Ee,Pe,ut,Me=.5*Z.buffer/Z.extent,vt=.5-Me,Ft=.5+Me,pt=1+Me;Oe=de=Be=Ee=null,Pe=Ri(I,xe,P-Me,P+Ft,0,fe.minX,fe.maxX,Z),ut=Ri(I,xe,P+vt,P+pt,0,fe.minX,fe.maxX,Z),I=null,Pe&&(Oe=Ri(Pe,xe,F-Me,F+Ft,1,fe.minY,fe.maxY,Z),de=Ri(Pe,xe,F+vt,F+pt,1,fe.minY,fe.maxY,Z),Pe=null),ut&&(Be=Ri(ut,xe,F-Me,F+Ft,1,fe.minY,fe.maxY,Z),Ee=Ri(ut,xe,F+vt,F+pt,1,fe.minY,fe.maxY,Z),ut=null),ne>1&&console.timeEnd("clipping"),B.push(Oe||[],C+1,2*P,2*F),B.push(de||[],C+1,2*P,2*F+1),B.push(Be||[],C+1,2*P+1,2*F),B.push(Ee||[],C+1,2*P+1,2*F+1)}}},nn.prototype.getTile=function(I,C,P){var F=this.options,j=F.extent,Q=F.debug;if(I<0||I>24)return null;var te=1<<I,B=on(I,C=(C%te+te)%te,P);if(this.tiles[B])return oa(this.tiles[B],j);Q>1&&console.log("drilling down to z%d-%d-%d",I,C,P);for(var Z,ne=I,xe=C,we=P;!Z&&ne>0;)ne--,xe=Math.floor(xe/2),we=Math.floor(we/2),Z=this.tiles[on(ne,xe,we)];return Z&&Z.source?(Q>1&&console.log("found parent tile z%d-%d-%d",ne,xe,we),Q>1&&console.time("drilling down"),this.splitTile(Z.source,ne,xe,we,I,C,P),Q>1&&console.timeEnd("drilling down"),this.tiles[B]?oa(this.tiles[B],j):null):null};var sa=function(I){function C(P,F,j,Q){I.call(this,P,F,j,Mo),Q&&(this.loadGeoJSON=Q)}return I&&(C.__proto__=I),(C.prototype=Object.create(I&&I.prototype)).constructor=C,C.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())},C.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 Q=!!(j&&j.request&&j.request.collectResourceTiming)&&new l.RequestPerformance(j.request);this.loadGeoJSON(j,function(te,B){if(te||!B)return F(te);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")It(be.coordinates,Ue);else if(de==="MultiPolygon")for(Oe=0;Oe<be.coordinates.length;Oe++)It(be.coordinates[Oe],Ue);return be})(B,!0);try{if(j.filter){var Z=l.createExpression(j.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Z.result==="error")throw new Error(Z.value.map(function(fe){return fe.key+": "+fe.message}).join(", "));var ne=B.features.filter(function(fe){return Z.value.evaluate({zoom:0},fe)});B={type:"FeatureCollection",features:ne}}P._geoJSONIndex=j.cluster?new Vr(function(fe){var be=fe.superclusterOptions,Ue=fe.clusterProperties;if(!Ue||!be)return be;for(var Oe={},de={},Be={accumulated:null,zoom:0},Ee={properties:null},Pe=Object.keys(Ue),ut=0,Me=Pe;ut<Me.length;ut+=1){var vt=Me[ut],Ft=Ue[vt],pt=Ft[0],At=l.createExpression(Ft[1]),_t=l.createExpression(typeof pt=="string"?[pt,["accumulated"],["get",vt]]:pt);Oe[vt]=At.value,de[vt]=_t.value}return be.map=function(Ur){Ee.properties=Ur;for(var Pt={},ir=0,zt=Pe;ir<zt.length;ir+=1){var mt=zt[ir];Pt[mt]=Oe[mt].evaluate(Be,Ee)}return Pt},be.reduce=function(Ur,Pt){Ee.properties=Pt;for(var ir=0,zt=Pe;ir<zt.length;ir+=1){var mt=zt[ir];Be.accumulated=Ur[mt],Ur[mt]=de[mt].evaluate(Be,Ee)}},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(Q){var we=Q.finish();we&&(xe.resourceTiming={},xe.resourceTiming[j.source]=JSON.parse(JSON.stringify(we)))}F(null,xe)})}},C.prototype.coalesce=function(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())},C.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)},C.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."))}}},C.prototype.removeSource=function(P,F){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),F()},C.prototype.getClusterExpansionZoom=function(P,F){try{F(null,this._geoJSONIndex.getClusterExpansionZoom(P.clusterId))}catch(j){F(j)}},C.prototype.getClusterChildren=function(P,F){try{F(null,this._geoJSONIndex.getChildren(P.clusterId))}catch(j){F(j)}},C.prototype.getClusterLeaves=function(P,F){try{F(null,this._geoJSONIndex.getLeaves(P.clusterId,P.limit,P.offset))}catch(j){F(j)}},C}(Re),rr=function(I){var C=this;this.self=I,this.actor=new l.Actor(I,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:Re,geojson:sa},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(P,F){if(C.workerSourceTypes[P])throw new Error('Worker source with name "'+P+'" already registered.');C.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 rr.prototype.setReferrer=function(I,C){this.referrer=C},rr.prototype.setImages=function(I,C,P){for(var F in this.availableImages[I]=C,this.workerSources[I]){var j=this.workerSources[I][F];for(var Q in j)j[Q].availableImages=C}P()},rr.prototype.setLayers=function(I,C,P){this.getLayerIndex(I).replace(C),P()},rr.prototype.updateLayers=function(I,C,P){this.getLayerIndex(I).update(C.layers,C.removedIds),P()},rr.prototype.loadTile=function(I,C,P){this.getWorkerSource(I,C.type,C.source).loadTile(C,P)},rr.prototype.loadDEMTile=function(I,C,P){this.getDEMWorkerSource(I,C.source).loadTile(C,P)},rr.prototype.reloadTile=function(I,C,P){this.getWorkerSource(I,C.type,C.source).reloadTile(C,P)},rr.prototype.abortTile=function(I,C,P){this.getWorkerSource(I,C.type,C.source).abortTile(C,P)},rr.prototype.removeTile=function(I,C,P){this.getWorkerSource(I,C.type,C.source).removeTile(C,P)},rr.prototype.removeDEMTile=function(I,C){this.getDEMWorkerSource(I,C.source).removeTile(C)},rr.prototype.removeSource=function(I,C,P){if(this.workerSources[I]&&this.workerSources[I][C.type]&&this.workerSources[I][C.type][C.source]){var F=this.workerSources[I][C.type][C.source];delete this.workerSources[I][C.type][C.source],F.removeSource!==void 0?F.removeSource(C,P):P()}},rr.prototype.loadWorkerSource=function(I,C,P){try{this.self.importScripts(C.url),P()}catch(F){P(F.toString())}},rr.prototype.syncRTLPluginState=function(I,C,P){try{l.plugin.setState(C);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(Q){P(Q.toString())}},rr.prototype.getAvailableImages=function(I){var C=this.availableImages[I];return C||(C=[]),C},rr.prototype.getLayerIndex=function(I){var C=this.layerIndexes[I];return C||(C=this.layerIndexes[I]=new ve),C},rr.prototype.getWorkerSource=function(I,C,P){var F=this;return this.workerSources[I]||(this.workerSources[I]={}),this.workerSources[I][C]||(this.workerSources[I][C]={}),this.workerSources[I][C][P]||(this.workerSources[I][C][P]=new this.workerSourceTypes[C]({send:function(j,Q,te){F.actor.send(j,Q,te,I)}},this.getLayerIndex(I),this.getAvailableImages(I))),this.workerSources[I][C][P]},rr.prototype.getDEMWorkerSource=function(I,C){return this.demWorkerSources[I]||(this.demWorkerSources[I]={}),this.demWorkerSources[I][C]||(this.demWorkerSources[I][C]=new je),this.demWorkerSources[I][C]},rr.prototype.enforceCacheSizeLimit=function(I,C){l.enforceCacheSizeLimit(C)},typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new rr(self)),rr}),G(["./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 y,g,w=new Blob([""],{type:"text/javascript"}),A=URL.createObjectURL(w);try{g=new Worker(A),y=!0}catch{y=!1}return g&&g.terminate(),URL.revokeObjectURL(A),y}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var y=document.createElement("canvas");y.width=y.height=1;var g=y.getContext("2d");if(!g)return!1;var w=g.getImageData(0,0,1,1);return w&&w.width===y.width}()?(s[f=p&&p.failIfMajorPerformanceCaveat]===void 0&&(s[f]=function(y){var g=function(A){var z=document.createElement("canvas"),D=Object.create(o.webGLContextAttributes);return D.failIfMajorPerformanceCaveat=A,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)}(y);if(!g)return!1;var w=g.createShader(g.VERTEX_SHADER);return!(!w||g.isContextLost())&&(g.shaderSource(w,"void main() {}"),g.compileShader(w),g.getShaderParameter(w,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}}),W={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)}},ve=l.window.document&&l.window.document.documentElement.style;function me(i){if(!ve)return i[0];for(var o=0;o<i.length;o++)if(i[o]in ve)return i[o];return i[0]}var Le,le=me(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);W.disableDrag=function(){ve&&le&&(Le=ve[le],ve[le]="none")},W.enableDrag=function(){ve&&le&&(ve[le]=Le)};var ge=me(["transform","WebkitTransform"]);W.setTransform=function(i,o){i.style[ge]=o};var Re=!1;try{var Ye=Object.defineProperty({},"passive",{get:function(){Re=!0}});l.window.addEventListener("test",Ye,Ye),l.window.removeEventListener("test",Ye,Ye)}catch{Re=!1}W.addEventListener=function(i,o,n,s){s===void 0&&(s={}),i.addEventListener(o,n,"passive"in s&&Re?s:s.capture)},W.removeEventListener=function(i,o,n,s){s===void 0&&(s={}),i.removeEventListener(o,n,"passive"in s&&Re?s:s.capture)};var je=function(i){i.preventDefault(),i.stopPropagation(),l.window.removeEventListener("click",je,!0)};function It(i){var o=i.userImage;return!!(o&&o.render&&o.render())&&(i.data.replace(new Uint8Array(o.data.buffer)),!0)}W.suppressClick=function(){l.window.addEventListener("click",je,!0),l.window.setTimeout(function(){l.window.removeEventListener("click",je,!0)},0)},W.mousePos=function(i,o){var n=i.getBoundingClientRect();return new l.Point(o.clientX-n.left-i.clientLeft,o.clientY-n.top-i.clientTop)},W.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},W.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},W.remove=function(i){i.parentNode&&i.parentNode.removeChild(i)};var tt=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,y=n;f<y.length;f+=1){var g=y[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,y=n;f<y.length;f+=1)this.images[y[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,y=n;f<y.length;f+=1){var g=y[f];this.images[g]||this.fire(new l.Event("styleimagemissing",{id:g}));var w=this.images[g];w?p[g]={data:w.data.clone(),pixelRatio:w.pixelRatio,sdf:w.sdf,version:w.version,stretchX:w.stretchX,stretchY:w.stretchY,content:w.content,hasRenderCallback:!!(w.userImage&&w.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},y=new l.ImagePosition(f,p);this.patterns[n]={bin:f,position:y}}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,y=p.h,g=this.atlasImage;for(var w in g.resize({width:f||1,height:y||1}),this.patterns){var A=this.patterns[w].bin,z=A.x+1,D=A.y+1,L=this.images[w].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 y=this.images[f];It(y)&&this.updateImage(f,y)}}},o}(l.Evented),dt=Kt,Dt=Kt,Xt=1e20;function Kt(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 y=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=y,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(y*y),this.gridInner=new Float64Array(y*y),this.f=new Float64Array(y),this.d=new Float64Array(y),this.z=new Float64Array(y+1),this.v=new Int16Array(y),this.middle=Math.round(y/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function ur(i,o,n,s,p,f,y){for(var g=0;g<o;g++){for(var w=0;w<n;w++)s[w]=i[w*o+g];for(Sr(s,p,f,y,n),w=0;w<n;w++)i[w*o+g]=p[w]}for(w=0;w<n;w++){for(g=0;g<o;g++)s[g]=i[w*o+g];for(Sr(s,p,f,y,o),g=0;g<o;g++)i[w*o+g]=Math.sqrt(p[g])}}function Sr(i,o,n,s,p){n[0]=0,s[0]=-1e20,s[1]=1e20;for(var f=1,y=0;f<p;f++){for(var g=(i[f]+f*f-(i[n[y]]+n[y]*n[y]))/(2*f-2*n[y]);g<=s[y];)y--,g=(i[f]+f*f-(i[n[y]]+n[y]*n[y]))/(2*f-2*n[y]);n[++y]=f,s[y]=g,s[y+1]=1e20}for(f=0,y=0;f<p;f++){for(;s[y+1]<f;)y++;o[f]=(f-n[y])*(f-n[y])+i[n[y]]}}Kt.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?Xt:Math.pow(Math.max(0,.5-p),2),this.gridInner[s]=p===1?Xt:p===0?0:Math.pow(Math.max(0,p-.5),2)}for(ur(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),ur(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},dt.default=Dt;var cr=function(i,o){this.requestManager=i,this.localIdeographFontFamily=o,this.entries={}};cr.prototype.setURL=function(i){this.url=i},cr.prototype.getGlyphs=function(i,o){var n=this,s=[];for(var p in i)for(var f=0,y=i[p];f<y.length;f+=1)s.push({stack:p,id:y[f]});l.asyncAll(s,function(g,w){var A=g.stack,z=g.id,D=n.entries[A];D||(D=n.entries[A]={glyphs:{},requests:{},ranges:{}});var L=D.glyphs[z];if(L===void 0){if(L=n._tinySDF(D,A,z))return D.glyphs[z]=L,void w(null,{stack:A,id:z,glyph:L});var $=Math.floor(z/256);if(256*$>65535)w(new Error("glyphs > 65535 not supported"));else if(D.ranges[$])w(null,{stack:A,id:z,glyph:L});else{var q=D.requests[$];q||(q=D.requests[$]=[],cr.loadGlyphRange(A,$,n.url,n.requestManager,function(K,V){if(V){for(var X in V)n._doesCharSupportLocalGlyph(+X)||(D.glyphs[+X]=V[+X]);D.ranges[$]=!0}for(var ee=0,ie=q;ee<ie.length;ee+=1)(0,ie[ee])(K,V);delete D.requests[$]})),q.push(function(K,V){K?w(K):V&&w(null,{stack:A,id:z,glyph:V[z]||null})})}}else w(null,{stack:A,id:z,glyph:L})},function(g,w){if(g)o(g);else if(w){for(var A={},z=0,D=w;z<D.length;z+=1){var L=D[z],$=L.stack,q=L.id,K=L.glyph;(A[$]||(A[$]={}))[q]=K&&{id:K.id,bitmap:K.bitmap.clone(),metrics:K.metrics}}o(null,A)}})},cr.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))},cr.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 cr.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}}}},cr.loadGlyphRange=function(i,o,n,s,p){var f=256*o,y=f+255,g=s.transformRequest(s.normalizeGlyphsURL(n).replace("{fontstack}",i).replace("{range}",f+"-"+y),l.ResourceType.Glyphs);l.getArrayBuffer(g,function(w,A){if(w)p(w);else if(A){for(var z={},D=0,L=l.parseGlyphPBF(A);D<L.length;D+=1){var $=L[D];z[$.id]=$}p(null,z)}})},cr.TinySDF=dt;var Xr=function(){this.specification=l.styleSpec.light.position};Xr.prototype.possiblyEvaluate=function(i,o){return l.sphericalToCartesian(i.expression.evaluate(o))},Xr.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 gr=new l.Properties({anchor:new l.DataConstantProperty(l.styleSpec.light.anchor),position:new Xr,color:new l.DataConstantProperty(l.styleSpec.light.color),intensity:new l.DataConstantProperty(l.styleSpec.light.intensity)}),gi=function(i){function o(n){i.call(this),this._transitionable=new l.Transitionable(gr),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,y=!0;s.push({left:p,right:f,isDash:y,zeroLength:i[0]===0});for(var g=i[0],w=1;w<i.length;w++){var A=i[w];s.push({left:p=g*n,right:f=(g+=A)*n,isDash:y=!y,zeroLength:A===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),y=0,g=i[y],w=0;w<this.width;w++){w/g.right>1&&(g=i[++y]);var A=Math.abs(w-g.left),z=Math.abs(w-g.right),D=Math.min(A,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+w]=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 y=this.width*this.nextRow,g=0,w=i[g],A=0;A<this.width;A++){A/w.right>1&&(w=i[++g]);var z=Math.abs(A-w.left),D=Math.abs(A-w.right),L=Math.min(z,D);this.data[y+A]=Math.max(0,Math.min(255,(w.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 y=this.width/p,g=this.getDashRanges(i,this.width,y);o?this.addRoundDash(g,y,n):this.addRegularDash(g)}var w={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:p};return this.nextRow+=s,this.dirty=!0,w},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 y=l.pick(l.extend(f,i),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);f.vector_layers&&(y.vectorLayers=f.vector_layers,y.vectorLayerIds=y.vectorLayers.map(function(g){return g.id})),y.tiles=o.canonicalizeTileset(y,i.url),n(null,y)}};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 y(g,w){return delete n.request,n.aborted?s(null):g&&g.status!==404?s(g):(w&&w.resourceTiming&&(n.resourceTiming=w.resourceTiming),this.map._refreshExpiredTiles&&w&&n.setExpiryData(w),n.loadVectorData(w,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,y.bind(this)):(n.actor=this.dispatcher.getActor(),n.request=n.actor.send("loadTile",f,y.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),Ao=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(y,g){if(delete n.request,n.aborted)n.state="unloaded",s(null);else if(y)n.state="errored",s(y);else if(g){p.map._refreshExpiredTiles&&n.setExpiryData(g),delete g.cacheControl,delete g.expires;var w=p.map.painter.context,A=w.gl;n.texture=p.map.painter.getTileTexture(g.width),n.texture?n.texture.update(g,{useMipmap:!0}):(n.texture=new l.Texture(w,g,A.RGBA,{useMipmap:!0}),n.texture.bind(A.LINEAR,A.CLAMP_TO_EDGE,A.LINEAR_MIPMAP_NEAREST),w.extTextureFilterAnisotropic&&A.texParameterf(A.TEXTURE_2D,w.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,w.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(y,g){y&&(n.state="errored",s(y)),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(y,g){if(delete n.request,n.aborted)n.state="unloaded",s(null);else if(y)n.state="errored",s(y);else if(g){this.map._refreshExpiredTiles&&n.setExpiryData(g),delete g.cacheControl,delete g.expires;var w=l.window.ImageBitmap&&g instanceof l.window.ImageBitmap&&l.offscreenCanvasSupported()?g:l.browser.getImageData(g,1),A={uid:n.uid,coord:n.tileID,source:this.id,rawImageData:w,encoding:this.encoding};n.actor&&n.state!=="expired"||(n.actor=this.dispatcher.getActor(),n.actor.send("loadDEMTile",A,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,y=s.x===0?n.wrap-1:n.wrap,g=(s.x+1+p)%p,w=s.x+1===p?n.wrap+1:n.wrap,A={};return A[new l.OverscaledTileID(n.overscaledZ,y,s.z,f,s.y).key]={backfilled:!1},A[new l.OverscaledTileID(n.overscaledZ,w,s.z,g,s.y).key]={backfilled:!1},s.y>0&&(A[new l.OverscaledTileID(n.overscaledZ,y,s.z,f,s.y-1).key]={backfilled:!1},A[new l.OverscaledTileID(n.overscaledZ,n.wrap,s.z,s.x,s.y-1).key]={backfilled:!1},A[new l.OverscaledTileID(n.overscaledZ,w,s.z,g,s.y-1).key]={backfilled:!1}),s.y+1<p&&(A[new l.OverscaledTileID(n.overscaledZ,y,s.z,f,s.y+1).key]={backfilled:!1},A[new l.OverscaledTileID(n.overscaledZ,n.wrap,s.z,s.x,s.y+1).key]={backfilled:!1},A[new l.OverscaledTileID(n.overscaledZ,w,s.z,g,s.y+1).key]={backfilled:!1}),A},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}(Ao),dn=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 y=l.EXTENT/this.tileSize;this.workerOptions=l.extend({source:this.id,cluster:s.cluster||!1,geojsonVtOptions:{buffer:(s.buffer!==void 0?s.buffer:128)*y,tolerance:(s.tolerance!==void 0?s.tolerance:.375)*y,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)*y,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(y,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(y))})},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(y,g){return delete n.request,n.unloadVectorData(),n.aborted?s(null):y?s(y):(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),Bi=l.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),Zi=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,y){p._loaded=!0,f?p.fire(new l.ErrorEvent(f)):y&&(p.image=y,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(y){for(var g=1/0,w=1/0,A=-1/0,z=-1/0,D=0,L=y;D<L.length;D+=1){var $=L[D];g=Math.min(g,$.x),w=Math.min(w,$.y),A=Math.max(A,$.x),z=Math.max(z,$.y)}var q=Math.max(A-g,z-w),K=Math.max(0,Math.floor(-Math.log(q)/Math.LN2)),V=Math.pow(2,K);return new l.CanonicalTileID(K,Math.floor((g+A)/2*V),Math.floor((w+z)/2*V))}(p),this.minzoom=this.maxzoom=this.tileID.z;var f=p.map(function(y){return s.tileID.getTilePoint(y)._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,Bi.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),qn=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(y,g){n._loaded=!0,y?n.fire(new l.ErrorEvent(y)):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,Bi.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}(Zi),jn=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(y){return!Array.isArray(y)||y.length!==2||y.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,Bi.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 y=this.tiles[f];y.state!=="loaded"&&(y.state="loaded",y.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}(Zi),mn={vector:Io,raster:Ao,"raster-dem":ja,geojson:dn,video:qn,image:Zi,canvas:jn};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 y=function(K,V,X){if(K)for(var ee=0,ie=K;ee<ie.length;ee+=1){var pe=V[ie[ee]];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(),w=i.tilesIn(s,g,y);w.sort(rn);for(var A=[],z=0,D=w;z<D.length;z+=1){var L=D[z];A.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(K){for(var V={},X={},ee=0,ie=K;ee<ie.length;ee+=1){var pe=ie[ee],ue=pe.queryResults,he=pe.wrappedTileID,_e=X[he]=X[he]||{};for(var Ie in ue)for(var Te=ue[Ie],De=_e[Ie]=_e[Ie]||{},Ge=V[Ie]=V[Ie]||[],Ke=0,Xe=Te;Ke<Xe.length;Ke+=1){var bt=Xe[Ke];De[bt.featureIndex]||(De[bt.featureIndex]=!0,Ge.push(bt))}}return V}(A);for(var q in $)$[q].forEach(function(K){var V=K.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 y=this._getAndRemoveByKey(this.order[0]);y&&this.onRemove(y)}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 y=0,g=o;y<g.length;y+=1){var w=g[y];this.remove(w.value.tileID,w)}};var Gi=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};Gi.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Gi.prototype.updateData=function(i){var o=this.context.gl;this.context.unbindVAO(),this.bind(),o.bufferSubData(o.ELEMENT_ARRAY_BUFFER,0,i.arrayBuffer)},Gi.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var Eo={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},Di=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};Di.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},Di.prototype.updateData=function(i){var o=this.context.gl;this.bind(),o.bufferSubData(o.ARRAY_BUFFER,0,i.arrayBuffer)},Di.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)}},Di.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[Eo[p.type]],!1,this.itemSize,p.offset+this.itemSize*(n||0))}},Di.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var yt=function(i){this.gl=i.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};yt.prototype.get=function(){return this.current},yt.prototype.set=function(i){},yt.prototype.getDefault=function(){return this.default},yt.prototype.setDefault=function(){this.set(this.default)};var yn=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}(yt),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}(yt),_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.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}(yt),Js=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}(yt),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.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}(yt),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}(yt),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{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}(yt),$n=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}(yt),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}(yt),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[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}(yt),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!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}(yt),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(){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}(yt),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!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}(yt),$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}(yt),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}(yt),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}(yt),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}(yt),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}(yt),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}(yt),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}(yt),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}(yt),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(){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}(yt),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}(yt),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}(yt),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}(yt),Ha=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}(yt),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(){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}(yt),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}(yt),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}(yt),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}(yt),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}(yt),rr=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}(yt),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}(rr),C=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}(rr),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 C(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 Q=function(i,o,n){this.blendFunction=i,this.blendColor=o,this.mask=n};Q.disabled=new Q(Q.Replace=[1,0],l.Color.transparent,[!1,!1,!1,!1]),Q.unblended=new Q(Q.Replace,l.Color.transparent,[!0,!0,!0,!0]),Q.alphaBlended=new Q([1,771],l.Color.transparent,[!0,!0,!0,!0]);var te=function(i,o,n){this.enable=i,this.mode=o,this.frontFace=n};te.disabled=new te(!1,1029,2305),te.backCCW=new te(!0,1029,2305);var B=function(i){this.gl=i,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new yn(this),this.clearDepth=new Kr(this),this.clearStencil=new _i(this),this.colorMask=new Js(this),this.depthMask=new Li(this),this.stencilMask=new ta(this),this.stencilFunc=new xi(this),this.stencilOp=new $n(this),this.stencilTest=new Co(this),this.depthRange=new bi(this),this.depthTest=new wi(this),this.depthFunc=new Zn(this),this.blend=new Ri(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 Gn(this),this.bindFramebuffer=new oa(this),this.bindRenderbuffer=new aa(this),this.bindTexture=new Wa(this),this.bindVertexBuffer=new Ha(this),this.bindElementBuffer=new Wn(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 Gi(this,i,o)},B.prototype.createVertexBuffer=function(i,o,n){return new Di(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,Q.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 Z=function(i){function o(n,s,p){var f=this;i.call(this),this.id=n,this.dispatcher=p,this.on("data",function(y){y.dataType==="source"&&y.sourceDataType==="metadata"&&(f._sourceLoaded=!0),f._sourceLoaded&&!f._paused&&y.dataType==="source"&&y.sourceDataType==="content"&&(f.reload(),f.transform&&f.update(f.transform))}),this.on("error",function(){f._sourceErrored=!0}),this._source=function(y,g,w,A){var z=new mn[g.type](y,g,w,A);if(z.id!==y)throw new Error("Expected Source id to be "+y+" 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(ne).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(y,g){var w=y.tileID,A=g.tileID,z=new l.Point(w.canonical.x,w.canonical.y)._rotate(s.transform.angle),D=new l.Point(A.canonical.x,A.canonical.y)._rotate(s.transform.angle);return w.overscaledZ-A.overscaledZ||D.y-z.y||D.x-z.x}).map(function(y){return y.tileID.key}):p.map(function(y){return y.tileID}).sort(ne).map(function(y){return y.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 y=this.getTileByID(f);g(n,y),g(y,n)}}function g(w,A){w.needsHillshadePrepare=!0;var z=A.tileID.canonical.x-w.tileID.canonical.x,D=A.tileID.canonical.y-w.tileID.canonical.y,L=Math.pow(2,w.tileID.canonical.z),$=A.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)),A.dem&&w.dem&&(w.dem.backfillBorder(A.dem,z,D),w.neighboringTiles&&w.neighboringTiles[$]&&(w.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 y in this._tiles){var g=this._tiles[y];if(!(f[y]||!g.hasData()||g.tileID.overscaledZ<=s||g.tileID.overscaledZ>p)){for(var w=g.tileID;g&&g.tileID.overscaledZ>s+1;){var A=g.tileID.scaledTo(g.tileID.overscaledZ-1);(g=this._tiles[A.key])&&g.hasData()&&(w=A)}for(var z=w;z.overscaledZ>s;)if(n[(z=z.scaledTo(z.overscaledZ-1)).key]){f[w.key]=w;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 y=n.scaledTo(f),g=this._getLoadedTile(y);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),y=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,f):f;this._cache.setMaxSize(y)},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 y=this._tiles[f];y.tileID=y.tileID.unwrapTo(y.tileID.wrap+s),p[y.tileID.key]=y}for(var g in this._tiles=p,this._timers)clearTimeout(this._timers[g]),delete this._timers[g];for(var w in this._tiles)this._setTileReloadTimer(w,this._tiles[w])}},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),y=Math.max(f-o.maxOverzooming,this._source.minzoom),g=Math.max(f+o.maxUnderzooming,this._source.minzoom),w=this._updateRetainedTiles(p,f);if(xe(this._source.type)){for(var A={},z={},D=0,L=Object.keys(w);D<L.length;D+=1){var $=L[D],q=w[$],K=this._tiles[$];if(K&&!(K.fadeEndTime&&K.fadeEndTime<=l.browser.now())){var V=this.findLoadedParent(q,y);V&&(this._addTile(V.tileID),A[V.tileID.key]=V.tileID),z[$]=q}}for(var X in this._retainLoadedChildren(z,f,g,w),A)w[X]||(this._coveredTiles[X]=!0,w[X]=A[X])}for(var ee in w)this._tiles[ee].clearFadeHold();for(var ie=0,pe=l.keysDifference(this._tiles,w);ie<pe.length;ie+=1){var ue=pe[ie],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={},y=Math.max(s-o.maxOverzooming,this._source.minzoom),g=Math.max(s+o.maxUnderzooming,this._source.minzoom),w={},A=0,z=n;A<z.length;A+=1){var D=z[A],L=this._addTile(D);p[D.key]=D,L.hasData()||s<this._source.maxzoom&&(w[D.key]=D)}this._retainLoadedChildren(w,s,g,p);for(var $=0,q=n;$<q.length;$+=1){var K=q[$],V=this._tiles[K.key];if(!V.hasData()){if(s+1>this._source.maxzoom){var X=K.children(this._source.maxzoom)[0],ee=this.getTile(X);if(ee&&ee.hasData()){p[X.key]=X;continue}}else{var ie=K.children(this._source.maxzoom);if(p[ie[0].key]&&p[ie[1].key]&&p[ie[2].key]&&p[ie[3].key])continue}for(var pe=V.wasRequested(),ue=K.overscaledZ-1;ue>=y;--ue){var he=K.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 y=f.scaledTo(f.overscaledZ-1);if(p=this._getLoadedTile(y))break;f=y}for(var g=0,w=s;g<w.length;g+=1)this._loadedParentTiles[w[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,y=[],g=this.transform;if(!g)return y;for(var w=p?g.getCameraQueryGeometry(n):n,A=n.map(function(ue){return g.pointCoordinate(ue)}),z=w.map(function(ue){return g.pointCoordinate(ue)}),D=this.getIds(),L=1/0,$=1/0,q=-1/0,K=-1/0,V=0,X=z;V<X.length;V+=1){var ee=X[V];L=Math.min(L,ee.x),$=Math.min($,ee.y),q=Math.max(q,ee.x),K=Math.max(K,ee.y)}for(var ie=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,De=[_e.getTilePoint(new l.MercatorCoordinate(L,$)),_e.getTilePoint(new l.MercatorCoordinate(q,K))];if(De[0].x-Te<l.EXTENT&&De[0].y-Te<l.EXTENT&&De[1].x+Te>=0&&De[1].y+Te>=0){var Ge=A.map(function(Xe){return _e.getTilePoint(Xe)}),Ke=z.map(function(Xe){return _e.getTilePoint(Xe)});y.push({tile:he,tileID:_e,queryGeometry:Ge,cameraQueryGeometry:Ke,scale:Ie})}}},pe=0;pe<D.length;pe++)ie(pe);return y},o.prototype.getVisibleCoordinates=function(n){for(var s=this,p=this.getRenderableIds(n).map(function(w){return s._tiles[w].tileID}),f=0,y=p;f<y.length;f+=1){var g=y[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 ne(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)}Z.maxOverzooming=10,Z.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 Be(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 Ee(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]=Be(i[s],o[i[s].ref]));return i}be.workerCount=Math.max(Math.min(Oe,6),1);var Pe={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:Pe.addSource,args:[i,o[i]]})}function Me(i,o,n){o.push({command:Pe.removeSource,args:[i]}),n[i]=!0}function vt(i,o,n,s){Me(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 y;for(y in o=o||{},i=i||{})i.hasOwnProperty(y)&&(l.deepEqual(i[y],o[y])||n.push({command:f,args:[s,y,o[y],p]}));for(y in o)o.hasOwnProperty(y)&&!i.hasOwnProperty(y)&&(l.deepEqual(i[y],o[y])||n.push({command:f,args:[s,y,o[y],p]}))}function At(i){return i.id}function _t(i,o){return i[o.id]=o,i}var Ur=function(i,o){this.reset(i,o)};Ur.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},Ur.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],y=n-f,g=y>0?(s-f)/y: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 ir(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 zt(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 mt(i,o){var n=[i.x,i.y,0,1];Ar(n,n,o);var s=n[3];return{point:new l.Point(n[0]/s,n[1]/s),signedDistanceFromCamera:s}}function Et(i,o){return .5+i/o*.5}function Jr(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,y,g){var w=s?i.textSizeData:i.iconSizeData,A=l.evaluateSizeForZoom(w,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,K=!1,V=0;V<$.length;V++){var X=$.get(V);if(X.hidden||X.writingMode===l.WritingMode.vertical&&!K)Nr(X.numGlyphs,D);else{K=!1;var ee=[X.anchorX,X.anchorY,0,1];if(l.transformMat4(ee,ee,o),Jr(ee,z)){var ie=Et(n.transform.cameraToCenterDistance,ee[3]),pe=l.evaluateSizeForFeature(w,A,X),ue=y?pe/ie:pe*ie,he=new l.Point(X.anchorX,X.anchorY),_e=mt(he,p).point,Ie={},Te=Ys(X,ue,!1,g,o,p,f,i.glyphOffsetArray,L,D,_e,he,Ie,q);K=Te.useVertical,(Te.notEnoughRoom||K||Te.needsFlipping&&Ys(X,ue,!0,g,o,p,f,i.glyphOffsetArray,L,D,_e,he,Ie,q).notEnoughRoom)&&Nr(X.numGlyphs,D)}else Nr(X.numGlyphs,D)}}s?i.text.dynamicLayoutVertexBuffer.updateData(D):i.icon.dynamicLayoutVertexBuffer.updateData(D)}function Ir(i,o,n,s,p,f,y,g,w,A,z){var D=g.glyphStartIndex+g.numGlyphs,L=g.lineStartIndex,$=g.lineStartIndex+g.lineLength,q=o.getoffsetX(g.glyphStartIndex),K=o.getoffsetX(D-1),V=nr(i*q,n,s,p,f,y,g.segment,L,$,w,A,z);if(!V)return null;var X=nr(i*K,n,s,p,f,y,g.segment,L,$,w,A,z);return X?{first:V,last:X}:null}function Yr(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 Ys(i,o,n,s,p,f,y,g,w,A,z,D,L,$){var q,K=o/24,V=i.lineOffsetX*K,X=i.lineOffsetY*K;if(i.numGlyphs>1){var ee=i.glyphStartIndex+i.numGlyphs,ie=i.lineStartIndex,pe=i.lineStartIndex+i.lineLength,ue=Ir(K,g,V,X,n,z,D,i,w,f,L);if(!ue)return{notEnoughRoom:!0};var he=mt(ue.first.point,y).point,_e=mt(ue.last.point,y).point;if(s&&!n){var Ie=Yr(i.writingMode,he,_e,$);if(Ie)return Ie}q=[ue.first];for(var Te=i.glyphStartIndex+1;Te<ee-1;Te++)q.push(nr(K*g.getoffsetX(Te),V,X,n,z,D,i.segment,ie,pe,w,f,L));q.push(ue.last)}else{if(s&&!n){var De=mt(D,p).point,Ge=i.lineStartIndex+i.segment+1,Ke=new l.Point(w.getx(Ge),w.gety(Ge)),Xe=mt(Ke,p),bt=Xe.signedDistanceFromCamera>0?Xe.point:ua(D,Ke,De,1,p),Fe=Yr(i.writingMode,De,bt,$);if(Fe)return Fe}var nt=nr(K*g.getoffsetX(i.glyphStartIndex),V,X,n,z,D,i.segment,i.lineStartIndex,i.lineStartIndex+i.lineLength,w,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(A,rt.point,rt.angle)}return{}}function ua(i,o,n,s,p){var f=mt(i.add(i.sub(o)._unit()),p).point,y=n.sub(f);return n.add(y._mult(s/y.mag()))}function nr(i,o,n,s,p,f,y,g,w,A,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 K=$>0?g+y:g+y+1,V=p,X=p,ee=0,ie=0,pe=Math.abs(L),ue=[];ee+ie<=pe;){if((K+=$)<g||K>=w)return null;if(X=V,ue.push(V),(V=D[K])===void 0){var he=new l.Point(A.getx(K),A.gety(K)),_e=mt(he,z);if(_e.signedDistanceFromCamera>0)V=D[K]=_e.point;else{var Ie=K-$;V=ua(ee===0?f:new l.Point(A.getx(Ie),A.gety(Ie)),he,X,pe-ee+1,z)}}ee+=ie,ie=X.dist(V)}var Te=(pe-ee)/ie,De=V.sub(X),Ge=De.mult(Te)._add(X);Ge._add(De._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 y=[];if(i<=0&&o<=0&&this.width<=n&&this.height<=s){if(p)return!0;for(var g=0;g<this.boxKeys.length;g++)y.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 w=0;w<this.circleKeys.length;w++){var A=this.circles[3*w],z=this.circles[3*w+1],D=this.circles[3*w+2];y.push({key:this.circleKeys[w],x1:A-D,y1:z-D,x2:A+D,y2:z+D})}return f?y.filter(f):y}return this._forEachCell(i,o,n,s,this._queryCell,y,{hitTest:p,seenUids:{box:{},circle:{}}},f),p?y.length>0:y},Pt.prototype._queryCircle=function(i,o,n,s,p){var f=i-n,y=i+n,g=o-n,w=o+n;if(y<0||f>this.width||w<0||g>this.height)return!s&&[];var A=[];return this._forEachCell(f,g,y,w,this._queryCellCircle,A,{hitTest:s,circle:{x:i,y:o,radius:n},seenUids:{box:{},circle:{}}},p),s?A.length>0:A},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,y,g){var w=y.seenUids,A=this.boxCells[p];if(A!==null)for(var z=this.bboxes,D=0,L=A;D<L.length;D+=1){var $=L[D];if(!w.box[$]){w.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(y.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 K=this.circleCells[p];if(K!==null)for(var V=this.circles,X=0,ee=K;X<ee.length;X+=1){var ie=ee[X];if(!w.circle[ie]){w.circle[ie]=!0;var pe=3*ie;if(this._circleAndRectCollide(V[pe],V[pe+1],V[pe+2],i,o,n,s)&&(!g||g(this.circleKeys[ie]))){if(y.hitTest)return f.push(!0),!0;var ue=V[pe],he=V[pe+1],_e=V[pe+2];f.push({key:this.circleKeys[ie],x1:ue-_e,y1:he-_e,x2:ue+_e,y2:he+_e})}}}},Pt.prototype._queryCellCircle=function(i,o,n,s,p,f,y,g){var w=y.circle,A=y.seenUids,z=this.boxCells[p];if(z!==null)for(var D=this.bboxes,L=0,$=z;L<$.length;L+=1){var q=$[L];if(!A.box[q]){A.box[q]=!0;var K=4*q;if(this._circleAndRectCollide(w.x,w.y,w.radius,D[K+0],D[K+1],D[K+2],D[K+3])&&(!g||g(this.boxKeys[q])))return f.push(!0),!0}}var V=this.circleCells[p];if(V!==null)for(var X=this.circles,ee=0,ie=V;ee<ie.length;ee+=1){var pe=ie[ee];if(!A.circle[pe]){A.circle[pe]=!0;var ue=3*pe;if(this._circlesCollide(X[ue],X[ue+1],X[ue+2],w.x,w.y,w.radius)&&(!g||g(this.circleKeys[pe])))return f.push(!0),!0}}},Pt.prototype._forEachCell=function(i,o,n,s,p,f,y,g){for(var w=this._convertToXCellCoord(i),A=this._convertToYCellCoord(o),z=this._convertToXCellCoord(n),D=this._convertToYCellCoord(s),L=w;L<=z;L++)for(var $=A;$<=D;$++)if(p.call(this,i,o,n,s,this.xCellCount*$+L,f,y,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 y=s-i,g=p-o,w=n+f;return w*w>y*y+g*g},Pt.prototype._circleAndRectCollide=function(i,o,n,s,p,f,y){var g=(f-s)/2,w=Math.abs(i-(s+g));if(w>g+n)return!1;var A=(y-p)/2,z=Math.abs(o-(p+A));if(z>A+n)return!1;if(w<=g||z<=A)return!0;var D=w-g,L=z-A;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 Nr(i,o){for(var n=0;n<i;n++){var s=o.length;o.resize(s+4),o.float32.set(ca,3*s)}}function Ar(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 Si=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 $t(i,o,n){return o*(l.EXTENT/(i.tileSize*Math.pow(2,n-i.tileID.overscaledZ)))}Si.prototype.placeCollisionBox=function(i,o,n,s,p){var f=this.projectAndGetPerspectiveRatio(s,i.anchorPointX,i.anchorPointY),y=n*f.perspectiveRatio,g=i.x1*y+f.point.x,w=i.y1*y+f.point.y,A=i.x2*y+f.point.x,z=i.y2*y+f.point.y;return!this.isInsideGrid(g,w,A,z)||!o&&this.grid.hitTest(g,w,A,z,p)?{box:[],offscreen:!1}:{box:[g,w,A,z],offscreen:this.isOffscreen(g,w,A,z)}},Si.prototype.placeCollisionCircles=function(i,o,n,s,p,f,y,g,w,A,z,D,L){var $=[],q=new l.Point(o.anchorX,o.anchorY),K=mt(q,f),V=Et(this.transform.cameraToCenterDistance,K.signedDistanceFromCamera),X=(A?p/V:p*V)/l.ONE_EM,ee=mt(q,y).point,ie=Ir(X,s,o.lineOffsetX*X,o.lineOffsetY*X,!1,ee,q,o,n,y,{}),pe=!1,ue=!1,he=!0;if(ie){for(var _e=.5*D*V+L,Ie=new l.Point(-100,-100),Te=new l.Point(this.screenRightBoundary,this.screenBottomBoundary),De=new Ur,Ge=ie.first,Ke=ie.last,Xe=[],bt=Ge.path.length-1;bt>=1;bt--)Xe.push(Ge.path[bt]);for(var Fe=1;Fe<Ke.path.length;Fe++)Xe.push(Ke.path[Fe]);var nt=2.5*_e;if(g){var st=Xe.map(function(Pi){return mt(Pi,g)});Xe=st.some(function(Pi){return Pi.signedDistanceFromCamera<=0})?[]:st.map(function(Pi){return Pi.point})}var it=[];if(Xe.length>0){for(var rt=Xe[0].clone(),at=Xe[0].clone(),et=1;et<Xe.length;et++)rt.x=Math.min(rt.x,Xe[et].x),rt.y=Math.min(rt.y,Xe[et].y),at.x=Math.max(at.x,Xe[et].x),at.y=Math.max(at.y,Xe[et].y);it=rt.x>=Ie.x&&at.x<=Te.x&&rt.y>=Ie.y&&at.y<=Te.y?[Xe]:at.x<Ie.x||rt.x>Te.x||at.y<Ie.y||rt.y>Te.y?[]:l.clipLine([Xe],Ie.x,Ie.y,Te.x,Te.y)}for(var Je=0,_r=it;Je<_r.length;Je+=1){var Qt;De.reset(_r[Je],.25*_e),Qt=De.length<=.5*_e?1:Math.ceil(De.paddedLength/nt)+1;for(var Rr=0;Rr<Qt;Rr++){var Cr=Rr/Math.max(Qt-1,1),Jt=De.lerp(Cr),or=Jt.x+100,ci=Jt.y+100;$.push(or,ci,_e,0);var Zr=or-_e,Mn=ci-_e,Qr=or+_e,ji=ci+_e;if(he=he&&this.isOffscreen(Zr,Mn,Qr,ji),ue=ue||this.isInsideGrid(Zr,Mn,Qr,ji),!i&&this.grid.hitTestCircle(or,ci,_e,z)&&(pe=!0,!w))return{circles:[],offscreen:!1,collisionDetected:pe}}}}return{circles:!w&&pe||!ue?[]:$,offscreen:he,collisionDetected:pe}},Si.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,y=0,g=i;y<g.length;y+=1){var w=g[y],A=new l.Point(w.x+100,w.y+100);n=Math.min(n,A.x),s=Math.min(s,A.y),p=Math.max(p,A.x),f=Math.max(f,A.y),o.push(A)}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],K=q.key;if(z[K.bucketInstanceId]===void 0&&(z[K.bucketInstanceId]={}),!z[K.bucketInstanceId][K.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[K.bucketInstanceId][K.featureIndex]=!0,D[K.bucketInstanceId]===void 0&&(D[K.bucketInstanceId]=[]),D[K.bucketInstanceId].push(K.featureIndex))}}return D},Si.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])},Si.prototype.insertCollisionCircles=function(i,o,n,s,p){for(var f=o?this.ignoredGrid:this.grid,y={bucketInstanceId:n,featureIndex:s,collisionGroupID:p},g=0;g<i.length;g+=4)f.insertCircle(y,i[g],i[g+1],i[g+2])},Si.prototype.projectAndGetPerspectiveRatio=function(i,o,n){var s=[o,n,0,1];return Ar(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}},Si.prototype.isOffscreen=function(i,o,n,s){return n<100||i>=this.screenRightBoundary||s<100||o>this.screenBottomBoundary},Si.prototype.isInsideGrid=function(i,o,n,s){return n>=0&&i<this.gridRightBoundary&&s>=0&&o<this.gridBottomBoundary},Si.prototype.getViewportMatrix=function(){var i=l.identity([]);return l.translate(i,i,[-100,-100,0]),i};var Fi=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};Fi.prototype.isHidden=function(){return this.opacity===0&&!this.placed};var hi=function(i,o,n,s,p){this.text=new Fi(i?i.text:null,o,n,p),this.icon=new Fi(i?i.icon:null,o,s,p)};hi.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var iu=function(i,o,n){this.text=i,this.icon=o,this.skipFade=n},Ti=function(){this.invProjMatrix=l.create(),this.viewportMatrix=l.create(),this.circles=[]},jc=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),y=-(f.horizontalAlign-.5)*o,g=-(f.verticalAlign-.5)*n,w=l.evaluateVariableOffset(i,s);return new l.Point(y+w[0]*p,g+w[1]*p)}function Wi(i,o,n,s,p,f){var y=i.x1,g=i.x2,w=i.y1,A=i.y2,z=i.anchorPointX,D=i.anchorPointY,L=new l.Point(o,n);return s&&L._rotate(p?f:-f),{x1:y+L.x,y1:w+L.y,x2:g+L.x,y2:A+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 Si(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 y=n.collisionBoxArray,g=p.layers[0].layout,w=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),A=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",$=$t(n,1,this.transform.zoom),q=ir(z,D,L,this.transform,$),K=null;if(D){var V=zt(z,D,L,this.transform,$);K=l.multiply([],this.transform.labelPlaneMatrix,V)}this.retainedQueryData[p.bucketInstanceId]=new jc(p.bucketInstanceId,f,p.sourceLayerIndex,p.index,n.tileID);var X={bucket:p,layout:g,posMatrix:z,textLabelPlaneMatrix:q,labelToScreenMatrix:K,scale:w,textPixelRatio:A,holdingForFade:n.holdingForFade(),collisionBoxArray:y,partiallyEvaluatedTextSize:l.evaluateSizeForZoom(p.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(p.sourceID)};if(s)for(var ee=0,ie=p.sortKeyRanges;ee<ie.length;ee+=1){var pe=ie[ee];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,y,g,w,A,z,D,L,$,q){var K,V=[D.textOffset0,D.textOffset1],X=zr(i,n,s,V,p),ee=this.collisionIndex.placeCollisionBox(Wi(o,X.x,X.y,f,y,this.transform.angle),z,g,w,A.predicate);if(!q||this.collisionIndex.placeCollisionBox(Wi(q,X.x,X.y,f,y,this.transform.angle),z,g,w,A.predicate).box.length!==0)return ee.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[D.crossTileID]&&this.prevPlacement.placements[D.crossTileID]&&this.prevPlacement.placements[D.crossTileID].text&&(K=this.prevPlacement.variableOffsets[D.crossTileID].anchor),this.variableOffsets[D.crossTileID]={textOffset:V,width:n,height:s,anchor:i,textBoxScale:p,prevAnchor:K},this.markUsedJustification(L,i,D,$),L.allowVerticalPlacement&&(this.markUsedOrientation(L,$,D),this.placedOrientations[D.crossTileID]=$),{shift:X,placedGlyphBoxes:ee}):void 0},qr.prototype.placeLayerBucketPart=function(i,o,n){var s=this,p=i.parameters,f=p.bucket,y=p.layout,g=p.posMatrix,w=p.textLabelPlaneMatrix,A=p.labelToScreenMatrix,z=p.textPixelRatio,D=p.holdingForFade,L=p.collisionBoxArray,$=p.partiallyEvaluatedTextSize,q=p.collisionGroup,K=y.get("text-optional"),V=y.get("icon-optional"),X=y.get("text-allow-overlap"),ee=y.get("icon-allow-overlap"),ie=y.get("text-rotation-alignment")==="map",pe=y.get("text-pitch-alignment")==="map",ue=y.get("icon-text-fit")!=="none",he=y.get("symbol-z-order")==="viewport-y",_e=X&&(ee||!f.hasIconData()||V),Ie=ee&&(X||!f.hasTextData()||K);!f.collisionArrays&&L&&f.deserializeCollisionBoxes(L);var Te=function(Fe,nt){if(!o[Fe.crossTileID])if(D)s.placements[Fe.crossTileID]=new iu(!1,!1,!1);else{var st,it=!1,rt=!1,at=!0,et=null,Je={box:null,offscreen:null},_r={box:null,offscreen:null},Qt=null,Rr=null,Cr=0,Jt=0,or=0;nt.textFeatureIndex?Cr=nt.textFeatureIndex:Fe.useRuntimeCollisionCircles&&(Cr=Fe.featureIndex),nt.verticalTextFeatureIndex&&(Jt=nt.verticalTextFeatureIndex);var ci=nt.textBox;if(ci){var Zr=function(Ct){var mi=l.WritingMode.horizontal;if(f.allowVerticalPlacement&&!Ct&&s.prevPlacement){var ei=s.prevPlacement.placedOrientations[Fe.crossTileID];ei&&(s.placedOrientations[Fe.crossTileID]=ei,s.markUsedOrientation(f,mi=ei,Fe))}return mi},Mn=function(Ct,mi){if(f.allowVerticalPlacement&&Fe.numVerticalGlyphVertices>0&&nt.verticalTextBox)for(var ei=0,ho=f.writingModes;ei<ho.length&&(ho[ei]===l.WritingMode.vertical?(Je=mi(),_r=Je):Je=Ct(),!(Je&&Je.box&&Je.box.length));ei+=1);else Je=Ct()};if(y.get("text-variable-anchor")){var Qr=y.get("text-variable-anchor");if(s.prevPlacement&&s.prevPlacement.variableOffsets[Fe.crossTileID]){var ji=s.prevPlacement.variableOffsets[Fe.crossTileID];Qr.indexOf(ji.anchor)>0&&(Qr=Qr.filter(function(Ct){return Ct!==ji.anchor})).unshift(ji.anchor)}var Pi=function(Ct,mi,ei){for(var ho=Ct.x2-Ct.x1,ip=Ct.y2-Ct.y1,ms=Fe.textBoxScale,np=ue&&!ee?mi:null,Ma={box:[],offscreen:!1},Du=X?2*Qr.length:Qr.length,Zo=0;Zo<Du;++Zo){var ys=s.attemptAnchorPlacement(Qr[Zo%Qr.length],Ct,ho,ip,ms,ie,pe,z,g,q,Zo>=Qr.length,Fe,f,ei,np);if(ys&&(Ma=ys.placedGlyphBoxes)&&Ma.box&&Ma.box.length){it=!0,et=ys.shift;break}}return Ma};Mn(function(){return Pi(ci,nt.iconBox,l.WritingMode.horizontal)},function(){var Ct=nt.verticalTextBox;return f.allowVerticalPlacement&&!(Je&&Je.box&&Je.box.length)&&Fe.numVerticalGlyphVertices>0&&Ct?Pi(Ct,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[Fe.crossTileID];jo&&(s.variableOffsets[Fe.crossTileID]=jo,s.markUsedJustification(f,jo.anchor,Fe,Ca))}}else{var zn=function(Ct,mi){var ei=s.collisionIndex.placeCollisionBox(Ct,X,z,g,q.predicate);return ei&&ei.box&&ei.box.length&&(s.markUsedOrientation(f,mi,Fe),s.placedOrientations[Fe.crossTileID]=mi),ei};Mn(function(){return zn(ci,l.WritingMode.horizontal)},function(){var Ct=nt.verticalTextBox;return f.allowVerticalPlacement&&Fe.numVerticalGlyphVertices>0&&Ct?zn(Ct,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,Fe.useRuntimeCollisionCircles){var $o=f.text.placedSymbolArray.get(Fe.centerJustifiedTextSymbolIndex),Pa=l.evaluateSizeForFeature(f.textSizeData,$,$o),Ji=y.get("text-padding");Qt=s.collisionIndex.placeCollisionCircles(X,$o,f.lineVertexArray,f.glyphOffsetArray,Pa,g,w,A,n,pe,q.predicate,Fe.collisionCircleDiameter,Ji),it=X||Qt.circles.length>0&&!Qt.collisionDetected,at=at&&Qt.offscreen}if(nt.iconFeatureIndex&&(or=nt.iconFeatureIndex),nt.iconBox){var ka=function(Ct){var mi=ue&&et?Wi(Ct,et.x,et.y,ie,pe,s.transform.angle):Ct;return s.collisionIndex.placeCollisionBox(mi,ee,z,g,q.predicate)};rt=_r&&_r.box&&_r.box.length&&nt.verticalIconBox?(Rr=ka(nt.verticalIconBox)).box.length>0:(Rr=ka(nt.iconBox)).box.length>0,at=at&&Rr.offscreen}var Yi=K||Fe.numHorizontalGlyphVertices===0&&Fe.numVerticalGlyphVertices===0,xr=V||Fe.numIconVertices===0;if(Yi||xr?xr?Yi||(rt=rt&&it):it=rt&&it:rt=it=rt&&it,it&&st&&st.box&&s.collisionIndex.insertCollisionBox(st.box,y.get("text-ignore-placement"),f.bucketInstanceId,_r&&_r.box&&Jt?Jt:Cr,q.ID),rt&&Rr&&s.collisionIndex.insertCollisionBox(Rr.box,y.get("icon-ignore-placement"),f.bucketInstanceId,or,q.ID),Qt&&(it&&s.collisionIndex.insertCollisionCircles(Qt.circles,y.get("text-ignore-placement"),f.bucketInstanceId,Cr,q.ID),n)){var cn=f.bucketInstanceId,Bn=s.collisionCircleArrays[cn];Bn===void 0&&(Bn=s.collisionCircleArrays[cn]=new Ti);for(var po=0;po<Qt.circles.length;po+=4)Bn.circles.push(Qt.circles[po+0]),Bn.circles.push(Qt.circles[po+1]),Bn.circles.push(Qt.circles[po+2]),Bn.circles.push(Qt.collisionDetected?1:0)}s.placements[Fe.crossTileID]=new iu(it||_e,rt||Ie,at||f.justReloaded),o[Fe.crossTileID]=!0}};if(he)for(var De=f.getSortedSymbolIndexes(this.transform.angle),Ge=De.length-1;Ge>=0;--Ge){var Ke=De[Ge];Te(f.symbolInstances.get(Ke),f.collisionArrays[Ke])}else for(var Xe=i.symbolInstanceStart;Xe<i.symbolInstanceEnd;Xe++)Te(f.symbolInstances.get(Xe),f.collisionArrays[Xe]);if(n&&f.bucketInstanceId in this.collisionCircleArrays){var bt=this.collisionCircleArrays[f.bucketInstanceId];l.invert(bt.invProjMatrix,g),bt.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,y=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];f<y.length;f+=1){var g=y[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,y=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];f<y.length;f+=1)i.text.placedSymbolArray.get(y[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:{},y=o?o.placedOrientations:{};for(var g in this.placements){var w=this.placements[g],A=p[g];A?(this.opacities[g]=new hi(A,s,w.text,w.icon),n=n||w.text!==A.text.placed||w.icon!==A.icon.placed):(this.opacities[g]=new hi(null,s,w.text,w.icon,w.skipFade),n=n||w.text||w.icon)}for(var z in p){var D=p[z];if(!this.opacities[z]){var L=new hi(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 y)this.placedOrientations[q]||!this.opacities[q]||this.opacities[q].isHidden()||(this.placedOrientations[q]=y[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],y=f.getBucket(i);y&&f.latestFeatureIndex&&i.id===y.layerIds[0]&&this.updateBucketOpacities(y,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 hi(null,0,!1,!1,!0),y=p.get("text-allow-overlap"),g=p.get("icon-allow-overlap"),w=p.get("text-variable-anchor"),A=p.get("text-rotation-alignment")==="map",z=p.get("text-pitch-alignment")==="map",D=p.get("icon-text-fit")!=="none",L=new hi(null,0,y&&(g||!i.hasIconData()||p.get("icon-optional")),g&&(y||!i.hasTextData()||p.get("text-optional")),!0);!i.collisionArrays&&n&&(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData())&&i.deserializeCollisionBoxes(n);for(var $=function(X,ee,ie){for(var pe=0;pe<ee/4;pe++)X.opacityVertexArray.emplaceBack(ie)},q=function(X){var ee=i.symbolInstances.get(X),ie=ee.numHorizontalGlyphVertices,pe=ee.numVerticalGlyphVertices,ue=ee.crossTileID,he=s.opacities[ue];o[ue]?he=f:he||(s.opacities[ue]=he=L),o[ue]=!0;var _e=ee.numIconVertices>0,Ie=s.placedOrientations[ee.crossTileID],Te=Ie===l.WritingMode.vertical,De=Ie===l.WritingMode.horizontal||Ie===l.WritingMode.horizontalOnly;if(ie>0||pe>0){var Ge=au(he.text);$(i.text,ie,Te?zo:Ge),$(i.text,pe,De?zo:Ge);var Ke=he.text.isHidden();[ee.rightJustifiedTextSymbolIndex,ee.centerJustifiedTextSymbolIndex,ee.leftJustifiedTextSymbolIndex].forEach(function(Je){Je>=0&&(i.text.placedSymbolArray.get(Je).hidden=Ke||Te?1:0)}),ee.verticalPlacedTextSymbolIndex>=0&&(i.text.placedSymbolArray.get(ee.verticalPlacedTextSymbolIndex).hidden=Ke||De?1:0);var Xe=s.variableOffsets[ee.crossTileID];Xe&&s.markUsedJustification(i,Xe.anchor,ee,Ie);var bt=s.placedOrientations[ee.crossTileID];bt&&(s.markUsedJustification(i,"left",ee,bt),s.markUsedOrientation(i,bt,ee))}if(_e){var Fe=au(he.icon),nt=!(D&&ee.verticalPlacedIconSymbolIndex&&Te);ee.placedIconSymbolIndex>=0&&($(i.icon,ee.numIconVertices,nt?Fe:zo),i.icon.placedSymbolArray.get(ee.placedIconSymbolIndex).hidden=he.icon.isHidden()),ee.verticalPlacedIconSymbolIndex>=0&&($(i.icon,ee.numVerticalIconVertices,nt?zo:Fe),i.icon.placedSymbolArray.get(ee.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(w){var at=s.variableOffsets[ue];at?(it=zr(at.anchor,at.width,at.height,at.textOffset,at.textBoxScale),A&&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||De,it.x,it.y)}var et=!!(!De&&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)}}},K=0;K<i.symbolInstances.length;K++)q(K);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 $c=Math.pow(2,25),Zc=Math.pow(2,24),Qs=Math.pow(2,17),Gc=Math.pow(2,16),nu=Math.pow(2,9),Wc=Math.pow(2,8),ou=Math.pow(2,1);function au(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*$c+o*Zc+n*Qs+o*Gc+n*nu+o*Wc+n*ou+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(y,g){return y.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,y){this.placement=new qr(i,p,f,y),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 w=l.browser.now()-p;return!s._forceFullPlacement&&w>2};this._currentPlacementIndex>=0;){var y=o[i[this._currentPlacementIndex]],g=this.placement.collisionIndex.transform.zoom;if(y.type==="symbol"&&(!y.minzoom||y.minzoom<=g)&&(!y.maxzoom||y.maxzoom>g)){if(this._inProgressLayer||(this._inProgressLayer=new el(y)),this._inProgressLayer.continuePlacement(n[y.source],this.placement,this._showCollisionBoxes,y,f))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},pa.prototype.commit=function(i){return this.placement.commit(i),this.placement};var su=512/l.EXTENT/2,Xa=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)})}};Xa.prototype.getScaledCoordinates=function(i,o){var n=su/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)}},Xa.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 y=this.indexedSymbolInstances[f.key];if(y)for(var g=this.getScaledCoordinates(f,o),w=0,A=y;w<A.length;w+=1){var z=A[w];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 Ii=function(){this.maxCrossTileID=0};Ii.prototype.generate=function(){return++this.maxCrossTileID};var vn=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};vn.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 y=s[f];y.tileID=y.tileID.unwrapTo(y.tileID.wrap+o),p[y.tileID.key]=y}this.indexes[n]=p}this.lng=i},vn.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 y=this.indexes[f];if(Number(f)>i.overscaledZ)for(var g in y){var w=y[g];w.tileID.isChildOf(i)&&w.findMatches(o.symbolInstances,i,p)}else{var A=y[i.scaledTo(Number(f)).key];A&&A.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 Xa(i,o.symbolInstances,o.bucketInstanceId),!0},vn.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]},vn.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 gn=function(){this.layerIndexes={},this.crossTileIDs=new Ii,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};gn.prototype.addLayer=function(i,o,n){var s=this.layerIndexes[i.id];s===void 0&&(s=this.layerIndexes[i.id]=new vn);var p=!1,f={};s.handleWrapJump(n);for(var y=0,g=o;y<g.length;y+=1){var w=g[y],A=w.getBucket(i);A&&i.id===A.layerIds[0]&&(A.bucketInstanceId||(A.bucketInstanceId=++this.maxBucketInstanceId),s.addBucket(w.tileID,A,this.crossTileIDs)&&(p=!0),f[A.bucketInstanceId]=!0)}return s.removeStaleBuckets(f)&&(p=!0),p},gn.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 Xn=function(i,o){return l.emitValidationErrors(i,o&&o.filter(function(n){return n.identifier!=="source.canvas"}))},_n=l.pick(Pe,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),xn=l.pick(Pe,["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 tt,this.imageManager.setEventedParent(this),this.glyphManager=new cr(n._requestManager,s.localIdeographFontFamily),this.lineAtlas=new Lt(256,512),this.crossTileSymbolIndex=new gn,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(y){f.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:y.pluginStatus,pluginURL:y.pluginURL},function(g,w){if(l.triggerPluginCompletionEvent(g),w&&w.every(function(z){return z}))for(var A in f.sourceCaches)f.sourceCaches[A].reload()})}),this.on("data",function(y){if(y.dataType==="source"&&y.sourceDataType==="metadata"){var g=p.sourceCaches[y.sourceId];if(g){var w=g.getSource();if(w&&w.vectorLayerIds)for(var A in p._layers){var z=p._layers[A];z.source===w.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 y=this.map._requestManager.transformRequest(n,l.ResourceType.Style);this._request=l.getJSON(y,function(g,w){p._request=null,g?p.fire(new l.ErrorEvent(g)):w&&p._load(w,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||!Xn(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=Ee(this.stylesheet.layers);this._order=f.map(function(A){return A.id}),this._layers={},this._serializedLayers={};for(var y=0,g=f;y<g.length;y+=1){var w=g[y];(w=l.createStyleLayer(w)).setEventedParent(this,{layer:{id:w.id}}),this._layers[w.id]=w,this._serializedLayers[w.id]=w.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new gi(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,y){var g,w,A,z=l.browser.devicePixelRatio>1?"@2x":"",D=l.getJSON(f.transformRequest(f.normalizeSpriteURL(p,z,".json"),l.ResourceType.SpriteJSON),function(q,K){D=null,A||(A=q,g=K,$())}),L=l.getImage(f.transformRequest(f.normalizeSpriteURL(p,z,".png"),l.ResourceType.SpriteImage),function(q,K){L=null,A||(A=q,w=K,$())});function $(){if(A)y(A);else if(g&&w){var q=l.browser.getImageData(w),K={};for(var V in g){var X=g[V],ee=X.width,ie=X.height,pe=X.x,ue=X.y,he=X.sdf,_e=X.pixelRatio,Ie=X.stretchX,Te=X.stretchY,De=X.content,Ge=new l.RGBAImage({width:ee,height:ie});l.RGBAImage.copy(q,Ge,{x:pe,y:ue},{x:0,y:0},{width:ee,height:ie}),K[V]={data:Ge,pixelRatio:_e,sdf:he,stretchX:Ie,stretchY:Te,content:De}}y(null,K)}}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 y in f)s.imageManager.addImage(y,f[y]);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 y=this._layers[f[p]];y.type!=="custom"&&s.push(y.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 y in(p.length||f.length)&&this._updateWorkerLayers(p,f),this._updatedSources){var g=this._updatedSources[y];g==="reload"?this._reloadSource(y):g==="clear"&&this._clearSource(y)}for(var w in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[w].updateTransitions(n);this.light.updateTransitions(n),this._resetUpdates()}var A={};for(var z in this.sourceCaches){var D=this.sourceCaches[z];A[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 K in A){var V=this.sourceCaches[K];A[K]!==V.used&&V.fire(new l.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:K}))}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(),Xn(this,l.validateStyle(n)))return!1;(n=l.clone$1(n)).layers=Ee(n.layers);var p=function(y,g){if(!y)return[{command:Pe.setStyle,args:[g]}];var w=[];try{if(!l.deepEqual(y.version,g.version))return[{command:Pe.setStyle,args:[g]}];l.deepEqual(y.center,g.center)||w.push({command:Pe.setCenter,args:[g.center]}),l.deepEqual(y.zoom,g.zoom)||w.push({command:Pe.setZoom,args:[g.zoom]}),l.deepEqual(y.bearing,g.bearing)||w.push({command:Pe.setBearing,args:[g.bearing]}),l.deepEqual(y.pitch,g.pitch)||w.push({command:Pe.setPitch,args:[g.pitch]}),l.deepEqual(y.sprite,g.sprite)||w.push({command:Pe.setSprite,args:[g.sprite]}),l.deepEqual(y.glyphs,g.glyphs)||w.push({command:Pe.setGlyphs,args:[g.glyphs]}),l.deepEqual(y.transition,g.transition)||w.push({command:Pe.setTransition,args:[g.transition]}),l.deepEqual(y.light,g.light)||w.push({command:Pe.setLight,args:[g.light]});var A={},z=[];(function(L,$,q,K){var V;for(V in $=$||{},L=L||{})L.hasOwnProperty(V)&&($.hasOwnProperty(V)||Me(V,q,K));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:Pe.setGeoJSONSourceData,args:[V,$[V].data]}):vt(V,$,q,K)):ut(V,$,q))})(y.sources,g.sources,z,A);var D=[];y.layers&&y.layers.forEach(function(L){A[L.source]?w.push({command:Pe.removeLayer,args:[L.id]}):D.push(L)}),w=w.concat(z),function(L,$,q){$=$||[];var K,V,X,ee,ie,pe,ue,he=(L=L||[]).map(At),_e=$.map(At),Ie=L.reduce(_t,{}),Te=$.reduce(_t,{}),De=he.slice(),Ge=Object.create(null);for(K=0,V=0;K<he.length;K++)Te.hasOwnProperty(X=he[K])?V++:(q.push({command:Pe.removeLayer,args:[X]}),De.splice(De.indexOf(X,V),1));for(K=0,V=0;K<_e.length;K++)De[De.length-1-K]!==(X=_e[_e.length-1-K])&&(Ie.hasOwnProperty(X)?(q.push({command:Pe.removeLayer,args:[X]}),De.splice(De.lastIndexOf(X,De.length-V),1)):V++,q.push({command:Pe.addLayer,args:[Te[X],pe=De[De.length-K]]}),De.splice(De.length-K,0,X),Ge[X]=!0);for(K=0;K<_e.length;K++)if(ee=Ie[X=_e[K]],ie=Te[X],!Ge[X]&&!l.deepEqual(ee,ie))if(l.deepEqual(ee.source,ie.source)&&l.deepEqual(ee["source-layer"],ie["source-layer"])&&l.deepEqual(ee.type,ie.type)){for(ue in pt(ee.layout,ie.layout,q,X,null,Pe.setLayoutProperty),pt(ee.paint,ie.paint,q,X,null,Pe.setPaintProperty),l.deepEqual(ee.filter,ie.filter)||q.push({command:Pe.setFilter,args:[X,ie.filter]}),l.deepEqual(ee.minzoom,ie.minzoom)&&l.deepEqual(ee.maxzoom,ie.maxzoom)||q.push({command:Pe.setLayerZoomRange,args:[X,ie.minzoom,ie.maxzoom]}),ee)ee.hasOwnProperty(ue)&&ue!=="layout"&&ue!=="paint"&&ue!=="filter"&&ue!=="metadata"&&ue!=="minzoom"&&ue!=="maxzoom"&&(ue.indexOf("paint.")===0?pt(ee[ue],ie[ue],q,X,ue.slice(6),Pe.setPaintProperty):l.deepEqual(ee[ue],ie[ue])||q.push({command:Pe.setLayerProperty,args:[X,ue,ie[ue]]}));for(ue in ie)ie.hasOwnProperty(ue)&&!ee.hasOwnProperty(ue)&&ue!=="layout"&&ue!=="paint"&&ue!=="filter"&&ue!=="metadata"&&ue!=="minzoom"&&ue!=="maxzoom"&&(ue.indexOf("paint.")===0?pt(ee[ue],ie[ue],q,X,ue.slice(6),Pe.setPaintProperty):l.deepEqual(ee[ue],ie[ue])||q.push({command:Pe.setLayerProperty,args:[X,ue,ie[ue]]}))}else q.push({command:Pe.removeLayer,args:[X]}),pe=De[De.lastIndexOf(X)+1],q.push({command:Pe.addLayer,args:[ie,pe]})}(D,g.layers,w)}catch(L){console.warn("Unable to compute style diff:",L),w=[{command:Pe.setStyle,args:[g]}]}return w}(this.serialize(),n).filter(function(y){return!(y.command in xn)});if(p.length===0)return!1;var f=p.filter(function(y){return!(y.command in _n)});if(f.length>0)throw new Error("Unimplemented: "+f.map(function(y){return y.command}).join(", ")+".");return p.forEach(function(y){y.command!=="setTransition"&&s[y.command].apply(s,y.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 y=this.sourceCaches[n]=new Z(n,s,this.dispatcher);y.style=this,y.setEventedParent(this,function(){return{isSourceLoaded:f.loaded(),source:y.serialize(),sourceId:n}}),y.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 y;if(n.type==="custom"){if(Xn(this,l.validateCustomStyleLayer(n)))return;y=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;y=l.createStyleLayer(n),this._validateLayer(y),y.setEventedParent(this,{layer:{id:f}}),this._serializedLayers[y.id]=y.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]=y,this._removedLayers[f]&&y.source&&y.type!=="custom"){var w=this._removedLayers[f];delete this._removedLayers[f],w.type!==y.type?this._updatedSources[y.source]="clear":(this._updatedSources[y.source]="reload",this.sourceCaches[y.source].pause())}this._updateLayer(y),y.onAdd&&y.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 y=this.getLayer(n);y?l.deepEqual(y.getLayoutProperty(s),p)||(y.setLayoutProperty(s,p,f),this._updateLayer(y)):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 y=this.getLayer(n);y?l.deepEqual(y.getPaintProperty(s),p)||(y.setPaintProperty(s,p,f)&&this._updateLayer(y),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,y=this.sourceCaches[p];if(y!==void 0){var g=y.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."))),y.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 y=f.getSource().type,g=y==="vector"?n.sourceLayer:void 0;y!=="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={},y=[],g=this._order.length-1;g>=0;g--){var w=this._order[g];if(p(w)){f[w]=g;for(var A=0,z=n;A<z.length;A+=1){var D=z[A][w];if(D)for(var L=0,$=D;L<$.length;L+=1)y.push($[L])}}}y.sort(function(Ie,Te){return Te.intersectionZ-Ie.intersectionZ});for(var q=[],K=this._order.length-1;K>=0;K--){var V=this._order[K];if(p(V))for(var X=y.length-1;X>=0;X--){var ee=y[X].feature;if(f[ee.layer.id]<K)break;q.push(ee),y.pop()}else for(var ie=0,pe=n;ie<pe.length;ie+=1){var ue=pe[ie][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 y=0,g=s.layers;y<g.length;y+=1){var w=g[y],A=this._layers[w];if(!A)return this.fire(new l.ErrorEvent(new Error("The layer '"+w+"' does not exist in the map's style and cannot be queried for features."))),[];f[A.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,K,V,X,ee){for(var ie={},pe=X.queryRenderedSymbols(K),ue=[],he=0,_e=Object.keys(pe).map(Number);he<_e.length;he+=1)ue.push(ee[_e[he]]);ue.sort(rn);for(var Ie=function(){var Xe=De[Te],bt=Xe.featureIndex.lookupSymbolFeatures(pe[Xe.bucketInstanceId],$,Xe.bucketIndex,Xe.sourceLayerIndex,V.filter,V.layers,V.availableImages,L);for(var Fe in bt){var nt=ie[Fe]=ie[Fe]||[],st=bt[Fe];st.sort(function(at,et){var Je=Xe.featureSortOrder;if(Je){var _r=Je.indexOf(at.featureIndex);return Je.indexOf(et.featureIndex)-_r}return et.featureIndex-at.featureIndex});for(var it=0,rt=st;it<rt.length;it+=1)nt.push(rt[it])}},Te=0,De=ue;Te<De.length;Te+=1)Ie();var Ge=function(Xe){ie[Xe].forEach(function(bt){var Fe=bt.feature,nt=q[L[Xe].source].getFeatureState(Fe.layer["source-layer"],Fe.id);Fe.source=Fe.layer.source,Fe.layer["source-layer"]&&(Fe.sourceLayer=Fe.layer["source-layer"]),Fe.state=nt})};for(var Ke in ie)Ge(Ke);return ie}(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,y){for(var g=f.getRenderableIds().map(function($){return f.getTileByID($)}),w=[],A={},z=0;z<g.length;z++){var D=g[z],L=D.tileID.canonical.key;A[L]||(A[L]=!0,D.querySourceFeatures(w,y))}return w}(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 y in n)if(!l.deepEqual(n[y],p[y])){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,y){return y===void 0&&(y={}),(!y||y.validate!==!1)&&Xn(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,y){y===void 0&&(y=!1);for(var g=!1,w=!1,A={},z=0,D=this._order;z<D.length;z+=1){var L=this._layers[D[z]];if(L.type==="symbol"){if(!A[L.source]){var $=this.sourceCaches[L.source];A[L.source]=$.getRenderableIds(!0).map(function(ee){return $.getTileByID(ee)}).sort(function(ee,ie){return ie.tileID.overscaledZ-ee.tileID.overscaledZ||(ee.tileID.isLessThan(ie.tileID)?-1:1)})}var q=this.crossTileSymbolIndex.addLayer(L,A[L.source],n.center.lng);g=g||q}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((y=y||this._layerOrderChanged||p===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(l.browser.now(),n.zoom))&&(this.pauseablePlacement=new pa(n,this._order,y,s,p,f,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,A),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(l.browser.now()),w=!0),g&&this.pauseablePlacement.placement.setStale()),w||g)for(var K=0,V=this._order;K<V.length;K+=1){var X=this._layers[V[K]];X.type==="symbol"&&this.placement.updateLayerOpacities(X,A[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 mn[i]},ni.setSourceType=function(i,o){mn[i]=o},ni.registerForPluginStateChange=l.registerForPluginStateChange;var pr=l.createLayout([{name:"a_pos",type:"Int16",components:2}]),Bo=Ot(`#ifdef GL_ES
|
|
2
2
|
precision mediump float;
|
|
3
3
|
#else
|
|
4
4
|
#if !defined(lowp)
|