@visitscotland/component-library 5.41.6 → 5.42.1
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 +3875 -3771
- package/dist/client/scripts/01b8e76e714348e01802.js +1 -0
- package/dist/client/scripts/02cd01e4087e8d5aa492.js +1 -0
- package/dist/client/scripts/0438b2a237fc5bdc3284.js +1 -0
- package/dist/client/scripts/05460edc897f6e35c50e.js +1 -0
- package/dist/client/scripts/05964f039507c464d344.js +1 -0
- package/dist/client/scripts/05a1efe07f04c478155a.js +1 -0
- package/dist/client/scripts/06e2a0dd3335dfc0e506.js +1 -0
- package/dist/client/scripts/08755652b19e4b8cc3a6.js +1 -0
- package/dist/client/scripts/093df1d5f4968f1a29eb.js +1 -0
- package/dist/client/scripts/096a1dc72c78b8176a60.js +1 -0
- package/dist/client/scripts/09ae016b64791f86ce4a.js +1 -0
- package/dist/client/scripts/09b087ec0d366e0f4aab.js +1 -0
- package/dist/client/scripts/0ab3c46d6068a5f67c1f.js +1 -0
- package/dist/client/scripts/0b5992e43cb6b1a5b482.js +1 -0
- package/dist/client/scripts/0c8e63483304c803b42a.js +1 -0
- package/dist/client/scripts/0cb36cf0019d0d1516a9.js +1 -0
- package/dist/client/scripts/0d44aeaf665b9f76f1a3.js +1 -0
- package/dist/client/scripts/0efef27882999582a48c.js +1 -0
- package/dist/client/scripts/0fc32c57e4b4c007d86e.js +1 -0
- package/dist/client/scripts/10feb66c27c41e55bdd4.js +1 -0
- package/dist/client/scripts/11bdf203d8398fc93aea.js +1 -0
- package/dist/client/scripts/125f54f2181f20b9b6c7.js +1 -0
- package/dist/client/scripts/12c214803bb856eac25e.js +1 -0
- package/dist/client/scripts/12f9d7e13904294edfc5.js +1 -0
- package/dist/client/scripts/144d2007e1b1a85b5cec.js +1 -0
- package/dist/client/scripts/14552227c097ba45d96d.js +1 -0
- package/dist/client/scripts/147acfad2826cadced1c.js +1 -0
- package/dist/client/scripts/170ca751557782434b86.js +1 -0
- package/dist/client/scripts/18b8732facc297fa275d.js +1 -0
- package/dist/client/scripts/1ad0f1a325ef164bc452.js +1 -0
- package/dist/client/scripts/1c20656fa41e8f0a9186.js +1 -0
- package/dist/client/scripts/1cf0a84b704943e20542.js +1 -0
- package/dist/client/scripts/1d1abb5e5dbc59ef9ba2.js +1 -0
- package/dist/client/scripts/1de9c5ad01140bfb6ca5.js +1 -0
- package/dist/client/scripts/1f4d80572006cd3ff28e.js +1 -0
- package/dist/client/scripts/201941464a25dc50dcec.js +1 -0
- package/dist/client/scripts/2061904ca074081d88fe.js +1 -0
- package/dist/client/scripts/20d05ca262d096564101.js +1 -0
- package/dist/client/scripts/20fb77cf2d74b861b795.js +1 -0
- package/dist/client/scripts/21711e87222aa129f005.js +1 -0
- package/dist/client/scripts/22306ddea2411c963bea.js +1 -0
- package/dist/client/scripts/223b412f296c214e60d8.js +1 -0
- package/dist/client/scripts/2290109a2b19f24f7f67.js +1 -1
- package/dist/client/scripts/230561f40b218ce33aa3.js +1 -0
- package/dist/client/scripts/239e8acfb9f1a566c62f.js +1 -0
- package/dist/client/scripts/23e7e7801052da2ee7b1.js +1 -0
- package/dist/client/scripts/23ea5cdb4bd00312ad71.js +1 -0
- package/dist/client/scripts/247c689797a97059a7e0.js +1 -0
- package/dist/client/scripts/25727b129afc42175cb4.js +1 -0
- package/dist/client/scripts/2597729b6576c994284e.js +1 -0
- package/dist/client/scripts/26e22ae1da8f26e5cb41.js +1 -0
- package/dist/client/scripts/281fbf5ff6ca8953bd94.js +1 -0
- package/dist/client/scripts/2832fa5d4d41a5ccbbea.js +1 -0
- package/dist/client/scripts/29592daed7085fae2aff.js +1 -0
- package/dist/client/scripts/29fe5285a5534638e45b.js +1 -0
- package/dist/client/scripts/2b43a99e2018d0c84f18.js +1 -0
- package/dist/client/scripts/2cc0bc8c9e4cf62adfae.js +1 -0
- package/dist/client/scripts/2d82857aa9b409543ad0.js +1 -0
- package/dist/client/scripts/2da8f9d947d895021c5d.js +1 -0
- package/dist/client/scripts/2e1e0dd2f0bc70406517.js +1 -0
- package/dist/client/scripts/2eb64565ce9bce410b7f.js +1 -0
- package/dist/client/scripts/2f1b8a7fe67255cbe0ad.js +1 -0
- package/dist/client/scripts/30104934860fed5bc19c.js +1 -0
- package/dist/client/scripts/311e9063fba535832317.js +1 -0
- package/dist/client/scripts/3173dc863274aa930452.js +1 -0
- package/dist/client/scripts/319cce34e32e88725a45.js +1 -0
- package/dist/client/scripts/31cc034791fd8fed08dc.js +1 -1
- package/dist/client/scripts/3217bd72dc64ca594af2.js +1 -0
- package/dist/client/scripts/3339ab53ef97b3ccfa18.js +1 -0
- package/dist/client/scripts/335bb4f1c38a98d3a44d.js +1 -0
- package/dist/client/scripts/33d5e23afd92ab87997e.js +1 -0
- package/dist/client/scripts/34684cbbfd8f07dd7939.js +1 -0
- package/dist/client/scripts/350b5411ffc3a7b4a42a.js +1 -0
- package/dist/client/scripts/36bb682d6ef3b6747725.js +1 -0
- package/dist/client/scripts/370e6150fbd0dccf34c7.js +2 -0
- package/dist/client/scripts/373129c3f6ff64209b21.js +1 -0
- package/dist/client/scripts/393fa3ee68d9e76e6def.js +1 -1
- package/dist/client/scripts/39ba7e46913442fd36d3.js +1 -0
- package/dist/client/scripts/39bd197d7d1f66f65105.js +1 -0
- package/dist/client/scripts/3a54f6b2d5b91ff395dc.js +1 -1
- package/dist/client/scripts/404c0b7cff4d305398c5.js +1 -0
- package/dist/client/scripts/407c4cdbe305f30d4aae.js +1 -0
- package/dist/client/scripts/40af9a8a69d05333c48b.js +1 -0
- package/dist/client/scripts/41085f1d73bd0fa3c10a.js +1 -0
- package/dist/client/scripts/41f72194eda6300eda07.js +1 -0
- package/dist/client/scripts/427f4a836835f87aa5a6.js +1 -0
- package/dist/client/scripts/430611976761c9823b28.js +1 -0
- package/dist/client/scripts/4318bb968a52201c4f49.js +1 -0
- package/dist/client/scripts/454827facac3a7b5372d.js +1 -0
- package/dist/client/scripts/45ea777abdc94a4fe90a.js +1 -0
- package/dist/client/scripts/46bac0bfa971ac9c156b.js +1 -0
- package/dist/client/scripts/494900a6843cbd395631.js +1 -0
- package/dist/client/scripts/4998595f5c0ba7e4cbef.js +1 -0
- package/dist/client/scripts/49ab77897fd7265e3bf1.js +1 -0
- package/dist/client/scripts/4a5baf290bdcb8866cb3.js +1 -0
- package/dist/client/scripts/4af4fb2e7934b3943d68.js +1 -0
- package/dist/client/scripts/4b8ab89e3dadf71a555b.js +1 -0
- package/dist/client/scripts/4be307902b6682456306.js +1 -0
- package/dist/client/scripts/4f227cf9d210a351d684.js +1 -0
- package/dist/client/scripts/4f47ffaa9a5862cc51d1.js +1 -0
- package/dist/client/scripts/50ac2404336c6a949f85.js +1 -0
- package/dist/client/scripts/50d64cdbfaa0c7f02bff.js +1 -0
- package/dist/client/scripts/50e356fe6c0b2febc750.js +1 -0
- package/dist/client/scripts/51b02e9cc8dcce007d09.js +1 -0
- package/dist/client/scripts/527999b00f27717c8e3d.js +1 -0
- package/dist/client/scripts/527b692a90fde1ab1fb1.js +1 -0
- package/dist/client/scripts/52c515514b241f01e737.js +1 -0
- package/dist/client/scripts/53251829ca5de2bf36fe.js +1 -0
- package/dist/client/scripts/5338ba2c1a300fb817ad.js +1 -1
- package/dist/client/scripts/565fe0111bdfe1faa81b.js +1 -0
- package/dist/client/scripts/56b154fca6dd1d2717ab.js +1 -0
- package/dist/client/scripts/573b3141c4f3aaf2a77a.js +1 -0
- package/dist/client/scripts/5751277f07388a09e8b9.js +1 -0
- package/dist/client/scripts/5840fd3aaf68742dbd91.js +1 -0
- package/dist/client/scripts/5a9f3609f8449b952b64.js +1 -0
- package/dist/client/scripts/5ba4f0c291b89c266862.js +1 -0
- package/dist/client/scripts/5c13f431c2e46685547e.js +1 -0
- package/dist/client/scripts/5c444609f44df9236b50.js +1 -0
- package/dist/client/scripts/5ca596aa3d93347cb166.js +1 -0
- package/dist/client/scripts/5eb42ef6d08a351ed72d.js +1 -0
- package/dist/client/scripts/5f4eae2e17299af02f30.js +1 -0
- package/dist/client/scripts/6017d8191657aaded718.js +1 -0
- package/dist/client/scripts/61640640348bfae9911a.js +1 -0
- package/dist/client/scripts/61bab8e68387ee80ff66.js +1 -0
- package/dist/client/scripts/63325e5621b93d481e33.js +1 -0
- package/dist/client/scripts/63cf7b24a6665afa8d93.js +1 -0
- package/dist/client/scripts/64040fe43c85229d6c7e.js +1 -0
- package/dist/client/scripts/6426b3dc3b49d5317801.js +1 -0
- package/dist/client/scripts/656320e03d581a8ea0e1.js +1 -0
- package/dist/client/scripts/65f43123fc14b35b64d1.js +2 -0
- package/dist/client/scripts/66d53fffb25ec07a1aa7.js +1 -1
- package/dist/client/scripts/68395bfe89565e0d1d79.js +1 -0
- package/dist/client/scripts/686711e0bbed23d62722.js +1 -0
- package/dist/client/scripts/6946e6aba0f938c33d41.js +1 -0
- package/dist/client/scripts/6995a6a5607ccfaef630.js +1 -0
- package/dist/client/scripts/69bcf40c72866c57569c.js +1 -0
- package/dist/client/scripts/6a72e20f9ac9a967fdb5.js +1 -0
- package/dist/client/scripts/6b46c22ca1c92349b2f8.js +1 -0
- package/dist/client/scripts/6b4ed5cf4bb509c82dc7.js +1 -0
- package/dist/client/scripts/6b8c01aec2b272c579b2.js +1 -0
- package/dist/client/scripts/6c01c3fecf56394f299c.js +1 -0
- package/dist/client/scripts/6c5b6c2aa4a4fb751c6e.js +1 -0
- package/dist/client/scripts/6cf6cc6c2d13bfd50cdd.js +1 -0
- package/dist/client/scripts/6e12a7ec94aa04c9e19a.js +1 -0
- package/dist/client/scripts/6e83cdb8cf4a81b04610.js +1 -0
- package/dist/client/scripts/6ec32a52d983bd17d964.js +1 -0
- package/dist/client/scripts/6eef2c349f99513c7605.js +1 -0
- package/dist/client/scripts/6f304354b9d063f6a388.js +1 -0
- package/dist/client/scripts/6fc29b2e316a296f27b3.js +1 -0
- package/dist/client/scripts/7016d8a61690a15d03f9.js +1 -0
- package/dist/client/scripts/7021a1aa103adb4c0afb.js +1 -0
- package/dist/client/scripts/70613f88c015cb23628f.js +1 -0
- package/dist/client/scripts/70b382267b5513186329.js +2 -0
- package/dist/client/scripts/732cde453ece9ad94e13.js +1 -0
- package/dist/client/scripts/73b00f60638d900381f9.js +2 -0
- package/dist/client/scripts/73b00f60638d900381f9.js.LICENSE.txt +5 -0
- package/dist/client/scripts/764708e59c9e117d7d05.js +1 -0
- package/dist/client/scripts/76d78ba0c2f38b447c7b.js +1 -0
- package/dist/client/scripts/773d825d249ad0676725.js +1 -0
- package/dist/client/scripts/7818ed43fdcd566ba3f8.js +1 -0
- package/dist/client/scripts/785f5aedccd25328545f.js +1 -0
- package/dist/client/scripts/7880369871d8c84cd0e7.js +1 -0
- package/dist/client/scripts/79eddfa24c7ea007b464.js +1 -0
- package/dist/client/scripts/7b64c0b95bc2e1e7b8b7.js +1 -0
- package/dist/client/scripts/7bb7988a7e3a48b42689.js +1 -0
- package/dist/client/scripts/7c47a608596fd7e340ac.js +1 -0
- package/dist/client/scripts/7d74987d7c93713490df.js +1 -0
- package/dist/client/scripts/7dc60eea744dfc329db1.js +1 -0
- package/dist/client/scripts/7e85f5e695d079dca886.js +2 -0
- package/dist/client/scripts/7e85f5e695d079dca886.js.LICENSE.txt +1 -0
- package/dist/client/scripts/7f95fbcd683062c20173.js +1 -0
- package/dist/client/scripts/7fa847dd9898ad08103f.js +1 -0
- package/dist/client/scripts/80006a5fec335cb12b7c.js +1 -0
- package/dist/client/scripts/80cddc196cc2b7002fd6.js +1 -0
- package/dist/client/scripts/82a07bb458544eeed2ba.js +1 -0
- package/dist/client/scripts/82cff5a009d11a47c9b1.js +1 -0
- package/dist/client/scripts/83e8c494ee1d031a6d1b.js +1 -0
- package/dist/client/scripts/84222624315dca891314.js +1 -0
- package/dist/client/scripts/858d0a582e7ad0c11188.js +1 -0
- package/dist/client/scripts/878fb5ed84c34cc290d7.js +1 -0
- package/dist/client/scripts/885aba9fe02e2e19ef08.js +1 -0
- package/dist/client/scripts/88c10a04376cf5a72c28.js +1 -0
- package/dist/client/scripts/89c7ce2ebd93f29188d4.js +1 -0
- package/dist/client/scripts/8aa688dbf078ed7770b4.js +1 -0
- package/dist/client/scripts/8ec6bd177c4c85a84907.js +1 -0
- package/dist/client/scripts/8f0d8b6f4cf5ea5d32e3.js +1 -0
- package/dist/client/scripts/8fb6347aacc0d7a6e455.js +1 -0
- package/dist/client/scripts/9212fa0c23e7fbc74fb7.js +1 -0
- package/dist/client/scripts/934ef1913852643b8075.js +1 -0
- package/dist/client/scripts/93a15382ca1d82530841.js +1 -0
- package/dist/client/scripts/93bde9d3da4e67262071.js +1 -0
- package/dist/client/scripts/93fcfa2274d0dc0bda30.js +1 -0
- package/dist/client/scripts/943c207eed1ff2aa3f4b.js +1 -0
- package/dist/client/scripts/947ee62243a4bb64cf62.js +1 -0
- package/dist/client/scripts/96306df532ecfd1464fb.js +1 -0
- package/dist/client/scripts/969be097de0ece70a219.js +1 -0
- package/dist/client/scripts/971b2c9a163cb9a4c1d9.js +1 -0
- package/dist/client/scripts/9742df9b3b105d4cc277.js +1 -0
- package/dist/client/scripts/9795b08c4ac3d39aa734.js +1 -0
- package/dist/client/scripts/9987d7d12d1a3b4a8eea.js +1 -0
- package/dist/client/scripts/9a240e0b21d636d1a38b.js +1 -0
- package/dist/client/scripts/9be66e00b94134bf8ba1.js +1 -0
- package/dist/client/scripts/9c119bb692b22af5aa30.js +1 -0
- package/dist/client/scripts/9e4f9b5ccf6374929ffd.js +1 -0
- package/dist/client/scripts/9eebe67b2504a3c1d87c.js +1 -0
- package/dist/client/scripts/9f21c1e47b8b109c3a6d.js +1 -0
- package/dist/client/scripts/9f3a445b7e4a1376917a.js +1 -0
- package/dist/client/scripts/9f5ae43cbfda2ce15ad0.js +1 -0
- package/dist/client/scripts/a06a68636bc8161710b5.js +1 -0
- package/dist/client/scripts/a256e0ec3a4d4952396d.js +1 -0
- package/dist/client/scripts/a3125245058e27361bb2.js +1 -1
- package/dist/client/scripts/a35c162c99ace4b92eff.js +1 -0
- package/dist/client/scripts/a3dde3a7c263f2c4f215.js +1 -0
- package/dist/client/scripts/a4919aaeec2b21a6fbc1.js +1 -0
- package/dist/client/scripts/a4dcfa11d11e734e715b.js +2 -0
- package/dist/client/scripts/a4dcfa11d11e734e715b.js.LICENSE.txt +7 -0
- package/dist/client/scripts/a54ed3a84366af42e9e7.js +1 -0
- package/dist/client/scripts/a57475df7173017e6067.js +1 -0
- package/dist/client/scripts/a5fc4d479e8511e4eb2b.js +1 -0
- package/dist/client/scripts/a95791db9a4415066336.js +1 -0
- package/dist/client/scripts/a964116d7226e0252a4e.js +1 -0
- package/dist/client/scripts/aa420ba8f8c0b546ec1b.js +1 -1
- package/dist/client/scripts/ab78c19a4e39b36f31db.js +1 -0
- package/dist/client/scripts/ac61187dca33e7ce424a.js +1 -0
- package/dist/client/scripts/aed199f6a2d99ed2c6ed.js +1 -0
- package/dist/client/scripts/af9276e8bebe0ab20336.js +1 -0
- package/dist/client/scripts/b0fa1ba312ee329cb3e5.js +1 -0
- package/dist/client/scripts/b1e7410c40828f1764d3.js +1 -0
- package/dist/client/scripts/b28545c066f1d7392f38.js +1 -0
- package/dist/client/scripts/b55e02a32d90c14f4cbe.js +1 -0
- package/dist/client/scripts/b6fd2ab6730d6bb9bcdf.js +1 -0
- package/dist/client/scripts/b951d27fb7938085152b.js +1 -0
- package/dist/client/scripts/ba92be8988f6e7cd5e6f.js +1 -0
- package/dist/client/scripts/baf3f29cb863c2f70914.js +1 -0
- package/dist/client/scripts/bb6ee4365a8705780e12.js +1 -0
- package/dist/client/scripts/bc8c593bdc7f77961b3e.js +1 -0
- package/dist/client/scripts/bccd95120799e94ad85b.js +1 -0
- package/dist/client/scripts/bce7cfcab89665d7843d.js +1 -0
- package/dist/client/scripts/bcffe26cebcae8869796.js +1 -0
- package/dist/client/scripts/beaf345e668e5858c6bd.js +1 -0
- package/dist/client/scripts/bfecde8061dcff3d096e.js +1 -0
- package/dist/client/scripts/c033ed6d46bc42084b33.js +1 -0
- package/dist/client/scripts/c10411cb2fb0d1e96b39.js +1 -0
- package/dist/client/scripts/c1d9299a2481f61b3e9b.js +1 -0
- package/dist/client/scripts/c2534659707a053ea8ee.js +1 -0
- package/dist/client/scripts/c267ae2b25cacae519ed.js +1 -0
- package/dist/client/scripts/c26ce260299263eeb8bb.js +1 -1
- package/dist/client/scripts/c3527a51540c796aa210.js +1 -0
- package/dist/client/scripts/c3768b5966b8ae4dfaec.js +1 -0
- package/dist/client/scripts/c385596749afa7bb3263.js +1 -0
- package/dist/client/scripts/c4988b34044304274bd5.js +1 -0
- package/dist/client/scripts/c4d1c2c8dbf87da6d96f.js +1 -0
- package/dist/client/scripts/c7fb4e35252146ab1ff9.js +1 -0
- package/dist/client/scripts/c851b9c277a957cfd5d1.js +1 -0
- package/dist/client/scripts/ca534726c8438931e48c.js +1 -0
- package/dist/client/scripts/cb6f19fdf5a3339ce13a.js +1 -0
- package/dist/client/scripts/cb7718d9829f07833d01.js +1 -0
- package/dist/client/scripts/cbc09cc950a1dd22d943.js +1 -0
- package/dist/client/scripts/cd64d43e92bed9490b5e.js +1 -0
- package/dist/client/scripts/cdb04a3db8b41eabef26.js +1 -0
- package/dist/client/scripts/ce0c092a8914dd6ea4bc.js +1 -0
- package/dist/client/scripts/ce762c959cf9b699acf8.js +1 -1
- package/dist/client/scripts/d004c86b9221141e7607.js +1 -0
- package/dist/client/scripts/d0572376812fe6fc9dec.js +1 -0
- package/dist/client/scripts/d05a0cf78979bfacdb55.js +1 -0
- package/dist/client/scripts/d2b730ad00573dad86d4.js +1 -0
- package/dist/client/scripts/d3290ba9c36afffcdaf5.js +1 -0
- package/dist/client/scripts/d3762db0c2c2b01eb444.js +1 -0
- package/dist/client/scripts/d43c1005ef0b2e384fdb.js +1 -0
- package/dist/client/scripts/d45a491bd98ee16dc921.js +1 -0
- package/dist/client/scripts/d4975689673752fc50fd.js +1 -0
- package/dist/client/scripts/d7be84839eb13c10994d.js +1 -0
- package/dist/client/scripts/d84d483d866959c361e3.js +1 -0
- package/dist/client/scripts/d90312afbc1bfd9f5a0d.js +1 -0
- package/dist/client/scripts/dcdb0c57cb9174c2474b.js +1 -0
- package/dist/client/scripts/e0dd06533ebb6c7bc4cc.js +1 -0
- package/dist/client/scripts/e1041a8f8fee37da9f64.js +1 -0
- package/dist/client/scripts/e147a51def3ab23ae656.js +1 -0
- package/dist/client/scripts/e19441594c72c7e33187.js +1 -0
- package/dist/client/scripts/e23286dae5ab566935f8.js +1 -0
- package/dist/client/scripts/e40e16f802cba2b38cd0.js +1 -0
- package/dist/client/scripts/e50f735e24a5511e4fe7.js +1 -0
- package/dist/client/scripts/e53c02752abb05f93abd.js +2 -0
- package/dist/client/scripts/e74cb22d42037309926d.js +1 -0
- package/dist/client/scripts/e82db7ecb8bd18986174.js +1 -0
- package/dist/client/scripts/e835ff260d3fbc62fe97.js +1 -0
- package/dist/client/scripts/e8e60da8c8779e8707b7.js +1 -0
- package/dist/client/scripts/e9da886158b0f2214ae2.js +1 -0
- package/dist/client/scripts/ea9c40e082d00151bcb2.js +1 -0
- package/dist/client/scripts/eba32e7258bb2a7a1a2a.js +1 -0
- package/dist/client/scripts/ebd5c31d99bfb280a1c4.js +1 -0
- package/dist/client/scripts/ede70c2797449c4d51a6.js +1 -0
- package/dist/client/scripts/eee8069cb45b656fdd7c.js +1 -0
- package/dist/client/scripts/ef1dd69cae444e50867a.js +1 -0
- package/dist/client/scripts/f059d5c14973f89cc511.js +1 -0
- package/dist/client/scripts/f07600be83e973fe699f.js +1 -0
- package/dist/client/scripts/f12e8d4deaddb3b26d58.js +1 -0
- package/dist/client/scripts/f25db0c188d1d6ae7dd7.js +1 -0
- package/dist/client/scripts/f277be41b5d66b178431.js +1 -1
- package/dist/client/scripts/f30fbd3d7d6421ff0d75.js +1 -0
- package/dist/client/scripts/f3ee4bdf344f8724e4c7.js +1 -0
- package/dist/client/scripts/f4a668879a22f437d35c.js +1 -0
- package/dist/client/scripts/f4dd172b8568997dcdf4.js +2 -0
- package/dist/client/scripts/f5dd83c05af526500d98.js +1 -0
- package/dist/client/scripts/f63eafcdb6b94fd95198.js +1 -0
- package/dist/client/scripts/f6cb2798677ada41ec58.js +1 -0
- package/dist/client/scripts/f812bdfd78927c2b61fe.js +1 -0
- package/dist/client/scripts/f84229a0696a0096e336.js +1 -0
- package/dist/client/scripts/f8e071a1b88fcd7db10a.js +1 -0
- package/dist/client/scripts/fbd887d0bca0878a38f9.js +1 -0
- package/dist/client/scripts/fbf1755027488e5b0cfb.js +1 -0
- package/dist/client/scripts/fcca4ddacffe3f8cf584.js +1 -0
- package/dist/client/scripts/fec2ba020c24c384b60b.js +1 -0
- package/dist/client/scripts/ff3f98b95580dd1fde4c.js +1 -0
- package/dist/client/scripts/ff4c5a9ba80c1fe53316.js +1 -0
- package/dist/components/LoadingSpinner-OUYR1Zws.mjs +14175 -0
- package/dist/components/LoadingSpinner-W8dEafHA.js +38 -0
- package/dist/components/deprecated-BJ2e68Yo.js +13 -0
- package/dist/components/deprecated-SV4OJNeR.mjs +16 -0
- package/dist/components/highland-cow-6AoCzBpF.mjs +18 -0
- package/dist/components/highland-cow-DlMGnebG.js +15 -0
- package/dist/components/iCentre-BLimkPxI.mjs +46 -0
- package/dist/components/iCentre-BnLcpIw8.js +43 -0
- package/dist/components/os-logo-maps-DUN8X-lQ.mjs +13 -0
- package/dist/components/os-logo-maps-QXAuept_.js +10 -0
- package/dist/components/os-logo-maps-white-BTtf_Eki.js +7 -0
- package/dist/components/os-logo-maps-white-SKYtuD6d.mjs +10 -0
- package/dist/components/prototype-DQocvgQh.js +13 -0
- package/dist/components/prototype-lvwJzV8T.mjs +16 -0
- package/dist/components/ready-CWPx4e9A.mjs +15 -0
- package/dist/components/ready-D9pdKFkx.js +12 -0
- package/dist/components/review-7L3On10m.js +12 -0
- package/dist/components/review-CknihZl_.mjs +15 -0
- package/dist/components/src/components/form/Form.vue.d.ts +4 -10
- package/dist/components/src/components/select/Select.vue.d.ts +14 -14
- package/dist/components/style.css +1 -1
- package/dist/components/visitscotland-logo-BEiiuSpo.mjs +7 -0
- package/dist/components/visitscotland-logo-NoymCLtN.js +4 -0
- package/dist/components/vs-component-library-maps.js +11 -11
- package/dist/components/vs-component-library-maps.mjs +3554 -3560
- package/dist/components/vs-component-library.js +201 -201
- package/dist/components/vs-component-library.mjs +3156 -3156
- package/dist/ssr/index.js +1 -1
- package/dist/ssr/manifest.json +1 -1
- package/dist/ssr/styles/6939e6bd1ef50bd4e031.css +205 -0
- package/package.json +233 -233
- package/dist/client/scripts/0036243f84e83014237c.js +0 -1
- package/dist/client/scripts/00ccd7949f170b3d738d.js +0 -1
- package/dist/client/scripts/01554a4fdde2d61b4d49.js +0 -1
- package/dist/client/scripts/02267cd15e5d3c38ec2a.js +0 -1
- package/dist/client/scripts/0389a15654d3a45aab1a.js +0 -1
- package/dist/client/scripts/04b71860f29844231b00.js +0 -1
- package/dist/client/scripts/04dfed6889eaadd2afd5.js +0 -1
- package/dist/client/scripts/056cd8933beea0edc19e.js +0 -1
- package/dist/client/scripts/05ed6c26804615289452.js +0 -1
- package/dist/client/scripts/089accd171820ed54ff9.js +0 -1
- package/dist/client/scripts/093dbadb21acf4310ea2.js +0 -1
- package/dist/client/scripts/0965942c287f6c10c83a.js +0 -1
- package/dist/client/scripts/09efaf35581f94d9341a.js +0 -1
- package/dist/client/scripts/0a73fba3841d42f4062e.js +0 -1
- package/dist/client/scripts/0b761938ad36cd67b6bf.js +0 -1
- package/dist/client/scripts/0da964d971a554507734.js +0 -1
- package/dist/client/scripts/0de83ee7e84dc3cca135.js +0 -1
- package/dist/client/scripts/0e836ffbc4a97ef8a4fb.js +0 -1
- package/dist/client/scripts/0eccccf491d2d8c15ec2.js +0 -1
- package/dist/client/scripts/10559d03b0ae2c434d59.js +0 -1
- package/dist/client/scripts/1077b219313276c21765.js +0 -1
- package/dist/client/scripts/108124f3353174a3c98b.js +0 -1
- package/dist/client/scripts/10c8c43c2d1d2c9c3ac6.js +0 -1
- package/dist/client/scripts/1262d9eb296be8be48b9.js +0 -1
- package/dist/client/scripts/138cfedbc9aa0fb82acc.js +0 -1
- package/dist/client/scripts/149849e9e46fa12a6d57.js +0 -1
- package/dist/client/scripts/15e9f022c7952c07e6ce.js +0 -1
- package/dist/client/scripts/16a3a76ec493d5af9559.js +0 -1
- package/dist/client/scripts/16d1b6f2e9d13a059244.js +0 -1
- package/dist/client/scripts/16f08d577a78d2740818.js +0 -1
- package/dist/client/scripts/17bca51c0b3e12105894.js +0 -1
- package/dist/client/scripts/17f050e8fbf954ca4400.js +0 -1
- package/dist/client/scripts/18fdae02c01f35f20b11.js +0 -1
- package/dist/client/scripts/1970d55f90fe220cf58b.js +0 -1
- package/dist/client/scripts/19a97f4c8217fe493368.js +0 -1
- package/dist/client/scripts/1aae8117699af5bed418.js +0 -1
- package/dist/client/scripts/1c048832077af161ca70.js +0 -1
- package/dist/client/scripts/1c5e74a53e980a13c560.js +0 -1
- package/dist/client/scripts/1dab8b823a9fc7be9e7d.js +0 -1
- package/dist/client/scripts/205795ceed348c421487.js +0 -1
- package/dist/client/scripts/209af26331fa5efbb1e0.js +0 -1
- package/dist/client/scripts/2122d479f8a8a3d5a02e.js +0 -1
- package/dist/client/scripts/22e270f311f56a5407cb.js +0 -1
- package/dist/client/scripts/23889a0a798b09d499c1.js +0 -1
- package/dist/client/scripts/23b4b0e265088d24449e.js +0 -1
- package/dist/client/scripts/23c68f0836ee164afc97.js +0 -1
- package/dist/client/scripts/24070a0f940f8ed87a1c.js +0 -1
- package/dist/client/scripts/2862716c5f1748b88abf.js +0 -1
- package/dist/client/scripts/29a09e10b4c826dc6bcd.js +0 -1
- package/dist/client/scripts/29d2385ba08f0023585c.js +0 -1
- package/dist/client/scripts/2a0d066c05ce80ef84a2.js +0 -1
- package/dist/client/scripts/2a512ada29fd6340b561.js +0 -1
- package/dist/client/scripts/2a74d3661f1aeb64da2d.js +0 -1
- package/dist/client/scripts/2bdd4484eaf0f7c7bc7d.js +0 -1
- package/dist/client/scripts/2cd9d0c7890646526851.js +0 -1
- package/dist/client/scripts/2d931eb506983939dee2.js +0 -1
- package/dist/client/scripts/2e41422c35f0d8147936.js +0 -1
- package/dist/client/scripts/2e92c9f1881a5f4f24d8.js +0 -1
- package/dist/client/scripts/2f0aa96a3867425b917c.js +0 -1
- package/dist/client/scripts/2fb997a43b43bfb18687.js +0 -1
- package/dist/client/scripts/31bdae30a445f8caf38d.js +0 -1
- package/dist/client/scripts/33243d5f6375a35a5b08.js +0 -1
- package/dist/client/scripts/336dc65beaffd0fe9728.js +0 -1
- package/dist/client/scripts/378133b962494b0328be.js +0 -1
- package/dist/client/scripts/382fbb35d40be45010f0.js +0 -1
- package/dist/client/scripts/38318d710c41e17d02b6.js +0 -1
- package/dist/client/scripts/38875405be2461bf6367.js +0 -1
- package/dist/client/scripts/38d5589b9158ab8e7423.js +0 -1
- package/dist/client/scripts/392a233a558e074c70d9.js +0 -1
- package/dist/client/scripts/3967efd5a872171e7230.js +0 -1
- package/dist/client/scripts/3aaefce16b5df1479178.js +0 -1
- package/dist/client/scripts/3abc2630f32e1ddf96d3.js +0 -1
- package/dist/client/scripts/3ae3625c5b179d3021e9.js +0 -1
- package/dist/client/scripts/3c5baf37fc4cdec110f6.js +0 -1
- package/dist/client/scripts/3cf61618bc3263a1c0c9.js +0 -1
- package/dist/client/scripts/3e2a4885ce28b249cd63.js +0 -1
- package/dist/client/scripts/3e5daaae9842486f22de.js +0 -1
- package/dist/client/scripts/3ea2352e8a94ddc6dc8a.js +0 -1
- package/dist/client/scripts/406e9909758efdb1ae29.js +0 -1
- package/dist/client/scripts/408bd09f6eb4f00d6659.js +0 -1
- package/dist/client/scripts/41dea7515c49fbb37cd0.js +0 -1
- package/dist/client/scripts/42233f90e1246c3d508e.js +0 -1
- package/dist/client/scripts/43f8d26f8aecf79a4b3a.js +0 -1
- package/dist/client/scripts/4626c48ced549c077e3e.js +0 -1
- package/dist/client/scripts/4686de7ea799c8ec1c03.js +0 -1
- package/dist/client/scripts/46b91e4ff55299b16e9b.js +0 -1
- package/dist/client/scripts/4a7dd18ce8648d5f3748.js +0 -1
- package/dist/client/scripts/4adaa88e55937e122c02.js +0 -1
- package/dist/client/scripts/4bd0e0de8052cba02172.js +0 -1
- package/dist/client/scripts/4db66c860932e8c611a3.js +0 -1
- package/dist/client/scripts/4e22e8c6d6968c8bb509.js +0 -1
- package/dist/client/scripts/5032a70c599e2f468071.js +0 -1
- package/dist/client/scripts/507d772ea7c3ad69cd02.js +0 -1
- package/dist/client/scripts/51240b9c502b2993bd72.js +0 -1
- package/dist/client/scripts/52884b53dca6e2248312.js +0 -1
- package/dist/client/scripts/529a6860261e6074f3d1.js +0 -1
- package/dist/client/scripts/529b4b855c5a64c0b642.js +0 -1
- package/dist/client/scripts/52ead081f08a937878ce.js +0 -1
- package/dist/client/scripts/5389ee753606f9248ce8.js +0 -1
- package/dist/client/scripts/544b6969eedda98a4909.js +0 -1
- package/dist/client/scripts/55718fd925b0c6f0c0fd.js +0 -1
- package/dist/client/scripts/55b1f27dcbab64e7f0b4.js +0 -1
- package/dist/client/scripts/568f78f9b01fc9462683.js +0 -1
- package/dist/client/scripts/5801faf406d084e1f422.js +0 -1
- package/dist/client/scripts/580a33d2a6fd7fafab2e.js +0 -1
- package/dist/client/scripts/58473b34392d3edecc6c.js +0 -1
- package/dist/client/scripts/59ab7b4a6827442b90c7.js +0 -1
- package/dist/client/scripts/5bfe1a52e5e438b16b80.js +0 -1
- package/dist/client/scripts/5c2b82e012d3f482ead3.js +0 -1
- package/dist/client/scripts/5d1cdcc8987a6cc186f0.js +0 -1
- package/dist/client/scripts/5f831ae065d194ef8b88.js +0 -2
- package/dist/client/scripts/6011db9e93655179bce2.js +0 -1
- package/dist/client/scripts/6021921cffa267d6b6a7.js +0 -1
- package/dist/client/scripts/607805f92c511232d42e.js +0 -1
- package/dist/client/scripts/60cb2189fbc7f98e341c.js +0 -1
- package/dist/client/scripts/60e11eae5d8e305a26b5.js +0 -1
- package/dist/client/scripts/6198cadc6ef977ea0b7f.js +0 -1
- package/dist/client/scripts/61e2b5d6d91ac1f79caa.js +0 -1
- package/dist/client/scripts/6231f7cde1c1a252e3ff.js +0 -1
- package/dist/client/scripts/6482c0db9dfb95939fd0.js +0 -1
- package/dist/client/scripts/6544d845ce286c6cf7f6.js +0 -2
- package/dist/client/scripts/6544d845ce286c6cf7f6.js.LICENSE.txt +0 -7
- package/dist/client/scripts/662de3a6d0e84564965f.js +0 -1
- package/dist/client/scripts/66d5a4a2cf08cdaa86bb.js +0 -1
- package/dist/client/scripts/678be80c89eff10efccf.js +0 -2
- package/dist/client/scripts/69230c65912cdd38a584.js +0 -1
- package/dist/client/scripts/697dab8ed79ec60a309b.js +0 -1
- package/dist/client/scripts/69c0b19f9b3d9637c86d.js +0 -1
- package/dist/client/scripts/6a18930893f1bec771d8.js +0 -1
- package/dist/client/scripts/6b275c100f8042199de9.js +0 -1
- package/dist/client/scripts/6b3a9814dfe9345f60db.js +0 -1
- package/dist/client/scripts/6dcc7e68252e013045d4.js +0 -1
- package/dist/client/scripts/6f579b91d024f526a37f.js +0 -1
- package/dist/client/scripts/701b3f29f72a42f4ba5b.js +0 -1
- package/dist/client/scripts/715a2208f0956b83dafc.js +0 -1
- package/dist/client/scripts/71ef2d367311e6e5bc86.js +0 -1
- package/dist/client/scripts/72709ccc1d539e0e7922.js +0 -1
- package/dist/client/scripts/72e8cf2a7ddceadf4584.js +0 -2
- package/dist/client/scripts/72e8cf2a7ddceadf4584.js.LICENSE.txt +0 -1
- package/dist/client/scripts/746da613bad15ee3dcff.js +0 -1
- package/dist/client/scripts/74ecbb4b7b820d191d79.js +0 -1
- package/dist/client/scripts/784d227f712ddb91cb2a.js +0 -1
- package/dist/client/scripts/7920255a5c68d97e99d9.js +0 -1
- package/dist/client/scripts/7bd6628181af41e6fc20.js +0 -1
- package/dist/client/scripts/7c55ed358f5750245829.js +0 -1
- package/dist/client/scripts/7f80929b1cc1047be1c9.js +0 -1
- package/dist/client/scripts/80482a16fe24140d2a21.js +0 -1
- package/dist/client/scripts/804a497cb44fe949310e.js +0 -1
- package/dist/client/scripts/815b2ba5fab54eebb5ca.js +0 -1
- package/dist/client/scripts/830e7f83c507e3b81403.js +0 -1
- package/dist/client/scripts/83df837d0feb863dfcd9.js +0 -1
- package/dist/client/scripts/84e8cb222b65ef8c7fd7.js +0 -1
- package/dist/client/scripts/8537711ac020c8f29676.js +0 -1
- package/dist/client/scripts/86714d804290b9ba22f6.js +0 -1
- package/dist/client/scripts/867ee96ab822b2070c40.js +0 -1
- package/dist/client/scripts/87437d71b7ed0a627316.js +0 -1
- package/dist/client/scripts/8773147ebc61bee2e1a6.js +0 -1
- package/dist/client/scripts/886d531d72735c6d34f0.js +0 -1
- package/dist/client/scripts/88b02946d875717c7892.js +0 -1
- package/dist/client/scripts/8a563c21fcd39c3edc64.js +0 -1
- package/dist/client/scripts/8bbb03cef27adbf1052c.js +0 -1
- package/dist/client/scripts/8bff3de4212bafab4077.js +0 -1
- package/dist/client/scripts/8ce2d092e29a43286f3c.js +0 -1
- package/dist/client/scripts/9017b70932ac98380220.js +0 -1
- package/dist/client/scripts/914125d34a0c8421839d.js +0 -1
- package/dist/client/scripts/91501cfefb3e9beeffa4.js +0 -1
- package/dist/client/scripts/91d074c85ca207348249.js +0 -1
- package/dist/client/scripts/91ec808848d9ef8fde7a.js +0 -1
- package/dist/client/scripts/91f5a130ef63276c95f1.js +0 -1
- package/dist/client/scripts/92e2f55c77c0b9473c56.js +0 -1
- package/dist/client/scripts/92f88dfc1b040e6657db.js +0 -1
- package/dist/client/scripts/9324abfa574340eb6ede.js +0 -1
- package/dist/client/scripts/933d633cb47a3304650c.js +0 -1
- package/dist/client/scripts/93891a876d2976d9805f.js +0 -1
- package/dist/client/scripts/9486014a6b617075b94c.js +0 -1
- package/dist/client/scripts/95239a6c2ab36a9f67e8.js +0 -1
- package/dist/client/scripts/958dc3347b4c79ae92f0.js +0 -1
- package/dist/client/scripts/980215f15338a4638935.js +0 -1
- package/dist/client/scripts/9865e2574c6d07158054.js +0 -1
- package/dist/client/scripts/98b05b5cd0aaffd7572a.js +0 -1
- package/dist/client/scripts/9a3456d670f8b4d54fa7.js +0 -1
- package/dist/client/scripts/9a83b42dbc369d0277e6.js +0 -1
- package/dist/client/scripts/9c4c4822a484f5a5ad19.js +0 -1
- package/dist/client/scripts/a1d3f1a72e58f869f748.js +0 -1
- package/dist/client/scripts/a1e09e772d99a582aca6.js +0 -1
- package/dist/client/scripts/a299cbe3889cd21cace8.js +0 -1
- package/dist/client/scripts/a2fe354aca6970fedba6.js +0 -1
- package/dist/client/scripts/a397c46fe765889eba59.js +0 -1
- package/dist/client/scripts/a451e339bbbf4c755dd2.js +0 -1
- package/dist/client/scripts/a49c74188fc5251d8b65.js +0 -1
- package/dist/client/scripts/a55fed95b2f031316caf.js +0 -1
- package/dist/client/scripts/a6130794c1d33d80488a.js +0 -1
- package/dist/client/scripts/a67dfcc6f9de1ceaf9d9.js +0 -1
- package/dist/client/scripts/a6d598ec76e67174f994.js +0 -1
- package/dist/client/scripts/a74cc1abc33d10c98576.js +0 -1
- package/dist/client/scripts/a7dbd4ea0593cac5da1e.js +0 -1
- package/dist/client/scripts/a7f81a333cfee151ffc8.js +0 -1
- package/dist/client/scripts/a8c732ef4e6bb196c696.js +0 -1
- package/dist/client/scripts/a98815c8466bb8a199d5.js +0 -1
- package/dist/client/scripts/a9887918f6748e99e5e6.js +0 -1
- package/dist/client/scripts/a98a1c78a6e495be1fe3.js +0 -1
- package/dist/client/scripts/a98ae546a5412a626205.js +0 -1
- package/dist/client/scripts/aaf155991bb2554936c0.js +0 -1
- package/dist/client/scripts/ab31c58b4b87e68b35fb.js +0 -1
- package/dist/client/scripts/ab4c23c9be69cc8dc10a.js +0 -1
- package/dist/client/scripts/abe7bec6335799afee09.js +0 -1
- package/dist/client/scripts/ac814e350b080b08f5fe.js +0 -1
- package/dist/client/scripts/ac9413fc9a5f74284fd0.js +0 -1
- package/dist/client/scripts/ada91090ef1c52557dc9.js +0 -1
- package/dist/client/scripts/adc43fc9fa9ee3c85f21.js +0 -1
- package/dist/client/scripts/ae547edbc8099702ba5a.js +0 -1
- package/dist/client/scripts/ae596ff1996c280c202c.js +0 -1
- package/dist/client/scripts/aed82b4abb9926126fdd.js +0 -1
- package/dist/client/scripts/af5952182a294bc0aa31.js +0 -1
- package/dist/client/scripts/afd5b0c1ea115a131076.js +0 -1
- package/dist/client/scripts/affc2dc765c1741a7319.js +0 -1
- package/dist/client/scripts/b12061cee6bd7ef0da0b.js +0 -1
- package/dist/client/scripts/b1590b789b54502c0272.js +0 -1
- package/dist/client/scripts/b16d36c13df4f81799dc.js +0 -2
- package/dist/client/scripts/b1786948f0135f272a09.js +0 -1
- package/dist/client/scripts/b28351429658bbe84c2b.js +0 -1
- package/dist/client/scripts/b43eabedc3d8cb405b13.js +0 -1
- package/dist/client/scripts/b83b6b4191840a25baa5.js +0 -1
- package/dist/client/scripts/bd3814764b1c7e8c5751.js +0 -1
- package/dist/client/scripts/becfc64a7cf18580f64b.js +0 -1
- package/dist/client/scripts/bf0781d3e1fda7aaf432.js +0 -1
- package/dist/client/scripts/bff2361f88ee3867b9b5.js +0 -1
- package/dist/client/scripts/c0448d3c462e3deb1993.js +0 -1
- package/dist/client/scripts/c07d2bb6aab9b5629d10.js +0 -1
- package/dist/client/scripts/c183f805ae8a659449f3.js +0 -1
- package/dist/client/scripts/c21a6c36e3568bdc534f.js +0 -1
- package/dist/client/scripts/c3622d52d3929b8ce67a.js +0 -1
- package/dist/client/scripts/c44d2718bc46a06944c9.js +0 -1
- package/dist/client/scripts/c4c6c4f82f8a5ceb9401.js +0 -1
- package/dist/client/scripts/c5f1674416359d3591b6.js +0 -1
- package/dist/client/scripts/c6fcd69688050e54270d.js +0 -1
- package/dist/client/scripts/c92d18059ca7a5fa187e.js +0 -1
- package/dist/client/scripts/ca79fa2a1ed7e82e450a.js +0 -1
- package/dist/client/scripts/ccbc92304043924d021b.js +0 -1
- package/dist/client/scripts/d014754e0eff762e6ca9.js +0 -1
- package/dist/client/scripts/d014f1abc1fcc90b5657.js +0 -1
- package/dist/client/scripts/d0754b4aa24deddb7245.js +0 -1
- package/dist/client/scripts/d2b70350d3fa2cef0e39.js +0 -1
- package/dist/client/scripts/d307d2e9cf655c179d77.js +0 -1
- package/dist/client/scripts/d39f4c3cff0aeebb9f76.js +0 -1
- package/dist/client/scripts/d3aa563c4024f80b82d0.js +0 -1
- package/dist/client/scripts/d46534bfd4639ca6592e.js +0 -1
- package/dist/client/scripts/d7a62916cee4d6e2b444.js +0 -1
- package/dist/client/scripts/d8502c8331a1e69286ed.js +0 -1
- package/dist/client/scripts/d92b71a6a05b8f554c7e.js +0 -1
- package/dist/client/scripts/db30cb86f2d695ff6d1c.js +0 -1
- package/dist/client/scripts/dba3948d8b668e96cee6.js +0 -1
- package/dist/client/scripts/dc16b2fd8f77226e3fd5.js +0 -1
- package/dist/client/scripts/dca2c65879ee8c6fe5e7.js +0 -1
- package/dist/client/scripts/ddc4d2ea575a50bc4ae3.js +0 -1
- package/dist/client/scripts/de137222b71f4b8d7f47.js +0 -1
- package/dist/client/scripts/de48ab96f2314589c8f5.js +0 -1
- package/dist/client/scripts/df56e8276b6973df6c3c.js +0 -1
- package/dist/client/scripts/dfab0d5501435b36f6fb.js +0 -1
- package/dist/client/scripts/dfb0649a31917de093b0.js +0 -1
- package/dist/client/scripts/e0ae6eb532e9deca95b9.js +0 -1
- package/dist/client/scripts/e0c5487ea1f49ba55654.js +0 -1
- package/dist/client/scripts/e0f5acc47ed5ca962695.js +0 -1
- package/dist/client/scripts/e2b91f9e13b86ff8389c.js +0 -1
- package/dist/client/scripts/e31c75f05ebcf9568c26.js +0 -1
- package/dist/client/scripts/e32ea532d3a6b8476e8e.js +0 -1
- package/dist/client/scripts/e555e6f7c093044467bd.js +0 -1
- package/dist/client/scripts/e600798c21b1e4b3421a.js +0 -1
- package/dist/client/scripts/e60fe8e9115fe7dd13cf.js +0 -1
- package/dist/client/scripts/e6d875a37c62f3d3e561.js +0 -1
- package/dist/client/scripts/e6e11ced2410e20b8d71.js +0 -1
- package/dist/client/scripts/e72a9fa25e0cb614b047.js +0 -1
- package/dist/client/scripts/e7b33c7b9c52aa2c42fb.js +0 -1
- package/dist/client/scripts/e8055817c34ca7f2e0d1.js +0 -1
- package/dist/client/scripts/e84e2c99fac618724a6b.js +0 -1
- package/dist/client/scripts/e86000417aa87698de4d.js +0 -1
- package/dist/client/scripts/e92b419e81affdea6d7d.js +0 -1
- package/dist/client/scripts/e949a288ca740fd5e306.js +0 -1
- package/dist/client/scripts/e94da6d3801ebb02d8ce.js +0 -1
- package/dist/client/scripts/e97cb8c56d2e5ca10a9b.js +0 -1
- package/dist/client/scripts/eab0059cfa57db0af11c.js +0 -1
- package/dist/client/scripts/eb9ab6dd707734630876.js +0 -1
- package/dist/client/scripts/eda3d84b5c7ef1cf832f.js +0 -1
- package/dist/client/scripts/ee1d435693f0ce65b853.js +0 -1
- package/dist/client/scripts/eeaf7a5064376c23e2fd.js +0 -1
- package/dist/client/scripts/f166c3fa28bce031e937.js +0 -1
- package/dist/client/scripts/f1fc1db1d8256f3c8b0f.js +0 -1
- package/dist/client/scripts/f2a2f7927eed677de0fb.js +0 -1
- package/dist/client/scripts/f2cfbc8d04d591718bf9.js +0 -1
- package/dist/client/scripts/f2dfcfa0d38d341fc827.js +0 -2
- package/dist/client/scripts/f2ef165911bb1b115aad.js +0 -1
- package/dist/client/scripts/f443edb707d72594a1e7.js +0 -1
- package/dist/client/scripts/f446782fd7a7a2f8aaef.js +0 -1
- package/dist/client/scripts/f463c441cd83d40c3f8f.js +0 -1
- package/dist/client/scripts/f75efc7d112f59f0bf9c.js +0 -1
- package/dist/client/scripts/f94be4a838d4a8146c32.js +0 -1
- package/dist/client/scripts/fdd619f75d63a8628e4e.js +0 -2
- package/dist/client/scripts/fddbb5023e794ab0f98a.js +0 -1
- package/dist/client/scripts/fe9b0e3ab93fda599cfb.js +0 -1
- package/dist/client/scripts/fed71972ffa79d797286.js +0 -1
- package/dist/client/scripts/feeecf83bdc1c651376a.js +0 -1
- package/dist/client/scripts/ff80131a5bed70291e0b.js +0 -1
- package/dist/components/LoadingSpinner-BKvB97F9.mjs +0 -14048
- package/dist/components/LoadingSpinner-C8LAYV8q.js +0 -38
- package/dist/components/deprecated-B3DbN99Y.mjs +0 -16
- package/dist/components/deprecated-Cl9osRH8.js +0 -13
- package/dist/components/highland-cow-BiKfZg7L.mjs +0 -18
- package/dist/components/highland-cow-CRm5ANrL.js +0 -15
- package/dist/components/iCentre-BeepnBTk.js +0 -43
- package/dist/components/iCentre-DV4_tr7d.mjs +0 -46
- package/dist/components/os-logo-maps-B7DKWN7s.mjs +0 -13
- package/dist/components/os-logo-maps-CF9QEvIX.js +0 -10
- package/dist/components/os-logo-maps-white-DOUatF7F.js +0 -7
- package/dist/components/os-logo-maps-white-Dl0tLZD_.mjs +0 -10
- package/dist/components/prototype-8NKYzK-s.mjs +0 -16
- package/dist/components/prototype-ggLuAMuB.js +0 -13
- package/dist/components/ready-DQA4tUcz.mjs +0 -15
- package/dist/components/ready-DSUouF6L.js +0 -12
- package/dist/components/review-B3KwWYuP.mjs +0 -15
- package/dist/components/review-Bi0lAugE.js +0 -12
- package/dist/components/visitscotland-logo-BA7LkUJw.mjs +0 -7
- package/dist/components/visitscotland-logo-yAzNpi5x.js +0 -4
- package/dist/ssr/styles/864095754937ffa99171.css +0 -205
- /package/dist/client/scripts/{04d55c65d84727be241d.js → 27ab39799c27a6e7c170.js} +0 -0
- /package/dist/client/scripts/{678be80c89eff10efccf.js.LICENSE.txt → 370e6150fbd0dccf34c7.js.LICENSE.txt} +0 -0
- /package/dist/client/scripts/{fdd619f75d63a8628e4e.js.LICENSE.txt → 65f43123fc14b35b64d1.js.LICENSE.txt} +0 -0
- /package/dist/client/scripts/{f2dfcfa0d38d341fc827.js.LICENSE.txt → 70b382267b5513186329.js.LICENSE.txt} +0 -0
- /package/dist/client/scripts/{fd3f812603b78fe9978b.js → 81267fad3ff38d811ea7.js} +0 -0
- /package/dist/client/scripts/{5c7de0c787b6e213d9a7.js → d94ba5393987a3e2d90a.js} +0 -0
- /package/dist/client/scripts/{5f831ae065d194ef8b88.js.LICENSE.txt → e53c02752abb05f93abd.js.LICENSE.txt} +0 -0
- /package/dist/client/scripts/{6b563760413cecbb2ea9.js → e6abca5f001c11b9b614.js} +0 -0
- /package/dist/client/scripts/{4ffdfcf6a6eecdca5833.js → f29db69f95e75149e0e5.js} +0 -0
- /package/dist/client/scripts/{b16d36c13df4f81799dc.js.LICENSE.txt → f4dd172b8568997dcdf4.js.LICENSE.txt} +0 -0
- /package/dist/client/styles/{f1fc1db1d8256f3c8b0f.css → 02cd01e4087e8d5aa492.css} +0 -0
- /package/dist/client/styles/{87437d71b7ed0a627316.css → 0438b2a237fc5bdc3284.css} +0 -0
- /package/dist/client/styles/{e0c5487ea1f49ba55654.css → 05a1efe07f04c478155a.css} +0 -0
- /package/dist/client/styles/{804a497cb44fe949310e.css → 06e2a0dd3335dfc0e506.css} +0 -0
- /package/dist/client/styles/{e949a288ca740fd5e306.css → 08755652b19e4b8cc3a6.css} +0 -0
- /package/dist/client/styles/{59ab7b4a6827442b90c7.css → 093df1d5f4968f1a29eb.css} +0 -0
- /package/dist/client/styles/{5389ee753606f9248ce8.css → 09ae016b64791f86ce4a.css} +0 -0
- /package/dist/client/styles/{8773147ebc61bee2e1a6.css → 09b087ec0d366e0f4aab.css} +0 -0
- /package/dist/client/styles/{5032a70c599e2f468071.css → 0ab3c46d6068a5f67c1f.css} +0 -0
- /package/dist/client/styles/{a98ae546a5412a626205.css → 0b5992e43cb6b1a5b482.css} +0 -0
- /package/dist/client/styles/{9486014a6b617075b94c.css → 0c8e63483304c803b42a.css} +0 -0
- /package/dist/client/styles/{746da613bad15ee3dcff.css → 0d44aeaf665b9f76f1a3.css} +0 -0
- /package/dist/client/styles/{92e2f55c77c0b9473c56.css → 0fc32c57e4b4c007d86e.css} +0 -0
- /package/dist/client/styles/{95239a6c2ab36a9f67e8.css → 10feb66c27c41e55bdd4.css} +0 -0
- /package/dist/client/styles/{51240b9c502b2993bd72.css → 125f54f2181f20b9b6c7.css} +0 -0
- /package/dist/client/styles/{c3622d52d3929b8ce67a.css → 12c214803bb856eac25e.css} +0 -0
- /package/dist/client/styles/{f75efc7d112f59f0bf9c.css → 147acfad2826cadced1c.css} +0 -0
- /package/dist/client/styles/{a9887918f6748e99e5e6.css → 170ca751557782434b86.css} +0 -0
- /package/dist/client/styles/{86714d804290b9ba22f6.css → 18b8732facc297fa275d.css} +0 -0
- /package/dist/client/styles/{16f08d577a78d2740818.css → 1ad0f1a325ef164bc452.css} +0 -0
- /package/dist/client/styles/{91d074c85ca207348249.css → 1c20656fa41e8f0a9186.css} +0 -0
- /package/dist/client/styles/{74ecbb4b7b820d191d79.css → 1d1abb5e5dbc59ef9ba2.css} +0 -0
- /package/dist/client/styles/{108124f3353174a3c98b.css → 2061904ca074081d88fe.css} +0 -0
- /package/dist/client/styles/{a7dbd4ea0593cac5da1e.css → 20fb77cf2d74b861b795.css} +0 -0
- /package/dist/client/styles/{715a2208f0956b83dafc.css → 22306ddea2411c963bea.css} +0 -0
- /package/dist/client/styles/{2a74d3661f1aeb64da2d.css → 223b412f296c214e60d8.css} +0 -0
- /package/dist/client/styles/{91501cfefb3e9beeffa4.css → 230561f40b218ce33aa3.css} +0 -0
- /package/dist/client/styles/{e97cb8c56d2e5ca10a9b.css → 23e7e7801052da2ee7b1.css} +0 -0
- /package/dist/client/styles/{1dab8b823a9fc7be9e7d.css → 23ea5cdb4bd00312ad71.css} +0 -0
- /package/dist/client/styles/{0b761938ad36cd67b6bf.css → 25727b129afc42175cb4.css} +0 -0
- /package/dist/client/styles/{de137222b71f4b8d7f47.css → 2597729b6576c994284e.css} +0 -0
- /package/dist/client/styles/{568f78f9b01fc9462683.css → 2832fa5d4d41a5ccbbea.css} +0 -0
- /package/dist/client/styles/{ddc4d2ea575a50bc4ae3.css → 29592daed7085fae2aff.css} +0 -0
- /package/dist/client/styles/{d307d2e9cf655c179d77.css → 29fe5285a5534638e45b.css} +0 -0
- /package/dist/client/styles/{3ea2352e8a94ddc6dc8a.css → 2b43a99e2018d0c84f18.css} +0 -0
- /package/dist/client/styles/{a98815c8466bb8a199d5.css → 2da8f9d947d895021c5d.css} +0 -0
- /package/dist/client/styles/{6b275c100f8042199de9.css → 2e1e0dd2f0bc70406517.css} +0 -0
- /package/dist/client/styles/{dc16b2fd8f77226e3fd5.css → 2eb64565ce9bce410b7f.css} +0 -0
- /package/dist/client/styles/{dfab0d5501435b36f6fb.css → 2f1b8a7fe67255cbe0ad.css} +0 -0
- /package/dist/client/styles/{2fb997a43b43bfb18687.css → 311e9063fba535832317.css} +0 -0
- /package/dist/client/styles/{1c048832077af161ca70.css → 319cce34e32e88725a45.css} +0 -0
- /package/dist/client/styles/{9017b70932ac98380220.css → 3217bd72dc64ca594af2.css} +0 -0
- /package/dist/client/styles/{69230c65912cdd38a584.css → 3339ab53ef97b3ccfa18.css} +0 -0
- /package/dist/client/styles/{a55fed95b2f031316caf.css → 33d5e23afd92ab87997e.css} +0 -0
- /package/dist/client/styles/{f166c3fa28bce031e937.css → 350b5411ffc3a7b4a42a.css} +0 -0
- /package/dist/client/styles/{e60fe8e9115fe7dd13cf.css → 36bb682d6ef3b6747725.css} +0 -0
- /package/dist/client/styles/{ada91090ef1c52557dc9.css → 373129c3f6ff64209b21.css} +0 -0
- /package/dist/client/styles/{980215f15338a4638935.css → 39ba7e46913442fd36d3.css} +0 -0
- /package/dist/client/styles/{00ccd7949f170b3d738d.css → 407c4cdbe305f30d4aae.css} +0 -0
- /package/dist/client/styles/{ee1d435693f0ce65b853.css → 40af9a8a69d05333c48b.css} +0 -0
- /package/dist/client/styles/{17bca51c0b3e12105894.css → 41085f1d73bd0fa3c10a.css} +0 -0
- /package/dist/client/styles/{e92b419e81affdea6d7d.css → 41f72194eda6300eda07.css} +0 -0
- /package/dist/client/styles/{10559d03b0ae2c434d59.css → 427f4a836835f87aa5a6.css} +0 -0
- /package/dist/client/styles/{089accd171820ed54ff9.css → 430611976761c9823b28.css} +0 -0
- /package/dist/client/styles/{e6e11ced2410e20b8d71.css → 4318bb968a52201c4f49.css} +0 -0
- /package/dist/client/styles/{eeaf7a5064376c23e2fd.css → 454827facac3a7b5372d.css} +0 -0
- /package/dist/client/styles/{8bbb03cef27adbf1052c.css → 46bac0bfa971ac9c156b.css} +0 -0
- /package/dist/client/styles/{3e2a4885ce28b249cd63.css → 494900a6843cbd395631.css} +0 -0
- /package/dist/client/styles/{71ef2d367311e6e5bc86.css → 4998595f5c0ba7e4cbef.css} +0 -0
- /package/dist/client/styles/{662de3a6d0e84564965f.css → 4b8ab89e3dadf71a555b.css} +0 -0
- /package/dist/client/styles/{2a0d066c05ce80ef84a2.css → 4be307902b6682456306.css} +0 -0
- /package/dist/client/styles/{88b02946d875717c7892.css → 4f227cf9d210a351d684.css} +0 -0
- /package/dist/client/styles/{b28351429658bbe84c2b.css → 50ac2404336c6a949f85.css} +0 -0
- /package/dist/client/styles/{378133b962494b0328be.css → 50e356fe6c0b2febc750.css} +0 -0
- /package/dist/client/styles/{e86000417aa87698de4d.css → 527b692a90fde1ab1fb1.css} +0 -0
- /package/dist/client/styles/{e600798c21b1e4b3421a.css → 52c515514b241f01e737.css} +0 -0
- /package/dist/client/styles/{6021921cffa267d6b6a7.css → 53251829ca5de2bf36fe.css} +0 -0
- /package/dist/client/styles/{d014754e0eff762e6ca9.css → 565fe0111bdfe1faa81b.css} +0 -0
- /package/dist/client/styles/{04b71860f29844231b00.css → 573b3141c4f3aaf2a77a.css} +0 -0
- /package/dist/client/styles/{1aae8117699af5bed418.css → 5840fd3aaf68742dbd91.css} +0 -0
- /package/dist/client/styles/{c07d2bb6aab9b5629d10.css → 5a9f3609f8449b952b64.css} +0 -0
- /package/dist/client/styles/{fed71972ffa79d797286.css → 5c13f431c2e46685547e.css} +0 -0
- /package/dist/client/styles/{d8502c8331a1e69286ed.css → 5c444609f44df9236b50.css} +0 -0
- /package/dist/client/styles/{e2b91f9e13b86ff8389c.css → 5ca596aa3d93347cb166.css} +0 -0
- /package/dist/client/styles/{93891a876d2976d9805f.css → 5f4eae2e17299af02f30.css} +0 -0
- /package/dist/client/styles/{a8c732ef4e6bb196c696.css → 61bab8e68387ee80ff66.css} +0 -0
- /package/dist/client/styles/{815b2ba5fab54eebb5ca.css → 64040fe43c85229d6c7e.css} +0 -0
- /package/dist/client/styles/{46b91e4ff55299b16e9b.css → 6426b3dc3b49d5317801.css} +0 -0
- /package/dist/client/styles/{a451e339bbbf4c755dd2.css → 68395bfe89565e0d1d79.css} +0 -0
- /package/dist/client/styles/{42233f90e1246c3d508e.css → 686711e0bbed23d62722.css} +0 -0
- /package/dist/client/styles/{92f88dfc1b040e6657db.css → 6995a6a5607ccfaef630.css} +0 -0
- /package/dist/client/styles/{d39f4c3cff0aeebb9f76.css → 6a72e20f9ac9a967fdb5.css} +0 -0
- /package/dist/client/styles/{6198cadc6ef977ea0b7f.css → 6b46c22ca1c92349b2f8.css} +0 -0
- /package/dist/client/styles/{867ee96ab822b2070c40.css → 6b4ed5cf4bb509c82dc7.css} +0 -0
- /package/dist/client/styles/{5bfe1a52e5e438b16b80.css → 6cf6cc6c2d13bfd50cdd.css} +0 -0
- /package/dist/client/styles/{e0ae6eb532e9deca95b9.css → 6e83cdb8cf4a81b04610.css} +0 -0
- /package/dist/client/styles/{0036243f84e83014237c.css → 6fc29b2e316a296f27b3.css} +0 -0
- /package/dist/client/styles/{a74cc1abc33d10c98576.css → 7016d8a61690a15d03f9.css} +0 -0
- /package/dist/client/styles/{a67dfcc6f9de1ceaf9d9.css → 732cde453ece9ad94e13.css} +0 -0
- /package/dist/client/styles/{f94be4a838d4a8146c32.css → 76d78ba0c2f38b447c7b.css} +0 -0
- /package/dist/client/styles/{41dea7515c49fbb37cd0.css → 7818ed43fdcd566ba3f8.css} +0 -0
- /package/dist/client/styles/{d7a62916cee4d6e2b444.css → 7880369871d8c84cd0e7.css} +0 -0
- /package/dist/client/styles/{16a3a76ec493d5af9559.css → 79eddfa24c7ea007b464.css} +0 -0
- /package/dist/client/styles/{3967efd5a872171e7230.css → 7b64c0b95bc2e1e7b8b7.css} +0 -0
- /package/dist/client/styles/{1970d55f90fe220cf58b.css → 7bb7988a7e3a48b42689.css} +0 -0
- /package/dist/client/styles/{5801faf406d084e1f422.css → 7dc60eea744dfc329db1.css} +0 -0
- /package/dist/client/styles/{ac9413fc9a5f74284fd0.css → 7fa847dd9898ad08103f.css} +0 -0
- /package/dist/client/styles/{becfc64a7cf18580f64b.css → 80006a5fec335cb12b7c.css} +0 -0
- /package/dist/client/styles/{bf0781d3e1fda7aaf432.css → 80cddc196cc2b7002fd6.css} +0 -0
- /package/dist/client/styles/{afd5b0c1ea115a131076.css → 82a07bb458544eeed2ba.css} +0 -0
- /package/dist/client/styles/{0389a15654d3a45aab1a.css → 82cff5a009d11a47c9b1.css} +0 -0
- /package/dist/client/styles/{7bd6628181af41e6fc20.css → 83e8c494ee1d031a6d1b.css} +0 -0
- /package/dist/client/styles/{392a233a558e074c70d9.css → 84222624315dca891314.css} +0 -0
- /package/dist/client/styles/{ca79fa2a1ed7e82e450a.css → 878fb5ed84c34cc290d7.css} +0 -0
- /package/dist/client/styles/{16d1b6f2e9d13a059244.css → 885aba9fe02e2e19ef08.css} +0 -0
- /package/dist/client/styles/{697dab8ed79ec60a309b.css → 8aa688dbf078ed7770b4.css} +0 -0
- /package/dist/client/styles/{01554a4fdde2d61b4d49.css → 8ec6bd177c4c85a84907.css} +0 -0
- /package/dist/client/styles/{df56e8276b6973df6c3c.css → 8fb6347aacc0d7a6e455.css} +0 -0
- /package/dist/client/styles/{91f5a130ef63276c95f1.css → 9212fa0c23e7fbc74fb7.css} +0 -0
- /package/dist/client/styles/{a2fe354aca6970fedba6.css → 93a15382ca1d82530841.css} +0 -0
- /package/dist/client/styles/{38875405be2461bf6367.css → 93bde9d3da4e67262071.css} +0 -0
- /package/dist/client/styles/{9324abfa574340eb6ede.css → 943c207eed1ff2aa3f4b.css} +0 -0
- /package/dist/client/styles/{3aaefce16b5df1479178.css → 947ee62243a4bb64cf62.css} +0 -0
- /package/dist/client/styles/{b1590b789b54502c0272.css → 96306df532ecfd1464fb.css} +0 -0
- /package/dist/client/styles/{29d2385ba08f0023585c.css → 971b2c9a163cb9a4c1d9.css} +0 -0
- /package/dist/client/styles/{affc2dc765c1741a7319.css → 9742df9b3b105d4cc277.css} +0 -0
- /package/dist/client/styles/{701b3f29f72a42f4ba5b.css → 9987d7d12d1a3b4a8eea.css} +0 -0
- /package/dist/client/styles/{a299cbe3889cd21cace8.css → 9c119bb692b22af5aa30.css} +0 -0
- /package/dist/client/styles/{6482c0db9dfb95939fd0.css → 9eebe67b2504a3c1d87c.css} +0 -0
- /package/dist/client/styles/{a49c74188fc5251d8b65.css → 9f21c1e47b8b109c3a6d.css} +0 -0
- /package/dist/client/styles/{3c5baf37fc4cdec110f6.css → 9f5ae43cbfda2ce15ad0.css} +0 -0
- /package/dist/client/styles/{a6d598ec76e67174f994.css → a06a68636bc8161710b5.css} +0 -0
- /package/dist/client/styles/{c4c6c4f82f8a5ceb9401.css → a256e0ec3a4d4952396d.css} +0 -0
- /package/dist/client/styles/{6dcc7e68252e013045d4.css → a3dde3a7c263f2c4f215.css} +0 -0
- /package/dist/client/styles/{29a09e10b4c826dc6bcd.css → a964116d7226e0252a4e.css} +0 -0
- /package/dist/client/styles/{f2cfbc8d04d591718bf9.css → ab78c19a4e39b36f31db.css} +0 -0
- /package/dist/client/styles/{60e11eae5d8e305a26b5.css → ac61187dca33e7ce424a.css} +0 -0
- /package/dist/client/styles/{38d5589b9158ab8e7423.css → aed199f6a2d99ed2c6ed.css} +0 -0
- /package/dist/client/styles/{feeecf83bdc1c651376a.css → b0fa1ba312ee329cb3e5.css} +0 -0
- /package/dist/client/styles/{b83b6b4191840a25baa5.css → b1e7410c40828f1764d3.css} +0 -0
- /package/dist/client/styles/{ab31c58b4b87e68b35fb.css → b55e02a32d90c14f4cbe.css} +0 -0
- /package/dist/client/styles/{fddbb5023e794ab0f98a.css → ba92be8988f6e7cd5e6f.css} +0 -0
- /package/dist/client/styles/{2bdd4484eaf0f7c7bc7d.css → bb6ee4365a8705780e12.css} +0 -0
- /package/dist/client/styles/{4a7dd18ce8648d5f3748.css → bc8c593bdc7f77961b3e.css} +0 -0
- /package/dist/client/styles/{db30cb86f2d695ff6d1c.css → bccd95120799e94ad85b.css} +0 -0
- /package/dist/client/styles/{ae547edbc8099702ba5a.css → beaf345e668e5858c6bd.css} +0 -0
- /package/dist/client/styles/{fe9b0e3ab93fda599cfb.css → bfecde8061dcff3d096e.css} +0 -0
- /package/dist/client/styles/{ff80131a5bed70291e0b.css → c033ed6d46bc42084b33.css} +0 -0
- /package/dist/client/styles/{6f579b91d024f526a37f.css → c1d9299a2481f61b3e9b.css} +0 -0
- /package/dist/client/styles/{e555e6f7c093044467bd.css → c2534659707a053ea8ee.css} +0 -0
- /package/dist/client/styles/{d92b71a6a05b8f554c7e.css → c267ae2b25cacae519ed.css} +0 -0
- /package/dist/client/styles/{e7b33c7b9c52aa2c42fb.css → c3527a51540c796aa210.css} +0 -0
- /package/dist/client/styles/{1262d9eb296be8be48b9.css → c4d1c2c8dbf87da6d96f.css} +0 -0
- /package/dist/client/styles/{abe7bec6335799afee09.css → c7fb4e35252146ab1ff9.css} +0 -0
- /package/dist/client/styles/{d2b70350d3fa2cef0e39.css → ca534726c8438931e48c.css} +0 -0
- /package/dist/client/styles/{f2ef165911bb1b115aad.css → cb7718d9829f07833d01.css} +0 -0
- /package/dist/client/styles/{f463c441cd83d40c3f8f.css → d004c86b9221141e7607.css} +0 -0
- /package/dist/client/styles/{15e9f022c7952c07e6ce.css → d05a0cf78979bfacdb55.css} +0 -0
- /package/dist/client/styles/{d014f1abc1fcc90b5657.css → d2b730ad00573dad86d4.css} +0 -0
- /package/dist/client/styles/{72709ccc1d539e0e7922.css → d3762db0c2c2b01eb444.css} +0 -0
- /package/dist/client/styles/{23889a0a798b09d499c1.css → d43c1005ef0b2e384fdb.css} +0 -0
- /package/dist/client/styles/{8537711ac020c8f29676.css → d45a491bd98ee16dc921.css} +0 -0
- /package/dist/client/styles/{507d772ea7c3ad69cd02.css → d4975689673752fc50fd.css} +0 -0
- /package/dist/client/styles/{84e8cb222b65ef8c7fd7.css → d7be84839eb13c10994d.css} +0 -0
- /package/dist/client/styles/{d3aa563c4024f80b82d0.css → dcdb0c57cb9174c2474b.css} +0 -0
- /package/dist/client/styles/{a7f81a333cfee151ffc8.css → e0dd06533ebb6c7bc4cc.css} +0 -0
- /package/dist/client/styles/{056cd8933beea0edc19e.css → e147a51def3ab23ae656.css} +0 -0
- /package/dist/client/styles/{6b563760413cecbb2ea9.css → e6abca5f001c11b9b614.css} +0 -0
- /package/dist/client/styles/{0eccccf491d2d8c15ec2.css → e74cb22d42037309926d.css} +0 -0
- /package/dist/client/styles/{dca2c65879ee8c6fe5e7.css → e82db7ecb8bd18986174.css} +0 -0
- /package/dist/client/styles/{66d5a4a2cf08cdaa86bb.css → ea9c40e082d00151bcb2.css} +0 -0
- /package/dist/client/styles/{a98a1c78a6e495be1fe3.css → eba32e7258bb2a7a1a2a.css} +0 -0
- /package/dist/client/styles/{914125d34a0c8421839d.css → ede70c2797449c4d51a6.css} +0 -0
- /package/dist/client/styles/{0a73fba3841d42f4062e.css → f07600be83e973fe699f.css} +0 -0
- /package/dist/client/styles/{6011db9e93655179bce2.css → f12e8d4deaddb3b26d58.css} +0 -0
- /package/dist/client/styles/{9c4c4822a484f5a5ad19.css → f25db0c188d1d6ae7dd7.css} +0 -0
- /package/dist/client/styles/{ae596ff1996c280c202c.css → f30fbd3d7d6421ff0d75.css} +0 -0
- /package/dist/client/styles/{5d1cdcc8987a6cc186f0.css → f3ee4bdf344f8724e4c7.css} +0 -0
- /package/dist/client/styles/{80482a16fe24140d2a21.css → f4a668879a22f437d35c.css} +0 -0
- /package/dist/client/styles/{3cf61618bc3263a1c0c9.css → f63eafcdb6b94fd95198.css} +0 -0
- /package/dist/client/styles/{093dbadb21acf4310ea2.css → f6cb2798677ada41ec58.css} +0 -0
- /package/dist/client/styles/{3ae3625c5b179d3021e9.css → f84229a0696a0096e336.css} +0 -0
- /package/dist/client/styles/{6231f7cde1c1a252e3ff.css → fcca4ddacffe3f8cf584.css} +0 -0
- /package/dist/client/styles/{9865e2574c6d07158054.css → ff3f98b95580dd1fde4c.css} +0 -0
- /package/dist/client/styles/{10c8c43c2d1d2c9c3ac6.css → ff4c5a9ba80c1fe53316.css} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("./LoadingSpinner-C8LAYV8q.js"),R=require("vue"),Ka=require("pinia");let Uo=null;typeof window<"u"&&(Uo=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"){Uo&&(this.options.div=Uo.getAttribute("data-div")||this.options.div,this.options.logo=Uo.getAttribute("data-logo")||this.options.logo,this.options.statement=Uo.getAttribute("data-statement")||this.options.statement,this.options.prefix=Uo.getAttribute("data-prefix")||this.options.prefix,this.options.suffix=Uo.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=Ka.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 oe(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:oe,setActiveSubcatFilters:W,setSelectedSubcat:ve,setActiveMarkerPos:me,getMapById:Le,getHoveredStop:le,getActivePlace:ge}});var ov={exports:{}};(function(m,d){(function(b,M){m.exports=M()})(Y.commonjsGlobal,function(){var b,M,O;function G(l,oe){if(!b)b=oe;else if(!M)M=oe;else{var W="var sharedChunk = {}; ("+b+")(sharedChunk); ("+M+")(sharedChunk);",ve={};b(ve),O=oe(ve),typeof window<"u"&&(O.workerUrl=window.URL.createObjectURL(new Blob([W],{type:"text/javascript"})))}}return G(["exports"],function(l){function oe(e,t){return e(t={exports:{}},t.exports),t.exports}var W=ve;function ve(e,t,r,o){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*(o-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=o,this.p2x=r,this.p2y=o}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,o,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>(o=1))return o;for(;r<o;){if(c=this.sampleCurveX(u),Math.abs(c-e)<t)return u;e>c?r=u:o=u,u=.5*(o-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),o=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=o,this},_rotateAround:function(e,t){var r=Math.cos(e),o=Math.sin(e),u=t.y+o*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-o*(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,o){var u=new W(e,t,r,o);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 o=r-t,u=((e-t)%o+o)%o+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 o=0,u=t;o<u.length;o+=1){var c=u[o];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 o={};for(var u in e)o[u]=t.call(r||this,e[u],u,e);return o}function Xr(e,t,r){var o={};for(var u in e)t.call(r||this,e[u],u,e)&&(o[u]=e[u]);return o}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 Sa(e){for(var t=0,r=0,o=e.length,u=o-1,c=void 0,h=void 0;r<o;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 Ta(e){var t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(o,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 Ia=null;function jo(e){if(Ia==null){var t=e.navigator?e.navigator.userAgent:null;Ia=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return Ia}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"),o=r.getContext("2d");if(!o)throw new Error("failed to create canvas 2d context");return r.width=e.width,r.height=e.height,o.drawImage(e,0,0,e.width,e.height),o.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){!Aa&&jn&&(Di?yt(e):qn=e)}},Aa=!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),Aa=!0}le.document&&((jn=le.document.createElement("img")).onload=function(){qn&&yt(qn),qn=null,Di=!0},jn.onerror=function(){Aa=!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,o){var u=xi(e);return _i(e)?(u.path="/styles/v1"+u.path+"/sprite"+t+r,this._makeAPIURL(u,this._customAccessToken||o)):(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 o=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&&o&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,o)},Kr.prototype.canonicalizeTileURL=function(e,t){var r=xi(e);if(!r.path.match(/(^\/v4\/)/)||!r.path.match(/\.[\w]+$/))return e;var o="mapbox://tiles/";o+=r.path.replace("/v4/","");var u=r.params;return t&&(u=u.filter(function(c){return!c.match(/^access_token=/)})),u.length&&(o+="?"+u.join("&")),o},Kr.prototype.canonicalizeTileset=function(e,t){for(var r=!!t&&_i(t),o=[],u=0,c=e.tiles||[];u<c.length;u+=1){var h=c[u];Li(h)?o.push(this.canonicalizeTileURL(h,r)):o.push(h)}return o},Kr.prototype._makeAPIURL=function(e,t){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",o=xi(Rt.API_URL);if(e.protocol=o.protocol,e.authority=o.authority,e.protocol==="http"){var u=e.params.indexOf("secure");u>=0&&e.params.splice(u,1)}if(o.path!=="/"&&(e.path=""+o.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 eo=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function xi(e){var t=e.match(eo);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 Ea(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=Ea(Rt.ACCESS_TOKEN);return t=r&&r.u?le.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,function(o,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 o=le.localStorage.getItem(t);o&&(this.eventData=JSON.parse(o));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,o){var u=this;if(Rt.EVENTS_URL){var c=xi(Rt.EVENTS_URL);c.params.push("access_token="+(o||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(o)})}},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,o,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:o,timestamp:Date.now()},c)},t.prototype.processRequests=function(r){var o=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&&(o.success[c]=!0)},r))}},t}(bi),$o=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,o){Rt.EVENTS_URL&&Rt.ACCESS_TOKEN&&Array.isArray(r)&&r.some(function(u){return _i(u)||Li(u)})&&this.queueRequest(Date.now(),o)},t.prototype.processRequests=function(r){var o=this;if(!this.pendingRequest&&this.queue.length!==0){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var u=Ea(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||(o.eventData.lastSuccess=v,o.eventData.tokenU=c)},r)}},t}(bi)),Zo=$o.postTurnstileEvent.bind($o),to=new Ri,ro=to.postMapLoadEvent.bind(to),Ca=500,Go=50;function Pa(){le.caches&&!wi&&(wi=le.caches.open("mapbox-tiles"))}function io(e){var t=e.indexOf("?");return t<0?e:e.slice(0,t)}var Gn,no=1/0;function ao(){return Gn==null&&(Gn=le.OffscreenCanvas&&new le.OffscreenCanvas(1,1).getContext("2d")&&typeof le.createImageBitmap=="function"),Gn}var Wo={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(Wo);var Ho=function(e){function t(r,o,u){o===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=o,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,an,ka=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(o,u){var c,h=new le.AbortController,v=new le.Request(o.url,{method:o.method||"GET",body:o.body,credentials:o.credentials,headers:o.headers,referrer:Wn(),signal:h.signal}),_=!1,x=!1,S=(c=v.url).indexOf("sku=")>0&&Li(c);o.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 Ho(H.statusText,H.status,o.url))}).catch(function(H){H.code!==20&&u(new Error(H.message))})}},E=function(k,U,N){(o.type==="arrayBuffer"?k.arrayBuffer():o.type==="json"?k.json():k.text()).then(function(J){x||(U&&N&&function(H,re,ae){if(Pa(),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=Ta(re.headers.get("Cache-Control")||"");ce["no-store"]||(ce["max-age"]&&se.headers.set("Expires",new Date(ae+1e3*ce["max-age"]).toUTCString()),new Date(se.headers.get("Expires")).getTime()-ae<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);Pa(),wi&&wi.then(function(Ae){return Ae.put(io(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(Pa(),!wi)return U(null);var N=io(k.url);wi.then(function(J){J.match(N).then(function(H){var re=function(ae){if(!ae)return!1;var se=new Date(ae.headers.get("Expires")||0),ce=Ta(ae.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(o,u){var c=new le.XMLHttpRequest;for(var h in c.open(o.method||"GET",o.url,!0),o.type==="arrayBuffer"&&(c.responseType="arraybuffer"),o.headers)c.setRequestHeader(h,o.headers[h]);return o.type==="json"&&(c.responseType="text",c.setRequestHeader("Accept","application/json")),c.withCredentials=o.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(o.type==="json")try{v=JSON.parse(c.response)}catch(_){return u(_)}u(null,v,c.getResponseHeader("Cache-Control"),c.getResponseHeader("Expires"))}else u(new Ho(c.statusText,c.status,o.url))},c.send(o.body),{cancel:function(){return c.abort()}}}(e,t)},oo=function(e,t){return ka(tt(e,{type:"arrayBuffer"}),t)},rr=function(e,t){return ka(tt(e,{method:"POST"}),t)},I="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";nn=[],an=0;var C=function(e,t){if(Gi.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),an>=Rt.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:e,callback:t,cancelled:!1,cancel:function(){this.cancelled=!0}};return nn.push(r),r}an++;var o=!1,u=function(){if(!o)for(o=!0,an--;nn.length&&an<Rt.MAX_PARALLEL_IMAGE_REQUESTS;){var h=nn.shift();h.cancelled||(h.cancel=C(h.requestParameters,h.callback).cancel)}},c=oo(e,function(h,v,_,x){u(),h?t(h):v&&(ao()?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 o=r[e].indexOf(t);o!==-1&&r[e].splice(o,1)}}var j=function(e,t){t===void 0&&(t={}),tt(this,t),this.type=e},Q=function(e){function t(r,o){o===void 0&&(o={}),e.call(this,"error",tt({error:r},o))}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 o=0,u=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];o<u.length;o+=1)u[o].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,o){this.message=(e?e+": ":"")+r,o&&(this.identifier=o),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 o=0,u=t;o<u.length;o+=1){var c=u[o];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,o){e.call(this,o),this.message=o,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,o=t;r<o.length;r+=1){var u=o[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,o=Ur;r<o.length;r+=1)if(!Pt(o[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=oe(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 o(v){return(v=Math.round(v))<0?0:v>255?255:v}function u(v){return o(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,ae=2*H-re;return[o(255*h(ae,re,N+1/3)),o(255*h(ae,re,N)),o(255*h(ae,re,N-1/3)),U];default:return null}}return null}}catch{}}).parseCSSColor,Et=function(e,t,r,o){o===void 0&&(o=1),this.r=e,this.g=t,this.b=r,this.a=o};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],o=e[3];return"rgba("+Math.round(e[0])+","+Math.round(t)+","+Math.round(r)+","+o+")"},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 so=function(e,t,r,o,u){this.text=e,this.image=t,this.scale=r,this.fontStack=o,this.textColor=u},Ir=function(e){this.sections=e};Ir.fromString=function(e){return new Ir([new so(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 o=r[t];if(o.image)e.push(["image",o.image.name]);else{e.push(o.text);var u={};o.fontStack&&(u["text-font"]=["literal",o.fontStack.split(",")]),o.scale&&(u["font-scale"]=o.scale),o.textColor&&(u["text-color"]=["rgba"].concat(o.textColor.toArray())),e.push(u)}}return e};var Yr=function(e){this.name=e.name,this.available=e.available};function Ys(e,t,r,o){return typeof e=="number"&&e>=0&&e<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof r=="number"&&r>=0&&r<=255?o===void 0||typeof o=="number"&&o>=0&&o<=1?null:"Invalid rgba value ["+[e,t,r,o].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+(typeof o=="number"?[e,t,r,o]:[e,t,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function lo(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(!lo(r[t]))return!1;return!0}if(typeof e=="object"){for(var o in e)if(!lo(e[o]))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,o=0,u=e;o<u.length;o+=1){var c=nr(u[o]);if(t){if(t===c)continue;t=Me;break}t=c}return At(t||Me,r)}return ut}function uo(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(!lo(e[1]))return t.error("invalid value");var r=e[1],o=nr(r),u=t.expectedType;return o.kind!=="array"||o.N!==0||!u||u.kind!=="array"||typeof u.N=="number"&&u.N!==0||(o=u),new Nr(o,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,o=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],o++}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],o++}r=At(c,h)}else r=Si[u];for(var _=[];o<e.length;o++){var x=t.parse(e[o],o,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 o=e.N;(typeof o=="number"||this.args.length>1)&&t.push(o)}}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 o=[],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=o[o.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,o.push({content:T,scale:null,font:null,textColor:null})}}return new Fi(o)},Fi.prototype.evaluate=function(e){return new Ir(this.sections.map(function(t){var r=t.content.evaluate(e);return nr(r)===pt?new so("",r,null,null,null):new so(uo(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 o=r[t];e(o.content),o.scale&&e(o.scale),o.font&&e(o.font),o.textColor&&e(o.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 o=r[t];e.push(o.content.serialize());var u={};o.scale&&(u["font-scale"]=o.scale.serialize()),o.font&&(u["text-font"]=o.font.serialize()),o.textColor&&(u["text-color"]=o.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 o=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(o,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,o=0,u=this.args;o<u.length;o+=1){if(r=null,(t=u[o].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(uo(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?Yr.fromString(uo(this.args[0].evaluate(e))):uo(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"],on=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};on.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},on.prototype.geometryType=function(){return this.feature?typeof this.feature.type=="number"?jc[this.feature.type]:this.feature.type:null},on.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},on.prototype.canonicalID=function(){return this.canonical},on.prototype.properties=function(){return this.feature&&this.feature.properties||{}},on.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,o){this.name=e,this.type=t,this._evaluate=r,this.args=o};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,o=e[0],u=zr.definitions[o];if(!u)return t.error('Unknown expression "'+o+'". 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,ae=_.parse(H,1+U.length,re);if(!ae){N=!0;break}U.push(ae)}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(o,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,o=(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(o*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,o,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]-(o=E[k])[0])*(_=r[1]-(u=E[k+1])[1])-(v=r[0]-u[0])*(h=r[1]-o[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,o){var u=o[0]-r[0],c=o[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 o=0,u=r;o<u.length;o+=1)for(var c=u[o],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 au(e,t){for(var r=0;r<e.length;++r)if(!Qs(e[r],t))return!1;for(var o=0;o<e.length-1;++o)if(Wc(e[o],e[o+1],t))return!1;return!0}function ou(e,t){for(var r=0;r<t.length;r++)if(au(e,t[r]))return!0;return!1}function Ma(e,t,r){for(var o=[],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)}o.push(c)}return o}function el(e,t,r){for(var o=[],u=0;u<e.length;u++){var c=Ma(e[u],t,r);o.push(c)}return o}function co(e,t,r,o){if(e[0]<r[0]||e[0]>r[2]){var u=.5*o,c=e[0]-r[0]>u?-o:r[0]-e[0]>u?o:0;c===0&&(c=e[0]-r[2]>u?-o:r[2]-e[0]>u?o:0),e[0]+=c}qr(t,e)}function su(e,t,r,o){for(var u=8192*Math.pow(2,o.z),c=[8192*o.x,8192*o.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]];co(E,t,r,u),h.push(E)}return h}function Xo(e,t,r,o){for(var u,c=8192*Math.pow(2,o.z),h=[8192*o.x,8192*o.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)co(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 o=t.parse(r["case-sensitive"]!==void 0&&r["case-sensitive"],1,Ee);if(!o)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(o,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(o){r&&!Xn(o,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(lo(e[1])){var r=e[1];if(r.type==="FeatureCollection")for(var o=0;o<r.features.length;++o){var u=r.features[o].geometry.type;if(u==="Polygon"||u==="MultiPolygon")return new Ii(r,r.features[o].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 o=[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=Ma(r.coordinates,u,c),v=su(t.geometry(),o,u,c);if(!Hn(o,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(),o,u,c);if(!Hn(o,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 o=[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=Ma(r.coordinates,u,c),v=Xo(t.geometry(),o,u,c);if(!Hn(o,u))return!1;for(var _=0,x=v;_<x.length;_+=1)if(!au(x[_],h))return!1}if(r.type==="MultiPolygon"){var S=el(r.coordinates,u,c),T=Xo(t.geometry(),o,u,c);if(!Hn(o,u))return!1;for(var E=0,k=T;E<k.length;E+=1)if(!ou(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,o,u){t===void 0&&(t=[]),o===void 0&&(o=new Ue),u===void 0&&(u=[]),this.registry=e,this.path=t,this.key=t.map(function(c){return"["+c+"]"}).join(""),this.scope=o,this.errors=u,this.expectedType=r};function Ko(e,t){for(var r,o=e.length-1,u=0,c=o,h=0;u<=c;)if((r=e[h=Math.floor((u+c)/2)])<=t){if(h===o||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,o,u){return u===void 0&&(u={}),t?this.concat(t,r,o)._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 o=e[0];if(typeof o!="string")return this.error("Expression name must be a string, but found "+typeof o+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var u=this.registry[o];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 on;try{c=new Nr(c.type,c.evaluate(_))}catch(x){return this.error(x.message),null}}return c}return this.error('Unknown expression "'+o+'". 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 o=typeof e=="number"?this.path.concat(e):this.path,u=r?this.scope.concat(r):this.scope;return new xn(this.registry,o,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 o=""+this.key+t.map(function(u){return"["+u+"]"}).join("");this.errors.push(new be(o,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 o=0,u=r;o<u.length;o+=1){var c=u[o],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 o=[],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(o.length&&o[o.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,o.push([h,S])}return new ni(u,r,o)},ni.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(t.length===1)return r[0].evaluate(e);var o=this.input.evaluate(e);if(o<=t[0])return r[0].evaluate(e);var u=t.length;return o>=t[u-1]?r[u-1].evaluate(e):r[Ko(t,o)].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 za=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(o,u){return pr(o,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),o=nl(e.b),u=tl((.4124564*t+.3575761*r+.1804375*o)/.95047),c=tl((.2126729*t+.7151522*r+.072175*o)/1);return{l:116*c-16,a:500*(u-c),b:200*(c-tl((.0193339*t+.119192*r+.9503041*o)/1.08883)),alpha:e.a}}function cu(e){var t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,o=isNaN(e.b)?t:t-e.b/200;return t=1*rl(t),r=.95047*rl(r),o=1.08883*rl(o),new Et(il(3.2404542*r-1.5371385*t-.4985314*o),il(-.969266*r+1.8760108*t+.041556*o),il(.0556434*r-.2040259*t+1.0572252*o),e.alpha)}function Kc(e,t,r){var o=t-e;return e+r*(o>180||o<-180?o-360*Math.round(o/360):o)}var po={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)}}},ho={forward:function(e){var t=uu(e),r=t.l,o=t.a,u=t.b,c=Math.atan2(u,o)*Xc;return{h:c<0?c+360:c,c:Math.sqrt(o*o+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:po,hcl:ho}),Br=function(e,t,r,o,u){this.type=e,this.operator=t,this.interpolation=r,this.input=o,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 al(e,t,r,o){var u=o-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,o){var u=0;if(e.name==="exponential")u=al(t,e.base,r,o);else if(e.name==="linear")u=al(t,1,r,o);else if(e.name==="cubic-bezier"){var c=e.controlPoints;u=new W(c[0],c[1],c[2],c[3]).solve(al(t,1,r,o))}return u},Br.parse=function(e,t){var r=e[0],o=e[1],u=e[2],c=e.slice(3);if(!Array.isArray(o)||o.length===0)return t.error("Expected an interpolation type expression.",1);if(o[0]==="linear")o={name:"linear"};else if(o[0]==="exponential"){var h=o[1];if(typeof h!="number")return t.error("Exponential interpolation requires a numeric base.",1,1);o={name:"exponential",base:h}}else{if(o[0]!=="cubic-bezier")return t.error("Unknown interpolation type "+String(o[0]),1,0);var v=o.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);o={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,o,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 o=this.input.evaluate(e);if(o<=t[0])return r[0].evaluate(e);var u=t.length;if(o>=t[u-1])return r[u-1].evaluate(e);var c=Ko(t,o),h=Br.interpolationFactor(this.interpolation,o,t[c],t[c+1]),v=r[c].evaluate(e),_=r[c+1].evaluate(e);return this.operator==="interpolate"?za[this.type.kind.toLowerCase()](v,_,h):this.operator==="interpolate-hcl"?ho.reverse(ho.interpolate(ho.forward(v),ho.forward(_),h)):po.reverse(po.interpolate(po.forward(v),po.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,o=t.expectedType;o&&o.kind!=="value"&&(r=o);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 _=o&&u.some(function(x){return Pt(o,x.type)});return new bn(_?Me:r,u)},bn.prototype.evaluate=function(e){for(var t,r=null,o=0,u=0,c=this.args;u<c.length&&(o++,(r=c[u].evaluate(e))&&r instanceof Yr&&!r.available&&(t||(t=r.name),r=null,o===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=[],o=1;o<e.length-1;o+=2){var u=e[o];if(typeof u!="string")return t.error("Expected string, but found "+typeof u+" instead.",o);if(/[^a-zA-Z0-9_]/.test(u))return t.error("Variable names must contain only alphanumeric characters or '_'.",o);var c=t.parse(e[o+1],o+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 o=r[t];e.push(o[0],o[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),o=t.parse(e[2],2,At(t.expectedType||Me));return r&&o?new Kn(o.type.itemType,r,o):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),o=t.parse(e[2],2,Me);return r&&o?ir(r.type,[Ee,Be,de,Oe,Me])?new Jn(r,o):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),o=t.parse(e[2],2,Me);if(!r||!o)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,o,u):null}return new Sn(r,o)},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 o=this.fromIndex.evaluate(e);return r.indexOf(t,o)}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,o,u,c){this.inputType=e,this.type=t,this.input=r,this.cases=o,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,o;t.expectedType&&t.expectedType.kind!=="value"&&(o=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,o);if(!k)return null;o=o||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,o);return N?U.type.kind!=="value"&&t.concat(1).checkSubtype(r,U.type)?null:new Yn(r,o,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=[],o={},u=0,c=Object.keys(this.cases).sort();u<c.length;u+=1){var h=c[u];(T=o[this.cases[h]])===void 0?(o[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 o=[],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;o.push([c,h]),r=r||h.type}var v=t.parse(e[e.length-1],e.length-1,r);return v?new Qn(r,o,v):null},Qn.prototype.evaluate=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var o=r[t],u=o[1];if(o[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 o=r[t],u=o[1];e(o[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,o){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=o};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,o){return o.compare(t,r)===0}function Ot(e,t,r){var o=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)+"'.");o&&(_.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(o&&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&&!o&&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),o=t.parse(e[2],2,de);if(!r||!o)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,o,u):null}return new Tn(r.type,r,o)},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 o=this.endIndex.evaluate(e);return t.slice(r,o)}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),Jo=Ot("!=",function(e,t,r){return t!==r},function(e,t,r,o){return!fu(0,t,r,o)}),du=Ot("<",function(e,t,r){return t<r},function(e,t,r,o){return o.compare(t,r)<0}),mu=Ot(">",function(e,t,r){return t>r},function(e,t,r,o){return o.compare(t,r)>0}),yu=Ot("<=",function(e,t,r){return t<=r},function(e,t,r,o){return o.compare(t,r)<=0}),vu=Ot(">=",function(e,t,r){return t>=r},function(e,t,r,o){return o.compare(t,r)>=0}),ea=function(e,t,r,o,u){this.type=Be,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=o,this.maxFractionDigits=u};ea.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 o=e[2];if(typeof o!="object"||Array.isArray(o))return t.error("NumberFormat options argument must be an object.");var u=null;if(o.locale&&!(u=t.parse(o.locale,1,Be)))return null;var c=null;if(o.currency&&!(c=t.parse(o.currency,1,Be)))return null;var h=null;if(o["min-fraction-digits"]&&!(h=t.parse(o["min-fraction-digits"],1,de)))return null;var v=null;return o["max-fraction-digits"]&&!(v=t.parse(o["max-fraction-digits"],1,de))?null:new ea(r,u,c,h,v)},ea.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))},ea.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)},ea.prototype.outputDefined=function(){return!1},ea.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 ta={"==":Jc,"!=":Jo,">":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":ea,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],o=t[1],u=t[2],c=t[3];r=r.evaluate(e),o=o.evaluate(e),u=u.evaluate(e);var h=c?c.evaluate(e):1,v=Ys(r,o,u,h);if(v)throw new Ar(v);return new Et(r/255*h,o/255*h,u/255*h,h)}function _u(e,t){return e in t}function ol(e,t){var r=t[e];return r===void 0?null:r}function ra(e){return{type:e}}function xu(e){return{result:"success",value:e}}function ia(e){return{result:"error",value:e}}function na(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 fo(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 Yo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Yc(e){return e}function Ba(e,t,r){return e!==void 0?e:t!==void 0?t:r!==void 0?r:void 0}function wu(e,t,r,o,u){return Ba(typeof r===u?o[r]:void 0,e.default,t.default)}function Qc(e,t,r){if(Ut(r)!=="number")return Ba(e.default,t.default);var o=e.stops.length;if(o===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[o-1][0])return e.stops[o-1][1];var u=Ko(e.stops.map(function(c){return c[0]}),r);return e.stops[u][1]}function Su(e,t,r){var o=e.base!==void 0?e.base:1;if(Ut(r)!=="number")return Ba(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=Ko(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,o,e.stops[c][0],e.stops[c+1][0]),v=e.stops[c][1],_=e.stops[c+1][1],x=za[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 Qo(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),Ba(r,e.default,t.default)}zr.register(ta,{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 ol(t[0].evaluate(e),e.properties())}],[[Be,ut],function(e,t){var r=t[1];return ol(t[0].evaluate(e),r.evaluate(e))}]]},"feature-state":[Me,[Be],function(e,t){return ol(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,ra(de),function(e,t){for(var r=0,o=0,u=t;o<u.length;o+=1)r+=u[o].evaluate(e);return r}],"*":[de,ra(de),function(e,t){for(var r=1,o=0,u=t;o<u.length;o+=1)r*=u[o].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,ra(de),function(e,t){return Math.min.apply(Math,t.map(function(r){return r.evaluate(e)}))}],max:[de,ra(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],o=t[1];return e.properties()[r.value]===o.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],o=t[1],u=e.properties()[r.value],c=o.value;return typeof u==typeof c&&u<c}],"filter-id-<":[Ee,[Me],function(e,t){var r=t[0],o=e.id(),u=r.value;return typeof o==typeof u&&o<u}],"filter->":[Ee,[Be,Me],function(e,t){var r=t[0],o=t[1],u=e.properties()[r.value],c=o.value;return typeof u==typeof c&&u>c}],"filter-id->":[Ee,[Me],function(e,t){var r=t[0],o=e.id(),u=r.value;return typeof o==typeof u&&o>u}],"filter-<=":[Ee,[Be,Me],function(e,t){var r=t[0],o=t[1],u=e.properties()[r.value],c=o.value;return typeof u==typeof c&&u<=c}],"filter-id-<=":[Ee,[Me],function(e,t){var r=t[0],o=e.id(),u=r.value;return typeof o==typeof u&&o<=u}],"filter->=":[Ee,[Be,Me],function(e,t){var r=t[0],o=t[1],u=e.properties()[r.value],c=o.value;return typeof u==typeof c&&u>=c}],"filter-id->=":[Ee,[Me],function(e,t){var r=t[0],o=e.id(),u=r.value;return typeof o==typeof u&&o>=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],o=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],o.value,0,o.value.length-1)}],all:{type:Ee,overloads:[[[Ee,Ee],function(e,t){var r=t[1];return t[0].evaluate(e)&&r.evaluate(e)}],[ra(Ee),function(e,t){for(var r=0,o=t;r<o.length;r+=1)if(!o[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)}],[ra(Ee),function(e,t){for(var r=0,o=t;r<o.length;r+=1)if(o[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,ra(Me),function(e,t){return t.map(function(r){return uo(r.evaluate(e))}).join("")}],"resolved-locale":[Be,[vt],function(e,t){return t[0].evaluate(e).resolvedLocale()}]});var Da=function(e,t){this.expression=e,this._warningHistory={},this._evaluator=new on,this._defaultValue=t?function(r){return r.type==="color"&&Yo(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 mo(e){return Array.isArray(e)&&e.length>0&&typeof e[0]=="string"&&e[0]in ta}function es(e,t){var r=new xn(ta,[],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),o=r.parse(e,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return o?xu(new Da(o,t)):ia(r.errors)}Da.prototype.evaluateWithoutErrorHandling=function(e,t,r,o,u,c){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=o,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=c,this.expression.evaluate(this._evaluator)},Da.prototype.evaluate=function(e,t,r,o,u,c){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=o,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 yo=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!=="constant"&&!gn(t.expression)};yo.prototype.evaluateWithoutErrorHandling=function(e,t,r,o,u,c){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,o,u,c)},yo.prototype.evaluate=function(e,t,r,o,u,c){return this._styleExpression.evaluate(e,t,r,o,u,c)};var La=function(e,t,r,o){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent=e!=="camera"&&!gn(t.expression),this.interpolationType=o};function Tu(e,t){if((e=es(e,t)).result==="error")return e;var r=e.value.expression,o=vn(r);if(!o&&!na(t))return ia([new be("","data expressions not supported")]);var u=Xn(r,["zoom"]);if(!u&&!bu(t))return ia([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?ia([c]):c instanceof Br&&!fo(t)?ia([new be("",'"interpolate" expressions cannot be used with this property')]):xu(c?new La(o?"camera":"composite",e.value,c.labels,c instanceof Br?c.interpolation:void 0):new yo(o?"constant":"source",e.value)):ia([new be("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}La.prototype.evaluateWithoutErrorHandling=function(e,t,r,o,u,c){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,o,u,c)},La.prototype.evaluate=function(e,t,r,o,u,c){return this._styleExpression.evaluate(e,t,r,o,u,c)},La.prototype.interpolationFactor=function(e,t,r){return this.interpolationType?Br.interpolationFactor(this.interpolationType,e,t,r):0};var Ra=function(e,t){this._parameters=e,this._specification=t,xe(this,function r(o,u){var c,h,v,_=u.type==="color",x=o.stops&&typeof o.stops[0][0]=="object",S=x||!(x||o.property!==void 0),T=o.type||(fo(u)?"exponential":"interval");if(_&&((o=xe({},o)).stops&&(o.stops=o.stops.map(function(ke){return[ke[0],Et.parse(ke[1])]})),o.default=Et.parse(o.default?o.default:u.default)),o.colorSpace&&o.colorSpace!=="rgb"&&!pu[o.colorSpace])throw new Error("Unknown color space: "+o.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=o.stops;E<k.length;E+=1){var U=k[E];h[U[0]]=U[1]}v=typeof o.stops[0][0]}else{if(T!=="identity")throw new Error('Unknown function type "'+T+'"');c=Qo}if(x){for(var N={},J=[],H=0;H<o.stops.length;H++){var re=o.stops[H],ae=re[0].zoom;N[ae]===void 0&&(N[ae]={zoom:ae,type:o.type,property:o.property,default:o.default,stops:[]},J.push(ae)),N[ae].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:o.base},u,ze).evaluate(ze,We)}}}if(S){var $e=T==="exponential"?{name:"exponential",base:o.base!==void 0?o.base:1}:null;return{kind:"camera",interpolationType:$e,interpolationFactor:Br.interpolationFactor.bind(void 0,$e),zoomStops:o.stops.map(function(ke){return ke[0]}),evaluate:function(ke){return c(o,u,ke.zoom,h,v)}}}return{kind:"source",evaluate:function(ke,We){var ze=We&&We.properties?We.properties[o.property]:void 0;return ze===void 0?Ba(o.default,u.default):c(o,u,ze,h,v)}}}(this._parameters,this._specification))};function Oi(e){var t=e.key,r=e.value,o=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=o[S]||o["*"],E=void 0;if(u[S])E=u[S];else if(o[S])E=gt;else if(u["*"])E=u["*"];else{if(!o["*"]){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 o)u[k]||o[k].required&&o[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,o=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:o,styleSpec:u,key:c+"["+x+"]"}));return _}function Au(e){var t=e.key,r=e.value,o=e.valueSpec,u=Ut(r);return u==="number"&&r!=r&&(u="NaN"),u!=="number"?[new Z(t,r,"number expected, "+u+" found")]:"minimum"in o&&r<o.minimum?[new Z(t,r,r+" is less than the minimum value "+o.minimum)]:"maximum"in o&&r>o.maximum?[new Z(t,r,r+" is greater than the maximum value "+o.maximum)]:[]}function Eu(e){var t,r,o,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&&!fo(e.valueSpec)&&S.push(new Z(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(_&&!na(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(o&&o>we(N[0].zoom))return[new Z(J,N[0].zoom,"stop zoom values must appear in ascending order")];we(N[0].zoom)!==o&&(o=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 mo(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 na(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 aa(e){var t=(e.expressionContext==="property"?Tu:es)(fe(e.value),e.valueSpec);if(t.result==="error")return t.value.map(function(o){return new Z(""+e.key+o.key,e.value,o.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 vo(e){var t=e.key,r=e.value,o=e.valueSpec,u=[];return Array.isArray(o.values)?o.values.indexOf(we(r))===-1&&u.push(new Z(t,r,"expected one of ["+o.values.join(", ")+"], "+JSON.stringify(r)+" found")):Object.keys(o.values).indexOf(we(r))===-1&&u.push(new Z(t,r,"expected one of ["+Object.keys(o.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 o=r[t];if(!ts(o)&&typeof o!="boolean")return!1}return!0;default:return!0}}Ra.deserialize=function(e){return new Ra(e._parameters,e._specification)},Ra.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,o,u){return t.value.evaluate(r,o,{},u)},needGeometry:function r(o){if(!Array.isArray(o))return!1;if(o[0]==="within")return!0;for(var u=1;u<o.length;u++)if(r(o[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))?aa(xe({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(r){var o=r.value,u=r.key;if(Ut(o)!=="array")return[new Z(u,o,"array expected, "+Ut(o)+" found")];var c,h=r.styleSpec,v=[];if(o.length<1)return[new Z(u,o,"filter array must have at least 1 element")];switch(v=v.concat(vo({key:u+"[0]",value:o[0],valueSpec:h.filter_operator,style:r.style,styleSpec:r.styleSpec})),we(o[0])){case"<":case"<=":case">":case">=":o.length>=2&&we(o[1])==="$type"&&v.push(new Z(u,o,'"$type" cannot be use with operator "'+o[0]+'"'));case"==":case"!=":o.length!==3&&v.push(new Z(u,o,'filter array for operator "'+o[0]+'" must have 3 elements'));case"in":case"!in":o.length>=2&&(c=Ut(o[1]))!=="string"&&v.push(new Z(u+"[1]",o[1],"string expected, "+c+" found"));for(var _=2;_<o.length;_++)c=Ut(o[_]),we(o[1])==="$type"?v=v.concat(vo({key:u+"["+_+"]",value:o[_],valueSpec:h.geometry_type,style:r.style,styleSpec:r.styleSpec})):c!=="string"&&c!=="number"&&c!=="boolean"&&v.push(new Z(u+"["+_+"]",o[_],"string, number, or boolean expected, "+c+" found"));break;case"any":case"all":case"none":for(var x=1;x<o.length;x++)v=v.concat(t({key:u+"["+x+"]",value:o[x],style:r.style,styleSpec:r.styleSpec}));break;case"has":case"!has":c=Ut(o[1]),o.length!==2?v.push(new Z(u,o,'filter array for "'+o[0]+'" operator must have 2 elements')):c!=="string"&&v.push(new Z(u+"[1]",o[1],"string expected, "+c+" found"));break;case"within":c=Ut(o[1]),o.length!==2?v.push(new Z(u,o,'filter array for "'+o[0]+'" operator must have 2 elements')):c!=="object"&&v.push(new Z(u+"[1]",o[1],"object expected, "+c+" found"))}return v}(e)}function cl(e,t){var r=e.key,o=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:o,styleSpec:u});var x,S=e.valueSpec||v[h];if(!S)return[new Z(r,c,'unknown property "'+h+'"')];if(Ut(c)==="string"&&na(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"&&o&&!o.glyphs&&T.push(new Z(r,c,'use of "text-field" requires a style "glyphs" property')),h==="text-font"&&Yo(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:o,styleSpec:u,expressionContext:"property",propertyType:t,propertyKey:h}))}function pl(e){return cl(e,"paint")}function go(e){return cl(e,"layout")}function ku(e){var t=[],r=e.value,o=e.key,u=e.style,c=e.styleSpec;r.type||r.ref||t.push(new Z(o,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(o,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(o,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(o,r.ref,"ref cannot reference another ref layer")):v=we(h.type):t.push(new Z(o,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(o,r.source,'layer "'+r.id+'" requires a raster source')):k==="raster"&&v!=="raster"?t.push(new Z(o,r.source,'layer "'+r.id+'" requires a vector source')):k!=="vector"||r["source-layer"]?k==="raster-dem"&&v!=="hillshade"?t.push(new Z(o,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(o,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):t.push(new Z(o,r,'layer "'+r.id+'" must specify a "source-layer"')):t.push(new Z(o,r.source,'source "'+r.source+'" not found'))}else t.push(new Z(o,r,'missing required property "source"'));return t=t.concat(Oi({key:o,value:r,valueSpec:c.layer,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return gt({key:o+".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 go(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 oa(e){var t=e.value,r=e.key,o=Ut(t);return o!=="string"?[new Z(r,t,"string expected, "+o+" found")]:[]}var Zt={promoteId:function(e){var t=e.key,r=e.value;if(Ut(r)==="string")return oa({key:t,value:r});var o=[];for(var u in r)o.push.apply(o,oa({key:t+"."+u,value:r[u]}));return o}};function as(e){var t=e.value,r=e.key,o=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:o["source_"+h.replace("-","_")],style:e.style,styleSpec:o,objectElementValidators:Zt});case"geojson":if(c=Oi({key:r,value:t,valueSpec:o.source_geojson,style:u,styleSpec:o,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,aa({key:r+"."+v+".map",value:_[1],expressionContext:"cluster-map"})),c.push.apply(c,aa({key:r+"."+v+".reduce",value:S,expressionContext:"cluster-reduce"}))}return c;case"video":return Oi({key:r,value:t,valueSpec:o.source_video,style:u,styleSpec:o});case"image":return Oi({key:r,value:t,valueSpec:o.source_image,style:u,styleSpec:o});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 vo({key:r+".type",value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function sa(e){var t=e.value,r=e.styleSpec,o=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(_&&o[_[1]]&&o[_[1]].transition?gt({key:v,value:t[v],valueSpec:r.transition,style:u,styleSpec:r}):o[v]?gt({key:v,value:t[v],valueSpec:o[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,o=Ut(t);return o!=="boolean"?[new Z(r,t,"boolean expected, "+o+" found")]:[]},number:Au,color:function(e){var t=e.key,r=e.value,o=Ut(r);return o!=="string"?[new Z(t,r,"color expected, "+o+" found")]:mt(r)===null?[new Z(t,r,'color expected, "'+r+'" found')]:[]},constants:ne,enum:vo,filter:ul,function:Eu,layer:ku,object:Oi,source:as,light:sa,string:oa,formatted:function(e){return oa(e).length===0?[]:aa(e)},resolvedImage:function(e){return oa(e).length===0?[]:aa(e)}};function gt(e){var t=e.value,r=e.valueSpec,o=e.styleSpec;return r.expression&&Yo(we(t))?Eu(e):r.expression&&mo(fe(t))?aa(e):r.type&&An[r.type]?An[r.type](e):Oi(xe({},e,{valueSpec:r.type?o[r.type]:r}))}function Nt(e){var t=e.value,r=e.key,o=oa(e);return o.length||(t.indexOf("{fontstack}")===-1&&o.push(new Z(r,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&o.push(new Z(r,t,'"glyphs" url must include a "{range}" token'))),o}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}))),_o(r)}function _o(e){return[].concat(e).sort(function(t,r){return t.line-r.line})}function Fa(e){return function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return _o(e.apply(this,t))}}fi.source=Fa(as),fi.light=Fa(sa),fi.layer=Fa(ku),fi.filter=Fa(ul),fi.paintProperty=Fa(pl),fi.layoutProperty=Fa(go);var xo=fi,tp=xo.light,rp=xo.paintProperty,bo=xo.layoutProperty;function wo(e,t){var r=!1;if(t&&t.length)for(var o=0,u=t;o<u.length;o+=1)e.fire(new Q(new Error(u[o].message))),r=!0;return r}var sn=dr;function dr(e,t,r){var o=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];o.push(h===v?null:u.subarray(h,v))}var _=u[3+o.length+1];this.keys=u.subarray(u[3+o.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++)o.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,o,u){this._forEachCell(t,r,o,u,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(o),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,o,u,c){this.cells[u].push(c)},dr.prototype.query=function(e,t,r,o,u){var c=this.min,h=this.max;if(e<=c&&t<=c&&h<=r&&h<=o&&!u)return Array.prototype.slice.call(this.keys);var v=[];return this._forEachCell(e,t,r,o,this._queryCell,v,{},u),v},dr.prototype._queryCell=function(e,t,r,o,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]&&o>=S[k+1])?(h[E]=!0,c.push(x[E])):h[E]=!1}}},dr.prototype._forEachCell=function(e,t,r,o,u,c,h,v){for(var _=this._convertToCellCoord(e),x=this._convertToCellCoord(t),S=this._convertToCellCoord(r),T=this._convertToCellCoord(o),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,o,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,o=0;o<this.cells.length;o++)r+=this.cells[o].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 So=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 ai 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",Ra),Ve("StyleExpression",Da,{omit:["_evaluator"]}),Ve("ZoomDependentExpression",La),Ve("ZoomConstantExpression",yo),Ve("CompoundExpression",zr,{omit:["_evaluate"]}),ta)ta[ai]._classRegistryKey||Ve("Expression_"+ai,ta[ai]);function os(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor&&e.constructor.name==="ArrayBuffer")}function Oa(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(os(e)||Oa(e))return t&&t.push(e),e;if(ArrayBuffer.isView(e)){var r=e;return t&&t.push(r.buffer),r}if(e instanceof So)return t&&t.push(e.data.buffer),e;if(Array.isArray(e)){for(var o=[],u=0,c=e;u<c.length;u+=1)o.push(Vi(c[u],t));return o}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 oi(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||os(e)||Oa(e)||ArrayBuffer.isView(e)||e instanceof So)return e;if(Array.isArray(e))return e.map(oi);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 o=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];o[h]=hr[t].shallow.indexOf(h)>=0?v:oi(v)}}return o}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 To(){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",To(),ln&&oo({url:ln},function(e){e?zu(e):(li="loaded",To())})},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 o=0,u=t;o<u.length;o+=1)if(!si(u[o].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,o){if(Yo(r))return new Ra(r,o);if(mo(r)){var u=Tu(r,o);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"&&o.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 la(this.property,this.value,t,tt({},e.transition,this.transition),e.now)},Ei.prototype.untransitioned=function(){return new la(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 o=r[t],u=this.getValue(o);u!==void 0&&(e[o]=u);var c=this.getTransition(o);c!==void 0&&(e[o+"-transition"]=c)}return e},Dr.prototype.transitioned=function(e,t){for(var r=new En(this._properties),o=0,u=Object.keys(this._values);o<u.length;o+=1){var c=u[o];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 o=r[t];e._values[o]=this._values[o].untransitioned()}return e};var la=function(e,t,r,o,u){this.property=e,this.value=t,this.begin=u+o.delay||0,this.end=this.begin+o.duration||0,e.specification.transition&&(o.delay||o.duration)&&(this.prior=r)};la.prototype.possiblyEvaluate=function(e,t,r){var o=e.now||0,u=this.value.possiblyEvaluate(e,t,r),c=this.prior;if(c){if(o>this.end)return this.prior=null,u;if(this.value.isDataDriven())return this.prior=null,u;if(o<this.begin)return c.possiblyEvaluate(e,t,r);var h=(o-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 o=new Io(this._properties),u=0,c=Object.keys(this._values);u<c.length;u+=1){var h=c[u];o._values[h]=this._values[h].possiblyEvaluate(e,t,r)}return o},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 o=r[t],u=this.getValue(o);u!==void 0&&(e[o]=u)}return e},Ni.prototype.possiblyEvaluate=function(e,t,r){for(var o=new Io(this._properties),u=0,c=Object.keys(this._values);u<c.length;u+=1){var h=c[u];o._values[h]=this._values[h].possiblyEvaluate(e,t,r)}return o};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,o){return this.property.evaluate(this.value,this.parameters,e,t,r,o)};var Io=function(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)};Io.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 o=za[this.specification.type];return o?o(e,t,r):e};var Ne=function(e,t){this.specification=e,this.overrides=t};Ne.prototype.possiblyEvaluate=function(e,t,r,o){return new jr(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(t,null,{},r,o)}: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 o=za[this.specification.type];return o?new jr(this,{kind:"constant",value:o(e.value.value,t.value.value,r)},e.parameters):e},Ne.prototype.evaluate=function(e,t,r,o,u,c){return e.kind==="constant"?e.value:e.evaluate(t,r,o,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,o,u,c){if(r.value===void 0)return new jr(this,{kind:"constant",value:void 0},o);if(r.expression.kind==="constant"){var h=r.expression.evaluate(o,null,{},u,c),v=r.property.specification.type==="resolvedImage"&&typeof h!="string"?h.name:h,_=this._calculate(v,v,v,o);return new jr(this,{kind:"constant",value:_},o)}if(r.expression.kind==="camera"){var x=this._calculate(r.expression.evaluate({zoom:o.zoom-1}),r.expression.evaluate({zoom:o.zoom}),r.expression.evaluate({zoom:o.zoom+1}),o);return new jr(this,{kind:"constant",value:x},o)}return new jr(this,r.expression,o)},t.prototype.evaluate=function(r,o,u,c,h,v){if(r.kind==="source"){var _=r.evaluate(o,u,c,h,v);return this._calculate(_,_,_,o)}return r.kind==="composite"?this._calculate(r.evaluate({zoom:Math.floor(o.zoom)-1},u,c),r.evaluate({zoom:Math.floor(o.zoom)},u,c),r.evaluate({zoom:Math.floor(o.zoom)+1},u,c),o):r.value},t.prototype._calculate=function(r,o,u,c){return c.zoom>c.zoomHistory.lastIntegerZoom?{from:r,to:o}:{from:u,to:o}},t.prototype.interpolate=function(r){return r},t}(Ne),$r=function(e){this.specification=e};$r.prototype.possiblyEvaluate=function(e,t,r,o){if(e.value!==void 0){if(e.expression.kind==="constant"){var u=e.expression.evaluate(t,null,{},r,o);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,o){return o.zoom>o.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,o){return!!e.expression.evaluate(t,null,{},r,o)},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 o=this.defaultPropertyValues[t]=new Hi(r,void 0),u=this.defaultTransitionablePropertyValues[t]=new Ei(r);this.defaultTransitioningPropertyValues[t]=u.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=o.possiblyEvaluate({})}};Ve("DataDrivenProperty",Ne),Ve("DataConstantProperty",Ze),Ve("CrossFadedDataDrivenProperty",cs),Ve("CrossFadedProperty",$r),Ve("ColorRampProperty",qi);var Xi=function(e){function t(r,o){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),o.layout&&(this._unevaluatedLayout=new Ni(o.layout)),o.paint)){for(var u in this._transitionablePaint=new Dr(o.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 Io(o.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,o,u){u===void 0&&(u={}),o!=null&&this._validate(bo,"layers."+this.id+".layout."+r,r,o,u)||(r!=="visibility"?this._unevaluatedLayout.setValue(r,o):this.visibility=o)},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,o,u){if(u===void 0&&(u={}),o!=null&&this._validate(rp,"layers."+this.id+".paint."+r,r,o,u))return!1;if(Sr(r,"-transition"))return this._transitionablePaint.setTransition(r.slice(0,-11),o||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,o),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,o,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,o){r.getCrossfadeParameters&&(this._crossfadeParameters=r.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(r,void 0,o)),this.paint=this._transitioningPaint.possiblyEvaluate(r,void 0,o)},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(o,u){return!(o===void 0||u==="layout"&&!Object.keys(o).length||u==="paint"&&!Object.keys(o).length)})},t.prototype._validate=function(r,o,u,c,h){return h===void 0&&(h={}),(!h||h.validate!==!1)&&wo(this,r.call(xo,{key:o,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 o=this.paint.get(r);if(o instanceof jr&&na(o.property.specification)&&(o.value.kind==="source"||o.value.kind==="composite")&&o.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,o=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 o=Math.max(o,c),r+=c*v,{name:u.name,type:u.type,components:v,offset:h}}),size:Bu(r,Math.max(o,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 ua=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,o){var u=this.length;return this.resize(u+1),this.emplace(u,r,o)},t.prototype.emplace=function(r,o,u){var c=2*r;return this.int16[c+0]=o,this.int16[c+1]=u,r},t}(kt);ua.prototype.bytesPerElement=4,Ve("StructArrayLayout2i4",ua);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,o,u,c){var h=this.length;return this.resize(h+1),this.emplace(h,r,o,u,c)},t.prototype.emplace=function(r,o,u,c,h){var v=4*r;return this.int16[v+0]=o,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,o,u,c,h,v){var _=this.length;return this.resize(_+1),this.emplace(_,r,o,u,c,h,v)},t.prototype.emplace=function(r,o,u,c,h,v,_){var x=6*r;return this.int16[x+0]=o,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,o,u,c,h,v){var _=this.length;return this.resize(_+1),this.emplace(_,r,o,u,c,h,v)},t.prototype.emplace=function(r,o,u,c,h,v,_){var x=4*r,S=8*r;return this.int16[x+0]=o,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 Va=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,o){var u=this.length;return this.resize(u+1),this.emplace(u,r,o)},t.prototype.emplace=function(r,o,u){var c=2*r;return this.float32[c+0]=o,this.float32[c+1]=u,r},t}(kt);Va.prototype.bytesPerElement=8,Ve("StructArrayLayout2f8",Va);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,o,u,c,h,v,_,x,S,T){var E=this.length;return this.resize(E+1),this.emplace(E,r,o,u,c,h,v,_,x,S,T)},t.prototype.emplace=function(r,o,u,c,h,v,_,x,S,T,E){var k=10*r;return this.uint16[k+0]=o,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,o,u,c,h,v,_,x,S,T,E,k){var U=this.length;return this.resize(U+1),this.emplace(U,r,o,u,c,h,v,_,x,S,T,E,k)},t.prototype.emplace=function(r,o,u,c,h,v,_,x,S,T,E,k,U){var N=12*r;return this.int16[N+0]=o,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 Ua=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,o,u){var c=this.length;return this.resize(c+1),this.emplace(c,r,o,u)},t.prototype.emplace=function(r,o,u,c){var h=3*r;return this.float32[h+0]=o,this.float32[h+1]=u,this.float32[h+2]=c,r},t}(kt);Ua.prototype.bytesPerElement=12,Ve("StructArrayLayout3f12",Ua);var Ao=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 o=this.length;return this.resize(o+1),this.emplace(o,r)},t.prototype.emplace=function(r,o){return this.uint32[1*r+0]=o,r},t}(kt);Ao.prototype.bytesPerElement=4,Ve("StructArrayLayout1ul4",Ao);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,o,u,c,h,v,_,x,S){var T=this.length;return this.resize(T+1),this.emplace(T,r,o,u,c,h,v,_,x,S)},t.prototype.emplace=function(r,o,u,c,h,v,_,x,S,T){var E=10*r,k=5*r;return this.int16[E+0]=o,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 Na=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,o,u,c,h,v){var _=this.length;return this.resize(_+1),this.emplace(_,r,o,u,c,h,v)},t.prototype.emplace=function(r,o,u,c,h,v,_){var x=6*r;return this.int16[x+0]=o,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);Na.prototype.bytesPerElement=12,Ve("StructArrayLayout2i2i2i12",Na);var ca=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,o,u,c,h){var v=this.length;return this.resize(v+1),this.emplace(v,r,o,u,c,h)},t.prototype.emplace=function(r,o,u,c,h,v){var _=4*r,x=8*r;return this.float32[_+0]=o,this.float32[_+1]=u,this.float32[_+2]=c,this.int16[x+6]=h,this.int16[x+7]=v,r},t}(kt);ca.prototype.bytesPerElement=16,Ve("StructArrayLayout2f1f2i16",ca);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,o,u,c){var h=this.length;return this.resize(h+1),this.emplace(h,r,o,u,c)},t.prototype.emplace=function(r,o,u,c,h){var v=12*r,_=3*r;return this.uint8[v+0]=o,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,o,u){var c=this.length;return this.resize(c+1),this.emplace(c,r,o,u)},t.prototype.emplace=function(r,o,u,c){var h=3*r;return this.uint16[h+0]=o,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,o,u,c,h,v,_,x,S,T,E,k,U,N,J,H,re){var ae=this.length;return this.resize(ae+1),this.emplace(ae,r,o,u,c,h,v,_,x,S,T,E,k,U,N,J,H,re)},t.prototype.emplace=function(r,o,u,c,h,v,_,x,S,T,E,k,U,N,J,H,re,ae){var se=24*r,ce=12*r,ye=48*r;return this.int16[se+0]=o,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]=ae,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,o,u,c,h,v,_,x,S,T,E,k,U,N,J,H,re,ae,se,ce,ye,Se,Ae,$e,ke,We,ze,lt){var Qe=this.length;return this.resize(Qe+1),this.emplace(Qe,r,o,u,c,h,v,_,x,S,T,E,k,U,N,J,H,re,ae,se,ce,ye,Se,Ae,$e,ke,We,ze,lt)},t.prototype.emplace=function(r,o,u,c,h,v,_,x,S,T,E,k,U,N,J,H,re,ae,se,ce,ye,Se,Ae,$e,ke,We,ze,lt,Qe){var qe=34*r,ct=17*r;return this.int16[qe+0]=o,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]=ae,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 o=this.length;return this.resize(o+1),this.emplace(o,r)},t.prototype.emplace=function(r,o){return this.float32[1*r+0]=o,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,o,u){var c=this.length;return this.resize(c+1),this.emplace(c,r,o,u)},t.prototype.emplace=function(r,o,u,c){var h=3*r;return this.int16[h+0]=o,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,o,u){var c=this.length;return this.resize(c+1),this.emplace(c,r,o,u)},t.prototype.emplace=function(r,o,u,c){var h=4*r;return this.uint32[2*r+0]=o,this.uint16[h+2]=u,this.uint16[h+3]=c,r},t}(kt);bl.prototype.bytesPerElement=8,Ve("StructArrayLayout1ul2ui8",bl);var Eo=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,o){var u=this.length;return this.resize(u+1),this.emplace(u,r,o)},t.prototype.emplace=function(r,o,u){var c=2*r;return this.uint16[c+0]=o,this.uint16[c+1]=u,r},t}(kt);Eo.prototype.bytesPerElement=4,Ve("StructArrayLayout2ui4",Eo);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 o=this.length;return this.resize(o+1),this.emplace(o,r)},t.prototype.emplace=function(r,o){return this.uint16[1*r+0]=o,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,o,u,c){var h=this.length;return this.resize(h+1),this.emplace(h,r,o,u,c)},t.prototype.emplace=function(r,o,u,c,h){var v=4*r;return this.float32[v+0]=o,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 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 i(this,r)},t}(_l);Ve("CollisionBoxArray",a);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(o){this._structArray.uint8[this._pos1+37]=o},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(o){this._structArray.uint8[this._pos1+38]=o},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(o){this._structArray.uint32[this._pos4+10]=o},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(o){this._structArray.uint32[this._pos4+12]=o},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,o){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!==o)&&(u={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},o!==void 0&&(u.sortKey=o),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 o in r.vaos)r.vaos[o].destroy()}},D.simpleSegment=function(e,t,r,o){return new D([{vertexOffset:e,primitiveOffset:t,vertexLength:r,primitiveLength:o,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=oe(function(e){e.exports=function(t,r){var o,u,c,h,v,_,x,S;for(u=t.length-(o=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,o){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=oe(function(e){e.exports=function(t,r){for(var o,u=t.length,c=r^u,h=0;u>=4;)o=1540483477*(65535&(o=255&t.charCodeAt(h)|(255&t.charCodeAt(++h))<<8|(255&t.charCodeAt(++h))<<16|(255&t.charCodeAt(++h))<<24))+((1540483477*(o>>>16)&65535)<<16),c=1540483477*(65535&c)+((1540483477*(c>>>16)&65535)<<16)^(o=1540483477*(65535&(o^=o>>>24))+((1540483477*(o>>>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,o){this.ids.push(pe(e)),this.positions.push(t,r,o)},ee.prototype.getPositions=function(e){for(var t=pe(e),r=0,o=this.ids.length-1;r<o;){var u=r+o>>1;this.ids[u]>=t?o=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),o=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,o,0,r.length-1),t&&t.push(r.buffer,o.buffer),{ids:r,positions:o}},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 o=e[t];e[t]=e[r],e[r]=o}Ve("FeaturePositionMap",ee);var he=function(e,t){this.gl=e.gl,this.location=t},_e=function(e){function t(r,o){e.call(this,r,o),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,o){e.call(this,r,o),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,o){e.call(this,r,o),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,o){e.call(this,r,o),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,o){e.call(this,r,o),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,o){e.call(this,r,o),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,o){e.call(this,r,o),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 o=1;o<16;o++)if(r[o]!==this.current[o]){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(o){return"u_"+o}),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,o){var u=o==="u_pattern_to"?this.patternTo:o==="u_pattern_from"?this.patternFrom:o==="u_pixel_ratio_to"?this.pixelRatioTo:o==="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,o){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 o};it.prototype.populatePaintArray=function(e,t,r,o,u){var c=this.paintVertexArray.length,h=this.expression.evaluate(new ht(0),t,{},o,[],u);this.paintVertexArray.resize(e),this._setPaintValue(c,e,h)},it.prototype.updatePaintArray=function(e,t,r,o){var u=this.expression.evaluate({zoom:0},r,o);this._setPaintValue(e,t,u)},it.prototype._setPaintValue=function(e,t,r){if(this.type==="color")for(var o=Fe(r),u=e;u<t;u++)this.paintVertexArray.emplace(u,o[0],o[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,o,u,c){this.expression=e,this.uniformNames=t.map(function(h){return"u_"+h+"_t"}),this.type=r,this.useIntegerZoom=o,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,o,u){var c=this.expression.evaluate(new ht(this.zoom),t,{},o,[],u),h=this.expression.evaluate(new ht(this.zoom+1),t,{},o,[],u),v=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(v,e,c,h)},rt.prototype.updatePaintArray=function(e,t,r,o){var u=this.expression.evaluate({zoom:this.zoom},r,o),c=this.expression.evaluate({zoom:this.zoom+1},r,o);this._setPaintValue(e,t,u,c)},rt.prototype._setPaintValue=function(e,t,r,o){if(this.type==="color")for(var u=Fe(r),c=Fe(o),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,o);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(o))}},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,o=je(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);e.set(o)},rt.prototype.getBinding=function(e,t,r){return new Ie(e,t)};var ot=function(e,t,r,o,u,c){this.expression=e,this.type=t,this.useIntegerZoom=r,this.zoom=o,this.layerId=c,this.zoomInPaintVertexArray=new u,this.zoomOutPaintVertexArray=new u};ot.prototype.populatePaintArray=function(e,t,r){var o=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(o,e,t.patterns&&t.patterns[this.layerId],r)},ot.prototype.updatePaintArray=function(e,t,r,o,u){this._setPaintValues(e,t,r.patterns&&r.patterns[this.layerId],u)},ot.prototype._setPaintValues=function(e,t,r,o){if(o&&r){var u=o[r.min],c=o[r.mid],h=o[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)}},ot.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))},ot.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var et=function(e,t,r){this.binders={},this._buffers=[];var o=[];for(var u in e.paint._values)if(r(u)){var c=e.paint.get(u);if(c instanceof jr&&na(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,_),o.push("/u_"+u);else if(v.kind==="source"||T){var E=Qt(u,_,"source");this.binders[u]=T?new ot(v,_,x,t,E,e.id):new it(v,h,_,E),o.push("/a_"+u)}else{var k=Qt(u,_,"composite");this.binders[u]=new rt(v,h,_,x,t,k),o.push("/z_"+u)}}}this.cacheKey=o.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,o,u){for(var c in this.binders){var h=this.binders[c];(h instanceof it||h instanceof rt||h instanceof ot)&&h.populatePaintArray(e,t,r,o,u)}},et.prototype.setConstantPatternPositions=function(e,t){for(var r in this.binders){var o=this.binders[r];o instanceof st&&o.setConstantPatternPositions(e,t)}},et.prototype.updatePaintArrays=function(e,t,r,o,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 ot)&&E.expression.isStateDependent===!0){var k=o.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(o){return"#define HAS_UNIFORM_"+o}))}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 o=0;o<r.paintVertexAttributes.length;o++)e.push(r.paintVertexAttributes[o].name);else if(r instanceof ot)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 o=0,u=r.uniformNames;o<u.length;o+=1)e.push(u[o])}return e},et.prototype.getPaintVertexBuffers=function(){return this._buffers},et.prototype.getUniforms=function(e,t){var r=[];for(var o in this.binders){var u=this.binders[o];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:o,binding:_})}}}return r},et.prototype.setUniforms=function(e,t,r,o){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,o,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 ot){var o=e.fromScale===2?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;o&&this._buffers.push(o)}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 ot)&&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 ot)&&t.destroy()}};var Je=function(e,t,r){r===void 0&&(r=function(){return!0}),this.programConfigurations={};for(var o=0,u=e;o<u.length;o+=1){var c=u[o];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 o={color:{source:Va,composite:ds},number:{source:kn,composite:Va}},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]||o[t][r]}Je.prototype.populatePaintArrays=function(e,t,r,o,u,c){for(var h in this.programConfigurations)this.programConfigurations[h].populatePaintArrays(e,t,o,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,o){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,o)||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",ot),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(),o=0;o<r.length;o++)for(var u=r[o],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 ar(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?Jt(e):[]}}function ci(e,t,r,o,u){e.emplaceBack(2*t+(o+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 ua,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 o=0;o<t.length;o++)if(Ji(e,t[o]))return!0;return!!Co(e,t)}function Qr(e,t,r){return!!Ji(e,t)||!!zn(t,e,r)}function ji(e,t){if(e.length===1)return Po(t,e[0]);for(var r=0;r<t.length;r++)for(var o=t[r],u=0;u<o.length;u++)if(Ji(e,o[u]))return!0;for(var c=0;c<e.length;c++)if(Po(t,e[c]))return!0;for(var h=0;h<t.length;h++)if(Co(e,t[h]))return!0;return!1}function Pi(e,t,r){if(e.length>1){if(Co(e,t))return!0;for(var o=0;o<t.length;o++)if(zn(t[o],e,r))return!0}for(var u=0;u<e.length;u++)if(zn(e[u],t,r))return!0;return!1}function Co(e,t){if(e.length===0||t.length===0)return!1;for(var r=0;r<e.length-1;r++)for(var o=e[r],u=e[r+1],c=0;c<t.length-1;c++)if(qa(o,u,t[c],t[c+1]))return!0;return!1}function qa(e,t,r,o){return Tr(e,r,o)!==Tr(t,r,o)&&Tr(e,t,r)!==Tr(e,t,o)}function zn(e,t,r){var o=r*r;if(t.length===1)return e.distSqr(t[0])<o;for(var u=1;u<t.length;u++)if(ja(e,t[u-1],t[u])<o)return!0;return!1}function ja(e,t,r){var o=t.distSqr(r);if(o===0)return e.distSqr(t);var u=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/o;return e.distSqr(u<0?t:u>1?r:r.sub(t)._mult(u)._add(t))}function Po(e,t){for(var r,o,u,c=!1,h=0;h<e.length;h++)for(var v=0,_=(r=e[h]).length-1;v<r.length;_=v++)(o=r[v]).y>t.y!=(u=r[_]).y>t.y&&t.x<(u.x-o.x)*(t.y-o.y)/(u.y-o.y)+o.x&&(c=!c);return c}function Ji(e,t){for(var r=!1,o=0,u=e.length-1;o<e.length;u=o++){var c=e[o],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 ko(e,t,r){var o=r[0],u=r[2];if(e.x<o.x&&t.x<o.x||e.x>u.x&&t.x>u.x||e.y<o.y&&t.y<o.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 o=t.paint.get(e).value;return o.kind==="constant"?o.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,o,u){if(!t[0]&&!t[1])return e;var c=me.convert(t)._mult(u);r==="viewport"&&c._rotate(-o);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 o=this.layers[0],u=[],c=null;o.type==="circle"&&(c=o.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=ar(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 ae=re[H],se=ae.geometry,ce=ae.index,ye=ae.sourceLayerIndex,Se=e[ce].feature;this.addFeature(ae,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,o){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,{},o)},Ve("CircleBucket",Zr,{omit:["layers"]});var Bn=new Lr({"circle-sort-key":new Ne(B.layout_circle["circle-sort-key"])}),pa={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 o=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],ae=r[0],se=r[1],ce=r[2],ye=r[3];return e[0]=ae*o+se*v+ce*T+ye*N,e[1]=ae*u+se*_+ce*E+ye*J,e[2]=ae*c+se*x+ce*k+ye*H,e[3]=ae*h+se*S+ce*U+ye*re,e[4]=(ae=r[4])*o+(se=r[5])*v+(ce=r[6])*T+(ye=r[7])*N,e[5]=ae*u+se*_+ce*E+ye*J,e[6]=ae*c+se*x+ce*k+ye*H,e[7]=ae*h+se*S+ce*U+ye*re,e[8]=(ae=r[8])*o+(se=r[9])*v+(ce=r[10])*T+(ye=r[11])*N,e[9]=ae*u+se*_+ce*E+ye*J,e[10]=ae*c+se*x+ce*k+ye*H,e[11]=ae*h+se*S+ce*U+ye*re,e[12]=(ae=r[12])*o+(se=r[13])*v+(ce=r[14])*T+(ye=r[15])*N,e[13]=ae*u+se*_+ce*E+ye*J,e[14]=ae*c+se*x+ce*k+ye*H,e[15]=ae*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 ha,ip=ei;function ms(e,t,r){var o=t[0],u=t[1],c=t[2],h=t[3];return e[0]=r[0]*o+r[4]*u+r[8]*c+r[12]*h,e[1]=r[1]*o+r[5]*u+r[9]*c+r[13]*h,e[2]=r[2]*o+r[6]*u+r[10]*c+r[14]*h,e[3]=r[3]*o+r[7]*u+r[11]*c+r[15]*h,e}ha=new Ct(3),Ct!=Float32Array&&(ha[0]=0,ha[1]=0,ha[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,pa)}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 o=r;return Yi("circle-radius",this,o)+Yi("circle-stroke-width",this,o)+xr(this.paint.get("circle-translate"))},t.prototype.queryIntersectsFeature=function(r,o,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(o,u)+this.paint.get("circle-stroke-width").evaluate(o,u),E=this.paint.get("circle-pitch-alignment")==="map",k=E?S:function(Se,Ae){return Se.map(function($e){return Mo($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 ae=re[H],se=E?ae:Mo(ae,x),ce=U,ye=ms([],[ae.x,ae.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 Mo(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 $a(e,t,r,o){var u=t.width,c=t.height;if(o){if(o instanceof Uint8ClampedArray)o=new Uint8Array(o.buffer);else if(o.length!==u*c*r)throw new RangeError("mismatched image size")}else o=new Uint8Array(u*c*r);return e.width=u,e.height=c,e.data=o,e}function ys(e,t,r){var o=t.width,u=t.height;if(o!==e.width||u!==e.height){var c=$a({},{width:o,height:u},r);ap(e,c,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,o),height:Math.min(e.height,u)},r),e.width=o,e.height=u,e.data=c.data}}function ap(e,t,r,o,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||o.x>t.width-u.width||o.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=((o.y+_)*t.width+o.x)*c,T=0;T<u.width*c;T++)v[S+T]=h[x+T];return t}Ve("HeatmapBucket",Du,{omit:["layers"]});var zo=function(e,t){$a(this,e,1,t)};zo.prototype.resize=function(e){ys(this,e,1)},zo.prototype.clone=function(){return new zo({width:this.width,height:this.height},new Uint8Array(this.data))},zo.copy=function(e,t,r,o,u){ap(e,t,r,o,u,1)};var pi=function(e,t){$a(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,o,u){ap(e,t,r,o,u,4)},Ve("AlphaImage",zo),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,o=e.clips?e.clips.length:1,u=e.image||new pi({width:r,height:o}),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<o;++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,op=Lu,Cg=Lu;function Lu(e,t,r){r=r||2;var o,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 ae,se,ce,ye=[];for(ae=0,se=J.length;ae<se;ae++)(ce=Pf(N,J[ae]*re,ae<se-1?J[ae+1]*re:N.length,re,!1))===ce.next&&(ce.steiner=!0),ye.push(Rg(ce));for(ye.sort(Bg),ae=0;ae<ye.length;ae++)Dg(ye[ae],H),H=Za(H,H.next);return H}(e,t,E,r)),e.length>80*r){o=c=e[0],u=h=e[1];for(var U=r;U<T;U+=r)(v=e[U])<o&&(o=v),(_=e[U+1])<u&&(u=_),v>c&&(c=v),_>h&&(h=_);x=(x=Math.max(c-o,h-u))!==0?1/x:0}return Sl(E,k,r,o,u,x),k}function Pf(e,t,r,o,u){var c,h;if(u===up(e,t,r,o)>0)for(c=t;c<r;c+=o)h=zf(c,e[c],e[c+1],h);else for(c=r-o;c>=t;c-=o)h=zf(c,e[c],e[c+1],h);return h&&Ru(h,h.next)&&(Il(h),h=h.next),h}function Za(e,t){if(!e)return e;t||(t=e);var r,o=e;do if(r=!1,o.steiner||!Ru(o,o.next)&&mr(o.prev,o,o.next)!==0)o=o.next;else{if(Il(o),(o=t=o.prev)===o.next)break;r=!0}while(r||o!==t);return t}function Sl(e,t,r,o,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,ae,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)?(ae=H,H=H.nextZ,ye--):(ae=re,re=re.nextZ,Se--),se?se.nextZ=ae:N=ae,ae.prevZ=se,se=ae;H=re}se.nextZ=null,Ae*=2}while(ce>1)}(U)}(e,o,u,c);for(var v,_,x=e;e.prev!==e.next;)if(v=e.prev,_=e.next,c?kg(e,o,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(Za(e),t,r),t,r,o,u,c,2):h===2&&zg(e,t,r,o,u,c):Sl(Za(e),t,r,o,u,c,1);break}}}function Pg(e){var t=e.prev,r=e,o=e.next;if(mr(t,r,o)>=0)return!1;for(var u=e.next.next;u!==e.prev;){if(vs(t.x,t.y,r.x,r.y,o.x,o.y,u.x,u.y)&&mr(u.prev,u,u.next)>=0)return!1;u=u.next}return!0}function kg(e,t,r,o){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,o),S=sp(v,_,t,r,o),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 o=e;do{var u=o.prev,c=o.next.next;!Ru(u,c)&&kf(u,o,o.next,c)&&Tl(u,c)&&Tl(c,u)&&(t.push(u.i/r),t.push(o.i/r),t.push(c.i/r),Il(o),Il(o.next),o=e=c),o=o.next}while(o!==e);return Za(o)}function zg(e,t,r,o,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=Za(h,h.next),_=Za(_,_.next),Sl(h,t,r,o,u,c),void Sl(_,t,r,o,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(o,u){var c,h=u,v=o.x,_=o.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,o)&&(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);Za(t,t.next),Za(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,o,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-o)*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,o,u,c,h,v){return(u-h)*(t-v)-(e-h)*(c-v)>=0&&(e-h)*(o-v)-(r-h)*(t-v)>=0&&(r-h)*(c-v)-(u-h)*(o-v)>=0}function Fg(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(r,o){var u=r;do{if(u.i!==r.i&&u.next.i!==r.i&&u.i!==o.i&&u.next.i!==o.i&&kf(u,u.next,r,o))return!0;u=u.next}while(u!==r);return!1}(e,t)&&(Tl(e,t)&&Tl(t,e)&&function(r,o){var u=r,c=!1,h=(r.x+o.x)/2,v=(r.y+o.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,o){var u=Ou(mr(e,t,r)),c=Ou(mr(e,t,o)),h=Ou(mr(r,o,e)),v=Ou(mr(r,o,t));return u!==c&&h!==v||!(u!==0||!Fu(e,r,t))||!(c!==0||!Fu(e,o,t))||!(h!==0||!Fu(r,e,o))||!(v!==0||!Fu(r,t,o))}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),o=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,o.next=r,r.prev=o,c.next=o,o.prev=c,o}function zf(e,t,r,o){var u=new lp(e,t,r);return o?(u.next=o.next,u.prev=o,o.next.prev=u,o.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,o){for(var u=0,c=t,h=r-o;c<r;c+=o)u+=(e[h]-e[c])*(e[c+1]+e[h+1]),h=c;return u}function Og(e,t,r,o,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,o||e.length-1,u||Vg)}function Al(e,t,r){var o=e[t];e[t]=e[r],e[r]=o}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 o,u,c=[],h=0;h<r;h++){var v=Sa(e[h]);v!==0&&(e[h].area=Math.abs(v),u===void 0&&(u=v<0),u===v<0?(o&&c.push(o),o=[e[h]]):o.push(e[h]))}if(o&&c.push(o),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 o=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,o[_.to]=!0,o[_.from]=!0)}return u}function hp(e,t,r,o,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:o-1},r,{},u.availableImages),T=x.evaluate({zoom:o},r,{},u.availableImages),E=x.evaluate({zoom:o+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,o){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<o.length;h+=3){var x=o[h]*r,S=o[h+1]*r,T=o[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},o=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(o+=e[u-1].length)}return r},op.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 ua,this.indexArray=new Cn,this.indexArray2=new Eo,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 o=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=ar(_,E);if(this.layers[0]._featureFilter.filter(new ht(this.zoom),k,r)){var U=o?o.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)}}o&&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],ae=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,ae,se,r,{});t.featureIndex.insert(e[se].feature,ae,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 o=0,u=this.patternFeatures;o<u.length;o+=1){var c=u[o];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,o,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),ae=re.vertexLength;this.layoutVertexArray.emplaceBack(H[0].x,H[0].y),this.indexArray2.emplaceBack(ae+H.length-1,ae),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(ae+se-1,ae+se),k.push(H[se].x),k.push(H[se].y);re.vertexLength+=H.length,re.primitiveLength+=H.length}}for(var ce=op(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,o)},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,o){e.prototype.recalculate.call(this,r,o);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,o,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,o,u){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=o,this._values=u,e.readFields(Zg,this,t)}function Zg(e,t,r){e==1?t.id=r.readVarint():e==2?function(o,u){for(var c=o.readVarint()+o.pos;o.pos<c;){var h=u._keys[o.readVarint()],v=u._values[o.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,o=0,u=0,c=e.length,h=c-1;u<c;h=u++)o+=((r=e[h]).x-(t=e[u]).x)*(t.y+r.y);return o}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,o=1,u=0,c=0,h=0,v=[];e.pos<r;){if(u<=0){var _=e.readVarint();o=7&_,u=_>>3}if(u--,o===1||o===2)c+=e.readSVarint(),h+=e.readSVarint(),o===1&&(t&&v.push(t),t=[]),t.push(new me(c,h));else{if(o!==7)throw new Error("unknown command "+o);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,o=0,u=0,c=0,h=1/0,v=-1/0,_=1/0,x=-1/0;e.pos<t;){if(o<=0){var S=e.readVarint();r=7&S,o=S>>3}if(o--,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 o,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(o=0;o<_.length;o++)T[o]=_[o][0];S(_=T);break;case 2:for(o=0;o<_.length;o++)S(_[o]);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 ae=Gg(k[re]);ae!==0&&(J===void 0&&(J=ae<0),J===ae<0?(N&&H.push(N),N=[k[re]]):N.push(k[re]))}return N&&H.push(N),H}(_),o=0;o<_.length;o++)for(u=0;u<_[o].length;u++)S(_[o][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(o){for(var u=null,c=o.readVarint()+o.pos;o.pos<c;){var h=o.readVarint()>>3;u=h===1?o.readString():h===2?o.readFloat():h===3?o.readDouble():h===4?o.readVarint64():h===5?o.readVarint():h===6?o.readSVarint():h===7?o.readBoolean():null}return u}(r))}function Hg(e,t,r){if(e===3){var o=new Df(r,r.readVarint()+r.pos);o.length&&(t[o.name]=o)}}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,o,u,c,h,v){e.emplaceBack(t,r,2*Math.floor(o*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 o=0,u=e;o<u.length;o+=1){var c=u[o],h=c.feature,v=c.id,_=c.index,x=c.sourceLayerIndex,S=this.layers[0]._featureFilter.needGeometry,T=ar(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 o=0,u=this.features;o<u.length;o+=1){var c=u[o];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,o,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(at){return at.x<0})||ct.every(function(at){return at.x>8192})||ct.every(function(at){return at.y<0})||ct.every(function(at){return at.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 ae=H.sub(re)._perp()._unit(),se=re.dist(H);N+se>32768&&(N=0),El(this.layoutVertexArray,H.x,H.y,ae.x,ae.y,0,0,N),El(this.layoutVertexArray,H.x,H.y,ae.x,ae.y,0,1,N),El(this.layoutVertexArray,re.x,re.y,ae.x,ae.y,0,0,N+=se),El(this.layoutVertexArray,re.x,re.y,ae.x,ae.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=op(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,o)},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,o,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(o,u),E=this.paint.get("fill-extrusion-base").evaluate(o,u),k=function(N,J,H,re){for(var ae=[],se=0,ce=N;se<ce.length;se+=1){var ye=ce[se],Se=[ye.x,ye.y,0,1];ms(Se,Se,J),ae.push(new me(Se[0]/Se[3],Se[1]/Se[3]))}return ae}(S,x),U=function(N,J,H,re){for(var ae=[],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=[],at=0,xt=Qe[lt];at<xt.length;at+=1){var He=xt[at],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,or=tr+ze,Mr=new me((er+ce)/wr,(Yt+ye)/wr);Mr.z=br/wr,qe.push(Mr);var ft=new me(Wr/or,kr/or);ft.z=Hr/or,ct.push(ft)}ae.push(qe),se.push(ct)}return[ae,se]}(c,E,T,x);return function(N,J,H){var re=1/0;ji(H,J)&&(re=Rf(H,J[0]));for(var ae=0;ae<J.length;ae++)for(var se=J[ae],ce=N[ae],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,o=0,u=t[o++];!r||u.equals(r);)if(!(r=t[o++]))return 1/0;for(;o<t.length;o++){var c=t[o],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 ae=1/0,se=0,ce=t;se<ce.length;se+=1)ae=Math.min(ae,ce[se].z);return ae}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 Va,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 o=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=ar(_,E);if(this.layers[0]._featureFilter.filter(new ht(this.zoom),k,r)){var U=o?o.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)}}o&&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],ae=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,ae,se,r,{});t.featureIndex.insert(e[se].feature,ae,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 o=0,u=this.patternFeatures;o<u.length;o+=1){var c=u[o];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,o,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,o)},ti.prototype.addLine=function(e,t,r,o,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 ae=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":o;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 at=Math.round(180*ye/Math.PI/20),xt=1;xt<at;xt++){var He=xt/at;if(He!==.5){var St=He-.5;He+=He*St*(He-1)*((1.0904+ae*(ae*(3.55645-1.43519*ae)-3.2452))*St*St+(.848013+ae*(.215638*ae-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,o,u,c){c===void 0&&(c=!1);var h=t.y*o-t.x,v=-t.y-t.x*o;this.addHalfVertex(e,t.x+t.y*r,t.y-t.x*r,c,!1,r,u),this.addHalfVertex(e,h,v,c,!0,-o,u),this.distance>Ff/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(e,t,r,o,u,c))},ti.prototype.addHalfVertex=function(e,t,r,o,u,c,h){var v=.5*(this.lineClips?this.scaledDistance*(Ff-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e.x<<1)+(o?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,o){return o=new ht(Math.floor(o.zoom),{now:o.now,fadeDuration:o.fadeDuration,zoomHistory:o.zoomHistory,transition:o.transition}),e.prototype.possiblyEvaluate.call(this,r,o)},t.prototype.evaluate=function(r,o,u,c){return o=tt({},o,{zoom:Math.floor(o.zoom)}),e.prototype.evaluate.call(this,r,o,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,o){e.prototype.recalculate.call(this,r,o),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 o=r,u=Uf(Yi("line-width",this,o),Yi("line-gap-width",this,o)),c=Yi("line-offset",this,o);return u/2+Math.abs(c)+xr(this.paint.get("line-translate"))},t.prototype.queryIntersectsFeature=function(r,o,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(o,u),this.paint.get("line-gap-width").evaluate(o,u)),T=this.paint.get("line-offset").evaluate(o,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=[],ae=0;ae<H.length;ae++){var se=H[ae],ce=H[ae+1],ye=ae===0?N:se.sub(H[ae-1])._unit()._perp(),Se=ae===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 a_=Er([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),o_=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(o){o.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}(o.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,o,u){var c,h,v=8*u-o-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+=o;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,o),c-=x}return(k?-1:1)*h*Math.pow(2,c-o)},jf=function(e,t,r,o,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 fa(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 o=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(o);for(var u=r.pos-1;u>=e;u--)r.buf[u+o]=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 o=r.readMessage(b_,{}),u=o.width,c=o.height,h=o.left,v=o.top,_=o.advance;t.push({id:o.id,bitmap:new zo({width:u+6,height:c+6},o.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,o=0,u=e;o<u.length;o+=1){var c=u[o];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 o=this.readVarint(),u=o>>3,c=this.pos;this.type=7&o,e(u,t,this),this.pos===c&&this.skip(o)}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,o=this.buf;return t=127&(r=o[this.pos++]),r<128?t:(t|=(127&(r=o[this.pos++]))<<7,r<128?t:(t|=(127&(r=o[this.pos++]))<<14,r<128?t:(t|=(127&(r=o[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=o[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,o,u){return $f.decode(r.subarray(o,u))}(this.buf,t,e):function(r,o,u){for(var c="",h=o;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=fa(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=fa(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=fa(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=fa(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=fa(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=fa(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=fa(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=fa(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=fa(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 o,u;if(t>=0?(o=t%4294967296|0,u=t/4294967296|0):(u=~(-t/4294967296),4294967295^(o=~(-t%4294967296))?o=o+1|0:(o=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)}(o,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(o,u,c){for(var h,v,_=0;_<u.length;_++){if((h=u.charCodeAt(_))>55295&&h<57344){if(!v){h>56319||_+1===u.length?(o[c++]=239,o[c++]=191,o[c++]=189):v=h;continue}if(h<56320){o[c++]=239,o[c++]=191,o[c++]=189,v=h;continue}h=v-55296<<10|h-56320|65536,v=null}else v&&(o[c++]=239,o[c++]=191,o[c++]=189,v=null);h<128?o[c++]=h:(h<2048?o[c++]=h>>6|192:(h<65536?o[c++]=h>>12|224:(o[c++]=h>>18|240,o[c++]=h>>12&63|128),o[c++]=h>>6&63|128),o[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 o=this.pos-r;o>=128&&Zf(r,o,this),this.pos=r-1,this.writeVarint(o),this.pos+=o},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,o=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=o},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={},o={};this.haveRenderCallbacks=[];var u=[];this.addImages(e,r,u),this.addImages(t,o,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=o[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=o};Ml.prototype.addImages=function(e,t,r){for(var o in e){var u=e[o],c={x:0,y:0,w:u.data.width+2,h:u.data.height+2};r.push(c),t[o]=new Nu(c,u),u.hasRenderCallback&&this.haveRenderCallbacks.push(o)}},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 o=e.tl;r.update(t.data,void 0,{x:o[0],y:o[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,o,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,ae=di.processStyledBidirectionalText;if(re&&H.sections.length===1){J=[];for(var se=0,ce=re(H.toString(),dp(H,x,c,t,o,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(ae){J=[];for(var $e=0,ke=ae(H.text,H.sectionIndex,dp(H,x,c,t,o,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 at=[],xt=qe.text,He=0,St=0,Wt=ct;St<Wt.length;St+=1){var er=Wt[St];at.push(qe.substring(He,er)),He=er}return He<xt.length&&at.push(qe.substring(He,xt.length)),at}(H,dp(H,x,c,t,o,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,at,xt,He,St,Wt,er,Yt,Ht,tr,br){for(var wr=0,Wr=-17,kr=0,Hr=0,or=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,Ro=!(Yt===ki.horizontal||!tr&&!ss(Mi)||tr&&(ju[Mi]||(va=Mi,Ce.Arabic(va)||Ce["Arabic Supplement"](va)||Ce["Arabic Extended-A"](va)||Ce["Arabic Presentation Forms-A"](va)||Ce["Arabic Presentation Forms-B"](va))));if(Tt.imageName){var Ms=xt[Tt.imageName];if(!Ms)continue;Qi=Tt.imageName,qe.iconsInText=qe.iconsInText||!0,Rn=Ms.paddedRect;var ya=Ms.displaySize;Tt.scale=24*Tt.scale/br,Ln=ri+(24-ya[1]*Tt.scale),ks=(sr={width:ya[0],height:ya[1],left:1,top:-3,advance:Ro?ya[1]:ya[0]}).advance;var zs=Ro?ya[0]*Tt.scale-24*wt:ya[1]*Tt.scale-24*wt;zs>0&&zs>fr&&(fr=zs)}else{var Yu=at[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)}Ro?(qe.verticalizable=!0,jt.push({glyph:Mi,imageName:Qi,x:wr,y:Wr+Ln,vertical:Ro,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:Ro,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,or,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 va,Ll=Wr- -17,Ds=mp(Wt),Wa=Ds.horizontalAlign,Ls=Ds.verticalAlign;(function(tc,rc,Rl,Fl,ic,Ol,Vl,Ul,nc){var Rs,ac=(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 Fo=0,ql=Nl[Fs].positionedGlyphs;Fo<ql.length;Fo+=1){var Os=ql[Fo];Os.x+=ac,Os.y+=Rs}})(qe.positionedLines,or,Wa,Ls,kr,Hr,St,Ll,He.length),qe.top+=-Ls*Ll,qe.bottom=qe.top+Ll,qe.left+=-Wa*kr,qe.right=qe.left+kr}(Qe,t,r,o,J,h,v,_,T,x,E,N),!function(qe){for(var ct=0,at=qe;ct<at.length;ct+=1)if(at[ct].positionedGlyphs.length!==0)return!1;return!0}(lt)&&Qe}Gr.fromFeature=function(e,t){for(var r=new Gr,o=0;o<e.sections.length;o++){var u=e.sections[o];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 o=e.charCodeAt(r+1)||null,u=e.charCodeAt(r-1)||null;t+=o&&dl(o)&&!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,o=this.text.length-1;o>=0&&o>=e&&ju[this.text.charCodeAt(o)];o--)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,o=0;o<e.text.length;++o)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,o,u,c){if(t.imageName){var h=o[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,o){var u=Math.pow(e-t,2);return o?e<t?u/2:2*u:u+Math.abs(r)*r}function w_(e,t,r){var o=0;return e===10&&(o-=1e4),r&&(o+=150),e!==40&&e!==65288||(o+=50),t!==41&&t!==65289||(o+=50),o}function Kf(e,t,r,o,u,c){for(var h=null,v=Xf(t,r,u,c),_=0,x=o;_<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,o,u,c,h){if(c!=="point")return[];if(!e)return[];for(var v,_=[],x=function(J,H,re,ae,se,ce){for(var ye=0,Se=0;Se<J.length();Se++){var Ae=J.getSection(Se);ye+=Hf(J.getCharCode(Se),Ae,ae,se,H,ce)}return ye/Math.max(1,Math.ceil(ye/re))}(e,t,r,o,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,o,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,o,u){if(o||u)for(var c=e[r],h=(e[r].x+c.metrics.advance*c.scale)*o,v=t;v<=r;v++)e[v].x-=h,e[v].y+=u}function Jf(e,t,r,o,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-o[3],T=u[0]+N+o[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-o[0],E=u[1]+H+o[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,o,u,c){e.call(this,r,o),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 o=r.zoomStops,u=r.interpolationType,c=0;c<o.length&&o[c]<=e;)c++;for(var h=c=Math.max(0,c-1);h<o.length&&o[h]<e+1;)h++;h=Math.min(o.length-1,h);var v=o[c],_=o[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 o=t.uSize,u=r.lowerSize;return e.kind==="source"?u/128:e.kind==="composite"?pr(u/128,r.upperSize/128,t.uSizeT):o}function Qf(e,t){var r=0,o=0;if(e.kind==="constant")o=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"?o=pr(e.minSize,e.maxSize,c):r=c}return{uSizeT:r,uSize:o}}Ve("Anchor",Ss);var T_=Object.freeze({__proto__:null,getSizeData:yp,evaluateSizeForFeature:Yf,evaluateSizeForZoom:Qf,SIZE_PACK_FACTOR:128});function ed(e,t,r,o,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>o;)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,o,u,c){for(var h=rd(r,u,c),v=id(r,o)*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,o,u,c,h,v,_){var x=rd(o,c,h),S=id(o,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,ae,se,ce,ye){for(var Se=ae/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 at=((ke+=J)-$e)/qe,xt=pr(lt.x,Qe.x,at),He=pr(lt.y,Qe.y,at);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,ae,H,re)||We.push(St)}}$e+=qe}return ce||We.length||se||(We=k(U,$e/2,J,H,re,ae,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,o,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>=o&&T.x>=o||(S.x>=o?S=new me(o,S.y+(o-S.x)/(T.x-S.x)*(T.y-S.y))._round():T.x>=o&&(T=new me(o,S.y+(o-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 ad(e,t,r,o){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,ae=U,se=0,ce=N,ye=0,Se=J,Ae=0,$e=H;if(c.content&&o){var ke=c.content;re=$u(T,0,ke[0]),se=$u(E,0,ke[1]),ae=$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]-ae,$e=ke[3]-ke[1]-ce}var We=function(xt,He,St,Wt){var er=Zu(xt.stretch-re,ae,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,ae,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),or=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),or._matMult(jt),ft._matMult(jt),Mr._matMult(jt)}var fr=xt.stretch+xt.fixed,Or=He.stretch+He.fixed;return{tl:Hr,tr:or,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(o&&(c.stretchX||c.stretchY))for(var ze=od(T,J,U),lt=od(E,H,N),Qe=0;Qe<ze.length-1;Qe++)for(var qe=ze[Qe],ct=ze[Qe+1],at=0;at<lt.length-1;at++)u.push(We(qe,lt[at],ct,lt[at+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 o=0,u=0,c=e;u<c.length;u+=1){var h=c[u];o+=Math.max(t,Math.min(r,h[1]))-Math.max(t,Math.min(r,h[0]))}return o}function od(e,t,r){for(var o=[{fixed:-1,stretch:0}],u=0,c=e;u<c.length;u+=1){var h=c[u],v=h[0],_=h[1],x=o[o.length-1];o.push({fixed:v-x.stretch,stretch:x.stretch}),o.push({fixed:v-x.stretch,stretch:x.stretch+(_-v)})}return o.push({fixed:t+1,stretch:r}),o}function Zu(e,t,r,o){return e/t*r+o}function Gu(e,t,r,o){return e-t*r/o}var Wu=function(e,t,r,o,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 ae=new me(J,U),se=new me(H,U),ce=new me(J,N),ye=new me(H,N),Se=x*Math.PI/180;ae._rotate(Se),se._rotate(Se),ce._rotate(Se),ye._rotate(Se),J=Math.min(ae.x,se.x,ce.x,ye.x),H=Math.max(ae.x,se.x,ce.x,ye.x),U=Math.min(ae.y,se.y,ce.y,ye.y),N=Math.max(ae.y,se.y,ce.y,ye.y)}e.emplaceBack(t.x,t.y,J,U,H,N,r,o,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 o=1/0,u=1/0,c=-1/0,h=-1/0,v=e[0],_=0;_<v.length;_++){var x=v[_];(!_||x.x<o)&&(o=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-o,h-u),T=S/2,E=new Ts([],P_);if(S===0)return new me(o,u);for(var k=o;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 ae=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,ae+=3*ze}return new Is(se/ae,ce/ae,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,o){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,ja(u,k,U))}return(h?1:-1)*Math.sqrt(v)}(this.p,o),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,o=t[e];e>0;){var u=e-1>>1,c=t[u];if(r(o,c)>=0)break;t[e]=c,e=u}t[e]=o},Ts.prototype._down=function(e){for(var t=this.data,r=this.compare,o=this.length>>1,u=t[e];e<o;){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,o,u){var c=0,h=0;switch(o=Math.abs(o),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=-o;break;case"top-left":case"bottom-left":case"left":c=o}return[c,h]}(e,t[0],t[1]):function(r,o){var u=0,c=0;o<0&&(o=0);var h=o/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-o;break;case"top":c=o-7}switch(r){case"top-right":case"bottom-right":u=-h;break;case"top-left":case"bottom-left":u=h;break;case"left":u=o;break;case"right":u=-o}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,o,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],at=0,xt=ct.positionedGlyphs;at<xt.length;at+=1){var He=xt[at];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 or=(He.metrics.left-Wt)*He.scale-br+kr[0],Mr=(-He.metrics.top-Wt)*He.scale+kr[1],ft=or+St.w*He.scale/Yt,Vt=Mr+St.h*He.scale/Yt,Mt=new me(or,Mr),wt=new me(ft,Mr),ri=new me(or,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,o,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,ae=S;re<ae.length;re+=1)T[ae[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,o){var u=e.compareText;if(t in u){for(var c=u[t],h=c.length-1;h>=0;h--)if(o.dist(c[h])<r)return!0}else u[t]=[];return u[t].push(o),!1}var M_=_s.VectorTileFeature.types,z_=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Hu(e,t,r,o,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*o),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 Ua,this.opacityVertexArray=new Ao,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,o){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,a_.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,o_.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,z_,!0),this.opacityVertexBuffer.itemSize=1),(r||o)&&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,o=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"&&o.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,o,u){for(var c=0;c<e.length;c++)if(t[e.charCodeAt(c)]=!0,(r||o)&&u){var h=Pl[e.charAt(c)];h&&(t[h.charCodeAt(0)]=!0)}},Bt.prototype.populate=function(e,t,r){var o=this.layers[0],u=o.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,ae=H.id,se=H.index,ce=H.sourceLayerIndex,ye=o._featureFilter.needGeometry,Se=ar(re,ye);if(o._featureFilter.filter(U,Se,r)){ye||(Se.geometry=Jt(re));var Ae=void 0;if(_){var $e=o.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,o,Se))}var We=void 0;if(x){var ze=o.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:ae,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,at=Ae.sections;ct<at.length;ct+=1){var xt=at[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 or=0;or<er.length;or++){var Mr=er[or],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(or),Yt[Mt]=br-1,Ht[wt]=br-1)}else wr(or)}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 o=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:o},h<t.length-1&&(o+=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,o,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,ae=0;ae<t.length;ae++){var se=t[ae],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,at=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(at,at+1,at+2),E.emplaceBack(at+1,at+2,at+3),U.vertexLength+=4,U.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Qe[0]),ae!==t.length-1&&ct===t[ae+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,o[0],o[1],h,0,!1,0,S)},Bt.prototype._addCollisionDebugVertex=function(e,t,r,o,u,c){return t.emplaceBack(0,0),e.emplaceBack(r.x,r.y,o,u,Math.round(c.x),Math.round(c.y))},Bt.prototype.addCollisionDebugVertices=function(e,t,r,o,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,o)),this._addCollisionDebugVertex(x,S,c,T,E,new me(e,o)),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,o){for(var u=e;u<t;u++){var c=this.collisionBoxArray.get(u);this.addCollisionDebugVertices(c.x1,c.y1,c.x2,c.y2,o?this.textCollisionBox:this.iconCollisionBox,c.anchorPoint,r)}},Bt.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new zl(Na,Nf.members,Eo),this.iconCollisionBox=new zl(Na,Nf.members,Eo);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,o,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=o;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),o=r.vertexStartIndex+4*r.numGlyphs,u=r.vertexStartIndex;u<o;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),o=[],u=[],c=[],h=0;h<this.symbolInstances.length;++h){c.push(h);var v=this.symbolInstances.get(h);o.push(0|Math.round(t*v.anchorX+r*v.anchorY)),u.push(v.featureIndex)}return c.sort(function(_,x){return o[_]-o[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,o=this.symbolInstanceIndexes;r<o.length;r+=1){var u=this.symbolInstances.get(o[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,o){if(e.prototype.recalculate.call(this,r,o),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,o,u,c){var h=this.layout.get(r).evaluate(o,{},u,c),v=this._unevaluatedLayout._values[r];return v.isDataDriven()||mo(v.value)||!h?h:function(_,x){return x.replace(/{([^{}]+)}/g,function(S,T){return T in _?String(_[T]):""})}(o.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,o=xp.paint.overridableProperties;r<o.length;r+=1){var u=o[r];if(t.hasPaintOverride(this.layout,u)){var c,h=this.paint.get(u),v=new Es(h),_=new Da(v,h.property.specification);c=h.value.kind==="constant"||h.value.kind==="source"?new yo("source",_):new La("composite",_,h.value.zoomStops,h.value._interpolationType),this.paint._values[u]=new jr(h.property,c,h.parameters)}}},t.prototype._handleOverridablePaintPropertyUpdate=function(r,o,u){return!(!this.layout||o.isDataDriven()||u.isDataDriven())&&t.hasPaintOverride(this.layout,r)},t.hasPaintOverride=function(r,o){var u=r.get("text-field"),c=xp.paint.properties[o],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,Bo=function(e,t,r,o){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this.update(t,o)};Bo.prototype.update=function(e,t,r){var o=e.width,u=e.height,c=!(this.size&&this.size[0]===o&&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=[o,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,o,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,o,u,v.RGBA,v.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&v.generateMipmap(v.TEXTURE_2D)},Bo.prototype.bind=function(e,t,r){var o=this.context.gl;o.bindTexture(o.TEXTURE_2D,this.texture),r!==o.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=o.LINEAR),e!==this.filter&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,e),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,r||e),this.filter=e),t!==this.wrap&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,t),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,t),this.wrap=t)},Bo.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},Bo.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 o=2*Math.PI*6378137/256/Math.pow(2,r);return[e*o-2*Math.PI*6378137/2,t*o-2*Math.PI*6378137/2]}Cs.prototype.send=function(e,t,r,o,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=jo(this.globalScope)?void 0:[];return this.target.postMessage({id:h,type:e,hasCallback:!!r,targetMapId:o,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:o,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 o=this.cancelCallbacks[r];delete this.cancelCallbacks[r],o&&o()}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 o=this.callbacks[e];delete this.callbacks[e],o&&(t.error?o(oi(t.error)):o(null,oi(t.data)))}else{var u=!1,c=jo(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,_=oi(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,o=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 o||u?(o.lng=Math.min(t.lng,o.lng),o.lat=Math.min(t.lat,o.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,o=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<=o&&o<=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,o=e.lat*t,u=Math.sin(r)*Math.sin(o)+Math.cos(r)*Math.cos(o)*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 Do=function(e,t,r){r===void 0&&(r=0),this.x=+e,this.y=+t,this.z=+r};Do.fromLngLat=function(e,t){t===void 0&&(t=0);var r=Gt.convert(e);return new Do(vd(r.lng),gd(r.lat),_d(t,r.lat))},Do.prototype.toLngLat=function(){return new Gt(360*this.x-180,wp(this.y))},Do.prototype.toAltitude=function(){return this.z*yd(wp(this.y))},Do.prototype.meterInMercatorCoordinateUnits=function(){return 1/md*(e=wp(this.y),1/Math.cos(e*Math.PI/180));var e};var Lo=function(e,t,r){this.z=e,this.x=t,this.y=r,this.key=Bl(0,e,e,t,r)};Lo.prototype.equals=function(e){return this.z===e.z&&this.x===e.x&&this.y===e.y},Lo.prototype.url=function(e,t){var r,o,u,c,h,v=(o=this.y,u=this.z,c=dd(256*(r=this.x),256*(o=Math.pow(2,u)-o-1),u),h=dd(256*(r+1),256*(o+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)},Lo.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))},Lo.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,o,u){this.overscaledZ=e,this.wrap=t,this.canonical=new Lo(r,+o,+u),this.key=Bl(t,e,r,o,u)};function Bl(e,t,r,o,u){(e*=2)<0&&(e=-1*e-1);var c=1<<r;return(c*c*e+c*u+o).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,o=2*this.canonical.y;return[new vr(t,this.wrap,t,r,o),new vr(t,this.wrap,t,r+1,o),new vr(t,this.wrap,t,r,o+1),new vr(t,this.wrap,t,r+1,o+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 Do(e.x-this.wrap,e.y))},Ve("CanonicalTileID",Lo),Ve("OverscaledTileID",vr,{omit:["posMatrix"]});var da=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 o=this.dim=t.height-2;this.data=new Uint32Array(t.data.buffer),this.encoding=r||"mapbox";for(var u=0;u<o;u++)this.data[this._idx(-1,u)]=this.data[this._idx(0,u)],this.data[this._idx(o,u)]=this.data[this._idx(o-1,u)],this.data[this._idx(u,-1)]=this.data[this._idx(u,0)],this.data[this._idx(u,o)]=this.data[this._idx(u,o-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(o,-1)]=this.data[this._idx(o-1,0)],this.data[this._idx(-1,o)]=this.data[this._idx(0,o-1)],this.data[this._idx(o,o)]=this.data[this._idx(o-1,o-1)]};da.prototype.get=function(e,t){var r=new Uint8Array(this.data.buffer),o=4*this._idx(e,t);return(this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox)(r[o],r[o+1],r[o+2])},da.prototype.getUnpackVector=function(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},da.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)},da.prototype._unpackMapbox=function(e,t,r){return(256*e*256+256*t+r)/10-1e4},da.prototype._unpackTerrarium=function(e,t,r){return 256*e+t+r/256-32768},da.prototype.getPixels=function(){return new pi({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},da.prototype.backfillBorder=function(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");var o=t*this.dim,u=t*this.dim+this.dim,c=r*this.dim,h=r*this.dim+this.dim;switch(t){case-1:o=u-1;break;case 1:u=o+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=o;S<u;S++)this.data[this._idx(S,x)]=e.data[this._idx(S+v,x+_)]},Ve("DEMData",da);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,o,u){this.type="Feature",this._vectorTileFeature=e,e._z=t,e._x=r,e._y=o,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 o=String(t);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][o]=this.stateChanges[e][o]||{},tt(this.stateChanges[e][o],r),this.deletedStates[e]===null)for(var u in this.deletedStates[e]={},this.state[e])u!==o&&(this.deletedStates[e][u]=null);else if(this.deletedStates[e]&&this.deletedStates[e][o]===null)for(var c in this.deletedStates[e][o]={},this.state[e][o])r[c]||(this.deletedStates[e][o][c]=null);else for(var h in r)this.deletedStates[e]&&this.deletedStates[e][o]&&this.deletedStates[e][o][h]===null&&delete this.deletedStates[e][o][h]},Ps.prototype.removeFeatureState=function(e,t,r){if(this.deletedStates[e]!==null){var o=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},r&&t!==void 0)this.deletedStates[e][o]!==null&&(this.deletedStates[e][o]=this.deletedStates[e][o]||{},this.deletedStates[e][o][r]=null);else if(t!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][o])for(r in this.deletedStates[e][o]={},this.stateChanges[e][o])this.deletedStates[e][o][r]=null;else this.deletedStates[e][o]=null;else this.deletedStates[e]=null}},Ps.prototype.getState=function(e,t){var r=String(t),o=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 o[c]}return o},Ps.prototype.initializeTileState=function(e,t){e.setFeatureState(this.state,t)},Ps.prototype.coalesceChanges=function(e,t){var r={};for(var o in this.stateChanges){this.state[o]=this.state[o]||{};var u={};for(var c in this.stateChanges[o])this.state[o][c]||(this.state[o][c]={}),tt(this.state[o][c],this.stateChanges[o][c]),u[c]=this.state[o][c];r[o]=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 ma=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,o,u){return cr(e,function(c,h){var v=t instanceof Io?t.get(h):null;return v&&v.evaluate?v.evaluate(r,o,u):v})}function wd(e){for(var t=1/0,r=1/0,o=-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),o=Math.max(o,v.x),u=Math.max(u,v.y)}return{minX:t,minY:r,maxX:o,maxY:u}}function q_(e,t){return t-e}ma.prototype.insert=function(e,t,r,o,u,c){var h=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,o,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])}},ma.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},ma.prototype.query=function(e,t,r,o){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 at=0,xt=ct;at<xt.length;at+=1)if(Ji(Ae,xt[at]))return!0}for(var He=0;He<Ae.length-1;He++)if(ko(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,o,function(Ae,$e,ke){return Se||(Se=Jt(Ae)),$e.queryIntersectsFeature(_,Ae,ke,Se,u.z,e.transform,h,e.pixelPosMatrix)})}},ae=0;ae<T.length;ae++)re(ae);return H},ma.prototype.loadMatchingFeature=function(e,t,r,o,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(o);if(u.needGeometry){var U=ar(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 ae={};N!==void 0&&x&&(ae=x.getState(re.sourceLayer||"_geojsonTileLayer",N));var se=tt({},_[H]);se.paint=bd(se.paint,re.paint,k,ae,h),se.layout=bd(se.layout,re.layout,k,ae,h);var ce=!S||S(k,re,ae);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:o,feature:ye,intersectionZ:ce})}}}}}},ma.prototype.lookupSymbolFeatures=function(e,t,r,o,u,c,h,v){var _={};this.loadVTLayers();for(var x=rs(u),S=0,T=e;S<T.length;S+=1)this.loadMatchingFeature(_,r,o,T[S],x,c,h,v,t);return _},ma.prototype.hasLayer=function(e){for(var t=0,r=this.bucketLayerIDs;t<r.length;t+=1)for(var o=0,u=r[t];o<u.length;o+=1)if(e===u[o])return!0;return!1},ma.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",ma,{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 o 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(ae){return S.getLayer(ae)}).filter(Boolean);if(J.length!==0){N.layers=J,N.stateDependentLayerIds&&(N.stateDependentLayers=N.stateDependentLayerIds.map(function(ae){return J.filter(function(se){return se.id===ae})[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[o];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 a},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 o=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Bo(e,this.imageAtlas.image,o.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Bo(e,this.glyphAtlasImage,o.ALPHA),this.glyphAtlasImage=null)},Pr.prototype.prepare=function(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)},Pr.prototype.queryRenderedFeatures=function(e,t,r,o,u,c,h,v,_,x){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:o,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 o=r.loadVTLayers(),u=t?t.sourceLayer:"",c=o._geojsonTileLayer||o[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=ar(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=Ta(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 o=Date.now(),u=!1;if(this.expirationTime>o)u=!1;else if(t)if(this.expirationTime<t)u=!0;else{var c=this.expirationTime-t;c?this.expirationTime=o+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 o in this.buckets)if(t.style.hasLayer(o)){var u=this.buckets[o],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(o);_&&(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={},o=0,u=t;o<u.length;o+=1)r[u[o]]=!0;this.dependencies[e]=r},Pr.prototype.hasDependency=function(e,t){for(var r=0,o=e;r<o.length;r+=1){var u=this.dependencies[o[r]];if(u){for(var c=0,h=t;c<h.length;c+=1)if(u[h[c]])return!0}}return!1};var Ga=le.performance,Sd=function(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},Ga.mark(this._marks.start)};Sd.prototype.finish=function(){Ga.mark(this._marks.end);var e=Ga.getEntriesByName(this._marks.measure);return e.length===0&&(Ga.measure(this._marks.measure,this._marks.start,this._marks.end),e=Ga.getEntriesByName(this._marks.measure),Ga.clearMarks(this._marks.start),Ga.clearMarks(this._marks.end),Ga.clearMeasures(this._marks.measure)),e},l.Actor=Cs,l.AlphaImage=zo,l.CanonicalTileID=Lo,l.CollisionBoxArray=a,l.Color=Et,l.DEMData=da,l.DataConstantProperty=Ze,l.DictionaryCoder=Ku,l.EXTENT=8192,l.ErrorEvent=Q,l.EvaluationParameters=ht,l.Event=j,l.Evented=te,l.FeatureIndex=ma,l.FillBucket=pn,l.FillExtrusionBucket=hn,l.ImageAtlas=Ml,l.ImagePosition=Nu,l.LineBucket=ti,l.LngLat=Gt,l.LngLatBounds=yr,l.MercatorCoordinate=Do,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=Wo,l.SegmentVector=D,l.SourceFeatureState=Ps,l.StructArrayLayout1ui2=wl,l.StructArrayLayout2f1f2i16=ca,l.StructArrayLayout2i4=ua,l.StructArrayLayout3ui6=Cn,l.StructArrayLayout4i8=gl,l.SymbolBucket=Bt,l.Texture=Bo,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 o=e.length,u=new Array(e.length),c=null;e.forEach(function(h,v){t(h,function(_,x){_&&(c=_),u[v]=x,--o==0&&r(c,u)})})},l.bezier=Re,l.bindAll=ur,l.browser=rn,l.cacheEntryPossiblyAdded=function(e){++no>Go&&(e.getActor().send("enforceCacheSizeLimit",Ca),no=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=oe,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 o=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-o*_,e[2]=o*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 o=0;o<t.length;o++)if(!e(t[o],r[o]))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=wo,l.endsWith=Sr,l.enforceCacheSizeLimit=function(e){Pa(),wi&&wi.then(function(t){t.keys().then(function(r){for(var o=0;o<r.length-e;o++)t.delete(r[o])})})},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),o=Math.cos(t);return e[0]=o,e[1]=r,e[2]=0,e[3]=-r,e[4]=o,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},l.getAnchorAlignment=mp,l.getAnchorJustification=gp,l.getArrayBuffer=oo,l.getImage=C,l.getJSON=function(e,t){return ka(tt(e,{type:"json"}),t)},l.getRTLTextPluginStatus=yl,l.getReferrer=Wn,l.getVideo=function(e,t){var r,o,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],o=void 0,(o=le.document.createElement("a")).href=r,(o.protocol!==le.document.location.protocol||o.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],o=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-o*h,ae=r*_-u*h,se=r*x-c*h,ce=o*_-u*v,ye=o*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-ae*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-o*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*ae)*Qe,e[7]=(S*Se-E*se+k*ae)*Qe,e[8]=(h*ze-v*ke+x*Ae)*Qe,e[9]=(o*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-o*$e+u*Ae)*Qe,e[14]=(N*ae-U*ce-J*re)*Qe,e[15]=(S*ce-T*ae+E*re)*Qe,e):null},l.isChar=Ce,l.isMapboxURL=_i,l.keysDifference=function(e,t){var r=[];for(var o in e)o in t||r.push(o);return r},l.makeRequest=ka,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],o=t[1],u=t[2],c=r*r+o*o+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=ao,l.ortho=function(e,t,r,o,u,c,h){var v=1/(t-r),_=1/(o-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+o)*_,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,o,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[ae],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),at=v.get("text-variable-anchor");if(!at){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&&at){for(var Yt=He==="auto"?at.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 or=o[ce.icon.name];or&&(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=or.sdf,e.sdfIcons===void 0?e.sdfIcons=or.sdf:e.sdfIcons!==or.sdf&&Lt("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(or.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,Ro=ft.tilePixelRatio*ks,Ms=ft.tilePixelRatio*Mi/24,ya=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",va=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 Wa=function(j_,jl){jl.x<0||jl.x>=8192||jl.y<0||jl.y>=8192||function(lr,fn,$_,Ha,Ep,Ad,oc,Fn,sc,$l,lc,uc,Cp,Ed,Zl,Cd,Pd,kd,Md,zd,zi,cc,Bd,On,Z_){var Dd,Oo,Vs,Us,Ns,qs=lr.addToLineVertexArray(fn,$_),Ld=0,Rd=0,Fd=0,Od=0,Pp=-1,kp=-1,ga={},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&&Ha.vertical){var Ud=Fn.layout.get("text-rotate").evaluate(zi,{},On)+90;Us=new Wu(sc,fn,$l,lc,uc,Ha.vertical,Cp,Ed,Zl,Ud),oc&&(Ns=new Wu(sc,fn,$l,lc,uc,oc,Pd,kd,Zl,Ud))}if(Ep){var Bp=Fn.layout.get("icon-rotate").evaluate(zi,{}),Nd=Fn.layout.get("icon-text-fit")!=="none",qd=ad(Ep,Bp,Bd,Nd),Dp=oc?ad(oc,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 Ha.horizontal){var pc=Ha.horizontal[$d];if(!Oo){Vd=V(pc.text);var G_=Fn.layout.get("text-rotate").evaluate(zi,{},On);Oo=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,Ha.vertical?ki.horizontal:ki.horizontalOnly,Zd?Object.keys(Ha.horizontal):[$d],ga,Pp,cc,On),Zd)break}Ha.vertical&&(Od+=ld(lr,fn,Ha.vertical,Ad,Fn,Zl,zi,Cd,qs,ki.vertical,["vertical"],ga,kp,cc,On));var W_=Oo?Oo.boxStartIndex:lr.collisionBoxArray.length,H_=Oo?Oo.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(Oo,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,ga.right>=0?ga.right:-1,ga.center>=0?ga.center:-1,ga.left>=0?ga.left:-1,ga.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,Ro,Yu,Qu,Or,ya,Bs,ec,Rn,Vt,Fr,Tt,Dn,jt)};if(va==="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)||Wa(rc,ic)}else if(va==="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&&Wa(Ul,nc)}}else if(Vt.type==="Polygon")for(var Rs=0,ac=cp(Vt.geometry,0);Rs<ac.length;Rs+=1){var Fs=ac[Rs],Nl=C_(Fs,16);Wa(Fs[0],new Ss(Nl.x,Nl.y,0))}else if(Vt.type==="LineString")for(var Fo=0,ql=Vt.geometry;Fo<ql.length;Fo+=1){var Os=ql[Fo];Wa(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];Wa([Ap],new Ss(Ap.x,Ap.y,0))}}(e,ce,ke,kr,o,x,Ae,$e,ze,Hr,h)},ae=0,se=e.features;ae<se.length;ae+=1)re();c&&e.generateCollisionDebugBuffers()},l.perspective=function(e,t,r,o,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+o)*(c=1/(o-u)),e[14]=2*u*o*c):(e[10]=-1,e[14]=-2*o),e},l.pick=function(e,t){for(var r={},o=0;o<t.length;o++){var u=t[o];u in e&&(r[u]=e[u])}return r},l.plugin=di,l.polygonIntersectsPolygon=Mn,l.postMapLoadEvent=ro,l.postTurnstileEvent=Zo,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 o=t[0],u=t[1],c=t[2],h=t[3],v=Math.sin(r),_=Math.cos(r);return e[0]=o*_+c*v,e[1]=u*_+h*v,e[2]=o*-v+c*_,e[3]=u*-v+h*_,e},l.rotateX=function(e,t,r){var o=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*o,e[5]=h*u+S*o,e[6]=v*u+T*o,e[7]=_*u+E*o,e[8]=x*u-c*o,e[9]=S*u-h*o,e[10]=T*u-v*o,e[11]=E*u-_*o,e},l.rotateZ=function(e,t,r){var o=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*o,e[1]=h*u+S*o,e[2]=v*u+T*o,e[3]=_*u+E*o,e[4]=x*u-c*o,e[5]=S*u-h*o,e[6]=T*u-v*o,e[7]=E*u-_*o,e},l.scale=function(e,t,r){var o=r[0],u=r[1],c=r[2];return e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3]*o,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){Ca=e,Go=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,To(),r||Ui()},l.sphericalToCartesian=function(e){var t=e[0],r=e[1],o=e[2];return r+=90,r*=Math.PI/180,o*=Math.PI/180,{x:t*Math.cos(r)*Math.sin(o),y:t*Math.sin(r)*Math.sin(o),z:t*Math.cos(o)}},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 o=t[0],u=t[1],c=t[2];return e[0]=o*r[0]+u*r[3]+c*r[6],e[1]=o*r[1]+u*r[4]+c*r[7],e[2]=o*r[2]+u*r[5]+c*r[8],e},l.transformMat4=ms,l.translate=function(e,t,r){var o,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]=o=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]=o*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=xo,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 oe(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+=oe(j[F])+",";return P+"]"}for(var Q=Object.keys(I).sort(),te="{",B=0;B<Q.length;B++)te+=JSON.stringify(Q[B])+":"+oe(I[Q[B]])+",";return te+"}"}function W(I){for(var C="",P=0,F=l.refProperties;P<F.length;P+=1)C+="/"+oe(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(so){return!so.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,jo,Q[P])}function Tr(I,C){var P=I.feature;P.id!==void 0&&C.writeVarintField(1,P.id),C.writeMessage(2,Sa,I),C.writeVarintField(3,P.type),C.writeMessage(4,Ia,P)}function Sa(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 Ta(I){return I<<1^I>>31}function Ia(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(Ta(fe)),C.writeVarint(Ta(be)),j+=fe,Q+=be}F===3&&C.writeVarint(ii(7,1))}}function jo(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:Aa(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 Aa(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")eo(Q,te);else if(B==="Polygon"||B==="MultiLineString")for(var Z=0;Z<te.length;Z++)eo(Q,te[Z]);else if(B==="MultiPolygon")for(Z=0;Z<te.length;Z++)for(var ne=0;ne<te[Z].length;ne++)eo(Q,te[Z][ne])}(j),j}function eo(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")Ea(j,B,te,!1);else if(Q==="MultiLineString"){if(P.lineMetrics){for(ne=0;ne<j.length;ne++)Ea(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 Ea(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=[];Ea(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")$o(we,Oe,P,F,j);else if(fe==="LineString")Zo(we,Oe,P,F,j,!1,B.lineMetrics);else if(fe==="MultiLineString")ro(we,Oe,P,F,j,!1);else if(fe==="Polygon")ro(we,Oe,P,F,j,!0);else if(fe==="MultiPolygon")for(var de=0;de<we.length;de++){var Be=[];ro(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 $o(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 Zo(I,C,P,F,j,Q,te){for(var B,Z,ne=to(I),xe=j===0?Go:Pa,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)):Ca(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=to(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&&Ca(ne,be,Ue,Oe),Me=ne.length-3,Q&&Me>=3&&(ne[Me]!==ne[0]||ne[Me+1]!==ne[1])&&Ca(ne,ne[0],ne[1],ne[2]),ne.length&&C.push(ne)}function to(I){var C=[];return C.size=I.size,C.start=I.start,C.end=I.end,C}function ro(I,C,P,F,j,Q){for(var te=0;te<I.length;te++)Zo(I[te],C,P,F,j,Q,!1)}function Ca(I,C,P,F){I.push(C),I.push(P),I.push(F)}function Go(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 Pa(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 io(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 no(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(ao(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(ao(ne[F][j],ne[F][j+1],C,Q,te,B));Z.geometry.push(we)}}return I.transformed=!0,I}function ao(I,C,P,F,j,Q){return[Math.round(P*(I*F-j)),Math.round(P*(C*F-Q))]}function Wo(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++,Ho(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 Ho(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=io(Z,1).concat(B)),ne&&(B=B.concat(io(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 an(I,C,P){return 32*((1<<I)*P+C)+I}function ka(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?Aa(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=an(C,P,F),fe=this.tiles[we];if(!fe&&(ne>1&&console.time("creation"),fe=this.tiles[we]=Wo(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=an(I,C=(C%te+te)%te,P);if(this.tiles[B])return no(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[an(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]?no(this.tiles[B],j):null):null};var oo=function(I){function C(P,F,j,Q){I.call(this,P,F,j,ka),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:oo},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 oe=l.createCommonjsModule(function(i){function a(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(a.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=a:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=a,window.mapboxgl.notSupportedReason=n);var s={};a.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}}),W={create:function(i,a,n){var s=l.window.document.createElement(i);return a!==void 0&&(s.className=a),n&&n.appendChild(s),s},createNS:function(i,a){return l.window.document.createElementNS(i,a)}},ve=l.window.document&&l.window.document.documentElement.style;function me(i){if(!ve)return i[0];for(var a=0;a<i.length;a++)if(i[a]in ve)return i[a];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,a){i.style[ge]=a};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,a,n,s){s===void 0&&(s={}),i.addEventListener(a,n,"passive"in s&&Re?s:s.capture)},W.removeEventListener=function(i,a,n,s){s===void 0&&(s={}),i.removeEventListener(a,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 a=i.userImage;return!!(a&&a.render&&a.render())&&(i.data.replace(new Uint8Array(a.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,a){var n=i.getBoundingClientRect();return new l.Point(a.clientX-n.left-i.clientLeft,a.clientY-n.top-i.clientTop)},W.touchPos=function(i,a){for(var n=i.getBoundingClientRect(),s=[],p=0;p<a.length;p++)s.push(new l.Point(a[p].clientX-n.left-i.clientLeft,a[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 a(){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&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.isLoaded=function(){return this.loaded},a.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=[]}},a.prototype.getImage=function(n){return this.images[n]},a.prototype.addImage=function(n,s){this._validate(n,s)&&(this.images[n]=s)},a.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},a.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},a.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]))},a.prototype.updateImage=function(n,s){s.version=this.images[n].version+1,this.images[n]=s,this.updatedImages[n]=!0},a.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()},a.prototype.listImages=function(){return Object.keys(this.images)},a.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})},a.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)},a.prototype.getPixelSize=function(){var n=this.atlasImage;return{width:n.width,height:n.height}},a.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},a.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)},a.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},a.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},a.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)}}},a}(l.Evented),dt=Kt,Dt=Kt,Xt=1e20;function Kt(i,a,n,s,p,f){this.fontSize=i||24,this.buffer=a===void 0?3:a,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,a,n,s,p,f,y){for(var g=0;g<a;g++){for(var w=0;w<n;w++)s[w]=i[w*a+g];for(Sr(s,p,f,y,n),w=0;w<n;w++)i[w*a+g]=p[w]}for(w=0;w<n;w++){for(g=0;g<a;g++)s[g]=i[w*a+g];for(Sr(s,p,f,y,a),g=0;g<a;g++)i[w*a+g]=Math.sqrt(p[g])}}function Sr(i,a,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++;a[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 a=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=a.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,a){this.requestManager=i,this.localIdeographFontFamily=a,this.entries={}};cr.prototype.setURL=function(i){this.url=i},cr.prototype.getGlyphs=function(i,a){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)a(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}}a(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,a,n){var s=this.localIdeographFontFamily;if(s&&this._doesCharSupportLocalGlyph(n)){var p=i.tinySDF;if(!p){var f="400";/bold/i.test(a)?f="900":/medium/i.test(a)?f="500":/light/i.test(a)&&(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,a,n,s,p){var f=256*a,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,a){return l.sphericalToCartesian(i.expression.evaluate(a))},Xr.prototype.interpolate=function(i,a,n){return{x:l.number(i.x,a.x,n),y:l.number(i.y,a.y,n),z:l.number(i.z,a.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 a(n){i.call(this),this._transitionable=new l.Transitionable(gr),this.setLight(n),this._transitioning=this._transitionable.untransitioned()}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getLight=function(){return this._transitionable.serialize()},a.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)}},a.prototype.updateTransitions=function(n){this._transitioning=this._transitionable.transitioned(n,this._transitioning)},a.prototype.hasTransition=function(){return this._transitioning.hasTransition()},a.prototype.recalculate=function(n){this.properties=this._transitioning.possiblyEvaluate(n)},a.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})))},a}(l.Evented),Lt=function(i,a){this.width=i,this.height=a,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};Lt.prototype.getDash=function(i,a){var n=i.join(",")+String(a);return this.dashEntry[n]||(this.dashEntry[n]=this.addDash(i,a)),this.dashEntry[n]},Lt.prototype.getDashRanges=function(i,a,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,a,n){for(var s=a/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 a=i.length-1;a>=0;--a){var n=i[a],s=i[a+1];n.zeroLength?i.splice(a,1):s&&s.isDash===n.isDash&&(s.left=n.left,i.splice(a,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,a){var n=a?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);a?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 a=i.gl;this.texture?(a.bindTexture(a.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,a.texSubImage2D(a.TEXTURE_2D,0,0,0,this.width,this.height,a.ALPHA,a.UNSIGNED_BYTE,this.data))):(this.texture=a.createTexture(),a.bindTexture(a.TEXTURE_2D,this.texture),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.REPEAT),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.REPEAT),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR),a.texImage2D(a.TEXTURE_2D,0,a.ALPHA,this.width,this.height,0,a.ALPHA,a.UNSIGNED_BYTE,this.data))};var Tr=function i(a,n){this.workerPool=a,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 Sa(i,a,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=a.canonicalizeTileset(y,i.url),n(null,y)}};return i.url?l.getJSON(a.transformRequest(a.normalizeSourceURL(i.url),l.ResourceType.Source),s):l.browser.frame(function(){return s(null,i)})}Tr.prototype.broadcast=function(i,a,n){l.asyncAll(this.actors,function(s,p){s.send(i,a,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,a,n){this.bounds=l.LngLatBounds.convert(this.validateBounds(i)),this.minzoom=a||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 a=Math.pow(2,i.z),n=Math.floor(l.mercatorXfromLng(this.bounds.getWest())*a),s=Math.floor(l.mercatorYfromLat(this.bounds.getNorth())*a),p=Math.ceil(l.mercatorXfromLng(this.bounds.getEast())*a),f=Math.ceil(l.mercatorYfromLat(this.bounds.getSouth())*a);return i.x>=n&&i.x<p&&i.y>=s&&i.y<f};var Ta=function(i){function a(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&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.load=function(){var n=this;this._loaded=!1,this.fire(new l.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Sa(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"})))})},a.prototype.loaded=function(){return this._loaded},a.prototype.hasTile=function(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)},a.prototype.onAdd=function(n){this.map=n,this.load()},a.prototype.setSourceProperty=function(n){this._tileJSONRequest&&this._tileJSONRequest.cancel(),n(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},a.prototype.setTiles=function(n){var s=this;return this.setSourceProperty(function(){s._options.tiles=n}),this},a.prototype.setUrl=function(n){var s=this;return this.setSourceProperty(function(){s.url=n,s._options.url=n}),this},a.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},a.prototype.serialize=function(){return l.extend({},this._options)},a.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)))},a.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)},a.prototype.unloadTile=function(n){n.unloadVectorData(),n.actor&&n.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id},void 0)},a.prototype.hasTransition=function(){return!1},a}(l.Evented),Ia=function(i){function a(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&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.load=function(){var n=this;this._loaded=!1,this.fire(new l.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Sa(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"})))})},a.prototype.loaded=function(){return this._loaded},a.prototype.onAdd=function(n){this.map=n,this.load()},a.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},a.prototype.serialize=function(){return l.extend({},this._options)},a.prototype.hasTile=function(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)},a.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)}})},a.prototype.abortTile=function(n,s){n.request&&(n.request.cancel(),delete n.request),s()},a.prototype.unloadTile=function(n,s){n.texture&&this.map.painter.saveTileTexture(n.texture),s()},a.prototype.hasTransition=function(){return!1},a}(l.Evented),jo=function(i){function a(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&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},a.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)},a.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},a.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})},a}(Ia),dn=function(i){function a(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&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.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))}})},a.prototype.onAdd=function(n){this.map=n,this.load()},a.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},a.prototype.getClusterExpansionZoom=function(n,s){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:n,source:this.id},s),this},a.prototype.getClusterChildren=function(n,s){return this.actor.send("geojson.getClusterChildren",{clusterId:n,source:this.id},s),this},a.prototype.getClusterLeaves=function(n,s,p,f){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:n,limit:s,offset:p},f),this},a.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))})},a.prototype.loaded=function(){return this._loaded},a.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))})},a.prototype.abortTile=function(n){n.request&&(n.request.cancel(),delete n.request),n.aborted=!0},a.prototype.unloadTile=function(n){n.unloadVectorData(),this.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id})},a.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},a.prototype.serialize=function(){return l.extend({},this._options,{type:this.type,data:this._data})},a.prototype.hasTransition=function(){return!1},a}(l.Evented),Bi=l.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),Zi=function(i){function a(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&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.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())})},a.prototype.loaded=function(){return this._loaded},a.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},a.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new l.Event("data",{dataType:"source",sourceDataType:"metadata"})))},a.prototype.onAdd=function(n){this.map=n,this.load()},a.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},a.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)}}},a.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))},a.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},a.prototype.hasTransition=function(){return!1},a}(l.Evented),qn=function(i){function a(n,s,p,f){i.call(this,n,s,p,f),this.roundZoom=!0,this.type="video",this.options=s}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.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())})},a.prototype.pause=function(){this.video&&this.video.pause()},a.prototype.play=function(){this.video&&this.video.play()},a.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}},a.prototype.getVideo=function(){return this.video},a.prototype.onAdd=function(n){this.map||(this.map=n,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},a.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)}}},a.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},a.prototype.hasTransition=function(){return this.video&&!this.video.paused},a}(Zi),jn=function(i){function a(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&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.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())},a.prototype.getCanvas=function(){return this.canvas},a.prototype.onAdd=function(n){this.map=n,this.load(),this.canvas&&this.animate&&this.play()},a.prototype.onRemove=function(){this.pause()},a.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)}}},a.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},a.prototype.hasTransition=function(){return this._playing},a.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},a}(Zi),mn={vector:Ta,raster:Ia,"raster-dem":jo,geojson:dn,video:qn,image:Zi,canvas:jn};function Ks(i,a){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(a.toUnwrapped()))}function Vr(i,a,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,a,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(a,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,a){var n=i.tileID,s=a.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,a){this.max=i,this.onRemove=a,this.reset()};Rt.prototype.reset=function(){for(var i in this.data)for(var a=0,n=this.data[i];a<n.length;a+=1){var s=n[a];s.timeout&&clearTimeout(s.timeout),this.onRemove(s.value)}return this.data={},this.order=[],this},Rt.prototype.add=function(i,a,n){var s=this,p=i.wrapped().key;this.data[p]===void 0&&(this.data[p]=[]);var f={value:a,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 a=this.data[i].shift();return a.timeout&&clearTimeout(a.timeout),this.data[i].length===0&&delete this.data[i],this.order.splice(this.order.indexOf(i),1),a.value},Rt.prototype.getByKey=function(i){var a=this.data[i];return a?a[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,a){if(!this.has(i))return this;var n=i.wrapped().key,s=a===void 0?0:this.data[n].indexOf(a),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 a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this},Rt.prototype.filter=function(i){var a=[];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)||a.push(f)}for(var y=0,g=a;y<g.length;y+=1){var w=g[y];this.remove(w.value.tileID,w)}};var Gi=function(i,a,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,a.arrayBuffer,this.dynamicDraw?s.DYNAMIC_DRAW:s.STATIC_DRAW),this.dynamicDraw||delete a.arrayBuffer};Gi.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Gi.prototype.updateData=function(i){var a=this.context.gl;this.context.unbindVAO(),this.bind(),a.bufferSubData(a.ELEMENT_ARRAY_BUFFER,0,i.arrayBuffer)},Gi.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var Aa={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},Di=function(i,a,n,s){this.length=a.length,this.attributes=n,this.itemSize=a.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,a.arrayBuffer,this.dynamicDraw?p.DYNAMIC_DRAW:p.STATIC_DRAW),this.dynamicDraw||delete a.arrayBuffer};Di.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},Di.prototype.updateData=function(i){var a=this.context.gl;this.bind(),a.bufferSubData(a.ARRAY_BUFFER,0,i.arrayBuffer)},Di.prototype.enableAttributes=function(i,a){for(var n=0;n<this.attributes.length;n++){var s=a.attributes[this.attributes[n].name];s!==void 0&&i.enableVertexAttribArray(s)}},Di.prototype.setVertexAttribPointers=function(i,a,n){for(var s=0;s<this.attributes.length;s++){var p=this.attributes[s],f=a.attributes[p.name];f!==void 0&&i.vertexAttribPointer(f,p.components,i[Aa[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 a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return l.Color.transparent},a.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)},a}(yt),Kr=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return 1},a.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.clearDepth(n),this.current=n,this.dirty=!1)},a}(yt),_i=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return 0},a.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.clearStencil(n),this.current=n,this.dirty=!1)},a}(yt),Js=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return[!0,!0,!0,!0]},a.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)},a}(yt),Li=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return!0},a.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.depthMask(n),this.current=n,this.dirty=!1)},a}(yt),eo=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return 255},a.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.stencilMask(n),this.current=n,this.dirty=!1)},a}(yt),xi=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},a.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)},a}(yt),$n=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){var n=this.gl;return[n.KEEP,n.KEEP,n.KEEP]},a.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)},a}(yt),Ea=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return!1},a.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}},a}(yt),bi=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return[0,1]},a.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)},a}(yt),wi=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return!1},a.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}},a}(yt),Zn=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return this.gl.LESS},a.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.depthFunc(n),this.current=n,this.dirty=!1)},a}(yt),Ri=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return!1},a.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}},a}(yt),$o=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){var n=this.gl;return[n.ONE,n.ZERO]},a.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)},a}(yt),Zo=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return l.Color.transparent},a.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)},a}(yt),to=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return this.gl.FUNC_ADD},a.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.blendEquation(n),this.current=n,this.dirty=!1)},a}(yt),ro=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return!1},a.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}},a}(yt),Ca=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return this.gl.BACK},a.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.cullFace(n),this.current=n,this.dirty=!1)},a}(yt),Go=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return this.gl.CCW},a.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.frontFace(n),this.current=n,this.dirty=!1)},a}(yt),Pa=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return null},a.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.useProgram(n),this.current=n,this.dirty=!1)},a}(yt),io=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return this.gl.TEXTURE0},a.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.activeTexture(n),this.current=n,this.dirty=!1)},a}(yt),Gn=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){var n=this.gl;return[0,0,n.drawingBufferWidth,n.drawingBufferHeight]},a.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)},a}(yt),no=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return null},a.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}},a}(yt),ao=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return null},a.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}},a}(yt),Wo=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return null},a.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}},a}(yt),Ho=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return null},a.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}},a}(yt),Wn=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return null},a.prototype.set=function(n){var s=this.gl;s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,n),this.current=n,this.dirty=!1},a}(yt),nn=function(i){function a(n){i.call(this,n),this.vao=n.extVertexArrayObject}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return null},a.prototype.set=function(n){this.vao&&(n!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(n),this.current=n,this.dirty=!1)},a}(yt),an=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return 4},a.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}},a}(yt),ka=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return!1},a.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}},a}(yt),oo=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return!1},a.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}},a}(yt),rr=function(i){function a(n,s){i.call(this,n),this.context=n,this.parent=s}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return null},a}(yt),I=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.setDirty=function(){this.dirty=!0},a.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}},a}(rr),C=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.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}},a}(rr),P=function(i,a,n,s){this.context=i,this.width=a,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,a=this.colorAttachment.get();if(a&&i.deleteTexture(a),this.depthAttachment){var n=this.depthAttachment.get();n&&i.deleteRenderbuffer(n)}i.deleteFramebuffer(this.framebuffer)};var F=function(i,a,n){this.func=i,this.mask=a,this.range=n};F.ReadOnly=!1,F.ReadWrite=!0,F.disabled=new F(519,F.ReadOnly,[0,1]);var j=function(i,a,n,s,p,f){this.test=i,this.ref=a,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,a,n){this.blendFunction=i,this.blendColor=a,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,a,n){this.enable=i,this.mode=a,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 eo(this),this.stencilFunc=new xi(this),this.stencilOp=new $n(this),this.stencilTest=new Ea(this),this.depthRange=new bi(this),this.depthTest=new wi(this),this.depthFunc=new Zn(this),this.blend=new Ri(this),this.blendFunc=new $o(this),this.blendColor=new Zo(this),this.blendEquation=new to(this),this.cullFace=new ro(this),this.cullFaceSide=new Ca(this),this.frontFace=new Go(this),this.program=new Pa(this),this.activeTexture=new io(this),this.viewport=new Gn(this),this.bindFramebuffer=new no(this),this.bindRenderbuffer=new ao(this),this.bindTexture=new Wo(this),this.bindVertexBuffer=new Ho(this),this.bindElementBuffer=new Wn(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new nn(this),this.pixelStoreUnpack=new an(this),this.pixelStoreUnpackPremultiplyAlpha=new ka(this),this.pixelStoreUnpackFlipY=new oo(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,a){return new Gi(this,i,a)},B.prototype.createVertexBuffer=function(i,a,n){return new Di(this,i,a,n)},B.prototype.createRenderbuffer=function(i,a,n){var s=this.gl,p=s.createRenderbuffer();return this.bindRenderbuffer.set(p),s.renderbufferStorage(s.RENDERBUFFER,i,a,n),this.bindRenderbuffer.set(null),p},B.prototype.createFramebuffer=function(i,a,n){return new P(this,i,a,n)},B.prototype.clear=function(i){var a=i.color,n=i.depth,s=this.gl,p=0;a&&(p|=s.COLOR_BUFFER_BIT,this.clearColor.set(a),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 a(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&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.onAdd=function(n){this.map=n,this._maxTileCacheSize=n?n._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(n)},a.prototype.onRemove=function(n){this._source&&this._source.onRemove&&this._source.onRemove(n)},a.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},a.prototype.getSource=function(){return this._source},a.prototype.pause=function(){this._paused=!0},a.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)}},a.prototype._loadTile=function(n,s){return this._source.loadTile(n,s)},a.prototype._unloadTile=function(n){if(this._source.unloadTile)return this._source.unloadTile(n,function(){})},a.prototype._abortTile=function(n){if(this._source.abortTile)return this._source.abortTile(n,function(){})},a.prototype.serialize=function(){return this._source.serialize()},a.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)}},a.prototype.getIds=function(){return l.values(this._tiles).map(function(n){return n.tileID}).sort(ne).map(function(n){return n.key})},a.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})},a.prototype.hasRenderableParent=function(n){var s=this.findLoadedParent(n,0);return!!s&&this._isIdRenderable(s.tileID.key)},a.prototype._isIdRenderable=function(n,s){return this._tiles[n]&&this._tiles[n].hasData()&&!this._coveredTiles[n]&&(s||!this._tiles[n].holdingForFade())},a.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")},a.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)))},a.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}))},a.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)))}},a.prototype.getTile=function(n){return this.getTileByID(n.key)},a.prototype.getTileByID=function(n){return this._tiles[n]},a.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}}}},a.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}},a.prototype._getLoadedTile=function(n){var s=this._tiles[n.key];return s&&s.hasData()?s:this._cache.getByKey(n.wrapped().key)},a.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)},a.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])}},a.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-a.maxOverzooming,this._source.minzoom),g=Math.max(f+a.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()}},a.prototype.releaseSymbolFadeTiles=function(){for(var n in this._tiles)this._tiles[n].holdingForFade()&&this._removeTile(n)},a.prototype._updateRetainedTiles=function(n,s){for(var p={},f={},y=Math.max(s-a.maxOverzooming,this._source.minzoom),g=Math.max(s+a.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},a.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}},a.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},a.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))},a.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))))},a.prototype.clearTiles=function(){for(var n in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(n);this._cache.reset()},a.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},a.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},a.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},a.prototype.setFeatureState=function(n,s,p){this._state.updateState(n=n||"_geojsonTileLayer",s,p)},a.prototype.removeFeatureState=function(n,s,p){this._state.removeFeatureState(n=n||"_geojsonTileLayer",s,p)},a.prototype.getFeatureState=function(n,s){return this._state.getState(n=n||"_geojsonTileLayer",s)},a.prototype.setDependencies=function(n,s,p){var f=this._tiles[n];f&&f.setDependencies(s,p)},a.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)})},a}(l.Evented);function ne(i,a){var n=Math.abs(2*i.wrap)-+(i.wrap<0),s=Math.abs(2*a.wrap)-+(a.wrap<0);return i.overscaledZ-a.overscaledZ||s-n||a.canonical.y-i.canonical.y||a.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(a){a.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,a){var n={};for(var s in i)s!=="ref"&&(n[s]=i[s]);return l.refProperties.forEach(function(p){p in a&&(n[p]=a[p])}),n}function Ee(i){i=i.slice();for(var a=Object.create(null),n=0;n<i.length;n++)a[i[n].id]=i[n];for(var s=0;s<i.length;s++)"ref"in i[s]&&(i[s]=Be(i[s],a[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,a,n){n.push({command:Pe.addSource,args:[i,a[i]]})}function Me(i,a,n){a.push({command:Pe.removeSource,args:[i]}),n[i]=!0}function vt(i,a,n,s){Me(i,n,s),ut(i,a,n)}function Ft(i,a,n){var s;for(s in i[n])if(i[n].hasOwnProperty(s)&&s!=="data"&&!l.deepEqual(i[n][s],a[n][s]))return!1;for(s in a[n])if(a[n].hasOwnProperty(s)&&s!=="data"&&!l.deepEqual(i[n][s],a[n][s]))return!1;return!0}function pt(i,a,n,s,p,f){var y;for(y in a=a||{},i=i||{})i.hasOwnProperty(y)&&(l.deepEqual(i[y],a[y])||n.push({command:f,args:[s,y,a[y],p]}));for(y in a)a.hasOwnProperty(y)&&!i.hasOwnProperty(y)&&(l.deepEqual(i[y],a[y])||n.push({command:f,args:[s,y,a[y],p]}))}function At(i){return i.id}function _t(i,a){return i[a.id]=a,i}var Ur=function(i,a){this.reset(i,a)};Ur.prototype.reset=function(i,a){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(a||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 a=1,n=this._distances[a],s=i*this.paddedLength+this.padding;n<s&&a<this._distances.length;)n=this._distances[++a];var p=a-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[a].mult(g))};var Pt=function(i,a,n){var s=this.boxCells=[],p=this.circleCells=[];this.xCellCount=Math.ceil(i/n),this.yCellCount=Math.ceil(a/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=a,this.xScale=this.xCellCount/i,this.yScale=this.yCellCount/a,this.boxUid=0,this.circleUid=0};function ir(i,a,n,s,p){var f=l.create();return a?(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,a,n,s,p){if(a){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,a){var n=[i.x,i.y,0,1];Ar(n,n,a);var s=n[3];return{point:new l.Point(n[0]/s,n[1]/s),signedDistanceFromCamera:s}}function Et(i,a){return .5+i/a*.5}function Jr(i,a){var n=i[0]/i[3],s=i[1]/i[3];return n>=-a[0]&&n<=a[0]&&s>=-a[1]&&s<=a[1]}function so(i,a,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,a),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,a,p,f,i.glyphOffsetArray,L,D,_e,he,Ie,q);K=Te.useVertical,(Te.notEnoughRoom||K||Te.needsFlipping&&Ys(X,ue,!0,g,a,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,a,n,s,p,f,y,g,w,A,z){var D=g.glyphStartIndex+g.numGlyphs,L=g.lineStartIndex,$=g.lineStartIndex+g.lineLength,q=a.getoffsetX(g.glyphStartIndex),K=a.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,a,n,s){return i===l.WritingMode.horizontal&&Math.abs(n.y-a.y)>Math.abs(n.x-a.x)*s?{useVertical:!0}:(i===l.WritingMode.vertical?a.y<n.y:a.x>n.x)?{needsFlipping:!0}:null}function Ys(i,a,n,s,p,f,y,g,w,A,z,D,L,$){var q,K=a/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:lo(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 lo(i,a,n,s,p){var f=mt(i.add(i.sub(a)._unit()),p).point,y=n.sub(f);return n.add(y._mult(s/y.mag()))}function nr(i,a,n,s,p,f,y,g,w,A,z,D){var L=s?i-a:i+a,$=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=lo(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,a,n,s,p){this._forEachCell(a,n,s,p,this._insertBoxCell,this.boxUid++),this.boxKeys.push(i),this.bboxes.push(a),this.bboxes.push(n),this.bboxes.push(s),this.bboxes.push(p)},Pt.prototype.insertCircle=function(i,a,n,s){this._forEachCell(a-s,n-s,a+s,n+s,this._insertCircleCell,this.circleUid++),this.circleKeys.push(i),this.circles.push(a),this.circles.push(n),this.circles.push(s)},Pt.prototype._insertBoxCell=function(i,a,n,s,p,f){this.boxCells[p].push(f)},Pt.prototype._insertCircleCell=function(i,a,n,s,p,f){this.circleCells[p].push(f)},Pt.prototype._query=function(i,a,n,s,p,f){if(n<0||i>this.width||s<0||a>this.height)return!p&&[];var y=[];if(i<=0&&a<=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,a,n,s,this._queryCell,y,{hitTest:p,seenUids:{box:{},circle:{}}},f),p?y.length>0:y},Pt.prototype._queryCircle=function(i,a,n,s,p){var f=i-n,y=i+n,g=a-n,w=a+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:a,radius:n},seenUids:{box:{},circle:{}}},p),s?A.length>0:A},Pt.prototype.query=function(i,a,n,s,p){return this._query(i,a,n,s,!1,p)},Pt.prototype.hitTest=function(i,a,n,s,p){return this._query(i,a,n,s,!0,p)},Pt.prototype.hitTestCircle=function(i,a,n,s){return this._queryCircle(i,a,n,!0,s)},Pt.prototype._queryCell=function(i,a,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]&&a<=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,a,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,a,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,a,n,s,p,f,y,g){for(var w=this._convertToXCellCoord(i),A=this._convertToYCellCoord(a),z=this._convertToXCellCoord(n),D=this._convertToYCellCoord(s),L=w;L<=z;L++)for(var $=A;$<=D;$++)if(p.call(this,i,a,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,a,n,s,p,f){var y=s-i,g=p-a,w=n+f;return w*w>y*y+g*g},Pt.prototype._circleAndRectCollide=function(i,a,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(a-(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 uo=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,a){for(var n=0;n<i;n++){var s=a.length;a.resize(s+4),a.float32.set(uo,3*s)}}function Ar(i,a,n){var s=a[0],p=a[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,a,n){a===void 0&&(a=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=a,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,a,n){return a*(l.EXTENT/(i.tileSize*Math.pow(2,n-i.tileID.overscaledZ)))}Si.prototype.placeCollisionBox=function(i,a,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)||!a&&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,a,n,s,p,f,y,g,w,A,z,D,L){var $=[],q=new l.Point(a.anchorX,a.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,a.lineOffsetX*X,a.lineOffsetY*X,!1,ee,q,a,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(),ot=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),ot.x=Math.max(ot.x,Xe[et].x),ot.y=Math.max(ot.y,Xe[et].y);it=rt.x>=Ie.x&&ot.x<=Te.x&&rt.y>=Ie.y&&ot.y<=Te.y?[Xe]:ot.x<Ie.x||rt.x>Te.x||ot.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),ar=Jt.x+100,ci=Jt.y+100;$.push(ar,ci,_e,0);var Zr=ar-_e,Mn=ci-_e,Qr=ar+_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(ar,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 a=[],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),a.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(a,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,a,n,s,p){(a?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:s,collisionGroupID:p},i[0],i[1],i[2],i[3])},Si.prototype.insertCollisionCircles=function(i,a,n,s,p){for(var f=a?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,a,n){var s=[a,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,a,n,s){return n<100||i>=this.screenRightBoundary||s<100||a>this.screenBottomBoundary},Si.prototype.isInsideGrid=function(i,a,n,s){return n>=0&&i<this.gridRightBoundary&&s>=0&&a<this.gridBottomBoundary},Si.prototype.getViewportMatrix=function(){var i=l.identity([]);return l.translate(i,i,[-100,-100,0]),i};var Fi=function(i,a,n,s){this.opacity=i?Math.max(0,Math.min(1,i.opacity+(i.placed?a:-a))):s&&n?1:0,this.placed=n};Fi.prototype.isHidden=function(){return this.opacity===0&&!this.placed};var hi=function(i,a,n,s,p){this.text=new Fi(i?i.text:null,a,n,p),this.icon=new Fi(i?i.icon:null,a,s,p)};hi.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var iu=function(i,a,n){this.text=i,this.icon=a,this.skipFade=n},Ti=function(){this.invProjMatrix=l.create(),this.viewportMatrix=l.create(),this.circles=[]},jc=function(i,a,n,s,p){this.bucketInstanceId=i,this.featureIndex=a,this.sourceLayerIndex=n,this.bucketIndex=s,this.tileID=p},on=function(i){this.crossSourceCollisions=i,this.maxGroupID=0,this.collisionGroups={}};function zr(i,a,n,s,p){var f=l.getAnchorAlignment(i),y=-(f.horizontalAlign-.5)*a,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,a,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(a,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}}on.prototype.get=function(i){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[i]){var a=++this.maxGroupID;this.collisionGroups[i]={ID:a,predicate:function(n){return n.collisionGroupID===a}}}return this.collisionGroups[i]};var qr=function(i,a,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=a,this.retainedQueryData={},this.collisionGroups=new on(n),this.collisionCircleArrays={},this.prevPlacement=s,s&&(s.prevPlacement=void 0),this.placedOrientations={}};function Hn(i,a,n,s,p){i.emplaceBack(a?1:0,n?1:0,s||0,p||0),i.emplaceBack(a?1:0,n?1:0,s||0,p||0),i.emplaceBack(a?1:0,n?1:0,s||0,p||0),i.emplaceBack(a?1:0,n?1:0,s||0,p||0)}qr.prototype.getBucketParts=function(i,a,n,s){var p=n.getBucket(a),f=n.latestFeatureIndex;if(p&&f&&a.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,a,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(a,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,a,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(!a[Fe.crossTileID])if(D)s.placements[Fe.crossTileID]=new iu(!1,!1,!1);else{var st,it=!1,rt=!1,ot=!0,et=null,Je={box:null,offscreen:null},_r={box:null,offscreen:null},Qt=null,Rr=null,Cr=0,Jt=0,ar=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,ha=f.writingModes;ei<ha.length&&(ha[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 ha=Ct.x2-Ct.x1,ip=Ct.y2-Ct.y1,ms=Fe.textBoxScale,np=ue&&!ee?mi:null,Mo={box:[],offscreen:!1},Du=X?2*Qr.length:Qr.length,$a=0;$a<Du;++$a){var ys=s.attemptAnchorPlacement(Qr[$a%Qr.length],Ct,ha,ip,ms,ie,pe,z,g,q,$a>=Qr.length,Fe,f,ei,np);if(ys&&(Mo=ys.placedGlyphBoxes)&&Mo.box&&Mo.box.length){it=!0,et=ys.shift;break}}return Mo};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,ot=Je.offscreen);var Co=Zr(Je&&Je.box);if(!it&&s.prevPlacement){var qa=s.prevPlacement.variableOffsets[Fe.crossTileID];qa&&(s.variableOffsets[Fe.crossTileID]=qa,s.markUsedJustification(f,qa.anchor,Fe,Co))}}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,ot=st&&st.offscreen,Fe.useRuntimeCollisionCircles){var ja=f.text.placedSymbolArray.get(Fe.centerJustifiedTextSymbolIndex),Po=l.evaluateSizeForFeature(f.textSizeData,$,ja),Ji=y.get("text-padding");Qt=s.collisionIndex.placeCollisionCircles(X,ja,f.lineVertexArray,f.glyphOffsetArray,Po,g,w,A,n,pe,q.predicate,Fe.collisionCircleDiameter,Ji),it=X||Qt.circles.length>0&&!Qt.collisionDetected,ot=ot&&Qt.offscreen}if(nt.iconFeatureIndex&&(ar=nt.iconFeatureIndex),nt.iconBox){var ko=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=ko(nt.verticalIconBox)).box.length>0:(Rr=ko(nt.iconBox)).box.length>0,ot=ot&&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,ar,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 pa=0;pa<Qt.circles.length;pa+=4)Bn.circles.push(Qt.circles[pa+0]),Bn.circles.push(Qt.circles[pa+1]),Bn.circles.push(Qt.circles[pa+2]),Bn.circles.push(Qt.collisionDetected?1:0)}s.placements[Fe.crossTileID]=new iu(it||_e,rt||Ie,ot||f.justReloaded),a[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,a,n,s){var p;p=s===l.WritingMode.vertical?n.verticalPlacedTextSymbolIndex:{left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex}[l.getAnchorJustification(a)];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,a,n){for(var s=a===l.WritingMode.horizontal||a===l.WritingMode.horizontalOnly?a:0,p=a===l.WritingMode.vertical?a: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 a=this.prevPlacement,n=!1;this.prevZoomAdjustment=a?a.zoomAdjustment(this.transform.zoom):0;var s=a?a.symbolFadeChange(i):1,p=a?a.opacities:{},f=a?a.variableOffsets:{},y=a?a.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=a?a.lastPlacementChangeTime:i)},qr.prototype.updateLayerOpacities=function(i,a){for(var n={},s=0,p=a;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,a,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];a[ue]?he=f:he||(s.opacities[ue]=he=L),a[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=ou(he.text);$(i.text,ie,Te?Ma:Ge),$(i.text,pe,De?Ma: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=ou(he.icon),nt=!(D&&ee.verticalPlacedIconSymbolIndex&&Te);ee.placedIconSymbolIndex>=0&&($(i.icon,ee.numIconVertices,nt?Fe:Ma),i.icon.placedSymbolArray.get(ee.placedIconSymbolIndex).hidden=he.icon.isHidden()),ee.verticalPlacedIconSymbolIndex>=0&&($(i.icon,ee.numVerticalIconVertices,nt?Ma: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 ot=s.variableOffsets[ue];ot?(it=zr(ot.anchor,ot.width,ot.height,ot.textOffset,ot.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,a){var n=this.zoomAtLastRecencyCheck===a?1-this.zoomAdjustment(a):1;return this.zoomAtLastRecencyCheck=a,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),au=Math.pow(2,1);function ou(i){if(i.opacity===0&&!i.placed)return 0;if(i.opacity===1&&i.placed)return 4294967295;var a=i.placed?1:0,n=Math.floor(127*i.opacity);return n*$c+a*Zc+n*Qs+a*Gc+n*nu+a*Wc+n*au+a}var Ma=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,a,n,s,p){for(var f=this._bucketParts;this._currentTileIndex<i.length;)if(a.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(a.placeLayerBucketPart(f[this._currentPartIndex],this._seenCrossTileIDs,n),this._currentPartIndex++,p())return!0;return!1};var co=function(i,a,n,s,p,f,y){this.placement=new qr(i,p,f,y),this._currentPlacementIndex=a.length-1,this._forceFullPlacement=n,this._showCollisionBoxes=s,this._done=!1};co.prototype.isDone=function(){return this._done},co.prototype.continuePlacement=function(i,a,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=a[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},co.prototype.commit=function(i){return this.placement.commit(i),this.placement};var su=512/l.EXTENT/2,Xo=function(i,a,n){this.tileID=i,this.indexedSymbolInstances={},this.bucketInstanceId=n;for(var s=0;s<a.length;s++){var p=a.get(s),f=p.key;this.indexedSymbolInstances[f]||(this.indexedSymbolInstances[f]=[]),this.indexedSymbolInstances[f].push({crossTileID:p.crossTileID,coord:this.getScaledCoordinates(p,i)})}};Xo.prototype.getScaledCoordinates=function(i,a){var n=su/Math.pow(2,a.canonical.z-this.tileID.canonical.z);return{x:Math.floor((a.canonical.x*l.EXTENT+i.anchorX)*n),y:Math.floor((a.canonical.y*l.EXTENT+i.anchorY)*n)}},Xo.prototype.findMatches=function(i,a,n){for(var s=this.tileID.canonical.z<a.canonical.z?1:Math.pow(2,this.tileID.canonical.z-a.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,a),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 a=Math.round((i-this.lng)/360);if(a!==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+a),p[y.tileID.key]=y}this.indexes[n]=p}this.lng=i},vn.prototype.addBucket=function(i,a,n){if(this.indexes[i.overscaledZ]&&this.indexes[i.overscaledZ][i.key]){if(this.indexes[i.overscaledZ][i.key].bucketInstanceId===a.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(i.overscaledZ,this.indexes[i.overscaledZ][i.key])}for(var s=0;s<a.symbolInstances.length;s++)a.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(a.symbolInstances,i,p)}else{var A=y[i.scaledTo(Number(f)).key];A&&A.findMatches(a.symbolInstances,i,p)}}for(var z=0;z<a.symbolInstances.length;z++){var D=a.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 Xo(i,a.symbolInstances,a.bucketInstanceId),!0},vn.prototype.removeBucketCrossTileIDs=function(i,a){for(var n in a.indexedSymbolInstances)for(var s=0,p=a.indexedSymbolInstances[n];s<p.length;s+=1)delete this.usedCrossTileIDs[i][p[s].crossTileID]},vn.prototype.removeStaleBuckets=function(i){var a=!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],a=!0)}return a};var gn=function(){this.layerIndexes={},this.crossTileIDs=new Ii,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};gn.prototype.addLayer=function(i,a,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=a;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 a={};for(var n in i.forEach(function(s){a[s]=!0}),this.layerIndexes)a[n]||delete this.layerIndexes[n]};var Xn=function(i,a){return l.emitValidationErrors(i,a&&a.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"]),Ko=function(){var i={},a=l.styleSpec.$version;for(var n in l.styleSpec.$root){var s,p=l.styleSpec.$root[n];p.required&&(s=n==="version"?a:p.type==="array"?[]:{})!=null&&(i[n]=s)}return i}(),ni=function(i){function a(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=a.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&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.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)})},a.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)})},a.prototype.loadEmpty=function(){this.fire(new l.Event("dataloading",{dataType:"style"})),this._load(Ko,!1)},a.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"))}},a.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"}))})},a.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+'"')))}}},a.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()},a.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},a.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},a.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},a.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"}))}},a.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={}}},a.prototype._updateWorkerLayers=function(n,s){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(n),removedIds:s})},a.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},a.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},a.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)},a.prototype.updateImage=function(n,s){this.imageManager.updateImage(n,s)},a.prototype.getImage=function(n){return this.imageManager.getImage(n)},a.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)},a.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"}))},a.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},a.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}},a.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},a.prototype.setGeoJSONSourceData=function(n,s){this._checkLoaded(),this.sourceCaches[n].getSource().setData(s),this._changed=!0},a.prototype.getSource=function(n){return this.sourceCaches[n]&&this.sourceCaches[n].getSource()},a.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)}}},a.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.")))},a.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.")))},a.prototype.getLayer=function(n){return this._layers[n]},a.prototype.hasLayer=function(n){return n in this._layers},a.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.")))},a.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.")))},a.prototype.getFilter=function(n){return l.clone$1(this.getLayer(n).filter)},a.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.")))},a.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.")))},a.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.")))},a.prototype.getPaintProperty=function(n,s){return this.getLayer(n).getPaintProperty(s)},a.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.")))},a.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.")))},a.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.")))},a.prototype.getTransition=function(){return l.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},a.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})},a.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},a.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},a.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(ot,et){var Je=Xe.featureSortOrder;if(Je){var _r=Je.indexOf(ot.featureIndex);return Je.indexOf(et.featureIndex)-_r}return et.featureIndex-ot.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)},a.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):[]},a.prototype.addSourceType=function(n,s,p){return a.getSourceType(n)?p(new Error('A source type called "'+n+'" already exists.')):(a.setSourceType(n,s),s.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:n,url:s.workerSourceURL},p):p(null,null))},a.prototype.getLight=function(){return this.light.getLight()},a.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)}},a.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)))},a.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()},a.prototype._clearSource=function(n){this.sourceCaches[n].clearTiles()},a.prototype._reloadSource=function(n){this.sourceCaches[n].resume(),this.sourceCaches[n].reload()},a.prototype._updateSources=function(n){for(var s in this.sourceCaches)this.sourceCaches[s].update(n)},a.prototype._generateCollisionBoxes=function(){for(var n in this.sourceCaches)this._reloadSource(n)},a.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 co(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())},a.prototype._releaseSymbolFadeTiles=function(){for(var n in this.sourceCaches)this.sourceCaches[n].releaseSymbolFadeTiles()},a.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)},a.prototype.getGlyphs=function(n,s,p){this.glyphManager.getGlyphs(s.stacks,p)},a.prototype.getResource=function(n,s,p){return l.makeRequest(s,p)},a}(l.Evented);ni.getSourceType=function(i){return mn[i]},ni.setSourceType=function(i,a){mn[i]=a},ni.registerForPluginStateChange=l.registerForPluginStateChange;var pr=l.createLayout([{name:"a_pos",type:"Int16",components:2}]),za=Ot(`#ifdef GL_ES
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("./LoadingSpinner-W8dEafHA.js"),R=require("vue"),Ka=require("pinia");let Uo=null;typeof window<"u"&&(Uo=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"){Uo&&(this.options.div=Uo.getAttribute("data-div")||this.options.div,this.options.logo=Uo.getAttribute("data-logo")||this.options.logo,this.options.statement=Uo.getAttribute("data-statement")||this.options.statement,this.options.prefix=Uo.getAttribute("data-prefix")||this.options.prefix,this.options.suffix=Uo.getAttribute("data-suffix")||this.options.suffix),m=typeof m<"u"?m:{},Object.assign(this.options,m);const f=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,f.appendChild(O);const G=document.createElement("div");G.className="os-api-branding copyright",G.innerHTML=M,f.appendChild(G)}}},$i=Ka.defineStore("map",()=>{const m=R.ref([]),f=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 le(Re){m.value.forEach(Ye=>{Ye.id===Re.mapId&&(Ye.activePlace=Re.activeFeature)})}function H(Re){f.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 se(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:f,selectedSubCategory:b,activeMarkerPos:M,activePlace:O,addMapInstance:G,setHoveredPlace:l,setActivePlace:le,setActiveSubcatFilters:H,setSelectedSubcat:ve,setActiveMarkerPos:me,getMapById:Le,getHoveredStop:se,getActivePlace:ge}});var av={exports:{}};(function(m,f){(function(b,M){m.exports=M()})(Y.commonjsGlobal,function(){var b,M,O;function G(l,le){if(!b)b=le;else if(!M)M=le;else{var H="var sharedChunk = {}; ("+b+")(sharedChunk); ("+M+")(sharedChunk);",ve={};b(ve),O=le(ve),typeof window<"u"&&(O.workerUrl=window.URL.createObjectURL(new Blob([H],{type:"text/javascript"})))}}return G(["exports"],function(l){function le(e,t){return e(t={exports:{}},t.exports),t.exports}var H=ve;function ve(e,t,r,o){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*(o-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=o,this.p2x=r,this.p2y=o}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,o,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>(o=1))return o;for(;r<o;){if(c=this.sampleCurveX(u),Math.abs(c-e)<t)return u;e>c?r=u:o=u,u=.5*(o-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),o=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=o,this},_rotateAround:function(e,t){var r=Math.cos(e),o=Math.sin(e),u=t.y+o*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-o*(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 se=typeof self<"u"?self:{},ge=Math.pow(2,53)-1;function Re(e,t,r,o){var u=new H(e,t,r,o);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 o=r-t,u=((e-t)%o+o)%o+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 o=0,u=t;o<u.length;o+=1){var c=u[o];for(var h in c)e[h]=c[h]}return e}var dt=1;function Dt(){return dt++}function jt(){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 o={};for(var u in e)o[u]=t.call(r||this,e[u],u,e);return o}function Xr(e,t,r){var o={};for(var u in e)t.call(r||this,e[u],u,e)&&(o[u]=e[u]);return o}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 Sa(e){for(var t=0,r=0,o=e.length,u=o-1,c=void 0,h=void 0;r<o;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 Ta(e){var t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(o,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 Ia=null;function jo(e){if(Ia==null){var t=e.navigator?e.navigator.userAgent:null;Ia=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return Ia}function dn(e){try{var t=se[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch{return!1}}var Bi,Zi,qn,jn,mn=se.performance&&se.performance.now?se.performance.now.bind(se.performance):Date.now.bind(Date),Ks=se.requestAnimationFrame||se.mozRequestAnimationFrame||se.webkitRequestAnimationFrame||se.msRequestAnimationFrame,Vr=se.cancelAnimationFrame||se.mozCancelAnimationFrame||se.webkitCancelAnimationFrame||se.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=se.document.createElement("canvas"),o=r.getContext("2d");if(!o)throw new Error("failed to create canvas 2d context");return r.width=e.width,r.height=e.height,o.drawImage(e,0,0,e.width,e.height),o.getImageData(-t,-t,e.width+2*t,e.height+2*t)},resolveURL:function(e){return Bi||(Bi=se.document.createElement("a")),Bi.href=e,Bi.href},hardwareConcurrency:se.navigator&&se.navigator.hardwareConcurrency||4,get devicePixelRatio(){return se.devicePixelRatio},get prefersReducedMotion(){return!!se.matchMedia&&(Zi==null&&(Zi=se.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){!Aa&&jn&&(Di?yt(e):qn=e)}},Aa=!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),Aa=!0}se.document&&((jn=se.document.createElement("img")).onload=function(){qn&&yt(qn),qn=null,Di=!0},jn.onerror=function(){Aa=!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,o){var u=xi(e);return _i(e)?(u.path="/styles/v1"+u.path+"/sprite"+t+r,this._makeAPIURL(u,this._customAccessToken||o)):(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 o=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&&o&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,o)},Kr.prototype.canonicalizeTileURL=function(e,t){var r=xi(e);if(!r.path.match(/(^\/v4\/)/)||!r.path.match(/\.[\w]+$/))return e;var o="mapbox://tiles/";o+=r.path.replace("/v4/","");var u=r.params;return t&&(u=u.filter(function(c){return!c.match(/^access_token=/)})),u.length&&(o+="?"+u.join("&")),o},Kr.prototype.canonicalizeTileset=function(e,t){for(var r=!!t&&_i(t),o=[],u=0,c=e.tiles||[];u<c.length;u+=1){var h=c[u];Li(h)?o.push(this.canonicalizeTileURL(h,r)):o.push(h)}return o},Kr.prototype._makeAPIURL=function(e,t){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",o=xi(Rt.API_URL);if(e.protocol=o.protocol,e.authority=o.authority,e.protocol==="http"){var u=e.params.indexOf("secure");u>=0&&e.params.splice(u,1)}if(o.path!=="/"&&(e.path=""+o.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 eo=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function xi(e){var t=e.match(eo);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 Ea(e){if(!e)return null;var t=e.split(".");if(!t||t.length!==3)return null;try{return JSON.parse(decodeURIComponent(se.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=Ea(Rt.ACCESS_TOKEN);return t=r&&r.u?se.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,function(o,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 o=se.localStorage.getItem(t);o&&(this.eventData=JSON.parse(o));var u=se.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{se.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&se.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,o){var u=this;if(Rt.EVENTS_URL){var c=xi(Rt.EVENTS_URL);c.params.push("access_token="+(o||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(o)})}},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,o,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:o,timestamp:Date.now()},c)},t.prototype.processRequests=function(r){var o=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=jt()),this.postEvent(h,{skuToken:this.skuToken},function(v){v||c&&(o.success[c]=!0)},r))}},t}(bi),$o=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,o){Rt.EVENTS_URL&&Rt.ACCESS_TOKEN&&Array.isArray(r)&&r.some(function(u){return _i(u)||Li(u)})&&this.queueRequest(Date.now(),o)},t.prototype.processRequests=function(r){var o=this;if(!this.pendingRequest&&this.queue.length!==0){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var u=Ea(Rt.ACCESS_TOKEN),c=u?u.u:Rt.ACCESS_TOKEN,h=c!==this.eventData.tokenU;Kt(this.anonId)||(this.anonId=jt(),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||(o.eventData.lastSuccess=v,o.eventData.tokenU=c)},r)}},t}(bi)),Zo=$o.postTurnstileEvent.bind($o),to=new Ri,ro=to.postMapLoadEvent.bind(to),Ca=500,Go=50;function Pa(){se.caches&&!wi&&(wi=se.caches.open("mapbox-tiles"))}function io(e){var t=e.indexOf("?");return t<0?e:e.slice(0,t)}var Gn,no=1/0;function ao(){return Gn==null&&(Gn=se.OffscreenCanvas&&new se.OffscreenCanvas(1,1).getContext("2d")&&typeof se.createImageBitmap=="function"),Gn}var Wo={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(Wo);var Ho=function(e){function t(r,o,u){o===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=o,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(se.location.protocol==="blob:"?se.parent:se).location.href},nn,an,ka=function(e,t){if(!(/^file:/.test(r=e.url)||/^file:/.test(Wn())&&!/^\w+:/.test(r))){if(se.fetch&&se.Request&&se.AbortController&&se.Request.prototype.hasOwnProperty("signal"))return function(o,u){var c,h=new se.AbortController,v=new se.Request(o.url,{method:o.method||"GET",body:o.body,credentials:o.credentials,headers:o.headers,referrer:Wn(),signal:h.signal}),_=!1,x=!1,S=(c=v.url).indexOf("sku=")>0&&Li(c);o.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 C(U);var J=Date.now();se.fetch(v).then(function(W){if(W.ok){var re=S?W.clone():null;return C(W,re,J)}return u(new Ho(W.statusText,W.status,o.url))}).catch(function(W){W.code!==20&&u(new Error(W.message))})}},C=function(k,U,N){(o.type==="arrayBuffer"?k.arrayBuffer():o.type==="json"?k.json():k.text()).then(function(J){x||(U&&N&&function(W,re,ae){if(Pa(),wi){var oe={status:re.status,statusText:re.statusText,headers:new se.Headers};re.headers.forEach(function(ye,Se){return oe.headers.set(Se,ye)});var ce=Ta(re.headers.get("Cache-Control")||"");ce["no-store"]||(ce["max-age"]&&oe.headers.set("Expires",new Date(ae+1e3*ce["max-age"]).toUTCString()),new Date(oe.headers.get("Expires")).getTime()-ae<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 se.Response(ye,oe);Pa(),wi&&wi.then(function(Ae){return Ae.put(io(W.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(Pa(),!wi)return U(null);var N=io(k.url);wi.then(function(J){J.match(N).then(function(W){var re=function(ae){if(!ae)return!1;var oe=new Date(ae.headers.get("Expires")||0),ce=Ta(ae.headers.get("Cache-Control")||"");return oe>Date.now()&&!ce["no-cache"]}(W);J.delete(N),re&&J.put(N,W.clone()),U(null,W,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(o,u){var c=new se.XMLHttpRequest;for(var h in c.open(o.method||"GET",o.url,!0),o.type==="arrayBuffer"&&(c.responseType="arraybuffer"),o.headers)c.setRequestHeader(h,o.headers[h]);return o.type==="json"&&(c.responseType="text",c.setRequestHeader("Accept","application/json")),c.withCredentials=o.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(o.type==="json")try{v=JSON.parse(c.response)}catch(_){return u(_)}u(null,v,c.getResponseHeader("Cache-Control"),c.getResponseHeader("Expires"))}else u(new Ho(c.statusText,c.status,o.url))},c.send(o.body),{cancel:function(){return c.abort()}}}(e,t)},oo=function(e,t){return ka(tt(e,{type:"arrayBuffer"}),t)},rr=function(e,t){return ka(tt(e,{method:"POST"}),t)},I="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";nn=[],an=0;var E=function(e,t){if(Gi.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),an>=Rt.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:e,callback:t,cancelled:!1,cancel:function(){this.cancelled=!0}};return nn.push(r),r}an++;var o=!1,u=function(){if(!o)for(o=!0,an--;nn.length&&an<Rt.MAX_PARALLEL_IMAGE_REQUESTS;){var h=nn.shift();h.cancelled||(h.cancel=E(h.requestParameters,h.callback).cancel)}},c=oo(e,function(h,v,_,x){u(),h?t(h):v&&(ao()?function(S,T){var C=new se.Blob([new Uint8Array(S)],{type:"image/png"});se.createImageBitmap(C).then(function(k){T(null,k)}).catch(function(k){T(new Error("Could not load image because of "+k.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}(v,t):function(S,T,C,k){var U=new se.Image,N=se.URL;U.onload=function(){T(null,U),N.revokeObjectURL(U.src),U.onload=null,se.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 se.Blob([new Uint8Array(S)],{type:"image/png"});U.cacheControl=C,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 o=r[e].indexOf(t);o!==-1&&r[e].splice(o,1)}}var j=function(e,t){t===void 0&&(t={}),tt(this,t),this.type=e},Q=function(e){function t(r,o){o===void 0&&(o={}),e.call(this,"error",tt({error:r},o))}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 o=0,u=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];o<u.length;o+=1)u[o].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,o){this.message=(e?e+": ":"")+r,o&&(this.identifier=o),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 o=0,u=t;o<u.length;o+=1){var c=u[o];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,o){e.call(this,o),this.message=o,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,o=t;r<o.length;r+=1){var u=o[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,o=Ur;r<o.length;r+=1)if(!Pt(o[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=le(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 o(v){return(v=Math.round(v))<0?0:v>255?255:v}function u(v){return o(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 C=x.substr(0,S),k=x.substr(S+1,T-(S+1)).split(","),U=1;switch(C){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]),W=c(k[2]),re=W<=.5?W*(J+1):W+J-W*J,ae=2*W-re;return[o(255*h(ae,re,N+1/3)),o(255*h(ae,re,N)),o(255*h(ae,re,N-1/3)),U];default:return null}}return null}}catch{}}).parseCSSColor,Et=function(e,t,r,o){o===void 0&&(o=1),this.r=e,this.g=t,this.b=r,this.a=o};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],o=e[3];return"rgba("+Math.round(e[0])+","+Math.round(t)+","+Math.round(r)+","+o+")"},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 so=function(e,t,r,o,u){this.text=e,this.image=t,this.scale=r,this.fontStack=o,this.textColor=u},Ir=function(e){this.sections=e};Ir.fromString=function(e){return new Ir([new so(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 o=r[t];if(o.image)e.push(["image",o.image.name]);else{e.push(o.text);var u={};o.fontStack&&(u["text-font"]=["literal",o.fontStack.split(",")]),o.scale&&(u["font-scale"]=o.scale),o.textColor&&(u["text-color"]=["rgba"].concat(o.textColor.toArray())),e.push(u)}}return e};var Yr=function(e){this.name=e.name,this.available=e.available};function Ys(e,t,r,o){return typeof e=="number"&&e>=0&&e<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof r=="number"&&r>=0&&r<=255?o===void 0||typeof o=="number"&&o>=0&&o<=1?null:"Invalid rgba value ["+[e,t,r,o].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+(typeof o=="number"?[e,t,r,o]:[e,t,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function lo(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(!lo(r[t]))return!1;return!0}if(typeof e=="object"){for(var o in e)if(!lo(e[o]))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,o=0,u=e;o<u.length;o+=1){var c=nr(u[o]);if(t){if(t===c)continue;t=Me;break}t=c}return At(t||Me,r)}return ut}function uo(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(!lo(e[1]))return t.error("invalid value");var r=e[1],o=nr(r),u=t.expectedType;return o.kind!=="array"||o.N!==0||!u||u.kind!=="array"||typeof u.N=="number"&&u.N!==0||(o=u),new Nr(o,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},Zt=function(e,t){this.type=e,this.args=t};Zt.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r,o=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],o++}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],o++}r=At(c,h)}else r=Si[u];for(var _=[];o<e.length;o++){var x=t.parse(e[o],o,Me);if(!x)return null;_.push(x)}return new Zt(r,_)},Zt.prototype.evaluate=function(e){for(var t=0;t<this.args.length;t++){var r=this.args[t].evaluate(e);if(!Pt(this.type,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},Zt.prototype.eachChild=function(e){this.args.forEach(e)},Zt.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},Zt.prototype.serialize=function(){var e=this.type,t=[e.kind];if(e.kind==="array"){var r=e.itemType;if(r.kind==="string"||r.kind==="number"||r.kind==="boolean"){t.push(r.kind);var o=e.N;(typeof o=="number"||this.args.length>1)&&t.push(o)}}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 o=[],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=o[o.length-1];S.scale=v,S.font=_,S.textColor=x}else{var T=t.parse(e[c],1,Me);if(!T)return null;var C=T.type.kind;if(C!=="string"&&C!=="value"&&C!=="null"&&C!=="resolvedImage")return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");u=!0,o.push({content:T,scale:null,font:null,textColor:null})}}return new Fi(o)},Fi.prototype.evaluate=function(e){return new Ir(this.sections.map(function(t){var r=t.content.evaluate(e);return nr(r)===pt?new so("",r,null,null,null):new so(uo(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 o=r[t];e(o.content),o.scale&&e(o.scale),o.font&&e(o.font),o.textColor&&e(o.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 o=r[t];e.push(o.content.serialize());var u={};o.scale&&(u["font-scale"]=o.scale.serialize()),o.font&&(u["text-font"]=o.font.serialize()),o.textColor&&(u["text-color"]=o.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 o=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(o,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,o=0,u=this.args;o<u.length;o+=1){if(r=null,(t=u[o].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(uo(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?Yr.fromString(uo(this.args[0].evaluate(e))):uo(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 qc=["Unknown","Point","LineString","Polygon"],on=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};on.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},on.prototype.geometryType=function(){return this.feature?typeof this.feature.type=="number"?qc[this.feature.type]:this.feature.type:null},on.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},on.prototype.canonicalID=function(){return this.canonical},on.prototype.properties=function(){return this.feature&&this.feature.properties||{}},on.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,o){this.name=e,this.type=t,this._evaluate=r,this.args=o};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,o=e[0],u=zr.definitions[o];if(!u)return t.error('Unknown expression "'+o+'". 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],C=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 W=e[J],re=Array.isArray(C)?C[J-1]:C.type,ae=_.parse(W,1+U.length,re);if(!ae){N=!0;break}U.push(ae)}if(!N)if(Array.isArray(C)&&C.length!==U.length)_.error("Expected "+C.length+" arguments, but found "+U.length+" instead.");else{for(var oe=0;oe<U.length;oe++){var ce=Array.isArray(C)?C[oe]:C.type,ye=U[oe];_.concat(oe+1).checkSubtype(ce,ye.type)}if(_.errors.length===0)return new zr(o,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 jc(e,t){var r=(180+e[0])/360,o=(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(o*u*8192)]}function $c(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,o,u,c,h,v,_,x=!1,S=0,T=t.length;S<T;S++)for(var C=t[S],k=0,U=C.length;k<U-1;k++){if((c=(r=e)[0]-(o=C[k])[0])*(_=r[1]-(u=C[k+1])[1])-(v=r[0]-u[0])*(h=r[1]-o[1])==0&&c*v<=0&&h*_<=0)return!1;$c(e,C[k],C[k+1])&&(x=!x)}return x}function Zc(e,t){for(var r=0;r<t.length;r++)if(Qs(e,t[r]))return!0;return!1}function nu(e,t,r,o){var u=o[0]-r[0],c=o[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 Gc(e,t,r){for(var o=0,u=r;o<u.length;o+=1)for(var c=u[o],h=0;h<c.length-1;++h)if((T=[(S=c[h+1])[0]-(x=c[h])[0],S[1]-x[1]])[0]*(C=[(_=t)[0]-(v=e)[0],_[1]-v[1]])[1]-T[1]*C[0]!=0&&nu(v,_,x,S)&&nu(x,S,v,_))return!0;var v,_,x,S,T,C;return!1}function au(e,t){for(var r=0;r<e.length;++r)if(!Qs(e[r],t))return!1;for(var o=0;o<e.length-1;++o)if(Gc(e[o],e[o+1],t))return!1;return!0}function ou(e,t){for(var r=0;r<t.length;r++)if(au(e,t[r]))return!0;return!1}function Ma(e,t,r){for(var o=[],u=0;u<e.length;u++){for(var c=[],h=0;h<e[u].length;h++){var v=jc(e[u][h],r);qr(t,v),c.push(v)}o.push(c)}return o}function el(e,t,r){for(var o=[],u=0;u<e.length;u++){var c=Ma(e[u],t,r);o.push(c)}return o}function co(e,t,r,o){if(e[0]<r[0]||e[0]>r[2]){var u=.5*o,c=e[0]-r[0]>u?-o:r[0]-e[0]>u?o:0;c===0&&(c=e[0]-r[2]>u?-o:r[2]-e[0]>u?o:0),e[0]+=c}qr(t,e)}function su(e,t,r,o){for(var u=8192*Math.pow(2,o.z),c=[8192*o.x,8192*o.y],h=[],v=0,_=e;v<_.length;v+=1)for(var x=0,S=_[v];x<S.length;x+=1){var T=S[x],C=[T.x+c[0],T.y+c[1]];co(C,t,r,u),h.push(C)}return h}function Xo(e,t,r,o){for(var u,c=8192*Math.pow(2,o.z),h=[8192*o.x,8192*o.y],v=[],_=0,x=e;_<x.length;_+=1){for(var S=[],T=0,C=x[_];T<C.length;T+=1){var k=C[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 W=0,re=J[N];W<re.length;W+=1)co(re[W],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 o=t.parse(r["case-sensitive"]!==void 0&&r["case-sensitive"],1,Ee);if(!o)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(o,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(o){r&&!Xn(o,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(lo(e[1])){var r=e[1];if(r.type==="FeatureCollection")for(var o=0;o<r.features.length;++o){var u=r.features[o].geometry.type;if(u==="Polygon"||u==="MultiPolygon")return new Ii(r,r.features[o].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 o=[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=Ma(r.coordinates,u,c),v=su(t.geometry(),o,u,c);if(!Hn(o,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(),o,u,c);if(!Hn(o,u))return!1;for(var C=0,k=T;C<k.length;C+=1)if(!Zc(k[C],S))return!1}return!0}(e,this.geometries);if(e.geometryType()==="LineString")return function(t,r){var o=[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=Ma(r.coordinates,u,c),v=Xo(t.geometry(),o,u,c);if(!Hn(o,u))return!1;for(var _=0,x=v;_<x.length;_+=1)if(!au(x[_],h))return!1}if(r.type==="MultiPolygon"){var S=el(r.coordinates,u,c),T=Xo(t.geometry(),o,u,c);if(!Hn(o,u))return!1;for(var C=0,k=T;C<k.length;C+=1)if(!ou(k[C],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,o,u){t===void 0&&(t=[]),o===void 0&&(o=new Ue),u===void 0&&(u=[]),this.registry=e,this.path=t,this.key=t.map(function(c){return"["+c+"]"}).join(""),this.scope=o,this.errors=u,this.expectedType=r};function Ko(e,t){for(var r,o=e.length-1,u=0,c=o,h=0;u<=c;)if((r=e[h=Math.floor((u+c)/2)])<=t){if(h===o||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,o,u){return u===void 0&&(u={}),t?this.concat(t,r,o)._parse(e,u):this._parse(e,u)},xn.prototype._parse=function(e,t){function r(x,S,T){return T==="assert"?new Zt(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 o=e[0];if(typeof o!="string")return this.error("Expression name must be a string, but found "+typeof o+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var u=this.registry[o];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 Zt,C=!0;return S.eachChild(function(k){C=T?C&&x(k):C&&k instanceof Nr}),!!C&&vn(S)&&Xn(S,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(c)){var _=new on;try{c=new Nr(c.type,c.evaluate(_))}catch(x){return this.error(x.message),null}}return c}return this.error('Unknown expression "'+o+'". 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 o=typeof e=="number"?this.path.concat(e):this.path,u=r?this.scope.concat(r):this.scope;return new xn(this.registry,o,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 o=""+this.key+t.map(function(u){return"["+u+"]"}).join("");this.errors.push(new be(o,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 o=0,u=r;o<u.length;o+=1){var c=u[o],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 o=[],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(o.length&&o[o.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,o.push([h,S])}return new ni(u,r,o)},ni.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(t.length===1)return r[0].evaluate(e);var o=this.input.evaluate(e);if(o<=t[0])return r[0].evaluate(e);var u=t.length;return o>=t[u-1]?r[u-1].evaluate(e):r[Ko(t,o)].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 za=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(o,u){return pr(o,t[u],r)})}}),lu=6/29*3*(6/29),Wc=Math.PI/180,Hc=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),o=nl(e.b),u=tl((.4124564*t+.3575761*r+.1804375*o)/.95047),c=tl((.2126729*t+.7151522*r+.072175*o)/1);return{l:116*c-16,a:500*(u-c),b:200*(c-tl((.0193339*t+.119192*r+.9503041*o)/1.08883)),alpha:e.a}}function cu(e){var t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,o=isNaN(e.b)?t:t-e.b/200;return t=1*rl(t),r=.95047*rl(r),o=1.08883*rl(o),new Et(il(3.2404542*r-1.5371385*t-.4985314*o),il(-.969266*r+1.8760108*t+.041556*o),il(.0556434*r-.2040259*t+1.0572252*o),e.alpha)}function Xc(e,t,r){var o=t-e;return e+r*(o>180||o<-180?o-360*Math.round(o/360):o)}var po={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)}}},ho={forward:function(e){var t=uu(e),r=t.l,o=t.a,u=t.b,c=Math.atan2(u,o)*Hc;return{h:c<0?c+360:c,c:Math.sqrt(o*o+u*u),l:r,alpha:e.a}},reverse:function(e){var t=e.h*Wc,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:Xc(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:po,hcl:ho}),Br=function(e,t,r,o,u){this.type=e,this.operator=t,this.interpolation=r,this.input=o,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 al(e,t,r,o){var u=o-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,o){var u=0;if(e.name==="exponential")u=al(t,e.base,r,o);else if(e.name==="linear")u=al(t,1,r,o);else if(e.name==="cubic-bezier"){var c=e.controlPoints;u=new H(c[0],c[1],c[2],c[3]).solve(al(t,1,r,o))}return u},Br.parse=function(e,t){var r=e[0],o=e[1],u=e[2],c=e.slice(3);if(!Array.isArray(o)||o.length===0)return t.error("Expected an interpolation type expression.",1);if(o[0]==="linear")o={name:"linear"};else if(o[0]==="exponential"){var h=o[1];if(typeof h!="number")return t.error("Exponential interpolation requires a numeric base.",1,1);o={name:"exponential",base:h}}else{if(o[0]!=="cubic-bezier")return t.error("Unknown interpolation type "+String(o[0]),1,0);var v=o.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);o={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],C=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(C,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,o,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 o=this.input.evaluate(e);if(o<=t[0])return r[0].evaluate(e);var u=t.length;if(o>=t[u-1])return r[u-1].evaluate(e);var c=Ko(t,o),h=Br.interpolationFactor(this.interpolation,o,t[c],t[c+1]),v=r[c].evaluate(e),_=r[c+1].evaluate(e);return this.operator==="interpolate"?za[this.type.kind.toLowerCase()](v,_,h):this.operator==="interpolate-hcl"?ho.reverse(ho.interpolate(ho.forward(v),ho.forward(_),h)):po.reverse(po.interpolate(po.forward(v),po.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,o=t.expectedType;o&&o.kind!=="value"&&(r=o);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 _=o&&u.some(function(x){return Pt(o,x.type)});return new bn(_?Me:r,u)},bn.prototype.evaluate=function(e){for(var t,r=null,o=0,u=0,c=this.args;u<c.length&&(o++,(r=c[u].evaluate(e))&&r instanceof Yr&&!r.available&&(t||(t=r.name),r=null,o===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=[],o=1;o<e.length-1;o+=2){var u=e[o];if(typeof u!="string")return t.error("Expected string, but found "+typeof u+" instead.",o);if(/[^a-zA-Z0-9_]/.test(u))return t.error("Variable names must contain only alphanumeric characters or '_'.",o);var c=t.parse(e[o+1],o+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 o=r[t];e.push(o[0],o[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),o=t.parse(e[2],2,At(t.expectedType||Me));return r&&o?new Kn(o.type.itemType,r,o):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),o=t.parse(e[2],2,Me);return r&&o?ir(r.type,[Ee,Be,de,Oe,Me])?new Jn(r,o):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),o=t.parse(e[2],2,Me);if(!r||!o)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,o,u):null}return new Sn(r,o)},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 o=this.fromIndex.evaluate(e);return r.indexOf(t,o)}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,o,u,c){this.inputType=e,this.type=t,this.input=r,this.cases=o,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,o;t.expectedType&&t.expectedType.kind!=="value"&&(o=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 C=T[S];if(typeof C!="number"&&typeof C!="string")return x.error("Branch labels must be numbers or strings.");if(typeof C=="number"&&Math.abs(C)>Number.MAX_SAFE_INTEGER)return x.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof C=="number"&&Math.floor(C)!==C)return x.error("Numeric branch labels must be integer values.");if(r){if(x.checkSubtype(r,nr(C)))return null}else r=nr(C);if(u[String(C)]!==void 0)return x.error("Branch labels must be unique.");u[String(C)]=c.length}var k=t.parse(_,h,o);if(!k)return null;o=o||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,o);return N?U.type.kind!=="value"&&t.concat(1).checkSubtype(r,U.type)?null:new Yn(r,o,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=[],o={},u=0,c=Object.keys(this.cases).sort();u<c.length;u+=1){var h=c[u];(T=o[this.cases[h]])===void 0?(o[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],C=S[1];t.push(C.length===1?v(C[0]):C.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 o=[],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;o.push([c,h]),r=r||h.type}var v=t.parse(e[e.length-1],e.length-1,r);return v?new Qn(r,o,v):null},Qn.prototype.evaluate=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var o=r[t],u=o[1];if(o[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 o=r[t],u=o[1];e(o[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,o){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=o};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,o){return o.compare(t,r)===0}function Ot(e,t,r){var o=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)+"'.");o&&(_.type.kind==="value"&&x.type.kind!=="value"?_=new Zt(x.type,[_]):_.type.kind!=="value"&&x.type.kind==="value"&&(x=new Zt(_.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(o&&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&&!o&&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),o=t.parse(e[2],2,de);if(!r||!o)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,o,u):null}return new Tn(r.type,r,o)},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 o=this.endIndex.evaluate(e);return t.slice(r,o)}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 Kc=Ot("==",function(e,t,r){return t===r},fu),Jo=Ot("!=",function(e,t,r){return t!==r},function(e,t,r,o){return!fu(0,t,r,o)}),du=Ot("<",function(e,t,r){return t<r},function(e,t,r,o){return o.compare(t,r)<0}),mu=Ot(">",function(e,t,r){return t>r},function(e,t,r,o){return o.compare(t,r)>0}),yu=Ot("<=",function(e,t,r){return t<=r},function(e,t,r,o){return o.compare(t,r)<=0}),vu=Ot(">=",function(e,t,r){return t>=r},function(e,t,r,o){return o.compare(t,r)>=0}),ea=function(e,t,r,o,u){this.type=Be,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=o,this.maxFractionDigits=u};ea.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 o=e[2];if(typeof o!="object"||Array.isArray(o))return t.error("NumberFormat options argument must be an object.");var u=null;if(o.locale&&!(u=t.parse(o.locale,1,Be)))return null;var c=null;if(o.currency&&!(c=t.parse(o.currency,1,Be)))return null;var h=null;if(o["min-fraction-digits"]&&!(h=t.parse(o["min-fraction-digits"],1,de)))return null;var v=null;return o["max-fraction-digits"]&&!(v=t.parse(o["max-fraction-digits"],1,de))?null:new ea(r,u,c,h,v)},ea.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))},ea.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)},ea.prototype.outputDefined=function(){return!1},ea.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 ta={"==":Kc,"!=":Jo,">":mu,"<":du,">=":vu,"<=":yu,array:Zt,at:Kn,boolean:Zt,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:Zt,"number-format":ea,object:Zt,slice:Tn,step:ni,string:Zt,"to-boolean":Ti,"to-color":Ti,"to-number":Ti,"to-string":Ti,var:_n,within:Ii};function gu(e,t){var r=t[0],o=t[1],u=t[2],c=t[3];r=r.evaluate(e),o=o.evaluate(e),u=u.evaluate(e);var h=c?c.evaluate(e):1,v=Ys(r,o,u,h);if(v)throw new Ar(v);return new Et(r/255*h,o/255*h,u/255*h,h)}function _u(e,t){return e in t}function ol(e,t){var r=t[e];return r===void 0?null:r}function ra(e){return{type:e}}function xu(e){return{result:"success",value:e}}function ia(e){return{result:"error",value:e}}function na(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 fo(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 Yo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Jc(e){return e}function Ba(e,t,r){return e!==void 0?e:t!==void 0?t:r!==void 0?r:void 0}function wu(e,t,r,o,u){return Ba(typeof r===u?o[r]:void 0,e.default,t.default)}function Yc(e,t,r){if(Ut(r)!=="number")return Ba(e.default,t.default);var o=e.stops.length;if(o===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[o-1][0])return e.stops[o-1][1];var u=Ko(e.stops.map(function(c){return c[0]}),r);return e.stops[u][1]}function Su(e,t,r){var o=e.base!==void 0?e.base:1;if(Ut(r)!=="number")return Ba(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=Ko(e.stops.map(function(T){return T[0]}),r),h=function(T,C,k,U){var N=U-k,J=T-k;return N===0?0:C===1?J/N:(Math.pow(C,J)-1)/(Math.pow(C,N)-1)}(r,o,e.stops[c][0],e.stops[c+1][0]),v=e.stops[c][1],_=e.stops[c+1][1],x=za[t.type]||Jc;if(e.colorSpace&&e.colorSpace!=="rgb"){var S=pu[e.colorSpace];x=function(T,C){return S.reverse(S.interpolate(S.forward(T),S.forward(C),h))}}return typeof v.evaluate=="function"?{evaluate:function(){for(var T=[],C=arguments.length;C--;)T[C]=arguments[C];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 Qo(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),Ba(r,e.default,t.default)}zr.register(ta,{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 ol(t[0].evaluate(e),e.properties())}],[[Be,ut],function(e,t){var r=t[1];return ol(t[0].evaluate(e),r.evaluate(e))}]]},"feature-state":[Me,[Be],function(e,t){return ol(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,ra(de),function(e,t){for(var r=0,o=0,u=t;o<u.length;o+=1)r+=u[o].evaluate(e);return r}],"*":[de,ra(de),function(e,t){for(var r=1,o=0,u=t;o<u.length;o+=1)r*=u[o].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,ra(de),function(e,t){return Math.min.apply(Math,t.map(function(r){return r.evaluate(e)}))}],max:[de,ra(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],o=t[1];return e.properties()[r.value]===o.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],o=t[1],u=e.properties()[r.value],c=o.value;return typeof u==typeof c&&u<c}],"filter-id-<":[Ee,[Me],function(e,t){var r=t[0],o=e.id(),u=r.value;return typeof o==typeof u&&o<u}],"filter->":[Ee,[Be,Me],function(e,t){var r=t[0],o=t[1],u=e.properties()[r.value],c=o.value;return typeof u==typeof c&&u>c}],"filter-id->":[Ee,[Me],function(e,t){var r=t[0],o=e.id(),u=r.value;return typeof o==typeof u&&o>u}],"filter-<=":[Ee,[Be,Me],function(e,t){var r=t[0],o=t[1],u=e.properties()[r.value],c=o.value;return typeof u==typeof c&&u<=c}],"filter-id-<=":[Ee,[Me],function(e,t){var r=t[0],o=e.id(),u=r.value;return typeof o==typeof u&&o<=u}],"filter->=":[Ee,[Be,Me],function(e,t){var r=t[0],o=t[1],u=e.properties()[r.value],c=o.value;return typeof u==typeof c&&u>=c}],"filter-id->=":[Ee,[Me],function(e,t){var r=t[0],o=e.id(),u=r.value;return typeof o==typeof u&&o>=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],o=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],o.value,0,o.value.length-1)}],all:{type:Ee,overloads:[[[Ee,Ee],function(e,t){var r=t[1];return t[0].evaluate(e)&&r.evaluate(e)}],[ra(Ee),function(e,t){for(var r=0,o=t;r<o.length;r+=1)if(!o[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)}],[ra(Ee),function(e,t){for(var r=0,o=t;r<o.length;r+=1)if(o[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,ra(Me),function(e,t){return t.map(function(r){return uo(r.evaluate(e))}).join("")}],"resolved-locale":[Be,[vt],function(e,t){return t[0].evaluate(e).resolvedLocale()}]});var Da=function(e,t){this.expression=e,this._warningHistory={},this._evaluator=new on,this._defaultValue=t?function(r){return r.type==="color"&&Yo(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 mo(e){return Array.isArray(e)&&e.length>0&&typeof e[0]=="string"&&e[0]in ta}function es(e,t){var r=new xn(ta,[],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),o=r.parse(e,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return o?xu(new Da(o,t)):ia(r.errors)}Da.prototype.evaluateWithoutErrorHandling=function(e,t,r,o,u,c){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=o,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=c,this.expression.evaluate(this._evaluator)},Da.prototype.evaluate=function(e,t,r,o,u,c){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=o,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 yo=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!=="constant"&&!gn(t.expression)};yo.prototype.evaluateWithoutErrorHandling=function(e,t,r,o,u,c){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,o,u,c)},yo.prototype.evaluate=function(e,t,r,o,u,c){return this._styleExpression.evaluate(e,t,r,o,u,c)};var La=function(e,t,r,o){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent=e!=="camera"&&!gn(t.expression),this.interpolationType=o};function Tu(e,t){if((e=es(e,t)).result==="error")return e;var r=e.value.expression,o=vn(r);if(!o&&!na(t))return ia([new be("","data expressions not supported")]);var u=Xn(r,["zoom"]);if(!u&&!bu(t))return ia([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 C=h(T);C instanceof be?_=C:!_&&C?_=new be("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):_&&C&&_!==C&&(_=new be("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),_}(r);return c||u?c instanceof be?ia([c]):c instanceof Br&&!fo(t)?ia([new be("",'"interpolate" expressions cannot be used with this property')]):xu(c?new La(o?"camera":"composite",e.value,c.labels,c instanceof Br?c.interpolation:void 0):new yo(o?"constant":"source",e.value)):ia([new be("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}La.prototype.evaluateWithoutErrorHandling=function(e,t,r,o,u,c){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,o,u,c)},La.prototype.evaluate=function(e,t,r,o,u,c){return this._styleExpression.evaluate(e,t,r,o,u,c)},La.prototype.interpolationFactor=function(e,t,r){return this.interpolationType?Br.interpolationFactor(this.interpolationType,e,t,r):0};var Ra=function(e,t){this._parameters=e,this._specification=t,xe(this,function r(o,u){var c,h,v,_=u.type==="color",x=o.stops&&typeof o.stops[0][0]=="object",S=x||!(x||o.property!==void 0),T=o.type||(fo(u)?"exponential":"interval");if(_&&((o=xe({},o)).stops&&(o.stops=o.stops.map(function(ke){return[ke[0],Et.parse(ke[1])]})),o.default=Et.parse(o.default?o.default:u.default)),o.colorSpace&&o.colorSpace!=="rgb"&&!pu[o.colorSpace])throw new Error("Unknown color space: "+o.colorSpace);if(T==="exponential")c=Su;else if(T==="interval")c=Yc;else if(T==="categorical"){c=wu,h=Object.create(null);for(var C=0,k=o.stops;C<k.length;C+=1){var U=k[C];h[U[0]]=U[1]}v=typeof o.stops[0][0]}else{if(T!=="identity")throw new Error('Unknown function type "'+T+'"');c=Qo}if(x){for(var N={},J=[],W=0;W<o.stops.length;W++){var re=o.stops[W],ae=re[0].zoom;N[ae]===void 0&&(N[ae]={zoom:ae,type:o.type,property:o.property,default:o.default,stops:[]},J.push(ae)),N[ae].stops.push([re[0].value,re[1]])}for(var oe=[],ce=0,ye=J;ce<ye.length;ce+=1){var Se=ye[ce];oe.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:oe.map(function(ke){return ke[0]}),evaluate:function(ke,We){var ze=ke.zoom;return Su({stops:oe,base:o.base},u,ze).evaluate(ze,We)}}}if(S){var $e=T==="exponential"?{name:"exponential",base:o.base!==void 0?o.base:1}:null;return{kind:"camera",interpolationType:$e,interpolationFactor:Br.interpolationFactor.bind(void 0,$e),zoomStops:o.stops.map(function(ke){return ke[0]}),evaluate:function(ke){return c(o,u,ke.zoom,h,v)}}}return{kind:"source",evaluate:function(ke,We){var ze=We&&We.properties?We.properties[o.property]:void 0;return ze===void 0?Ba(o.default,u.default):c(o,u,ze,h,v)}}}(this._parameters,this._specification))};function Oi(e){var t=e.key,r=e.value,o=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=o[S]||o["*"],C=void 0;if(u[S])C=u[S];else if(o[S])C=gt;else if(u["*"])C=u["*"];else{if(!o["*"]){v.push(new Z(t,r[x],'unknown property "'+x+'"'));continue}C=gt}v=v.concat(C({key:(t&&t+".")+x,value:r[x],valueSpec:T,style:c,styleSpec:h,object:r,objectKey:x},r))}for(var k in o)u[k]||o[k].required&&o[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,o=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:o,styleSpec:u,key:c+"["+x+"]"}));return _}function Au(e){var t=e.key,r=e.value,o=e.valueSpec,u=Ut(r);return u==="number"&&r!=r&&(u="NaN"),u!=="number"?[new Z(t,r,"number expected, "+u+" found")]:"minimum"in o&&r<o.minimum?[new Z(t,r,r+" is less than the minimum value "+o.minimum)]:"maximum"in o&&r>o.maximum?[new Z(t,r,r+" is greater than the maximum value "+o.maximum)]:[]}function Eu(e){var t,r,o,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&&!fo(e.valueSpec)&&S.push(new Z(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(_&&!na(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(o&&o>we(N[0].zoom))return[new Z(J,N[0].zoom,"stop zoom values must appear in ascending order")];we(N[0].zoom)!==o&&(o=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:C}}))}else U=U.concat(C({key:J+"[0]",value:N[0],style:k.style,styleSpec:k.styleSpec},N));return mo(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 C(k,U){var N=Ut(k.value),J=we(k.value),W=k.value!==null?k.value:U;if(t){if(N!==t)return[new Z(k.key,W,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,W,"stop domain value must be a number, string, or boolean")];if(N!=="number"&&c!=="categorical"){var re="number expected, "+N+" found";return na(u)&&c===void 0&&(re+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Z(k.key,W,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,W,"stop domain values must appear in ascending order")]:(r=J,c==="categorical"&&J in h?[new Z(k.key,W,"stop domain values must be unique")]:(h[J]=!0,[])):[new Z(k.key,W,"integer expected, found "+J)]}}function aa(e){var t=(e.expressionContext==="property"?Tu:es)(fe(e.value),e.valueSpec);if(t.result==="error")return t.value.map(function(o){return new Z(""+e.key+o.key,e.value,o.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 vo(e){var t=e.key,r=e.value,o=e.valueSpec,u=[];return Array.isArray(o.values)?o.values.indexOf(we(r))===-1&&u.push(new Z(t,r,"expected one of ["+o.values.join(", ")+"], "+JSON.stringify(r)+" found")):Object.keys(o.values).indexOf(we(r))===-1&&u.push(new Z(t,r,"expected one of ["+Object.keys(o.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 o=r[t];if(!ts(o)&&typeof o!="boolean")return!1}return!0;default:return!0}}Ra.deserialize=function(e){return new Ra(e._parameters,e._specification)},Ra.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,o,u){return t.value.evaluate(r,o,{},u)},needGeometry:function r(o){if(!Array.isArray(o))return!1;if(o[0]==="within")return!0;for(var u=1;u<o.length;u++)if(r(o[u]))return!0;return!1}(e)}}function Qc(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(Qc)]]:["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))?aa(xe({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(r){var o=r.value,u=r.key;if(Ut(o)!=="array")return[new Z(u,o,"array expected, "+Ut(o)+" found")];var c,h=r.styleSpec,v=[];if(o.length<1)return[new Z(u,o,"filter array must have at least 1 element")];switch(v=v.concat(vo({key:u+"[0]",value:o[0],valueSpec:h.filter_operator,style:r.style,styleSpec:r.styleSpec})),we(o[0])){case"<":case"<=":case">":case">=":o.length>=2&&we(o[1])==="$type"&&v.push(new Z(u,o,'"$type" cannot be use with operator "'+o[0]+'"'));case"==":case"!=":o.length!==3&&v.push(new Z(u,o,'filter array for operator "'+o[0]+'" must have 3 elements'));case"in":case"!in":o.length>=2&&(c=Ut(o[1]))!=="string"&&v.push(new Z(u+"[1]",o[1],"string expected, "+c+" found"));for(var _=2;_<o.length;_++)c=Ut(o[_]),we(o[1])==="$type"?v=v.concat(vo({key:u+"["+_+"]",value:o[_],valueSpec:h.geometry_type,style:r.style,styleSpec:r.styleSpec})):c!=="string"&&c!=="number"&&c!=="boolean"&&v.push(new Z(u+"["+_+"]",o[_],"string, number, or boolean expected, "+c+" found"));break;case"any":case"all":case"none":for(var x=1;x<o.length;x++)v=v.concat(t({key:u+"["+x+"]",value:o[x],style:r.style,styleSpec:r.styleSpec}));break;case"has":case"!has":c=Ut(o[1]),o.length!==2?v.push(new Z(u,o,'filter array for "'+o[0]+'" operator must have 2 elements')):c!=="string"&&v.push(new Z(u+"[1]",o[1],"string expected, "+c+" found"));break;case"within":c=Ut(o[1]),o.length!==2?v.push(new Z(u,o,'filter array for "'+o[0]+'" operator must have 2 elements')):c!=="object"&&v.push(new Z(u+"[1]",o[1],"object expected, "+c+" found"))}return v}(e)}function cl(e,t){var r=e.key,o=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:o,styleSpec:u});var x,S=e.valueSpec||v[h];if(!S)return[new Z(r,c,'unknown property "'+h+'"')];if(Ut(c)==="string"&&na(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"&&o&&!o.glyphs&&T.push(new Z(r,c,'use of "text-field" requires a style "glyphs" property')),h==="text-font"&&Yo(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:o,styleSpec:u,expressionContext:"property",propertyType:t,propertyKey:h}))}function pl(e){return cl(e,"paint")}function go(e){return cl(e,"layout")}function ku(e){var t=[],r=e.value,o=e.key,u=e.style,c=e.styleSpec;r.type||r.ref||t.push(new Z(o,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(o,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(o,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(o,r.ref,"ref cannot reference another ref layer")):v=we(h.type):t.push(new Z(o,r.ref,'ref layer "'+_+'" not found'));else if(v!=="background")if(r.source){var C=u.sources&&u.sources[r.source],k=C&&we(C.type);C?k==="vector"&&v==="raster"?t.push(new Z(o,r.source,'layer "'+r.id+'" requires a raster source')):k==="raster"&&v!=="raster"?t.push(new Z(o,r.source,'layer "'+r.id+'" requires a vector source')):k!=="vector"||r["source-layer"]?k==="raster-dem"&&v!=="hillshade"?t.push(new Z(o,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):v!=="line"||!r.paint||!r.paint["line-gradient"]||k==="geojson"&&C.lineMetrics||t.push(new Z(o,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):t.push(new Z(o,r,'layer "'+r.id+'" must specify a "source-layer"')):t.push(new Z(o,r.source,'source "'+r.source+'" not found'))}else t.push(new Z(o,r,'missing required property "source"'));return t=t.concat(Oi({key:o,value:r,valueSpec:c.layer,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return gt({key:o+".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 go(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 oa(e){var t=e.value,r=e.key,o=Ut(t);return o!=="string"?[new Z(r,t,"string expected, "+o+" found")]:[]}var Gt={promoteId:function(e){var t=e.key,r=e.value;if(Ut(r)==="string")return oa({key:t,value:r});var o=[];for(var u in r)o.push.apply(o,oa({key:t+"."+u,value:r[u]}));return o}};function as(e){var t=e.value,r=e.key,o=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:o["source_"+h.replace("-","_")],style:e.style,styleSpec:o,objectElementValidators:Gt});case"geojson":if(c=Oi({key:r,value:t,valueSpec:o.source_geojson,style:u,styleSpec:o,objectElementValidators:Gt}),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,aa({key:r+"."+v+".map",value:_[1],expressionContext:"cluster-map"})),c.push.apply(c,aa({key:r+"."+v+".reduce",value:S,expressionContext:"cluster-reduce"}))}return c;case"video":return Oi({key:r,value:t,valueSpec:o.source_video,style:u,styleSpec:o});case"image":return Oi({key:r,value:t,valueSpec:o.source_image,style:u,styleSpec:o});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 vo({key:r+".type",value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function sa(e){var t=e.value,r=e.styleSpec,o=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(_&&o[_[1]]&&o[_[1]].transition?gt({key:v,value:t[v],valueSpec:r.transition,style:u,styleSpec:r}):o[v]?gt({key:v,value:t[v],valueSpec:o[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,o=Ut(t);return o!=="boolean"?[new Z(r,t,"boolean expected, "+o+" found")]:[]},number:Au,color:function(e){var t=e.key,r=e.value,o=Ut(r);return o!=="string"?[new Z(t,r,"color expected, "+o+" found")]:mt(r)===null?[new Z(t,r,'color expected, "'+r+'" found')]:[]},constants:ne,enum:vo,filter:ul,function:Eu,layer:ku,object:Oi,source:as,light:sa,string:oa,formatted:function(e){return oa(e).length===0?[]:aa(e)},resolvedImage:function(e){return oa(e).length===0?[]:aa(e)}};function gt(e){var t=e.value,r=e.valueSpec,o=e.styleSpec;return r.expression&&Yo(we(t))?Eu(e):r.expression&&mo(fe(t))?aa(e):r.type&&An[r.type]?An[r.type](e):Oi(xe({},e,{valueSpec:r.type?o[r.type]:r}))}function Nt(e){var t=e.value,r=e.key,o=oa(e);return o.length||(t.indexOf("{fontstack}")===-1&&o.push(new Z(r,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&o.push(new Z(r,t,'"glyphs" url must include a "{range}" token'))),o}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}))),_o(r)}function _o(e){return[].concat(e).sort(function(t,r){return t.line-r.line})}function Fa(e){return function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return _o(e.apply(this,t))}}fi.source=Fa(as),fi.light=Fa(sa),fi.layer=Fa(ku),fi.filter=Fa(ul),fi.paintProperty=Fa(pl),fi.layoutProperty=Fa(go);var xo=fi,ep=xo.light,tp=xo.paintProperty,bo=xo.layoutProperty;function wo(e,t){var r=!1;if(t&&t.length)for(var o=0,u=t;o<u.length;o+=1)e.fire(new Q(new Error(u[o].message))),r=!0;return r}var sn=dr;function dr(e,t,r){var o=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];o.push(h===v?null:u.subarray(h,v))}var _=u[3+o.length+1];this.keys=u.subarray(u[3+o.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++)o.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,o,u){this._forEachCell(t,r,o,u,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(o),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,o,u,c){this.cells[u].push(c)},dr.prototype.query=function(e,t,r,o,u){var c=this.min,h=this.max;if(e<=c&&t<=c&&h<=r&&h<=o&&!u)return Array.prototype.slice.call(this.keys);var v=[];return this._forEachCell(e,t,r,o,this._queryCell,v,{},u),v},dr.prototype._queryCell=function(e,t,r,o,u,c,h,v){var _=this.cells[u];if(_!==null)for(var x=this.keys,S=this.bboxes,T=0;T<_.length;T++){var C=_[T];if(h[C]===void 0){var k=4*C;(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]&&o>=S[k+1])?(h[C]=!0,c.push(x[C])):h[C]=!1}}},dr.prototype._forEachCell=function(e,t,r,o,u,c,h,v){for(var _=this._convertToCellCoord(e),x=this._convertToCellCoord(t),S=this._convertToCellCoord(r),T=this._convertToCellCoord(o),C=_;C<=S;C++)for(var k=x;k<=T;k++){var U=this.d*k+C;if((!v||v(this._convertFromCellCoord(C),this._convertFromCellCoord(k),this._convertFromCellCoord(C+1),this._convertFromCellCoord(k+1)))&&u.call(this,e,t,r,o,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,o=0;o<this.cells.length;o++)r+=this.cells[o].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 So=se.ImageData,Mu=se.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 ai 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",Ra),Ve("StyleExpression",Da,{omit:["_evaluator"]}),Ve("ZoomDependentExpression",La),Ve("ZoomConstantExpression",yo),Ve("CompoundExpression",zr,{omit:["_evaluate"]}),ta)ta[ai]._classRegistryKey||Ve("Expression_"+ai,ta[ai]);function os(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor&&e.constructor.name==="ArrayBuffer")}function Oa(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(os(e)||Oa(e))return t&&t.push(e),e;if(ArrayBuffer.isView(e)){var r=e;return t&&t.push(r.buffer),r}if(e instanceof So)return t&&t.push(e.data.buffer),e;if(Array.isArray(e)){for(var o=[],u=0,c=e;u<c.length;u+=1)o.push(Vi(c[u],t));return o}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 oi(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||os(e)||Oa(e)||ArrayBuffer.isView(e)||e instanceof So)return e;if(Array.isArray(e))return e.map(oi);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 o=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];o[h]=hr[t].shallow.indexOf(h)>=0?v:oi(v)}}return o}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 To(){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",To(),ln&&oo({url:ln},function(e){e?zu(e):(li="loaded",To())})},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 o=0,u=t;o<u.length;o+=1)if(!si(u[o].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,o){if(Yo(r))return new Ra(r,o);if(mo(r)){var u=Tu(r,o);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"&&o.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 la(this.property,this.value,t,tt({},e.transition,this.transition),e.now)},Ei.prototype.untransitioned=function(){return new la(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 o=r[t],u=this.getValue(o);u!==void 0&&(e[o]=u);var c=this.getTransition(o);c!==void 0&&(e[o+"-transition"]=c)}return e},Dr.prototype.transitioned=function(e,t){for(var r=new En(this._properties),o=0,u=Object.keys(this._values);o<u.length;o+=1){var c=u[o];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 o=r[t];e._values[o]=this._values[o].untransitioned()}return e};var la=function(e,t,r,o,u){this.property=e,this.value=t,this.begin=u+o.delay||0,this.end=this.begin+o.duration||0,e.specification.transition&&(o.delay||o.duration)&&(this.prior=r)};la.prototype.possiblyEvaluate=function(e,t,r){var o=e.now||0,u=this.value.possiblyEvaluate(e,t,r),c=this.prior;if(c){if(o>this.end)return this.prior=null,u;if(this.value.isDataDriven())return this.prior=null,u;if(o<this.begin)return c.possiblyEvaluate(e,t,r);var h=(o-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 o=new Io(this._properties),u=0,c=Object.keys(this._values);u<c.length;u+=1){var h=c[u];o._values[h]=this._values[h].possiblyEvaluate(e,t,r)}return o},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 o=r[t],u=this.getValue(o);u!==void 0&&(e[o]=u)}return e},Ni.prototype.possiblyEvaluate=function(e,t,r){for(var o=new Io(this._properties),u=0,c=Object.keys(this._values);u<c.length;u+=1){var h=c[u];o._values[h]=this._values[h].possiblyEvaluate(e,t,r)}return o};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,o){return this.property.evaluate(this.value,this.parameters,e,t,r,o)};var Io=function(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)};Io.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 o=za[this.specification.type];return o?o(e,t,r):e};var Ne=function(e,t){this.specification=e,this.overrides=t};Ne.prototype.possiblyEvaluate=function(e,t,r,o){return new jr(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(t,null,{},r,o)}: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 o=za[this.specification.type];return o?new jr(this,{kind:"constant",value:o(e.value.value,t.value.value,r)},e.parameters):e},Ne.prototype.evaluate=function(e,t,r,o,u,c){return e.kind==="constant"?e.value:e.evaluate(t,r,o,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,o,u,c){if(r.value===void 0)return new jr(this,{kind:"constant",value:void 0},o);if(r.expression.kind==="constant"){var h=r.expression.evaluate(o,null,{},u,c),v=r.property.specification.type==="resolvedImage"&&typeof h!="string"?h.name:h,_=this._calculate(v,v,v,o);return new jr(this,{kind:"constant",value:_},o)}if(r.expression.kind==="camera"){var x=this._calculate(r.expression.evaluate({zoom:o.zoom-1}),r.expression.evaluate({zoom:o.zoom}),r.expression.evaluate({zoom:o.zoom+1}),o);return new jr(this,{kind:"constant",value:x},o)}return new jr(this,r.expression,o)},t.prototype.evaluate=function(r,o,u,c,h,v){if(r.kind==="source"){var _=r.evaluate(o,u,c,h,v);return this._calculate(_,_,_,o)}return r.kind==="composite"?this._calculate(r.evaluate({zoom:Math.floor(o.zoom)-1},u,c),r.evaluate({zoom:Math.floor(o.zoom)},u,c),r.evaluate({zoom:Math.floor(o.zoom)+1},u,c),o):r.value},t.prototype._calculate=function(r,o,u,c){return c.zoom>c.zoomHistory.lastIntegerZoom?{from:r,to:o}:{from:u,to:o}},t.prototype.interpolate=function(r){return r},t}(Ne),$r=function(e){this.specification=e};$r.prototype.possiblyEvaluate=function(e,t,r,o){if(e.value!==void 0){if(e.expression.kind==="constant"){var u=e.expression.evaluate(t,null,{},r,o);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,o){return o.zoom>o.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,o){return!!e.expression.evaluate(t,null,{},r,o)},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 o=this.defaultPropertyValues[t]=new Hi(r,void 0),u=this.defaultTransitionablePropertyValues[t]=new Ei(r);this.defaultTransitioningPropertyValues[t]=u.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=o.possiblyEvaluate({})}};Ve("DataDrivenProperty",Ne),Ve("DataConstantProperty",Ze),Ve("CrossFadedDataDrivenProperty",cs),Ve("CrossFadedProperty",$r),Ve("ColorRampProperty",qi);var Xi=function(e){function t(r,o){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),o.layout&&(this._unevaluatedLayout=new Ni(o.layout)),o.paint)){for(var u in this._transitionablePaint=new Dr(o.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 Io(o.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,o,u){u===void 0&&(u={}),o!=null&&this._validate(bo,"layers."+this.id+".layout."+r,r,o,u)||(r!=="visibility"?this._unevaluatedLayout.setValue(r,o):this.visibility=o)},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,o,u){if(u===void 0&&(u={}),o!=null&&this._validate(tp,"layers."+this.id+".paint."+r,r,o,u))return!1;if(Sr(r,"-transition"))return this._transitionablePaint.setTransition(r.slice(0,-11),o||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,o),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,o,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,o){r.getCrossfadeParameters&&(this._crossfadeParameters=r.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(r,void 0,o)),this.paint=this._transitioningPaint.possiblyEvaluate(r,void 0,o)},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(o,u){return!(o===void 0||u==="layout"&&!Object.keys(o).length||u==="paint"&&!Object.keys(o).length)})},t.prototype._validate=function(r,o,u,c,h){return h===void 0&&(h={}),(!h||h.validate!==!1)&&wo(this,r.call(xo,{key:o,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 o=this.paint.get(r);if(o instanceof jr&&na(o.property.specification)&&(o.value.kind==="source"||o.value.kind==="composite")&&o.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,o=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 o=Math.max(o,c),r+=c*v,{name:u.name,type:u.type,components:v,offset:h}}),size:Bu(r,Math.max(o,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 ua=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,o){var u=this.length;return this.resize(u+1),this.emplace(u,r,o)},t.prototype.emplace=function(r,o,u){var c=2*r;return this.int16[c+0]=o,this.int16[c+1]=u,r},t}(kt);ua.prototype.bytesPerElement=4,Ve("StructArrayLayout2i4",ua);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,o,u,c){var h=this.length;return this.resize(h+1),this.emplace(h,r,o,u,c)},t.prototype.emplace=function(r,o,u,c,h){var v=4*r;return this.int16[v+0]=o,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,o,u,c,h,v){var _=this.length;return this.resize(_+1),this.emplace(_,r,o,u,c,h,v)},t.prototype.emplace=function(r,o,u,c,h,v,_){var x=6*r;return this.int16[x+0]=o,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,o,u,c,h,v){var _=this.length;return this.resize(_+1),this.emplace(_,r,o,u,c,h,v)},t.prototype.emplace=function(r,o,u,c,h,v,_){var x=4*r,S=8*r;return this.int16[x+0]=o,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 Va=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,o){var u=this.length;return this.resize(u+1),this.emplace(u,r,o)},t.prototype.emplace=function(r,o,u){var c=2*r;return this.float32[c+0]=o,this.float32[c+1]=u,r},t}(kt);Va.prototype.bytesPerElement=8,Ve("StructArrayLayout2f8",Va);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,o,u,c,h,v,_,x,S,T){var C=this.length;return this.resize(C+1),this.emplace(C,r,o,u,c,h,v,_,x,S,T)},t.prototype.emplace=function(r,o,u,c,h,v,_,x,S,T,C){var k=10*r;return this.uint16[k+0]=o,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]=C,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,o,u,c,h,v,_,x,S,T,C,k){var U=this.length;return this.resize(U+1),this.emplace(U,r,o,u,c,h,v,_,x,S,T,C,k)},t.prototype.emplace=function(r,o,u,c,h,v,_,x,S,T,C,k,U){var N=12*r;return this.int16[N+0]=o,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]=C,this.int16[N+10]=k,this.int16[N+11]=U,r},t}(kt);hs.prototype.bytesPerElement=24,Ve("StructArrayLayout4i4ui4i24",hs);var Ua=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,o,u){var c=this.length;return this.resize(c+1),this.emplace(c,r,o,u)},t.prototype.emplace=function(r,o,u,c){var h=3*r;return this.float32[h+0]=o,this.float32[h+1]=u,this.float32[h+2]=c,r},t}(kt);Ua.prototype.bytesPerElement=12,Ve("StructArrayLayout3f12",Ua);var Ao=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 o=this.length;return this.resize(o+1),this.emplace(o,r)},t.prototype.emplace=function(r,o){return this.uint32[1*r+0]=o,r},t}(kt);Ao.prototype.bytesPerElement=4,Ve("StructArrayLayout1ul4",Ao);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,o,u,c,h,v,_,x,S){var T=this.length;return this.resize(T+1),this.emplace(T,r,o,u,c,h,v,_,x,S)},t.prototype.emplace=function(r,o,u,c,h,v,_,x,S,T){var C=10*r,k=5*r;return this.int16[C+0]=o,this.int16[C+1]=u,this.int16[C+2]=c,this.int16[C+3]=h,this.int16[C+4]=v,this.int16[C+5]=_,this.uint32[k+3]=x,this.uint16[C+8]=S,this.uint16[C+9]=T,r},t}(kt);_l.prototype.bytesPerElement=20,Ve("StructArrayLayout6i1ul2ui20",_l);var Na=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,o,u,c,h,v){var _=this.length;return this.resize(_+1),this.emplace(_,r,o,u,c,h,v)},t.prototype.emplace=function(r,o,u,c,h,v,_){var x=6*r;return this.int16[x+0]=o,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);Na.prototype.bytesPerElement=12,Ve("StructArrayLayout2i2i2i12",Na);var ca=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,o,u,c,h){var v=this.length;return this.resize(v+1),this.emplace(v,r,o,u,c,h)},t.prototype.emplace=function(r,o,u,c,h,v){var _=4*r,x=8*r;return this.float32[_+0]=o,this.float32[_+1]=u,this.float32[_+2]=c,this.int16[x+6]=h,this.int16[x+7]=v,r},t}(kt);ca.prototype.bytesPerElement=16,Ve("StructArrayLayout2f1f2i16",ca);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,o,u,c){var h=this.length;return this.resize(h+1),this.emplace(h,r,o,u,c)},t.prototype.emplace=function(r,o,u,c,h){var v=12*r,_=3*r;return this.uint8[v+0]=o,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,o,u){var c=this.length;return this.resize(c+1),this.emplace(c,r,o,u)},t.prototype.emplace=function(r,o,u,c){var h=3*r;return this.uint16[h+0]=o,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,o,u,c,h,v,_,x,S,T,C,k,U,N,J,W,re){var ae=this.length;return this.resize(ae+1),this.emplace(ae,r,o,u,c,h,v,_,x,S,T,C,k,U,N,J,W,re)},t.prototype.emplace=function(r,o,u,c,h,v,_,x,S,T,C,k,U,N,J,W,re,ae){var oe=24*r,ce=12*r,ye=48*r;return this.int16[oe+0]=o,this.int16[oe+1]=u,this.uint16[oe+2]=c,this.uint16[oe+3]=h,this.uint32[ce+2]=v,this.uint32[ce+3]=_,this.uint32[ce+4]=x,this.uint16[oe+10]=S,this.uint16[oe+11]=T,this.uint16[oe+12]=C,this.float32[ce+7]=k,this.float32[ce+8]=U,this.uint8[ye+36]=N,this.uint8[ye+37]=J,this.uint8[ye+38]=W,this.uint32[ce+10]=re,this.int16[oe+22]=ae,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,o,u,c,h,v,_,x,S,T,C,k,U,N,J,W,re,ae,oe,ce,ye,Se,Ae,$e,ke,We,ze,lt){var Qe=this.length;return this.resize(Qe+1),this.emplace(Qe,r,o,u,c,h,v,_,x,S,T,C,k,U,N,J,W,re,ae,oe,ce,ye,Se,Ae,$e,ke,We,ze,lt)},t.prototype.emplace=function(r,o,u,c,h,v,_,x,S,T,C,k,U,N,J,W,re,ae,oe,ce,ye,Se,Ae,$e,ke,We,ze,lt,Qe){var qe=34*r,ct=17*r;return this.int16[qe+0]=o,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]=C,this.uint16[qe+10]=k,this.uint16[qe+11]=U,this.uint16[qe+12]=N,this.uint16[qe+13]=J,this.uint16[qe+14]=W,this.uint16[qe+15]=re,this.uint16[qe+16]=ae,this.uint16[qe+17]=oe,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 o=this.length;return this.resize(o+1),this.emplace(o,r)},t.prototype.emplace=function(r,o){return this.float32[1*r+0]=o,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,o,u){var c=this.length;return this.resize(c+1),this.emplace(c,r,o,u)},t.prototype.emplace=function(r,o,u,c){var h=3*r;return this.int16[h+0]=o,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,o,u){var c=this.length;return this.resize(c+1),this.emplace(c,r,o,u)},t.prototype.emplace=function(r,o,u,c){var h=4*r;return this.uint32[2*r+0]=o,this.uint16[h+2]=u,this.uint16[h+3]=c,r},t}(kt);bl.prototype.bytesPerElement=8,Ve("StructArrayLayout1ul2ui8",bl);var Eo=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,o){var u=this.length;return this.resize(u+1),this.emplace(u,r,o)},t.prototype.emplace=function(r,o,u){var c=2*r;return this.uint16[c+0]=o,this.uint16[c+1]=u,r},t}(kt);Eo.prototype.bytesPerElement=4,Ve("StructArrayLayout2ui4",Eo);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 o=this.length;return this.resize(o+1),this.emplace(o,r)},t.prototype.emplace=function(r,o){return this.uint16[1*r+0]=o,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,o,u,c){var h=this.length;return this.resize(h+1),this.emplace(h,r,o,u,c)},t.prototype.emplace=function(r,o,u,c,h){var v=4*r;return this.float32[v+0]=o,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 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 i(this,r)},t}(_l);Ve("CollisionBoxArray",a);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(o){this._structArray.uint8[this._pos1+37]=o},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(o){this._structArray.uint8[this._pos1+38]=o},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(o){this._structArray.uint32[this._pos4+10]=o},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(o){this._structArray.uint32[this._pos4+12]=o},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 d=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new p(this,r)},t}(fs);Ve("SymbolInstanceArray",d);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,o){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!==o)&&(u={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},o!==void 0&&(u.sortKey=o),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 o in r.vaos)r.vaos[o].destroy()}},D.simpleSegment=function(e,t,r,o){return new D([{vertexOffset:e,primitiveOffset:t,vertexLength:r,primitiveLength:o,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=le(function(e){e.exports=function(t,r){var o,u,c,h,v,_,x,S;for(u=t.length-(o=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,o){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=le(function(e){e.exports=function(t,r){for(var o,u=t.length,c=r^u,h=0;u>=4;)o=1540483477*(65535&(o=255&t.charCodeAt(h)|(255&t.charCodeAt(++h))<<8|(255&t.charCodeAt(++h))<<16|(255&t.charCodeAt(++h))<<24))+((1540483477*(o>>>16)&65535)<<16),c=1540483477*(65535&c)+((1540483477*(c>>>16)&65535)<<16)^(o=1540483477*(65535&(o^=o>>>24))+((1540483477*(o>>>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,o){this.ids.push(pe(e)),this.positions.push(t,r,o)},ee.prototype.getPositions=function(e){for(var t=pe(e),r=0,o=this.ids.length-1;r<o;){var u=r+o>>1;this.ids[u]>=t?o=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),o=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,o,0,r.length-1),t&&t.push(r.buffer,o.buffer),{ids:r,positions:o}},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 o=e[t];e[t]=e[r],e[r]=o}Ve("FeaturePositionMap",ee);var he=function(e,t){this.gl=e.gl,this.location=t},_e=function(e){function t(r,o){e.call(this,r,o),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,o){e.call(this,r,o),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,o){e.call(this,r,o),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,o){e.call(this,r,o),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,o){e.call(this,r,o),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,o){e.call(this,r,o),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,o){e.call(this,r,o),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 o=1;o<16;o++)if(r[o]!==this.current[o]){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(o){return"u_"+o}),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,o){var u=o==="u_pattern_to"?this.patternTo:o==="u_pattern_from"?this.patternFrom:o==="u_pixel_ratio_to"?this.pixelRatioTo:o==="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,o){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 o};it.prototype.populatePaintArray=function(e,t,r,o,u){var c=this.paintVertexArray.length,h=this.expression.evaluate(new ht(0),t,{},o,[],u);this.paintVertexArray.resize(e),this._setPaintValue(c,e,h)},it.prototype.updatePaintArray=function(e,t,r,o){var u=this.expression.evaluate({zoom:0},r,o);this._setPaintValue(e,t,u)},it.prototype._setPaintValue=function(e,t,r){if(this.type==="color")for(var o=Fe(r),u=e;u<t;u++)this.paintVertexArray.emplace(u,o[0],o[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,o,u,c){this.expression=e,this.uniformNames=t.map(function(h){return"u_"+h+"_t"}),this.type=r,this.useIntegerZoom=o,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,o,u){var c=this.expression.evaluate(new ht(this.zoom),t,{},o,[],u),h=this.expression.evaluate(new ht(this.zoom+1),t,{},o,[],u),v=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(v,e,c,h)},rt.prototype.updatePaintArray=function(e,t,r,o){var u=this.expression.evaluate({zoom:this.zoom},r,o),c=this.expression.evaluate({zoom:this.zoom+1},r,o);this._setPaintValue(e,t,u,c)},rt.prototype._setPaintValue=function(e,t,r,o){if(this.type==="color")for(var u=Fe(r),c=Fe(o),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,o);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(o))}},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,o=je(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);e.set(o)},rt.prototype.getBinding=function(e,t,r){return new Ie(e,t)};var ot=function(e,t,r,o,u,c){this.expression=e,this.type=t,this.useIntegerZoom=r,this.zoom=o,this.layerId=c,this.zoomInPaintVertexArray=new u,this.zoomOutPaintVertexArray=new u};ot.prototype.populatePaintArray=function(e,t,r){var o=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(o,e,t.patterns&&t.patterns[this.layerId],r)},ot.prototype.updatePaintArray=function(e,t,r,o,u){this._setPaintValues(e,t,r.patterns&&r.patterns[this.layerId],u)},ot.prototype._setPaintValues=function(e,t,r,o){if(o&&r){var u=o[r.min],c=o[r.mid],h=o[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)}},ot.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))},ot.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var et=function(e,t,r){this.binders={},this._buffers=[];var o=[];for(var u in e.paint._values)if(r(u)){var c=e.paint.get(u);if(c instanceof jr&&na(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,_),o.push("/u_"+u);else if(v.kind==="source"||T){var C=Qt(u,_,"source");this.binders[u]=T?new ot(v,_,x,t,C,e.id):new it(v,h,_,C),o.push("/a_"+u)}else{var k=Qt(u,_,"composite");this.binders[u]=new rt(v,h,_,x,t,k),o.push("/z_"+u)}}}this.cacheKey=o.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,o,u){for(var c in this.binders){var h=this.binders[c];(h instanceof it||h instanceof rt||h instanceof ot)&&h.populatePaintArray(e,t,r,o,u)}},et.prototype.setConstantPatternPositions=function(e,t){for(var r in this.binders){var o=this.binders[r];o instanceof st&&o.setConstantPatternPositions(e,t)}},et.prototype.updatePaintArrays=function(e,t,r,o,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 C=this.binders[T];if((C instanceof it||C instanceof rt||C instanceof ot)&&C.expression.isStateDependent===!0){var k=o.paint.get(T);C.expression=k.value,C.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(o){return"#define HAS_UNIFORM_"+o}))}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 o=0;o<r.paintVertexAttributes.length;o++)e.push(r.paintVertexAttributes[o].name);else if(r instanceof ot)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 o=0,u=r.uniformNames;o<u.length;o+=1)e.push(u[o])}return e},et.prototype.getPaintVertexBuffers=function(){return this._buffers},et.prototype.getUniforms=function(e,t){var r=[];for(var o in this.binders){var u=this.binders[o];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:o,binding:_})}}}return r},et.prototype.setUniforms=function(e,t,r,o){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,o,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 ot){var o=e.fromScale===2?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;o&&this._buffers.push(o)}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 ot)&&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 ot)&&t.destroy()}};var Je=function(e,t,r){r===void 0&&(r=function(){return!0}),this.programConfigurations={};for(var o=0,u=e;o<u.length;o+=1){var c=u[o];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 o={color:{source:Va,composite:ds},number:{source:kn,composite:Va}},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]||o[t][r]}Je.prototype.populatePaintArrays=function(e,t,r,o,u,c){for(var h in this.programConfigurations)this.programConfigurations[h].populatePaintArrays(e,t,o,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,o){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,o)||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",ot),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(),o=0;o<r.length;o++)for(var u=r[o],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 ar(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?Jt(e):[]}}function ci(e,t,r,o,u){e.emplaceBack(2*t+(o+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 ua,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 o=0;o<t.length;o++)if(Ji(e,t[o]))return!0;return!!Co(e,t)}function Qr(e,t,r){return!!Ji(e,t)||!!zn(t,e,r)}function ji(e,t){if(e.length===1)return Po(t,e[0]);for(var r=0;r<t.length;r++)for(var o=t[r],u=0;u<o.length;u++)if(Ji(e,o[u]))return!0;for(var c=0;c<e.length;c++)if(Po(t,e[c]))return!0;for(var h=0;h<t.length;h++)if(Co(e,t[h]))return!0;return!1}function Pi(e,t,r){if(e.length>1){if(Co(e,t))return!0;for(var o=0;o<t.length;o++)if(zn(t[o],e,r))return!0}for(var u=0;u<e.length;u++)if(zn(e[u],t,r))return!0;return!1}function Co(e,t){if(e.length===0||t.length===0)return!1;for(var r=0;r<e.length-1;r++)for(var o=e[r],u=e[r+1],c=0;c<t.length-1;c++)if(qa(o,u,t[c],t[c+1]))return!0;return!1}function qa(e,t,r,o){return Tr(e,r,o)!==Tr(t,r,o)&&Tr(e,t,r)!==Tr(e,t,o)}function zn(e,t,r){var o=r*r;if(t.length===1)return e.distSqr(t[0])<o;for(var u=1;u<t.length;u++)if(ja(e,t[u-1],t[u])<o)return!0;return!1}function ja(e,t,r){var o=t.distSqr(r);if(o===0)return e.distSqr(t);var u=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/o;return e.distSqr(u<0?t:u>1?r:r.sub(t)._mult(u)._add(t))}function Po(e,t){for(var r,o,u,c=!1,h=0;h<e.length;h++)for(var v=0,_=(r=e[h]).length-1;v<r.length;_=v++)(o=r[v]).y>t.y!=(u=r[_]).y>t.y&&t.x<(u.x-o.x)*(t.y-o.y)/(u.y-o.y)+o.x&&(c=!c);return c}function Ji(e,t){for(var r=!1,o=0,u=e.length-1;o<e.length;u=o++){var c=e[o],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 ko(e,t,r){var o=r[0],u=r[2];if(e.x<o.x&&t.x<o.x||e.x>u.x&&t.x>u.x||e.y<o.y&&t.y<o.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 o=t.paint.get(e).value;return o.kind==="constant"?o.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,o,u){if(!t[0]&&!t[1])return e;var c=me.convert(t)._mult(u);r==="viewport"&&c._rotate(-o);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 o=this.layers[0],u=[],c=null;o.type==="circle"&&(c=o.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,C=_.sourceLayerIndex,k=this.layers[0]._featureFilter.needGeometry,U=ar(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:C,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 W=0,re=u;W<re.length;W+=1){var ae=re[W],oe=ae.geometry,ce=ae.index,ye=ae.sourceLayerIndex,Se=e[ce].feature;this.addFeature(ae,oe,ce,r),t.featureIndex.insert(Se,oe,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,o){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),C=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(C,C+1,C+2),this.indexArray.emplaceBack(C,C+3,C+2),T.vertexLength+=4,T.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},o)},Ve("CircleBucket",Zr,{omit:["layers"]});var Bn=new Lr({"circle-sort-key":new Ne(B.layout_circle["circle-sort-key"])}),pa={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 o=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],C=t[9],k=t[10],U=t[11],N=t[12],J=t[13],W=t[14],re=t[15],ae=r[0],oe=r[1],ce=r[2],ye=r[3];return e[0]=ae*o+oe*v+ce*T+ye*N,e[1]=ae*u+oe*_+ce*C+ye*J,e[2]=ae*c+oe*x+ce*k+ye*W,e[3]=ae*h+oe*S+ce*U+ye*re,e[4]=(ae=r[4])*o+(oe=r[5])*v+(ce=r[6])*T+(ye=r[7])*N,e[5]=ae*u+oe*_+ce*C+ye*J,e[6]=ae*c+oe*x+ce*k+ye*W,e[7]=ae*h+oe*S+ce*U+ye*re,e[8]=(ae=r[8])*o+(oe=r[9])*v+(ce=r[10])*T+(ye=r[11])*N,e[9]=ae*u+oe*_+ce*C+ye*J,e[10]=ae*c+oe*x+ce*k+ye*W,e[11]=ae*h+oe*S+ce*U+ye*re,e[12]=(ae=r[12])*o+(oe=r[13])*v+(ce=r[14])*T+(ye=r[15])*N,e[13]=ae*u+oe*_+ce*C+ye*J,e[14]=ae*c+oe*x+ce*k+ye*W,e[15]=ae*h+oe*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 ha,rp=ei;function ms(e,t,r){var o=t[0],u=t[1],c=t[2],h=t[3];return e[0]=r[0]*o+r[4]*u+r[8]*c+r[12]*h,e[1]=r[1]*o+r[5]*u+r[9]*c+r[13]*h,e[2]=r[2]*o+r[6]*u+r[10]*c+r[14]*h,e[3]=r[3]*o+r[7]*u+r[11]*c+r[15]*h,e}ha=new Ct(3),Ct!=Float32Array&&(ha[0]=0,ha[1]=0,ha[2]=0),function(){var e=new Ct(4);Ct!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0)}();var ip=(function(){var e=new Ct(2);Ct!=Float32Array&&(e[0]=0,e[1]=0)}(),function(e){function t(r){e.call(this,r,pa)}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 o=r;return Yi("circle-radius",this,o)+Yi("circle-stroke-width",this,o)+xr(this.paint.get("circle-translate"))},t.prototype.queryIntersectsFeature=function(r,o,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(o,u)+this.paint.get("circle-stroke-width").evaluate(o,u),C=this.paint.get("circle-pitch-alignment")==="map",k=C?S:function(Se,Ae){return Se.map(function($e){return Mo($e,Ae)})}(S,x),U=C?T*_:T,N=0,J=c;N<J.length;N+=1)for(var W=0,re=J[N];W<re.length;W+=1){var ae=re[W],oe=C?ae:Mo(ae,x),ce=U,ye=ms([],[ae.x,ae.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,oe,ce))return!0}return!1},t}(Xi));function Mo(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 $a(e,t,r,o){var u=t.width,c=t.height;if(o){if(o instanceof Uint8ClampedArray)o=new Uint8Array(o.buffer);else if(o.length!==u*c*r)throw new RangeError("mismatched image size")}else o=new Uint8Array(u*c*r);return e.width=u,e.height=c,e.data=o,e}function ys(e,t,r){var o=t.width,u=t.height;if(o!==e.width||u!==e.height){var c=$a({},{width:o,height:u},r);np(e,c,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,o),height:Math.min(e.height,u)},r),e.width=o,e.height=u,e.data=c.data}}function np(e,t,r,o,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||o.x>t.width-u.width||o.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=((o.y+_)*t.width+o.x)*c,T=0;T<u.width*c;T++)v[S+T]=h[x+T];return t}Ve("HeatmapBucket",Du,{omit:["layers"]});var zo=function(e,t){$a(this,e,1,t)};zo.prototype.resize=function(e){ys(this,e,1)},zo.prototype.clone=function(){return new zo({width:this.width,height:this.height},new Uint8Array(this.data))},zo.copy=function(e,t,r,o,u){np(e,t,r,o,u,1)};var pi=function(e,t){$a(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,o,u){np(e,t,r,o,u,4)},Ve("AlphaImage",zo),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,o=e.clips?e.clips.length:1,u=e.image||new pi({width:r,height:o}),c=function(U,N,J){t[e.evaluationKey]=J;var W=e.expression.evaluate(t);u.data[U+N+0]=Math.floor(255*W.r/W.a),u.data[U+N+1]=Math.floor(255*W.g/W.a),u.data[U+N+2]=Math.floor(255*W.b/W.a),u.data[U+N+3]=Math.floor(255*W.a)};if(e.clips)for(var h=0,v=0;h<o;++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 C=0,k=0;C<r;C++,k+=4)c(0,k,C/(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 o,u,c,h,v,_,x,S=t&&t.length,T=S?t[0]*r:e.length,C=Pf(e,0,T,r,!0),k=[];if(!C||C.next===C.prev)return k;if(S&&(C=function(N,J,W,re){var ae,oe,ce,ye=[];for(ae=0,oe=J.length;ae<oe;ae++)(ce=Pf(N,J[ae]*re,ae<oe-1?J[ae+1]*re:N.length,re,!1))===ce.next&&(ce.steiner=!0),ye.push(Rg(ce));for(ye.sort(Bg),ae=0;ae<ye.length;ae++)Dg(ye[ae],W),W=Za(W,W.next);return W}(e,t,C,r)),e.length>80*r){o=c=e[0],u=h=e[1];for(var U=r;U<T;U+=r)(v=e[U])<o&&(o=v),(_=e[U+1])<u&&(u=_),v>c&&(c=v),_>h&&(h=_);x=(x=Math.max(c-o,h-u))!==0?1/x:0}return Sl(C,k,r,o,u,x),k}function Pf(e,t,r,o,u){var c,h;if(u===lp(e,t,r,o)>0)for(c=t;c<r;c+=o)h=zf(c,e[c],e[c+1],h);else for(c=r-o;c>=t;c-=o)h=zf(c,e[c],e[c+1],h);return h&&Ru(h,h.next)&&(Il(h),h=h.next),h}function Za(e,t){if(!e)return e;t||(t=e);var r,o=e;do if(r=!1,o.steiner||!Ru(o,o.next)&&mr(o.prev,o,o.next)!==0)o=o.next;else{if(Il(o),(o=t=o.prev)===o.next)break;r=!0}while(r||o!==t);return t}function Sl(e,t,r,o,u,c,h){if(e){!h&&c&&function(S,T,C,k){var U=S;do U.z===null&&(U.z=op(U.x,U.y,T,C,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,W,re,ae,oe,ce,ye,Se,Ae=1;do{for(W=N,N=null,oe=null,ce=0;W;){for(ce++,re=W,ye=0,J=0;J<Ae&&(ye++,re=re.nextZ);J++);for(Se=Ae;ye>0||Se>0&&re;)ye!==0&&(Se===0||!re||W.z<=re.z)?(ae=W,W=W.nextZ,ye--):(ae=re,re=re.nextZ,Se--),oe?oe.nextZ=ae:N=ae,ae.prevZ=oe,oe=ae;W=re}oe.nextZ=null,Ae*=2}while(ce>1)}(U)}(e,o,u,c);for(var v,_,x=e;e.prev!==e.next;)if(v=e.prev,_=e.next,c?kg(e,o,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(Za(e),t,r),t,r,o,u,c,2):h===2&&zg(e,t,r,o,u,c):Sl(Za(e),t,r,o,u,c,1);break}}}function Pg(e){var t=e.prev,r=e,o=e.next;if(mr(t,r,o)>=0)return!1;for(var u=e.next.next;u!==e.prev;){if(vs(t.x,t.y,r.x,r.y,o.x,o.y,u.x,u.y)&&mr(u.prev,u,u.next)>=0)return!1;u=u.next}return!0}function kg(e,t,r,o){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=op(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,o),S=op(v,_,t,r,o),T=e.prevZ,C=e.nextZ;T&&T.z>=x&&C&&C.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,C!==e.prev&&C!==e.next&&vs(u.x,u.y,c.x,c.y,h.x,h.y,C.x,C.y)&&mr(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;T&&T.z>=x;){if(T!==e.prev&&T!==e.next&&vs(u.x,u.y,c.x,c.y,h.x,h.y,T.x,T.y)&&mr(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;C&&C.z<=S;){if(C!==e.prev&&C!==e.next&&vs(u.x,u.y,c.x,c.y,h.x,h.y,C.x,C.y)&&mr(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function Mg(e,t,r){var o=e;do{var u=o.prev,c=o.next.next;!Ru(u,c)&&kf(u,o,o.next,c)&&Tl(u,c)&&Tl(c,u)&&(t.push(u.i/r),t.push(o.i/r),t.push(c.i/r),Il(o),Il(o.next),o=e=c),o=o.next}while(o!==e);return Za(o)}function zg(e,t,r,o,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=Za(h,h.next),_=Za(_,_.next),Sl(h,t,r,o,u,c),void Sl(_,t,r,o,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(o,u){var c,h=u,v=o.x,_=o.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,C=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,o)&&(T<N||T===N&&(h.x>c.x||h.x===c.x&&Lg(c,h)))&&(c=h,N=T)),h=h.next;while(h!==C);return c}(e,t)){var r=Mf(t,e);Za(t,t.next),Za(r,r.next)}}function Lg(e,t){return mr(e.prev,e,t.prev)<0&&mr(t.next,e,e.next)<0}function op(e,t,r,o,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-o)*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,o,u,c,h,v){return(u-h)*(t-v)-(e-h)*(c-v)>=0&&(e-h)*(o-v)-(r-h)*(t-v)>=0&&(r-h)*(c-v)-(u-h)*(o-v)>=0}function Fg(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(r,o){var u=r;do{if(u.i!==r.i&&u.next.i!==r.i&&u.i!==o.i&&u.next.i!==o.i&&kf(u,u.next,r,o))return!0;u=u.next}while(u!==r);return!1}(e,t)&&(Tl(e,t)&&Tl(t,e)&&function(r,o){var u=r,c=!1,h=(r.x+o.x)/2,v=(r.y+o.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,o){var u=Ou(mr(e,t,r)),c=Ou(mr(e,t,o)),h=Ou(mr(r,o,e)),v=Ou(mr(r,o,t));return u!==c&&h!==v||!(u!==0||!Fu(e,r,t))||!(c!==0||!Fu(e,o,t))||!(h!==0||!Fu(r,e,o))||!(v!==0||!Fu(r,t,o))}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 sp(e.i,e.x,e.y),o=new sp(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,o.next=r,r.prev=o,c.next=o,o.prev=c,o}function zf(e,t,r,o){var u=new sp(e,t,r);return o?(u.next=o.next,u.prev=o,o.next.prev=u,o.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 sp(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 lp(e,t,r,o){for(var u=0,c=t,h=r-o;c<r;c+=o)u+=(e[h]-e[c])*(e[c+1]+e[h+1]),h=c;return u}function Og(e,t,r,o,u){(function c(h,v,_,x,S){for(;x>_;){if(x-_>600){var T=x-_+1,C=v-_+1,k=Math.log(T),U=.5*Math.exp(2*k/3),N=.5*Math.sqrt(k*U*(T-U)/T)*(C-T/2<0?-1:1);c(h,v,Math.max(_,Math.floor(v-C*U/T+N)),Math.min(x,Math.floor(v+(T-C)*U/T+N)),S)}var J=h[v],W=_,re=x;for(Al(h,_,v),S(h[x],J)>0&&Al(h,_,x);W<re;){for(Al(h,W,re),W++,re--;S(h[W],J)<0;)W++;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,o||e.length-1,u||Vg)}function Al(e,t,r){var o=e[t];e[t]=e[r],e[r]=o}function Vg(e,t){return e<t?-1:e>t?1:0}function up(e,t){var r=e.length;if(r<=1)return[e];for(var o,u,c=[],h=0;h<r;h++){var v=Sa(e[h]);v!==0&&(e[h].area=Math.abs(v),u===void 0&&(u=v<0),u===v<0?(o&&c.push(o),o=[e[h]]):o.push(e[h]))}if(o&&c.push(o),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 cp(e,t,r){for(var o=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,o[_.to]=!0,o[_.from]=!0)}return u}function pp(e,t,r,o,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:o-1},r,{},u.availableImages),T=x.evaluate({zoom:o},r,{},u.availableImages),C=x.evaluate({zoom:o+1},r,{},u.availableImages);T=T&&T.name?T.name:T,C=C&&C.name?C.name:C,c[S=S&&S.name?S.name:S]=!0,c[T]=!0,c[C]=!0,r.patterns[_.id]={min:S,mid:T,max:C}}}return r}Lu.deviation=function(e,t,r,o){var u=t&&t.length,c=Math.abs(lp(e,0,u?t[0]*r:e.length,r));if(u)for(var h=0,v=t.length;h<v;h++)c-=Math.abs(lp(e,t[h]*r,h<v-1?t[h+1]*r:e.length,r));var _=0;for(h=0;h<o.length;h+=3){var x=o[h]*r,S=o[h+1]*r,T=o[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},o=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(o+=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 ua,this.indexArray=new Cn,this.indexArray2=new Eo,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=cp("fill",this.layers,t);for(var o=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,C=this.layers[0]._featureFilter.needGeometry,k=ar(_,C);if(this.layers[0]._featureFilter.filter(new ht(this.zoom),k,r)){var U=o?o.evaluate(k,{},r,t.availableImages):void 0,N={id:x,properties:_.properties,type:_.type,sourceLayerIndex:T,index:S,geometry:C?k.geometry:Jt(_),patterns:{},sortKey:U};u.push(N)}}o&&u.sort(function(Se,Ae){return Se.sortKey-Ae.sortKey});for(var J=0,W=u;J<W.length;J+=1){var re=W[J],ae=re.geometry,oe=re.index,ce=re.sourceLayerIndex;if(this.hasPattern){var ye=pp("fill",this.layers,re,this.zoom,t);this.patternFeatures.push(ye)}else this.addFeature(re,ae,oe,r,{});t.featureIndex.insert(e[oe].feature,ae,oe,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 o=0,u=this.patternFeatures;o<u.length;o+=1){var c=u[o];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,o,u){for(var c=0,h=up(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),C=T.vertexLength,k=[],U=[],N=0,J=v;N<J.length;N+=1){var W=J[N];if(W.length!==0){W!==v[0]&&U.push(k.length/2);var re=this.segments2.prepareSegment(W.length,this.layoutVertexArray,this.indexArray2),ae=re.vertexLength;this.layoutVertexArray.emplaceBack(W[0].x,W[0].y),this.indexArray2.emplaceBack(ae+W.length-1,ae),k.push(W[0].x),k.push(W[0].y);for(var oe=1;oe<W.length;oe++)this.layoutVertexArray.emplaceBack(W[oe].x,W[oe].y),this.indexArray2.emplaceBack(ae+oe-1,ae+oe),k.push(W[oe].x),k.push(W[oe].y);re.vertexLength+=W.length,re.primitiveLength+=W.length}}for(var ce=ap(k,U),ye=0;ye<ce.length;ye+=3)this.indexArray.emplaceBack(C+ce[ye],C+ce[ye+1],C+ce[ye+2]);T.vertexLength+=_,T.primitiveLength+=ce.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,u,o)},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,o){e.prototype.recalculate.call(this,r,o);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,o,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,o,u){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=o,this._values=u,e.readFields(Zg,this,t)}function Zg(e,t,r){e==1?t.id=r.readVarint():e==2?function(o,u){for(var c=o.readVarint()+o.pos;o.pos<c;){var h=u._keys[o.readVarint()],v=u._values[o.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,o=0,u=0,c=e.length,h=c-1;u<c;h=u++)o+=((r=e[h]).x-(t=e[u]).x)*(t.y+r.y);return o}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,o=1,u=0,c=0,h=0,v=[];e.pos<r;){if(u<=0){var _=e.readVarint();o=7&_,u=_>>3}if(u--,o===1||o===2)c+=e.readSVarint(),h+=e.readSVarint(),o===1&&(t&&v.push(t),t=[]),t.push(new me(c,h));else{if(o!==7)throw new Error("unknown command "+o);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,o=0,u=0,c=0,h=1/0,v=-1/0,_=1/0,x=-1/0;e.pos<t;){if(o<=0){var S=e.readVarint();r=7&S,o=S>>3}if(o--,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 o,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(o=0;o<_.length;o++)T[o]=_[o][0];S(_=T);break;case 2:for(o=0;o<_.length;o++)S(_[o]);break;case 3:for(_=function(k){var U=k.length;if(U<=1)return[k];for(var N,J,W=[],re=0;re<U;re++){var ae=Gg(k[re]);ae!==0&&(J===void 0&&(J=ae<0),J===ae<0?(N&&W.push(N),N=[k[re]]):N.push(k[re]))}return N&&W.push(N),W}(_),o=0;o<_.length;o++)for(u=0;u<_[o].length;u++)S(_[o][u])}_.length===1?_=_[0]:x="Multi"+x;var C={type:"Feature",geometry:{type:x,coordinates:_},properties:this.properties};return"id"in this&&(C.id=this.id),C};var 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(o){for(var u=null,c=o.readVarint()+o.pos;o.pos<c;){var h=o.readVarint()>>3;u=h===1?o.readString():h===2?o.readFloat():h===3?o.readDouble():h===4?o.readVarint64():h===5?o.readVarint():h===6?o.readSVarint():h===7?o.readBoolean():null}return u}(r))}function Hg(e,t,r){if(e===3){var o=new Df(r,r.readVarint()+r.pos);o.length&&(t[o.name]=o)}}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,hp=Math.pow(2,13);function El(e,t,r,o,u,c,h,v){e.emplaceBack(t,r,2*Math.floor(o*hp)+h,u*hp*2,c*hp*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=cp("fill-extrusion",this.layers,t);for(var o=0,u=e;o<u.length;o+=1){var c=u[o],h=c.feature,v=c.id,_=c.index,x=c.sourceLayerIndex,S=this.layers[0]._featureFilter.needGeometry,T=ar(h,S);if(this.layers[0]._featureFilter.filter(new ht(this.zoom),T,r)){var C={id:v,sourceLayerIndex:x,index:_,geometry:S?T.geometry:Jt(h),properties:h.properties,type:h.type,patterns:{}};this.hasPattern?this.features.push(pp("fill-extrusion",this.layers,C,this.zoom,t)):this.addFeature(C,C.geometry,_,r,{}),t.featureIndex.insert(h,C.geometry,_,x,this.index,!0)}}},hn.prototype.addFeatures=function(e,t,r){for(var o=0,u=this.features;o<u.length;o+=1){var c=u[o];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,o,u){for(var c=0,h=up(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),C=0,k=v;C<k.length;C+=1){var U=k[C];if(U.length!==0&&!((ct=U).every(function(at){return at.x<0})||ct.every(function(at){return at.x>8192})||ct.every(function(at){return at.y<0})||ct.every(function(at){return at.y>8192})))for(var N=0,J=0;J<U.length;J++){var W=U[J];if(J>=1){var re=U[J-1];if(!Kg(W,re)){T.vertexLength+4>D.MAX_VERTEX_ARRAY_LENGTH&&(T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var ae=W.sub(re)._perp()._unit(),oe=re.dist(W);N+oe>32768&&(N=0),El(this.layoutVertexArray,W.x,W.y,ae.x,ae.y,0,0,N),El(this.layoutVertexArray,W.x,W.y,ae.x,ae.y,0,1,N),El(this.layoutVertexArray,re.x,re.y,ae.x,ae.y,0,0,N+=oe),El(this.layoutVertexArray,re.x,re.y,ae.x,ae.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,o)},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,o,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(o,u),C=this.paint.get("fill-extrusion-base").evaluate(o,u),k=function(N,J,W,re){for(var ae=[],oe=0,ce=N;oe<ce.length;oe+=1){var ye=ce[oe],Se=[ye.x,ye.y,0,1];ms(Se,Se,J),ae.push(new me(Se[0]/Se[3],Se[1]/Se[3]))}return ae}(S,x),U=function(N,J,W,re){for(var ae=[],oe=[],ce=re[8]*J,ye=re[9]*J,Se=re[10]*J,Ae=re[11]*J,$e=re[8]*W,ke=re[9]*W,We=re[10]*W,ze=re[11]*W,lt=0,Qe=N;lt<Qe.length;lt+=1){for(var qe=[],ct=[],at=0,xt=Qe[lt];at<xt.length;at+=1){var He=xt[at],St=He.x,Ht=He.y,er=re[0]*St+re[4]*Ht+re[12],Yt=re[1]*St+re[5]*Ht+re[13],Xt=re[2]*St+re[6]*Ht+re[14],tr=re[3]*St+re[7]*Ht+re[15],br=Xt+Se,wr=tr+Ae,Wr=er+$e,kr=Yt+ke,Hr=Xt+We,or=tr+ze,Mr=new me((er+ce)/wr,(Yt+ye)/wr);Mr.z=br/wr,qe.push(Mr);var ft=new me(Wr/or,kr/or);ft.z=Hr/or,ct.push(ft)}ae.push(qe),oe.push(ct)}return[ae,oe]}(c,C,T,x);return function(N,J,W){var re=1/0;ji(W,J)&&(re=Rf(W,J[0]));for(var ae=0;ae<J.length;ae++)for(var oe=J[ae],ce=N[ae],ye=0;ye<oe.length-1;ye++){var Se=oe[ye],Ae=[Se,oe[ye+1],ce[ye+1],ce[ye],Se];Mn(W,Ae)&&(re=Math.min(re,Rf(W,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,o=0,u=t[o++];!r||u.equals(r);)if(!(r=t[o++]))return 1/0;for(;o<t.length;o++){var c=t[o],h=e[0],v=r.sub(u),_=c.sub(u),x=h.sub(u),S=Cl(v,v),T=Cl(v,_),C=Cl(_,_),k=Cl(x,v),U=Cl(x,_),N=S*C-T*T,J=(C*k-T*U)/N,W=(S*U-T*k)/N,re=u.z*(1-J-W)+r.z*J+c.z*W;if(isFinite(re))return re}return 1/0}for(var ae=1/0,oe=0,ce=t;oe<ce.length;oe+=1)ae=Math.min(ae,ce[oe].z);return ae}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 Va,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=cp("line",this.layers,t);for(var o=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,C=this.layers[0]._featureFilter.needGeometry,k=ar(_,C);if(this.layers[0]._featureFilter.filter(new ht(this.zoom),k,r)){var U=o?o.evaluate(k,{},r):void 0,N={id:x,properties:_.properties,type:_.type,sourceLayerIndex:T,index:S,geometry:C?k.geometry:Jt(_),patterns:{},sortKey:U};u.push(N)}}o&&u.sort(function(Se,Ae){return Se.sortKey-Ae.sortKey});for(var J=0,W=u;J<W.length;J+=1){var re=W[J],ae=re.geometry,oe=re.index,ce=re.sourceLayerIndex;if(this.hasPattern){var ye=pp("line",this.layers,re,this.zoom,t);this.patternFeatures.push(ye)}else this.addFeature(re,ae,oe,r,{});t.featureIndex.insert(e[oe].feature,ae,oe,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 o=0,u=this.patternFeatures;o<u.length;o+=1){var c=u[o];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,o,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,o)},ti.prototype.addLine=function(e,t,r,o,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,C=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 W=x;W<_;W++)if(!(U=W===_-1?v?e[x+1]:void 0:e[W+1])||!e[W].equals(U)){J&&(N=J),S&&(k=S),S=e[W],J=U?U.sub(S)._unit()._perp():N;var re=(N=N||J).add(J);re.x===0&&re.y===0||re._unit();var ae=N.x*J.x+N.y*J.y,oe=re.x*J.x+re.y*J.y,ce=oe!==0?1/oe:1/0,ye=2*Math.sqrt(2-2*oe),Se=oe<r_&&k&&U,Ae=N.x*J.y-N.y*J.x>0;if(Se&&W>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,C),k=ke}}var We=k&&U,ze=We?r:v?"butt":o;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,C);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,C),this.addCurrentVertex(S,re.mult(-1),0,0,C)}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,C),ze==="fakeround")for(var at=Math.round(180*ye/Math.PI/20),xt=1;xt<at;xt++){var He=xt/at;if(He!==.5){var St=He-.5;He+=He*St*(He-1)*((1.0904+ae*(ae*(3.55645-1.43519*ae)-3.2452))*St*St+(.848013+ae*(.215638*ae-1.06021)))}var Ht=J.sub(N)._mult(He)._add(N)._unit()._mult(Ae?-1:1);this.addHalfVertex(S,Ht.x,Ht.y,!1,Ae,0,C)}U&&this.addCurrentVertex(S,J,-qe,-ct,C)}else if(ze==="butt")this.addCurrentVertex(S,re,0,0,C);else if(ze==="square"){var er=k?1:-1;this.addCurrentVertex(S,re,er,er,C)}else ze==="round"&&(k&&(this.addCurrentVertex(S,N,0,0,C),this.addCurrentVertex(S,N,1,1,C,!0)),U&&(this.addCurrentVertex(S,J,-1,-1,C,!0),this.addCurrentVertex(S,J,0,0,C)));if(Se&&W<_-1){var Yt=S.dist(U);if(Yt>2*T){var Xt=S.add(U.sub(S)._mult(T/Yt)._round());this.updateDistance(S,Xt),this.addCurrentVertex(Xt,J,0,0,C),S=Xt}}}}},ti.prototype.addCurrentVertex=function(e,t,r,o,u,c){c===void 0&&(c=!1);var h=t.y*o-t.x,v=-t.y-t.x*o;this.addHalfVertex(e,t.x+t.y*r,t.y-t.x*r,c,!1,r,u),this.addHalfVertex(e,h,v,c,!0,-o,u),this.distance>Ff/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(e,t,r,o,u,c))},ti.prototype.addHalfVertex=function(e,t,r,o,u,c,h){var v=.5*(this.lineClips?this.scaledDistance*(Ff-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e.x<<1)+(o?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,o){return o=new ht(Math.floor(o.zoom),{now:o.now,fadeDuration:o.fadeDuration,zoomHistory:o.zoomHistory,transition:o.transition}),e.prototype.possiblyEvaluate.call(this,r,o)},t.prototype.evaluate=function(r,o,u,c){return o=tt({},o,{zoom:Math.floor(o.zoom)}),e.prototype.evaluate.call(this,r,o,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,o){e.prototype.recalculate.call(this,r,o),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 o=r,u=Uf(Yi("line-width",this,o),Yi("line-gap-width",this,o)),c=Yi("line-offset",this,o);return u/2+Math.abs(c)+xr(this.paint.get("line-translate"))},t.prototype.queryIntersectsFeature=function(r,o,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(o,u),this.paint.get("line-gap-width").evaluate(o,u)),T=this.paint.get("line-offset").evaluate(o,u);return T&&(c=function(C,k){for(var U=[],N=new me(0,0),J=0;J<C.length;J++){for(var W=C[J],re=[],ae=0;ae<W.length;ae++){var oe=W[ae],ce=W[ae+1],ye=ae===0?N:oe.sub(W[ae-1])._unit()._perp(),Se=ae===W.length-1?N:ce.sub(oe)._unit()._perp(),Ae=ye._add(Se)._unit();Ae._mult(1/(Ae.x*Se.x+Ae.y*Se.y)),re.push(Ae._mult(k)._add(oe))}U.push(re)}return U}(c,T*_)),function(C,k,U){for(var N=0;N<k.length;N++){var J=k[N];if(C.length>=3){for(var W=0;W<J.length;W++)if(Ji(C,J[W]))return!0}if(Pi(C,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 a_=Er([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),o_=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(o){o.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}(o.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,o,u){var c,h,v=8*u-o-1,_=(1<<v)-1,x=_>>1,S=-7,T=u-1,C=-1,k=e[t+T];for(T+=C,c=k&(1<<-S)-1,k>>=-S,S+=v;S>0;c=256*c+e[t+T],T+=C,S-=8);for(h=c&(1<<-S)-1,c>>=-S,S+=o;S>0;h=256*h+e[t+T],T+=C,S-=8);if(c===0)c=1-x;else{if(c===_)return h?NaN:1/0*(k?-1:1);h+=Math.pow(2,o),c-=x}return(k?-1:1)*h*Math.pow(2,c-o)},jf=function(e,t,r,o,u,c){var h,v,_,x=8*c-u-1,S=(1<<x)-1,T=S>>1,C=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?C/_:C*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 fa(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 o=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(o);for(var u=r.pos-1;u>=e;u--)r.buf[u+o]=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 o=r.readMessage(b_,{}),u=o.width,c=o.height,h=o.left,v=o.top,_=o.advance;t.push({id:o.id,bitmap:new zo({width:u+6,height:c+6},o.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,o=0,u=e;o<u.length;o+=1){var c=u[o];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],C=h.length-1;C>=0;C--){var k=h[C];if(!(T.w>k.w||T.h>k.h)){if(T.x=k.x,T.y=k.y,_=Math.max(_,T.y+T.h),v=Math.max(v,T.x+T.w),T.w===k.w&&T.h===k.h){var U=h.pop();C<h.length&&(h[C]=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 o=this.readVarint(),u=o>>3,c=this.pos;this.type=7&o,e(u,t,this),this.pos===c&&this.skip(o)}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,o=this.buf;return t=127&(r=o[this.pos++]),r<128?t:(t|=(127&(r=o[this.pos++]))<<7,r<128?t:(t|=(127&(r=o[this.pos++]))<<14,r<128?t:(t|=(127&(r=o[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=o[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,o,u){return $f.decode(r.subarray(o,u))}(this.buf,t,e):function(r,o,u){for(var c="",h=o;h<u;){var v,_,x,S=r[h],T=null,C=S>239?4:S>223?3:S>191?2:1;if(h+C>u)break;C===1?S<128&&(T=S):C===2?(192&(v=r[h+1]))==128&&(T=(31&S)<<6|63&v)<=127&&(T=null):C===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)):C===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,C=1):T>65535&&(T-=65536,c+=String.fromCharCode(T>>>10&1023|55296),T=56320|1023&T),c+=String.fromCharCode(T),h+=C}return c}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==qt.Bytes)return e.push(this.readVarint(t));var r=fa(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=fa(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=fa(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=fa(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=fa(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=fa(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=fa(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=fa(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=fa(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 o,u;if(t>=0?(o=t%4294967296|0,u=t/4294967296|0):(u=~(-t/4294967296),4294967295^(o=~(-t%4294967296))?o=o+1|0:(o=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)}(o,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(o,u,c){for(var h,v,_=0;_<u.length;_++){if((h=u.charCodeAt(_))>55295&&h<57344){if(!v){h>56319||_+1===u.length?(o[c++]=239,o[c++]=191,o[c++]=189):v=h;continue}if(h<56320){o[c++]=239,o[c++]=191,o[c++]=189,v=h;continue}h=v-55296<<10|h-56320|65536,v=null}else v&&(o[c++]=239,o[c++]=191,o[c++]=189,v=null);h<128?o[c++]=h:(h<2048?o[c++]=h>>6|192:(h<65536?o[c++]=h>>12|224:(o[c++]=h>>18|240,o[c++]=h>>12&63|128),o[c++]=h>>6&63|128),o[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 o=this.pos-r;o>=128&&Zf(r,o,this),this.pos=r-1,this.writeVarint(o),this.pos+=o},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,o=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=o},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={},o={};this.haveRenderCallbacks=[];var u=[];this.addImages(e,r,u),this.addImages(t,o,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],C=o[S].paddedRect,k=C.x+1,U=C.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=o};Ml.prototype.addImages=function(e,t,r){for(var o in e){var u=e[o],c={x:0,y:0,w:u.data.width+2,h:u.data.height+2};r.push(c),t[o]=new Nu(c,u),u.hasRenderCallback&&this.haveRenderCallbacks.push(o)}},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 o=e.tl;r.update(t.data,void 0,{x:o[0],y:o[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,o,u,c,h,v,_,x,S,T,C,k,U,N){var J,W=Gr.fromFeature(e,u);T===ki.vertical&&W.verticalizePunctuation();var re=di.processBidirectionalText,ae=di.processStyledBidirectionalText;if(re&&W.sections.length===1){J=[];for(var oe=0,ce=re(W.toString(),fp(W,x,c,t,o,k,U));oe<ce.length;oe+=1){var ye=ce[oe],Se=new Gr;Se.text=ye,Se.sections=W.sections;for(var Ae=0;Ae<ye.length;Ae++)Se.sectionIndex.push(0);J.push(Se)}}else if(ae){J=[];for(var $e=0,ke=ae(W.text,W.sectionIndex,fp(W,x,c,t,o,k,U));$e<ke.length;$e+=1){var We=ke[$e],ze=new Gr;ze.text=We[0],ze.sectionIndex=We[1],ze.sections=W.sections,J.push(ze)}}else J=function(qe,ct){for(var at=[],xt=qe.text,He=0,St=0,Ht=ct;St<Ht.length;St+=1){var er=Ht[St];at.push(qe.substring(He,er)),He=er}return He<xt.length&&at.push(qe.substring(He,xt.length)),at}(W,fp(W,x,c,t,o,k,U));var lt=[],Qe={positionedLines:lt,text:W.toString(),top:S[1],bottom:S[1],left:S[0],right:S[0],writingMode:T,iconsInText:!1,verticalizable:!1};return function(qe,ct,at,xt,He,St,Ht,er,Yt,Xt,tr,br){for(var wr=0,Wr=-17,kr=0,Hr=0,or=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 $t=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,Ro=!(Yt===ki.horizontal||!tr&&!ss(Mi)||tr&&(ju[Mi]||(va=Mi,Ce.Arabic(va)||Ce["Arabic Supplement"](va)||Ce["Arabic Extended-A"](va)||Ce["Arabic Presentation Forms-A"](va)||Ce["Arabic Presentation Forms-B"](va))));if(Tt.imageName){var Ms=xt[Tt.imageName];if(!Ms)continue;Qi=Tt.imageName,qe.iconsInText=qe.iconsInText||!0,Rn=Ms.paddedRect;var ya=Ms.displaySize;Tt.scale=24*Tt.scale/br,Ln=ri+(24-ya[1]*Tt.scale),ks=(sr={width:ya[0],height:ya[1],left:1,top:-3,advance:Ro?ya[1]:ya[0]}).advance;var zs=Ro?ya[0]*Tt.scale-24*wt:ya[1]*Tt.scale-24*wt;zs>0&&zs>fr&&(fr=zs)}else{var Yu=at[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)}Ro?(qe.verticalizable=!0,$t.push({glyph:Mi,imageName:Qi,x:wr,y:Wr+Ln,vertical:Ro,scale:Tt.scale,fontStack:Tt.fontStack,sectionIndex:Dn,metrics:sr,rect:Rn}),wr+=ks*Tt.scale+Xt):($t.push({glyph:Mi,imageName:Qi,x:wr,y:Wr+Ln,vertical:Ro,scale:Tt.scale,fontStack:Tt.fontStack,sectionIndex:Dn,metrics:sr,rect:Rn}),wr+=sr.advance*Tt.scale+Xt)}$t.length!==0&&(kr=Math.max(wr-Xt,kr),S_($t,0,$t.length-1,or,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 va,Ll=Wr- -17,Ds=dp(Ht),Wa=Ds.horizontalAlign,Ls=Ds.verticalAlign;(function(tc,rc,Rl,Fl,ic,Ol,Vl,Ul,nc){var Rs,ac=(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 Fo=0,ql=Nl[Fs].positionedGlyphs;Fo<ql.length;Fo+=1){var Os=ql[Fo];Os.x+=ac,Os.y+=Rs}})(qe.positionedLines,or,Wa,Ls,kr,Hr,St,Ll,He.length),qe.top+=-Ls*Ll,qe.bottom=qe.top+Ll,qe.left+=-Wa*kr,qe.right=qe.left+kr}(Qe,t,r,o,J,h,v,_,T,x,C,N),!function(qe){for(var ct=0,at=qe;ct<at.length;ct+=1)if(at[ct].positionedGlyphs.length!==0)return!1;return!0}(lt)&&Qe}Gr.fromFeature=function(e,t){for(var r=new Gr,o=0;o<e.sections.length;o++){var u=e.sections[o];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 o=e.charCodeAt(r+1)||null,u=e.charCodeAt(r-1)||null;t+=o&&dl(o)&&!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,o=this.text.length-1;o>=0&&o>=e&&ju[this.text.charCodeAt(o)];o--)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,o=0;o<e.text.length;++o)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,o,u,c){if(t.imageName){var h=o[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,o){var u=Math.pow(e-t,2);return o?e<t?u/2:2*u:u+Math.abs(r)*r}function w_(e,t,r){var o=0;return e===10&&(o-=1e4),r&&(o+=150),e!==40&&e!==65288||(o+=50),t!==41&&t!==65289||(o+=50),o}function Kf(e,t,r,o,u,c){for(var h=null,v=Xf(t,r,u,c),_=0,x=o;_<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 fp(e,t,r,o,u,c,h){if(c!=="point")return[];if(!e)return[];for(var v,_=[],x=function(J,W,re,ae,oe,ce){for(var ye=0,Se=0;Se<J.length();Se++){var Ae=J.getSection(Se);ye+=Hf(J.getCharCode(Se),Ae,ae,oe,W,ce)}return ye/Math.max(1,Math.ceil(ye/re))}(e,t,r,o,u,h),S=e.text.indexOf("")>=0,T=0,C=0;C<e.length();C++){var k=e.getSection(C),U=e.getCharCode(C);if(ju[U]||(T+=Hf(U,k,o,u,t,h)),C<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(C+1,T,x,_,w_(U,e.getCharCode(C+1),N&&S),!1))}}return function J(W){return W?J(W.priorBreak).concat(W.index):[]}(Kf(e.length(),T,x,_,0,!0))}function dp(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,o,u){if(o||u)for(var c=e[r],h=(e[r].x+c.metrics.advance*c.scale)*o,v=t;v<=r;v++)e[v].x-=h,e[v].y+=u}function Jf(e,t,r,o,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,C,k,U=t.left*c,N=t.right*c;r==="width"||r==="both"?(k=u[0]+U-o[3],T=u[0]+N+o[1]):T=(k=u[0]+(U+N-v.displaySize[0])/2)+v.displaySize[0];var J=t.top*c,W=t.bottom*c;return r==="height"||r==="both"?(S=u[1]+J-o[0],C=u[1]+W+o[2]):C=(S=u[1]+(J+W-v.displaySize[1])/2)+v.displaySize[1],{image:v,top:S,right:T,bottom:C,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,o,u,c){e.call(this,r,o),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 mp(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 o=r.zoomStops,u=r.interpolationType,c=0;c<o.length&&o[c]<=e;)c++;for(var h=c=Math.max(0,c-1);h<o.length&&o[h]<e+1;)h++;h=Math.min(o.length-1,h);var v=o[c],_=o[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 o=t.uSize,u=r.lowerSize;return e.kind==="source"?u/128:e.kind==="composite"?pr(u/128,r.upperSize/128,t.uSizeT):o}function Qf(e,t){var r=0,o=0;if(e.kind==="constant")o=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"?o=pr(e.minSize,e.maxSize,c):r=c}return{uSizeT:r,uSize:o}}Ve("Anchor",Ss);var T_=Object.freeze({__proto__:null,getSizeData:mp,evaluateSizeForFeature:Yf,evaluateSizeForZoom:Qf,SIZE_PACK_FACTOR:128});function ed(e,t,r,o,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 C=e[h-1].angleTo(S)-S.angleTo(T);for(C=Math.abs((C+3*Math.PI)%(2*Math.PI)-Math.PI),_.push({distance:v,angleDelta:C}),x+=C;v-_[0].distance>o;)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,o,u,c){for(var h=rd(r,u,c),v=id(r,o)*c,_=0,x=td(e)/2,S=0;S<e.length-1;S++){var T=e[S],C=e[S+1],k=T.dist(C);if(_+k>x){var U=(x-_)/k,N=pr(T.x,C.x,U),J=pr(T.y,C.y,U),W=new Ss(N,J,C.angleTo(T),S);return W._round(),!h||ed(e,W,v,h,t)?W:void 0}_+=k}}function A_(e,t,r,o,u,c,h,v,_){var x=rd(o,c,h),S=id(o,u),T=S*h,C=e[0].x===0||e[0].x===_||e[0].y===0||e[0].y===_;return t-T<t/4&&(t=T+t/4),function k(U,N,J,W,re,ae,oe,ce,ye){for(var Se=ae/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 at=((ke+=J)-$e)/qe,xt=pr(lt.x,Qe.x,at),He=pr(lt.y,Qe.y,at);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(),W&&!ed(U,St,ae,W,re)||We.push(St)}}$e+=qe}return ce||We.length||oe||(We=k(U,$e/2,J,W,re,ae,oe,!0,ye)),We}(e,C?t/2*v%t:(S/2+2*c)*h*v%t,t,x,r,T,C,!1,_)}function nd(e,t,r,o,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>=o&&T.x>=o||(S.x>=o?S=new me(o,S.y+(o-S.x)/(T.x-S.x)*(T.y-S.y))._round():T.x>=o&&(T=new me(o,S.y+(o-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 ad(e,t,r,o){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]],C=c.stretchY||[[0,_]],k=function(xt,He){return xt+He[1]-He[0]},U=T.reduce(k,0),N=C.reduce(k,0),J=v-U,W=_-N,re=0,ae=U,oe=0,ce=N,ye=0,Se=J,Ae=0,$e=W;if(c.content&&o){var ke=c.content;re=$u(T,0,ke[0]),oe=$u(C,0,ke[1]),ae=$u(T,ke[0],ke[2]),ce=$u(C,ke[1],ke[3]),ye=ke[0]-re,Ae=ke[1]-oe,Se=ke[2]-ke[0]-ae,$e=ke[3]-ke[1]-ce}var We=function(xt,He,St,Ht){var er=Zu(xt.stretch-re,ae,x,e.left),Yt=Gu(xt.fixed-ye,Se,xt.stretch,U),Xt=Zu(He.stretch-oe,ce,S,e.top),tr=Gu(He.fixed-Ae,$e,He.stretch,N),br=Zu(St.stretch-re,ae,x,e.left),wr=Gu(St.fixed-ye,Se,St.stretch,U),Wr=Zu(Ht.stretch-oe,ce,S,e.top),kr=Gu(Ht.fixed-Ae,$e,Ht.stretch,N),Hr=new me(er,Xt),or=new me(br,Xt),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),$t=[Fr,-ri,ri,Fr];Hr._matMult($t),or._matMult($t),ft._matMult($t),Mr._matMult($t)}var fr=xt.stretch+xt.fixed,Or=He.stretch+He.fixed;return{tl:Hr,tr:or,bl:ft,br:Mr,tex:{x:c.paddedRect.x+1+fr,y:c.paddedRect.y+1+Or,w:St.stretch+St.fixed-fr,h:Ht.stretch+Ht.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(o&&(c.stretchX||c.stretchY))for(var ze=od(T,J,U),lt=od(C,W,N),Qe=0;Qe<ze.length-1;Qe++)for(var qe=ze[Qe],ct=ze[Qe+1],at=0;at<lt.length-1;at++)u.push(We(qe,lt[at],ct,lt[at+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 o=0,u=0,c=e;u<c.length;u+=1){var h=c[u];o+=Math.max(t,Math.min(r,h[1]))-Math.max(t,Math.min(r,h[0]))}return o}function od(e,t,r){for(var o=[{fixed:-1,stretch:0}],u=0,c=e;u<c.length;u+=1){var h=c[u],v=h[0],_=h[1],x=o[o.length-1];o.push({fixed:v-x.stretch,stretch:x.stretch}),o.push({fixed:v-x.stretch,stretch:x.stretch+(_-v)})}return o.push({fixed:t+1,stretch:r}),o}function Zu(e,t,r,o){return e/t*r+o}function Gu(e,t,r,o){return e-t*r/o}var Wu=function(e,t,r,o,u,c,h,v,_,x){if(this.boxStartIndex=e.length,_){var S=c.top,T=c.bottom,C=c.collisionPadding;C&&(S-=C[1],T+=C[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,W=c.right*h+v,re=c.collisionPadding;if(re&&(J-=re[0]*h,U-=re[1]*h,W+=re[2]*h,N+=re[3]*h),x){var ae=new me(J,U),oe=new me(W,U),ce=new me(J,N),ye=new me(W,N),Se=x*Math.PI/180;ae._rotate(Se),oe._rotate(Se),ce._rotate(Se),ye._rotate(Se),J=Math.min(ae.x,oe.x,ce.x,ye.x),W=Math.max(ae.x,oe.x,ce.x,ye.x),U=Math.min(ae.y,oe.y,ce.y,ye.y),N=Math.max(ae.y,oe.y,ce.y,ye.y)}e.emplaceBack(t.x,t.y,J,U,W,N,r,o,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 o=1/0,u=1/0,c=-1/0,h=-1/0,v=e[0],_=0;_<v.length;_++){var x=v[_];(!_||x.x<o)&&(o=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-o,h-u),T=S/2,C=new Ts([],P_);if(S===0)return new me(o,u);for(var k=o;k<c;k+=S)for(var U=u;U<h;U+=S)C.push(new Is(k+T,U+T,T,e));for(var N=function(re){for(var ae=0,oe=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;oe+=(ke.x+We.x)*ze,ce+=(ke.y+We.y)*ze,ae+=3*ze}return new Is(oe/ae,ce/ae,0,re)}(e),J=C.length;C.length;){var W=C.pop();(W.d>N.d||!N.d)&&(N=W,r&&console.log("found best %d after %d probes",Math.round(1e4*W.d)/1e4,J)),W.max-N.d<=t||(C.push(new Is(W.p.x-(T=W.h/2),W.p.y-T,T,e)),C.push(new Is(W.p.x+T,W.p.y-T,T,e)),C.push(new Is(W.p.x-T,W.p.y+T,T,e)),C.push(new Is(W.p.x+T,W.p.y+T,T,e)),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,o){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,C=T-1;S<T;C=S++){var k=x[S],U=x[C];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,ja(u,k,U))}return(h?1:-1)*Math.sqrt(v)}(this.p,o),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,o=t[e];e>0;){var u=e-1>>1,c=t[u];if(r(o,c)>=0)break;t[e]=c,e=u}t[e]=o},Ts.prototype._down=function(e){for(var t=this.data,r=this.compare,o=this.length>>1,u=t[e];e<o;){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 yp=Number.POSITIVE_INFINITY;function sd(e,t){return t[1]!==yp?function(r,o,u){var c=0,h=0;switch(o=Math.abs(o),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=-o;break;case"top-left":case"bottom-left":case"left":c=o}return[c,h]}(e,t[0],t[1]):function(r,o){var u=0,c=0;o<0&&(o=0);var h=o/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-o;break;case"top":c=o-7}switch(r){case"top-right":case"bottom-right":u=-h;break;case"top-left":case"bottom-left":u=h;break;case"left":u=o;break;case"right":u=-o}return[u,c]}(e,t[0])}function vp(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,o,u,c,h,v,_,x,S,T,C,k,U){var N=function(oe,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],at=0,xt=ct.positionedGlyphs;at<xt.length;at+=1){var He=xt[at];if(He.rect){var St=He.rect||{},Ht=4,er=!0,Yt=1,Xt=0,tr=(Ae||We)&&He.vertical,br=He.metrics.advance*He.scale/2;if(We&&ce.verticalizable&&(Xt=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,Ht=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]-Xt],Hr=[0,0];tr&&(Hr=kr,kr=[0,0]);var or=(He.metrics.left-Ht)*He.scale-br+kr[0],Mr=(-He.metrics.top-Ht)*He.scale+kr[1],ft=or+St.w*He.scale/Yt,Vt=Mr+St.h*He.scale/Yt,Mt=new me(or,Mr),wt=new me(ft,Mr),ri=new me(or,Vt),Fr=new me(ft,Vt);if(tr){var $t=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,$t)._add(Tt)._add(Dn),wt._rotateAround(fr,$t)._add(Tt)._add(Dn),ri._rotateAround(fr,$t)._add(Tt)._add(Dn),Fr._rotateAround(fr,$t)._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,o,e.allowVerticalPlacement),J=e.textSizeData,W=null;J.kind==="source"?(W=[128*u.layout.get("text-size").evaluate(h,{})])[0]>32640&&Lt(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):J.kind==="composite"&&((W=[128*k.compositeTextSizes[0].evaluate(h,{},U),128*k.compositeTextSizes[1].evaluate(h,{},U)])[0]>32640||W[1]>32640)&&Lt(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),e.addSymbols(e.text,N,W,v,c,h,x,t,_.lineStartIndex,_.lineLength,C,U);for(var re=0,ae=S;re<ae.length;re+=1)T[ae[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,o){var u=e.compareText;if(t in u){for(var c=u[t],h=c.length-1;h>=0;h--)if(o.dist(c[h])<r)return!0}else u[t]=[];return u[t].push(o),!1}var M_=_s.VectorTileFeature.types,z_=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Hu(e,t,r,o,u,c,h,v,_,x,S,T,C){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*o),Math.round(32*u),c,h,(k<<1)+(_?1:0),U,16*x,16*S,256*T,256*C)}function gp(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 Ua,this.opacityVertexArray=new Ao,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,o){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,a_.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,o_.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,z_,!0),this.opacityVertexBuffer.itemSize=1),(r||o)&&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=mp(this.zoom,t["text-size"]),this.iconSizeData=mp(this.zoom,t["icon-size"]);var r=this.layers[0].layout,o=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"&&o.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 d},Bt.prototype.calculateGlyphDependencies=function(e,t,r,o,u){for(var c=0;c<e.length;c++)if(t[e.charCodeAt(c)]=!0,(r||o)&&u){var h=Pl[e.charAt(c)];h&&(t[h.charCodeAt(0)]=!0)}},Bt.prototype.populate=function(e,t,r){var o=this.layers[0],u=o.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,C=t.glyphDependencies,k=t.availableImages,U=new ht(this.zoom),N=0,J=e;N<J.length;N+=1){var W=J[N],re=W.feature,ae=W.id,oe=W.index,ce=W.sourceLayerIndex,ye=o._featureFilter.needGeometry,Se=ar(re,ye);if(o._featureFilter.filter(U,Se,r)){ye||(Se.geometry=Jt(re));var Ae=void 0;if(_){var $e=o.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,o,Se))}var We=void 0;if(x){var ze=o.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:ae,text:Ae,icon:We,index:oe,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,at=Ae.sections;ct<at.length;ct+=1){var xt=at[ct];if(xt.image)T[xt.image.name]=!0;else{var He=fl(Ae.toString()),St=xt.fontStack||Qe,Ht=C[St]=C[St]||{};this.calculateGlyphDependencies(xt.text,Ht,qe,this.allowVerticalPlacement,He)}}}}}}u.get("symbol-placement")==="line"&&(this.features=function(er){var Yt={},Xt={},tr=[],br=0;function wr($t){tr.push(er[$t]),br++}function Wr($t,fr,Or){var Tt=Xt[$t];return delete Xt[$t],Xt[fr]=Tt,tr[Tt].geometry[0].pop(),tr[Tt].geometry[0]=tr[Tt].geometry[0].concat(Or[0]),Tt}function kr($t,fr,Or){var Tt=Yt[fr];return delete Yt[fr],Yt[$t]=Tt,tr[Tt].geometry[0].shift(),tr[Tt].geometry[0]=Or[0].concat(tr[Tt].geometry[0]),Tt}function Hr($t,fr,Or){var Tt=Or?fr[0][fr[0].length-1]:fr[0][0];return $t+":"+Tt.x+":"+Tt.y}for(var or=0;or<er.length;or++){var Mr=er[or],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 Xt&&wt in Yt&&Xt[Mt]!==Yt[wt]){var ri=kr(Mt,wt,ft),Fr=Wr(Mt,wt,tr[ri].geometry);delete Yt[Mt],delete Xt[wt],Xt[Hr(Vt,tr[Fr].geometry,!0)]=Fr,tr[ri].geometry=null}else Mt in Xt?Wr(Mt,wt,ft):wt in Yt?kr(Mt,wt,ft):(wr(or),Yt[Mt]=br-1,Xt[wt]=br-1)}else wr(or)}return tr.filter(function($t){return $t.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 o=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:o},h<t.length-1&&(o+=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,o,u,c,h,v,_,x,S,T){for(var C=e.indexArray,k=e.layoutVertexArray,U=e.segments.prepareSegment(4*t.length,k,C,this.canOverlap?c.sortKey:void 0),N=this.glyphOffsetArray.length,J=U.vertexLength,W=this.allowVerticalPlacement&&h===ki.vertical?Math.PI/2:0,re=c.text&&c.text.sections,ae=0;ae<t.length;ae++){var oe=t[ae],ce=oe.tl,ye=oe.tr,Se=oe.bl,Ae=oe.br,$e=oe.tex,ke=oe.pixelOffsetTL,We=oe.pixelOffsetBR,ze=oe.minFontScaleX,lt=oe.minFontScaleY,Qe=oe.glyphOffset,qe=oe.isSDF,ct=oe.sectionIndex,at=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),gp(e.dynamicLayoutVertexArray,v,W),C.emplaceBack(at,at+1,at+2),C.emplaceBack(at+1,at+2,at+3),U.vertexLength+=4,U.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Qe[0]),ae!==t.length-1&&ct===t[ae+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,o[0],o[1],h,0,!1,0,S)},Bt.prototype._addCollisionDebugVertex=function(e,t,r,o,u,c){return t.emplaceBack(0,0),e.emplaceBack(r.x,r.y,o,u,Math.round(c.x),Math.round(c.y))},Bt.prototype.addCollisionDebugVertices=function(e,t,r,o,u,c,h){var v=u.segments.prepareSegment(4,u.layoutVertexArray,u.indexArray),_=v.vertexLength,x=u.layoutVertexArray,S=u.collisionVertexArray,T=h.anchorX,C=h.anchorY;this._addCollisionDebugVertex(x,S,c,T,C,new me(e,t)),this._addCollisionDebugVertex(x,S,c,T,C,new me(r,t)),this._addCollisionDebugVertex(x,S,c,T,C,new me(r,o)),this._addCollisionDebugVertex(x,S,c,T,C,new me(e,o)),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,o){for(var u=e;u<t;u++){var c=this.collisionBoxArray.get(u);this.addCollisionDebugVertices(c.x1,c.y1,c.x2,c.y2,o?this.textCollisionBox:this.iconCollisionBox,c.anchorPoint,r)}},Bt.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new zl(Na,Nf.members,Eo),this.iconCollisionBox=new zl(Na,Nf.members,Eo);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,o,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 C=o;C<u;C++){var k=e.get(C);x.verticalTextBox={x1:k.x1,y1:k.y1,x2:k.x2,y2:k.y2,anchorPointX:k.anchorPointX,anchorPointY:k.anchorPointY},x.verticalTextFeatureIndex=k.featureIndex;break}for(var 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 W=e.get(J);x.verticalIconBox={x1:W.x1,y1:W.y1,x2:W.x2,y2:W.y2,anchorPointX:W.anchorPointX,anchorPointY:W.anchorPointY},x.verticalIconFeatureIndex=W.featureIndex;break}return x},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),o=r.vertexStartIndex+4*r.numGlyphs,u=r.vertexStartIndex;u<o;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),o=[],u=[],c=[],h=0;h<this.symbolInstances.length;++h){c.push(h);var v=this.symbolInstances.get(h);o.push(0|Math.round(t*v.anchorX+r*v.anchorY)),u.push(v.featureIndex)}return c.sort(function(_,x){return o[_]-o[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,o=this.symbolInstanceIndexes;r<o.length;r+=1){var u=this.symbolInstances.get(o[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=gp;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"])}),_p={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,_p)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.recalculate=function(r,o){if(e.prototype.recalculate.call(this,r,o),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,o,u,c){var h=this.layout.get(r).evaluate(o,{},u,c),v=this._unevaluatedLayout._values[r];return v.isDataDriven()||mo(v.value)||!h?h:function(_,x){return x.replace(/{([^{}]+)}/g,function(S,T){return T in _?String(_[T]):""})}(o.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,o=_p.paint.overridableProperties;r<o.length;r+=1){var u=o[r];if(t.hasPaintOverride(this.layout,u)){var c,h=this.paint.get(u),v=new Es(h),_=new Da(v,h.property.specification);c=h.value.kind==="constant"||h.value.kind==="source"?new yo("source",_):new La("composite",_,h.value.zoomStops,h.value._interpolationType),this.paint._values[u]=new jr(h.property,c,h.parameters)}}},t.prototype._handleOverridablePaintPropertyUpdate=function(r,o,u){return!(!this.layout||o.isDataDriven()||u.isDataDriven())&&t.hasPaintOverride(this.layout,r)},t.hasPaintOverride=function(r,o){var u=r.get("text-field"),c=_p.paint.properties[o],h=!1,v=function(S){for(var T=0,C=S;T<C.length;T+=1)if(c.overrides&&c.overrides.hasOverride(C[T]))return void(h=!0)};if(u.value.kind==="constant"&&u.value.value instanceof Ir)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:ip,heatmap:Tg,hillshade:Ag,fill:jg,"fill-extrusion":Yg,line:n_,symbol:L_,background:F_,raster:V_},cd=se.HTMLImageElement,pd=se.HTMLCanvasElement,hd=se.HTMLVideoElement,fd=se.ImageData,Xu=se.ImageBitmap,Bo=function(e,t,r,o){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this.update(t,o)};Bo.prototype.update=function(e,t,r){var o=e.width,u=e.height,c=!(this.size&&this.size[0]===o&&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=[o,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,o,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,o,u,v.RGBA,v.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&v.generateMipmap(v.TEXTURE_2D)},Bo.prototype.bind=function(e,t,r){var o=this.context.gl;o.bindTexture(o.TEXTURE_2D,this.texture),r!==o.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=o.LINEAR),e!==this.filter&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,e),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,r||e),this.filter=e),t!==this.wrap&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,t),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,t),this.wrap=t)},Bo.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},Bo.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var xp=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()})};xp.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))},xp.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 xp(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=ii()?e:se};function dd(e,t,r){var o=2*Math.PI*6378137/256/Math.pow(2,r);return[e*o-2*Math.PI*6378137/2,t*o-2*Math.PI*6378137/2]}Cs.prototype.send=function(e,t,r,o,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=jo(this.globalScope)?void 0:[];return this.target.postMessage({id:h,type:e,hasCallback:!!r,targetMapId:o,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:o,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 o=this.cancelCallbacks[r];delete this.cancelCallbacks[r],o&&o()}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 o=this.callbacks[e];delete this.callbacks[e],o&&(t.error?o(oi(t.error)):o(null,oi(t.data)))}else{var u=!1,c=jo(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,_=oi(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 Wt?new Wt(e.lng,e.lat):Wt.convert(e),this},yr.prototype.setSouthWest=function(e){return this._sw=e instanceof Wt?new Wt(e.lng,e.lat):Wt.convert(e),this},yr.prototype.extend=function(e){var t,r,o=this._sw,u=this._ne;if(e instanceof Wt)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(Wt.convert(e)):this;if(r=e._ne,!(t=e._sw)||!r)return this}return o||u?(o.lng=Math.min(t.lng,o.lng),o.lat=Math.min(t.lat,o.lat),u.lng=Math.max(r.lng,u.lng),u.lat=Math.max(r.lat,u.lat)):(this._sw=new Wt(t.lng,t.lat),this._ne=new Wt(r.lng,r.lat)),this},yr.prototype.getCenter=function(){return new Wt((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 Wt(this.getWest(),this.getNorth())},yr.prototype.getSouthEast=function(){return new Wt(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=Wt.convert(e),r=t.lng,o=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<=o&&o<=this._ne.lat&&u},yr.convert=function(e){return!e||e instanceof yr?e:new yr(e)};var Wt=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: ("+e+", "+t+")");if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Wt.prototype.wrap=function(){return new Wt(It(this.lng,-180,180),this.lat)},Wt.prototype.toArray=function(){return[this.lng,this.lat]},Wt.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Wt.prototype.distanceTo=function(e){var t=Math.PI/180,r=this.lat*t,o=e.lat*t,u=Math.sin(r)*Math.sin(o)+Math.cos(r)*Math.cos(o)*Math.cos((e.lng-this.lng)*t);return 63710088e-1*Math.acos(Math.min(u,1))},Wt.prototype.toBounds=function(e){e===void 0&&(e=0);var t=360*e/40075017,r=t/Math.cos(Math.PI/180*this.lat);return new yr(new Wt(this.lng-r,this.lat-t),new Wt(this.lng+r,this.lat+t))},Wt.convert=function(e){if(e instanceof Wt)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Wt(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new Wt(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var 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 bp(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}var Do=function(e,t,r){r===void 0&&(r=0),this.x=+e,this.y=+t,this.z=+r};Do.fromLngLat=function(e,t){t===void 0&&(t=0);var r=Wt.convert(e);return new Do(vd(r.lng),gd(r.lat),_d(t,r.lat))},Do.prototype.toLngLat=function(){return new Wt(360*this.x-180,bp(this.y))},Do.prototype.toAltitude=function(){return this.z*yd(bp(this.y))},Do.prototype.meterInMercatorCoordinateUnits=function(){return 1/md*(e=bp(this.y),1/Math.cos(e*Math.PI/180));var e};var Lo=function(e,t,r){this.z=e,this.x=t,this.y=r,this.key=Bl(0,e,e,t,r)};Lo.prototype.equals=function(e){return this.z===e.z&&this.x===e.x&&this.y===e.y},Lo.prototype.url=function(e,t){var r,o,u,c,h,v=(o=this.y,u=this.z,c=dd(256*(r=this.x),256*(o=Math.pow(2,u)-o-1),u),h=dd(256*(r+1),256*(o+1),u),c[0]+","+c[1]+","+h[0]+","+h[1]),_=function(x,S,T){for(var C,k="",U=x;U>0;U--)k+=(S&(C=1<<U-1)?1:0)+(T&C?2:0);return k}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(t==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",_).replace("{bbox-epsg-3857}",v)},Lo.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))},Lo.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,o,u){this.overscaledZ=e,this.wrap=t,this.canonical=new Lo(r,+o,+u),this.key=Bl(t,e,r,o,u)};function Bl(e,t,r,o,u){(e*=2)<0&&(e=-1*e-1);var c=1<<r;return(c*c*e+c*u+o).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,o=2*this.canonical.y;return[new vr(t,this.wrap,t,r,o),new vr(t,this.wrap,t,r+1,o),new vr(t,this.wrap,t,r,o+1),new vr(t,this.wrap,t,r+1,o+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 Do(e.x-this.wrap,e.y))},Ve("CanonicalTileID",Lo),Ve("OverscaledTileID",vr,{omit:["posMatrix"]});var da=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 o=this.dim=t.height-2;this.data=new Uint32Array(t.data.buffer),this.encoding=r||"mapbox";for(var u=0;u<o;u++)this.data[this._idx(-1,u)]=this.data[this._idx(0,u)],this.data[this._idx(o,u)]=this.data[this._idx(o-1,u)],this.data[this._idx(u,-1)]=this.data[this._idx(u,0)],this.data[this._idx(u,o)]=this.data[this._idx(u,o-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(o,-1)]=this.data[this._idx(o-1,0)],this.data[this._idx(-1,o)]=this.data[this._idx(0,o-1)],this.data[this._idx(o,o)]=this.data[this._idx(o-1,o-1)]};da.prototype.get=function(e,t){var r=new Uint8Array(this.data.buffer),o=4*this._idx(e,t);return(this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox)(r[o],r[o+1],r[o+2])},da.prototype.getUnpackVector=function(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},da.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)},da.prototype._unpackMapbox=function(e,t,r){return(256*e*256+256*t+r)/10-1e4},da.prototype._unpackTerrarium=function(e,t,r){return 256*e+t+r/256-32768},da.prototype.getPixels=function(){return new pi({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},da.prototype.backfillBorder=function(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");var o=t*this.dim,u=t*this.dim+this.dim,c=r*this.dim,h=r*this.dim+this.dim;switch(t){case-1:o=u-1;break;case 1:u=o+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=o;S<u;S++)this.data[this._idx(S,x)]=e.data[this._idx(S+v,x+_)]},Ve("DEMData",da);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,o,u){this.type="Feature",this._vectorTileFeature=e,e._z=t,e._x=r,e._y=o,this.properties=e.properties,this.id=u},wp={geometry:{configurable:!0}};wp.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},wp.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,wp);var Ps=function(){this.state={},this.stateChanges={},this.deletedStates={}};Ps.prototype.updateState=function(e,t,r){var o=String(t);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][o]=this.stateChanges[e][o]||{},tt(this.stateChanges[e][o],r),this.deletedStates[e]===null)for(var u in this.deletedStates[e]={},this.state[e])u!==o&&(this.deletedStates[e][u]=null);else if(this.deletedStates[e]&&this.deletedStates[e][o]===null)for(var c in this.deletedStates[e][o]={},this.state[e][o])r[c]||(this.deletedStates[e][o][c]=null);else for(var h in r)this.deletedStates[e]&&this.deletedStates[e][o]&&this.deletedStates[e][o][h]===null&&delete this.deletedStates[e][o][h]},Ps.prototype.removeFeatureState=function(e,t,r){if(this.deletedStates[e]!==null){var o=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},r&&t!==void 0)this.deletedStates[e][o]!==null&&(this.deletedStates[e][o]=this.deletedStates[e][o]||{},this.deletedStates[e][o][r]=null);else if(t!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][o])for(r in this.deletedStates[e][o]={},this.stateChanges[e][o])this.deletedStates[e][o][r]=null;else this.deletedStates[e][o]=null;else this.deletedStates[e]=null}},Ps.prototype.getState=function(e,t){var r=String(t),o=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 o[c]}return o},Ps.prototype.initializeTileState=function(e,t){e.setFeatureState(this.state,t)},Ps.prototype.coalesceChanges=function(e,t){var r={};for(var o in this.stateChanges){this.state[o]=this.state[o]||{};var u={};for(var c in this.stateChanges[o])this.state[o][c]||(this.state[o][c]={}),tt(this.state[o][c],this.stateChanges[o][c]),u[c]=this.state[o][c];r[o]=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 C in e)e[C].setFeatureState(r,t)};var ma=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,o,u){return cr(e,function(c,h){var v=t instanceof Io?t.get(h):null;return v&&v.evaluate?v.evaluate(r,o,u):v})}function wd(e){for(var t=1/0,r=1/0,o=-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),o=Math.max(o,v.x),u=Math.max(u,v.y)}return{minX:t,minY:r,maxX:o,maxY:u}}function q_(e,t){return t-e}ma.prototype.insert=function(e,t,r,o,u,c){var h=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,o,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 C=x[T];S[0]=Math.min(S[0],C.x),S[1]=Math.min(S[1],C.y),S[2]=Math.max(S[2],C.x),S[3]=Math.max(S[3],C.y)}S[0]<8192&&S[1]<8192&&S[2]>=0&&S[3]>=0&&v.insert(h,S[0],S[1],S[2],S[3])}},ma.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},ma.prototype.query=function(e,t,r,o){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),C=wd(e.cameraQueryGeometry),k=this.grid3D.query(C.minX-x,C.minY-x,C.maxX+x,C.maxY+x,function(oe,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 at=0,xt=ct;at<xt.length;at+=1)if(Ji(Ae,xt[at]))return!0}for(var He=0;He<Ae.length-1;He++)if(ko(Ae[He],Ae[He+1],ct))return!0;return!1}(e.cameraQueryGeometry,oe-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,W={},re=function(oe){var ce=T[oe];if(ce!==J){J=ce;var ye=u.featureIndexArray.get(ce),Se=null;u.loadMatchingFeature(W,ye.bucketIndex,ye.sourceLayerIndex,ye.featureIndex,v,c.layers,c.availableImages,t,r,o,function(Ae,$e,ke){return Se||(Se=Jt(Ae)),$e.queryIntersectsFeature(_,Ae,ke,Se,u.z,e.transform,h,e.pixelPosMatrix)})}},ae=0;ae<T.length;ae++)re(ae);return W},ma.prototype.loadMatchingFeature=function(e,t,r,o,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 C=this.sourceLayerCoder.decode(r),k=this.vtLayers[C].feature(o);if(u.needGeometry){var U=ar(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,C),J=0;J<T.length;J++){var W=T[J];if(!(c&&c.indexOf(W)<0)){var re=v[W];if(re){var ae={};N!==void 0&&x&&(ae=x.getState(re.sourceLayer||"_geojsonTileLayer",N));var oe=tt({},_[W]);oe.paint=bd(oe.paint,re.paint,k,ae,h),oe.layout=bd(oe.layout,re.layout,k,ae,h);var ce=!S||S(k,re,ae);if(ce){var ye=new Ju(k,this.z,this.x,this.y,N);ye.layer=oe;var Se=e[W];Se===void 0&&(Se=e[W]=[]),Se.push({featureIndex:o,feature:ye,intersectionZ:ce})}}}}}},ma.prototype.lookupSymbolFeatures=function(e,t,r,o,u,c,h,v){var _={};this.loadVTLayers();for(var x=rs(u),S=0,T=e;S<T.length;S+=1)this.loadMatchingFeature(_,r,o,T[S],x,c,h,v,t);return _},ma.prototype.hasLayer=function(e){for(var t=0,r=this.bucketLayerIDs;t<r.length;t+=1)for(var o=0,u=r[t];o<u.length;o+=1)if(e===u[o])return!0;return!1},ma.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",ma,{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 o 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 C=function(){var N=U[k],J=N.layerIds.map(function(ae){return S.getLayer(ae)}).filter(Boolean);if(J.length!==0){N.layers=J,N.stateDependentLayerIds&&(N.stateDependentLayers=N.stateDependentLayerIds.map(function(ae){return J.filter(function(oe){return oe.id===ae})[0]}));for(var W=0,re=J;W<re.length;W+=1)T[re[W].id]=N}},k=0,U=x;k<U.length;k+=1)C();return T}(e.buckets,t.style),this.hasSymbolBuckets=!1,this.buckets){var u=this.buckets[o];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 a},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 o=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Bo(e,this.imageAtlas.image,o.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Bo(e,this.glyphAtlasImage,o.ALPHA),this.glyphAtlasImage=null)},Pr.prototype.prepare=function(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)},Pr.prototype.queryRenderedFeatures=function(e,t,r,o,u,c,h,v,_,x){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:o,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 o=r.loadVTLayers(),u=t?t.sourceLayer:"",c=o._geojsonTileLayer||o[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},C=0;C<c.length;C++){var k=c.feature(C);if(h.needGeometry){var U=ar(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=Ta(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 o=Date.now(),u=!1;if(this.expirationTime>o)u=!1;else if(t)if(this.expirationTime<t)u=!0;else{var c=this.expirationTime-t;c?this.expirationTime=o+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 o in this.buckets)if(t.style.hasLayer(o)){var u=this.buckets[o],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(o);_&&(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={},o=0,u=t;o<u.length;o+=1)r[u[o]]=!0;this.dependencies[e]=r},Pr.prototype.hasDependency=function(e,t){for(var r=0,o=e;r<o.length;r+=1){var u=this.dependencies[o[r]];if(u){for(var c=0,h=t;c<h.length;c+=1)if(u[h[c]])return!0}}return!1};var Ga=se.performance,Sd=function(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},Ga.mark(this._marks.start)};Sd.prototype.finish=function(){Ga.mark(this._marks.end);var e=Ga.getEntriesByName(this._marks.measure);return e.length===0&&(Ga.measure(this._marks.measure,this._marks.start,this._marks.end),e=Ga.getEntriesByName(this._marks.measure),Ga.clearMarks(this._marks.start),Ga.clearMarks(this._marks.end),Ga.clearMeasures(this._marks.measure)),e},l.Actor=Cs,l.AlphaImage=zo,l.CanonicalTileID=Lo,l.CollisionBoxArray=a,l.Color=Et,l.DEMData=da,l.DataConstantProperty=Ze,l.DictionaryCoder=Ku,l.EXTENT=8192,l.ErrorEvent=Q,l.EvaluationParameters=ht,l.Event=j,l.Evented=te,l.FeatureIndex=ma,l.FillBucket=pn,l.FillExtrusionBucket=hn,l.ImageAtlas=Ml,l.ImagePosition=Nu,l.LineBucket=ti,l.LngLat=Wt,l.LngLatBounds=yr,l.MercatorCoordinate=Do,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=Wo,l.SegmentVector=D,l.SourceFeatureState=Ps,l.StructArrayLayout1ui2=wl,l.StructArrayLayout2f1f2i16=ca,l.StructArrayLayout2i4=ua,l.StructArrayLayout3ui6=Cn,l.StructArrayLayout4i8=gl,l.SymbolBucket=Bt,l.Texture=Bo,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=gp,l.asyncAll=function(e,t,r){if(!e.length)return r(null,[]);var o=e.length,u=new Array(e.length),c=null;e.forEach(function(h,v){t(h,function(_,x){_&&(c=_),u[v]=x,--o==0&&r(c,u)})})},l.bezier=Re,l.bindAll=ur,l.browser=rn,l.cacheEntryPossiblyAdded=function(e){++no>Go&&(e.getActor().send("enforceCacheSizeLimit",Ca),no=0)},l.clamp=je,l.clearTileCache=function(e){var t=se.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=le,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 o=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-o*_,e[2]=o*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 o=0;o<t.length;o++)if(!e(t[o],r[o]))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=wo,l.endsWith=Sr,l.enforceCacheSizeLimit=function(e){Pa(),wi&&wi.then(function(t){t.keys().then(function(r){for(var o=0;o<r.length-e;o++)t.delete(r[o])})})},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),o=Math.cos(t);return e[0]=o,e[1]=r,e[2]=0,e[3]=-r,e[4]=o,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},l.getAnchorAlignment=dp,l.getAnchorJustification=vp,l.getArrayBuffer=oo,l.getImage=E,l.getJSON=function(e,t){return ka(tt(e,{type:"json"}),t)},l.getRTLTextPluginStatus=yl,l.getReferrer=Wn,l.getVideo=function(e,t){var r,o,u=se.document.createElement("video");u.muted=!0,u.onloadstart=function(){t(null,u)};for(var c=0;c<e.length;c++){var h=se.document.createElement("source");r=e[c],o=void 0,(o=se.document.createElement("a")).href=r,(o.protocol!==se.document.location.protocol||o.host!==se.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],o=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],C=t[10],k=t[11],U=t[12],N=t[13],J=t[14],W=t[15],re=r*v-o*h,ae=r*_-u*h,oe=r*x-c*h,ce=o*_-u*v,ye=o*x-c*v,Se=u*x-c*_,Ae=S*N-T*U,$e=S*J-C*U,ke=S*W-k*U,We=T*J-C*N,ze=T*W-k*N,lt=C*W-k*J,Qe=re*lt-ae*ze+oe*We+ce*ke-ye*$e+Se*Ae;return Qe?(e[0]=(v*lt-_*ze+x*We)*(Qe=1/Qe),e[1]=(u*ze-o*lt-c*We)*Qe,e[2]=(N*Se-J*ye+W*ce)*Qe,e[3]=(C*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*oe-U*Se-W*ae)*Qe,e[7]=(S*Se-C*oe+k*ae)*Qe,e[8]=(h*ze-v*ke+x*Ae)*Qe,e[9]=(o*ke-r*ze-c*Ae)*Qe,e[10]=(U*ye-N*oe+W*re)*Qe,e[11]=(T*oe-S*ye-k*re)*Qe,e[12]=(v*$e-h*We-_*Ae)*Qe,e[13]=(r*We-o*$e+u*Ae)*Qe,e[14]=(N*ae-U*ce-J*re)*Qe,e[15]=(S*ce-T*ae+C*re)*Qe,e):null},l.isChar=Ce,l.isMapboxURL=_i,l.keysDifference=function(e,t){var r=[];for(var o in e)o in t||r.push(o);return r},l.makeRequest=ka,l.mapObject=cr,l.mercatorXfromLng=vd,l.mercatorYfromLat=gd,l.mercatorZfromAltitude=_d,l.mul=rp,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],o=t[1],u=t[2],c=r*r+o*o+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=ao,l.ortho=function(e,t,r,o,u,c,h){var v=1/(t-r),_=1/(o-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+o)*_,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,o,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 C=e.iconSizeData,k=C.maxZoom;x.compositeIconSizes=[_["icon-size"].possiblyEvaluate(new ht(C.minZoom),h),_["icon-size"].possiblyEvaluate(new ht(k),h)]}x.layoutTextSize=_["text-size"].possiblyEvaluate(new ht(e.zoom+1),h),x.layoutIconSize=_["icon-size"].possiblyEvaluate(new ht(e.zoom+1),h),x.textMaxSize=_["text-size"].possiblyEvaluate(new ht(18));for(var 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"),W=v.get("text-size"),re=function(){var ce=oe[ae],ye=v.get("text-font").evaluate(ce,{},h).join(","),Se=W.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),at=v.get("text-variable-anchor");if(!at){var xt=v.get("text-radial-offset").evaluate(ce,{},h);ze=xt?sd(ct,[24*xt,yp]):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"),Ht=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,Ht,U,ct,"left",qe,ze,ki.vertical,!0,St,Ae,Se))};if(!N&&at){for(var Yt=He==="auto"?at.map(function(ft){return vp(ft)}):[He],Xt=!1,tr=0;tr<Yt.length;tr++){var br=Yt[tr];if(!ke.horizontal[br])if(Xt)ke.horizontal[br]=ke.horizontal[0];else{var wr=qu(We,t,r,u,ye,Ht,U,"center",br,qe,ze,ki.horizontal,!1,St,Ae,Se);wr&&(ke.horizontal[br]=wr,Xt=wr.positionedLines.length===1)}}er()}else{He==="auto"&&(He=vp(ct));var Wr=qu(We,t,r,u,ye,Ht,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,Ht,U,ct,He,qe,ze,ki.vertical,!1,St,Ae,Se))}}var kr=void 0,Hr=!1;if(ce.icon&&ce.icon.name){var or=o[ce.icon.name];or&&(kr=function(ft,Vt,Mt){var wt=dp(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=or.sdf,e.sdfIcons===void 0?e.sdfIcons=or.sdf:e.sdfIcons!==or.sdf&&Lt("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(or.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,$t,fr,Or,Tt,Dn){var Mi=Fr.textMaxSize.evaluate(Vt,{});Mi===void 0&&(Mi=$t);var Ln,sr=ft.layers[0].layout,Rn=sr.get("icon-offset").evaluate(Vt,{},Dn),Qi=ud(Mt.horizontal),ks=$t/24,Ro=ft.tilePixelRatio*ks,Ms=ft.tilePixelRatio*Mi/24,ya=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",va=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 Wa=function(j_,jl){jl.x<0||jl.x>=8192||jl.y<0||jl.y>=8192||function(lr,fn,$_,Ha,Ap,Ad,oc,Fn,sc,$l,lc,uc,Ep,Ed,Zl,Cd,Pd,kd,Md,zd,zi,cc,Bd,On,Z_){var Dd,Oo,Vs,Us,Ns,qs=lr.addToLineVertexArray(fn,$_),Ld=0,Rd=0,Fd=0,Od=0,Cp=-1,Pp=-1,ga={},Vd=V(""),kp=0,Mp=0;if(Fn._unevaluatedLayout.getValue("text-radial-offset")===void 0?(kp=(Dd=Fn.layout.get("text-offset").evaluate(zi,{},On).map(function(Wl){return 24*Wl}))[0],Mp=Dd[1]):(kp=24*Fn.layout.get("text-radial-offset").evaluate(zi,{},On),Mp=yp),lr.allowVerticalPlacement&&Ha.vertical){var Ud=Fn.layout.get("text-rotate").evaluate(zi,{},On)+90;Us=new Wu(sc,fn,$l,lc,uc,Ha.vertical,Ep,Ed,Zl,Ud),oc&&(Ns=new Wu(sc,fn,$l,lc,uc,oc,Pd,kd,Zl,Ud))}if(Ap){var zp=Fn.layout.get("icon-rotate").evaluate(zi,{}),Nd=Fn.layout.get("icon-text-fit")!=="none",qd=ad(Ap,zp,Bd,Nd),Bp=oc?ad(oc,zp,Bd,Nd):void 0;Vs=new Wu(sc,fn,$l,lc,uc,Ap,Pd,kd,!1,zp),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),Cp=lr.icon.placedSymbolArray.length-1,Bp&&(Rd=4*Bp.length,lr.addSymbols(lr.icon,Bp,Gl,zd,Md,zi,ki.vertical,fn,qs.lineStartIndex,qs.lineLength,-1,On),Pp=lr.icon.placedSymbolArray.length-1)}for(var $d in Ha.horizontal){var pc=Ha.horizontal[$d];if(!Oo){Vd=V(pc.text);var G_=Fn.layout.get("text-rotate").evaluate(zi,{},On);Oo=new Wu(sc,fn,$l,lc,uc,pc,Ep,Ed,Zl,G_)}var Zd=pc.positionedLines.length===1;if(Fd+=ld(lr,fn,pc,Ad,Fn,Zl,zi,Cd,qs,Ha.vertical?ki.horizontal:ki.horizontalOnly,Zd?Object.keys(Ha.horizontal):[$d],ga,Cp,cc,On),Zd)break}Ha.vertical&&(Od+=ld(lr,fn,Ha.vertical,Ad,Fn,Zl,zi,Cd,qs,ki.vertical,["vertical"],ga,Pp,cc,On));var W_=Oo?Oo.boxStartIndex:lr.collisionBoxArray.length,H_=Oo?Oo.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(Oo,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,ga.right>=0?ga.right:-1,ga.center>=0?ga.center:-1,ga.left>=0?ga.left:-1,ga.vertical||-1,Cp,Pp,Vd,W_,H_,X_,K_,J_,Y_,Q_,ex,$l,Fd,Od,Ld,Rd,Gd,0,Ep,kp,Mp,Vn)}(ft,jl,j_,Mt,wt,ri,Ln,ft.layers[0],ft.collisionBoxArray,Vt.index,Vt.sourceLayerIndex,ft.index,Ro,Yu,Qu,Or,ya,Bs,ec,Rn,Vt,Fr,Tt,Dn,$t)};if(va==="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)||Wa(rc,ic)}else if(va==="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&&Wa(Ul,nc)}}else if(Vt.type==="Polygon")for(var Rs=0,ac=up(Vt.geometry,0);Rs<ac.length;Rs+=1){var Fs=ac[Rs],Nl=C_(Fs,16);Wa(Fs[0],new Ss(Nl.x,Nl.y,0))}else if(Vt.type==="LineString")for(var Fo=0,ql=Vt.geometry;Fo<ql.length;Fo+=1){var Os=ql[Fo];Wa(Os,new Ss(Os[0].x,Os[0].y,0))}else if(Vt.type==="Point")for(var Sp=0,Td=Vt.geometry;Sp<Td.length;Sp+=1)for(var Tp=0,Id=Td[Sp];Tp<Id.length;Tp+=1){var Ip=Id[Tp];Wa([Ip],new Ss(Ip.x,Ip.y,0))}}(e,ce,ke,kr,o,x,Ae,$e,ze,Hr,h)},ae=0,oe=e.features;ae<oe.length;ae+=1)re();c&&e.generateCollisionDebugBuffers()},l.perspective=function(e,t,r,o,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+o)*(c=1/(o-u)),e[14]=2*u*o*c):(e[10]=-1,e[14]=-2*o),e},l.pick=function(e,t){for(var r={},o=0;o<t.length;o++){var u=t[o];u in e&&(r[u]=e[u])}return r},l.plugin=di,l.polygonIntersectsPolygon=Mn,l.postMapLoadEvent=ro,l.postTurnstileEvent=Zo,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 o=t[0],u=t[1],c=t[2],h=t[3],v=Math.sin(r),_=Math.cos(r);return e[0]=o*_+c*v,e[1]=u*_+h*v,e[2]=o*-v+c*_,e[3]=u*-v+h*_,e},l.rotateX=function(e,t,r){var o=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],C=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=c*u+x*o,e[5]=h*u+S*o,e[6]=v*u+T*o,e[7]=_*u+C*o,e[8]=x*u-c*o,e[9]=S*u-h*o,e[10]=T*u-v*o,e[11]=C*u-_*o,e},l.rotateZ=function(e,t,r){var o=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],C=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=c*u+x*o,e[1]=h*u+S*o,e[2]=v*u+T*o,e[3]=_*u+C*o,e[4]=x*u-c*o,e[5]=S*u-h*o,e[6]=T*u-v*o,e[7]=C*u-_*o,e},l.scale=function(e,t,r){var o=r[0],u=r[1],c=r[2];return e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3]*o,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){Ca=e,Go=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,To(),r||Ui()},l.sphericalToCartesian=function(e){var t=e[0],r=e[1],o=e[2];return r+=90,r*=Math.PI/180,o*=Math.PI/180,{x:t*Math.cos(r)*Math.sin(o),y:t*Math.sin(r)*Math.sin(o),z:t*Math.cos(o)}},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 o=t[0],u=t[1],c=t[2];return e[0]=o*r[0]+u*r[3]+c*r[6],e[1]=o*r[1]+u*r[4]+c*r[7],e[2]=o*r[2]+u*r[5]+c*r[8],e},l.transformMat4=ms,l.translate=function(e,t,r){var o,u,c,h,v,_,x,S,T,C,k,U,N=r[0],J=r[1],W=r[2];return t===e?(e[12]=t[0]*N+t[4]*J+t[8]*W+t[12],e[13]=t[1]*N+t[5]*J+t[9]*W+t[13],e[14]=t[2]*N+t[6]*J+t[10]*W+t[14],e[15]=t[3]*N+t[7]*J+t[11]*W+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],C=t[9],k=t[10],U=t[11],e[0]=o=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]=C,e[10]=k,e[11]=U,e[12]=o*N+v*J+T*W+t[12],e[13]=u*N+_*J+C*W+t[13],e[14]=c*N+x*J+k*W+t[14],e[15]=h*N+S*J+U*W+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=ep,l.validateStyle=xo,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=se,l.wrap=It}),G(["./shared"],function(l){function le(I){var E=typeof I;if(E==="number"||E==="boolean"||E==="string"||I==null)return JSON.stringify(I);if(Array.isArray(I)){for(var P="[",F=0,j=I;F<j.length;F+=1)P+=le(j[F])+",";return P+"]"}for(var Q=Object.keys(I).sort(),te="{",B=0;B<Q.length;B++)te+=JSON.stringify(Q[B])+":"+le(I[Q[B]])+",";return te+"}"}function H(I){for(var E="",P=0,F=l.refProperties;P<F.length;P+=1)E+="/"+le(I[F[P]]);return E}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,E){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=E;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]||H(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 E={},P=[];for(var F in I){var j=I[F],Q=E[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=E[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=E};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 se(I,E,P){for(var F=new l.EvaluationParameters(E),j=0,Q=I;j<Q.length;j+=1)Q[j].recalculate(F,P)}function ge(I,E){var P=l.getArrayBuffer(I.request,function(F,j,Q,te){F?E(F):j&&E(null,{vectorTile:new l.vectorTile.VectorTile(new l.pbf(j)),rawData:j,cacheControl:Q,expires:te})});return function(){P.cancel(),E()}}Le.prototype.parse=function(I,E,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=E.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"&&(se(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?(se(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)&&(se(Jr.layers,this.zoom,P),Jr.addFeatures(be,this.tileID.canonical,mt.patternPositions))}this.status="done",j(null,{buckets:l.values(fe).filter(function(so){return!so.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,E,P,F){this.actor=I,this.layerIndex=E,this.availableImages=P,this.loadVectorData=F||ge,this.loading={},this.loaded={}};Re.prototype.loadTile=function(I,E){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,E(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 E(fe);E(null,l.extend({rawTileData:Z.slice(0)},be,ne,xe))}),P.loaded=P.loaded||{},P.loaded[F]=Q})},Re.prototype.reloadTile=function(I,E){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)),E(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,E){var P=this.loading,F=I.uid;P&&P[F]&&P[F].abort&&(P[F].abort(),delete P[F]),E()},Re.prototype.removeTile=function(I,E){var P=this.loaded,F=I.uid;P&&P[F]&&delete P[F],E()};var Ye=l.window.ImageBitmap,je=function(){this.loaded={}};function It(I,E){if(I.length!==0){tt(I[0],E);for(var P=1;P<I.length;P++)tt(I[P],!E)}}function tt(I,E){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!=!!E&&I.reverse()}je.prototype.loadTile=function(I,E){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,E(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 E=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:E.width,height:E.height},E.data)},je.prototype.removeTile=function(I){var E=this.loaded,P=I.uid;E&&E[P]&&delete E[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=[],E=0,P=this._feature.geometry;E<P.length;E+=1){var F=P[E];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,E,P){return dt.call(this,I,E,P)};var jt=function(I){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=l.EXTENT,this.length=I.length,this._features=I};jt.prototype.feature=function(I){return new Dt(this._features[I])};var Kt=l.vectorTile.VectorTileFeature,ur=Sr;function Sr(I,E){this.options=E||{},this.features=I,this.length=I.length}function cr(I,E){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=E||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 E=0;E<I.length;E++){for(var P=I[E],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,E=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];E=Math.min(E,Z.x),P=Math.max(P,Z.x),F=Math.min(F,Z.y),j=Math.max(j,Z.y)}return[E,F,P,j]},cr.prototype.toGeoJSON=Kt.prototype.toGeoJSON;var Xr=gi,gr=ur;function gi(I){var E=new l.pbf;return function(P,F){for(var j in P.layers)F.writeMessage(3,Lt,P.layers[j])}(I,E),E.finish()}function Lt(I,E){var P;E.writeVarintField(15,I.version||1),E.writeStringField(1,I.name||""),E.writeVarintField(5,I.extent||4096);var F={keys:[],values:[],keycache:{},valuecache:{}};for(P=0;P<I.length;P++)F.feature=I.feature(P),E.writeMessage(2,Tr,F);var j=F.keys;for(P=0;P<j.length;P++)E.writeStringField(3,j[P]);var Q=F.values;for(P=0;P<Q.length;P++)E.writeMessage(4,jo,Q[P])}function Tr(I,E){var P=I.feature;P.id!==void 0&&E.writeVarintField(1,P.id),E.writeMessage(2,Sa,I),E.writeVarintField(3,P.type),E.writeMessage(4,Ia,P)}function Sa(I,E){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),E.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),E.writeVarint(fe)}}function ii(I,E){return(E<<3)+(7&I)}function Ta(I){return I<<1^I>>31}function Ia(I,E){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),E.writeVarint(ii(1,ne));for(var xe=F===3?Z.length-1:Z.length,we=0;we<xe;we++){we===1&&F!==1&&E.writeVarint(ii(2,xe-1));var fe=Z[we].x-j,be=Z[we].y-Q;E.writeVarint(Ta(fe)),E.writeVarint(Ta(be)),j+=fe,Q+=be}F===3&&E.writeVarint(ii(7,1))}}function jo(I,E){var P=typeof I;P==="string"?E.writeStringField(1,I):P==="boolean"?E.writeBooleanField(7,I):P==="number"&&(I%1!=0?E.writeDoubleField(3,I):I<0?E.writeSVarintField(6,I):E.writeVarintField(5,I))}function dn(I,E,P,F){Bi(I,P,F),Bi(E,2*P,2*F),Bi(E,2*P+1,2*F+1)}function Bi(I,E,P){var F=I[E];I[E]=I[P],I[P]=F}function Zi(I,E,P,F){var j=I-P,Q=E-F;return j*j+Q*Q}Xr.fromVectorTileJs=gi,Xr.fromGeojsonVt=function(I,E){E=E||{};var P={};for(var F in I)P[F]=new ur(I[F].features,E),P[F].name=F,P[F].version=E.version,P[F].extent=E.extent;return gi({layers:P})},Xr.GeoJSONWrapper=gr;var qn=function(I){return I[0]},jn=function(I){return I[1]},mn=function(I,E,P,F,j){E===void 0&&(E=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]=E(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,E,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,E,P,F,this.nodeSize)},mn.prototype.within=function(I,E,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,E,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,E,P,F,j){return{x:I,y:E,zoom:1/0,id:P,parentId:-1,numPoints:F,properties:j}}function Rt(I,E){var P=I.geometry.coordinates,F=P[1];return{x:Di(P[0]),y:yt(F),zoom:1/0,index:E,parentId:-1}}function Gi(I){return{type:"Feature",id:I.id,properties:Aa(I),geometry:{type:"Point",coordinates:[(F=I.x,360*(F-.5)),(E=I.y,P=(180-360*E)*Math.PI/180,360*Math.atan(Math.exp(P))/Math.PI-90)]}};var E,P,F}function Aa(I){var E=I.numPoints,P=E>=1e4?Math.round(E/1e3)+"k":E>=1e3?Math.round(E/100)/10+"k":E;return yn(yn({},I.properties),{cluster:!0,cluster_id:I.id,point_count:E,point_count_abbreviated:P})}function Di(I){return I/360+.5}function yt(I){var E=Math.sin(I*Math.PI/180),P=.5-.25*Math.log((1+E)/(1-E))/Math.PI;return P<0?0:P>1?1:P}function yn(I,E){for(var P in E)I[P]=E[P];return I}function Kr(I){return I.x}function _i(I){return I.y}function Js(I,E,P,F,j,Q){var te=j-P,B=Q-F;if(te!==0||B!==0){var Z=((I-P)*te+(E-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=E-F)*B}function Li(I,E,P,F){var j={id:I===void 0?null:I,type:E,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")eo(Q,te);else if(B==="Polygon"||B==="MultiLineString")for(var Z=0;Z<te.length;Z++)eo(Q,te[Z]);else if(B==="MultiPolygon")for(Z=0;Z<te.length;Z++)for(var ne=0;ne<te[Z].length;ne++)eo(Q,te[Z][ne])}(j),j}function eo(I,E){for(var P=0;P<E.length;P+=3)I.minX=Math.min(I.minX,E[P]),I.minY=Math.min(I.minY,E[P+1]),I.maxX=Math.max(I.maxX,E[P]),I.maxY=Math.max(I.maxY,E[P+1])}function xi(I,E,P,F){if(E.geometry){var j=E.geometry.coordinates,Q=E.geometry.type,te=Math.pow(P.tolerance/((1<<P.maxZoom)*P.extent),2),B=[],Z=E.id;if(P.promoteId?Z=E.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")Ea(j,B,te,!1);else if(Q==="MultiLineString"){if(P.lineMetrics){for(ne=0;ne<j.length;ne++)Ea(j[ne],B=[],te,!1),I.push(Li(Z,"LineString",B,E.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<E.geometry.geometries.length;ne++)xi(I,{id:Z,geometry:E.geometry.geometries[ne],properties:E.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,E.properties))}}function $n(I,E){E.push(wi(I[0])),E.push(Zn(I[1])),E.push(0)}function Ea(I,E,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]);E.push(Z),E.push(ne),E.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=E.length-3;E[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))}(E,0,xe,P),E[xe+2]=1,E.size=Math.abs(te),E.start=0,E.end=E.size}function bi(I,E,P,F){for(var j=0;j<I.length;j++){var Q=[];Ea(I[j],Q,P,F),E.push(Q)}}function wi(I){return I/360+.5}function Zn(I){var E=Math.sin(I*Math.PI/180),P=.5-.25*Math.log((1+E)/(1-E))/Math.PI;return P<0?0:P>1?1:P}function Ri(I,E,P,F,j,Q,te,B){if(F/=E,Q>=(P/=E)&&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")$o(we,Oe,P,F,j);else if(fe==="LineString")Zo(we,Oe,P,F,j,!1,B.lineMetrics);else if(fe==="MultiLineString")ro(we,Oe,P,F,j,!1);else if(fe==="Polygon")ro(we,Oe,P,F,j,!0);else if(fe==="MultiPolygon")for(var de=0;de<we.length;de++){var Be=[];ro(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 $o(I,E,P,F,j){for(var Q=0;Q<I.length;Q+=3){var te=I[Q+j];te>=P&&te<=F&&(E.push(I[Q]),E.push(I[Q+1]),E.push(I[Q+2]))}}function Zo(I,E,P,F,j,Q,te){for(var B,Z,ne=to(I),xe=j===0?Go:Pa,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)):Ca(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),E.push(ne),ne=to(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&&Ca(ne,be,Ue,Oe),Me=ne.length-3,Q&&Me>=3&&(ne[Me]!==ne[0]||ne[Me+1]!==ne[1])&&Ca(ne,ne[0],ne[1],ne[2]),ne.length&&E.push(ne)}function to(I){var E=[];return E.size=I.size,E.start=I.start,E.end=I.end,E}function ro(I,E,P,F,j,Q){for(var te=0;te<I.length;te++)Zo(I[te],E,P,F,j,Q,!1)}function Ca(I,E,P,F){I.push(E),I.push(P),I.push(F)}function Go(I,E,P,F,j,Q){var te=(Q-E)/(F-E);return I.push(Q),I.push(P+(j-P)*te),I.push(1),te}function Pa(I,E,P,F,j,Q){var te=(Q-P)/(j-P);return I.push(E+(F-E)*te),I.push(Q),I.push(1),te}function io(I,E){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,E);else if(te==="MultiLineString"||te==="Polygon"){j=[];for(var B=0;B<Q.geometry.length;B++)j.push(Gn(Q.geometry[B],E))}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],E));j.push(Z)}P.push(Li(Q.id,te,j,Q.tags))}return P}function Gn(I,E){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]+E,I[F+1],I[F+2]);return P}function no(I,E){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(ao(ne[F],ne[F+1],E,Q,te,B));else for(F=0;F<ne.length;F++){var we=[];for(j=0;j<ne[F].length;j+=2)we.push(ao(ne[F][j],ne[F][j+1],E,Q,te,B));Z.geometry.push(we)}}return I.transformed=!0,I}function ao(I,E,P,F,j,Q){return[Math.round(P*(I*F-j)),Math.round(P*(E*F-Q))]}function Wo(I,E,P,F,j){for(var Q=E===j.maxZoom?0:j.tolerance/((1<<E)*j.extent),te={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:P,y:F,z:E,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},B=0;B<I.length;B++){te.numFeatures++,Ho(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 Ho(I,E,P,F){var j=E.geometry,Q=E.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=E.tags||null;if(Q==="LineString"&&F.lineMetrics){for(var we in xe={},E.tags)xe[we]=E.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};E.id!==null&&(fe.id=E.id),I.features.push(fe)}}function Wn(I,E,P,F,j,Q){var te=F*F;if(F>0&&E.size<(j?te:F))P.numPoints+=E.length/3;else{for(var B=[],Z=0;Z<E.length;Z+=3)(F===0||E[Z+2]>te)&&(P.numSimplified++,B.push(E[Z]),B.push(E[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,E){var P=(E=this.options=function(j,Q){for(var te in Q)j[te]=Q[te];return j}(Object.create(this.options),E)).debug;if(P&&console.time("preprocess data"),E.maxZoom<0||E.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(E.promoteId&&E.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,E);this.tiles={},this.tileCoords=[],P&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",E.indexMaxZoom,E.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=io(Z,1).concat(B)),ne&&(B=B.concat(io(ne,-1)))),B}(F,E)).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 an(I,E,P){return 32*((1<<I)*P+E)+I}function ka(I,E){var P=I.tileID.canonical;if(!this._geoJSONIndex)return E(null,null);var F=this._geoJSONIndex.getTile(P.z,P.x,P.y);if(!F)return E(null,null);var j=new jt(F.features),Q=Xr(j);Q.byteOffset===0&&Q.byteLength===Q.buffer.byteLength||(Q=new Uint8Array(Q)),E(null,{vectorTile:j,rawData:Q.buffer})}Vr.prototype.load=function(I){var E=this.options,P=E.log,F=E.minZoom,j=E.maxZoom,Q=E.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,E){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],E),B=this.getClusters([-180,F,j,Q],E);return te.concat(B)}for(var Z=this.trees[this._limitZoom(E)],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 E=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[E];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,E,P){var F=[];return this._appendLeaves(F,I,E=E||10,P=P||0,0),F},Vr.prototype.getTile=function(I,E,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((E-te)/j,B,(E+1+te)/j,Z),F.points,E,P,j,ne),E===0&&this._addTileFeatures(F.range(1-te/j,B,1,Z),F.points,j,P,j,ne),E===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 E=this._getOriginZoom(I)-1;E<=this.options.maxZoom;){var P=this.getChildren(I);if(E++,P.length!==1)break;I=P[0].properties.cluster_id}return E},Vr.prototype._appendLeaves=function(I,E,P,F,j){for(var Q=0,te=this.getChildren(E);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,E,P,F,j,Q){for(var te=0,B=I;te<B.length;te+=1){var Z=E[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?Aa(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,E){for(var P=[],F=this.options,j=F.reduce,Q=F.minPoints,te=F.radius/(F.extent*Math.pow(2,E)),B=0;B<I.length;B++){var Z=I[B];if(!(Z.zoom<=E)){Z.zoom=E;for(var ne=this.trees[E+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>E&&(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)+(E+1)+this.points.length,ut=0,Me=xe;ut<Me.length;ut+=1){var vt=ne.points[Me[ut]];if(!(vt.zoom<=E)){vt.zoom=E;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<=E||(_t.zoom=E,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,E){if(I.numPoints)return E?yn({},I.properties):I.properties;var P=this.points[I.index].properties,F=this.options.map(P);return E&&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,E,P,F,j,Q,te){for(var B=[I,E,P,F],Z=this.options,ne=Z.debug;B.length;){F=B.pop(),P=B.pop(),E=B.pop(),I=B.pop();var xe=1<<E,we=an(E,P,F),fe=this.tiles[we];if(!fe&&(ne>1&&console.time("creation"),fe=this.tiles[we]=Wo(I,E,P,F,Z),this.tileCoords.push({z:E,x:P,y:F}),ne)){ne>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",E,P,F,fe.numFeatures,fe.numPoints,fe.numSimplified),console.timeEnd("creation"));var be="z"+E;this.stats[be]=(this.stats[be]||0)+1,this.total++}if(fe.source=I,j){if(E===Z.maxZoom||E===j)continue;var Ue=1<<j-E;if(P!==Math.floor(Q/Ue)||F!==Math.floor(te/Ue))continue}else if(E===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||[],E+1,2*P,2*F),B.push(de||[],E+1,2*P,2*F+1),B.push(Be||[],E+1,2*P+1,2*F),B.push(Ee||[],E+1,2*P+1,2*F+1)}}},nn.prototype.getTile=function(I,E,P){var F=this.options,j=F.extent,Q=F.debug;if(I<0||I>24)return null;var te=1<<I,B=an(I,E=(E%te+te)%te,P);if(this.tiles[B])return no(this.tiles[B],j);Q>1&&console.log("drilling down to z%d-%d-%d",I,E,P);for(var Z,ne=I,xe=E,we=P;!Z&&ne>0;)ne--,xe=Math.floor(xe/2),we=Math.floor(we/2),Z=this.tiles[an(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,E,P),Q>1&&console.timeEnd("drilling down"),this.tiles[B]?no(this.tiles[B],j):null):null};var oo=function(I){function E(P,F,j,Q){I.call(this,P,F,j,ka),Q&&(this.loadGeoJSON=Q)}return I&&(E.__proto__=I),(E.prototype=Object.create(I&&I.prototype)).constructor=E,E.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())},E.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)})}},E.prototype.coalesce=function(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())},E.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)},E.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."))}}},E.prototype.removeSource=function(P,F){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),F()},E.prototype.getClusterExpansionZoom=function(P,F){try{F(null,this._geoJSONIndex.getClusterExpansionZoom(P.clusterId))}catch(j){F(j)}},E.prototype.getClusterChildren=function(P,F){try{F(null,this._geoJSONIndex.getChildren(P.clusterId))}catch(j){F(j)}},E.prototype.getClusterLeaves=function(P,F){try{F(null,this._geoJSONIndex.getLeaves(P.clusterId,P.limit,P.offset))}catch(j){F(j)}},E}(Re),rr=function(I){var E=this;this.self=I,this.actor=new l.Actor(I,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:Re,geojson:oo},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(P,F){if(E.workerSourceTypes[P])throw new Error('Worker source with name "'+P+'" already registered.');E.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,E){this.referrer=E},rr.prototype.setImages=function(I,E,P){for(var F in this.availableImages[I]=E,this.workerSources[I]){var j=this.workerSources[I][F];for(var Q in j)j[Q].availableImages=E}P()},rr.prototype.setLayers=function(I,E,P){this.getLayerIndex(I).replace(E),P()},rr.prototype.updateLayers=function(I,E,P){this.getLayerIndex(I).update(E.layers,E.removedIds),P()},rr.prototype.loadTile=function(I,E,P){this.getWorkerSource(I,E.type,E.source).loadTile(E,P)},rr.prototype.loadDEMTile=function(I,E,P){this.getDEMWorkerSource(I,E.source).loadTile(E,P)},rr.prototype.reloadTile=function(I,E,P){this.getWorkerSource(I,E.type,E.source).reloadTile(E,P)},rr.prototype.abortTile=function(I,E,P){this.getWorkerSource(I,E.type,E.source).abortTile(E,P)},rr.prototype.removeTile=function(I,E,P){this.getWorkerSource(I,E.type,E.source).removeTile(E,P)},rr.prototype.removeDEMTile=function(I,E){this.getDEMWorkerSource(I,E.source).removeTile(E)},rr.prototype.removeSource=function(I,E,P){if(this.workerSources[I]&&this.workerSources[I][E.type]&&this.workerSources[I][E.type][E.source]){var F=this.workerSources[I][E.type][E.source];delete this.workerSources[I][E.type][E.source],F.removeSource!==void 0?F.removeSource(E,P):P()}},rr.prototype.loadWorkerSource=function(I,E,P){try{this.self.importScripts(E.url),P()}catch(F){P(F.toString())}},rr.prototype.syncRTLPluginState=function(I,E,P){try{l.plugin.setState(E);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 E=this.availableImages[I];return E||(E=[]),E},rr.prototype.getLayerIndex=function(I){var E=this.layerIndexes[I];return E||(E=this.layerIndexes[I]=new ve),E},rr.prototype.getWorkerSource=function(I,E,P){var F=this;return this.workerSources[I]||(this.workerSources[I]={}),this.workerSources[I][E]||(this.workerSources[I][E]={}),this.workerSources[I][E][P]||(this.workerSources[I][E][P]=new this.workerSourceTypes[E]({send:function(j,Q,te){F.actor.send(j,Q,te,I)}},this.getLayerIndex(I),this.getAvailableImages(I))),this.workerSources[I][E][P]},rr.prototype.getDEMWorkerSource=function(I,E){return this.demWorkerSources[I]||(this.demWorkerSources[I]={}),this.demWorkerSources[I][E]||(this.demWorkerSources[I][E]=new je),this.demWorkerSources[I][E]},rr.prototype.enforceCacheSizeLimit=function(I,E){l.enforceCacheSizeLimit(E)},typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new rr(self)),rr}),G(["./shared"],function(l){var le=l.createCommonjsModule(function(i){function a(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[d=p&&p.failIfMajorPerformanceCaveat]===void 0&&(s[d]=function(y){var g=function(A){var z=document.createElement("canvas"),D=Object.create(a.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)}(d)),s[d]?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 d}i.exports?i.exports=a:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=a,window.mapboxgl.notSupportedReason=n);var s={};a.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}}),H={create:function(i,a,n){var s=l.window.document.createElement(i);return a!==void 0&&(s.className=a),n&&n.appendChild(s),s},createNS:function(i,a){return l.window.document.createElementNS(i,a)}},ve=l.window.document&&l.window.document.documentElement.style;function me(i){if(!ve)return i[0];for(var a=0;a<i.length;a++)if(i[a]in ve)return i[a];return i[0]}var Le,se=me(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);H.disableDrag=function(){ve&&se&&(Le=ve[se],ve[se]="none")},H.enableDrag=function(){ve&&se&&(ve[se]=Le)};var ge=me(["transform","WebkitTransform"]);H.setTransform=function(i,a){i.style[ge]=a};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}H.addEventListener=function(i,a,n,s){s===void 0&&(s={}),i.addEventListener(a,n,"passive"in s&&Re?s:s.capture)},H.removeEventListener=function(i,a,n,s){s===void 0&&(s={}),i.removeEventListener(a,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 a=i.userImage;return!!(a&&a.render&&a.render())&&(i.data.replace(new Uint8Array(a.data.buffer)),!0)}H.suppressClick=function(){l.window.addEventListener("click",je,!0),l.window.setTimeout(function(){l.window.removeEventListener("click",je,!0)},0)},H.mousePos=function(i,a){var n=i.getBoundingClientRect();return new l.Point(a.clientX-n.left-i.clientLeft,a.clientY-n.top-i.clientTop)},H.touchPos=function(i,a){for(var n=i.getBoundingClientRect(),s=[],p=0;p<a.length;p++)s.push(new l.Point(a[p].clientX-n.left-i.clientLeft,a[p].clientY-n.top-i.clientTop));return s},H.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},H.remove=function(i){i.parentNode&&i.parentNode.removeChild(i)};var tt=function(i){function a(){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&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.isLoaded=function(){return this.loaded},a.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 d=p[s];this._notify(d.ids,d.callback)}this.requestors=[]}},a.prototype.getImage=function(n){return this.images[n]},a.prototype.addImage=function(n,s){this._validate(n,s)&&(this.images[n]=s)},a.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},a.prototype._validateStretch=function(n,s){if(!n)return!0;for(var p=0,d=0,y=n;d<y.length;d+=1){var g=y[d];if(g[0]<p||g[1]<g[0]||s<g[1])return!1;p=g[1]}return!0},a.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]))},a.prototype.updateImage=function(n,s){s.version=this.images[n].version+1,this.images[n]=s,this.updatedImages[n]=!0},a.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()},a.prototype.listImages=function(){return Object.keys(this.images)},a.prototype.getImages=function(n,s){var p=!0;if(!this.isLoaded())for(var d=0,y=n;d<y.length;d+=1)this.images[y[d]]||(p=!1);this.isLoaded()||p?this._notify(n,s):this.requestors.push({ids:n,callback:s})},a.prototype._notify=function(n,s){for(var p={},d=0,y=n;d<y.length;d+=1){var g=y[d];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)},a.prototype.getPixelSize=function(){var n=this.atlasImage;return{width:n.width,height:n.height}},a.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 d={w:p.data.width+2,h:p.data.height+2,x:0,y:0},y=new l.ImagePosition(d,p);this.patterns[n]={bin:d,position:y}}return this._updatePatternAtlas(),this.patterns[n].position},a.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)},a.prototype._updatePatternAtlas=function(){var n=[];for(var s in this.patterns)n.push(this.patterns[s].bin);var p=l.potpack(n),d=p.w,y=p.h,g=this.atlasImage;for(var w in g.resize({width:d||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},a.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},a.prototype.dispatchRenderCallbacks=function(n){for(var s=0,p=n;s<p.length;s+=1){var d=p[s];if(!this.callbackDispatchedThisFrame[d]){this.callbackDispatchedThisFrame[d]=!0;var y=this.images[d];It(y)&&this.updateImage(d,y)}}},a}(l.Evented),dt=Kt,Dt=Kt,jt=1e20;function Kt(i,a,n,s,p,d){this.fontSize=i||24,this.buffer=a===void 0?3:a,this.cutoff=s||.25,this.fontFamily=p||"sans-serif",this.fontWeight=d||"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,a,n,s,p,d,y){for(var g=0;g<a;g++){for(var w=0;w<n;w++)s[w]=i[w*a+g];for(Sr(s,p,d,y,n),w=0;w<n;w++)i[w*a+g]=p[w]}for(w=0;w<n;w++){for(g=0;g<a;g++)s[g]=i[w*a+g];for(Sr(s,p,d,y,a),g=0;g<a;g++)i[w*a+g]=Math.sqrt(p[g])}}function Sr(i,a,n,s,p){n[0]=0,s[0]=-jt,s[1]=+jt;for(var d=1,y=0;d<p;d++){for(var g=(i[d]+d*d-(i[n[y]]+n[y]*n[y]))/(2*d-2*n[y]);g<=s[y];)y--,g=(i[d]+d*d-(i[n[y]]+n[y]*n[y]))/(2*d-2*n[y]);n[++y]=d,s[y]=g,s[y+1]=+jt}for(d=0,y=0;d<p;d++){for(;s[y+1]<d;)y++;a[d]=(d-n[y])*(d-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 a=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=a.data[4*s+3]/255;this.gridOuter[s]=p===1?0:p===0?jt:Math.pow(Math.max(0,.5-p),2),this.gridInner[s]=p===1?jt: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,a){this.requestManager=i,this.localIdeographFontFamily=a,this.entries={}};cr.prototype.setURL=function(i){this.url=i},cr.prototype.getGlyphs=function(i,a){var n=this,s=[];for(var p in i)for(var d=0,y=i[p];d<y.length;d+=1)s.push({stack:p,id:y[d]});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)a(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}}a(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,a,n){var s=this.localIdeographFontFamily;if(s&&this._doesCharSupportLocalGlyph(n)){var p=i.tinySDF;if(!p){var d="400";/bold/i.test(a)?d="900":/medium/i.test(a)?d="500":/light/i.test(a)&&(d="200"),p=i.tinySDF=new cr.TinySDF(24,3,8,.25,s,d)}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,a,n,s,p){var d=256*a,y=d+255,g=s.transformRequest(s.normalizeGlyphsURL(n).replace("{fontstack}",i).replace("{range}",d+"-"+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,a){return l.sphericalToCartesian(i.expression.evaluate(a))},Xr.prototype.interpolate=function(i,a,n){return{x:l.number(i.x,a.x,n),y:l.number(i.y,a.y,n),z:l.number(i.z,a.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 a(n){i.call(this),this._transitionable=new l.Transitionable(gr),this.setLight(n),this._transitioning=this._transitionable.untransitioned()}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getLight=function(){return this._transitionable.serialize()},a.prototype.setLight=function(n,s){if(s===void 0&&(s={}),!this._validate(l.validateLight,n,s))for(var p in n){var d=n[p];l.endsWith(p,"-transition")?this._transitionable.setTransition(p.slice(0,-11),d):this._transitionable.setValue(p,d)}},a.prototype.updateTransitions=function(n){this._transitioning=this._transitionable.transitioned(n,this._transitioning)},a.prototype.hasTransition=function(){return this._transitioning.hasTransition()},a.prototype.recalculate=function(n){this.properties=this._transitioning.possiblyEvaluate(n)},a.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})))},a}(l.Evented),Lt=function(i,a){this.width=i,this.height=a,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};Lt.prototype.getDash=function(i,a){var n=i.join(",")+String(a);return this.dashEntry[n]||(this.dashEntry[n]=this.addDash(i,a)),this.dashEntry[n]},Lt.prototype.getDashRanges=function(i,a,n){var s=[],p=i.length%2==1?-i[i.length-1]*n:0,d=i[0]*n,y=!0;s.push({left:p,right:d,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:d=(g+=A)*n,isDash:y=!y,zeroLength:A===0})}return s},Lt.prototype.addRoundDash=function(i,a,n){for(var s=a/2,p=-n;p<=n;p++)for(var d=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[d+w]=Math.max(0,Math.min(255,L+128))}},Lt.prototype.addRegularDash=function(i){for(var a=i.length-1;a>=0;--a){var n=i[a],s=i[a+1];n.zeroLength?i.splice(a,1):s&&s.isDash===n.isDash&&(s.left=n.left,i.splice(a,1))}var p=i[0],d=i[i.length-1];p.isDash===d.isDash&&(p.left=d.left-this.width,d.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,a){var n=a?7:0,s=2*n+1;if(this.nextRow+s>this.height)return l.warnOnce("LineAtlas out of space"),null;for(var p=0,d=0;d<i.length;d++)p+=i[d];if(p!==0){var y=this.width/p,g=this.getDashRanges(i,this.width,y);a?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 a=i.gl;this.texture?(a.bindTexture(a.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,a.texSubImage2D(a.TEXTURE_2D,0,0,0,this.width,this.height,a.ALPHA,a.UNSIGNED_BYTE,this.data))):(this.texture=a.createTexture(),a.bindTexture(a.TEXTURE_2D,this.texture),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.REPEAT),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.REPEAT),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR),a.texImage2D(a.TEXTURE_2D,0,a.ALPHA,this.width,this.height,0,a.ALPHA,a.UNSIGNED_BYTE,this.data))};var Tr=function i(a,n){this.workerPool=a,this.actors=[],this.currentActor=0,this.id=l.uniqueId();for(var s=this.workerPool.acquire(this.id),p=0;p<s.length;p++){var d=new i.Actor(s[p],n,this.id);d.name="Worker "+p,this.actors.push(d)}};function Sa(i,a,n){var s=function(p,d){if(p)return n(p);if(d){var y=l.pick(l.extend(d,i),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);d.vector_layers&&(y.vectorLayers=d.vector_layers,y.vectorLayerIds=y.vectorLayers.map(function(g){return g.id})),y.tiles=a.canonicalizeTileset(y,i.url),n(null,y)}};return i.url?l.getJSON(a.transformRequest(a.normalizeSourceURL(i.url),l.ResourceType.Source),s):l.browser.frame(function(){return s(null,i)})}Tr.prototype.broadcast=function(i,a,n){l.asyncAll(this.actors,function(s,p){s.send(i,a,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,a,n){this.bounds=l.LngLatBounds.convert(this.validateBounds(i)),this.minzoom=a||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 a=Math.pow(2,i.z),n=Math.floor(l.mercatorXfromLng(this.bounds.getWest())*a),s=Math.floor(l.mercatorYfromLat(this.bounds.getNorth())*a),p=Math.ceil(l.mercatorXfromLng(this.bounds.getEast())*a),d=Math.ceil(l.mercatorYfromLat(this.bounds.getSouth())*a);return i.x>=n&&i.x<p&&i.y>=s&&i.y<d};var Ta=function(i){function a(n,s,p,d){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(d)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.load=function(){var n=this;this._loaded=!1,this.fire(new l.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Sa(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"})))})},a.prototype.loaded=function(){return this._loaded},a.prototype.hasTile=function(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)},a.prototype.onAdd=function(n){this.map=n,this.load()},a.prototype.setSourceProperty=function(n){this._tileJSONRequest&&this._tileJSONRequest.cancel(),n(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},a.prototype.setTiles=function(n){var s=this;return this.setSourceProperty(function(){s._options.tiles=n}),this},a.prototype.setUrl=function(n){var s=this;return this.setSourceProperty(function(){s.url=n,s._options.url=n}),this},a.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},a.prototype.serialize=function(){return l.extend({},this._options)},a.prototype.loadTile=function(n,s){var p=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme)),d={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)))}d.request.collectResourceTiming=this._collectResourceTiming,n.actor&&n.state!=="expired"?n.state==="loading"?n.reloadCallback=s:n.request=n.actor.send("reloadTile",d,y.bind(this)):(n.actor=this.dispatcher.getActor(),n.request=n.actor.send("loadTile",d,y.bind(this)))},a.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)},a.prototype.unloadTile=function(n){n.unloadVectorData(),n.actor&&n.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id},void 0)},a.prototype.hasTransition=function(){return!1},a}(l.Evented),Ia=function(i){function a(n,s,p,d){i.call(this),this.id=n,this.dispatcher=p,this.setEventedParent(d),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&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.load=function(){var n=this;this._loaded=!1,this.fire(new l.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Sa(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"})))})},a.prototype.loaded=function(){return this._loaded},a.prototype.onAdd=function(n){this.map=n,this.load()},a.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},a.prototype.serialize=function(){return l.extend({},this._options)},a.prototype.hasTile=function(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)},a.prototype.loadTile=function(n,s){var p=this,d=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);n.request=l.getImage(this.map._requestManager.transformRequest(d,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)}})},a.prototype.abortTile=function(n,s){n.request&&(n.request.cancel(),delete n.request),s()},a.prototype.unloadTile=function(n,s){n.texture&&this.map.painter.saveTileTexture(n.texture),s()},a.prototype.hasTransition=function(){return!1},a}(l.Evented),jo=function(i){function a(n,s,p,d){i.call(this,n,s,p,d),this.type="raster-dem",this.maxzoom=22,this._options=l.extend({type:"raster-dem"},s),this.encoding=s.encoding||"mapbox"}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},a.prototype.loadTile=function(n,s){var p=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function d(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,d.bind(this)))}}).bind(this)),n.neighboringTiles=this._getNeighboringTiles(n.tileID)},a.prototype._getNeighboringTiles=function(n){var s=n.canonical,p=Math.pow(2,s.z),d=(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,d,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,d,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,d,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},a.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})},a}(Ia),dn=function(i){function a(n,s,p,d){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(d),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&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.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))}})},a.prototype.onAdd=function(n){this.map=n,this.load()},a.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 d={dataType:"source",sourceDataType:"content"};s._collectResourceTiming&&s._resourceTiming&&s._resourceTiming.length>0&&(d.resourceTiming=s._resourceTiming,s._resourceTiming=[]),s.fire(new l.Event("data",d))}}),this},a.prototype.getClusterExpansionZoom=function(n,s){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:n,source:this.id},s),this},a.prototype.getClusterChildren=function(n,s){return this.actor.send("geojson.getClusterChildren",{clusterId:n,source:this.id},s),this},a.prototype.getClusterLeaves=function(n,s,p,d){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:n,limit:s,offset:p},d),this},a.prototype._updateWorkerData=function(n){var s=this;this._loaded=!1;var p=l.extend({},this.workerOptions),d=this._data;typeof d=="string"?(p.request=this.map._requestManager.transformRequest(l.browser.resolveURL(d),l.ResourceType.Source),p.request.collectResourceTiming=this._collectResourceTiming):p.data=JSON.stringify(d),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))})},a.prototype.loaded=function(){return this._loaded},a.prototype.loadTile=function(n,s){var p=this,d=n.actor?"reloadTile":"loadTile";n.actor=this.actor,n.request=this.actor.send(d,{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,d==="reloadTile"),s(null))})},a.prototype.abortTile=function(n){n.request&&(n.request.cancel(),delete n.request),n.aborted=!0},a.prototype.unloadTile=function(n){n.unloadVectorData(),this.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id})},a.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},a.prototype.serialize=function(){return l.extend({},this._options,{type:this.type,data:this._data})},a.prototype.hasTransition=function(){return!1},a}(l.Evented),Bi=l.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),Zi=function(i){function a(n,s,p,d){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(d),this.options=s}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.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(d,y){p._loaded=!0,d?p.fire(new l.ErrorEvent(d)):y&&(p.image=y,n&&(p.coordinates=n),s&&s(),p._finishLoading())})},a.prototype.loaded=function(){return this._loaded},a.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},a.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new l.Event("data",{dataType:"source",sourceDataType:"metadata"})))},a.prototype.onAdd=function(n){this.map=n,this.load()},a.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 d=p.map(function(y){return s.tileID.getTilePoint(y)._round()});return this._boundsArray=new l.StructArrayLayout4i8,this._boundsArray.emplaceBack(d[0].x,d[0].y,0,0),this._boundsArray.emplaceBack(d[1].x,d[1].y,l.EXTENT,0),this._boundsArray.emplaceBack(d[3].x,d[3].y,0,l.EXTENT),this._boundsArray.emplaceBack(d[2].x,d[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},a.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 d=this.tiles[p];d.state!=="loaded"&&(d.state="loaded",d.texture=this.texture)}}},a.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))},a.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},a.prototype.hasTransition=function(){return!1},a}(l.Evented),qn=function(i){function a(n,s,p,d){i.call(this,n,s,p,d),this.roundZoom=!0,this.type="video",this.options=s}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.load=function(){var n=this;this._loaded=!1;var s=this.options;this.urls=[];for(var p=0,d=s.urls;p<d.length;p+=1)this.urls.push(this.map._requestManager.transformRequest(d[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())})},a.prototype.pause=function(){this.video&&this.video.pause()},a.prototype.play=function(){this.video&&this.video.play()},a.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}},a.prototype.getVideo=function(){return this.video},a.prototype.onAdd=function(n){this.map||(this.map=n,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},a.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 d=this.tiles[p];d.state!=="loaded"&&(d.state="loaded",d.texture=this.texture)}}},a.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},a.prototype.hasTransition=function(){return this.video&&!this.video.paused},a}(Zi),jn=function(i){function a(n,s,p,d){i.call(this,n,s,p,d),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&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.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())},a.prototype.getCanvas=function(){return this.canvas},a.prototype.onAdd=function(n){this.map=n,this.load(),this.canvas&&this.animate&&this.play()},a.prototype.onRemove=function(){this.pause()},a.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 d 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[d];y.state!=="loaded"&&(y.state="loaded",y.texture=this.texture)}}},a.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},a.prototype.hasTransition=function(){return this._playing},a.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},a}(Zi),mn={vector:Ta,raster:Ia,"raster-dem":jo,geojson:dn,video:qn,image:Zi,canvas:jn};function Ks(i,a){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(a.toUnwrapped()))}function Vr(i,a,n,s,p,d){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,a,i.id),g=d.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(a,n,i._state,L.queryGeometry,L.cameraQueryGeometry,L.scale,p,d,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,a){var n=i.tileID,s=a.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,a){this.max=i,this.onRemove=a,this.reset()};Rt.prototype.reset=function(){for(var i in this.data)for(var a=0,n=this.data[i];a<n.length;a+=1){var s=n[a];s.timeout&&clearTimeout(s.timeout),this.onRemove(s.value)}return this.data={},this.order=[],this},Rt.prototype.add=function(i,a,n){var s=this,p=i.wrapped().key;this.data[p]===void 0&&(this.data[p]=[]);var d={value:a,timeout:void 0};if(n!==void 0&&(d.timeout=setTimeout(function(){s.remove(i,d)},n)),this.data[p].push(d),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 a=this.data[i].shift();return a.timeout&&clearTimeout(a.timeout),this.data[i].length===0&&delete this.data[i],this.order.splice(this.order.indexOf(i),1),a.value},Rt.prototype.getByKey=function(i){var a=this.data[i];return a?a[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,a){if(!this.has(i))return this;var n=i.wrapped().key,s=a===void 0?0:this.data[n].indexOf(a),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 a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this},Rt.prototype.filter=function(i){var a=[];for(var n in this.data)for(var s=0,p=this.data[n];s<p.length;s+=1){var d=p[s];i(d.value)||a.push(d)}for(var y=0,g=a;y<g.length;y+=1){var w=g[y];this.remove(w.value.tileID,w)}};var Gi=function(i,a,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,a.arrayBuffer,this.dynamicDraw?s.DYNAMIC_DRAW:s.STATIC_DRAW),this.dynamicDraw||delete a.arrayBuffer};Gi.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Gi.prototype.updateData=function(i){var a=this.context.gl;this.context.unbindVAO(),this.bind(),a.bufferSubData(a.ELEMENT_ARRAY_BUFFER,0,i.arrayBuffer)},Gi.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var Aa={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},Di=function(i,a,n,s){this.length=a.length,this.attributes=n,this.itemSize=a.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,a.arrayBuffer,this.dynamicDraw?p.DYNAMIC_DRAW:p.STATIC_DRAW),this.dynamicDraw||delete a.arrayBuffer};Di.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},Di.prototype.updateData=function(i){var a=this.context.gl;this.bind(),a.bufferSubData(a.ARRAY_BUFFER,0,i.arrayBuffer)},Di.prototype.enableAttributes=function(i,a){for(var n=0;n<this.attributes.length;n++){var s=a.attributes[this.attributes[n].name];s!==void 0&&i.enableVertexAttribArray(s)}},Di.prototype.setVertexAttribPointers=function(i,a,n){for(var s=0;s<this.attributes.length;s++){var p=this.attributes[s],d=a.attributes[p.name];d!==void 0&&i.vertexAttribPointer(d,p.components,i[Aa[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 a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return l.Color.transparent},a.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)},a}(yt),Kr=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return 1},a.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.clearDepth(n),this.current=n,this.dirty=!1)},a}(yt),_i=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return 0},a.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.clearStencil(n),this.current=n,this.dirty=!1)},a}(yt),Js=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return[!0,!0,!0,!0]},a.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)},a}(yt),Li=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return!0},a.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.depthMask(n),this.current=n,this.dirty=!1)},a}(yt),eo=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return 255},a.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.stencilMask(n),this.current=n,this.dirty=!1)},a}(yt),xi=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},a.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)},a}(yt),$n=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){var n=this.gl;return[n.KEEP,n.KEEP,n.KEEP]},a.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)},a}(yt),Ea=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return!1},a.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}},a}(yt),bi=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return[0,1]},a.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)},a}(yt),wi=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return!1},a.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}},a}(yt),Zn=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return this.gl.LESS},a.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.depthFunc(n),this.current=n,this.dirty=!1)},a}(yt),Ri=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return!1},a.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}},a}(yt),$o=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){var n=this.gl;return[n.ONE,n.ZERO]},a.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)},a}(yt),Zo=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return l.Color.transparent},a.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)},a}(yt),to=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return this.gl.FUNC_ADD},a.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.blendEquation(n),this.current=n,this.dirty=!1)},a}(yt),ro=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return!1},a.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}},a}(yt),Ca=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return this.gl.BACK},a.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.cullFace(n),this.current=n,this.dirty=!1)},a}(yt),Go=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return this.gl.CCW},a.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.frontFace(n),this.current=n,this.dirty=!1)},a}(yt),Pa=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return null},a.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.useProgram(n),this.current=n,this.dirty=!1)},a}(yt),io=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return this.gl.TEXTURE0},a.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.activeTexture(n),this.current=n,this.dirty=!1)},a}(yt),Gn=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){var n=this.gl;return[0,0,n.drawingBufferWidth,n.drawingBufferHeight]},a.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)},a}(yt),no=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return null},a.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}},a}(yt),ao=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return null},a.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}},a}(yt),Wo=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return null},a.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}},a}(yt),Ho=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return null},a.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}},a}(yt),Wn=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return null},a.prototype.set=function(n){var s=this.gl;s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,n),this.current=n,this.dirty=!1},a}(yt),nn=function(i){function a(n){i.call(this,n),this.vao=n.extVertexArrayObject}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return null},a.prototype.set=function(n){this.vao&&(n!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(n),this.current=n,this.dirty=!1)},a}(yt),an=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return 4},a.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}},a}(yt),ka=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return!1},a.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}},a}(yt),oo=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return!1},a.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}},a}(yt),rr=function(i){function a(n,s){i.call(this,n),this.context=n,this.parent=s}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getDefault=function(){return null},a}(yt),I=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.setDirty=function(){this.dirty=!0},a.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}},a}(rr),E=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.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}},a}(rr),P=function(i,a,n,s){this.context=i,this.width=a,this.height=n;var p=this.framebuffer=i.gl.createFramebuffer();this.colorAttachment=new I(i,p),s&&(this.depthAttachment=new E(i,p))};P.prototype.destroy=function(){var i=this.context.gl,a=this.colorAttachment.get();if(a&&i.deleteTexture(a),this.depthAttachment){var n=this.depthAttachment.get();n&&i.deleteRenderbuffer(n)}i.deleteFramebuffer(this.framebuffer)};var F=function(i,a,n){this.func=i,this.mask=a,this.range=n};F.ReadOnly=!1,F.ReadWrite=!0,F.disabled=new F(519,F.ReadOnly,[0,1]);var j=function(i,a,n,s,p,d){this.test=i,this.ref=a,this.mask=n,this.fail=s,this.depthFail=p,this.pass=d};j.disabled=new j({func:519,mask:0},0,0,7680,7680,7680);var Q=function(i,a,n){this.blendFunction=i,this.blendColor=a,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,a,n){this.enable=i,this.mode=a,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 eo(this),this.stencilFunc=new xi(this),this.stencilOp=new $n(this),this.stencilTest=new Ea(this),this.depthRange=new bi(this),this.depthTest=new wi(this),this.depthFunc=new Zn(this),this.blend=new Ri(this),this.blendFunc=new $o(this),this.blendColor=new Zo(this),this.blendEquation=new to(this),this.cullFace=new ro(this),this.cullFaceSide=new Ca(this),this.frontFace=new Go(this),this.program=new Pa(this),this.activeTexture=new io(this),this.viewport=new Gn(this),this.bindFramebuffer=new no(this),this.bindRenderbuffer=new ao(this),this.bindTexture=new Wo(this),this.bindVertexBuffer=new Ho(this),this.bindElementBuffer=new Wn(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new nn(this),this.pixelStoreUnpack=new an(this),this.pixelStoreUnpackPremultiplyAlpha=new ka(this),this.pixelStoreUnpackFlipY=new oo(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,a){return new Gi(this,i,a)},B.prototype.createVertexBuffer=function(i,a,n){return new Di(this,i,a,n)},B.prototype.createRenderbuffer=function(i,a,n){var s=this.gl,p=s.createRenderbuffer();return this.bindRenderbuffer.set(p),s.renderbufferStorage(s.RENDERBUFFER,i,a,n),this.bindRenderbuffer.set(null),p},B.prototype.createFramebuffer=function(i,a,n){return new P(this,i,a,n)},B.prototype.clear=function(i){var a=i.color,n=i.depth,s=this.gl,p=0;a&&(p|=s.COLOR_BUFFER_BIT,this.clearColor.set(a),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 a(n,s,p){var d=this;i.call(this),this.id=n,this.dispatcher=p,this.on("data",function(y){y.dataType==="source"&&y.sourceDataType==="metadata"&&(d._sourceLoaded=!0),d._sourceLoaded&&!d._paused&&y.dataType==="source"&&y.sourceDataType==="content"&&(d.reload(),d.transform&&d.update(d.transform))}),this.on("error",function(){d._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&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.onAdd=function(n){this.map=n,this._maxTileCacheSize=n?n._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(n)},a.prototype.onRemove=function(n){this._source&&this._source.onRemove&&this._source.onRemove(n)},a.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},a.prototype.getSource=function(){return this._source},a.prototype.pause=function(){this._paused=!0},a.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)}},a.prototype._loadTile=function(n,s){return this._source.loadTile(n,s)},a.prototype._unloadTile=function(n){if(this._source.unloadTile)return this._source.unloadTile(n,function(){})},a.prototype._abortTile=function(n){if(this._source.abortTile)return this._source.abortTile(n,function(){})},a.prototype.serialize=function(){return this._source.serialize()},a.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)}},a.prototype.getIds=function(){return l.values(this._tiles).map(function(n){return n.tileID}).sort(ne).map(function(n){return n.key})},a.prototype.getRenderableIds=function(n){var s=this,p=[];for(var d in this._tiles)this._isIdRenderable(d,n)&&p.push(this._tiles[d]);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})},a.prototype.hasRenderableParent=function(n){var s=this.findLoadedParent(n,0);return!!s&&this._isIdRenderable(s.tileID.key)},a.prototype._isIdRenderable=function(n,s){return this._tiles[n]&&this._tiles[n].hasData()&&!this._coveredTiles[n]&&(s||!this._tiles[n].holdingForFade())},a.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")},a.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)))},a.prototype._tileLoaded=function(n,s,p,d){if(d)return n.state="errored",void(d.status!==404?this._source.fire(new l.ErrorEvent(d,{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}))},a.prototype._backfillDEM=function(n){for(var s=this.getRenderableIds(),p=0;p<s.length;p++){var d=s[p];if(n.neighboringTiles&&n.neighboringTiles[d]){var y=this.getTileByID(d);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)))}},a.prototype.getTile=function(n){return this.getTileByID(n.key)},a.prototype.getTileByID=function(n){return this._tiles[n]},a.prototype._retainLoadedChildren=function(n,s,p,d){for(var y in this._tiles){var g=this._tiles[y];if(!(d[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]){d[w.key]=w;break}}}},a.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 d=n.overscaledZ-1;d>=s;d--){var y=n.scaledTo(d),g=this._getLoadedTile(y);if(g)return g}},a.prototype._getLoadedTile=function(n){var s=this._tiles[n.key];return s&&s.hasData()?s:this._cache.getByKey(n.wrapped().key)},a.prototype.updateCacheSize=function(n){var s=Math.ceil(n.width/this._source.tileSize)+1,p=Math.ceil(n.height/this._source.tileSize)+1,d=Math.floor(s*p*5),y=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,d):d;this._cache.setMaxSize(y)},a.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 d in this._tiles){var y=this._tiles[d];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])}},a.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 d=n.coveringZoomLevel(this._source),y=Math.max(d-a.maxOverzooming,this._source.minzoom),g=Math.max(d+a.maxUnderzooming,this._source.minzoom),w=this._updateRetainedTiles(p,d);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,d,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()}},a.prototype.releaseSymbolFadeTiles=function(){for(var n in this._tiles)this._tiles[n].holdingForFade()&&this._removeTile(n)},a.prototype._updateRetainedTiles=function(n,s){for(var p={},d={},y=Math.max(s-a.maxOverzooming,this._source.minzoom),g=Math.max(s+a.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(d[he.key]||(d[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},a.prototype._updateLoadedParentTileCache=function(){for(var n in this._loadedParentTiles={},this._tiles){for(var s=[],p=void 0,d=this._tiles[n].tileID;d.overscaledZ>0;){if(d.key in this._loadedParentTiles){p=this._loadedParentTiles[d.key];break}s.push(d.key);var y=d.scaledTo(d.overscaledZ-1);if(p=this._getLoadedTile(y))break;d=y}for(var g=0,w=s;g<w.length;g+=1)this._loadedParentTiles[w[g]]=p}},a.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},a.prototype._setTileReloadTimer=function(n,s){var p=this;n in this._timers&&(clearTimeout(this._timers[n]),delete this._timers[n]);var d=s.getExpiryTimeout();d&&(this._timers[n]=setTimeout(function(){p._reloadTile(n,"expired"),delete p._timers[n]},d))},a.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))))},a.prototype.clearTiles=function(){for(var n in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(n);this._cache.reset()},a.prototype.tilesIn=function(n,s,p){var d=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=d._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},a.prototype.getVisibleCoordinates=function(n){for(var s=this,p=this.getRenderableIds(n).map(function(w){return s._tiles[w].tileID}),d=0,y=p;d<y.length;d+=1){var g=y[d];g.posMatrix=this.transform.calculatePosMatrix(g.toUnwrapped())}return p},a.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},a.prototype.setFeatureState=function(n,s,p){this._state.updateState(n=n||"_geojsonTileLayer",s,p)},a.prototype.removeFeatureState=function(n,s,p){this._state.removeFeatureState(n=n||"_geojsonTileLayer",s,p)},a.prototype.getFeatureState=function(n,s){return this._state.getState(n=n||"_geojsonTileLayer",s)},a.prototype.setDependencies=function(n,s,p){var d=this._tiles[n];d&&d.setDependencies(s,p)},a.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(d){return!d.hasDependency(n,s)})},a}(l.Evented);function ne(i,a){var n=Math.abs(2*i.wrap)-+(i.wrap<0),s=Math.abs(2*a.wrap)-+(a.wrap<0);return i.overscaledZ-a.overscaledZ||s-n||a.canonical.y-i.canonical.y||a.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(a){a.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,a){var n={};for(var s in i)s!=="ref"&&(n[s]=i[s]);return l.refProperties.forEach(function(p){p in a&&(n[p]=a[p])}),n}function Ee(i){i=i.slice();for(var a=Object.create(null),n=0;n<i.length;n++)a[i[n].id]=i[n];for(var s=0;s<i.length;s++)"ref"in i[s]&&(i[s]=Be(i[s],a[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,a,n){n.push({command:Pe.addSource,args:[i,a[i]]})}function Me(i,a,n){a.push({command:Pe.removeSource,args:[i]}),n[i]=!0}function vt(i,a,n,s){Me(i,n,s),ut(i,a,n)}function Ft(i,a,n){var s;for(s in i[n])if(i[n].hasOwnProperty(s)&&s!=="data"&&!l.deepEqual(i[n][s],a[n][s]))return!1;for(s in a[n])if(a[n].hasOwnProperty(s)&&s!=="data"&&!l.deepEqual(i[n][s],a[n][s]))return!1;return!0}function pt(i,a,n,s,p,d){var y;for(y in a=a||{},i=i||{})i.hasOwnProperty(y)&&(l.deepEqual(i[y],a[y])||n.push({command:d,args:[s,y,a[y],p]}));for(y in a)a.hasOwnProperty(y)&&!i.hasOwnProperty(y)&&(l.deepEqual(i[y],a[y])||n.push({command:d,args:[s,y,a[y],p]}))}function At(i){return i.id}function _t(i,a){return i[a.id]=a,i}var Ur=function(i,a){this.reset(i,a)};Ur.prototype.reset=function(i,a){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(a||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 a=1,n=this._distances[a],s=i*this.paddedLength+this.padding;n<s&&a<this._distances.length;)n=this._distances[++a];var p=a-1,d=this._distances[p],y=n-d,g=y>0?(s-d)/y:0;return this.points[p].mult(1-g).add(this.points[a].mult(g))};var Pt=function(i,a,n){var s=this.boxCells=[],p=this.circleCells=[];this.xCellCount=Math.ceil(i/n),this.yCellCount=Math.ceil(a/n);for(var d=0;d<this.xCellCount*this.yCellCount;d++)s.push([]),p.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=i,this.height=a,this.xScale=this.xCellCount/i,this.yScale=this.yCellCount/a,this.boxUid=0,this.circleUid=0};function ir(i,a,n,s,p){var d=l.create();return a?(l.scale(d,d,[1/p,1/p,1]),n||l.rotateZ(d,d,s.angle)):l.multiply(d,s.labelPlaneMatrix,i),d}function zt(i,a,n,s,p){if(a){var d=l.clone(i);return l.scale(d,d,[p,p,1]),n||l.rotateZ(d,d,-s.angle),d}return s.glCoordMatrix}function mt(i,a){var n=[i.x,i.y,0,1];Ar(n,n,a);var s=n[3];return{point:new l.Point(n[0]/s,n[1]/s),signedDistanceFromCamera:s}}function Et(i,a){return .5+i/a*.5}function Jr(i,a){var n=i[0]/i[3],s=i[1]/i[3];return n>=-a[0]&&n<=a[0]&&s>=-a[1]&&s<=a[1]}function so(i,a,n,s,p,d,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,a),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,a,p,d,i.glyphOffsetArray,L,D,_e,he,Ie,q);K=Te.useVertical,(Te.notEnoughRoom||K||Te.needsFlipping&&Ys(X,ue,!0,g,a,p,d,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,a,n,s,p,d,y,g,w,A,z){var D=g.glyphStartIndex+g.numGlyphs,L=g.lineStartIndex,$=g.lineStartIndex+g.lineLength,q=a.getoffsetX(g.glyphStartIndex),K=a.getoffsetX(D-1),V=nr(i*q,n,s,p,d,y,g.segment,L,$,w,A,z);if(!V)return null;var X=nr(i*K,n,s,p,d,y,g.segment,L,$,w,A,z);return X?{first:V,last:X}:null}function Yr(i,a,n,s){return i===l.WritingMode.horizontal&&Math.abs(n.y-a.y)>Math.abs(n.x-a.x)*s?{useVertical:!0}:(i===l.WritingMode.vertical?a.y<n.y:a.x>n.x)?{needsFlipping:!0}:null}function Ys(i,a,n,s,p,d,y,g,w,A,z,D,L,$){var q,K=a/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,d,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,d,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:lo(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,d,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 lo(i,a,n,s,p){var d=mt(i.add(i.sub(a)._unit()),p).point,y=n.sub(d);return n.add(y._mult(s/y.mag()))}function nr(i,a,n,s,p,d,y,g,w,A,z,D){var L=s?i-a:i+a,$=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=lo(ee===0?d: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,a,n,s,p){this._forEachCell(a,n,s,p,this._insertBoxCell,this.boxUid++),this.boxKeys.push(i),this.bboxes.push(a),this.bboxes.push(n),this.bboxes.push(s),this.bboxes.push(p)},Pt.prototype.insertCircle=function(i,a,n,s){this._forEachCell(a-s,n-s,a+s,n+s,this._insertCircleCell,this.circleUid++),this.circleKeys.push(i),this.circles.push(a),this.circles.push(n),this.circles.push(s)},Pt.prototype._insertBoxCell=function(i,a,n,s,p,d){this.boxCells[p].push(d)},Pt.prototype._insertCircleCell=function(i,a,n,s,p,d){this.circleCells[p].push(d)},Pt.prototype._query=function(i,a,n,s,p,d){if(n<0||i>this.width||s<0||a>this.height)return!p&&[];var y=[];if(i<=0&&a<=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 d?y.filter(d):y}return this._forEachCell(i,a,n,s,this._queryCell,y,{hitTest:p,seenUids:{box:{},circle:{}}},d),p?y.length>0:y},Pt.prototype._queryCircle=function(i,a,n,s,p){var d=i-n,y=i+n,g=a-n,w=a+n;if(y<0||d>this.width||w<0||g>this.height)return!s&&[];var A=[];return this._forEachCell(d,g,y,w,this._queryCellCircle,A,{hitTest:s,circle:{x:i,y:a,radius:n},seenUids:{box:{},circle:{}}},p),s?A.length>0:A},Pt.prototype.query=function(i,a,n,s,p){return this._query(i,a,n,s,!1,p)},Pt.prototype.hitTest=function(i,a,n,s,p){return this._query(i,a,n,s,!0,p)},Pt.prototype.hitTestCircle=function(i,a,n,s){return this._queryCircle(i,a,n,!0,s)},Pt.prototype._queryCell=function(i,a,n,s,p,d,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]&&a<=z[q+3]&&n>=z[q+0]&&s>=z[q+1]&&(!g||g(this.boxKeys[$]))){if(y.hitTest)return d.push(!0),!0;d.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,a,n,s)&&(!g||g(this.circleKeys[ie]))){if(y.hitTest)return d.push(!0),!0;var ue=V[pe],he=V[pe+1],_e=V[pe+2];d.push({key:this.circleKeys[ie],x1:ue-_e,y1:he-_e,x2:ue+_e,y2:he+_e})}}}},Pt.prototype._queryCellCircle=function(i,a,n,s,p,d,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 d.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 d.push(!0),!0}}},Pt.prototype._forEachCell=function(i,a,n,s,p,d,y,g){for(var w=this._convertToXCellCoord(i),A=this._convertToYCellCoord(a),z=this._convertToXCellCoord(n),D=this._convertToYCellCoord(s),L=w;L<=z;L++)for(var $=A;$<=D;$++)if(p.call(this,i,a,n,s,this.xCellCount*$+L,d,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,a,n,s,p,d){var y=s-i,g=p-a,w=n+d;return w*w>y*y+g*g},Pt.prototype._circleAndRectCollide=function(i,a,n,s,p,d,y){var g=(d-s)/2,w=Math.abs(i-(s+g));if(w>g+n)return!1;var A=(y-p)/2,z=Math.abs(a-(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 uo=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,a){for(var n=0;n<i;n++){var s=a.length;a.resize(s+4),a.float32.set(uo,3*s)}}function Ar(i,a,n){var s=a[0],p=a[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,a,n){a===void 0&&(a=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=a,this.ignoredGrid=n,this.pitchfactor=Math.cos(i._pitch)*i.cameraToCenterDistance,this.screenRightBoundary=i.width+100,this.screenBottomBoundary=i.height+100,this.gridRightBoundary=i.width+200,this.gridBottomBoundary=i.height+200};function Zt(i,a,n){return a*(l.EXTENT/(i.tileSize*Math.pow(2,n-i.tileID.overscaledZ)))}Si.prototype.placeCollisionBox=function(i,a,n,s,p){var d=this.projectAndGetPerspectiveRatio(s,i.anchorPointX,i.anchorPointY),y=n*d.perspectiveRatio,g=i.x1*y+d.point.x,w=i.y1*y+d.point.y,A=i.x2*y+d.point.x,z=i.y2*y+d.point.y;return!this.isInsideGrid(g,w,A,z)||!a&&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,a,n,s,p,d,y,g,w,A,z,D,L){var $=[],q=new l.Point(a.anchorX,a.anchorY),K=mt(q,d),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,a.lineOffsetX*X,a.lineOffsetY*X,!1,ee,q,a,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(),ot=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),ot.x=Math.max(ot.x,Xe[et].x),ot.y=Math.max(ot.y,Xe[et].y);it=rt.x>=Ie.x&&ot.x<=Te.x&&rt.y>=Ie.y&&ot.y<=Te.y?[Xe]:ot.x<Ie.x||rt.x>Te.x||ot.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),ar=Jt.x+100,ci=Jt.y+100;$.push(ar,ci,_e,0);var Zr=ar-_e,Mn=ci-_e,Qr=ar+_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(ar,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 a=[],n=1/0,s=1/0,p=-1/0,d=-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),d=Math.max(d,A.y),a.push(A)}for(var z={},D={},L=0,$=this.grid.query(n,s,p,d).concat(this.ignoredGrid.query(n,s,p,d));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(a,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,a,n,s,p){(a?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:s,collisionGroupID:p},i[0],i[1],i[2],i[3])},Si.prototype.insertCollisionCircles=function(i,a,n,s,p){for(var d=a?this.ignoredGrid:this.grid,y={bucketInstanceId:n,featureIndex:s,collisionGroupID:p},g=0;g<i.length;g+=4)d.insertCircle(y,i[g],i[g+1],i[g+2])},Si.prototype.projectAndGetPerspectiveRatio=function(i,a,n){var s=[a,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,a,n,s){return n<100||i>=this.screenRightBoundary||s<100||a>this.screenBottomBoundary},Si.prototype.isInsideGrid=function(i,a,n,s){return n>=0&&i<this.gridRightBoundary&&s>=0&&a<this.gridBottomBoundary},Si.prototype.getViewportMatrix=function(){var i=l.identity([]);return l.translate(i,i,[-100,-100,0]),i};var Fi=function(i,a,n,s){this.opacity=i?Math.max(0,Math.min(1,i.opacity+(i.placed?a:-a))):s&&n?1:0,this.placed=n};Fi.prototype.isHidden=function(){return this.opacity===0&&!this.placed};var hi=function(i,a,n,s,p){this.text=new Fi(i?i.text:null,a,n,p),this.icon=new Fi(i?i.icon:null,a,s,p)};hi.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var iu=function(i,a,n){this.text=i,this.icon=a,this.skipFade=n},Ti=function(){this.invProjMatrix=l.create(),this.viewportMatrix=l.create(),this.circles=[]},qc=function(i,a,n,s,p){this.bucketInstanceId=i,this.featureIndex=a,this.sourceLayerIndex=n,this.bucketIndex=s,this.tileID=p},on=function(i){this.crossSourceCollisions=i,this.maxGroupID=0,this.collisionGroups={}};function zr(i,a,n,s,p){var d=l.getAnchorAlignment(i),y=-(d.horizontalAlign-.5)*a,g=-(d.verticalAlign-.5)*n,w=l.evaluateVariableOffset(i,s);return new l.Point(y+w[0]*p,g+w[1]*p)}function Wi(i,a,n,s,p,d){var y=i.x1,g=i.x2,w=i.y1,A=i.y2,z=i.anchorPointX,D=i.anchorPointY,L=new l.Point(a,n);return s&&L._rotate(p?d:-d),{x1:y+L.x,y1:w+L.y,x2:g+L.x,y2:A+L.y,anchorPointX:z,anchorPointY:D}}on.prototype.get=function(i){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[i]){var a=++this.maxGroupID;this.collisionGroups[i]={ID:a,predicate:function(n){return n.collisionGroupID===a}}}return this.collisionGroups[i]};var qr=function(i,a,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=a,this.retainedQueryData={},this.collisionGroups=new on(n),this.collisionCircleArrays={},this.prevPlacement=s,s&&(s.prevPlacement=void 0),this.placedOrientations={}};function Hn(i,a,n,s,p){i.emplaceBack(a?1:0,n?1:0,s||0,p||0),i.emplaceBack(a?1:0,n?1:0,s||0,p||0),i.emplaceBack(a?1:0,n?1:0,s||0,p||0),i.emplaceBack(a?1:0,n?1:0,s||0,p||0)}qr.prototype.getBucketParts=function(i,a,n,s){var p=n.getBucket(a),d=n.latestFeatureIndex;if(p&&d&&a.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",$=Zt(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 qc(p.bucketInstanceId,d,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,a,n,s,p,d,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(a,X.x,X.y,d,y,this.transform.angle),z,g,w,A.predicate);if(!q||this.collisionIndex.placeCollisionBox(Wi(q,X.x,X.y,d,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,a,n){var s=this,p=i.parameters,d=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||!d.hasIconData()||V),Ie=ee&&(X||!d.hasTextData()||K);!d.collisionArrays&&L&&d.deserializeCollisionBoxes(L);var Te=function(Fe,nt){if(!a[Fe.crossTileID])if(D)s.placements[Fe.crossTileID]=new iu(!1,!1,!1);else{var st,it=!1,rt=!1,ot=!0,et=null,Je={box:null,offscreen:null},_r={box:null,offscreen:null},Qt=null,Rr=null,Cr=0,Jt=0,ar=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(d.allowVerticalPlacement&&!Ct&&s.prevPlacement){var ei=s.prevPlacement.placedOrientations[Fe.crossTileID];ei&&(s.placedOrientations[Fe.crossTileID]=ei,s.markUsedOrientation(d,mi=ei,Fe))}return mi},Mn=function(Ct,mi){if(d.allowVerticalPlacement&&Fe.numVerticalGlyphVertices>0&&nt.verticalTextBox)for(var ei=0,ha=d.writingModes;ei<ha.length&&(ha[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 ha=Ct.x2-Ct.x1,rp=Ct.y2-Ct.y1,ms=Fe.textBoxScale,ip=ue&&!ee?mi:null,Mo={box:[],offscreen:!1},Du=X?2*Qr.length:Qr.length,$a=0;$a<Du;++$a){var ys=s.attemptAnchorPlacement(Qr[$a%Qr.length],Ct,ha,rp,ms,ie,pe,z,g,q,$a>=Qr.length,Fe,d,ei,ip);if(ys&&(Mo=ys.placedGlyphBoxes)&&Mo.box&&Mo.box.length){it=!0,et=ys.shift;break}}return Mo};Mn(function(){return Pi(ci,nt.iconBox,l.WritingMode.horizontal)},function(){var Ct=nt.verticalTextBox;return d.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,ot=Je.offscreen);var Co=Zr(Je&&Je.box);if(!it&&s.prevPlacement){var qa=s.prevPlacement.variableOffsets[Fe.crossTileID];qa&&(s.variableOffsets[Fe.crossTileID]=qa,s.markUsedJustification(d,qa.anchor,Fe,Co))}}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(d,mi,Fe),s.placedOrientations[Fe.crossTileID]=mi),ei};Mn(function(){return zn(ci,l.WritingMode.horizontal)},function(){var Ct=nt.verticalTextBox;return d.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,ot=st&&st.offscreen,Fe.useRuntimeCollisionCircles){var ja=d.text.placedSymbolArray.get(Fe.centerJustifiedTextSymbolIndex),Po=l.evaluateSizeForFeature(d.textSizeData,$,ja),Ji=y.get("text-padding");Qt=s.collisionIndex.placeCollisionCircles(X,ja,d.lineVertexArray,d.glyphOffsetArray,Po,g,w,A,n,pe,q.predicate,Fe.collisionCircleDiameter,Ji),it=X||Qt.circles.length>0&&!Qt.collisionDetected,ot=ot&&Qt.offscreen}if(nt.iconFeatureIndex&&(ar=nt.iconFeatureIndex),nt.iconBox){var ko=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=ko(nt.verticalIconBox)).box.length>0:(Rr=ko(nt.iconBox)).box.length>0,ot=ot&&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"),d.bucketInstanceId,_r&&_r.box&&Jt?Jt:Cr,q.ID),rt&&Rr&&s.collisionIndex.insertCollisionBox(Rr.box,y.get("icon-ignore-placement"),d.bucketInstanceId,ar,q.ID),Qt&&(it&&s.collisionIndex.insertCollisionCircles(Qt.circles,y.get("text-ignore-placement"),d.bucketInstanceId,Cr,q.ID),n)){var cn=d.bucketInstanceId,Bn=s.collisionCircleArrays[cn];Bn===void 0&&(Bn=s.collisionCircleArrays[cn]=new Ti);for(var pa=0;pa<Qt.circles.length;pa+=4)Bn.circles.push(Qt.circles[pa+0]),Bn.circles.push(Qt.circles[pa+1]),Bn.circles.push(Qt.circles[pa+2]),Bn.circles.push(Qt.collisionDetected?1:0)}s.placements[Fe.crossTileID]=new iu(it||_e,rt||Ie,ot||d.justReloaded),a[Fe.crossTileID]=!0}};if(he)for(var De=d.getSortedSymbolIndexes(this.transform.angle),Ge=De.length-1;Ge>=0;--Ge){var Ke=De[Ge];Te(d.symbolInstances.get(Ke),d.collisionArrays[Ke])}else for(var Xe=i.symbolInstanceStart;Xe<i.symbolInstanceEnd;Xe++)Te(d.symbolInstances.get(Xe),d.collisionArrays[Xe]);if(n&&d.bucketInstanceId in this.collisionCircleArrays){var bt=this.collisionCircleArrays[d.bucketInstanceId];l.invert(bt.invProjMatrix,g),bt.viewportMatrix=this.collisionIndex.getViewportMatrix()}d.justReloaded=!1},qr.prototype.markUsedJustification=function(i,a,n,s){var p;p=s===l.WritingMode.vertical?n.verticalPlacedTextSymbolIndex:{left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex}[l.getAnchorJustification(a)];for(var d=0,y=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];d<y.length;d+=1){var g=y[d];g>=0&&(i.text.placedSymbolArray.get(g).crossTileID=p>=0&&g!==p?0:n.crossTileID)}},qr.prototype.markUsedOrientation=function(i,a,n){for(var s=a===l.WritingMode.horizontal||a===l.WritingMode.horizontalOnly?a:0,p=a===l.WritingMode.vertical?a:0,d=0,y=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];d<y.length;d+=1)i.text.placedSymbolArray.get(y[d]).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 a=this.prevPlacement,n=!1;this.prevZoomAdjustment=a?a.zoomAdjustment(this.transform.zoom):0;var s=a?a.symbolFadeChange(i):1,p=a?a.opacities:{},d=a?a.variableOffsets:{},y=a?a.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 d)this.variableOffsets[$]||!this.opacities[$]||this.opacities[$].isHidden()||(this.variableOffsets[$]=d[$]);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=a?a.lastPlacementChangeTime:i)},qr.prototype.updateLayerOpacities=function(i,a){for(var n={},s=0,p=a;s<p.length;s+=1){var d=p[s],y=d.getBucket(i);y&&d.latestFeatureIndex&&i.id===y.layerIds[0]&&this.updateBucketOpacities(y,n,d.collisionBoxArray)}},qr.prototype.updateBucketOpacities=function(i,a,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,d=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];a[ue]?he=d:he||(s.opacities[ue]=he=L),a[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=ou(he.text);$(i.text,ie,Te?Ma:Ge),$(i.text,pe,De?Ma: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=ou(he.icon),nt=!(D&&ee.verticalPlacedIconSymbolIndex&&Te);ee.placedIconSymbolIndex>=0&&($(i.icon,ee.numIconVertices,nt?Fe:Ma),i.icon.placedSymbolArray.get(ee.placedIconSymbolIndex).hidden=he.icon.isHidden()),ee.verticalPlacedIconSymbolIndex>=0&&($(i.icon,ee.numVerticalIconVertices,nt?Ma: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 ot=s.variableOffsets[ue];ot?(it=zr(ot.anchor,ot.width,ot.height,ot.textOffset,ot.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,a){var n=this.zoomAtLastRecencyCheck===a?1-this.zoomAdjustment(a):1;return this.zoomAtLastRecencyCheck=a,this.commitTime+this.fadeDuration*n>i},qr.prototype.setStale=function(){this.stale=!0};var jc=Math.pow(2,25),$c=Math.pow(2,24),Qs=Math.pow(2,17),Zc=Math.pow(2,16),nu=Math.pow(2,9),Gc=Math.pow(2,8),au=Math.pow(2,1);function ou(i){if(i.opacity===0&&!i.placed)return 0;if(i.opacity===1&&i.placed)return 4294967295;var a=i.placed?1:0,n=Math.floor(127*i.opacity);return n*jc+a*$c+n*Qs+a*Zc+n*nu+a*Gc+n*au+a}var Ma=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,a,n,s,p){for(var d=this._bucketParts;this._currentTileIndex<i.length;)if(a.getBucketParts(d,s,i[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,p())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,d.sort(function(y,g){return y.sortKey-g.sortKey}));this._currentPartIndex<d.length;)if(a.placeLayerBucketPart(d[this._currentPartIndex],this._seenCrossTileIDs,n),this._currentPartIndex++,p())return!0;return!1};var co=function(i,a,n,s,p,d,y){this.placement=new qr(i,p,d,y),this._currentPlacementIndex=a.length-1,this._forceFullPlacement=n,this._showCollisionBoxes=s,this._done=!1};co.prototype.isDone=function(){return this._done},co.prototype.continuePlacement=function(i,a,n){for(var s=this,p=l.browser.now(),d=function(){var w=l.browser.now()-p;return!s._forceFullPlacement&&w>2};this._currentPlacementIndex>=0;){var y=a[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,d))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},co.prototype.commit=function(i){return this.placement.commit(i),this.placement};var su=512/l.EXTENT/2,Xo=function(i,a,n){this.tileID=i,this.indexedSymbolInstances={},this.bucketInstanceId=n;for(var s=0;s<a.length;s++){var p=a.get(s),d=p.key;this.indexedSymbolInstances[d]||(this.indexedSymbolInstances[d]=[]),this.indexedSymbolInstances[d].push({crossTileID:p.crossTileID,coord:this.getScaledCoordinates(p,i)})}};Xo.prototype.getScaledCoordinates=function(i,a){var n=su/Math.pow(2,a.canonical.z-this.tileID.canonical.z);return{x:Math.floor((a.canonical.x*l.EXTENT+i.anchorX)*n),y:Math.floor((a.canonical.y*l.EXTENT+i.anchorY)*n)}},Xo.prototype.findMatches=function(i,a,n){for(var s=this.tileID.canonical.z<a.canonical.z?1:Math.pow(2,this.tileID.canonical.z-a.canonical.z),p=0;p<i.length;p++){var d=i.get(p);if(!d.crossTileID){var y=this.indexedSymbolInstances[d.key];if(y)for(var g=this.getScaledCoordinates(d,a),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,d.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 a=Math.round((i-this.lng)/360);if(a!==0)for(var n in this.indexes){var s=this.indexes[n],p={};for(var d in s){var y=s[d];y.tileID=y.tileID.unwrapTo(y.tileID.wrap+a),p[y.tileID.key]=y}this.indexes[n]=p}this.lng=i},vn.prototype.addBucket=function(i,a,n){if(this.indexes[i.overscaledZ]&&this.indexes[i.overscaledZ][i.key]){if(this.indexes[i.overscaledZ][i.key].bucketInstanceId===a.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(i.overscaledZ,this.indexes[i.overscaledZ][i.key])}for(var s=0;s<a.symbolInstances.length;s++)a.symbolInstances.get(s).crossTileID=0;this.usedCrossTileIDs[i.overscaledZ]||(this.usedCrossTileIDs[i.overscaledZ]={});var p=this.usedCrossTileIDs[i.overscaledZ];for(var d in this.indexes){var y=this.indexes[d];if(Number(d)>i.overscaledZ)for(var g in y){var w=y[g];w.tileID.isChildOf(i)&&w.findMatches(a.symbolInstances,i,p)}else{var A=y[i.scaledTo(Number(d)).key];A&&A.findMatches(a.symbolInstances,i,p)}}for(var z=0;z<a.symbolInstances.length;z++){var D=a.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 Xo(i,a.symbolInstances,a.bucketInstanceId),!0},vn.prototype.removeBucketCrossTileIDs=function(i,a){for(var n in a.indexedSymbolInstances)for(var s=0,p=a.indexedSymbolInstances[n];s<p.length;s+=1)delete this.usedCrossTileIDs[i][p[s].crossTileID]},vn.prototype.removeStaleBuckets=function(i){var a=!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],a=!0)}return a};var gn=function(){this.layerIndexes={},this.crossTileIDs=new Ii,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};gn.prototype.addLayer=function(i,a,n){var s=this.layerIndexes[i.id];s===void 0&&(s=this.layerIndexes[i.id]=new vn);var p=!1,d={};s.handleWrapJump(n);for(var y=0,g=a;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),d[A.bucketInstanceId]=!0)}return s.removeStaleBuckets(d)&&(p=!0),p},gn.prototype.pruneUnusedLayers=function(i){var a={};for(var n in i.forEach(function(s){a[s]=!0}),this.layerIndexes)a[n]||delete this.layerIndexes[n]};var Xn=function(i,a){return l.emitValidationErrors(i,a&&a.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"]),Ko=function(){var i={},a=l.styleSpec.$version;for(var n in l.styleSpec.$root){var s,p=l.styleSpec.$root[n];p.required&&(s=n==="version"?a:p.type==="array"?[]:{})!=null&&(i[n]=s)}return i}(),ni=function(i){function a(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 d=this;this._rtlTextPluginCallback=a.registerForPluginStateChange(function(y){d.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 d.sourceCaches)d.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&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.loadURL=function(n,s){var p=this;s===void 0&&(s={}),this.fire(new l.Event("dataloading",{dataType:"style"}));var d=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,d)})},a.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)})},a.prototype.loadEmpty=function(){this.fire(new l.Event("dataloading",{dataType:"style"})),this._load(Ko,!1)},a.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 d=Ee(this.stylesheet.layers);this._order=d.map(function(A){return A.id}),this._layers={},this._serializedLayers={};for(var y=0,g=d;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"))}},a.prototype._loadSprite=function(n){var s=this;this._spriteRequest=function(p,d,y){var g,w,A,z=l.browser.devicePixelRatio>1?"@2x":"",D=l.getJSON(d.transformRequest(d.normalizeSpriteURL(p,z,".json"),l.ResourceType.SpriteJSON),function(q,K){D=null,A||(A=q,g=K,$())}),L=l.getImage(d.transformRequest(d.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,d){if(s._spriteRequest=null,p)s.fire(new l.ErrorEvent(p));else if(d)for(var y in d)s.imageManager.addImage(y,d[y]);s.imageManager.setLoaded(!0),s._availableImages=s.imageManager.listImages(),s.dispatcher.broadcast("setImages",s._availableImages),s.fire(new l.Event("data",{dataType:"style"}))})},a.prototype._validateLayer=function(n){var s=this.sourceCaches[n.source];if(s){var p=n.sourceLayer;if(p){var d=s.getSource();(d.type==="geojson"||d.vectorLayerIds&&d.vectorLayerIds.indexOf(p)===-1)&&this.fire(new l.ErrorEvent(new Error('Source layer "'+p+'" does not exist on source "'+d.id+'" as specified by style layer "'+n.id+'"')))}}},a.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()},a.prototype._serializeLayers=function(n){for(var s=[],p=0,d=n;p<d.length;p+=1){var y=this._layers[d[p]];y.type!=="custom"&&s.push(y.serialize())}return s},a.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},a.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},a.prototype.update=function(n){if(this._loaded){var s=this._changed;if(this._changed){var p=Object.keys(this._updatedLayers),d=Object.keys(this._removedLayers);for(var y in(p.length||d.length)&&this._updateWorkerLayers(p,d),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"}))}},a.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={}}},a.prototype._updateWorkerLayers=function(n,s){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(n),removedIds:s})},a.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},a.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 d=p.filter(function(y){return!(y.command in _n)});if(d.length>0)throw new Error("Unimplemented: "+d.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},a.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)},a.prototype.updateImage=function(n,s){this.imageManager.updateImage(n,s)},a.prototype.getImage=function(n){return this.imageManager.getImage(n)},a.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)},a.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"}))},a.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},a.prototype.addSource=function(n,s,p){var d=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:d.loaded(),source:y.serialize(),sourceId:n}}),y.onAdd(this.map),this._changed=!0}},a.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},a.prototype.setGeoJSONSourceData=function(n,s){this._checkLoaded(),this.sourceCaches[n].getSource().setData(s),this._changed=!0},a.prototype.getSource=function(n){return this.sourceCaches[n]&&this.sourceCaches[n].getSource()},a.prototype.addLayer=function(n,s,p){p===void 0&&(p={}),this._checkLoaded();var d=n.id;if(this.getLayer(d))this.fire(new l.ErrorEvent(new Error('Layer with id "'+d+'" 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(d,n.source),n=l.clone$1(n),n=l.extend(n,{source:d})),this._validate(l.validateStyle.layer,"layers."+d,n,{arrayIndex:-1},p))return;y=l.createStyleLayer(n),this._validateLayer(y),y.setEventedParent(this,{layer:{id:d}}),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,d),this._layerOrderChanged=!0,this._layers[d]=y,this._removedLayers[d]&&y.source&&y.type!=="custom"){var w=this._removedLayers[d];delete this._removedLayers[d],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)}}},a.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 d=s?this._order.indexOf(s):this._order.length;s&&d===-1?this.fire(new l.ErrorEvent(new Error('Layer with id "'+s+'" does not exist on this map.'))):(this._order.splice(d,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.")))},a.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.")))},a.prototype.getLayer=function(n){return this._layers[n]},a.prototype.hasLayer=function(n){return n in this._layers},a.prototype.setLayerZoomRange=function(n,s,p){this._checkLoaded();var d=this.getLayer(n);d?d.minzoom===s&&d.maxzoom===p||(s!=null&&(d.minzoom=s),p!=null&&(d.maxzoom=p),this._updateLayer(d)):this.fire(new l.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot have zoom extent.")))},a.prototype.setFilter=function(n,s,p){p===void 0&&(p={}),this._checkLoaded();var d=this.getLayer(n);if(d){if(!l.deepEqual(d.filter,s))return s==null?(d.filter=void 0,void this._updateLayer(d)):void(this._validate(l.validateStyle.filter,"layers."+d.id+".filter",s,null,p)||(d.filter=l.clone$1(s),this._updateLayer(d)))}else this.fire(new l.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be filtered.")))},a.prototype.getFilter=function(n){return l.clone$1(this.getLayer(n).filter)},a.prototype.setLayoutProperty=function(n,s,p,d){d===void 0&&(d={}),this._checkLoaded();var y=this.getLayer(n);y?l.deepEqual(y.getLayoutProperty(s),p)||(y.setLayoutProperty(s,p,d),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.")))},a.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.")))},a.prototype.setPaintProperty=function(n,s,p,d){d===void 0&&(d={}),this._checkLoaded();var y=this.getLayer(n);y?l.deepEqual(y.getPaintProperty(s),p)||(y.setPaintProperty(s,p,d)&&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.")))},a.prototype.getPaintProperty=function(n,s){return this.getLayer(n).getPaintProperty(s)},a.prototype.setFeatureState=function(n,s){this._checkLoaded();var p=n.source,d=n.sourceLayer,y=this.sourceCaches[p];if(y!==void 0){var g=y.getSource().type;g==="geojson"&&d?this.fire(new l.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):g!=="vector"||d?(n.id===void 0&&this.fire(new l.ErrorEvent(new Error("The feature id parameter must be provided."))),y.setFeatureState(d,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.")))},a.prototype.removeFeatureState=function(n,s){this._checkLoaded();var p=n.source,d=this.sourceCaches[p];if(d!==void 0){var y=d.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."))):d.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.")))},a.prototype.getFeatureState=function(n){this._checkLoaded();var s=n.source,p=n.sourceLayer,d=this.sourceCaches[s];if(d!==void 0){if(d.getSource().type!=="vector"||p)return n.id===void 0&&this.fire(new l.ErrorEvent(new Error("The feature id parameter must be provided."))),d.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.")))},a.prototype.getTransition=function(){return l.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},a.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})},a.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},a.prototype._flattenAndSortRenderedFeatures=function(n){for(var s=this,p=function(Ie){return s._layers[Ie].type==="fill-extrusion"},d={},y=[],g=this._order.length-1;g>=0;g--){var w=this._order[g];if(p(w)){d[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(d[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},a.prototype.queryRenderedFeatures=function(n,s,p){s&&s.filter&&this._validate(l.validateStyle.filter,"queryRenderedFeatures.filter",s.filter,null,s);var d={};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."))),[];d[A.source]=!0}}var z=[];for(var D in s.availableImages=this._availableImages,this.sourceCaches)s.layers&&!d[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(ot,et){var Je=Xe.featureSortOrder;if(Je){var _r=Je.indexOf(ot.featureIndex);return Je.indexOf(et.featureIndex)-_r}return et.featureIndex-ot.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)},a.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(d,y){for(var g=d.getRenderableIds().map(function($){return d.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):[]},a.prototype.addSourceType=function(n,s,p){return a.getSourceType(n)?p(new Error('A source type called "'+n+'" already exists.')):(a.setSourceType(n,s),s.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:n,url:s.workerSourceURL},p):p(null,null))},a.prototype.getLight=function(){return this.light.getLight()},a.prototype.setLight=function(n,s){s===void 0&&(s={}),this._checkLoaded();var p=this.light.getLight(),d=!1;for(var y in n)if(!l.deepEqual(n[y],p[y])){d=!0;break}if(d){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)}},a.prototype._validate=function(n,s,p,d,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},d)))},a.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()},a.prototype._clearSource=function(n){this.sourceCaches[n].clearTiles()},a.prototype._reloadSource=function(n){this.sourceCaches[n].resume(),this.sourceCaches[n].reload()},a.prototype._updateSources=function(n){for(var s in this.sourceCaches)this.sourceCaches[s].update(n)},a.prototype._generateCollisionBoxes=function(){for(var n in this.sourceCaches)this._reloadSource(n)},a.prototype._updatePlacement=function(n,s,p,d,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 co(n,this._order,y,s,p,d,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())},a.prototype._releaseSymbolFadeTiles=function(){for(var n in this.sourceCaches)this.sourceCaches[n].releaseSymbolFadeTiles()},a.prototype.getImages=function(n,s,p){this.imageManager.getImages(s.icons,p),this._updateTilesForChangedImages();var d=this.sourceCaches[s.source];d&&d.setDependencies(s.tileID.key,s.type,s.icons)},a.prototype.getGlyphs=function(n,s,p){this.glyphManager.getGlyphs(s.stacks,p)},a.prototype.getResource=function(n,s,p){return l.makeRequest(s,p)},a}(l.Evented);ni.getSourceType=function(i){return mn[i]},ni.setSourceType=function(i,a){mn[i]=a},ni.registerForPluginStateChange=l.registerForPluginStateChange;var pr=l.createLayout([{name:"a_pos",type:"Int16",components:2}]),za=Ot(`#ifdef GL_ES
|
|
2
2
|
precision mediump float;
|
|
3
3
|
#else
|
|
4
4
|
#if !defined(lowp)
|
|
@@ -28,11 +28,11 @@ vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);
|
|
|
28
28
|
#ifdef OVERDRAW_INSPECTOR
|
|
29
29
|
gl_FragColor=vec4(1.0);
|
|
30
30
|
#endif
|
|
31
|
-
}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),
|
|
31
|
+
}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Wc=Ot(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;
|
|
32
32
|
#ifdef OVERDRAW_INSPECTOR
|
|
33
33
|
gl_FragColor=vec4(1.0);
|
|
34
34
|
#endif
|
|
35
|
-
}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),
|
|
35
|
+
}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),Hc=Ot(`varying vec3 v_data;
|
|
36
36
|
#pragma mapbox: define highp vec4 color
|
|
37
37
|
#pragma mapbox: define mediump float radius
|
|
38
38
|
#pragma mapbox: define lowp float blur
|
|
@@ -89,7 +89,7 @@ vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/we
|
|
|
89
89
|
#ifdef OVERDRAW_INSPECTOR
|
|
90
90
|
gl_FragColor=vec4(0.0);
|
|
91
91
|
#endif
|
|
92
|
-
}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),nl=Ot("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),uu=Ot("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),cu=Ot("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),
|
|
92
|
+
}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),nl=Ot("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),uu=Ot("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),cu=Ot("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),Xc=Ot(`#pragma mapbox: define highp vec4 color
|
|
93
93
|
#pragma mapbox: define lowp float opacity
|
|
94
94
|
void main() {
|
|
95
95
|
#pragma mapbox: initialize highp vec4 color
|
|
@@ -443,7 +443,7 @@ void main() {
|
|
|
443
443
|
#pragma mapbox: initialize lowp float halo_blur
|
|
444
444
|
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|
445
445
|
camera_to_anchor_distance/u_camera_to_center_distance :
|
|
446
|
-
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`);function Ot(i,a){var n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,s=a.match(/attribute ([\w]+) ([\w]+)/g),p=i.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),
|
|
446
|
+
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`);function Ot(i,a){var n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,s=a.match(/attribute ([\w]+) ([\w]+)/g),p=i.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),d=a.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),y=d?d.concat(p):p,g={};return{fragmentSource:i=i.replace(n,function(w,A,z,D,L){return g[L]=!0,A==="define"?`
|
|
447
447
|
#ifndef HAS_UNIFORM_u_`+L+`
|
|
448
448
|
varying `+z+" "+D+" "+L+`;
|
|
449
449
|
#else
|
|
@@ -492,12 +492,12 @@ uniform `+z+" "+D+" u_"+L+`;
|
|
|
492
492
|
#else
|
|
493
493
|
`+z+" "+D+" "+L+" = u_"+L+`;
|
|
494
494
|
#endif
|
|
495
|
-
`}),staticAttributes:s,staticUniforms:y}}var
|
|
495
|
+
`}),staticAttributes:s,staticUniforms:y}}var Kc=Object.freeze({__proto__:null,prelude:za,background:lu,backgroundPattern:Wc,circle:Hc,clippingMask:tl,heatmap:rl,heatmapTexture:il,collisionBox:nl,collisionCircle:uu,debug:cu,fill:Xc,fillOutline:po,fillOutlinePattern:ho,fillPattern:pu,fillExtrusion:Br,fillExtrusionPattern:al,hillshadePrepare:bn,hillshade:wn,line:Kn,lineGradient:Jn,linePattern:Sn,lineSDF:Yn,raster:Qn,symbolIcon:Tn,symbolSDF:hu,symbolTextAndIcon:fu}),Jo=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function du(i){for(var a=[],n=0;n<i.length;n++)if(i[n]!==null){var s=i[n].split(" ");a.push(s.pop())}return a}Jo.prototype.bind=function(i,a,n,s,p,d,y,g){this.context=i;for(var w=this.boundPaintVertexBuffers.length!==s.length,A=0;!w&&A<s.length;A++)this.boundPaintVertexBuffers[A]!==s[A]&&(w=!0);i.extVertexArrayObject&&this.vao&&this.boundProgram===a&&this.boundLayoutVertexBuffer===n&&!w&&this.boundIndexBuffer===p&&this.boundVertexOffset===d&&this.boundDynamicVertexBuffer===y&&this.boundDynamicVertexBuffer2===g?(i.bindVertexArrayOES.set(this.vao),y&&y.bind(),p&&p.dynamicDraw&&p.bind(),g&&g.bind()):this.freshBind(a,n,s,p,d,y,g)},Jo.prototype.freshBind=function(i,a,n,s,p,d,y){var g,w=i.numAttributes,A=this.context,z=A.gl;if(A.extVertexArrayObject)this.vao&&this.destroy(),this.vao=A.extVertexArrayObject.createVertexArrayOES(),A.bindVertexArrayOES.set(this.vao),g=0,this.boundProgram=i,this.boundLayoutVertexBuffer=a,this.boundPaintVertexBuffers=n,this.boundIndexBuffer=s,this.boundVertexOffset=p,this.boundDynamicVertexBuffer=d,this.boundDynamicVertexBuffer2=y;else{g=A.currentNumAttributes||0;for(var D=w;D<g;D++)z.disableVertexAttribArray(D)}a.enableAttributes(z,i);for(var L=0,$=n;L<$.length;L+=1)$[L].enableAttributes(z,i);d&&d.enableAttributes(z,i),y&&y.enableAttributes(z,i),a.bind(),a.setVertexAttribPointers(z,i,p);for(var q=0,K=n;q<K.length;q+=1){var V=K[q];V.bind(),V.setVertexAttribPointers(z,i,p)}d&&(d.bind(),d.setVertexAttribPointers(z,i,p)),s&&s.bind(),y&&(y.bind(),y.setVertexAttribPointers(z,i,p)),A.currentNumAttributes=w},Jo.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var mu=function(i,a,n,s,p,d){var y=i.gl;this.program=y.createProgram();for(var g=du(n.staticAttributes),w=s?s.getBinderAttributes():[],A=g.concat(w),z=n.staticUniforms?du(n.staticUniforms):[],D=s?s.getBinderUniforms():[],L=[],$=0,q=z.concat(D);$<q.length;$+=1){var K=q[$];L.indexOf(K)<0&&L.push(K)}var V=s?s.defines():[];d&&V.push("#define OVERDRAW_INSPECTOR;");var X=V.concat(za.fragmentSource,n.fragmentSource).join(`
|
|
496
496
|
`),ee=V.concat(za.vertexSource,n.vertexSource).join(`
|
|
497
|
-
`),ie=y.createShader(y.FRAGMENT_SHADER);if(y.isContextLost())this.failedToCreate=!0;else{y.shaderSource(ie,X),y.compileShader(ie),y.attachShader(this.program,ie);var pe=y.createShader(y.VERTEX_SHADER);if(y.isContextLost())this.failedToCreate=!0;else{y.shaderSource(pe,ee),y.compileShader(pe),y.attachShader(this.program,pe),this.attributes={};var ue={};this.numAttributes=A.length;for(var he=0;he<this.numAttributes;he++)A[he]&&(y.bindAttribLocation(this.program,he,A[he]),this.attributes[A[he]]=he);y.linkProgram(this.program),y.deleteShader(pe),y.deleteShader(ie);for(var _e=0;_e<L.length;_e++){var Ie=L[_e];if(Ie&&!ue[Ie]){var Te=y.getUniformLocation(this.program,Ie);Te&&(ue[Ie]=Te)}}this.fixedUniforms=p(i,ue),this.binderUniforms=s?s.getUniforms(i,ue):[]}}};function yu(i,a,n){var s=1/$t(n,1,a.transform.tileZoom),p=Math.pow(2,n.tileID.overscaledZ),f=n.tileSize*Math.pow(2,a.transform.tileZoom)/p,y=f*(n.tileID.canonical.x+n.tileID.wrap*p),g=f*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[s,i.fromScale,i.toScale],u_fade:i.t,u_pixel_coord_upper:[y>>16,g>>16],u_pixel_coord_lower:[65535&y,65535&g]}}mu.prototype.draw=function(i,a,n,s,p,f,y,g,w,A,z,D,L,$,q,K){var V,X=i.gl;if(!this.failedToCreate){for(var ee in i.program.set(this.program),i.setDepthMode(n),i.setStencilMode(s),i.setColorMode(p),i.setCullFace(f),this.fixedUniforms)this.fixedUniforms[ee].set(y[ee]);$&&$.setUniforms(i,this.binderUniforms,D,{zoom:L});for(var ie=(V={},V[X.LINES]=2,V[X.TRIANGLES]=3,V[X.LINE_STRIP]=1,V)[a],pe=0,ue=z.get();pe<ue.length;pe+=1){var he=ue[pe],_e=he.vaos||(he.vaos={});(_e[g]||(_e[g]=new Jo)).bind(i,this,w,$?$.getPaintVertexBuffers():[],A,he.vertexOffset,q,K),X.drawElements(a,he.primitiveLength*ie,X.UNSIGNED_SHORT,he.primitiveOffset*ie*2)}}};var vu=function(i,a,n,s){var p=a.style.light,f=p.properties.get("position"),y=[f.x,f.y,f.z],g=l.create$1();p.properties.get("anchor")==="viewport"&&l.fromRotation(g,-a.transform.angle),l.transformMat3(y,y,g);var w=p.properties.get("color");return{u_matrix:i,u_lightpos:y,u_lightintensity:p.properties.get("intensity"),u_lightcolor:[w.r,w.g,w.b],u_vertical_gradient:+n,u_opacity:s}},ea=function(i,a,n,s,p,f,y){return l.extend(vu(i,a,n,s),yu(f,a,y),{u_height_factor:-Math.pow(2,p.overscaledZ)/y.tileSize/8})},In=function(i){return{u_matrix:i}},ta=function(i,a,n,s){return l.extend(In(i),yu(n,a,s))},gu=function(i,a){return{u_matrix:i,u_world:a}},_u=function(i,a,n,s,p){return l.extend(ta(i,a,n,s),{u_world:p})},ol=function(i,a,n,s){var p,f,y=i.transform;if(s.paint.get("circle-pitch-alignment")==="map"){var g=$t(n,1,y.zoom);p=!0,f=[g,g]}else p=!1,f=y.pixelsToGLUnits;return{u_camera_to_center_distance:y.cameraToCenterDistance,u_scale_with_map:+(s.paint.get("circle-pitch-scale")==="map"),u_matrix:i.translatePosMatrix(a.posMatrix,n,s.paint.get("circle-translate"),s.paint.get("circle-translate-anchor")),u_pitch_with_map:+p,u_device_pixel_ratio:l.browser.devicePixelRatio,u_extrude_scale:f}},ra=function(i,a,n){var s=$t(n,1,a.zoom),p=Math.pow(2,a.zoom-n.tileID.overscaledZ),f=n.tileID.overscaleFactor();return{u_matrix:i,u_camera_to_center_distance:a.cameraToCenterDistance,u_pixels_to_tile_units:s,u_extrude_scale:[a.pixelsToGLUnits[0]/(s*p),a.pixelsToGLUnits[1]/(s*p)],u_overscale_factor:f}},xu=function(i,a,n){return{u_matrix:i,u_inv_matrix:a,u_camera_to_center_distance:n.cameraToCenterDistance,u_viewport_size:[n.width,n.height]}},ia=function(i,a,n){return n===void 0&&(n=1),{u_matrix:i,u_color:a,u_overlay:0,u_overlay_scale:n}},na=function(i){return{u_matrix:i}},bu=function(i,a,n,s){return{u_matrix:i,u_extrude_scale:$t(a,1,n),u_intensity:s}},fo=function(i,a,n){var s=i.transform;return{u_matrix:wu(i,a,n),u_ratio:1/$t(a,1,s.zoom),u_device_pixel_ratio:l.browser.devicePixelRatio,u_units_to_pixels:[1/s.pixelsToGLUnits[0],1/s.pixelsToGLUnits[1]]}},Ut=function(i,a,n,s){return l.extend(fo(i,a,n),{u_image:0,u_image_height:s})},Yo=function(i,a,n,s){var p=i.transform,f=Ba(a,p);return{u_matrix:wu(i,a,n),u_texsize:a.imageAtlasTexture.size,u_ratio:1/$t(a,1,p.zoom),u_device_pixel_ratio:l.browser.devicePixelRatio,u_image:0,u_scale:[f,s.fromScale,s.toScale],u_fade:s.t,u_units_to_pixels:[1/p.pixelsToGLUnits[0],1/p.pixelsToGLUnits[1]]}},Yc=function(i,a,n,s,p){var f=i.lineAtlas,y=Ba(a,i.transform),g=n.layout.get("line-cap")==="round",w=f.getDash(s.from,g),A=f.getDash(s.to,g),z=w.width*p.fromScale,D=A.width*p.toScale;return l.extend(fo(i,a,n),{u_patternscale_a:[y/z,-w.height/2],u_patternscale_b:[y/D,-A.height/2],u_sdfgamma:f.width/(256*Math.min(z,D)*l.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:w.y,u_tex_y_b:A.y,u_mix:p.t})};function Ba(i,a){return 1/$t(i,1,a.tileZoom)}function wu(i,a,n){return i.translatePosMatrix(a.tileID.posMatrix,a,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}var Qc=function(i,a,n,s,p){return{u_matrix:i,u_tl_parent:a,u_scale_parent:n,u_buffer_scale:1,u_fade_t:s.mix,u_opacity:s.opacity*p.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:p.paint.get("raster-brightness-min"),u_brightness_high:p.paint.get("raster-brightness-max"),u_saturation_factor:(y=p.paint.get("raster-saturation"),y>0?1-1/(1.001-y):-y),u_contrast_factor:(f=p.paint.get("raster-contrast"),f>0?1/(1-f):1+f),u_spin_weights:Su(p.paint.get("raster-hue-rotate"))};var f,y};function Su(i){i*=Math.PI/180;var a=Math.sin(i),n=Math.cos(i);return[(2*n+1)/3,(-Math.sqrt(3)*a-n+1)/3,(Math.sqrt(3)*a-n+1)/3]}var Qo,Da=function(i,a,n,s,p,f,y,g,w,A){var z=p.transform;return{u_is_size_zoom_constant:+(i==="constant"||i==="source"),u_is_size_feature_constant:+(i==="constant"||i==="camera"),u_size_t:a?a.uSizeT:0,u_size:a?a.uSize:0,u_camera_to_center_distance:z.cameraToCenterDistance,u_pitch:z.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:z.width/z.height,u_fade_change:p.options.fadeDuration?p.symbolFadeChange:1,u_matrix:f,u_label_plane_matrix:y,u_coord_matrix:g,u_is_text:+w,u_pitch_with_map:+s,u_texsize:A,u_texture:0}},mo=function(i,a,n,s,p,f,y,g,w,A,z){var D=p.transform;return l.extend(Da(i,a,n,s,p,f,y,g,w,A),{u_gamma_scale:s?Math.cos(D._pitch)*D.cameraToCenterDistance:1,u_device_pixel_ratio:l.browser.devicePixelRatio,u_is_halo:1})},es=function(i,a,n,s,p,f,y,g,w,A){return l.extend(mo(i,a,n,s,p,f,y,g,!0,w),{u_texsize_icon:A,u_texture_icon:1})},yo=function(i,a,n){return{u_matrix:i,u_opacity:a,u_color:n}},La=function(i,a,n,s,p,f){return l.extend(function(y,g,w,A){var z=w.imageManager.getPattern(y.from.toString()),D=w.imageManager.getPattern(y.to.toString()),L=w.imageManager.getPixelSize(),$=L.width,q=L.height,K=Math.pow(2,A.tileID.overscaledZ),V=A.tileSize*Math.pow(2,w.transform.tileZoom)/K,X=V*(A.tileID.canonical.x+A.tileID.wrap*K),ee=V*A.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:z.tl,u_pattern_br_a:z.br,u_pattern_tl_b:D.tl,u_pattern_br_b:D.br,u_texsize:[$,q],u_mix:g.t,u_pattern_size_a:z.displaySize,u_pattern_size_b:D.displaySize,u_scale_a:g.fromScale,u_scale_b:g.toScale,u_tile_units_to_pixels:1/$t(A,1,w.transform.tileZoom),u_pixel_coord_upper:[X>>16,ee>>16],u_pixel_coord_lower:[65535&X,65535&ee]}}(s,f,n,p),{u_matrix:i,u_opacity:a})},Tu={fillExtrusion:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_lightpos:new l.Uniform3f(i,a.u_lightpos),u_lightintensity:new l.Uniform1f(i,a.u_lightintensity),u_lightcolor:new l.Uniform3f(i,a.u_lightcolor),u_vertical_gradient:new l.Uniform1f(i,a.u_vertical_gradient),u_opacity:new l.Uniform1f(i,a.u_opacity)}},fillExtrusionPattern:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_lightpos:new l.Uniform3f(i,a.u_lightpos),u_lightintensity:new l.Uniform1f(i,a.u_lightintensity),u_lightcolor:new l.Uniform3f(i,a.u_lightcolor),u_vertical_gradient:new l.Uniform1f(i,a.u_vertical_gradient),u_height_factor:new l.Uniform1f(i,a.u_height_factor),u_image:new l.Uniform1i(i,a.u_image),u_texsize:new l.Uniform2f(i,a.u_texsize),u_pixel_coord_upper:new l.Uniform2f(i,a.u_pixel_coord_upper),u_pixel_coord_lower:new l.Uniform2f(i,a.u_pixel_coord_lower),u_scale:new l.Uniform3f(i,a.u_scale),u_fade:new l.Uniform1f(i,a.u_fade),u_opacity:new l.Uniform1f(i,a.u_opacity)}},fill:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix)}},fillPattern:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_image:new l.Uniform1i(i,a.u_image),u_texsize:new l.Uniform2f(i,a.u_texsize),u_pixel_coord_upper:new l.Uniform2f(i,a.u_pixel_coord_upper),u_pixel_coord_lower:new l.Uniform2f(i,a.u_pixel_coord_lower),u_scale:new l.Uniform3f(i,a.u_scale),u_fade:new l.Uniform1f(i,a.u_fade)}},fillOutline:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_world:new l.Uniform2f(i,a.u_world)}},fillOutlinePattern:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_world:new l.Uniform2f(i,a.u_world),u_image:new l.Uniform1i(i,a.u_image),u_texsize:new l.Uniform2f(i,a.u_texsize),u_pixel_coord_upper:new l.Uniform2f(i,a.u_pixel_coord_upper),u_pixel_coord_lower:new l.Uniform2f(i,a.u_pixel_coord_lower),u_scale:new l.Uniform3f(i,a.u_scale),u_fade:new l.Uniform1f(i,a.u_fade)}},circle:function(i,a){return{u_camera_to_center_distance:new l.Uniform1f(i,a.u_camera_to_center_distance),u_scale_with_map:new l.Uniform1i(i,a.u_scale_with_map),u_pitch_with_map:new l.Uniform1i(i,a.u_pitch_with_map),u_extrude_scale:new l.Uniform2f(i,a.u_extrude_scale),u_device_pixel_ratio:new l.Uniform1f(i,a.u_device_pixel_ratio),u_matrix:new l.UniformMatrix4f(i,a.u_matrix)}},collisionBox:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_camera_to_center_distance:new l.Uniform1f(i,a.u_camera_to_center_distance),u_pixels_to_tile_units:new l.Uniform1f(i,a.u_pixels_to_tile_units),u_extrude_scale:new l.Uniform2f(i,a.u_extrude_scale),u_overscale_factor:new l.Uniform1f(i,a.u_overscale_factor)}},collisionCircle:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_inv_matrix:new l.UniformMatrix4f(i,a.u_inv_matrix),u_camera_to_center_distance:new l.Uniform1f(i,a.u_camera_to_center_distance),u_viewport_size:new l.Uniform2f(i,a.u_viewport_size)}},debug:function(i,a){return{u_color:new l.UniformColor(i,a.u_color),u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_overlay:new l.Uniform1i(i,a.u_overlay),u_overlay_scale:new l.Uniform1f(i,a.u_overlay_scale)}},clippingMask:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix)}},heatmap:function(i,a){return{u_extrude_scale:new l.Uniform1f(i,a.u_extrude_scale),u_intensity:new l.Uniform1f(i,a.u_intensity),u_matrix:new l.UniformMatrix4f(i,a.u_matrix)}},heatmapTexture:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_world:new l.Uniform2f(i,a.u_world),u_image:new l.Uniform1i(i,a.u_image),u_color_ramp:new l.Uniform1i(i,a.u_color_ramp),u_opacity:new l.Uniform1f(i,a.u_opacity)}},hillshade:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_image:new l.Uniform1i(i,a.u_image),u_latrange:new l.Uniform2f(i,a.u_latrange),u_light:new l.Uniform2f(i,a.u_light),u_shadow:new l.UniformColor(i,a.u_shadow),u_highlight:new l.UniformColor(i,a.u_highlight),u_accent:new l.UniformColor(i,a.u_accent)}},hillshadePrepare:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_image:new l.Uniform1i(i,a.u_image),u_dimension:new l.Uniform2f(i,a.u_dimension),u_zoom:new l.Uniform1f(i,a.u_zoom),u_unpack:new l.Uniform4f(i,a.u_unpack)}},line:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_ratio:new l.Uniform1f(i,a.u_ratio),u_device_pixel_ratio:new l.Uniform1f(i,a.u_device_pixel_ratio),u_units_to_pixels:new l.Uniform2f(i,a.u_units_to_pixels)}},lineGradient:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_ratio:new l.Uniform1f(i,a.u_ratio),u_device_pixel_ratio:new l.Uniform1f(i,a.u_device_pixel_ratio),u_units_to_pixels:new l.Uniform2f(i,a.u_units_to_pixels),u_image:new l.Uniform1i(i,a.u_image),u_image_height:new l.Uniform1f(i,a.u_image_height)}},linePattern:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_texsize:new l.Uniform2f(i,a.u_texsize),u_ratio:new l.Uniform1f(i,a.u_ratio),u_device_pixel_ratio:new l.Uniform1f(i,a.u_device_pixel_ratio),u_image:new l.Uniform1i(i,a.u_image),u_units_to_pixels:new l.Uniform2f(i,a.u_units_to_pixels),u_scale:new l.Uniform3f(i,a.u_scale),u_fade:new l.Uniform1f(i,a.u_fade)}},lineSDF:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_ratio:new l.Uniform1f(i,a.u_ratio),u_device_pixel_ratio:new l.Uniform1f(i,a.u_device_pixel_ratio),u_units_to_pixels:new l.Uniform2f(i,a.u_units_to_pixels),u_patternscale_a:new l.Uniform2f(i,a.u_patternscale_a),u_patternscale_b:new l.Uniform2f(i,a.u_patternscale_b),u_sdfgamma:new l.Uniform1f(i,a.u_sdfgamma),u_image:new l.Uniform1i(i,a.u_image),u_tex_y_a:new l.Uniform1f(i,a.u_tex_y_a),u_tex_y_b:new l.Uniform1f(i,a.u_tex_y_b),u_mix:new l.Uniform1f(i,a.u_mix)}},raster:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_tl_parent:new l.Uniform2f(i,a.u_tl_parent),u_scale_parent:new l.Uniform1f(i,a.u_scale_parent),u_buffer_scale:new l.Uniform1f(i,a.u_buffer_scale),u_fade_t:new l.Uniform1f(i,a.u_fade_t),u_opacity:new l.Uniform1f(i,a.u_opacity),u_image0:new l.Uniform1i(i,a.u_image0),u_image1:new l.Uniform1i(i,a.u_image1),u_brightness_low:new l.Uniform1f(i,a.u_brightness_low),u_brightness_high:new l.Uniform1f(i,a.u_brightness_high),u_saturation_factor:new l.Uniform1f(i,a.u_saturation_factor),u_contrast_factor:new l.Uniform1f(i,a.u_contrast_factor),u_spin_weights:new l.Uniform3f(i,a.u_spin_weights)}},symbolIcon:function(i,a){return{u_is_size_zoom_constant:new l.Uniform1i(i,a.u_is_size_zoom_constant),u_is_size_feature_constant:new l.Uniform1i(i,a.u_is_size_feature_constant),u_size_t:new l.Uniform1f(i,a.u_size_t),u_size:new l.Uniform1f(i,a.u_size),u_camera_to_center_distance:new l.Uniform1f(i,a.u_camera_to_center_distance),u_pitch:new l.Uniform1f(i,a.u_pitch),u_rotate_symbol:new l.Uniform1i(i,a.u_rotate_symbol),u_aspect_ratio:new l.Uniform1f(i,a.u_aspect_ratio),u_fade_change:new l.Uniform1f(i,a.u_fade_change),u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_label_plane_matrix:new l.UniformMatrix4f(i,a.u_label_plane_matrix),u_coord_matrix:new l.UniformMatrix4f(i,a.u_coord_matrix),u_is_text:new l.Uniform1i(i,a.u_is_text),u_pitch_with_map:new l.Uniform1i(i,a.u_pitch_with_map),u_texsize:new l.Uniform2f(i,a.u_texsize),u_texture:new l.Uniform1i(i,a.u_texture)}},symbolSDF:function(i,a){return{u_is_size_zoom_constant:new l.Uniform1i(i,a.u_is_size_zoom_constant),u_is_size_feature_constant:new l.Uniform1i(i,a.u_is_size_feature_constant),u_size_t:new l.Uniform1f(i,a.u_size_t),u_size:new l.Uniform1f(i,a.u_size),u_camera_to_center_distance:new l.Uniform1f(i,a.u_camera_to_center_distance),u_pitch:new l.Uniform1f(i,a.u_pitch),u_rotate_symbol:new l.Uniform1i(i,a.u_rotate_symbol),u_aspect_ratio:new l.Uniform1f(i,a.u_aspect_ratio),u_fade_change:new l.Uniform1f(i,a.u_fade_change),u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_label_plane_matrix:new l.UniformMatrix4f(i,a.u_label_plane_matrix),u_coord_matrix:new l.UniformMatrix4f(i,a.u_coord_matrix),u_is_text:new l.Uniform1i(i,a.u_is_text),u_pitch_with_map:new l.Uniform1i(i,a.u_pitch_with_map),u_texsize:new l.Uniform2f(i,a.u_texsize),u_texture:new l.Uniform1i(i,a.u_texture),u_gamma_scale:new l.Uniform1f(i,a.u_gamma_scale),u_device_pixel_ratio:new l.Uniform1f(i,a.u_device_pixel_ratio),u_is_halo:new l.Uniform1i(i,a.u_is_halo)}},symbolTextAndIcon:function(i,a){return{u_is_size_zoom_constant:new l.Uniform1i(i,a.u_is_size_zoom_constant),u_is_size_feature_constant:new l.Uniform1i(i,a.u_is_size_feature_constant),u_size_t:new l.Uniform1f(i,a.u_size_t),u_size:new l.Uniform1f(i,a.u_size),u_camera_to_center_distance:new l.Uniform1f(i,a.u_camera_to_center_distance),u_pitch:new l.Uniform1f(i,a.u_pitch),u_rotate_symbol:new l.Uniform1i(i,a.u_rotate_symbol),u_aspect_ratio:new l.Uniform1f(i,a.u_aspect_ratio),u_fade_change:new l.Uniform1f(i,a.u_fade_change),u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_label_plane_matrix:new l.UniformMatrix4f(i,a.u_label_plane_matrix),u_coord_matrix:new l.UniformMatrix4f(i,a.u_coord_matrix),u_is_text:new l.Uniform1i(i,a.u_is_text),u_pitch_with_map:new l.Uniform1i(i,a.u_pitch_with_map),u_texsize:new l.Uniform2f(i,a.u_texsize),u_texsize_icon:new l.Uniform2f(i,a.u_texsize_icon),u_texture:new l.Uniform1i(i,a.u_texture),u_texture_icon:new l.Uniform1i(i,a.u_texture_icon),u_gamma_scale:new l.Uniform1f(i,a.u_gamma_scale),u_device_pixel_ratio:new l.Uniform1f(i,a.u_device_pixel_ratio),u_is_halo:new l.Uniform1i(i,a.u_is_halo)}},background:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_opacity:new l.Uniform1f(i,a.u_opacity),u_color:new l.UniformColor(i,a.u_color)}},backgroundPattern:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_opacity:new l.Uniform1f(i,a.u_opacity),u_image:new l.Uniform1i(i,a.u_image),u_pattern_tl_a:new l.Uniform2f(i,a.u_pattern_tl_a),u_pattern_br_a:new l.Uniform2f(i,a.u_pattern_br_a),u_pattern_tl_b:new l.Uniform2f(i,a.u_pattern_tl_b),u_pattern_br_b:new l.Uniform2f(i,a.u_pattern_br_b),u_texsize:new l.Uniform2f(i,a.u_texsize),u_mix:new l.Uniform1f(i,a.u_mix),u_pattern_size_a:new l.Uniform2f(i,a.u_pattern_size_a),u_pattern_size_b:new l.Uniform2f(i,a.u_pattern_size_b),u_scale_a:new l.Uniform1f(i,a.u_scale_a),u_scale_b:new l.Uniform1f(i,a.u_scale_b),u_pixel_coord_upper:new l.Uniform2f(i,a.u_pixel_coord_upper),u_pixel_coord_lower:new l.Uniform2f(i,a.u_pixel_coord_lower),u_tile_units_to_pixels:new l.Uniform1f(i,a.u_tile_units_to_pixels)}}};function Ra(i,a,n,s,p,f,y){for(var g=i.context,w=g.gl,A=i.useProgram("collisionBox"),z=[],D=0,L=0,$=0;$<s.length;$++){var q=s[$],K=a.getTile(q),V=K.getBucket(n);if(V){var X=q.posMatrix;p[0]===0&&p[1]===0||(X=i.translatePosMatrix(q.posMatrix,K,p,f));var ee=y?V.textCollisionBox:V.iconCollisionBox,ie=V.collisionCircleArray;if(ie.length>0){var pe=l.create(),ue=X;l.mul(pe,V.placementInvProjMatrix,i.transform.glCoordMatrix),l.mul(pe,pe,V.placementViewportMatrix),z.push({circleArray:ie,circleOffset:L,transform:ue,invTransform:pe}),L=D+=ie.length/4}ee&&A.draw(g,w.LINES,F.disabled,j.disabled,i.colorModeForRenderPass(),te.disabled,ra(X,i.transform,K),n.id,ee.layoutVertexBuffer,ee.indexBuffer,ee.segments,null,i.transform.zoom,null,null,ee.collisionVertexBuffer)}}if(y&&z.length){var he=i.useProgram("collisionCircle"),_e=new l.StructArrayLayout2f1f2i16;_e.resize(4*D),_e._trim();for(var Ie=0,Te=0,De=z;Te<De.length;Te+=1)for(var Ge=De[Te],Ke=0;Ke<Ge.circleArray.length/4;Ke++){var Xe=4*Ke,bt=Ge.circleArray[Xe+0],Fe=Ge.circleArray[Xe+1],nt=Ge.circleArray[Xe+2],st=Ge.circleArray[Xe+3];_e.emplace(Ie++,bt,Fe,nt,st,0),_e.emplace(Ie++,bt,Fe,nt,st,1),_e.emplace(Ie++,bt,Fe,nt,st,2),_e.emplace(Ie++,bt,Fe,nt,st,3)}(!Qo||Qo.length<2*D)&&(Qo=function(Qt){var Rr=2*Qt,Cr=new l.StructArrayLayout3ui6;Cr.resize(Rr),Cr._trim();for(var Jt=0;Jt<Rr;Jt++){var ar=6*Jt;Cr.uint16[ar+0]=4*Jt+0,Cr.uint16[ar+1]=4*Jt+1,Cr.uint16[ar+2]=4*Jt+2,Cr.uint16[ar+3]=4*Jt+2,Cr.uint16[ar+4]=4*Jt+3,Cr.uint16[ar+5]=4*Jt+0}return Cr}(D));for(var it=g.createIndexBuffer(Qo,!0),rt=g.createVertexBuffer(_e,l.collisionCircleLayout.members,!0),ot=0,et=z;ot<et.length;ot+=1){var Je=et[ot],_r=xu(Je.transform,Je.invTransform,i.transform);he.draw(g,w.TRIANGLES,F.disabled,j.disabled,i.colorModeForRenderPass(),te.disabled,_r,n.id,rt,it,l.SegmentVector.simpleSegment(0,2*Je.circleOffset,Je.circleArray.length,Je.circleArray.length/2),null,i.transform.zoom,null,null,null)}rt.destroy(),it.destroy()}}var Oi=l.identity(new Float32Array(16));function Iu(i,a,n,s,p,f){var y=l.getAnchorAlignment(i),g=-(y.horizontalAlign-.5)*a,w=-(y.verticalAlign-.5)*n,A=l.evaluateVariableOffset(i,s);return new l.Point((g/p+A[0])*f,(w/p+A[1])*f)}function Au(i,a,n,s,p,f,y,g,w,A,z){var D=i.text.placedSymbolArray,L=i.text.dynamicLayoutVertexArray,$=i.icon.dynamicLayoutVertexArray,q={};L.clear();for(var K=0;K<D.length;K++){var V=D.get(K),X=V.hidden||!V.crossTileID||i.allowVerticalPlacement&&!V.placedOrientation?null:s[V.crossTileID];if(X){var ee=new l.Point(V.anchorX,V.anchorY),ie=mt(ee,n?g:y),pe=Et(f.cameraToCenterDistance,ie.signedDistanceFromCamera),ue=p.evaluateSizeForFeature(i.textSizeData,A,V)*pe/l.ONE_EM;n&&(ue*=i.tilePixelRatio/w);for(var he=Iu(X.anchor,X.width,X.height,X.textOffset,X.textBoxScale,ue),_e=n?mt(ee.add(he),y).point:ie.point.add(a?he.rotate(-f.angle):he),Ie=i.allowVerticalPlacement&&V.placedOrientation===l.WritingMode.vertical?Math.PI/2:0,Te=0;Te<V.numGlyphs;Te++)l.addDynamicAttributes(L,_e,Ie);z&&V.associatedIconIndex>=0&&(q[V.associatedIconIndex]={shiftedAnchor:_e,angle:Ie})}else Nr(V.numGlyphs,L)}if(z){$.clear();for(var De=i.icon.placedSymbolArray,Ge=0;Ge<De.length;Ge++){var Ke=De.get(Ge);if(Ke.hidden)Nr(Ke.numGlyphs,$);else{var Xe=q[Ge];if(Xe)for(var bt=0;bt<Ke.numGlyphs;bt++)l.addDynamicAttributes($,Xe.shiftedAnchor,Xe.angle);else Nr(Ke.numGlyphs,$)}}i.icon.dynamicLayoutVertexBuffer.updateData($)}i.text.dynamicLayoutVertexBuffer.updateData(L)}function Eu(i,a,n){return n.iconsInText&&a?"symbolTextAndIcon":i?"symbolSDF":"symbolIcon"}function aa(i,a,n,s,p,f,y,g,w,A,z,D){for(var L=i.context,$=L.gl,q=i.transform,K=g==="map",V=w==="map",X=K&&n.layout.get("symbol-placement")!=="point",ee=K&&!V&&!X,ie=n.layout.get("symbol-sort-key").constantOr(1)!==void 0,pe=!1,ue=i.depthModeForSublayer(0,F.ReadOnly),he=n.layout.get("text-variable-anchor"),_e=[],Ie=0,Te=s;Ie<Te.length;Ie+=1){var De=Te[Ie],Ge=a.getTile(De),Ke=Ge.getBucket(n);if(Ke){var Xe=p?Ke.text:Ke.icon;if(Xe&&Xe.segments.get().length){var bt=Xe.programConfigurations.get(n.id),Fe=p||Ke.sdfIcons,nt=p?Ke.textSizeData:Ke.iconSizeData,st=V||q.pitch!==0,it=i.useProgram(Eu(Fe,p,Ke),bt),rt=l.evaluateSizeForZoom(nt,q.zoom),ot=void 0,et=[0,0],Je=void 0,_r=void 0,Qt=null,Rr=void 0;if(p)Je=Ge.glyphAtlasTexture,_r=$.LINEAR,ot=Ge.glyphAtlasTexture.size,Ke.iconsInText&&(et=Ge.imageAtlasTexture.size,Qt=Ge.imageAtlasTexture,Rr=st||i.options.rotating||i.options.zooming||nt.kind==="composite"||nt.kind==="camera"?$.LINEAR:$.NEAREST);else{var Cr=n.layout.get("icon-size").constantOr(0)!==1||Ke.iconsNeedLinear;Je=Ge.imageAtlasTexture,_r=Fe||i.options.rotating||i.options.zooming||Cr||st?$.LINEAR:$.NEAREST,ot=Ge.imageAtlasTexture.size}var Jt=$t(Ge,1,i.transform.zoom),ar=ir(De.posMatrix,V,K,i.transform,Jt),ci=zt(De.posMatrix,V,K,i.transform,Jt),Zr=he&&Ke.hasTextData(),Mn=n.layout.get("icon-text-fit")!=="none"&&Zr&&Ke.hasIconData();X&&so(Ke,De.posMatrix,i,p,ar,ci,V,A);var Qr=i.translatePosMatrix(De.posMatrix,Ge,f,y),ji=X||p&&he||Mn?Oi:ar,Pi=i.translatePosMatrix(ci,Ge,f,y,!0),Co=Fe&&n.paint.get(p?"text-halo-width":"icon-halo-width").constantOr(1)!==0,qa={program:it,buffers:Xe,uniformValues:Fe?Ke.iconsInText?es(nt.kind,rt,ee,V,i,Qr,ji,Pi,ot,et):mo(nt.kind,rt,ee,V,i,Qr,ji,Pi,p,ot):Da(nt.kind,rt,ee,V,i,Qr,ji,Pi,p,ot),atlasTexture:Je,atlasTextureIcon:Qt,atlasInterpolation:_r,atlasInterpolationIcon:Rr,isSDF:Fe,hasHalo:Co};if(ie&&Ke.canOverlap){pe=!0;for(var zn=0,ja=Xe.segments.get();zn<ja.length;zn+=1){var Po=ja[zn];_e.push({segments:new l.SegmentVector([Po]),sortKey:Po.sortKey,state:qa})}}else _e.push({segments:Xe.segments,sortKey:0,state:qa})}}}pe&&_e.sort(function(Bn,pa){return Bn.sortKey-pa.sortKey});for(var Ji=0,ko=_e;Ji<ko.length;Ji+=1){var Yi=ko[Ji],xr=Yi.state;if(L.activeTexture.set($.TEXTURE0),xr.atlasTexture.bind(xr.atlasInterpolation,$.CLAMP_TO_EDGE),xr.atlasTextureIcon&&(L.activeTexture.set($.TEXTURE1),xr.atlasTextureIcon&&xr.atlasTextureIcon.bind(xr.atlasInterpolationIcon,$.CLAMP_TO_EDGE)),xr.isSDF){var cn=xr.uniformValues;xr.hasHalo&&(cn.u_is_halo=1,vo(xr.buffers,Yi.segments,n,i,xr.program,ue,z,D,cn)),cn.u_is_halo=0}vo(xr.buffers,Yi.segments,n,i,xr.program,ue,z,D,xr.uniformValues)}}function vo(i,a,n,s,p,f,y,g,w){var A=s.context;p.draw(A,A.gl.TRIANGLES,f,y,g,te.disabled,w,n.id,i.layoutVertexBuffer,i.indexBuffer,a,n.paint,s.transform.zoom,i.programConfigurations.get(n.id),i.dynamicLayoutVertexBuffer,i.opacityVertexBuffer)}function ts(i,a,n,s,p,f,y){var g,w,A,z,D,L=i.context.gl,$=n.paint.get("fill-pattern"),q=$&&$.constantOr(1),K=n.getCrossfadeParameters();y?(w=q&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",g=L.LINES):(w=q?"fillPattern":"fill",g=L.TRIANGLES);for(var V=0,X=s;V<X.length;V+=1){var ee=X[V],ie=a.getTile(ee);if(!q||ie.patternsLoaded()){var pe=ie.getBucket(n);if(pe){var ue=pe.programConfigurations.get(n.id),he=i.useProgram(w,ue);q&&(i.context.activeTexture.set(L.TEXTURE0),ie.imageAtlasTexture.bind(L.LINEAR,L.CLAMP_TO_EDGE),ue.updatePaintBuffers(K));var _e=$.constantOr(null);if(_e&&ie.imageAtlas){var Ie=ie.imageAtlas,Te=Ie.patternPositions[_e.to.toString()],De=Ie.patternPositions[_e.from.toString()];Te&&De&&ue.setConstantPatternPositions(Te,De)}var Ge=i.translatePosMatrix(ee.posMatrix,ie,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(y){z=pe.indexBuffer2,D=pe.segments2;var Ke=[L.drawingBufferWidth,L.drawingBufferHeight];A=w==="fillOutlinePattern"&&q?_u(Ge,i,K,ie,Ke):gu(Ge,Ke)}else z=pe.indexBuffer,D=pe.segments,A=q?ta(Ge,i,K,ie):In(Ge);he.draw(i.context,g,p,i.stencilModeForClipping(ee),f,te.disabled,A,n.id,pe.layoutVertexBuffer,z,D,n.paint,i.transform.zoom,ue)}}}}function sl(i,a,n,s,p,f,y){for(var g=i.context,w=g.gl,A=n.paint.get("fill-extrusion-pattern"),z=A.constantOr(1),D=n.getCrossfadeParameters(),L=n.paint.get("fill-extrusion-opacity"),$=0,q=s;$<q.length;$+=1){var K=q[$],V=a.getTile(K),X=V.getBucket(n);if(X){var ee=X.programConfigurations.get(n.id),ie=i.useProgram(z?"fillExtrusionPattern":"fillExtrusion",ee);z&&(i.context.activeTexture.set(w.TEXTURE0),V.imageAtlasTexture.bind(w.LINEAR,w.CLAMP_TO_EDGE),ee.updatePaintBuffers(D));var pe=A.constantOr(null);if(pe&&V.imageAtlas){var ue=V.imageAtlas,he=ue.patternPositions[pe.to.toString()],_e=ue.patternPositions[pe.from.toString()];he&&_e&&ee.setConstantPatternPositions(he,_e)}var Ie=i.translatePosMatrix(K.posMatrix,V,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),Te=n.paint.get("fill-extrusion-vertical-gradient"),De=z?ea(Ie,i,Te,L,K,D,V):vu(Ie,i,Te,L);ie.draw(g,g.gl.TRIANGLES,p,f,y,te.backCCW,De,n.id,X.layoutVertexBuffer,X.indexBuffer,X.segments,n.paint,i.transform.zoom,ee)}}}function rs(i,a,n,s,p,f){var y=i.context,g=y.gl,w=a.fbo;if(w){var A=i.useProgram("hillshade");y.activeTexture.set(g.TEXTURE0),g.bindTexture(g.TEXTURE_2D,w.colorAttachment.get());var z=function(D,L,$){var q=$.paint.get("hillshade-shadow-color"),K=$.paint.get("hillshade-highlight-color"),V=$.paint.get("hillshade-accent-color"),X=$.paint.get("hillshade-illumination-direction")*(Math.PI/180);$.paint.get("hillshade-illumination-anchor")==="viewport"&&(X-=D.transform.angle);var ee,ie,pe,ue=!D.options.moving;return{u_matrix:D.transform.calculatePosMatrix(L.tileID.toUnwrapped(),ue),u_image:0,u_latrange:(ee=L.tileID,ie=Math.pow(2,ee.canonical.z),pe=ee.canonical.y,[new l.MercatorCoordinate(0,pe/ie).toLngLat().lat,new l.MercatorCoordinate(0,(pe+1)/ie).toLngLat().lat]),u_light:[$.paint.get("hillshade-exaggeration"),X],u_shadow:q,u_highlight:K,u_accent:V}}(i,a,n);A.draw(y,g.TRIANGLES,s,p,f,te.disabled,z,n.id,i.rasterBoundsBuffer,i.quadTriangleIndexBuffer,i.rasterBoundsSegments)}}function ep(i,a,n,s,p,f){var y=i.context,g=y.gl,w=a.dem;if(w&&w.data){var A=w.dim,z=w.stride,D=w.getPixels();if(y.activeTexture.set(g.TEXTURE1),y.pixelStoreUnpackPremultiplyAlpha.set(!1),a.demTexture=a.demTexture||i.getTileTexture(z),a.demTexture){var L=a.demTexture;L.update(D,{premultiply:!1}),L.bind(g.NEAREST,g.CLAMP_TO_EDGE)}else a.demTexture=new l.Texture(y,D,g.RGBA,{premultiply:!1}),a.demTexture.bind(g.NEAREST,g.CLAMP_TO_EDGE);y.activeTexture.set(g.TEXTURE0);var $=a.fbo;if(!$){var q=new l.Texture(y,{width:A,height:A,data:null},g.RGBA);q.bind(g.LINEAR,g.CLAMP_TO_EDGE),($=a.fbo=y.createFramebuffer(A,A,!0)).colorAttachment.set(q.texture)}y.bindFramebuffer.set($.framebuffer),y.viewport.set([0,0,A,A]),i.useProgram("hillshadePrepare").draw(y,g.TRIANGLES,s,p,f,te.disabled,function(K,V){var X=V.stride,ee=l.create();return l.ortho(ee,0,l.EXTENT,-l.EXTENT,0,0,1),l.translate(ee,ee,[0,-l.EXTENT,0]),{u_matrix:ee,u_image:1,u_dimension:[X,X],u_zoom:K.overscaledZ,u_unpack:V.getUnpackVector()}}(a.tileID,w),n.id,i.rasterBoundsBuffer,i.quadTriangleIndexBuffer,i.rasterBoundsSegments),a.needsHillshadePrepare=!1}}function is(i,a,n,s,p){var f=s.paint.get("raster-fade-duration");if(f>0){var y=l.browser.now(),g=(y-i.timeAdded)/f,w=a?(y-a.timeAdded)/f:-1,A=n.getSource(),z=p.coveringZoomLevel({tileSize:A.tileSize,roundZoom:A.roundZoom}),D=!a||Math.abs(a.tileID.overscaledZ-z)>Math.abs(i.tileID.overscaledZ-z),L=D&&i.refreshedUponExpiration?1:l.clamp(D?g:1-w,0,1);return i.refreshedUponExpiration&&g>=1&&(i.refreshedUponExpiration=!1),a?{opacity:1,mix:1-L}:{opacity:L,mix:0}}return{opacity:1,mix:0}}var ll=new l.Color(1,0,0,1),Cu=new l.Color(0,1,0,1),Pu=new l.Color(0,0,1,1),ns=new l.Color(1,0,1,1),ul=new l.Color(0,1,1,1);function cl(i,a,n,s){go(i,0,a+n/2,i.transform.width,n,s)}function pl(i,a,n,s){go(i,a-n/2,0,n,i.transform.height,s)}function go(i,a,n,s,p,f){var y=i.context,g=y.gl;g.enable(g.SCISSOR_TEST),g.scissor(a*l.browser.devicePixelRatio,n*l.browser.devicePixelRatio,s*l.browser.devicePixelRatio,p*l.browser.devicePixelRatio),y.clear({color:f}),g.disable(g.SCISSOR_TEST)}function ku(i,a,n){var s=i.context,p=s.gl,f=n.posMatrix,y=i.useProgram("debug"),g=F.disabled,w=j.disabled,A=i.colorModeForRenderPass();s.activeTexture.set(p.TEXTURE0),i.emptyTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),y.draw(s,p.LINE_STRIP,g,w,A,te.disabled,ia(f,l.Color.red),"$debug",i.debugBuffer,i.tileBorderIndexBuffer,i.debugSegments);var z=a.getTileByID(n.key).latestRawTileData,D=Math.floor((z&&z.byteLength||0)/1024),L=a.getTile(n).tileSize,$=512/Math.min(L,512)*(n.overscaledZ/i.transform.zoom)*.5,q=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(q+=" => "+n.overscaledZ),function(K,V){K.initDebugOverlayCanvas();var X=K.debugOverlayCanvas,ee=K.context.gl,ie=K.debugOverlayCanvas.getContext("2d");ie.clearRect(0,0,X.width,X.height),ie.shadowColor="white",ie.shadowBlur=2,ie.lineWidth=1.5,ie.strokeStyle="white",ie.textBaseline="top",ie.font="bold 36px Open Sans, sans-serif",ie.fillText(V,5,5),ie.strokeText(V,5,5),K.debugOverlayTexture.update(X),K.debugOverlayTexture.bind(ee.LINEAR,ee.CLAMP_TO_EDGE)}(i,q+" "+D+"kb"),y.draw(s,p.TRIANGLES,g,w,Q.alphaBlended,te.disabled,ia(f,l.Color.transparent,$),"$debug",i.debugBuffer,i.quadTriangleIndexBuffer,i.debugSegments)}var oa={symbol:function(i,a,n,s,p){if(i.renderPass==="translucent"){var f=j.disabled,y=i.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(g,w,A,z,D,L,$){for(var q=w.transform,K=D==="map",V=L==="map",X=0,ee=g;X<ee.length;X+=1){var ie=ee[X],pe=z.getTile(ie),ue=pe.getBucket(A);if(ue&&ue.text&&ue.text.segments.get().length){var he=l.evaluateSizeForZoom(ue.textSizeData,q.zoom),_e=$t(pe,1,w.transform.zoom),Ie=ir(ie.posMatrix,V,K,w.transform,_e),Te=A.layout.get("icon-text-fit")!=="none"&&ue.hasIconData();if(he){var De=Math.pow(2,q.zoom-pe.tileID.overscaledZ);Au(ue,K,V,$,l.symbolSize,q,Ie,ie.posMatrix,De,he,Te)}}}}(s,i,n,a,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),p),n.paint.get("icon-opacity").constantOr(1)!==0&&aa(i,a,n,s,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),f,y),n.paint.get("text-opacity").constantOr(1)!==0&&aa(i,a,n,s,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),f,y),a.map.showCollisionBoxes&&(Ra(i,a,n,s,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),Ra(i,a,n,s,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))}},circle:function(i,a,n,s){if(i.renderPass==="translucent"){var p=n.paint.get("circle-opacity"),f=n.paint.get("circle-stroke-width"),y=n.paint.get("circle-stroke-opacity"),g=n.layout.get("circle-sort-key").constantOr(1)!==void 0;if(p.constantOr(1)!==0||f.constantOr(1)!==0&&y.constantOr(1)!==0){for(var w=i.context,A=w.gl,z=i.depthModeForSublayer(0,F.ReadOnly),D=j.disabled,L=i.colorModeForRenderPass(),$=[],q=0;q<s.length;q++){var K=s[q],V=a.getTile(K),X=V.getBucket(n);if(X){var ee=X.programConfigurations.get(n.id),ie={programConfiguration:ee,program:i.useProgram("circle",ee),layoutVertexBuffer:X.layoutVertexBuffer,indexBuffer:X.indexBuffer,uniformValues:ol(i,K,V,n)};if(g)for(var pe=0,ue=X.segments.get();pe<ue.length;pe+=1){var he=ue[pe];$.push({segments:new l.SegmentVector([he]),sortKey:he.sortKey,state:ie})}else $.push({segments:X.segments,sortKey:0,state:ie})}}g&&$.sort(function(Ge,Ke){return Ge.sortKey-Ke.sortKey});for(var _e=0,Ie=$;_e<Ie.length;_e+=1){var Te=Ie[_e],De=Te.state;De.program.draw(w,A.TRIANGLES,z,D,L,te.disabled,De.uniformValues,n.id,De.layoutVertexBuffer,De.indexBuffer,Te.segments,n.paint,i.transform.zoom,De.programConfiguration)}}}},heatmap:function(i,a,n,s){if(n.paint.get("heatmap-opacity")!==0)if(i.renderPass==="offscreen"){var p=i.context,f=p.gl,y=j.disabled,g=new Q([f.ONE,f.ONE],l.Color.transparent,[!0,!0,!0,!0]);(function($,q,K){var V=$.gl;$.activeTexture.set(V.TEXTURE1),$.viewport.set([0,0,q.width/4,q.height/4]);var X=K.heatmapFbo;if(X)V.bindTexture(V.TEXTURE_2D,X.colorAttachment.get()),$.bindFramebuffer.set(X.framebuffer);else{var ee=V.createTexture();V.bindTexture(V.TEXTURE_2D,ee),V.texParameteri(V.TEXTURE_2D,V.TEXTURE_WRAP_S,V.CLAMP_TO_EDGE),V.texParameteri(V.TEXTURE_2D,V.TEXTURE_WRAP_T,V.CLAMP_TO_EDGE),V.texParameteri(V.TEXTURE_2D,V.TEXTURE_MIN_FILTER,V.LINEAR),V.texParameteri(V.TEXTURE_2D,V.TEXTURE_MAG_FILTER,V.LINEAR),X=K.heatmapFbo=$.createFramebuffer(q.width/4,q.height/4,!1),function(ie,pe,ue,he){var _e=ie.gl;_e.texImage2D(_e.TEXTURE_2D,0,_e.RGBA,pe.width/4,pe.height/4,0,_e.RGBA,ie.extRenderToTextureHalfFloat?ie.extTextureHalfFloat.HALF_FLOAT_OES:_e.UNSIGNED_BYTE,null),he.colorAttachment.set(ue)}($,q,ee,X)}})(p,i,n),p.clear({color:l.Color.transparent});for(var w=0;w<s.length;w++){var A=s[w];if(!a.hasRenderableParent(A)){var z=a.getTile(A),D=z.getBucket(n);if(D){var L=D.programConfigurations.get(n.id);i.useProgram("heatmap",L).draw(p,f.TRIANGLES,F.disabled,y,g,te.disabled,bu(A.posMatrix,z,i.transform.zoom,n.paint.get("heatmap-intensity")),n.id,D.layoutVertexBuffer,D.indexBuffer,D.segments,n.paint,i.transform.zoom,L)}}}p.viewport.set([0,0,i.width,i.height])}else i.renderPass==="translucent"&&(i.context.setColorMode(i.colorModeForRenderPass()),function($,q){var K=$.context,V=K.gl,X=q.heatmapFbo;if(X){K.activeTexture.set(V.TEXTURE0),V.bindTexture(V.TEXTURE_2D,X.colorAttachment.get()),K.activeTexture.set(V.TEXTURE1);var ee=q.colorRampTexture;ee||(ee=q.colorRampTexture=new l.Texture(K,q.colorRamp,V.RGBA)),ee.bind(V.LINEAR,V.CLAMP_TO_EDGE),$.useProgram("heatmapTexture").draw(K,V.TRIANGLES,F.disabled,j.disabled,$.colorModeForRenderPass(),te.disabled,function(ie,pe,ue,he){var _e=l.create();l.ortho(_e,0,ie.width,ie.height,0,0,1);var Ie=ie.context.gl;return{u_matrix:_e,u_world:[Ie.drawingBufferWidth,Ie.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:pe.paint.get("heatmap-opacity")}}($,q),q.id,$.viewportBuffer,$.quadTriangleIndexBuffer,$.viewportSegments,q.paint,$.transform.zoom)}}(i,n))},line:function(i,a,n,s){if(i.renderPass==="translucent"){var p=n.paint.get("line-opacity"),f=n.paint.get("line-width");if(p.constantOr(1)!==0&&f.constantOr(1)!==0)for(var y=i.depthModeForSublayer(0,F.ReadOnly),g=i.colorModeForRenderPass(),w=n.paint.get("line-dasharray"),A=n.paint.get("line-pattern"),z=A.constantOr(1),D=n.paint.get("line-gradient"),L=n.getCrossfadeParameters(),$=z?"linePattern":w?"lineSDF":D?"lineGradient":"line",q=i.context,K=q.gl,V=!0,X=0,ee=s;X<ee.length;X+=1){var ie=ee[X],pe=a.getTile(ie);if(!z||pe.patternsLoaded()){var ue=pe.getBucket(n);if(ue){var he=ue.programConfigurations.get(n.id),_e=i.context.program.get(),Ie=i.useProgram($,he),Te=V||Ie.program!==_e,De=A.constantOr(null);if(De&&pe.imageAtlas){var Ge=pe.imageAtlas,Ke=Ge.patternPositions[De.to.toString()],Xe=Ge.patternPositions[De.from.toString()];Ke&&Xe&&he.setConstantPatternPositions(Ke,Xe)}var bt=z?Yo(i,pe,n,L):w?Yc(i,pe,n,w,L):D?Ut(i,pe,n,ue.lineClipsArray.length):fo(i,pe,n);if(z)q.activeTexture.set(K.TEXTURE0),pe.imageAtlasTexture.bind(K.LINEAR,K.CLAMP_TO_EDGE),he.updatePaintBuffers(L);else if(w&&(Te||i.lineAtlas.dirty))q.activeTexture.set(K.TEXTURE0),i.lineAtlas.bind(q);else if(D){var Fe=ue.gradients[n.id],nt=Fe.texture;if(n.gradientVersion!==Fe.version){var st=256;if(n.stepInterpolant){var it=a.getSource().maxzoom,rt=ie.canonical.z===it?Math.ceil(1<<i.transform.maxZoom-ie.canonical.z):1;st=l.clamp(l.nextPowerOfTwo(ue.maxLineLength/l.EXTENT*1024*rt),256,q.maxTextureSize)}Fe.gradient=l.renderColorRamp({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:st,image:Fe.gradient||void 0,clips:ue.lineClipsArray}),Fe.texture?Fe.texture.update(Fe.gradient):Fe.texture=new l.Texture(q,Fe.gradient,K.RGBA),Fe.version=n.gradientVersion,nt=Fe.texture}q.activeTexture.set(K.TEXTURE0),nt.bind(n.stepInterpolant?K.NEAREST:K.LINEAR,K.CLAMP_TO_EDGE)}Ie.draw(q,K.TRIANGLES,y,i.stencilModeForClipping(ie),g,te.disabled,bt,n.id,ue.layoutVertexBuffer,ue.indexBuffer,ue.segments,n.paint,i.transform.zoom,he,ue.layoutVertexBuffer2),V=!1}}}}},fill:function(i,a,n,s){var p=n.paint.get("fill-color"),f=n.paint.get("fill-opacity");if(f.constantOr(1)!==0){var y=i.colorModeForRenderPass(),g=n.paint.get("fill-pattern"),w=i.opaquePassEnabledForLayer()&&!g.constantOr(1)&&p.constantOr(l.Color.transparent).a===1&&f.constantOr(0)===1?"opaque":"translucent";if(i.renderPass===w){var A=i.depthModeForSublayer(1,i.renderPass==="opaque"?F.ReadWrite:F.ReadOnly);ts(i,a,n,s,A,y,!1)}if(i.renderPass==="translucent"&&n.paint.get("fill-antialias")){var z=i.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,F.ReadOnly);ts(i,a,n,s,z,y,!0)}}},"fill-extrusion":function(i,a,n,s){var p=n.paint.get("fill-extrusion-opacity");if(p!==0&&i.renderPass==="translucent"){var f=new F(i.context.gl.LEQUAL,F.ReadWrite,i.depthRangeFor3D);if(p!==1||n.paint.get("fill-extrusion-pattern").constantOr(1))sl(i,a,n,s,f,j.disabled,Q.disabled),sl(i,a,n,s,f,i.stencilModeFor3D(),i.colorModeForRenderPass());else{var y=i.colorModeForRenderPass();sl(i,a,n,s,f,j.disabled,y)}}},hillshade:function(i,a,n,s){if(i.renderPass==="offscreen"||i.renderPass==="translucent"){for(var p=i.context,f=i.depthModeForSublayer(0,F.ReadOnly),y=i.colorModeForRenderPass(),g=i.renderPass==="translucent"?i.stencilConfigForOverlap(s):[{},s],w=g[0],A=0,z=g[1];A<z.length;A+=1){var D=z[A],L=a.getTile(D);L.needsHillshadePrepare&&i.renderPass==="offscreen"?ep(i,L,n,f,j.disabled,y):i.renderPass==="translucent"&&rs(i,L,n,f,w[D.overscaledZ],y)}p.viewport.set([0,0,i.width,i.height])}},raster:function(i,a,n,s){if(i.renderPass==="translucent"&&n.paint.get("raster-opacity")!==0&&s.length)for(var p=i.context,f=p.gl,y=a.getSource(),g=i.useProgram("raster"),w=i.colorModeForRenderPass(),A=y instanceof Zi?[{},s]:i.stencilConfigForOverlap(s),z=A[0],D=A[1],L=D[D.length-1].overscaledZ,$=!i.options.moving,q=0,K=D;q<K.length;q+=1){var V=K[q],X=i.depthModeForSublayer(V.overscaledZ-L,n.paint.get("raster-opacity")===1?F.ReadWrite:F.ReadOnly,f.LESS),ee=a.getTile(V),ie=i.transform.calculatePosMatrix(V.toUnwrapped(),$);ee.registerFadeDuration(n.paint.get("raster-fade-duration"));var pe=a.findLoadedParent(V,0),ue=is(ee,pe,a,n,i.transform),he=void 0,_e=void 0,Ie=n.paint.get("raster-resampling")==="nearest"?f.NEAREST:f.LINEAR;p.activeTexture.set(f.TEXTURE0),ee.texture.bind(Ie,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST),p.activeTexture.set(f.TEXTURE1),pe?(pe.texture.bind(Ie,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST),he=Math.pow(2,pe.tileID.overscaledZ-ee.tileID.overscaledZ),_e=[ee.tileID.canonical.x*he%1,ee.tileID.canonical.y*he%1]):ee.texture.bind(Ie,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST);var Te=Qc(ie,_e||[0,0],he||1,ue,n);y instanceof Zi?g.draw(p,f.TRIANGLES,X,j.disabled,w,te.disabled,Te,n.id,y.boundsBuffer,i.quadTriangleIndexBuffer,y.boundsSegments):g.draw(p,f.TRIANGLES,X,z[V.overscaledZ],w,te.disabled,Te,n.id,i.rasterBoundsBuffer,i.quadTriangleIndexBuffer,i.rasterBoundsSegments)}},background:function(i,a,n){var s=n.paint.get("background-color"),p=n.paint.get("background-opacity");if(p!==0){var f=i.context,y=f.gl,g=i.transform,w=g.tileSize,A=n.paint.get("background-pattern");if(!i.isPatternMissing(A)){var z=!A&&s.a===1&&p===1&&i.opaquePassEnabledForLayer()?"opaque":"translucent";if(i.renderPass===z){var D=j.disabled,L=i.depthModeForSublayer(0,z==="opaque"?F.ReadWrite:F.ReadOnly),$=i.colorModeForRenderPass(),q=i.useProgram(A?"backgroundPattern":"background"),K=g.coveringTiles({tileSize:w});A&&(f.activeTexture.set(y.TEXTURE0),i.imageManager.bind(i.context));for(var V=n.getCrossfadeParameters(),X=0,ee=K;X<ee.length;X+=1){var ie=ee[X],pe=i.transform.calculatePosMatrix(ie.toUnwrapped()),ue=A?La(pe,p,i,A,{tileID:ie,tileSize:w},V):yo(pe,p,s);q.draw(f,y.TRIANGLES,L,D,$,te.disabled,ue,n.id,i.tileExtentBuffer,i.quadTriangleIndexBuffer,i.tileExtentSegments)}}}}},debug:function(i,a,n){for(var s=0;s<n.length;s++)ku(i,a,n[s])},custom:function(i,a,n){var s=i.context,p=n.implementation;if(i.renderPass==="offscreen"){var f=p.prerender;f&&(i.setCustomLayerDefaults(),s.setColorMode(i.colorModeForRenderPass()),f.call(p,s.gl,i.transform.customLayerMatrix()),s.setDirty(),i.setBaseState())}else if(i.renderPass==="translucent"){i.setCustomLayerDefaults(),s.setColorMode(i.colorModeForRenderPass()),s.setStencilMode(j.disabled);var y=p.renderingMode==="3d"?new F(i.context.gl.LEQUAL,F.ReadWrite,i.depthRangeFor3D):i.depthModeForSublayer(0,F.ReadOnly);s.setDepthMode(y),p.render(s.gl,i.transform.customLayerMatrix()),s.setDirty(),i.setBaseState(),s.bindFramebuffer.set(null)}}},Zt=function(i,a){this.context=new B(i),this.transform=a,this._tileTextures={},this.setup(),this.numSublayers=Z.maxUnderzooming+Z.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new gn,this.gpuTimers={}};Zt.prototype.resize=function(i,a){if(this.width=i*l.browser.devicePixelRatio,this.height=a*l.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var n=0,s=this.style._order;n<s.length;n+=1)this.style._layers[s[n]].resize()},Zt.prototype.setup=function(){var i=this.context,a=new l.StructArrayLayout2i4;a.emplaceBack(0,0),a.emplaceBack(l.EXTENT,0),a.emplaceBack(0,l.EXTENT),a.emplaceBack(l.EXTENT,l.EXTENT),this.tileExtentBuffer=i.createVertexBuffer(a,pr.members),this.tileExtentSegments=l.SegmentVector.simpleSegment(0,0,4,2);var n=new l.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(l.EXTENT,0),n.emplaceBack(0,l.EXTENT),n.emplaceBack(l.EXTENT,l.EXTENT),this.debugBuffer=i.createVertexBuffer(n,pr.members),this.debugSegments=l.SegmentVector.simpleSegment(0,0,4,5);var s=new l.StructArrayLayout4i8;s.emplaceBack(0,0,0,0),s.emplaceBack(l.EXTENT,0,l.EXTENT,0),s.emplaceBack(0,l.EXTENT,0,l.EXTENT),s.emplaceBack(l.EXTENT,l.EXTENT,l.EXTENT,l.EXTENT),this.rasterBoundsBuffer=i.createVertexBuffer(s,Bi.members),this.rasterBoundsSegments=l.SegmentVector.simpleSegment(0,0,4,2);var p=new l.StructArrayLayout2i4;p.emplaceBack(0,0),p.emplaceBack(1,0),p.emplaceBack(0,1),p.emplaceBack(1,1),this.viewportBuffer=i.createVertexBuffer(p,pr.members),this.viewportSegments=l.SegmentVector.simpleSegment(0,0,4,2);var f=new l.StructArrayLayout1ui2;f.emplaceBack(0),f.emplaceBack(1),f.emplaceBack(3),f.emplaceBack(2),f.emplaceBack(0),this.tileBorderIndexBuffer=i.createIndexBuffer(f);var y=new l.StructArrayLayout3ui6;y.emplaceBack(0,1,2),y.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=i.createIndexBuffer(y),this.emptyTexture=new l.Texture(i,{width:1,height:1,data:new Uint8Array([0,0,0,0])},i.gl.RGBA);var g=this.context.gl;this.stencilClearMode=new j({func:g.ALWAYS,mask:0},0,255,g.ZERO,g.ZERO,g.ZERO)},Zt.prototype.clearStencil=function(){var i=this.context,a=i.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var n=l.create();l.ortho(n,0,this.width,this.height,0,0,1),l.scale(n,n,[a.drawingBufferWidth,a.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(i,a.TRIANGLES,F.disabled,this.stencilClearMode,Q.disabled,te.disabled,na(n),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},Zt.prototype._renderTileClippingMasks=function(i,a){if(this.currentStencilSource!==i.source&&i.isTileClipped()&&a&&a.length){this.currentStencilSource=i.source;var n=this.context,s=n.gl;this.nextStencilID+a.length>256&&this.clearStencil(),n.setColorMode(Q.disabled),n.setDepthMode(F.disabled);var p=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var f=0,y=a;f<y.length;f+=1){var g=y[f],w=this._tileClippingMaskIDs[g.key]=this.nextStencilID++;p.draw(n,s.TRIANGLES,F.disabled,new j({func:s.ALWAYS,mask:0},w,255,s.KEEP,s.KEEP,s.REPLACE),Q.disabled,te.disabled,na(g.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},Zt.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var i=this.nextStencilID++,a=this.context.gl;return new j({func:a.NOTEQUAL,mask:255},i,255,a.KEEP,a.KEEP,a.REPLACE)},Zt.prototype.stencilModeForClipping=function(i){var a=this.context.gl;return new j({func:a.EQUAL,mask:255},this._tileClippingMaskIDs[i.key],0,a.KEEP,a.KEEP,a.REPLACE)},Zt.prototype.stencilConfigForOverlap=function(i){var a,n=this.context.gl,s=i.sort(function(w,A){return A.overscaledZ-w.overscaledZ}),p=s[s.length-1].overscaledZ,f=s[0].overscaledZ-p+1;if(f>1){this.currentStencilSource=void 0,this.nextStencilID+f>256&&this.clearStencil();for(var y={},g=0;g<f;g++)y[g+p]=new j({func:n.GEQUAL,mask:255},g+this.nextStencilID,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID+=f,[y,s]}return[(a={},a[p]=j.disabled,a),s]},Zt.prototype.colorModeForRenderPass=function(){var i=this.context.gl;return this._showOverdrawInspector?new Q([i.CONSTANT_COLOR,i.ONE],new l.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?Q.unblended:Q.alphaBlended},Zt.prototype.depthModeForSublayer=function(i,a,n){if(!this.opaquePassEnabledForLayer())return F.disabled;var s=1-((1+this.currentLayer)*this.numSublayers+i)*this.depthEpsilon;return new F(n||this.context.gl.LEQUAL,a,[s,s])},Zt.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},Zt.prototype.render=function(i,a){var n=this;this.style=i,this.options=a,this.lineAtlas=i.lineAtlas,this.imageManager=i.imageManager,this.glyphManager=i.glyphManager,this.symbolFadeChange=i.placement.symbolFadeChange(l.browser.now()),this.imageManager.beginFrame();var s=this.style._order,p=this.style.sourceCaches;for(var f in p){var y=p[f];y.used&&y.prepare(this.context)}var g,w,A={},z={},D={};for(var L in p){var $=p[L];A[L]=$.getVisibleCoordinates(),z[L]=A[L].slice().reverse(),D[L]=$.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var q=0;q<s.length;q++)if(this.style._layers[s[q]].is3D()){this.opaquePassCutoff=q;break}this.renderPass="offscreen";for(var K=0,V=s;K<V.length;K+=1){var X=this.style._layers[V[K]];if(X.hasOffscreenPass()&&!X.isHidden(this.transform.zoom)){var ee=z[X.source];(X.type==="custom"||ee.length)&&this.renderLayer(this,p[X.source],X,ee)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:a.showOverdrawInspector?l.Color.black:l.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=a.showOverdrawInspector,this.depthRangeFor3D=[0,1-(i._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=s.length-1;this.currentLayer>=0;this.currentLayer--){var ie=this.style._layers[s[this.currentLayer]],pe=p[ie.source],ue=A[ie.source];this._renderTileClippingMasks(ie,ue),this.renderLayer(this,pe,ie,ue)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<s.length;this.currentLayer++){var he=this.style._layers[s[this.currentLayer]],_e=p[he.source],Ie=(he.type==="symbol"?D:z)[he.source];this._renderTileClippingMasks(he,A[he.source]),this.renderLayer(this,_e,he,Ie)}this.options.showTileBoundaries&&(l.values(this.style._layers).forEach(function(Te){Te.source&&!Te.isHidden(n.transform.zoom)&&(Te.source!==(w&&w.id)&&(w=n.style.sourceCaches[Te.source]),(!g||g.getSource().maxzoom<w.getSource().maxzoom)&&(g=w))}),g&&oa.debug(this,g,g.getVisibleCoordinates())),this.options.showPadding&&function(Te){var De=Te.transform.padding;cl(Te,Te.transform.height-(De.top||0),3,ll),cl(Te,De.bottom||0,3,Cu),pl(Te,De.left||0,3,Pu),pl(Te,Te.transform.width-(De.right||0),3,ns);var Ge=Te.transform.centerPoint;(function(Ke,Xe,bt,Fe){go(Ke,Xe-1,bt-10,2,20,Fe),go(Ke,Xe-10,bt-1,20,2,Fe)})(Te,Ge.x,Te.transform.height-Ge.y,ul)}(this),this.context.setDefault()},Zt.prototype.renderLayer=function(i,a,n,s){n.isHidden(this.transform.zoom)||(n.type==="background"||n.type==="custom"||s.length)&&(this.id=n.id,this.gpuTimingStart(n),oa[n.type](i,a,n,s,this.style.placement.variableOffsets),this.gpuTimingEnd())},Zt.prototype.gpuTimingStart=function(i){if(this.options.gpuTiming){var a=this.context.extTimerQuery,n=this.gpuTimers[i.id];n||(n=this.gpuTimers[i.id]={calls:0,cpuTime:0,query:a.createQueryEXT()}),n.calls++,a.beginQueryEXT(a.TIME_ELAPSED_EXT,n.query)}},Zt.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var i=this.context.extTimerQuery;i.endQueryEXT(i.TIME_ELAPSED_EXT)}},Zt.prototype.collectGpuTimers=function(){var i=this.gpuTimers;return this.gpuTimers={},i},Zt.prototype.queryGpuTimers=function(i){var a={};for(var n in i){var s=i[n],p=this.context.extTimerQuery,f=p.getQueryObjectEXT(s.query,p.QUERY_RESULT_EXT)/1e6;p.deleteQueryEXT(s.query),a[n]=f}return a},Zt.prototype.translatePosMatrix=function(i,a,n,s,p){if(!n[0]&&!n[1])return i;var f=p?s==="map"?this.transform.angle:0:s==="viewport"?-this.transform.angle:0;if(f){var y=Math.sin(f),g=Math.cos(f);n=[n[0]*g-n[1]*y,n[0]*y+n[1]*g]}var w=[p?n[0]:$t(a,n[0],this.transform.zoom),p?n[1]:$t(a,n[1],this.transform.zoom),0],A=new Float32Array(16);return l.translate(A,i,w),A},Zt.prototype.saveTileTexture=function(i){var a=this._tileTextures[i.size[0]];a?a.push(i):this._tileTextures[i.size[0]]=[i]},Zt.prototype.getTileTexture=function(i){var a=this._tileTextures[i];return a&&a.length>0?a.pop():null},Zt.prototype.isPatternMissing=function(i){if(!i)return!1;if(!i.from||!i.to)return!0;var a=this.imageManager.getPattern(i.from.toString()),n=this.imageManager.getPattern(i.to.toString());return!a||!n},Zt.prototype.useProgram=function(i,a){this.cache=this.cache||{};var n=""+i+(a?a.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[n]||(this.cache[n]=new mu(this.context,i,Jc[i],a,Tu[i],this._showOverdrawInspector)),this.cache[n]},Zt.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},Zt.prototype.setBaseState=function(){var i=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(i.FUNC_ADD)},Zt.prototype.initDebugOverlayCanvas=function(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=l.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new l.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},Zt.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var as=function(i,a){this.points=i,this.planes=a};as.fromInvProjectionMatrix=function(i,a,n){var s=Math.pow(2,n),p=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(function(y){return l.transformMat4([],y,i)}).map(function(y){return l.scale$1([],y,1/y[3]/a*s)}),f=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(function(y){var g=l.sub([],p[y[0]],p[y[1]]),w=l.sub([],p[y[2]],p[y[1]]),A=l.normalize([],l.cross([],g,w)),z=-l.dot(A,p[y[1]]);return A.concat(z)});return new as(p,f)};var sa=function(i,a){this.min=i,this.max=a,this.center=l.scale$2([],l.add([],this.min,this.max),.5)};sa.prototype.quadrant=function(i){for(var a=[i%2==0,i<2],n=l.clone$2(this.min),s=l.clone$2(this.max),p=0;p<a.length;p++)n[p]=a[p]?this.min[p]:this.center[p],s[p]=a[p]?this.center[p]:this.max[p];return s[2]=this.max[2],new sa(n,s)},sa.prototype.distanceX=function(i){return Math.max(Math.min(this.max[0],i[0]),this.min[0])-i[0]},sa.prototype.distanceY=function(i){return Math.max(Math.min(this.max[1],i[1]),this.min[1])-i[1]},sa.prototype.intersects=function(i){for(var a=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],n=!0,s=0;s<i.planes.length;s++){for(var p=i.planes[s],f=0,y=0;y<a.length;y++)f+=l.dot$1(p,a[y])>=0;if(f===0)return 0;f!==a.length&&(n=!1)}if(n)return 2;for(var g=0;g<3;g++){for(var w=Number.MAX_VALUE,A=-Number.MAX_VALUE,z=0;z<i.points.length;z++){var D=i.points[z][g]-this.min[g];w=Math.min(w,D),A=Math.max(A,D)}if(A<0||w>this.max[g]-this.min[g])return 0}return 1};var An=function(i,a,n,s){if(i===void 0&&(i=0),a===void 0&&(a=0),n===void 0&&(n=0),s===void 0&&(s=0),isNaN(i)||i<0||isNaN(a)||a<0||isNaN(n)||n<0||isNaN(s)||s<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=i,this.bottom=a,this.left=n,this.right=s};An.prototype.interpolate=function(i,a,n){return a.top!=null&&i.top!=null&&(this.top=l.number(i.top,a.top,n)),a.bottom!=null&&i.bottom!=null&&(this.bottom=l.number(i.bottom,a.bottom,n)),a.left!=null&&i.left!=null&&(this.left=l.number(i.left,a.left,n)),a.right!=null&&i.right!=null&&(this.right=l.number(i.right,a.right,n)),this},An.prototype.getCenter=function(i,a){var n=l.clamp((this.left+i-this.right)/2,0,i),s=l.clamp((this.top+a-this.bottom)/2,0,a);return new l.Point(n,s)},An.prototype.equals=function(i){return this.top===i.top&&this.bottom===i.bottom&&this.left===i.left&&this.right===i.right},An.prototype.clone=function(){return new An(this.top,this.bottom,this.left,this.right)},An.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var gt=function(i,a,n,s,p){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=p===void 0||p,this._minZoom=i||0,this._maxZoom=a||22,this._minPitch=n??0,this._maxPitch=s??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new l.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new An,this._posMatrixCache={},this._alignedPosMatrixCache={}},Nt={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};gt.prototype.clone=function(){var i=new gt(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return i.tileSize=this.tileSize,i.latRange=this.latRange,i.width=this.width,i.height=this.height,i._center=this._center,i.zoom=this.zoom,i.angle=this.angle,i._fov=this._fov,i._pitch=this._pitch,i._unmodified=this._unmodified,i._edgeInsets=this._edgeInsets.clone(),i._calcMatrices(),i},Nt.minZoom.get=function(){return this._minZoom},Nt.minZoom.set=function(i){this._minZoom!==i&&(this._minZoom=i,this.zoom=Math.max(this.zoom,i))},Nt.maxZoom.get=function(){return this._maxZoom},Nt.maxZoom.set=function(i){this._maxZoom!==i&&(this._maxZoom=i,this.zoom=Math.min(this.zoom,i))},Nt.minPitch.get=function(){return this._minPitch},Nt.minPitch.set=function(i){this._minPitch!==i&&(this._minPitch=i,this.pitch=Math.max(this.pitch,i))},Nt.maxPitch.get=function(){return this._maxPitch},Nt.maxPitch.set=function(i){this._maxPitch!==i&&(this._maxPitch=i,this.pitch=Math.min(this.pitch,i))},Nt.renderWorldCopies.get=function(){return this._renderWorldCopies},Nt.renderWorldCopies.set=function(i){i===void 0?i=!0:i===null&&(i=!1),this._renderWorldCopies=i},Nt.worldSize.get=function(){return this.tileSize*this.scale},Nt.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Nt.size.get=function(){return new l.Point(this.width,this.height)},Nt.bearing.get=function(){return-this.angle/Math.PI*180},Nt.bearing.set=function(i){var a=-l.wrap(i,-180,180)*Math.PI/180;this.angle!==a&&(this._unmodified=!1,this.angle=a,this._calcMatrices(),this.rotationMatrix=l.create$2(),l.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Nt.pitch.get=function(){return this._pitch/Math.PI*180},Nt.pitch.set=function(i){var a=l.clamp(i,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==a&&(this._unmodified=!1,this._pitch=a,this._calcMatrices())},Nt.fov.get=function(){return this._fov/Math.PI*180},Nt.fov.set=function(i){i=Math.max(.01,Math.min(60,i)),this._fov!==i&&(this._unmodified=!1,this._fov=i/180*Math.PI,this._calcMatrices())},Nt.zoom.get=function(){return this._zoom},Nt.zoom.set=function(i){var a=Math.min(Math.max(i,this.minZoom),this.maxZoom);this._zoom!==a&&(this._unmodified=!1,this._zoom=a,this.scale=this.zoomScale(a),this.tileZoom=Math.floor(a),this.zoomFraction=a-this.tileZoom,this._constrain(),this._calcMatrices())},Nt.center.get=function(){return this._center},Nt.center.set=function(i){i.lat===this._center.lat&&i.lng===this._center.lng||(this._unmodified=!1,this._center=i,this._constrain(),this._calcMatrices())},Nt.padding.get=function(){return this._edgeInsets.toJSON()},Nt.padding.set=function(i){this._edgeInsets.equals(i)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,i,1),this._calcMatrices())},Nt.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},gt.prototype.isPaddingEqual=function(i){return this._edgeInsets.equals(i)},gt.prototype.interpolatePadding=function(i,a,n){this._unmodified=!1,this._edgeInsets.interpolate(i,a,n),this._constrain(),this._calcMatrices()},gt.prototype.coveringZoomLevel=function(i){var a=(i.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/i.tileSize));return Math.max(0,a)},gt.prototype.getVisibleUnwrappedCoordinates=function(i){var a=[new l.UnwrappedTileID(0,i)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new l.Point(0,0)),s=this.pointCoordinate(new l.Point(this.width,0)),p=this.pointCoordinate(new l.Point(this.width,this.height)),f=this.pointCoordinate(new l.Point(0,this.height)),y=Math.floor(Math.min(n.x,s.x,p.x,f.x)),g=Math.floor(Math.max(n.x,s.x,p.x,f.x)),w=y-1;w<=g+1;w++)w!==0&&a.push(new l.UnwrappedTileID(w,i));return a},gt.prototype.coveringTiles=function(i){var a=this.coveringZoomLevel(i),n=a;if(i.minzoom!==void 0&&a<i.minzoom)return[];i.maxzoom!==void 0&&a>i.maxzoom&&(a=i.maxzoom);var s=l.MercatorCoordinate.fromLngLat(this.center),p=Math.pow(2,a),f=[p*s.x,p*s.y,0],y=as.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,a),g=i.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(g=a);var w=function(Te){return{aabb:new sa([Te*p,0,0],[(Te+1)*p,p,0]),zoom:0,x:0,y:0,wrap:Te,fullyVisible:!1}},A=[],z=[],D=a,L=i.reparseOverscaled?n:a;if(this._renderWorldCopies)for(var $=1;$<=3;$++)A.push(w(-$)),A.push(w($));for(A.push(w(0));A.length>0;){var q=A.pop(),K=q.x,V=q.y,X=q.fullyVisible;if(!X){var ee=q.aabb.intersects(y);if(ee===0)continue;X=ee===2}var ie=q.aabb.distanceX(f),pe=q.aabb.distanceY(f),ue=Math.max(Math.abs(ie),Math.abs(pe));if(q.zoom===D||ue>3+(1<<D-q.zoom)-2&&q.zoom>=g)z.push({tileID:new l.OverscaledTileID(q.zoom===D?L:q.zoom,q.wrap,q.zoom,K,V),distanceSq:l.sqrLen([f[0]-.5-K,f[1]-.5-V])});else for(var he=0;he<4;he++){var _e=(K<<1)+he%2,Ie=(V<<1)+(he>>1);A.push({aabb:q.aabb.quadrant(he),zoom:q.zoom+1,x:_e,y:Ie,wrap:q.wrap,fullyVisible:X})}}return z.sort(function(Te,De){return Te.distanceSq-De.distanceSq}).map(function(Te){return Te.tileID})},gt.prototype.resize=function(i,a){this.width=i,this.height=a,this.pixelsToGLUnits=[2/i,-2/a],this._constrain(),this._calcMatrices()},Nt.unmodified.get=function(){return this._unmodified},gt.prototype.zoomScale=function(i){return Math.pow(2,i)},gt.prototype.scaleZoom=function(i){return Math.log(i)/Math.LN2},gt.prototype.project=function(i){var a=l.clamp(i.lat,-this.maxValidLatitude,this.maxValidLatitude);return new l.Point(l.mercatorXfromLng(i.lng)*this.worldSize,l.mercatorYfromLat(a)*this.worldSize)},gt.prototype.unproject=function(i){return new l.MercatorCoordinate(i.x/this.worldSize,i.y/this.worldSize).toLngLat()},Nt.point.get=function(){return this.project(this.center)},gt.prototype.setLocationAtPoint=function(i,a){var n=this.pointCoordinate(a),s=this.pointCoordinate(this.centerPoint),p=this.locationCoordinate(i),f=new l.MercatorCoordinate(p.x-(n.x-s.x),p.y-(n.y-s.y));this.center=this.coordinateLocation(f),this._renderWorldCopies&&(this.center=this.center.wrap())},gt.prototype.locationPoint=function(i){return this.coordinatePoint(this.locationCoordinate(i))},gt.prototype.pointLocation=function(i){return this.coordinateLocation(this.pointCoordinate(i))},gt.prototype.locationCoordinate=function(i){return l.MercatorCoordinate.fromLngLat(i)},gt.prototype.coordinateLocation=function(i){return i.toLngLat()},gt.prototype.pointCoordinate=function(i){var a=[i.x,i.y,0,1],n=[i.x,i.y,1,1];l.transformMat4(a,a,this.pixelMatrixInverse),l.transformMat4(n,n,this.pixelMatrixInverse);var s=a[3],p=n[3],f=a[1]/s,y=n[1]/p,g=a[2]/s,w=n[2]/p,A=g===w?0:(0-g)/(w-g);return new l.MercatorCoordinate(l.number(a[0]/s,n[0]/p,A)/this.worldSize,l.number(f,y,A)/this.worldSize)},gt.prototype.coordinatePoint=function(i){var a=[i.x*this.worldSize,i.y*this.worldSize,0,1];return l.transformMat4(a,a,this.pixelMatrix),new l.Point(a[0]/a[3],a[1]/a[3])},gt.prototype.getBounds=function(){return new l.LngLatBounds().extend(this.pointLocation(new l.Point(0,0))).extend(this.pointLocation(new l.Point(this.width,0))).extend(this.pointLocation(new l.Point(this.width,this.height))).extend(this.pointLocation(new l.Point(0,this.height)))},gt.prototype.getMaxBounds=function(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new l.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},gt.prototype.setMaxBounds=function(i){i?(this.lngRange=[i.getWest(),i.getEast()],this.latRange=[i.getSouth(),i.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},gt.prototype.calculatePosMatrix=function(i,a){a===void 0&&(a=!1);var n=i.key,s=a?this._alignedPosMatrixCache:this._posMatrixCache;if(s[n])return s[n];var p=i.canonical,f=this.worldSize/this.zoomScale(p.z),y=p.x+Math.pow(2,p.z)*i.wrap,g=l.identity(new Float64Array(16));return l.translate(g,g,[y*f,p.y*f,0]),l.scale(g,g,[f/l.EXTENT,f/l.EXTENT,1]),l.multiply(g,a?this.alignedProjMatrix:this.projMatrix,g),s[n]=new Float32Array(g),s[n]},gt.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},gt.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var i,a,n,s,p=-90,f=90,y=-180,g=180,w=this.size,A=this._unmodified;if(this.latRange){var z=this.latRange;p=l.mercatorYfromLat(z[1])*this.worldSize,i=(f=l.mercatorYfromLat(z[0])*this.worldSize)-p<w.y?w.y/(f-p):0}if(this.lngRange){var D=this.lngRange;y=l.mercatorXfromLng(D[0])*this.worldSize,a=(g=l.mercatorXfromLng(D[1])*this.worldSize)-y<w.x?w.x/(g-y):0}var L=this.point,$=Math.max(a||0,i||0);if($)return this.center=this.unproject(new l.Point(a?(g+y)/2:L.x,i?(f+p)/2:L.y)),this.zoom+=this.scaleZoom($),this._unmodified=A,void(this._constraining=!1);if(this.latRange){var q=L.y,K=w.y/2;q-K<p&&(s=p+K),q+K>f&&(s=f-K)}if(this.lngRange){var V=L.x,X=w.x/2;V-X<y&&(n=y+X),V+X>g&&(n=g-X)}n===void 0&&s===void 0||(this.center=this.unproject(new l.Point(n!==void 0?n:L.x,s!==void 0?s:L.y))),this._unmodified=A,this._constraining=!1}},gt.prototype._calcMatrices=function(){if(this.height){var i=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var a=Math.PI/2+this._pitch,n=this._fov*(.5+i.y/this.height),s=Math.sin(n)*this.cameraToCenterDistance/Math.sin(l.clamp(Math.PI-a-n,.01,Math.PI-.01)),p=this.point,f=p.x,y=p.y,g=1.01*(Math.cos(Math.PI/2-this._pitch)*s+this.cameraToCenterDistance),w=this.height/50,A=new Float64Array(16);l.perspective(A,this._fov,this.width/this.height,w,g),A[8]=2*-i.x/this.width,A[9]=2*i.y/this.height,l.scale(A,A,[1,-1,1]),l.translate(A,A,[0,0,-this.cameraToCenterDistance]),l.rotateX(A,A,this._pitch),l.rotateZ(A,A,this.angle),l.translate(A,A,[-f,-y,0]),this.mercatorMatrix=l.scale([],A,[this.worldSize,this.worldSize,this.worldSize]),l.scale(A,A,[1,1,l.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=A,this.invProjMatrix=l.invert([],this.projMatrix);var z=this.width%2/2,D=this.height%2/2,L=Math.cos(this.angle),$=Math.sin(this.angle),q=f-Math.round(f)+L*z+$*D,K=y-Math.round(y)+L*D+$*z,V=new Float64Array(A);if(l.translate(V,V,[q>.5?q-1:q,K>.5?K-1:K,0]),this.alignedProjMatrix=V,A=l.create(),l.scale(A,A,[this.width/2,-this.height/2,1]),l.translate(A,A,[1,-1,0]),this.labelPlaneMatrix=A,A=l.create(),l.scale(A,A,[1,-1,1]),l.translate(A,A,[-1,-1,0]),l.scale(A,A,[2/this.width,2/this.height,1]),this.glCoordMatrix=A,this.pixelMatrix=l.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(A=l.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=A,this._posMatrixCache={},this._alignedPosMatrixCache={}}},gt.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var i=this.pointCoordinate(new l.Point(0,0)),a=[i.x*this.worldSize,i.y*this.worldSize,0,1];return l.transformMat4(a,a,this.pixelMatrix)[3]/this.cameraToCenterDistance},gt.prototype.getCameraPoint=function(){var i=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new l.Point(0,i))},gt.prototype.getCameraQueryGeometry=function(i){var a=this.getCameraPoint();if(i.length===1)return[i[0],a];for(var n=a.x,s=a.y,p=a.x,f=a.y,y=0,g=i;y<g.length;y+=1){var w=g[y];n=Math.min(n,w.x),s=Math.min(s,w.y),p=Math.max(p,w.x),f=Math.max(f,w.y)}return[new l.Point(n,s),new l.Point(p,s),new l.Point(p,f),new l.Point(n,f),new l.Point(n,s)]},Object.defineProperties(gt.prototype,Nt);var fi=function(i){var a,n,s,p;this._hashName=i&&encodeURIComponent(i),l.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(a=this._updateHashUnthrottled.bind(this),n=!1,s=null,p=function(){s=null,n&&(a(),s=setTimeout(p,300),n=!1)},function(){return n=!0,s||p(),s})};fi.prototype.addTo=function(i){return this._map=i,l.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},fi.prototype.remove=function(){return l.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},fi.prototype.getHashString=function(i){var a=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,s=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),p=Math.pow(10,s),f=Math.round(a.lng*p)/p,y=Math.round(a.lat*p)/p,g=this._map.getBearing(),w=this._map.getPitch(),A="";if(A+=i?"/"+f+"/"+y+"/"+n:n+"/"+y+"/"+f,(g||w)&&(A+="/"+Math.round(10*g)/10),w&&(A+="/"+Math.round(w)),this._hashName){var z=this._hashName,D=!1,L=l.window.location.hash.slice(1).split("&").map(function($){var q=$.split("=")[0];return q===z?(D=!0,q+"="+A):$}).filter(function($){return $});return D||L.push(z+"="+A),"#"+L.join("&")}return"#"+A},fi.prototype._getCurrentHash=function(){var i,a=this,n=l.window.location.hash.replace("#","");return this._hashName?(n.split("&").map(function(s){return s.split("=")}).forEach(function(s){s[0]===a._hashName&&(i=s)}),(i&&i[1]||"").split("/")):n.split("/")},fi.prototype._onHashChange=function(){var i=this._getCurrentHash();if(i.length>=3&&!i.some(function(n){return isNaN(n)})){var a=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(i[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+i[2],+i[1]],zoom:+i[0],bearing:a,pitch:+(i[4]||0)}),!0}return!1},fi.prototype._updateHashUnthrottled=function(){var i=l.window.location.href.replace(/(#.+)?$/,this.getHashString());try{l.window.history.replaceState(l.window.history.state,null,i)}catch{}};var _o={linearity:.3,easing:l.bezier(0,0,.3,1)},Fa=l.extend({deceleration:2500,maxSpeed:1400},_o),xo=l.extend({deceleration:20,maxSpeed:1400},_o),tp=l.extend({deceleration:1e3,maxSpeed:360},_o),rp=l.extend({deceleration:1e3,maxSpeed:90},_o),bo=function(i){this._map=i,this.clear()};function wo(i,a){(!i.duration||i.duration<a.duration)&&(i.duration=a.duration,i.easing=a.easing)}function sn(i,a,n){var s=n.maxSpeed,p=n.linearity,f=n.deceleration,y=l.clamp(i*p/(a/1e3),-s,s),g=Math.abs(y)/(f*p);return{easing:n.easing,duration:1e3*g,amount:y*(g/2)}}bo.prototype.clear=function(){this._inertiaBuffer=[]},bo.prototype.record=function(i){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:l.browser.now(),settings:i})},bo.prototype._drainInertiaBuffer=function(){for(var i=this._inertiaBuffer,a=l.browser.now();i.length>0&&a-i[0].time>160;)i.shift()},bo.prototype._onMoveEnd=function(i){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var a={zoom:0,bearing:0,pitch:0,pan:new l.Point(0,0),pinchAround:void 0,around:void 0},n=0,s=this._inertiaBuffer;n<s.length;n+=1){var p=s[n].settings;a.zoom+=p.zoomDelta||0,a.bearing+=p.bearingDelta||0,a.pitch+=p.pitchDelta||0,p.panDelta&&a.pan._add(p.panDelta),p.around&&(a.around=p.around),p.pinchAround&&(a.pinchAround=p.pinchAround)}var f=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,y={};if(a.pan.mag()){var g=sn(a.pan.mag(),f,l.extend({},Fa,i||{}));y.offset=a.pan.mult(g.amount/a.pan.mag()),y.center=this._map.transform.center,wo(y,g)}if(a.zoom){var w=sn(a.zoom,f,xo);y.zoom=this._map.transform.zoom+w.amount,wo(y,w)}if(a.bearing){var A=sn(a.bearing,f,tp);y.bearing=this._map.transform.bearing+l.clamp(A.amount,-179,179),wo(y,A)}if(a.pitch){var z=sn(a.pitch,f,rp);y.pitch=this._map.transform.pitch+z.amount,wo(y,z)}if(y.zoom||y.bearing){var D=a.pinchAround===void 0?a.around:a.pinchAround;y.around=D?this._map.unproject(D):this._map.getCenter()}return this.clear(),l.extend(y,{noMoveStart:!0})}};var dr=function(i){function a(s,p,f,y){y===void 0&&(y={});var g=W.mousePos(p.getCanvasContainer(),f),w=p.unproject(g);i.call(this,s,l.extend({point:g,lngLat:w,originalEvent:f},y)),this._defaultPrevented=!1,this.target=p}i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a;var n={defaultPrevented:{configurable:!0}};return a.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(a.prototype,n),a}(l.Event),So=function(i){function a(s,p,f){var y=s==="touchend"?f.changedTouches:f.touches,g=W.touchPos(p.getCanvasContainer(),y),w=g.map(function(D){return p.unproject(D)}),A=g.reduce(function(D,L,$,q){return D.add(L.div(q.length))},new l.Point(0,0)),z=p.unproject(A);i.call(this,s,{points:g,point:A,lngLats:w,lngLat:z,originalEvent:f}),this._defaultPrevented=!1}i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a;var n={defaultPrevented:{configurable:!0}};return a.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(a.prototype,n),a}(l.Event),Mu=function(i){function a(s,p,f){i.call(this,s,{originalEvent:f}),this._defaultPrevented=!1}i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a;var n={defaultPrevented:{configurable:!0}};return a.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(a.prototype,n),a}(l.Event),hr=function(i,a){this._map=i,this._clickTolerance=a.clickTolerance};hr.prototype.reset=function(){delete this._mousedownPos},hr.prototype.wheel=function(i){return this._firePreventable(new Mu(i.type,this._map,i))},hr.prototype.mousedown=function(i,a){return this._mousedownPos=a,this._firePreventable(new dr(i.type,this._map,i))},hr.prototype.mouseup=function(i){this._map.fire(new dr(i.type,this._map,i))},hr.prototype.click=function(i,a){this._mousedownPos&&this._mousedownPos.dist(a)>=this._clickTolerance||this._map.fire(new dr(i.type,this._map,i))},hr.prototype.dblclick=function(i){return this._firePreventable(new dr(i.type,this._map,i))},hr.prototype.mouseover=function(i){this._map.fire(new dr(i.type,this._map,i))},hr.prototype.mouseout=function(i){this._map.fire(new dr(i.type,this._map,i))},hr.prototype.touchstart=function(i){return this._firePreventable(new So(i.type,this._map,i))},hr.prototype.touchmove=function(i){this._map.fire(new So(i.type,this._map,i))},hr.prototype.touchend=function(i){this._map.fire(new So(i.type,this._map,i))},hr.prototype.touchcancel=function(i){this._map.fire(new So(i.type,this._map,i))},hr.prototype._firePreventable=function(i){if(this._map.fire(i),i.defaultPrevented)return{}},hr.prototype.isEnabled=function(){return!0},hr.prototype.isActive=function(){return!1},hr.prototype.enable=function(){},hr.prototype.disable=function(){};var Ve=function(i){this._map=i};Ve.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Ve.prototype.mousemove=function(i){this._map.fire(new dr(i.type,this._map,i))},Ve.prototype.mousedown=function(){this._delayContextMenu=!0},Ve.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new dr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Ve.prototype.contextmenu=function(i){this._delayContextMenu?this._contextMenuEvent=i:this._map.fire(new dr(i.type,this._map,i)),this._map.listens("contextmenu")&&i.preventDefault()},Ve.prototype.isEnabled=function(){return!0},Ve.prototype.isActive=function(){return!1},Ve.prototype.enable=function(){},Ve.prototype.disable=function(){};var ai=function(i,a){this._map=i,this._el=i.getCanvasContainer(),this._container=i.getContainer(),this._clickTolerance=a.clickTolerance||1};function os(i,a){for(var n={},s=0;s<i.length;s++)n[i[s].identifier]=a[s];return n}ai.prototype.isEnabled=function(){return!!this._enabled},ai.prototype.isActive=function(){return!!this._active},ai.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},ai.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},ai.prototype.mousedown=function(i,a){this.isEnabled()&&i.shiftKey&&i.button===0&&(W.disableDrag(),this._startPos=this._lastPos=a,this._active=!0)},ai.prototype.mousemoveWindow=function(i,a){if(this._active){var n=a;if(!(this._lastPos.equals(n)||!this._box&&n.dist(this._startPos)<this._clickTolerance)){var s=this._startPos;this._lastPos=n,this._box||(this._box=W.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",i));var p=Math.min(s.x,n.x),f=Math.max(s.x,n.x),y=Math.min(s.y,n.y),g=Math.max(s.y,n.y);W.setTransform(this._box,"translate("+p+"px,"+y+"px)"),this._box.style.width=f-p+"px",this._box.style.height=g-y+"px"}}},ai.prototype.mouseupWindow=function(i,a){var n=this;if(this._active&&i.button===0){var s=this._startPos,p=a;if(this.reset(),W.suppressClick(),s.x!==p.x||s.y!==p.y)return this._map.fire(new l.Event("boxzoomend",{originalEvent:i})),{cameraAnimation:function(f){return f.fitScreenCoordinates(s,p,n._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",i)}},ai.prototype.keydown=function(i){this._active&&i.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",i))},ai.prototype.blur=function(){this.reset()},ai.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(W.remove(this._box),this._box=null),W.enableDrag(),delete this._startPos,delete this._lastPos},ai.prototype._fireEvent=function(i,a){return this._map.fire(new l.Event(i,{originalEvent:a}))};var Oa=function(i){this.reset(),this.numTouches=i.numTouches};Oa.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Oa.prototype.touchstart=function(i,a,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=i.timeStamp),n.length===this.numTouches&&(this.centroid=function(s){for(var p=new l.Point(0,0),f=0,y=s;f<y.length;f+=1)p._add(y[f]);return p.div(s.length)}(a),this.touches=os(n,a)))},Oa.prototype.touchmove=function(i,a,n){if(!this.aborted&&this.centroid){var s=os(n,a);for(var p in this.touches){var f=s[p];(!f||f.dist(this.touches[p])>30)&&(this.aborted=!0)}}},Oa.prototype.touchend=function(i,a,n){if((!this.centroid||i.timeStamp-this.startTime>500)&&(this.aborted=!0),n.length===0){var s=!this.aborted&&this.centroid;if(this.reset(),s)return s}};var Vi=function(i){this.singleTap=new Oa(i),this.numTaps=i.numTaps,this.reset()};Vi.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Vi.prototype.touchstart=function(i,a,n){this.singleTap.touchstart(i,a,n)},Vi.prototype.touchmove=function(i,a,n){this.singleTap.touchmove(i,a,n)},Vi.prototype.touchend=function(i,a,n){var s=this.singleTap.touchend(i,a,n);if(s){var p=i.timeStamp-this.lastTime<500,f=!this.lastTap||this.lastTap.dist(s)<30;if(p&&f||this.reset(),this.count++,this.lastTime=i.timeStamp,this.lastTap=s,this.count===this.numTaps)return this.reset(),s}};var oi=function(){this._zoomIn=new Vi({numTouches:1,numTaps:2}),this._zoomOut=new Vi({numTouches:2,numTaps:1}),this.reset()};oi.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},oi.prototype.touchstart=function(i,a,n){this._zoomIn.touchstart(i,a,n),this._zoomOut.touchstart(i,a,n)},oi.prototype.touchmove=function(i,a,n){this._zoomIn.touchmove(i,a,n),this._zoomOut.touchmove(i,a,n)},oi.prototype.touchend=function(i,a,n){var s=this,p=this._zoomIn.touchend(i,a,n),f=this._zoomOut.touchend(i,a,n);return p?(this._active=!0,i.preventDefault(),setTimeout(function(){return s.reset()},0),{cameraAnimation:function(y){return y.easeTo({duration:300,zoom:y.getZoom()+1,around:y.unproject(p)},{originalEvent:i})}}):f?(this._active=!0,i.preventDefault(),setTimeout(function(){return s.reset()},0),{cameraAnimation:function(y){return y.easeTo({duration:300,zoom:y.getZoom()-1,around:y.unproject(f)},{originalEvent:i})}}):void 0},oi.prototype.touchcancel=function(){this.reset()},oi.prototype.enable=function(){this._enabled=!0},oi.prototype.disable=function(){this._enabled=!1,this.reset()},oi.prototype.isEnabled=function(){return this._enabled},oi.prototype.isActive=function(){return this._active};var hl={0:1,2:2},Ce=function(i){this.reset(),this._clickTolerance=i.clickTolerance||1};Ce.prototype.blur=function(){this.reset()},Ce.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Ce.prototype._correctButton=function(i,a){return!1},Ce.prototype._move=function(i,a){return{}},Ce.prototype.mousedown=function(i,a){if(!this._lastPoint){var n=W.mouseButton(i);this._correctButton(i,n)&&(this._lastPoint=a,this._eventButton=n)}},Ce.prototype.mousemoveWindow=function(i,a){var n=this._lastPoint;if(n){if(i.preventDefault(),function(s,p){var f=hl[p];return s.buttons===void 0||(s.buttons&f)!==f}(i,this._eventButton))this.reset();else if(this._moved||!(a.dist(n)<this._clickTolerance))return this._moved=!0,this._lastPoint=a,this._move(n,a)}},Ce.prototype.mouseupWindow=function(i){this._lastPoint&&W.mouseButton(i)===this._eventButton&&(this._moved&&W.suppressClick(),this.reset())},Ce.prototype.enable=function(){this._enabled=!0},Ce.prototype.disable=function(){this._enabled=!1,this.reset()},Ce.prototype.isEnabled=function(){return this._enabled},Ce.prototype.isActive=function(){return this._active};var fl=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.mousedown=function(n,s){i.prototype.mousedown.call(this,n,s),this._lastPoint&&(this._active=!0)},a.prototype._correctButton=function(n,s){return s===0&&!n.ctrlKey},a.prototype._move=function(n,s){return{around:s,panDelta:s.sub(n)}},a}(Ce),ss=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype._correctButton=function(n,s){return s===0&&n.ctrlKey||s===2},a.prototype._move=function(n,s){var p=.8*(s.x-n.x);if(p)return this._active=!0,{bearingDelta:p}},a.prototype.contextmenu=function(n){n.preventDefault()},a}(Ce),dl=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype._correctButton=function(n,s){return s===0&&n.ctrlKey||s===2},a.prototype._move=function(n,s){var p=-.5*(s.y-n.y);if(p)return this._active=!0,{pitchDelta:p}},a.prototype.contextmenu=function(n){n.preventDefault()},a}(Ce),Ai=function(i){this._minTouches=1,this._clickTolerance=i.clickTolerance||1,this.reset()};Ai.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new l.Point(0,0)},Ai.prototype.touchstart=function(i,a,n){return this._calculateTransform(i,a,n)},Ai.prototype.touchmove=function(i,a,n){if(this._active&&!(n.length<this._minTouches))return i.preventDefault(),this._calculateTransform(i,a,n)},Ai.prototype.touchend=function(i,a,n){this._calculateTransform(i,a,n),this._active&&n.length<this._minTouches&&this.reset()},Ai.prototype.touchcancel=function(){this.reset()},Ai.prototype._calculateTransform=function(i,a,n){n.length>0&&(this._active=!0);var s=os(n,a),p=new l.Point(0,0),f=new l.Point(0,0),y=0;for(var g in s){var w=s[g],A=this._touches[g];A&&(p._add(w),f._add(w.sub(A)),y++,s[g]=w)}if(this._touches=s,!(y<this._minTouches)&&f.mag()){var z=f.div(y);if(this._sum._add(z),!(this._sum.mag()<this._clickTolerance))return{around:p.div(y),panDelta:z}}},Ai.prototype.enable=function(){this._enabled=!0},Ai.prototype.disable=function(){this._enabled=!1,this.reset()},Ai.prototype.isEnabled=function(){return this._enabled},Ai.prototype.isActive=function(){return this._active};var si=function(){this.reset()};function ls(i,a,n){for(var s=0;s<i.length;s++)if(i[s].identifier===n)return a[s]}function us(i,a){return Math.log(i/a)/Math.LN2}si.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},si.prototype._start=function(i){},si.prototype._move=function(i,a,n){return{}},si.prototype.touchstart=function(i,a,n){this._firstTwoTouches||n.length<2||(this._firstTwoTouches=[n[0].identifier,n[1].identifier],this._start([a[0],a[1]]))},si.prototype.touchmove=function(i,a,n){if(this._firstTwoTouches){i.preventDefault();var s=this._firstTwoTouches,p=s[1],f=ls(n,a,s[0]),y=ls(n,a,p);if(f&&y){var g=this._aroundCenter?null:f.add(y).div(2);return this._move([f,y],g,i)}}},si.prototype.touchend=function(i,a,n){if(this._firstTwoTouches){var s=this._firstTwoTouches,p=s[1],f=ls(n,a,s[0]),y=ls(n,a,p);f&&y||(this._active&&W.suppressClick(),this.reset())}},si.prototype.touchcancel=function(){this.reset()},si.prototype.enable=function(i){this._enabled=!0,this._aroundCenter=!!i&&i.around==="center"},si.prototype.disable=function(){this._enabled=!1,this.reset()},si.prototype.isEnabled=function(){return this._enabled},si.prototype.isActive=function(){return this._active};var li=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.reset=function(){i.prototype.reset.call(this),delete this._distance,delete this._startDistance},a.prototype._start=function(n){this._startDistance=this._distance=n[0].dist(n[1])},a.prototype._move=function(n,s){var p=this._distance;if(this._distance=n[0].dist(n[1]),this._active||!(Math.abs(us(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:us(this._distance,p),pinchAround:s}},a}(si);function ln(i,a){return 180*i.angleWith(a)/Math.PI}var zu=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.reset=function(){i.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},a.prototype._start=function(n){this._startVector=this._vector=n[0].sub(n[1]),this._minDiameter=n[0].dist(n[1])},a.prototype._move=function(n,s){var p=this._vector;if(this._vector=n[0].sub(n[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:ln(this._vector,p),pinchAround:s}},a.prototype._isBelowThreshold=function(n){this._minDiameter=Math.min(this._minDiameter,n.mag());var s=25/(Math.PI*this._minDiameter)*360,p=ln(n,this._startVector);return Math.abs(p)<s},a}(si);function To(i){return Math.abs(i.y)>Math.abs(i.x)}var ml=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.reset=function(){i.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},a.prototype._start=function(n){this._lastPoints=n,To(n[0].sub(n[1]))&&(this._valid=!1)},a.prototype._move=function(n,s,p){var f=n[0].sub(this._lastPoints[0]),y=n[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(f,y,p.timeStamp),this._valid)return this._lastPoints=n,this._active=!0,{pitchDelta:(f.y+y.y)/2*-.5}},a.prototype.gestureBeginsVertically=function(n,s,p){if(this._valid!==void 0)return this._valid;var f=n.mag()>=2,y=s.mag()>=2;if(f||y){if(!f||!y)return this._firstMove===void 0&&(this._firstMove=p),p-this._firstMove<100&&void 0;var g=n.y>0==s.y>0;return To(n)&&To(s)&&g}},a}(si),yl={panStep:100,bearingStep:15,pitchStep:10},Ui=function(){var i=yl;this._panStep=i.panStep,this._bearingStep=i.bearingStep,this._pitchStep=i.pitchStep,this._rotationDisabled=!1};function di(i){return i*(2-i)}Ui.prototype.blur=function(){this.reset()},Ui.prototype.reset=function(){this._active=!1},Ui.prototype.keydown=function(i){var a=this;if(!(i.altKey||i.ctrlKey||i.metaKey)){var n=0,s=0,p=0,f=0,y=0;switch(i.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:i.shiftKey?s=-1:(i.preventDefault(),f=-1);break;case 39:i.shiftKey?s=1:(i.preventDefault(),f=1);break;case 38:i.shiftKey?p=1:(i.preventDefault(),y=-1);break;case 40:i.shiftKey?p=-1:(i.preventDefault(),y=1);break;default:return}return this._rotationDisabled&&(s=0,p=0),{cameraAnimation:function(g){var w=g.getZoom();g.easeTo({duration:300,easeId:"keyboardHandler",easing:di,zoom:n?Math.round(w)+n*(i.shiftKey?2:1):w,bearing:g.getBearing()+s*a._bearingStep,pitch:g.getPitch()+p*a._pitchStep,offset:[-f*a._panStep,-y*a._panStep],center:g.getCenter()},{originalEvent:i})}}}},Ui.prototype.enable=function(){this._enabled=!0},Ui.prototype.disable=function(){this._enabled=!1,this.reset()},Ui.prototype.isEnabled=function(){return this._enabled},Ui.prototype.isActive=function(){return this._active},Ui.prototype.disableRotation=function(){this._rotationDisabled=!0},Ui.prototype.enableRotation=function(){this._rotationDisabled=!1};var ht=function(i,a){this._map=i,this._el=i.getCanvasContainer(),this._handler=a,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,l.bindAll(["_onTimeout"],this)};ht.prototype.setZoomRate=function(i){this._defaultZoomRate=i},ht.prototype.setWheelZoomRate=function(i){this._wheelZoomRate=i},ht.prototype.isEnabled=function(){return!!this._enabled},ht.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},ht.prototype.isZooming=function(){return!!this._zooming},ht.prototype.enable=function(i){this.isEnabled()||(this._enabled=!0,this._aroundCenter=i&&i.around==="center")},ht.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},ht.prototype.wheel=function(i){if(this.isEnabled()){var a=i.deltaMode===l.window.WheelEvent.DOM_DELTA_LINE?40*i.deltaY:i.deltaY,n=l.browser.now(),s=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,a!==0&&a%4.000244140625==0?this._type="wheel":a!==0&&Math.abs(a)<4?this._type="trackpad":s>400?(this._type=null,this._lastValue=a,this._timeout=setTimeout(this._onTimeout,40,i)):this._type||(this._type=Math.abs(s*a)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,a+=this._lastValue)),i.shiftKey&&a&&(a/=4),this._type&&(this._lastWheelEvent=i,this._delta-=a,this._active||this._start(i)),i.preventDefault()}},ht.prototype._onTimeout=function(i){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(i)},ht.prototype._start=function(i){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var a=W.mousePos(this._el,i);this._around=l.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(a)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},ht.prototype.renderFrame=function(){var i=this;if(this._frameId&&(this._frameId=null,this.isActive())){var a=this._map.transform;if(this._delta!==0){var n=this._type==="wheel"&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,s=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&s!==0&&(s=1/s);var p=typeof this._targetZoom=="number"?a.zoomScale(this._targetZoom):a.scale;this._targetZoom=Math.min(a.maxZoom,Math.max(a.minZoom,a.scaleZoom(p*s))),this._type==="wheel"&&(this._startZoom=a.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var f,y=typeof this._targetZoom=="number"?this._targetZoom:a.zoom,g=this._startZoom,w=this._easing,A=!1;if(this._type==="wheel"&&g&&w){var z=Math.min((l.browser.now()-this._lastWheelEventTime)/200,1),D=w(z);f=l.number(g,y,D),z<1?this._frameId||(this._frameId=!0):A=!0}else f=y,A=!0;return this._active=!0,A&&(this._active=!1,this._finishTimeout=setTimeout(function(){i._zooming=!1,i._handler._triggerRenderFrame(),delete i._targetZoom,delete i._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!A,zoomDelta:f-a.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},ht.prototype._smoothOutEasing=function(i){var a=l.ease;if(this._prevEase){var n=this._prevEase,s=(l.browser.now()-n.start)/n.duration,p=n.easing(s+.01)-n.easing(s),f=.27/Math.sqrt(p*p+1e-4)*.01,y=Math.sqrt(.0729-f*f);a=l.bezier(f,y,.25,1)}return this._prevEase={start:l.browser.now(),duration:i,easing:a},a},ht.prototype.blur=function(){this.reset()},ht.prototype.reset=function(){this._active=!1};var Hi=function(i,a){this._clickZoom=i,this._tapZoom=a};Hi.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Hi.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Hi.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Hi.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var Ei=function(){this.reset()};Ei.prototype.reset=function(){this._active=!1},Ei.prototype.blur=function(){this.reset()},Ei.prototype.dblclick=function(i,a){return i.preventDefault(),{cameraAnimation:function(n){n.easeTo({duration:300,zoom:n.getZoom()+(i.shiftKey?-1:1),around:n.unproject(a)},{originalEvent:i})}}},Ei.prototype.enable=function(){this._enabled=!0},Ei.prototype.disable=function(){this._enabled=!1,this.reset()},Ei.prototype.isEnabled=function(){return this._enabled},Ei.prototype.isActive=function(){return this._active};var Dr=function(){this._tap=new Vi({numTouches:1,numTaps:1}),this.reset()};Dr.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},Dr.prototype.touchstart=function(i,a,n){this._swipePoint||(this._tapTime&&i.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?n.length>0&&(this._swipePoint=a[0],this._swipeTouch=n[0].identifier):this._tap.touchstart(i,a,n))},Dr.prototype.touchmove=function(i,a,n){if(this._tapTime){if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;var s=a[0],p=s.y-this._swipePoint.y;return this._swipePoint=s,i.preventDefault(),this._active=!0,{zoomDelta:p/128}}}else this._tap.touchmove(i,a,n)},Dr.prototype.touchend=function(i,a,n){this._tapTime?this._swipePoint&&n.length===0&&this.reset():this._tap.touchend(i,a,n)&&(this._tapTime=i.timeStamp)},Dr.prototype.touchcancel=function(){this.reset()},Dr.prototype.enable=function(){this._enabled=!0},Dr.prototype.disable=function(){this._enabled=!1,this.reset()},Dr.prototype.isEnabled=function(){return this._enabled},Dr.prototype.isActive=function(){return this._active};var la=function(i,a,n){this._el=i,this._mousePan=a,this._touchPan=n};la.prototype.enable=function(i){this._inertiaOptions=i||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},la.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},la.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},la.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var En=function(i,a,n){this._pitchWithRotate=i.pitchWithRotate,this._mouseRotate=a,this._mousePitch=n};En.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},En.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},En.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},En.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var Ni=function(i,a,n,s){this._el=i,this._touchZoom=a,this._touchRotate=n,this._tapDragZoom=s,this._rotationDisabled=!1,this._enabled=!0};Ni.prototype.enable=function(i){this._touchZoom.enable(i),this._rotationDisabled||this._touchRotate.enable(i),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},Ni.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},Ni.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},Ni.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},Ni.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},Ni.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var jr=function(i){return i.zoom||i.drag||i.pitch||i.rotate},Io=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a}(l.Event);function Ze(i){return i.panDelta&&i.panDelta.mag()||i.zoomDelta||i.bearingDelta||i.pitchDelta}var Ne=function(i,a){this._map=i,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new bo(i),this._bearingSnap=a.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(a),l.bindAll(["handleEvent","handleWindowEvent"],this);var n=this._el;this._listeners=[[n,"touchstart",{passive:!0}],[n,"touchmove",{passive:!1}],[n,"touchend",void 0],[n,"touchcancel",void 0],[n,"mousedown",void 0],[n,"mousemove",void 0],[n,"mouseup",void 0],[l.window.document,"mousemove",{capture:!0}],[l.window.document,"mouseup",void 0],[n,"mouseover",void 0],[n,"mouseout",void 0],[n,"dblclick",void 0],[n,"click",void 0],[n,"keydown",{capture:!1}],[n,"keyup",void 0],[n,"wheel",{passive:!1}],[n,"contextmenu",void 0],[l.window,"blur",void 0]];for(var s=0,p=this._listeners;s<p.length;s+=1){var f=p[s],y=f[0];W.addEventListener(y,f[1],y===l.window.document?this.handleWindowEvent:this.handleEvent,f[2])}};Ne.prototype.destroy=function(){for(var i=0,a=this._listeners;i<a.length;i+=1){var n=a[i],s=n[0];W.removeEventListener(s,n[1],s===l.window.document?this.handleWindowEvent:this.handleEvent,n[2])}},Ne.prototype._addDefaultHandlers=function(i){var a=this._map,n=a.getCanvasContainer();this._add("mapEvent",new hr(a,i));var s=a.boxZoom=new ai(a,i);this._add("boxZoom",s);var p=new oi,f=new Ei;a.doubleClickZoom=new Hi(f,p),this._add("tapZoom",p),this._add("clickZoom",f);var y=new Dr;this._add("tapDragZoom",y);var g=a.touchPitch=new ml;this._add("touchPitch",g);var w=new ss(i),A=new dl(i);a.dragRotate=new En(i,w,A),this._add("mouseRotate",w,["mousePitch"]),this._add("mousePitch",A,["mouseRotate"]);var z=new fl(i),D=new Ai(i);a.dragPan=new la(n,z,D),this._add("mousePan",z),this._add("touchPan",D,["touchZoom","touchRotate"]);var L=new zu,$=new li;a.touchZoomRotate=new Ni(n,$,L,y),this._add("touchRotate",L,["touchPan","touchZoom"]),this._add("touchZoom",$,["touchPan","touchRotate"]);var q=a.scrollZoom=new ht(a,this);this._add("scrollZoom",q,["mousePan"]);var K=a.keyboard=new Ui;this._add("keyboard",K),this._add("blockableMapEvent",new Ve(a));for(var V=0,X=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];V<X.length;V+=1){var ee=X[V];i.interactive&&i[ee]&&a[ee].enable(i[ee])}},Ne.prototype._add=function(i,a,n){this._handlers.push({handlerName:i,handler:a,allowed:n}),this._handlersById[i]=a},Ne.prototype.stop=function(i){if(!this._updatingCamera){for(var a=0,n=this._handlers;a<n.length;a+=1)n[a].handler.reset();this._inertia.clear(),this._fireEvents({},{},i),this._changes=[]}},Ne.prototype.isActive=function(){for(var i=0,a=this._handlers;i<a.length;i+=1)if(a[i].handler.isActive())return!0;return!1},Ne.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},Ne.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},Ne.prototype.isMoving=function(){return!!jr(this._eventsInProgress)||this.isZooming()},Ne.prototype._blockedByActive=function(i,a,n){for(var s in i)if(s!==n&&(!a||a.indexOf(s)<0))return!0;return!1},Ne.prototype.handleWindowEvent=function(i){this.handleEvent(i,i.type+"Window")},Ne.prototype._getMapTouches=function(i){for(var a=[],n=0,s=i;n<s.length;n+=1){var p=s[n];this._el.contains(p.target)&&a.push(p)}return a},Ne.prototype.handleEvent=function(i,a){this._updatingCamera=!0;for(var n=i.type==="renderFrame"?void 0:i,s={needsRenderFrame:!1},p={},f={},y=i.touches?this._getMapTouches(i.touches):void 0,g=y?W.touchPos(this._el,y):W.mousePos(this._el,i),w=0,A=this._handlers;w<A.length;w+=1){var z=A[w],D=z.handlerName,L=z.handler,$=z.allowed;if(L.isEnabled()){var q=void 0;this._blockedByActive(f,$,D)?L.reset():L[a||i.type]&&(q=L[a||i.type](i,g,y),this.mergeHandlerResult(s,p,q,D,n),q&&q.needsRenderFrame&&this._triggerRenderFrame()),(q||L.isActive())&&(f[D]=L)}}var K={};for(var V in this._previousActiveHandlers)f[V]||(K[V]=n);this._previousActiveHandlers=f,(Object.keys(K).length||Ze(s))&&(this._changes.push([s,p,K]),this._triggerRenderFrame()),(Object.keys(f).length||Ze(s))&&this._map._stop(!0),this._updatingCamera=!1;var X=s.cameraAnimation;X&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],X(this._map))},Ne.prototype.mergeHandlerResult=function(i,a,n,s,p){if(n){l.extend(i,n);var f={handlerName:s,originalEvent:n.originalEvent||p};n.zoomDelta!==void 0&&(a.zoom=f),n.panDelta!==void 0&&(a.drag=f),n.pitchDelta!==void 0&&(a.pitch=f),n.bearingDelta!==void 0&&(a.rotate=f)}},Ne.prototype._applyChanges=function(){for(var i={},a={},n={},s=0,p=this._changes;s<p.length;s+=1){var f=p[s],y=f[0],g=f[1],w=f[2];y.panDelta&&(i.panDelta=(i.panDelta||new l.Point(0,0))._add(y.panDelta)),y.zoomDelta&&(i.zoomDelta=(i.zoomDelta||0)+y.zoomDelta),y.bearingDelta&&(i.bearingDelta=(i.bearingDelta||0)+y.bearingDelta),y.pitchDelta&&(i.pitchDelta=(i.pitchDelta||0)+y.pitchDelta),y.around!==void 0&&(i.around=y.around),y.pinchAround!==void 0&&(i.pinchAround=y.pinchAround),y.noInertia&&(i.noInertia=y.noInertia),l.extend(a,g),l.extend(n,w)}this._updateMapTransform(i,a,n),this._changes=[]},Ne.prototype._updateMapTransform=function(i,a,n){var s=this._map,p=s.transform;if(!Ze(i))return this._fireEvents(a,n,!0);var f=i.panDelta,y=i.zoomDelta,g=i.bearingDelta,w=i.pitchDelta,A=i.around,z=i.pinchAround;z!==void 0&&(A=z),s._stop(!0),A=A||s.transform.centerPoint;var D=p.pointLocation(f?A.sub(f):A);g&&(p.bearing+=g),w&&(p.pitch+=w),y&&(p.zoom+=y),p.setLocationAtPoint(D,A),this._map._update(),i.noInertia||this._inertia.record(i),this._fireEvents(a,n,!0)},Ne.prototype._fireEvents=function(i,a,n){var s=this,p=jr(this._eventsInProgress),f=jr(i),y={};for(var g in i)this._eventsInProgress[g]||(y[g+"start"]=i[g].originalEvent),this._eventsInProgress[g]=i[g];for(var w in!p&&f&&this._fireEvent("movestart",f.originalEvent),y)this._fireEvent(w,y[w]);for(var A in f&&this._fireEvent("move",f.originalEvent),i)this._fireEvent(A,i[A].originalEvent);var z,D={};for(var L in this._eventsInProgress){var $=this._eventsInProgress[L],q=$.handlerName,K=$.originalEvent;this._handlersById[q].isActive()||(delete this._eventsInProgress[L],D[L+"end"]=z=a[q]||K)}for(var V in D)this._fireEvent(V,D[V]);var X=jr(this._eventsInProgress);if(n&&(p||f)&&!X){this._updatingCamera=!0;var ee=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),ie=function(pe){return pe!==0&&-s._bearingSnap<pe&&pe<s._bearingSnap};ee?(ie(ee.bearing||this._map.getBearing())&&(ee.bearing=0),this._map.easeTo(ee,{originalEvent:z})):(this._map.fire(new l.Event("moveend",{originalEvent:z})),ie(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},Ne.prototype._fireEvent=function(i,a){this._map.fire(new l.Event(i,a?{originalEvent:a}:{}))},Ne.prototype._requestFrame=function(){var i=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add(function(a){delete i._frameId,i.handleEvent(new Io("renderFrame",{timeStamp:a})),i._applyChanges()})},Ne.prototype._triggerRenderFrame=function(){this._frameId===void 0&&(this._frameId=this._requestFrame())};var cs=function(i){function a(n,s){i.call(this),this._moving=!1,this._zooming=!1,this.transform=n,this._bearingSnap=s.bearingSnap,l.bindAll(["_renderFrameCallback"],this)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getCenter=function(){return new l.LngLat(this.transform.center.lng,this.transform.center.lat)},a.prototype.setCenter=function(n,s){return this.jumpTo({center:n},s)},a.prototype.panBy=function(n,s,p){return n=l.Point.convert(n).mult(-1),this.panTo(this.transform.center,l.extend({offset:n},s),p)},a.prototype.panTo=function(n,s,p){return this.easeTo(l.extend({center:n},s),p)},a.prototype.getZoom=function(){return this.transform.zoom},a.prototype.setZoom=function(n,s){return this.jumpTo({zoom:n},s),this},a.prototype.zoomTo=function(n,s,p){return this.easeTo(l.extend({zoom:n},s),p)},a.prototype.zoomIn=function(n,s){return this.zoomTo(this.getZoom()+1,n,s),this},a.prototype.zoomOut=function(n,s){return this.zoomTo(this.getZoom()-1,n,s),this},a.prototype.getBearing=function(){return this.transform.bearing},a.prototype.setBearing=function(n,s){return this.jumpTo({bearing:n},s),this},a.prototype.getPadding=function(){return this.transform.padding},a.prototype.setPadding=function(n,s){return this.jumpTo({padding:n},s),this},a.prototype.rotateTo=function(n,s,p){return this.easeTo(l.extend({bearing:n},s),p)},a.prototype.resetNorth=function(n,s){return this.rotateTo(0,l.extend({duration:1e3},n),s),this},a.prototype.resetNorthPitch=function(n,s){return this.easeTo(l.extend({bearing:0,pitch:0,duration:1e3},n),s),this},a.prototype.snapToNorth=function(n,s){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(n,s):this},a.prototype.getPitch=function(){return this.transform.pitch},a.prototype.setPitch=function(n,s){return this.jumpTo({pitch:n},s),this},a.prototype.cameraForBounds=function(n,s){n=l.LngLatBounds.convert(n);var p=s&&s.bearing||0;return this._cameraForBoxAndBearing(n.getNorthWest(),n.getSouthEast(),p,s)},a.prototype._cameraForBoxAndBearing=function(n,s,p,f){var y={top:0,bottom:0,right:0,left:0};if(typeof(f=l.extend({padding:y,offset:[0,0],maxZoom:this.transform.maxZoom},f)).padding=="number"){var g=f.padding;f.padding={top:g,bottom:g,right:g,left:g}}f.padding=l.extend(y,f.padding);var w=this.transform,A=w.padding,z=w.project(l.LngLat.convert(n)),D=w.project(l.LngLat.convert(s)),L=z.rotate(-p*Math.PI/180),$=D.rotate(-p*Math.PI/180),q=new l.Point(Math.max(L.x,$.x),Math.max(L.y,$.y)),K=new l.Point(Math.min(L.x,$.x),Math.min(L.y,$.y)),V=q.sub(K),X=(w.width-(A.left+A.right+f.padding.left+f.padding.right))/V.x,ee=(w.height-(A.top+A.bottom+f.padding.top+f.padding.bottom))/V.y;if(!(ee<0||X<0)){var ie=Math.min(w.scaleZoom(w.scale*Math.min(X,ee)),f.maxZoom),pe=typeof f.offset.x=="number"?new l.Point(f.offset.x,f.offset.y):l.Point.convert(f.offset),ue=new l.Point((f.padding.left-f.padding.right)/2,(f.padding.top-f.padding.bottom)/2).rotate(p*Math.PI/180),he=pe.add(ue).mult(w.scale/w.zoomScale(ie));return{center:w.unproject(z.add(D).div(2).sub(he)),zoom:ie,bearing:p}}l.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},a.prototype.fitBounds=function(n,s,p){return this._fitInternal(this.cameraForBounds(n,s),s,p)},a.prototype.fitScreenCoordinates=function(n,s,p,f,y){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(l.Point.convert(n)),this.transform.pointLocation(l.Point.convert(s)),p,f),f,y)},a.prototype._fitInternal=function(n,s,p){return n?(delete(s=l.extend(n,s)).padding,s.linear?this.easeTo(s,p):this.flyTo(s,p)):this},a.prototype.jumpTo=function(n,s){this.stop();var p=this.transform,f=!1,y=!1,g=!1;return"zoom"in n&&p.zoom!==+n.zoom&&(f=!0,p.zoom=+n.zoom),n.center!==void 0&&(p.center=l.LngLat.convert(n.center)),"bearing"in n&&p.bearing!==+n.bearing&&(y=!0,p.bearing=+n.bearing),"pitch"in n&&p.pitch!==+n.pitch&&(g=!0,p.pitch=+n.pitch),n.padding==null||p.isPaddingEqual(n.padding)||(p.padding=n.padding),this.fire(new l.Event("movestart",s)).fire(new l.Event("move",s)),f&&this.fire(new l.Event("zoomstart",s)).fire(new l.Event("zoom",s)).fire(new l.Event("zoomend",s)),y&&this.fire(new l.Event("rotatestart",s)).fire(new l.Event("rotate",s)).fire(new l.Event("rotateend",s)),g&&this.fire(new l.Event("pitchstart",s)).fire(new l.Event("pitch",s)).fire(new l.Event("pitchend",s)),this.fire(new l.Event("moveend",s))},a.prototype.easeTo=function(n,s){var p=this;this._stop(!1,n.easeId),((n=l.extend({offset:[0,0],duration:500,easing:l.ease},n)).animate===!1||!n.essential&&l.browser.prefersReducedMotion)&&(n.duration=0);var f=this.transform,y=this.getZoom(),g=this.getBearing(),w=this.getPitch(),A=this.getPadding(),z="zoom"in n?+n.zoom:y,D="bearing"in n?this._normalizeBearing(n.bearing,g):g,L="pitch"in n?+n.pitch:w,$="padding"in n?n.padding:f.padding,q=l.Point.convert(n.offset),K=f.centerPoint.add(q),V=f.pointLocation(K),X=l.LngLat.convert(n.center||V);this._normalizeCenter(X);var ee,ie,pe=f.project(V),ue=f.project(X).sub(pe),he=f.zoomScale(z-y);n.around&&(ee=l.LngLat.convert(n.around),ie=f.locationPoint(ee));var _e={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||z!==y,this._rotating=this._rotating||g!==D,this._pitching=this._pitching||L!==w,this._padding=!f.isPaddingEqual($),this._easeId=n.easeId,this._prepareEase(s,n.noMoveStart,_e),this._ease(function(Ie){if(p._zooming&&(f.zoom=l.number(y,z,Ie)),p._rotating&&(f.bearing=l.number(g,D,Ie)),p._pitching&&(f.pitch=l.number(w,L,Ie)),p._padding&&(f.interpolatePadding(A,$,Ie),K=f.centerPoint.add(q)),ee)f.setLocationAtPoint(ee,ie);else{var Te=f.zoomScale(f.zoom-y),De=z>y?Math.min(2,he):Math.max(.5,he),Ge=Math.pow(De,1-Ie),Ke=f.unproject(pe.add(ue.mult(Ie*Ge)).mult(Te));f.setLocationAtPoint(f.renderWorldCopies?Ke.wrap():Ke,K)}p._fireMoveEvents(s)},function(Ie){p._afterEase(s,Ie)},n),this},a.prototype._prepareEase=function(n,s,p){p===void 0&&(p={}),this._moving=!0,s||p.moving||this.fire(new l.Event("movestart",n)),this._zooming&&!p.zooming&&this.fire(new l.Event("zoomstart",n)),this._rotating&&!p.rotating&&this.fire(new l.Event("rotatestart",n)),this._pitching&&!p.pitching&&this.fire(new l.Event("pitchstart",n))},a.prototype._fireMoveEvents=function(n){this.fire(new l.Event("move",n)),this._zooming&&this.fire(new l.Event("zoom",n)),this._rotating&&this.fire(new l.Event("rotate",n)),this._pitching&&this.fire(new l.Event("pitch",n))},a.prototype._afterEase=function(n,s){if(!this._easeId||!s||this._easeId!==s){delete this._easeId;var p=this._zooming,f=this._rotating,y=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,p&&this.fire(new l.Event("zoomend",n)),f&&this.fire(new l.Event("rotateend",n)),y&&this.fire(new l.Event("pitchend",n)),this.fire(new l.Event("moveend",n))}},a.prototype.flyTo=function(n,s){var p=this;if(!n.essential&&l.browser.prefersReducedMotion){var f=l.pick(n,["center","zoom","bearing","pitch","around"]);return this.jumpTo(f,s)}this.stop(),n=l.extend({offset:[0,0],speed:1.2,curve:1.42,easing:l.ease},n);var y=this.transform,g=this.getZoom(),w=this.getBearing(),A=this.getPitch(),z=this.getPadding(),D="zoom"in n?l.clamp(+n.zoom,y.minZoom,y.maxZoom):g,L="bearing"in n?this._normalizeBearing(n.bearing,w):w,$="pitch"in n?+n.pitch:A,q="padding"in n?n.padding:y.padding,K=y.zoomScale(D-g),V=l.Point.convert(n.offset),X=y.centerPoint.add(V),ee=y.pointLocation(X),ie=l.LngLat.convert(n.center||ee);this._normalizeCenter(ie);var pe=y.project(ee),ue=y.project(ie).sub(pe),he=n.curve,_e=Math.max(y.width,y.height),Ie=_e/K,Te=ue.mag();if("minZoom"in n){var De=l.clamp(Math.min(n.minZoom,g,D),y.minZoom,y.maxZoom),Ge=_e/y.zoomScale(De-g);he=Math.sqrt(Ge/Te*2)}var Ke=he*he;function Xe(et){var Je=(Ie*Ie-_e*_e+(et?-1:1)*Ke*Ke*Te*Te)/(2*(et?Ie:_e)*Ke*Te);return Math.log(Math.sqrt(Je*Je+1)-Je)}function bt(et){return(Math.exp(et)-Math.exp(-et))/2}function Fe(et){return(Math.exp(et)+Math.exp(-et))/2}var nt=Xe(0),st=function(et){return Fe(nt)/Fe(nt+he*et)},it=function(et){return _e*((Fe(nt)*(bt(Je=nt+he*et)/Fe(Je))-bt(nt))/Ke)/Te;var Je},rt=(Xe(1)-nt)/he;if(Math.abs(Te)<1e-6||!isFinite(rt)){if(Math.abs(_e-Ie)<1e-6)return this.easeTo(n,s);var ot=Ie<_e?-1:1;rt=Math.abs(Math.log(Ie/_e))/he,it=function(){return 0},st=function(et){return Math.exp(ot*he*et)}}return n.duration="duration"in n?+n.duration:1e3*rt/("screenSpeed"in n?+n.screenSpeed/he:+n.speed),n.maxDuration&&n.duration>n.maxDuration&&(n.duration=0),this._zooming=!0,this._rotating=w!==L,this._pitching=$!==A,this._padding=!y.isPaddingEqual(q),this._prepareEase(s,!1),this._ease(function(et){var Je=et*rt,_r=1/st(Je);y.zoom=et===1?D:g+y.scaleZoom(_r),p._rotating&&(y.bearing=l.number(w,L,et)),p._pitching&&(y.pitch=l.number(A,$,et)),p._padding&&(y.interpolatePadding(z,q,et),X=y.centerPoint.add(V));var Qt=et===1?ie:y.unproject(pe.add(ue.mult(it(Je))).mult(_r));y.setLocationAtPoint(y.renderWorldCopies?Qt.wrap():Qt,X),p._fireMoveEvents(s)},function(){return p._afterEase(s)},n),this},a.prototype.isEasing=function(){return!!this._easeFrameId},a.prototype.stop=function(){return this._stop()},a.prototype._stop=function(n,s){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var p=this._onEaseEnd;delete this._onEaseEnd,p.call(this,s)}if(!n){var f=this.handlers;f&&f.stop(!1)}return this},a.prototype._ease=function(n,s,p){p.animate===!1||p.duration===0?(n(1),s()):(this._easeStart=l.browser.now(),this._easeOptions=p,this._onEaseFrame=n,this._onEaseEnd=s,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},a.prototype._renderFrameCallback=function(){var n=Math.min((l.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(n)),n<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},a.prototype._normalizeBearing=function(n,s){n=l.wrap(n,-180,180);var p=Math.abs(n-s);return Math.abs(n-360-s)<p&&(n-=360),Math.abs(n+360-s)<p&&(n+=360),n},a.prototype._normalizeCenter=function(n){var s=this.transform;if(s.renderWorldCopies&&!s.lngRange){var p=n.lng-s.center.lng;n.lng+=p>180?-360:p<-180?360:0}},a}(l.Evented),$r=function(i){i===void 0&&(i={}),this.options=i,l.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};$r.prototype.getDefaultPosition=function(){return"bottom-right"},$r.prototype.onAdd=function(i){var a=this.options&&this.options.compact;return this._map=i,this._container=W.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=W.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=W.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),a&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),a===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},$r.prototype.onRemove=function(){W.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},$r.prototype._setElementTitle=function(i,a){var n=this._map._getUIString("AttributionControl."+a);i.title=n,i.setAttribute("aria-label",n)},$r.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},$r.prototype._updateEditLink=function(){var i=this._editLink;i||(i=this._editLink=this._container.querySelector(".mapbox-improve-map"));var a=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||l.config.ACCESS_TOKEN}];if(i){var n=a.reduce(function(s,p,f){return p.value&&(s+=p.key+"="+p.value+(f<a.length-1?"&":"")),s},"?");i.href=l.config.FEEDBACK_URL+"/"+n+(this._map._hash?this._map._hash.getHashString(!0):""),i.rel="noopener nofollow",this._setElementTitle(i,"MapFeedback")}},$r.prototype._updateData=function(i){!i||i.sourceDataType!=="metadata"&&i.sourceDataType!=="visibility"&&i.dataType!=="style"||(this._updateAttributions(),this._updateEditLink())},$r.prototype._updateAttributions=function(){if(this._map.style){var i=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?i=i.concat(this.options.customAttribution.map(function(g){return typeof g!="string"?"":g})):typeof this.options.customAttribution=="string"&&i.push(this.options.customAttribution)),this._map.style.stylesheet){var a=this._map.style.stylesheet;this.styleOwner=a.owner,this.styleId=a.id}var n=this._map.style.sourceCaches;for(var s in n){var p=n[s];if(p.used){var f=p.getSource();f.attribution&&i.indexOf(f.attribution)<0&&i.push(f.attribution)}}i.sort(function(g,w){return g.length-w.length});var y=(i=i.filter(function(g,w){for(var A=w+1;A<i.length;A++)if(i[A].indexOf(g)>=0)return!1;return!0})).join(" | ");y!==this._attribHTML&&(this._attribHTML=y,i.length?(this._innerContainer.innerHTML=y,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},$r.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var qi=function(){l.bindAll(["_updateLogo"],this),l.bindAll(["_updateCompact"],this)};qi.prototype.onAdd=function(i){this._map=i,this._container=W.create("div","mapboxgl-ctrl");var a=W.create("a","mapboxgl-ctrl-logo");return a.target="_blank",a.rel="noopener nofollow",a.href="https://www.mapbox.com/",a.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),a.setAttribute("rel","noopener nofollow"),this._container.appendChild(a),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},qi.prototype.onRemove=function(){W.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},qi.prototype.getDefaultPosition=function(){return"bottom-left"},qi.prototype._updateLogo=function(i){i&&i.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")},qi.prototype._logoRequired=function(){if(this._map.style){var i=this._map.style.sourceCaches;for(var a in i)if(i[a].getSource().mapbox_logo)return!0;return!1}},qi.prototype._updateCompact=function(){var i=this._container.children;if(i.length){var a=i[0];this._map.getCanvasContainer().offsetWidth<250?a.classList.add("mapboxgl-compact"):a.classList.remove("mapboxgl-compact")}};var Lr=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Lr.prototype.add=function(i){var a=++this._id;return this._queue.push({callback:i,id:a,cancelled:!1}),a},Lr.prototype.remove=function(i){for(var a=this._currentlyRunning,n=0,s=a?this._queue.concat(a):this._queue;n<s.length;n+=1){var p=s[n];if(p.id===i)return void(p.cancelled=!0)}},Lr.prototype.run=function(i){i===void 0&&(i=0);var a=this._currentlyRunning=this._queue;this._queue=[];for(var n=0,s=a;n<s.length;n+=1){var p=s[n];if(!p.cancelled&&(p.callback(i),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},Lr.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var Xi={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},vl=l.window.HTMLImageElement,ps=l.window.HTMLElement,kt=l.window.ImageBitmap,Er={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Bu=function(i){function a(s){var p=this;if((s=l.extend({},Er,s)).minZoom!=null&&s.maxZoom!=null&&s.minZoom>s.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(s.minPitch!=null&&s.maxPitch!=null&&s.minPitch>s.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(s.minPitch!=null&&s.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(s.maxPitch!=null&&s.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var f=new gt(s.minZoom,s.maxZoom,s.minPitch,s.maxPitch,s.renderWorldCopies);if(i.call(this,f,s),this._interactive=s.interactive,this._maxTileCacheSize=s.maxTileCacheSize,this._failIfMajorPerformanceCaveat=s.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=s.preserveDrawingBuffer,this._antialias=s.antialias,this._trackResize=s.trackResize,this._bearingSnap=s.bearingSnap,this._refreshExpiredTiles=s.refreshExpiredTiles,this._fadeDuration=s.fadeDuration,this._crossSourceCollisions=s.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=s.collectResourceTiming,this._renderTaskQueue=new Lr,this._controls=[],this._mapId=l.uniqueId(),this._locale=l.extend({},Xi,s.locale),this._clickTolerance=s.clickTolerance,this._requestManager=new l.RequestManager(s.transformRequest,s.accessToken),typeof s.container=="string"){if(this._container=l.window.document.getElementById(s.container),!this._container)throw new Error("Container '"+s.container+"' not found.")}else{if(!(s.container instanceof ps))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=s.container}if(s.maxBounds&&this.setMaxBounds(s.maxBounds),l.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return p._update(!1)}),this.on("moveend",function(){return p._update(!1)}),this.on("zoom",function(){return p._update(!0)}),l.window!==void 0&&(l.window.addEventListener("online",this._onWindowOnline,!1),l.window.addEventListener("resize",this._onWindowResize,!1),l.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Ne(this,s),this._hash=s.hash&&new fi(typeof s.hash=="string"&&s.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:s.center,zoom:s.zoom,bearing:s.bearing,pitch:s.pitch}),s.bounds&&(this.resize(),this.fitBounds(s.bounds,l.extend({},s.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=s.localIdeographFontFamily,s.style&&this.setStyle(s.style,{localIdeographFontFamily:s.localIdeographFontFamily}),s.attributionControl&&this.addControl(new $r({customAttribution:s.customAttribution})),this.addControl(new qi,s.logoPosition),this.on("style.load",function(){p.transform.unmodified&&p.jumpTo(p.style.stylesheet)}),this.on("data",function(y){p._update(y.dataType==="style"),p.fire(new l.Event(y.dataType+"data",y))}),this.on("dataloading",function(y){p.fire(new l.Event(y.dataType+"dataloading",y))})}i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a;var n={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return a.prototype._getMapId=function(){return this._mapId},a.prototype.addControl=function(s,p){if(p===void 0&&(p=s.getDefaultPosition?s.getDefaultPosition():"top-right"),!s||!s.onAdd)return this.fire(new l.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var f=s.onAdd(this);this._controls.push(s);var y=this._controlPositions[p];return p.indexOf("bottom")!==-1?y.insertBefore(f,y.firstChild):y.appendChild(f),this},a.prototype.removeControl=function(s){if(!s||!s.onRemove)return this.fire(new l.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var p=this._controls.indexOf(s);return p>-1&&this._controls.splice(p,1),s.onRemove(this),this},a.prototype.hasControl=function(s){return this._controls.indexOf(s)>-1},a.prototype.resize=function(s){var p=this._containerDimensions(),f=p[0],y=p[1];if(f===this.transform.width&&y===this.transform.height)return this;this._resizeCanvas(f,y),this.transform.resize(f,y),this.painter.resize(f,y);var g=!this._moving;return g&&this.fire(new l.Event("movestart",s)).fire(new l.Event("move",s)),this.fire(new l.Event("resize",s)),g&&this.fire(new l.Event("moveend",s)),this},a.prototype.getBounds=function(){return this.transform.getBounds()},a.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},a.prototype.setMaxBounds=function(s){return this.transform.setMaxBounds(l.LngLatBounds.convert(s)),this._update()},a.prototype.setMinZoom=function(s){if((s=s??-2)>=-2&&s<=this.transform.maxZoom)return this.transform.minZoom=s,this._update(),this.getZoom()<s&&this.setZoom(s),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},a.prototype.getMinZoom=function(){return this.transform.minZoom},a.prototype.setMaxZoom=function(s){if((s=s??22)>=this.transform.minZoom)return this.transform.maxZoom=s,this._update(),this.getZoom()>s&&this.setZoom(s),this;throw new Error("maxZoom must be greater than the current minZoom")},a.prototype.getMaxZoom=function(){return this.transform.maxZoom},a.prototype.setMinPitch=function(s){if((s=s??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(s>=0&&s<=this.transform.maxPitch)return this.transform.minPitch=s,this._update(),this.getPitch()<s&&this.setPitch(s),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},a.prototype.getMinPitch=function(){return this.transform.minPitch},a.prototype.setMaxPitch=function(s){if((s=s??60)>60)throw new Error("maxPitch must be less than or equal to 60");if(s>=this.transform.minPitch)return this.transform.maxPitch=s,this._update(),this.getPitch()>s&&this.setPitch(s),this;throw new Error("maxPitch must be greater than the current minPitch")},a.prototype.getMaxPitch=function(){return this.transform.maxPitch},a.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},a.prototype.setRenderWorldCopies=function(s){return this.transform.renderWorldCopies=s,this._update()},a.prototype.project=function(s){return this.transform.locationPoint(l.LngLat.convert(s))},a.prototype.unproject=function(s){return this.transform.pointLocation(l.Point.convert(s))},a.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},a.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},a.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},a.prototype._createDelegatedListener=function(s,p,f){var y,g=this;if(s==="mouseenter"||s==="mouseover"){var w=!1;return{layer:p,listener:f,delegates:{mousemove:function(z){var D=g.getLayer(p)?g.queryRenderedFeatures(z.point,{layers:[p]}):[];D.length?w||(w=!0,f.call(g,new dr(s,g,z.originalEvent,{features:D}))):w=!1},mouseout:function(){w=!1}}}}if(s==="mouseleave"||s==="mouseout"){var A=!1;return{layer:p,listener:f,delegates:{mousemove:function(z){(g.getLayer(p)?g.queryRenderedFeatures(z.point,{layers:[p]}):[]).length?A=!0:A&&(A=!1,f.call(g,new dr(s,g,z.originalEvent)))},mouseout:function(z){A&&(A=!1,f.call(g,new dr(s,g,z.originalEvent)))}}}}return{layer:p,listener:f,delegates:(y={},y[s]=function(z){var D=g.getLayer(p)?g.queryRenderedFeatures(z.point,{layers:[p]}):[];D.length&&(z.features=D,f.call(g,z),delete z.features)},y)}},a.prototype.on=function(s,p,f){if(f===void 0)return i.prototype.on.call(this,s,p);var y=this._createDelegatedListener(s,p,f);for(var g in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[s]=this._delegatedListeners[s]||[],this._delegatedListeners[s].push(y),y.delegates)this.on(g,y.delegates[g]);return this},a.prototype.once=function(s,p,f){if(f===void 0)return i.prototype.once.call(this,s,p);var y=this._createDelegatedListener(s,p,f);for(var g in y.delegates)this.once(g,y.delegates[g]);return this},a.prototype.off=function(s,p,f){var y=this;return f===void 0?i.prototype.off.call(this,s,p):(this._delegatedListeners&&this._delegatedListeners[s]&&function(g){for(var w=g[s],A=0;A<w.length;A++){var z=w[A];if(z.layer===p&&z.listener===f){for(var D in z.delegates)y.off(D,z.delegates[D]);return w.splice(A,1),y}}}(this._delegatedListeners),this)},a.prototype.queryRenderedFeatures=function(s,p){if(!this.style)return[];var f;if(p!==void 0||s===void 0||s instanceof l.Point||Array.isArray(s)||(p=s,s=void 0),p=p||{},(s=s||[[0,0],[this.transform.width,this.transform.height]])instanceof l.Point||typeof s[0]=="number")f=[l.Point.convert(s)];else{var y=l.Point.convert(s[0]),g=l.Point.convert(s[1]);f=[y,new l.Point(g.x,y.y),g,new l.Point(y.x,g.y),y]}return this.style.queryRenderedFeatures(f,p,this.transform)},a.prototype.querySourceFeatures=function(s,p){return this.style.querySourceFeatures(s,p)},a.prototype.setStyle=function(s,p){return(p=l.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},p)).diff!==!1&&p.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&s?(this._diffStyle(s,p),this):(this._localIdeographFontFamily=p.localIdeographFontFamily,this._updateStyle(s,p))},a.prototype._getUIString=function(s){var p=this._locale[s];if(p==null)throw new Error("Missing UI string '"+s+"'");return p},a.prototype._updateStyle=function(s,p){return this.style&&(this.style.setEventedParent(null),this.style._remove()),s?(this.style=new ni(this,p||{}),this.style.setEventedParent(this,{style:this.style}),typeof s=="string"?this.style.loadURL(s):this.style.loadJSON(s),this):(delete this.style,this)},a.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new ni(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},a.prototype._diffStyle=function(s,p){var f=this;if(typeof s=="string"){var y=this._requestManager.normalizeStyleURL(s),g=this._requestManager.transformRequest(y,l.ResourceType.Style);l.getJSON(g,function(w,A){w?f.fire(new l.ErrorEvent(w)):A&&f._updateDiff(A,p)})}else typeof s=="object"&&this._updateDiff(s,p)},a.prototype._updateDiff=function(s,p){try{this.style.setState(s)&&this._update(!0)}catch(f){l.warnOnce("Unable to perform style diff: "+(f.message||f.error||f)+". Rebuilding the style from scratch."),this._updateStyle(s,p)}},a.prototype.getStyle=function(){if(this.style)return this.style.serialize()},a.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():l.warnOnce("There is no style added to the map.")},a.prototype.addSource=function(s,p){return this._lazyInitEmptyStyle(),this.style.addSource(s,p),this._update(!0)},a.prototype.isSourceLoaded=function(s){var p=this.style&&this.style.sourceCaches[s];if(p!==void 0)return p.loaded();this.fire(new l.ErrorEvent(new Error("There is no source with ID '"+s+"'")))},a.prototype.areTilesLoaded=function(){var s=this.style&&this.style.sourceCaches;for(var p in s){var f=s[p]._tiles;for(var y in f){var g=f[y];if(g.state!=="loaded"&&g.state!=="errored")return!1}}return!0},a.prototype.addSourceType=function(s,p,f){return this._lazyInitEmptyStyle(),this.style.addSourceType(s,p,f)},a.prototype.removeSource=function(s){return this.style.removeSource(s),this._update(!0)},a.prototype.getSource=function(s){return this.style.getSource(s)},a.prototype.addImage=function(s,p,f){f===void 0&&(f={});var y=f.pixelRatio;y===void 0&&(y=1);var g=f.sdf;g===void 0&&(g=!1);var w=f.stretchX,A=f.stretchY,z=f.content;if(this._lazyInitEmptyStyle(),p instanceof vl||kt&&p instanceof kt){var D=l.browser.getImageData(p);this.style.addImage(s,{data:new l.RGBAImage({width:D.width,height:D.height},D.data),pixelRatio:y,stretchX:w,stretchY:A,content:z,sdf:g,version:0})}else{if(p.width===void 0||p.height===void 0)return this.fire(new l.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var L=p;this.style.addImage(s,{data:new l.RGBAImage({width:p.width,height:p.height},new Uint8Array(p.data)),pixelRatio:y,stretchX:w,stretchY:A,content:z,sdf:g,version:0,userImage:L}),L.onAdd&&L.onAdd(this,s)}},a.prototype.updateImage=function(s,p){var f=this.style.getImage(s);if(!f)return this.fire(new l.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var y=p instanceof vl||kt&&p instanceof kt?l.browser.getImageData(p):p,g=y.width,w=y.height,A=y.data;return g===void 0||w===void 0?this.fire(new l.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))):g!==f.data.width||w!==f.data.height?this.fire(new l.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(f.data.replace(A,!(p instanceof vl||kt&&p instanceof kt)),void this.style.updateImage(s,f))},a.prototype.hasImage=function(s){return s?!!this.style.getImage(s):(this.fire(new l.ErrorEvent(new Error("Missing required image id"))),!1)},a.prototype.removeImage=function(s){this.style.removeImage(s)},a.prototype.loadImage=function(s,p){l.getImage(this._requestManager.transformRequest(s,l.ResourceType.Image),p)},a.prototype.listImages=function(){return this.style.listImages()},a.prototype.addLayer=function(s,p){return this._lazyInitEmptyStyle(),this.style.addLayer(s,p),this._update(!0)},a.prototype.moveLayer=function(s,p){return this.style.moveLayer(s,p),this._update(!0)},a.prototype.removeLayer=function(s){return this.style.removeLayer(s),this._update(!0)},a.prototype.getLayer=function(s){return this.style.getLayer(s)},a.prototype.setLayerZoomRange=function(s,p,f){return this.style.setLayerZoomRange(s,p,f),this._update(!0)},a.prototype.setFilter=function(s,p,f){return f===void 0&&(f={}),this.style.setFilter(s,p,f),this._update(!0)},a.prototype.getFilter=function(s){return this.style.getFilter(s)},a.prototype.setPaintProperty=function(s,p,f,y){return y===void 0&&(y={}),this.style.setPaintProperty(s,p,f,y),this._update(!0)},a.prototype.getPaintProperty=function(s,p){return this.style.getPaintProperty(s,p)},a.prototype.setLayoutProperty=function(s,p,f,y){return y===void 0&&(y={}),this.style.setLayoutProperty(s,p,f,y),this._update(!0)},a.prototype.getLayoutProperty=function(s,p){return this.style.getLayoutProperty(s,p)},a.prototype.setLight=function(s,p){return p===void 0&&(p={}),this._lazyInitEmptyStyle(),this.style.setLight(s,p),this._update(!0)},a.prototype.getLight=function(){return this.style.getLight()},a.prototype.setFeatureState=function(s,p){return this.style.setFeatureState(s,p),this._update()},a.prototype.removeFeatureState=function(s,p){return this.style.removeFeatureState(s,p),this._update()},a.prototype.getFeatureState=function(s){return this.style.getFeatureState(s)},a.prototype.getContainer=function(){return this._container},a.prototype.getCanvasContainer=function(){return this._canvasContainer},a.prototype.getCanvas=function(){return this._canvas},a.prototype._containerDimensions=function(){var s=0,p=0;return this._container&&(s=this._container.clientWidth||400,p=this._container.clientHeight||300),[s,p]},a.prototype._detectMissingCSS=function(){l.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&l.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},a.prototype._setupContainer=function(){var s=this._container;s.classList.add("mapboxgl-map"),(this._missingCSSCanary=W.create("div","mapboxgl-canary",s)).style.visibility="hidden",this._detectMissingCSS();var p=this._canvasContainer=W.create("div","mapboxgl-canvas-container",s);this._interactive&&p.classList.add("mapboxgl-interactive"),this._canvas=W.create("canvas","mapboxgl-canvas",p),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");var f=this._containerDimensions();this._resizeCanvas(f[0],f[1]);var y=this._controlContainer=W.create("div","mapboxgl-control-container",s),g=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(w){g[w]=W.create("div","mapboxgl-ctrl-"+w,y)}),this._container.addEventListener("scroll",this._onMapScroll,!1)},a.prototype._resizeCanvas=function(s,p){var f=l.browser.devicePixelRatio||1;this._canvas.width=f*s,this._canvas.height=f*p,this._canvas.style.width=s+"px",this._canvas.style.height=p+"px"},a.prototype._setupPainter=function(){var s=l.extend({},oe.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),p=this._canvas.getContext("webgl",s)||this._canvas.getContext("experimental-webgl",s);p?(this.painter=new Zt(p,this.transform),l.webpSupported.testSupport(p)):this.fire(new l.ErrorEvent(new Error("Failed to initialize WebGL")))},a.prototype._contextLost=function(s){s.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new l.Event("webglcontextlost",{originalEvent:s}))},a.prototype._contextRestored=function(s){this._setupPainter(),this.resize(),this._update(),this.fire(new l.Event("webglcontextrestored",{originalEvent:s}))},a.prototype._onMapScroll=function(s){if(s.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},a.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},a.prototype._update=function(s){return this.style?(this._styleDirty=this._styleDirty||s,this._sourcesDirty=!0,this.triggerRepaint(),this):this},a.prototype._requestRenderFrame=function(s){return this._update(),this._renderTaskQueue.add(s)},a.prototype._cancelRenderFrame=function(s){this._renderTaskQueue.remove(s)},a.prototype._render=function(s){var p,f=this,y=0,g=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(p=g.createQueryEXT(),g.beginQueryEXT(g.TIME_ELAPSED_EXT,p),y=l.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(s),!this._removed){var w=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var A=this.transform.zoom,z=l.browser.now();this.style.zoomHistory.update(A,z);var D=new l.EvaluationParameters(A,{now:z,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),L=D.crossFadingFactor();L===1&&L===this._crossFadingFactor||(w=!0,this._crossFadingFactor=L),this.style.update(D)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new l.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new l.Event("load"))),this.style&&(this.style.hasTransitions()||w)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var $=l.browser.now()-y;g.endQueryEXT(g.TIME_ELAPSED_EXT,p),setTimeout(function(){var V=g.getQueryObjectEXT(p,g.QUERY_RESULT_EXT)/1e6;g.deleteQueryEXT(p),f.fire(new l.Event("gpu-timing-frame",{cpuTime:$,gpuTime:V}))},50)}if(this.listens("gpu-timing-layer")){var q=this.painter.collectGpuTimers();setTimeout(function(){var V=f.painter.queryGpuTimers(q);f.fire(new l.Event("gpu-timing-layer",{layerTimes:V}))},50)}var K=this._sourcesDirty||this._styleDirty||this._placementDirty;return K||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new l.Event("idle")),!this._loaded||this._fullyLoaded||K||(this._fullyLoaded=!0),this}},a.prototype.remove=function(){this._hash&&this._hash.remove();for(var s=0,p=this._controls;s<p.length;s+=1)p[s].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),l.window!==void 0&&(l.window.removeEventListener("resize",this._onWindowResize,!1),l.window.removeEventListener("orientationchange",this._onWindowResize,!1),l.window.removeEventListener("online",this._onWindowOnline,!1));var f=this.painter.context.gl.getExtension("WEBGL_lose_context");f&&f.loseContext(),ua(this._canvasContainer),ua(this._controlContainer),ua(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new l.Event("remove"))},a.prototype.triggerRepaint=function(){var s=this;this.style&&!this._frame&&(this._frame=l.browser.frame(function(p){s._frame=null,s._render(p)}))},a.prototype._onWindowOnline=function(){this._update()},a.prototype._onWindowResize=function(s){this._trackResize&&this.resize({originalEvent:s})._update()},n.showTileBoundaries.get=function(){return!!this._showTileBoundaries},n.showTileBoundaries.set=function(s){this._showTileBoundaries!==s&&(this._showTileBoundaries=s,this._update())},n.showPadding.get=function(){return!!this._showPadding},n.showPadding.set=function(s){this._showPadding!==s&&(this._showPadding=s,this._update())},n.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},n.showCollisionBoxes.set=function(s){this._showCollisionBoxes!==s&&(this._showCollisionBoxes=s,s?this.style._generateCollisionBoxes():this._update())},n.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},n.showOverdrawInspector.set=function(s){this._showOverdrawInspector!==s&&(this._showOverdrawInspector=s,this._update())},n.repaint.get=function(){return!!this._repaint},n.repaint.set=function(s){this._repaint!==s&&(this._repaint=s,this.triggerRepaint())},n.vertices.get=function(){return!!this._vertices},n.vertices.set=function(s){this._vertices=s,this._update()},a.prototype._setCacheLimits=function(s,p){l.setCacheLimits(s,p)},n.version.get=function(){return l.version},Object.defineProperties(a.prototype,n),a}(cs);function ua(i){i.parentNode&&i.parentNode.removeChild(i)}var gl={showCompass:!0,showZoom:!0,visualizePitch:!1},un=function(i){var a=this;this.options=l.extend({},gl,i),this._container=W.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",function(n){return n.preventDefault()}),this.options.showZoom&&(l.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",function(n){return a._map.zoomIn({},{originalEvent:n})}),W.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",function(n){return a._map.zoomOut({},{originalEvent:n})}),W.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(l.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",function(n){a.options.visualizePitch?a._map.resetNorthPitch({},{originalEvent:n}):a._map.resetNorth({},{originalEvent:n})}),this._compassIcon=W.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};un.prototype._updateZoomButtons=function(){var i=this._map.getZoom(),a=i===this._map.getMaxZoom(),n=i===this._map.getMinZoom();this._zoomInButton.disabled=a,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",a.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())},un.prototype._rotateCompassArrow=function(){var i=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=i},un.prototype.onAdd=function(i){return this._map=i,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new ui(this._map,this._compass,this.options.visualizePitch)),this._container},un.prototype.onRemove=function(){W.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map},un.prototype._createButton=function(i,a){var n=W.create("button",i,this._container);return n.type="button",n.addEventListener("click",a),n},un.prototype._setButtonTitle=function(i,a){var n=this._map._getUIString("NavigationControl."+a);i.title=n,i.setAttribute("aria-label",n)};var ui=function(i,a,n){n===void 0&&(n=!1),this._clickTolerance=10,this.element=a,this.mouseRotate=new ss({clickTolerance:i.dragRotate._mouseRotate._clickTolerance}),this.map=i,n&&(this.mousePitch=new dl({clickTolerance:i.dragRotate._mousePitch._clickTolerance})),l.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),W.addEventListener(a,"mousedown",this.mousedown),W.addEventListener(a,"touchstart",this.touchstart,{passive:!1}),W.addEventListener(a,"touchmove",this.touchmove),W.addEventListener(a,"touchend",this.touchend),W.addEventListener(a,"touchcancel",this.reset)};function Va(i,a,n){if(i=new l.LngLat(i.lng,i.lat),a){var s=new l.LngLat(i.lng-360,i.lat),p=new l.LngLat(i.lng+360,i.lat),f=n.locationPoint(i).distSqr(a);n.locationPoint(s).distSqr(a)<f?i=s:n.locationPoint(p).distSqr(a)<f&&(i=p)}for(;Math.abs(i.lng-n.center.lng)>180;){var y=n.locationPoint(i);if(y.x>=0&&y.y>=0&&y.x<=n.width&&y.y<=n.height)break;i.lng>n.center.lng?i.lng-=360:i.lng+=360}return i}ui.prototype.down=function(i,a){this.mouseRotate.mousedown(i,a),this.mousePitch&&this.mousePitch.mousedown(i,a),W.disableDrag()},ui.prototype.move=function(i,a){var n=this.map,s=this.mouseRotate.mousemoveWindow(i,a);if(s&&s.bearingDelta&&n.setBearing(n.getBearing()+s.bearingDelta),this.mousePitch){var p=this.mousePitch.mousemoveWindow(i,a);p&&p.pitchDelta&&n.setPitch(n.getPitch()+p.pitchDelta)}},ui.prototype.off=function(){var i=this.element;W.removeEventListener(i,"mousedown",this.mousedown),W.removeEventListener(i,"touchstart",this.touchstart,{passive:!1}),W.removeEventListener(i,"touchmove",this.touchmove),W.removeEventListener(i,"touchend",this.touchend),W.removeEventListener(i,"touchcancel",this.reset),this.offTemp()},ui.prototype.offTemp=function(){W.enableDrag(),W.removeEventListener(l.window,"mousemove",this.mousemove),W.removeEventListener(l.window,"mouseup",this.mouseup)},ui.prototype.mousedown=function(i){this.down(l.extend({},i,{ctrlKey:!0,preventDefault:function(){return i.preventDefault()}}),W.mousePos(this.element,i)),W.addEventListener(l.window,"mousemove",this.mousemove),W.addEventListener(l.window,"mouseup",this.mouseup)},ui.prototype.mousemove=function(i){this.move(i,W.mousePos(this.element,i))},ui.prototype.mouseup=function(i){this.mouseRotate.mouseupWindow(i),this.mousePitch&&this.mousePitch.mouseupWindow(i),this.offTemp()},ui.prototype.touchstart=function(i){i.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=W.touchPos(this.element,i.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return i.preventDefault()}},this._startPos))},ui.prototype.touchmove=function(i){i.targetTouches.length!==1?this.reset():(this._lastPos=W.touchPos(this.element,i.targetTouches)[0],this.move({preventDefault:function(){return i.preventDefault()}},this._lastPos))},ui.prototype.touchend=function(i){i.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},ui.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var Ki={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function hs(i,a,n){var s=i.classList;for(var p in Ki)s.remove("mapboxgl-"+n+"-anchor-"+p);s.add("mapboxgl-"+n+"-anchor-"+a)}var Ua,Ao=function(i){function a(n,s){if(i.call(this),(n instanceof l.window.HTMLElement||s)&&(n=l.extend({element:n},s)),l.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=n&&n.anchor||"center",this._color=n&&n.color||"#3FB1CE",this._scale=n&&n.scale||1,this._draggable=n&&n.draggable||!1,this._clickTolerance=n&&n.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=n&&n.rotation||0,this._rotationAlignment=n&&n.rotationAlignment||"auto",this._pitchAlignment=n&&n.pitchAlignment&&n.pitchAlignment!=="auto"?n.pitchAlignment:this._rotationAlignment,n&&n.element)this._element=n.element,this._offset=l.Point.convert(n&&n.offset||[0,0]);else{this._defaultMarker=!0,this._element=W.create("div"),this._element.setAttribute("aria-label","Map marker");var p=W.createNS("http://www.w3.org/2000/svg","svg");p.setAttributeNS(null,"display","block"),p.setAttributeNS(null,"height","41px"),p.setAttributeNS(null,"width","27px"),p.setAttributeNS(null,"viewBox","0 0 27 41");var f=W.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"stroke","none"),f.setAttributeNS(null,"stroke-width","1"),f.setAttributeNS(null,"fill","none"),f.setAttributeNS(null,"fill-rule","evenodd");var y=W.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"fill-rule","nonzero");var g=W.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"transform","translate(3.0, 29.0)"),g.setAttributeNS(null,"fill","#000000");for(var w=0,A=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];w<A.length;w+=1){var z=A[w],D=W.createNS("http://www.w3.org/2000/svg","ellipse");D.setAttributeNS(null,"opacity","0.04"),D.setAttributeNS(null,"cx","10.5"),D.setAttributeNS(null,"cy","5.80029008"),D.setAttributeNS(null,"rx",z.rx),D.setAttributeNS(null,"ry",z.ry),g.appendChild(D)}var L=W.createNS("http://www.w3.org/2000/svg","g");L.setAttributeNS(null,"fill",this._color);var $=W.createNS("http://www.w3.org/2000/svg","path");$.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),L.appendChild($);var q=W.createNS("http://www.w3.org/2000/svg","g");q.setAttributeNS(null,"opacity","0.25"),q.setAttributeNS(null,"fill","#000000");var K=W.createNS("http://www.w3.org/2000/svg","path");K.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),q.appendChild(K);var V=W.createNS("http://www.w3.org/2000/svg","g");V.setAttributeNS(null,"transform","translate(6.0, 7.0)"),V.setAttributeNS(null,"fill","#FFFFFF");var X=W.createNS("http://www.w3.org/2000/svg","g");X.setAttributeNS(null,"transform","translate(8.0, 8.0)");var ee=W.createNS("http://www.w3.org/2000/svg","circle");ee.setAttributeNS(null,"fill","#000000"),ee.setAttributeNS(null,"opacity","0.25"),ee.setAttributeNS(null,"cx","5.5"),ee.setAttributeNS(null,"cy","5.5"),ee.setAttributeNS(null,"r","5.4999962");var ie=W.createNS("http://www.w3.org/2000/svg","circle");ie.setAttributeNS(null,"fill","#FFFFFF"),ie.setAttributeNS(null,"cx","5.5"),ie.setAttributeNS(null,"cy","5.5"),ie.setAttributeNS(null,"r","5.4999962"),X.appendChild(ee),X.appendChild(ie),y.appendChild(g),y.appendChild(L),y.appendChild(q),y.appendChild(V),y.appendChild(X),p.appendChild(y),p.setAttributeNS(null,"height",41*this._scale+"px"),p.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(p),this._offset=l.Point.convert(n&&n.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",function(pe){pe.preventDefault()}),this._element.addEventListener("mousedown",function(pe){pe.preventDefault()}),hs(this._element,this._anchor,"marker"),this._popup=null}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.addTo=function(n){return this.remove(),this._map=n,n.getCanvasContainer().appendChild(this._element),n.on("move",this._update),n.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},a.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),W.remove(this._element),this._popup&&this._popup.remove(),this},a.prototype.getLngLat=function(){return this._lngLat},a.prototype.setLngLat=function(n){return this._lngLat=l.LngLat.convert(n),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},a.prototype.getElement=function(){return this._element},a.prototype.setPopup=function(n){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),n){if(!("offset"in n.options)){var s=Math.sqrt(Math.pow(13.5,2)/2);n.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[s,-1*(24.6+s)],"bottom-right":[-s,-1*(24.6+s)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=n,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},a.prototype._onKeyPress=function(n){var s=n.code,p=n.charCode||n.keyCode;s!=="Space"&&s!=="Enter"&&p!==32&&p!==13||this.togglePopup()},a.prototype._onMapClick=function(n){var s=n.originalEvent.target,p=this._element;this._popup&&(s===p||p.contains(s))&&this.togglePopup()},a.prototype.getPopup=function(){return this._popup},a.prototype.togglePopup=function(){var n=this._popup;return n?(n.isOpen()?n.remove():n.addTo(this._map),this):this},a.prototype._update=function(n){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=Va(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var s="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?s="rotateZ("+this._rotation+"deg)":this._rotationAlignment==="map"&&(s="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var p="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?p="rotateX(0deg)":this._pitchAlignment==="map"&&(p="rotateX("+this._map.getPitch()+"deg)"),n&&n.type!=="moveend"||(this._pos=this._pos.round()),W.setTransform(this._element,Ki[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+p+" "+s)}},a.prototype.getOffset=function(){return this._offset},a.prototype.setOffset=function(n){return this._offset=l.Point.convert(n),this._update(),this},a.prototype._onMove=function(n){if(!this._isDragging){var s=this._clickTolerance||this._map._clickTolerance;this._isDragging=n.point.dist(this._pointerdownPos)>=s}this._isDragging&&(this._pos=n.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new l.Event("dragstart"))),this.fire(new l.Event("drag")))},a.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new l.Event("dragend")),this._state="inactive"},a.prototype._addDragHandler=function(n){this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(this._pos).add(this._offset),this._pointerdownPos=n.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},a.prototype.setDraggable=function(n){return this._draggable=!!n,this._map&&(n?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},a.prototype.isDraggable=function(){return this._draggable},a.prototype.setRotation=function(n){return this._rotation=n||0,this._update(),this},a.prototype.getRotation=function(){return this._rotation},a.prototype.setRotationAlignment=function(n){return this._rotationAlignment=n||"auto",this._update(),this},a.prototype.getRotationAlignment=function(){return this._rotationAlignment},a.prototype.setPitchAlignment=function(n){return this._pitchAlignment=n&&n!=="auto"?n:this._rotationAlignment,this._update(),this},a.prototype.getPitchAlignment=function(){return this._pitchAlignment},a}(l.Evented),_l={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Na=0,ca=!1,xl=function(i){function a(n){i.call(this),this.options=l.extend({},_l,n),l.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.onAdd=function(n){var s;return this._map=n,this._container=W.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),s=this._setupUI,Ua!==void 0?s(Ua):l.window.navigator.permissions!==void 0?l.window.navigator.permissions.query({name:"geolocation"}).then(function(p){s(Ua=p.state!=="denied")}):s(Ua=!!l.window.navigator.geolocation),this._container},a.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(l.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),W.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Na=0,ca=!1},a.prototype._isOutOfMapMaxBounds=function(n){var s=this._map.getMaxBounds(),p=n.coords;return s&&(p.longitude<s.getWest()||p.longitude>s.getEast()||p.latitude<s.getSouth()||p.latitude>s.getNorth())},a.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},a.prototype._onSuccess=function(n){if(this._map){if(this._isOutOfMapMaxBounds(n))return this._setErrorState(),this.fire(new l.Event("outofmaxbounds",n)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=n,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(n),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(n),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new l.Event("geolocate",n)),this._finish()}},a.prototype._updateCamera=function(n){var s=new l.LngLat(n.coords.longitude,n.coords.latitude),p=n.coords.accuracy,f=this._map.getBearing(),y=l.extend({bearing:f},this.options.fitBoundsOptions);this._map.fitBounds(s.toBounds(p),y,{geolocateSource:!0})},a.prototype._updateMarker=function(n){if(n){var s=new l.LngLat(n.coords.longitude,n.coords.latitude);this._accuracyCircleMarker.setLngLat(s).addTo(this._map),this._userLocationDotMarker.setLngLat(s).addTo(this._map),this._accuracy=n.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},a.prototype._updateCircleRadius=function(){var n=this._map._container.clientHeight/2,s=this._map.unproject([0,n]),p=this._map.unproject([1,n]),f=s.distanceTo(p),y=Math.ceil(2*this._accuracy/f);this._circleElement.style.width=y+"px",this._circleElement.style.height=y+"px"},a.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},a.prototype._onError=function(n){if(this._map){if(this.options.trackUserLocation)if(n.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(n.code===3&&ca)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new l.Event("error",n)),this._finish()}},a.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},a.prototype._setupUI=function(n){var s=this;if(this._container.addEventListener("contextmenu",function(y){return y.preventDefault()}),this._geolocateButton=W.create("button","mapboxgl-ctrl-geolocate",this._container),W.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",n===!1){l.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var p=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=p,this._geolocateButton.setAttribute("aria-label",p)}else{var f=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=f,this._geolocateButton.setAttribute("aria-label",f)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=W.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Ao(this._dotElement),this._circleElement=W.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ao({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",function(y){y.geolocateSource||s._watchState!=="ACTIVE_LOCK"||y.originalEvent&&y.originalEvent.type==="resize"||(s._watchState="BACKGROUND",s._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),s._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),s.fire(new l.Event("trackuserlocationend")))})},a.prototype.trigger=function(){if(!this._setup)return l.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new l.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Na--,ca=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new l.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new l.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){var n;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Na>1?(n={maximumAge:6e5,timeout:0},ca=!0):(n=this.options.positionOptions,ca=!1),this._geolocationWatchID=l.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,n)}}else l.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},a.prototype._clearWatch=function(){l.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},a}(l.Evented),Cn={maxWidth:100,unit:"metric"},Pn=function(i){this.options=l.extend({},Cn,i),l.bindAll(["_onMove","setUnit"],this)};function fs(i,a,n){var s=n&&n.maxWidth||100,p=i._container.clientHeight/2,f=i.unproject([0,p]),y=i.unproject([s,p]),g=f.distanceTo(y);if(n&&n.unit==="imperial"){var w=3.2808*g;w>5280?kn(a,s,w/5280,i._getUIString("ScaleControl.Miles")):kn(a,s,w,i._getUIString("ScaleControl.Feet"))}else n&&n.unit==="nautical"?kn(a,s,g/1852,i._getUIString("ScaleControl.NauticalMiles")):g>=1e3?kn(a,s,g/1e3,i._getUIString("ScaleControl.Kilometers")):kn(a,s,g,i._getUIString("ScaleControl.Meters"))}function kn(i,a,n,s){var p,f,y,g=(p=n,(f=Math.pow(10,(""+Math.floor(p)).length-1))*(y=(y=p/f)>=10?10:y>=5?5:y>=3?3:y>=2?2:y>=1?1:function(w){var A=Math.pow(10,Math.ceil(-Math.log(w)/Math.LN10));return Math.round(w*A)/A}(y)));i.style.width=a*(g/n)+"px",i.innerHTML=g+" "+s}Pn.prototype.getDefaultPosition=function(){return"bottom-left"},Pn.prototype._onMove=function(){fs(this._map,this._container,this.options)},Pn.prototype.onAdd=function(i){return this._map=i,this._container=W.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",i.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Pn.prototype.onRemove=function(){W.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Pn.prototype.setUnit=function(i){this.options.unit=i,fs(this._map,this._container,this.options)};var Ci=function(i){this._fullscreen=!1,i&&i.container&&(i.container instanceof l.window.HTMLElement?this._container=i.container:l.warnOnce("Full screen control 'container' must be a DOM element.")),l.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in l.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in l.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in l.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in l.window.document&&(this._fullscreenchange="MSFullscreenChange")};Ci.prototype.onAdd=function(i){return this._map=i,this._container||(this._container=this._map.getContainer()),this._controlContainer=W.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",l.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Ci.prototype.onRemove=function(){W.remove(this._controlContainer),this._map=null,l.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Ci.prototype._checkFullscreenSupport=function(){return!!(l.window.document.fullscreenEnabled||l.window.document.mozFullScreenEnabled||l.window.document.msFullscreenEnabled||l.window.document.webkitFullscreenEnabled)},Ci.prototype._setupUI=function(){var i=this._fullscreenButton=W.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);W.create("span","mapboxgl-ctrl-icon",i).setAttribute("aria-hidden",!0),i.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),l.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Ci.prototype._updateTitle=function(){var i=this._getTitle();this._fullscreenButton.setAttribute("aria-label",i),this._fullscreenButton.title=i},Ci.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Ci.prototype._isFullscreen=function(){return this._fullscreen},Ci.prototype._changeIcon=function(){(l.window.document.fullscreenElement||l.window.document.mozFullScreenElement||l.window.document.webkitFullscreenElement||l.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Ci.prototype._onClickFullscreen=function(){this._isFullscreen()?l.window.document.exitFullscreen?l.window.document.exitFullscreen():l.window.document.mozCancelFullScreen?l.window.document.mozCancelFullScreen():l.window.document.msExitFullscreen?l.window.document.msExitFullscreen():l.window.document.webkitCancelFullScreen&&l.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var bl={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Eo=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),wl=function(i){function a(n){i.call(this),this.options=l.extend(Object.create(bl),n),l.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.addTo=function(n){return this._map&&this.remove(),this._map=n,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new l.Event("open")),this},a.prototype.isOpen=function(){return!!this._map},a.prototype.remove=function(){return this._content&&W.remove(this._content),this._container&&(W.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new l.Event("close")),this},a.prototype.getLngLat=function(){return this._lngLat},a.prototype.setLngLat=function(n){return this._lngLat=l.LngLat.convert(n),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},a.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},a.prototype.getElement=function(){return this._container},a.prototype.setText=function(n){return this.setDOMContent(l.window.document.createTextNode(n))},a.prototype.setHTML=function(n){var s,p=l.window.document.createDocumentFragment(),f=l.window.document.createElement("body");for(f.innerHTML=n;s=f.firstChild;)p.appendChild(s);return this.setDOMContent(p)},a.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},a.prototype.setMaxWidth=function(n){return this.options.maxWidth=n,this._update(),this},a.prototype.setDOMContent=function(n){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=W.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(n),this._createCloseButton(),this._update(),this._focusFirstElement(),this},a.prototype.addClassName=function(n){this._container&&this._container.classList.add(n)},a.prototype.removeClassName=function(n){this._container&&this._container.classList.remove(n)},a.prototype.setOffset=function(n){return this.options.offset=n,this._update(),this},a.prototype.toggleClassName=function(n){if(this._container)return this._container.classList.toggle(n)},a.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=W.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},a.prototype._onMouseUp=function(n){this._update(n.point)},a.prototype._onMouseMove=function(n){this._update(n.point)},a.prototype._onDrag=function(n){this._update(n.point)},a.prototype._update=function(n){var s=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=W.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=W.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(D){return s._container.classList.add(D)}),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Va(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||n)){var p=this._pos=this._trackPointer&&n?n:this._map.project(this._lngLat),f=this.options.anchor,y=function D(L){if(L){if(typeof L=="number"){var $=Math.round(Math.sqrt(.5*Math.pow(L,2)));return{center:new l.Point(0,0),top:new l.Point(0,L),"top-left":new l.Point($,$),"top-right":new l.Point(-$,$),bottom:new l.Point(0,-L),"bottom-left":new l.Point($,-$),"bottom-right":new l.Point(-$,-$),left:new l.Point(L,0),right:new l.Point(-L,0)}}if(L instanceof l.Point||Array.isArray(L)){var q=l.Point.convert(L);return{center:q,top:q,"top-left":q,"top-right":q,bottom:q,"bottom-left":q,"bottom-right":q,left:q,right:q}}return{center:l.Point.convert(L.center||[0,0]),top:l.Point.convert(L.top||[0,0]),"top-left":l.Point.convert(L["top-left"]||[0,0]),"top-right":l.Point.convert(L["top-right"]||[0,0]),bottom:l.Point.convert(L.bottom||[0,0]),"bottom-left":l.Point.convert(L["bottom-left"]||[0,0]),"bottom-right":l.Point.convert(L["bottom-right"]||[0,0]),left:l.Point.convert(L.left||[0,0]),right:l.Point.convert(L.right||[0,0])}}return D(new l.Point(0,0))}(this.options.offset);if(!f){var g,w=this._container.offsetWidth,A=this._container.offsetHeight;g=p.y+y.bottom.y<A?["top"]:p.y>this._map.transform.height-A?["bottom"]:[],p.x<w/2?g.push("left"):p.x>this._map.transform.width-w/2&&g.push("right"),f=g.length===0?"bottom":g.join("-")}var z=p.add(y[f]).round();W.setTransform(this._container,Ki[f]+" translate("+z.x+"px,"+z.y+"px)"),hs(this._container,f,"popup")}},a.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var n=this._container.querySelector(Eo);n&&n.focus()}},a.prototype._onClose=function(){this.remove()},a}(l.Evented),ds={version:l.version,supported:oe,setRTLTextPlugin:l.setRTLTextPlugin,getRTLTextPluginStatus:l.getRTLTextPluginStatus,Map:Bu,NavigationControl:un,GeolocateControl:xl,AttributionControl:$r,ScaleControl:Pn,FullscreenControl:Ci,Popup:wl,Marker:Ao,Style:ni,LngLat:l.LngLat,LngLatBounds:l.LngLatBounds,Point:l.Point,MercatorCoordinate:l.MercatorCoordinate,Evented:l.Evented,config:l.config,prewarm:function(){de().acquire(fe)},clearPrewarmedResources:function(){var i=Ue;i&&(i.isPreloaded()&&i.numActive()===1?(i.release(fe),Ue=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return l.config.ACCESS_TOKEN},set accessToken(i){l.config.ACCESS_TOKEN=i},get baseApiUrl(){return l.config.API_URL},set baseApiUrl(i){l.config.API_URL=i},get workerCount(){return be.workerCount},set workerCount(i){be.workerCount=i},get maxParallelImageRequests(){return l.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(i){l.config.MAX_PARALLEL_IMAGE_REQUESTS=i},clearStorage:function(i){l.clearTileCache(i)},workerUrl:""};return ds}),O})})(ov);var tx=ov.exports;const Un=Y.getDefaultExportFromCjs(tx);var Lc={exports:{}},rx=nx,ix={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"};function nx(m){if(!m||!m.type)return null;var d=ix[m.type];if(!d)return null;if(d==="geometry")return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:m}]};if(d==="feature")return{type:"FeatureCollection",features:[m]};if(d==="featurecollection")return m}function Tc(m){switch(m&&m.type||null){case"FeatureCollection":return m.features=m.features.reduce(function(d,b){return d.concat(Tc(b))},[]),m;case"Feature":return m.geometry?Tc(m.geometry).map(function(d){var b={type:"Feature",properties:JSON.parse(JSON.stringify(m.properties)),geometry:d};return m.id!==void 0&&(b.id=m.id),b}):[m];case"MultiPoint":return m.coordinates.map(function(d){return{type:"Point",coordinates:d}});case"MultiPolygon":return m.coordinates.map(function(d){return{type:"Polygon",coordinates:d}});case"MultiLineString":return m.coordinates.map(function(d){return{type:"LineString",coordinates:d}});case"GeometryCollection":return m.geometries.map(Tc).reduce(function(d,b){return d.concat(b)},[]);case"Point":case"Polygon":case"LineString":return[m]}}const ax=Object.freeze(Object.defineProperty({__proto__:null,default:Tc},Symbol.toStringTag,{value:"Module"})),ox=Y.getAugmentedNamespace(ax);var sx=function(d){return b(d);function b(M){return Array.isArray(M)&&M.length&&typeof M[0]=="number"?[M]:M.reduce(function(O,G){return Array.isArray(G)&&Array.isArray(G[0])?O.concat(b(G)):(O.push(G),O)},[])}},lx=rx,Ic=ox,ux=sx;Ic instanceof Function||(Ic=Ic.default);var cx=function(m){if(!m)return[];var d=Ic(lx(m)),b=[];return d.features.forEach(function(M){M.geometry&&(b=b.concat(ux(M.geometry.coordinates)))}),b},Xd=Object.prototype.toString,sv=function(d){var b=Xd.call(d),M=b==="[object Arguments]";return M||(M=b!=="[object Array]"&&d!==null&&typeof d=="object"&&typeof d.length=="number"&&d.length>=0&&Xd.call(d.callee)==="[object Function]"),M},Lp,Kd;function px(){if(Kd)return Lp;Kd=1;var m;if(!Object.keys){var d=Object.prototype.hasOwnProperty,b=Object.prototype.toString,M=sv,O=Object.prototype.propertyIsEnumerable,G=!O.call({toString:null},"toString"),l=O.call(function(){},"prototype"),oe=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],W=function(le){var ge=le.constructor;return ge&&ge.prototype===le},ve={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},me=function(){if(typeof window>"u")return!1;for(var le in window)try{if(!ve["$"+le]&&d.call(window,le)&&window[le]!==null&&typeof window[le]=="object")try{W(window[le])}catch{return!0}}catch{return!0}return!1}(),Le=function(le){if(typeof window>"u"||!me)return W(le);try{return W(le)}catch{return!1}};m=function(ge){var Re=ge!==null&&typeof ge=="object",Ye=b.call(ge)==="[object Function]",je=M(ge),It=Re&&b.call(ge)==="[object String]",tt=[];if(!Re&&!Ye&&!je)throw new TypeError("Object.keys called on a non-object");var dt=l&&Ye;if(It&&ge.length>0&&!d.call(ge,0))for(var Dt=0;Dt<ge.length;++Dt)tt.push(String(Dt));if(je&&ge.length>0)for(var Xt=0;Xt<ge.length;++Xt)tt.push(String(Xt));else for(var Kt in ge)!(dt&&Kt==="prototype")&&d.call(ge,Kt)&&tt.push(String(Kt));if(G)for(var ur=Le(ge),Sr=0;Sr<oe.length;++Sr)!(ur&&oe[Sr]==="constructor")&&d.call(ge,oe[Sr])&&tt.push(oe[Sr]);return tt}}return Lp=m,Lp}var hx=Array.prototype.slice,fx=sv,Jd=Object.keys,Ac=Jd?function(d){return Jd(d)}:px(),Yd=Object.keys;Ac.shim=function(){if(Object.keys){var d=function(){var b=Object.keys(arguments);return b&&b.length===arguments.length}(1,2);d||(Object.keys=function(M){return fx(M)?Yd(hx.call(M)):Yd(M)})}else Object.keys=Ac;return Object.keys||Ac};var dx=Ac,mx=dx,yx=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",vx=Object.prototype.toString,gx=Array.prototype.concat,Qd=Y.defineDataProperty,_x=function(m){return typeof m=="function"&&vx.call(m)==="[object Function]"},lv=Y.hasPropertyDescriptors_1(),xx=function(m,d,b,M){if(d in m){if(M===!0){if(m[d]===b)return}else if(!_x(M)||!M())return}lv?Qd(m,d,b,!0):Qd(m,d,b)},uv=function(m,d){var b=arguments.length>2?arguments[2]:{},M=mx(d);yx&&(M=gx.call(M,Object.getOwnPropertySymbols(d)));for(var O=0;O<M.length;O+=1)xx(m,M[O],d[M[O]],b[M[O]])};uv.supportsDescriptors=!!lv;var eu=uv,df=typeof Map=="function"&&Map.prototype,Rp=Object.getOwnPropertyDescriptor&&df?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Cc=df&&Rp&&typeof Rp.get=="function"?Rp.get:null,em=df&&Map.prototype.forEach,mf=typeof Set=="function"&&Set.prototype,Fp=Object.getOwnPropertyDescriptor&&mf?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Pc=mf&&Fp&&typeof Fp.get=="function"?Fp.get:null,tm=mf&&Set.prototype.forEach,bx=typeof WeakMap=="function"&&WeakMap.prototype,Xl=bx?WeakMap.prototype.has:null,wx=typeof WeakSet=="function"&&WeakSet.prototype,Kl=wx?WeakSet.prototype.has:null,Sx=typeof WeakRef=="function"&&WeakRef.prototype,rm=Sx?WeakRef.prototype.deref:null,Tx=Boolean.prototype.valueOf,Ix=Object.prototype.toString,Ax=Function.prototype.toString,Ex=String.prototype.match,yf=String.prototype.slice,Xa=String.prototype.replace,Cx=String.prototype.toUpperCase,im=String.prototype.toLowerCase,cv=RegExp.prototype.test,nm=Array.prototype.concat,Nn=Array.prototype.join,Px=Array.prototype.slice,am=Math.floor,tf=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Op=Object.getOwnPropertySymbols,rf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,$s=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Jl=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===$s||!0)?Symbol.toStringTag:null,pv=Object.prototype.propertyIsEnumerable,om=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(m){return m.__proto__}:null);function sm(m,d){if(m===1/0||m===-1/0||m!==m||m&&m>-1e3&&m<1e3||cv.call(/e/,d))return d;var b=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof m=="number"){var M=m<0?-am(-m):am(m);if(M!==m){var O=String(M),G=yf.call(d,O.length+1);return Xa.call(O,b,"$&_")+"."+Xa.call(Xa.call(G,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Xa.call(d,b,"$&_")}var nf=Y.require$$0,lm=nf.custom,um=dv(lm)?lm:null,hv={__proto__:null,double:'"',single:"'"},kx={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},Mx=function m(d,b,M,O){var G=b||{};if(ba(G,"quoteStyle")&&!ba(hv,G.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ba(G,"maxStringLength")&&(typeof G.maxStringLength=="number"?G.maxStringLength<0&&G.maxStringLength!==1/0:G.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var l=ba(G,"customInspect")?G.customInspect:!0;if(typeof l!="boolean"&&l!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ba(G,"indent")&&G.indent!==null&&G.indent!==" "&&!(parseInt(G.indent,10)===G.indent&&G.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ba(G,"numericSeparator")&&typeof G.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var oe=G.numericSeparator;if(typeof d>"u")return"undefined";if(d===null)return"null";if(typeof d=="boolean")return d?"true":"false";if(typeof d=="string")return yv(d,G);if(typeof d=="number"){if(d===0)return 1/0/d>0?"0":"-0";var W=String(d);return oe?sm(d,W):W}if(typeof d=="bigint"){var ve=String(d)+"n";return oe?sm(d,ve):ve}var me=typeof G.depth>"u"?5:G.depth;if(typeof M>"u"&&(M=0),M>=me&&me>0&&typeof d=="object")return af(d)?"[Array]":"[Object]";var Le=Xx(G,M);if(typeof O>"u")O=[];else if(mv(O,d)>=0)return"[Circular]";function le(Lt,Tr,Sa){if(Tr&&(O=Px.call(O),O.push(Tr)),Sa){var ii={depth:G.depth};return ba(G,"quoteStyle")&&(ii.quoteStyle=G.quoteStyle),m(Lt,ii,M+1,O)}return m(Lt,G,M+1,O)}if(typeof d=="function"&&!cm(d)){var ge=Ux(d),Re=fc(d,le);return"[Function"+(ge?": "+ge:" (anonymous)")+"]"+(Re.length>0?" { "+Nn.call(Re,", ")+" }":"")}if(dv(d)){var Ye=$s?Xa.call(String(d),/^(Symbol\(.*\))_[^)]*$/,"$1"):rf.call(d);return typeof d=="object"&&!$s?Hl(Ye):Ye}if(Gx(d)){for(var je="<"+im.call(String(d.nodeName)),It=d.attributes||[],tt=0;tt<It.length;tt++)je+=" "+It[tt].name+"="+fv(zx(It[tt].value),"double",G);return je+=">",d.childNodes&&d.childNodes.length&&(je+="..."),je+="</"+im.call(String(d.nodeName))+">",je}if(af(d)){if(d.length===0)return"[]";var dt=fc(d,le);return Le&&!Hx(dt)?"["+of(dt,Le)+"]":"[ "+Nn.call(dt,", ")+" ]"}if(Dx(d)){var Dt=fc(d,le);return!("cause"in Error.prototype)&&"cause"in d&&!pv.call(d,"cause")?"{ ["+String(d)+"] "+Nn.call(nm.call("[cause]: "+le(d.cause),Dt),", ")+" }":Dt.length===0?"["+String(d)+"]":"{ ["+String(d)+"] "+Nn.call(Dt,", ")+" }"}if(typeof d=="object"&&l){if(um&&typeof d[um]=="function"&&nf)return nf(d,{depth:me-M});if(l!=="symbol"&&typeof d.inspect=="function")return d.inspect()}if(Nx(d)){var Xt=[];return em&&em.call(d,function(Lt,Tr){Xt.push(le(Tr,d,!0)+" => "+le(Lt,d))}),pm("Map",Cc.call(d),Xt,Le)}if($x(d)){var Kt=[];return tm&&tm.call(d,function(Lt){Kt.push(le(Lt,d))}),pm("Set",Pc.call(d),Kt,Le)}if(qx(d))return Vp("WeakMap");if(Zx(d))return Vp("WeakSet");if(jx(d))return Vp("WeakRef");if(Rx(d))return Hl(le(Number(d)));if(Ox(d))return Hl(le(tf.call(d)));if(Fx(d))return Hl(Tx.call(d));if(Lx(d))return Hl(le(String(d)));if(typeof window<"u"&&d===window)return"{ [object Window] }";if(typeof globalThis<"u"&&d===globalThis||typeof Y.commonjsGlobal<"u"&&d===Y.commonjsGlobal)return"{ [object globalThis] }";if(!Bx(d)&&!cm(d)){var ur=fc(d,le),Sr=om?om(d)===Object.prototype:d instanceof Object||d.constructor===Object,cr=d instanceof Object?"":"null prototype",Xr=!Sr&&Jl&&Object(d)===d&&Jl in d?yf.call(Ja(d),8,-1):cr?"Object":"",gr=Sr||typeof d.constructor!="function"?"":d.constructor.name?d.constructor.name+" ":"",gi=gr+(Xr||cr?"["+Nn.call(nm.call([],Xr||[],cr||[]),": ")+"] ":"");return ur.length===0?gi+"{}":Le?gi+"{"+of(ur,Le)+"}":gi+"{ "+Nn.call(ur,", ")+" }"}return String(d)};function fv(m,d,b){var M=b.quoteStyle||d,O=hv[M];return O+m+O}function zx(m){return Xa.call(String(m),/"/g,""")}function No(m){return!Jl||!(typeof m=="object"&&(Jl in m||typeof m[Jl]<"u"))}function af(m){return Ja(m)==="[object Array]"&&No(m)}function Bx(m){return Ja(m)==="[object Date]"&&No(m)}function cm(m){return Ja(m)==="[object RegExp]"&&No(m)}function Dx(m){return Ja(m)==="[object Error]"&&No(m)}function Lx(m){return Ja(m)==="[object String]"&&No(m)}function Rx(m){return Ja(m)==="[object Number]"&&No(m)}function Fx(m){return Ja(m)==="[object Boolean]"&&No(m)}function dv(m){if($s)return m&&typeof m=="object"&&m instanceof Symbol;if(typeof m=="symbol")return!0;if(!m||typeof m!="object"||!rf)return!1;try{return rf.call(m),!0}catch{}return!1}function Ox(m){if(!m||typeof m!="object"||!tf)return!1;try{return tf.call(m),!0}catch{}return!1}var Vx=Object.prototype.hasOwnProperty||function(m){return m in this};function ba(m,d){return Vx.call(m,d)}function Ja(m){return Ix.call(m)}function Ux(m){if(m.name)return m.name;var d=Ex.call(Ax.call(m),/^function\s*([\w$]+)/);return d?d[1]:null}function mv(m,d){if(m.indexOf)return m.indexOf(d);for(var b=0,M=m.length;b<M;b++)if(m[b]===d)return b;return-1}function Nx(m){if(!Cc||!m||typeof m!="object")return!1;try{Cc.call(m);try{Pc.call(m)}catch{return!0}return m instanceof Map}catch{}return!1}function qx(m){if(!Xl||!m||typeof m!="object")return!1;try{Xl.call(m,Xl);try{Kl.call(m,Kl)}catch{return!0}return m instanceof WeakMap}catch{}return!1}function jx(m){if(!rm||!m||typeof m!="object")return!1;try{return rm.call(m),!0}catch{}return!1}function $x(m){if(!Pc||!m||typeof m!="object")return!1;try{Pc.call(m);try{Cc.call(m)}catch{return!0}return m instanceof Set}catch{}return!1}function Zx(m){if(!Kl||!m||typeof m!="object")return!1;try{Kl.call(m,Kl);try{Xl.call(m,Xl)}catch{return!0}return m instanceof WeakSet}catch{}return!1}function Gx(m){return!m||typeof m!="object"?!1:typeof HTMLElement<"u"&&m instanceof HTMLElement?!0:typeof m.nodeName=="string"&&typeof m.getAttribute=="function"}function yv(m,d){if(m.length>d.maxStringLength){var b=m.length-d.maxStringLength,M="... "+b+" more character"+(b>1?"s":"");return yv(yf.call(m,0,d.maxStringLength),d)+M}var O=kx[d.quoteStyle||"single"];O.lastIndex=0;var G=Xa.call(Xa.call(m,O,"\\$1"),/[\x00-\x1f]/g,Wx);return fv(G,"single",d)}function Wx(m){var d=m.charCodeAt(0),b={8:"b",9:"t",10:"n",12:"f",13:"r"}[d];return b?"\\"+b:"\\x"+(d<16?"0":"")+Cx.call(d.toString(16))}function Hl(m){return"Object("+m+")"}function Vp(m){return m+" { ? }"}function pm(m,d,b,M){var O=M?of(b,M):Nn.call(b,", ");return m+" ("+d+") {"+O+"}"}function Hx(m){for(var d=0;d<m.length;d++)if(mv(m[d],`
|
|
498
|
-
`)>=0)return!1;return!0}function Xx(m,
|
|
499
|
-
`+
|
|
500
|
-
`+d.prev}function fc(m,d){var b=af(m),M=[];if(b){M.length=m.length;for(var O=0;O<m.length;O++)M[O]=ba(m,O)?d(m[O],m):""}var G=typeof Op=="function"?Op(m):[],l;if($s){l={};for(var oe=0;oe<G.length;oe++)l["$"+G[oe]]=G[oe]}for(var W in m)ba(m,W)&&(b&&String(Number(W))===W&&W<m.length||$s&&l["$"+W]instanceof Symbol||(cv.call(/[^\w$]/,W)?M.push(d(W,m)+": "+d(m[W],m)):M.push(W+": "+d(m[W],m))));if(typeof Op=="function")for(var ve=0;ve<G.length;ve++)pv.call(m,G[ve])&&M.push("["+d(G[ve])+"]: "+d(m[G[ve]],m));return M}var Rc=function(d){return typeof d=="string"||typeof d=="symbol"},Ya=function(d){return!!d&&(typeof d=="function"||typeof d=="object")},hm=Y.type,Kx=Mx,Jx=Rc,Yx=Ya,Qx=function(d,b){if(!Yx(d))throw new hm("Assertion failed: Type(O) is not Object");if(!Jx(b))throw new hm("Assertion failed: P is not a Property Key, got "+Kx(b));return d[b]},e0=Y._isNaN,wa=function(d){return(typeof d=="number"||typeof d=="bigint")&&!e0(d)&&d!==1/0&&d!==-1/0},t0=Y.abs,r0=Y.floor,i0=Y._isNaN,n0=wa,Fc=function(d){if(typeof d!="number"||i0(d)||!n0(d))return!1;var b=t0(d);return r0(b)===b},a0=Y.callBindExports,vv=Y.callBound,o0=Y.getIntrinsic,sf=o0("%ArrayBuffer%",!0),Ec=vv("ArrayBuffer.prototype.byteLength",!0),s0=vv("Object.prototype.toString"),fm=!!sf&&!Ec&&new sf(0).slice,dm=!!fm&&a0(fm),Zs=Ec||dm?function(d){if(!d||typeof d!="object")return!1;try{return Ec?Ec(d):dm(d,0),!0}catch{return!1}}:sf?function(d){return s0(d)==="[object ArrayBuffer]"}:function(d){return!1},l0=Y.callBound,mm=l0("ArrayBuffer.prototype.byteLength",!0),u0=Zs,gv=function(d){return u0(d)?mm?mm(d):d.byteLength:NaN},c0=Y.callBound,ym=c0("SharedArrayBuffer.prototype.byteLength",!0),tu=ym?function(d){if(!d||typeof d!="object")return!1;try{return ym(d),!0}catch{return!1}}:function(d){return!1},p0=Y.type,h0=gv,f0=Y.availableTypedArrays(),d0=Y.callBound,m0=Zs,y0=tu,v0=d0("SharedArrayBuffer.prototype.byteLength",!0),Gs=function(d){var b=y0(d);if(!m0(d)&&!b)throw new p0("Assertion failed: `arrayBuffer` must be an Object with an [[ArrayBufferData]] internal slot");if((b?v0:h0)(d)===0)try{new Y.commonjsGlobal[f0[0]](d)}catch(M){return!!M&&M.name==="TypeError"}return!1},Up,vm;function _v(){if(vm)return Up;vm=1;var m=Y.type,d=Y.requireHasown(),b=Ya,M=Rc;return Up=function(G,l){if(!b(G))throw new m("Assertion failed: `O` must be an Object");if(!M(l))throw new m("Assertion failed: `P` must be a Property Key");return d(G,l)},Up}var g0=Y.getIntrinsic,xv=g0("%Array%"),_0=!xv.isArray&&Y.callBound("Object.prototype.toString"),bv=xv.isArray||function(d){return _0(d)==="[object Array]"},vf=bv,Np,gm;function wv(){return gm||(gm=1,Np=function(d){return d==="BIGUINT64"||d==="BIGINT64"}),Np}var qp,_m;function x0(){return _m||(_m=1,qp=function(d){return d==="UINT8"||d==="UINT8C"||d==="UINT16"||d==="UINT32"||d==="BIGUINT64"}),qp}var jp,xm;function b0(){if(xm)return jp;xm=1;var m=Y.pow;return jp=function(b){var M=b[3]&128?-1:1,O=(b[3]&127)<<1|b[2]>>7,G=(b[2]&127)<<16|b[1]<<8|b[0];return O===0&&G===0?M===1?0:-0:O===255&&G===0?M===1?1/0:-1/0:O===255&&G!==0?NaN:(O-=127,O===-127?M*G*m(2,-149):M*(1+G*m(2,-23))*m(2,O))},jp}var $p,bm;function w0(){if(bm)return $p;bm=1;var m=Y.pow;return $p=function(b){var M=b[7]&128?-1:1,O=(b[7]&127)<<4|(b[6]&240)>>4,G=(b[6]&15)*281474976710656+b[5]*1099511627776+b[4]*4294967296+b[3]*16777216+b[2]*65536+b[1]*256+b[0];return O===0&&G===0?M*0:O===2047&&G!==0?NaN:O===2047&&G===0?M*(1/0):(O-=1023,O===-1023?M*G*5e-324:M*(1+G/4503599627370496)*m(2,O))},$p}var Zp,wm;function S0(){if(wm)return Zp;wm=1;var m=Y.getIntrinsic,d=Y.pow,b=m("%Number%"),M=m("%BigInt%",!0);return Zp=function(G,l,oe,W){for(var ve=W?M:b,me=ve(0),Le=0;Le<G.length;Le++)me+=ve(G[Le]*d(2,8*Le));if(!oe){var le=l*8;G[l-1]&128&&(me-=ve(d(2,le)))}return me},Zp}var Gp,Sm;function T0(){return Sm||(Sm=1,Gp=function(d,b){for(var M=0;M<d.length;M+=1)if(!b(d[M],M,d))return!1;return!0}),Gp}var Wp,Tm;function I0(){return Tm||(Tm=1,Wp=function(d){return typeof d=="number"&&d>=0&&d<=255&&(d|0)===d}),Wp}var Ws={__proto__:null,name:{__proto__:null,$Int8Array:"INT8",$Uint8Array:"UINT8",$Uint8ClampedArray:"UINT8C",$Int16Array:"INT16",$Uint16Array:"UINT16",$Int32Array:"INT32",$Uint32Array:"UINT32",$BigInt64Array:"BIGINT64",$BigUint64Array:"BIGUINT64",$Float32Array:"FLOAT32",$Float64Array:"FLOAT64"},size:{__proto__:null,$INT8:1,$UINT8:1,$UINT8C:1,$INT16:2,$UINT16:2,$INT32:4,$UINT32:4,$BIGINT64:8,$BIGUINT64:8,$FLOAT32:4,$FLOAT64:8},choices:'"INT8", "UINT8", "UINT8C", "INT16", "UINT16", "INT32", "UINT32", "BIGINT64", "BIGUINT64", "FLOAT32", or "FLOAT64"'},Hp,Im;function A0(){if(Im)return Hp;Im=1;var m=Y.getIntrinsic,d=Y.callBound,b=Y.range,M=Y.syntax,O=Y.type,G=m("%BigInt%",!0),l=_v(),oe=vf,W=wv(),ve=x0(),me=b0(),Le=w0(),le=S0(),ge=T0(),Re=I0(),Ye=d("Array.prototype.reverse"),je=d("Array.prototype.slice"),It=Ws;return Hp=function(dt,Dt,Xt){if(!l(It.size,"$"+dt))throw new O("Assertion failed: `type` must be a TypedArray element type");if(!oe(Dt)||!ge(Dt,Re))throw new O("Assertion failed: `rawBytes` must be an Array of bytes");if(typeof Xt!="boolean")throw new O("Assertion failed: `isLittleEndian` must be a Boolean");var Kt=It.size["$"+dt];if(Dt.length!==Kt)throw new b("Assertion failed: `rawBytes` must have a length of "+Kt+" for type "+dt);var ur=W(dt);if(ur&&!G)throw new M("this environment does not support BigInts");return Dt=je(Dt,0,Kt),Xt||Ye(Dt),dt==="FLOAT32"?me(Dt):dt==="FLOAT64"?Le(Dt):le(Dt,Kt,ve(dt),ur)},Hp}var Xp,Am;function Sv(){if(Am)return Xp;Am=1;var m={}.toString;return Xp=Array.isArray||function(d){return m.call(d)=="[object Array]"},Xp}var Kp,Em;function E0(){if(Em)return Kp;Em=1;var m=Y.getIntrinsic,d=m("%Array.prototype.concat%"),b=Y.callBindExports,M=Y.callBound,O=M("Array.prototype.slice"),G=Y.requireShams$1()(),l=G&&Symbol.isConcatSpreadable,oe=[],W=l?b.apply(d,oe):null,ve=l?Sv():null;return Kp=l?function(Le){for(var le=0;le<arguments.length;le+=1){var ge=arguments[le];if(ge&&typeof ge=="object"&&typeof ge[l]=="boolean"){oe[l]||(oe[l]=!0);var Re=ve(ge)?O(ge):[ge];Re[l]=!0,arguments[le]=Re}}return W(arguments)}:b(d,oe),Kp}var C0=Y.type,P0=Y.callBound,k0=P0("TypedArray.prototype.buffer",!0),M0=Y.isTypedArray,ru=k0||function(d){if(!M0(d))throw new C0("Not a Typed Array");return d.buffer},Jp,Cm;function Tv(){if(Cm)return Jp;Cm=1;var m=Y.getIntrinsic,d=m("%Uint8Array%",!0),b=m("%Uint32Array%",!0),M=ru,O=b&&new b([305419896]),G=O&&new d(M(O));return Jp=G?G[0]===120?"little":G[0]===18?"big":G[0]===52?"mixed":"unknown":"indeterminate",Jp}var z0=Y.getIntrinsic,B0=Y.syntax,_a=Y.type,D0=Y.callBound,L0=Fc,R0=z0("%Uint8Array%",!0),Yp=D0("Array.prototype.slice"),F0=Gs,O0=A0(),V0=Zs,U0=tu,Pm=E0(),dc=Ws,N0=Tv(),q0=function(d,b,M,O,G){var l=U0(d);if(!V0(d)&&!l)throw new _a("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!L0(b))throw new _a("Assertion failed: `byteIndex` must be an integer");if(typeof M!="string"||typeof dc.size["$"+M]!="number")throw new _a("Assertion failed: `type` must be one of "+dc.choices);if(typeof O!="boolean")throw new _a("Assertion failed: `isTypedArray` must be a boolean");if(G!=="SEQ-CST"&&G!=="UNORDERED")throw new _a("Assertion failed: `order` must be either `SEQ-CST` or `UNORDERED`");if(arguments.length>5&&typeof arguments[5]!="boolean")throw new _a("Assertion failed: `isLittleEndian` must be a boolean, if present");if(F0(d))throw new _a("Assertion failed: `arrayBuffer` is detached");if(b<0)throw new _a("Assertion failed: `byteIndex` must be non-negative");var oe=dc.size["$"+M];if(!oe)throw new _a("Assertion failed: `type` must be one of "+dc.choices);var W;if(l)throw new B0("SharedArrayBuffer is not supported by this implementation");W=Yp(new R0(d,b),0,oe);var ve=arguments.length>5?arguments[5]:N0==="little",me=ve?Yp(Pm([0,0,0,0,0,0,0,0],W),-oe):Yp(Pm(W,[0,0,0,0,0,0,0,0]),0,oe);return O0(M,me,ve)},km=Y._isNaN,Iv=function(d,b){return d===b?d===0?1/d===1/b:!0:km(d)&&km(b)},mc=Y.type,j0=Ya,$0=Rc,Mm=Iv,zm=function(){try{return delete[].length,!0}catch{return!1}}(),Z0=function(d,b,M,O){if(!j0(d))throw new mc("Assertion failed: `O` must be an Object");if(!$0(b))throw new mc("Assertion failed: `P` must be a Property Key");if(typeof O!="boolean")throw new mc("Assertion failed: `Throw` must be a Boolean");if(O){if(d[b]=M,zm&&!Mm(d[b],M))throw new mc("Attempted to assign to readonly property.");return!0}try{return d[b]=M,zm?Mm(d[b],M):!0}catch{return!1}},Qp,Bm;function G0(){if(Bm)return Qp;Bm=1;var m=Y.getIntrinsic,d=m("%BigInt%",!0),b=Y.type,M=Y.syntax;return Qp=function(G){if(typeof G!="string")throw new b("`argument` must be a string");if(!d)throw new M("BigInts are not supported in this environment");try{return d(G)}catch{return}},Qp}var eh,Dm;function W0(){return Dm||(Dm=1,eh=function(d){return d===null||typeof d!="function"&&typeof d!="object"}),eh}var Av=Y.callBound,H0=Av("Date.prototype.getDay"),X0=function(d){try{return H0(d),!0}catch{return!1}},K0=Av("Object.prototype.toString"),J0="[object Date]",Y0=Y.requireShams()(),Ev=function(d){return typeof d!="object"||d===null?!1:Y0?X0(d):K0(d)===J0},yc={exports:{}},Lm;function Cv(){if(Lm)return yc.exports;Lm=1;var m=Y.callBound,d=m("Object.prototype.toString"),b=Y.requireHasSymbols()(),M=Y.requireSafeRegexTest();if(b){var O=m("Symbol.prototype.toString"),G=M(/^Symbol\(.*\)$/),l=function(W){return typeof W.valueOf()!="symbol"?!1:G(O(W))};yc.exports=function(W){if(typeof W=="symbol")return!0;if(!W||typeof W!="object"||d(W)!=="[object Symbol]")return!1;try{return l(W)}catch{return!1}}}else yc.exports=function(W){return!1};return yc.exports}var th,Rm;function Q0(){if(Rm)return th;Rm=1;var m=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol",d=W0(),b=Y.isCallable,M=Ev,O=Cv(),G=function(W,ve){if(typeof W>"u"||W===null)throw new TypeError("Cannot call method on "+W);if(typeof ve!="string"||ve!=="number"&&ve!=="string")throw new TypeError('hint must be "string" or "number"');var me=ve==="string"?["toString","valueOf"]:["valueOf","toString"],Le,le,ge;for(ge=0;ge<me.length;++ge)if(Le=W[me[ge]],b(Le)&&(le=Le.call(W),d(le)))return le;throw new TypeError("No default value")},l=function(W,ve){var me=W[ve];if(me!==null&&typeof me<"u"){if(!b(me))throw new TypeError(me+" returned for property "+String(ve)+" of object "+W+" is not a function");return me}};return th=function(W){if(d(W))return W;var ve="default";arguments.length>1&&(arguments[1]===String?ve="string":arguments[1]===Number&&(ve="number"));var me;if(m&&(Symbol.toPrimitive?me=l(W,Symbol.toPrimitive):O(W)&&(me=Symbol.prototype.valueOf)),typeof me<"u"){var Le=me.call(W,ve);if(d(Le))return Le;throw new TypeError("unable to convert exotic object to primitive")}return ve==="default"&&(M(W)||O(W))&&(ve="string"),G(W,ve==="default"?"number":ve)},th}var rh,Fm;function Pv(){if(Fm)return rh;Fm=1;var m=Q0();return rh=function(b){return arguments.length>1?m(b,arguments[1]):m(b)},rh}var ih,Om;function kv(){if(Om)return ih;Om=1;var m=Y.getIntrinsic,d=m("%BigInt%",!0),b=m("%Number%"),M=Y.type,O=Y.syntax,G=G0(),l=Pv();return ih=function(W){if(!d)throw new O("BigInts are not supported in this environment");var ve=l(W,b);if(ve==null)throw new M("Cannot convert null or undefined to a BigInt");if(typeof ve=="boolean")return d(ve?1:0);if(typeof ve=="number")throw new M("Cannot convert a Number value to a BigInt");if(typeof ve=="string"){var me=G(ve);if(typeof me>"u")throw new M("Failed to parse String to BigInt");return me}if(typeof ve=="symbol")throw new M("Cannot convert a Symbol value to a BigInt");if(typeof ve!="bigint")throw new O("Assertion failed: unknown primitive type");return ve},ih}var nh,Vm;function Mv(){if(Vm)return nh;Vm=1;var m=Y.getIntrinsic,d=m("%BigInt%",!0),b=Y.range,M=Y.type,O=d&&d(0);return nh=function(l,oe){if(typeof l!="bigint"||typeof oe!="bigint")throw new M("Assertion failed: `n` and `d` arguments must be BigInts");if(oe===O)throw new b("Division by zero");return l===O?O:l%oe},nh}var ah,Um;function zv(){return Um||(Um=1,ah=function(d,b,M){var O=d(b,M);return O>=0?O:O+M}),ah}var oh,Nm;function eb(){if(Nm)return oh;Nm=1;var m=Y.getIntrinsic,d=m("%BigInt%",!0),b=Y.pow,M=kv(),O=Mv(),G=zv(),l=d&&BigInt(b(2,32))*BigInt(b(2,31)),oe=d&&BigInt(b(2,32))*BigInt(b(2,32));return oh=function(ve){var me=M(ve),Le=G(O,me,oe);return Le>=l?Le-oe:Le},oh}var sh,qm;function tb(){if(qm)return sh;qm=1;var m=Y.getIntrinsic,d=m("%BigInt%",!0),b=Y.pow,M=kv(),O=Mv(),G=zv(),l=d&&BigInt(b(2,32))*BigInt(b(2,32));return sh=function(W){var ve=M(W),me=G(O,ve,l);return me},sh}var lh,jm;function rb(){if(jm)return lh;jm=1;var m=Y.floor;return lh=function(b,M){var O=b%M;return m(O>=0?O:O+M)},lh}var uh,$m;function ib(){return $m||($m=1,uh=rb()),uh}var ch,Zm;function Hs(){if(Zm)return ch;Zm=1;var m=ib();return ch=function(b,M){return m(b,M)},ch}var ph,Gm;function nb(){return Gm||(Gm=1,ph=function(d){return d===null||typeof d!="function"&&typeof d!="object"}),ph}var hh,Wm;function Bv(){if(Wm)return hh;Wm=1;var m=Y.type;return hh=function(b){if(b==null)throw new m(arguments.length>0&&arguments[1]||"Cannot call method on "+b);return b},hh}var ab=Y.getIntrinsic,ob=ab("%String%"),sb=Y.type,Dv=function(d){if(typeof d=="symbol")throw new sb("Cannot convert a Symbol value to a string");return ob(d)},fh,Hm;function Lv(){if(Hm)return fh;Hm=1;var m=Bv(),d=Dv,b=Y.callBound,M=b("String.prototype.replace"),O=/^\s$/.test(""),G=O?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,l=O?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;return fh=function(){var W=d(m(this));return M(M(W,G,""),l,"")},fh}var dh,Xm;function Rv(){if(Xm)return dh;Xm=1;var m=Lv(),d="",b="";return dh=function(){return String.prototype.trim&&d.trim()===d&&b.trim()===b&&("_"+b).trim()==="_"+b&&(b+"_").trim()===b+"_"?String.prototype.trim:m},dh}var mh,Km;function lb(){if(Km)return mh;Km=1;var m=Y.hasPropertyDescriptors_1(),d=Y.defineDataProperty,b=Rv();return mh=function(){var O=b();return String.prototype.trim!==O&&(m?d(String.prototype,"trim",O,!0):d(String.prototype,"trim",O)),O},mh}var yh,Jm;function ub(){if(Jm)return yh;Jm=1;var m=Y.callBindExports,d=eu,b=Bv(),M=Lv(),O=Rv(),G=lb(),l=m(O()),oe=function(ve){return b(ve),l(ve)};return d(oe,{getPolyfill:O,implementation:M,shim:G}),yh=oe,yh}var vh,Ym;function cb(){if(Ym)return vh;Ym=1;var m=Y.getIntrinsic,d=m("%RegExp%"),b=Y.type,M=m("%parseInt%"),O=Y.callBound,G=Y.requireSafeRegexTest(),l=O("String.prototype.slice"),oe=G(/^0b[01]+$/i),W=G(/^0o[0-7]+$/i),ve=G(/^[-+]0x[0-9a-f]+$/i),me=["
","",""].join(""),Le=new d("["+me+"]","g"),le=G(Le),ge=ub();return vh=function Re(Ye){if(typeof Ye!="string")throw new b("Assertion failed: `argument` is not a String");if(oe(Ye))return+M(l(Ye,2),2);if(W(Ye))return+M(l(Ye,2),8);if(le(Ye)||ve(Ye))return NaN;var je=ge(Ye);return je!==Ye?Re(je):+Ye},vh}var pb=Y.getIntrinsic,Qm=Y.type,hb=pb("%Number%"),fb=nb(),db=Pv(),mb=cb(),Qa=function(d){var b=fb(d)?d:db(d,hb);if(typeof b=="symbol")throw new Qm("Cannot convert a Symbol value to a number");if(typeof b=="bigint")throw new Qm("Conversion from 'BigInt' to 'number' is not allowed.");return typeof b=="string"?mb(b):+b},yb=Y.floor,gf=function(d){return typeof d=="bigint"?d:yb(d)},ey=gf,vb=Y.type,qo=function(d){if(typeof d!="number"&&typeof d!="bigint")throw new vb("argument must be a Number or a BigInt");var b=d<0?-ey(-d):ey(d);return b===0?0:b},gh,ty;function gb(){if(ty)return gh;ty=1;var m=Hs(),d=Qa,b=qo,M=wa,O=65536;return gh=function(l){var oe=d(l);if(!M(oe)||oe===0)return 0;var W=b(oe),ve=m(W,O);return ve>=32768?ve-O:ve},gh}var _h,ry;function _b(){if(ry)return _h;ry=1;var m=Hs(),d=Qa,b=qo,M=wa,O=2147483648,G=4294967296;return _h=function(oe){var W=d(oe);if(!M(W)||W===0)return 0;var ve=b(W),me=m(ve,G),Le=me>=O?me-G:me;return Le===0?0:Le},_h}var xh,iy;function xb(){if(iy)return xh;iy=1;var m=Hs(),d=Qa,b=qo,M=wa;return xh=function(G){var l=d(G);if(!M(l)||l===0)return 0;var oe=b(l),W=m(oe,256);return W>=128?W-256:W},xh}var bh,ny;function bb(){if(ny)return bh;ny=1;var m=Hs(),d=Qa,b=qo,M=wa,O=65536;return bh=function(l){var oe=d(l);if(!M(oe)||oe===0)return 0;var W=b(oe),ve=m(W,O);return ve===0?0:ve},bh}var wh,ay;function wb(){if(ay)return wh;ay=1;var m=Hs(),d=Qa,b=qo,M=wa,O=4294967296;return wh=function(l){var oe=d(l);if(!M(oe)||oe===0)return 0;var W=b(oe),ve=m(W,O);return ve===0?0:ve},wh}var Sh,oy;function Sb(){if(oy)return Sh;oy=1;var m=wa,d=Hs(),b=Qa,M=qo;return Sh=function(G){var l=b(G);if(!m(l)||l===0)return 0;var oe=M(l),W=d(oe,256);return W},Sh}var Th,sy;function Tb(){if(sy)return Th;sy=1;var m=Y.type,d=Y.max,b=Y.min;return Th=function(O,G,l){if(typeof O!="number"||typeof G!="number"||typeof l!="number"||!(G<=l))throw new m("Assertion failed: all three arguments must be MVs, and `lower` must be `<= upper`");return b(d(G,O),l)},Th}var Ih,ly;function Ib(){if(ly)return Ih;ly=1;var m=Tb(),d=Qa,b=gf,M=Y._isNaN;return Ih=function(G){var l=d(G);if(M(l))return 0;var oe=m(l,0,255),W=b(oe);return oe<W+.5?W:oe>W+.5?W+1:W%2===0?W:W+1},Ih}var Ah,uy;function Fv(){return uy||(uy=1,Ah=function(d){return d===0&&1/d===-1/0}),Ah}var Eh,cy;function Ab(){if(cy)return Eh;cy=1;var m=Y.abs,d=Y.floor,b=Y.pow,M=wa,O=Y._isNaN,G=Fv(),l=34028234663852886e22;return Eh=function(W,ve){if(O(W))return ve?[0,0,192,127]:[127,192,0,0];var me;if(W===0)return me=G(W)?128:0,ve?[0,0,0,me]:[me,0,0,0];if(m(W)>l||!M(W))return me=W<0?255:127,ve?[0,0,128,me]:[me,128,0,0];var Le=W<0?1:0;W=m(W);for(var le=0;W>=2;)le+=1,W/=2;for(;W<1;)le-=1,W*=2;var ge=W-1;ge*=b(2,23)+.5,ge=d(ge),le+=127,le<<=23;var Re=Le<<31|le|ge,Ye=Re&255;Re>>=8;var je=Re&255;Re>>=8;var It=Re&255;Re>>=8;var tt=Re&255;return ve?[Ye,je,It,tt]:[tt,It,je,Ye]},Eh}var Ch,py;function Eb(){if(py)return Ch;py=1;var m=1075,d=54;return Ch=function(M){var O="";if(M===0)return O;for(var G=m,l,oe=0;oe<m;oe+=1)if(l=M*2,l>=1?(M=l-1,O+="1",G===m&&(G=oe)):(M=l,O+="0"),l===1||oe-G>d)return O;return O},Ch}var Ph,hy;function Cb(){if(hy)return Ph;hy=1;var m=Y.floor;return Ph=function(b){for(var M="",O;b>0;)O=b/2,b=m(O),O===b?M="0"+M:M="1"+M;return M},Ph}var kh,fy;function Pb(){if(fy)return kh;fy=1;var m=Y.getIntrinsic,d=m("%parseInt%"),b=Y.abs,M=Y.floor,O=Fv(),G=Y.callBound,l=G("String.prototype.indexOf"),oe=G("String.prototype.slice"),W=Eb(),ve=Cb(),me=1023,Le="11111111111",le="00000000000",ge=le+le+le+le+"0000000";return kh=function(Ye,je){var It=Ye<0||O(Ye)?"1":"0",tt,dt;if(isNaN(Ye))tt=Le,dt="1"+ge;else if(!isFinite(Ye))tt=Le,dt="0"+ge;else if(Ye===0)tt=le,dt="0"+ge;else{Ye=b(Ye);var Dt=M(Ye),Xt=ve(Dt),Kt=W(Ye-Dt),ur;if(Xt)tt=Xt.length-1;else{var Sr=l(Kt,"1");Sr>-1&&(ur=Sr+1),tt=-ur}dt=Xt+Kt,tt<0?(tt<=-1023&&(ur=me-1),dt=oe(dt,ur)):dt=oe(dt,1),tt=oe(le+ve(tt+me),-11),dt=oe(dt+ge+"0",0,52)}for(var cr=It+tt+dt,Xr=[],gr=0;gr<8;gr++){var gi=je?8-gr-1:gr;Xr[gi]=d(oe(cr,gr*8,(gr+1)*8),2)}return Xr},kh}var Mh,dy;function kb(){if(dy)return Mh;dy=1;var m=Y.getIntrinsic,d=m("%Number%"),b=m("%BigInt%",!0);return Mh=function(O,G,l){var oe=typeof O=="bigint"?b:d;O<0&&(O>>>=0);for(var W=[],ve=0;ve<G;ve++)W[l?ve:G-1-ve]=d(O&oe(255)),O>>=oe(8);return W},Mh}var zh,my;function Mb(){if(my)return zh;my=1;var m=Y.type,d=_v(),b=eb(),M=tb(),O=gb(),G=_b(),l=xb(),oe=bb(),W=wb(),ve=Sb(),me=Ib(),Le=Ab(),le=Pb(),ge=kb(),Re=Ws,Ye={__proto__:null,$INT8:l,$UINT8:ve,$UINT8C:me,$INT16:O,$UINT16:oe,$INT32:G,$UINT32:W,$BIGINT64:b,$BIGUINT64:M};return zh=function(It,tt,dt){if(typeof It!="string"||!d(Re.size,"$"+It))throw new m("Assertion failed: `type` must be a TypedArray element type");if(typeof tt!="number"&&typeof tt!="bigint")throw new m("Assertion failed: `value` must be a Number or a BigInt");if(typeof dt!="boolean")throw new m("Assertion failed: `isLittleEndian` must be a Boolean");if(It==="FLOAT32")return Le(tt,dt);if(It==="FLOAT64")return le(tt,dt);var Dt=Re.size["$"+It],Xt=Ye["$"+It],Kt=Xt(tt);return ge(Kt,Dt,dt)},zh}var Bh,yy;function zb(){return yy||(yy=1,Bh=function(d,b){for(var M=0;M<d.length;M+=1)b(d[M],M,d)}),Bh}var Bb=Y.getIntrinsic,Db=Y.syntax,xa=Y.type,Lb=Fc,Rb=Bb("%Uint8Array%",!0),Fb=wv(),Ob=Gs,Vb=Mb(),Ub=Zs,Nb=tu,qb=Y.requireHasown(),Dh=Ws,jb=Tv(),$b=zb(),Zb=function(d,b,M,O,G,l){var oe=Nb(d);if(!Ub(d)&&!oe)throw new xa("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!Lb(b)||b<0)throw new xa("Assertion failed: `byteIndex` must be a non-negative integer");if(typeof M!="string"||!qb(Dh.size,"$"+M))throw new xa("Assertion failed: `type` must be one of "+Dh.choices);if(typeof O!="number"&&typeof O!="bigint")throw new xa("Assertion failed: `value` must be a Number or a BigInt");if(typeof G!="boolean")throw new xa("Assertion failed: `isTypedArray` must be a boolean");if(l!=="SEQ-CST"&&l!=="UNORDERED"&&l!=="INIT")throw new xa('Assertion failed: `order` must be `"SEQ-CST"`, `"UNORDERED"`, or `"INIT"`');if(arguments.length>6&&typeof arguments[6]!="boolean")throw new xa("Assertion failed: `isLittleEndian` must be a boolean, if present");if(Ob(d))throw new xa("Assertion failed: ArrayBuffer is detached");if(Fb(M)?typeof O!="bigint":typeof O!="number")throw new xa("Assertion failed: `value` must be a BigInt if type is ~BIGINT64~ or ~BIGUINT64~, otherwise a Number");var W=Dh.size["$"+M],ve=arguments.length>6?arguments[6]:jb==="little",me=Vb(M,O,ve);if(oe)throw new Db("SharedArrayBuffer is not supported by this implementation");var Le=new Rb(d,b,W);$b(me,function(le,ge){Le[ge]=le})},Gb=Qa,Wb=qo,Hb=Y._isNaN,Xb=wa,Kb=function(d){var b=Gb(d);return Hb(b)||b===0?0:Xb(b)?Wb(b):b},Jb=Y.syntax,Yb=Y.type,Qb=Fc,e1=Y.whichTypedArray,vy=Ws,_f=function(d){var b=e1(d);if(!b)throw new Yb("Assertion failed: `O` must be a TypedArray");var M=vy.size["$"+vy.name["$"+b]];if(!Qb(M)||M<0)throw new Jb("Assertion failed: Unknown TypedArray type `"+b+"`");return M},t1=Y.syntax,r1=Y.type,i1=Y.whichTypedArray,n1=Ws,a1=function(d){var b=i1(d);if(!b)throw new r1("Assertion failed: `O` must be a TypedArray");var M=n1.name["$"+b];if(typeof M!="string")throw new t1("Assertion failed: Unknown TypedArray type `"+b+"`");return M},lf={exports:{}},o1=Y.getIntrinsic,Lh,gy;function xf(){if(gy)return Lh;gy=1;var m=Y.type,d=Y.requireHasown(),b={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};return Lh=function(O){if(!O||typeof O!="object")return!1;for(var G in O)if(d(O,G)&&!b[G])return!1;var l=d(O,"[[Value]]")||d(O,"[[Writable]]"),oe=d(O,"[[Get]]")||d(O,"[[Set]]");if(l&&oe)throw new m("Property Descriptors may not be both accessor and data descriptors");return!0},Lh}var Rh,_y;function s1(){if(_y)return Rh;_y=1;var m=Y.hasPropertyDescriptors_1,d=Y.esDefineProperty,b=m.hasArrayLengthDefineBug(),M=b&&bv,O=Y.callBound,G=O("Object.prototype.propertyIsEnumerable");return Rh=function(oe,W,ve,me,Le,le){if(!d){if(!oe(le)||!le["[[Configurable]]"]||!le["[[Writable]]"]||Le in me&&G(me,Le)!==!!le["[[Enumerable]]"])return!1;var ge=le["[[Value]]"];return me[Le]=ge,W(me[Le],ge)}return b&&Le==="length"&&"[[Value]]"in le&&M(me)&&me.length!==le["[[Value]]"]?(me.length=le["[[Value]]"],me.length===le["[[Value]]"]):(d(me,Le,ve(le)),!0)},Rh}var Fh,xy;function l1(){return xy||(xy=1,Fh=function(d){if(typeof d>"u")return d;var b={};return"[[Value]]"in d&&(b.value=d["[[Value]]"]),"[[Writable]]"in d&&(b.writable=!!d["[[Writable]]"]),"[[Get]]"in d&&(b.get=d["[[Get]]"]),"[[Set]]"in d&&(b.set=d["[[Set]]"]),"[[Enumerable]]"in d&&(b.enumerable=!!d["[[Enumerable]]"]),"[[Configurable]]"in d&&(b.configurable=!!d["[[Configurable]]"]),b}),Fh}var Oh,by;function u1(){if(by)return Oh;by=1;var m=Y.type,d=xf(),b=l1();return Oh=function(O){if(typeof O<"u"&&!d(O))throw new m("Assertion failed: `Desc` must be a Property Descriptor");return b(O)},Oh}var Vh,wy;function c1(){if(wy)return Vh;wy=1;var m=Y.type,d=Y.requireHasown(),b=xf();return Vh=function(O){if(typeof O>"u")return!1;if(!b(O))throw new m("Assertion failed: `Desc` must be a Property Descriptor");return!(!d(O,"[[Value]]")&&!d(O,"[[Writable]]"))},Vh}var Ov=Y.isCallable,Uh,Sy;function p1(){return Sy||(Sy=1,Uh=function(d){return!!d}),Uh}var Nh,Ty;function h1(){if(Ty)return Nh;Ty=1;var m=Y.requireHasown(),d=Y.type,b=Ya,M=Ov,O=p1();return Nh=function(l){if(!b(l))throw new d("ToPropertyDescriptor requires an object");var oe={};if(m(l,"enumerable")&&(oe["[[Enumerable]]"]=O(l.enumerable)),m(l,"configurable")&&(oe["[[Configurable]]"]=O(l.configurable)),m(l,"value")&&(oe["[[Value]]"]=l.value),m(l,"writable")&&(oe["[[Writable]]"]=O(l.writable)),m(l,"get")){var W=l.get;if(typeof W<"u"&&!M(W))throw new d("getter must be a function");oe["[[Get]]"]=W}if(m(l,"set")){var ve=l.set;if(typeof ve<"u"&&!M(ve))throw new d("setter must be a function");oe["[[Set]]"]=ve}if((m(oe,"[[Get]]")||m(oe,"[[Set]]"))&&(m(oe,"[[Value]]")||m(oe,"[[Writable]]")))throw new d("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return oe},Nh}var qh,Iy;function f1(){if(Iy)return qh;Iy=1;var m=Y.type,d=Ya,b=xf(),M=s1(),O=u1(),G=c1(),l=Rc,oe=Iv,W=h1();return qh=function(me,Le,le){if(!d(me))throw new m("Assertion failed: Type(O) is not Object");if(!l(Le))throw new m("Assertion failed: P is not a Property Key");var ge=b(le)?le:W(le);if(!b(ge))throw new m("Assertion failed: Desc is not a valid Property Descriptor");return M(G,oe,O,me,Le,ge)},qh}var d1=o1,Ay=d1("%Reflect.construct%",!0),kc=f1();try{kc({},"",{"[[Get]]":function(){}})}catch{kc=null}if(kc&&Ay){var Ey={},Cy={};kc(Cy,"length",{"[[Get]]":function(){throw Ey},"[[Enumerable]]":!0}),lf.exports=function(d){try{Ay(d,Cy)}catch(b){return b===Ey}}}else lf.exports=function(d){return typeof d=="function"&&!!d.prototype};var Vv=lf.exports,m1=Y.getIntrinsic,Py=m1("%Symbol.species%",!0),jh=Y.type,ky=Ya,y1=Vv,v1=function(d,b){if(!ky(d))throw new jh("Assertion failed: Type(O) is not Object");var M=d.constructor;if(typeof M>"u")return b;if(!ky(M))throw new jh("O.constructor is not an Object");var O=Py?M[Py]:void 0;if(O==null)return b;if(y1(O))return O;throw new jh("no constructor found")},g1=Y.type,Uv=Y.callBound,My=Uv("%ArrayBuffer.prototype.resizable%",!0),zy=Uv("%SharedArrayBuffer.prototype.growable%",!0),_1=Zs,x1=tu,Nv=function(d){var b=_1(d),M=x1(d);if(!b&&!M)throw new g1("Assertion failed: `arrayBuffer` must be an ArrayBuffer or SharedArrayBuffer");return b&&My?!My(d):M&&zy?!zy(d):!0},b1=Fc,By=Y.requireHasown(),w1=Y.isTypedArray,S1=b1,qv=function(d){return!!d&&typeof d=="object"&&By(d,"[[Object]]")&&By(d,"[[CachedBufferByteLength]]")&&(S1(d["[[CachedBufferByteLength]]"])&&d["[[CachedBufferByteLength]]"]>=0||d["[[CachedBufferByteLength]]"]==="DETACHED")&&w1(d["[[Object]]"])},T1=Ya,jv=Y.callBound,I1=jv("String.prototype.valueOf"),A1=function(d){try{return I1(d),!0}catch{return!1}},E1=jv("Object.prototype.toString"),C1="[object String]",P1=Y.requireShams()(),k1=function(d){return typeof d=="string"?!0:!d||typeof d!="object"?!1:P1?A1(d):E1(d)===C1},$v=Y.callBound,M1=$v("Number.prototype.toString"),z1=function(d){try{return M1(d),!0}catch{return!1}},B1=$v("Object.prototype.toString"),D1="[object Number]",L1=Y.requireShams()(),R1=function(d){return typeof d=="number"?!0:!d||typeof d!="object"?!1:L1?z1(d):B1(d)===D1},Zv=Y.callBound,F1=Zv("Boolean.prototype.toString"),O1=Zv("Object.prototype.toString"),V1=function(d){try{return F1(d),!0}catch{return!1}},U1="[object Boolean]",N1=Y.requireShams()(),q1=function(d){return typeof d=="boolean"?!0:d===null||typeof d!="object"?!1:N1?V1(d):O1(d)===U1},uf={exports:{}},Dy=typeof BigInt<"u"&&BigInt,j1=function(){return typeof Dy=="function"&&typeof BigInt=="function"&&typeof Dy(42)=="bigint"&&typeof BigInt(42)=="bigint"},$1=j1();if($1){var Z1=BigInt.prototype.valueOf,G1=function(d){try{return Z1.call(d),!0}catch{}return!1};uf.exports=function(d){return d===null||typeof d>"u"||typeof d=="boolean"||typeof d=="string"||typeof d=="number"||typeof d=="symbol"||typeof d=="function"?!1:typeof d=="bigint"?!0:G1(d)}}else uf.exports=function(d){return!1};var W1=uf.exports,H1=k1,X1=R1,K1=q1,J1=Cv(),Y1=W1,Q1=function(d){if(d==null||typeof d!="object"&&typeof d!="function")return null;if(H1(d))return"String";if(X1(d))return"Number";if(K1(d))return"Boolean";if(J1(d))return"Symbol";if(Y1(d))return"BigInt"},bf=typeof Map=="function"&&Map.prototype?Map:null,ew=typeof Set=="function"&&Set.prototype?Set:null,Mc;bf||(Mc=function(d){return!1});var Gv=bf?Map.prototype.has:null,Ly=ew?Set.prototype.has:null;!Mc&&!Gv&&(Mc=function(d){return!1});var tw=Mc||function(d){if(!d||typeof d!="object")return!1;try{if(Gv.call(d),Ly)try{Ly.call(d)}catch{return!0}return d instanceof bf}catch{}return!1},rw=typeof Map=="function"&&Map.prototype?Map:null,wf=typeof Set=="function"&&Set.prototype?Set:null,zc;wf||(zc=function(d){return!1});var Ry=rw?Map.prototype.has:null,Wv=wf?Set.prototype.has:null;!zc&&!Wv&&(zc=function(d){return!1});var iw=zc||function(d){if(!d||typeof d!="object")return!1;try{if(Wv.call(d),Ry)try{Ry.call(d)}catch{return!0}return d instanceof wf}catch{}return!1},Bc=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,Fy=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,Dc;Bc||(Dc=function(d){return!1});var cf=Bc?Bc.prototype.has:null,$h=Fy?Fy.prototype.has:null;!Dc&&!cf&&(Dc=function(d){return!1});var nw=Dc||function(d){if(!d||typeof d!="object")return!1;try{if(cf.call(d,cf),$h)try{$h.call(d,$h)}catch{return!0}return d instanceof Bc}catch{}return!1},pf={exports:{}},aw=Y.getIntrinsic,Hv=Y.callBound,ow=aw("%WeakSet%",!0),Zh=Hv("WeakSet.prototype.has",!0);if(Zh){var Gh=Hv("WeakMap.prototype.has",!0);pf.exports=function(d){if(!d||typeof d!="object")return!1;try{if(Zh(d,Zh),Gh)try{Gh(d,Gh)}catch{return!0}return d instanceof ow}catch{}return!1}}else pf.exports=function(d){return!1};var sw=pf.exports,lw=tw,uw=iw,cw=nw,pw=sw,hw=function(d){if(d&&typeof d=="object"){if(lw(d))return"Map";if(uw(d))return"Set";if(cw(d))return"WeakMap";if(pw(d))return"WeakSet"}return!1},fw=Y.callBound,dw=fw("WeakRef.prototype.deref",!0),mw=typeof WeakRef>"u"?function(d){return!1}:function(d){if(!d||typeof d!="object")return!1;try{return dw(d),!0}catch{return!1}},yw=Y.callBound,Oy=yw("FinalizationRegistry.prototype.register",!0),vw=Oy?function(d){if(!d||typeof d!="object")return!1;try{return Oy(d,{},null),!0}catch{return!1}}:function(d){return!1},Ql=function(){return typeof(function(){}).name=="string"},Yl=Object.getOwnPropertyDescriptor;if(Yl)try{Yl([],"length")}catch{Yl=null}Ql.functionsHaveConfigurableNames=function(){if(!Ql()||!Yl)return!1;var d=Yl(function(){},"name");return!!d&&!!d.configurable};var gw=Function.prototype.bind;Ql.boundFunctionsHaveNames=function(){return Ql()&&typeof gw=="function"&&(function(){}).bind().name!==""};var Xv=Ql,Kv=Y.isCallable,_w=Y.requireHasown(),xw=Xv(),Sf=Y.callBound,Jv=Sf("Function.prototype.toString"),Yv=Sf("String.prototype.match"),Wh=Sf("Object.prototype.toString"),bw=/^class /,ww=function(d){if(Kv(d)||typeof d!="function")return!1;try{var b=Yv(Jv(d),bw);return!!b}catch{}return!1},Sw=/\s*function\s+([^(\s]*)\s*/,Tw=!(0 in[,]),Iw="[object Object]",Aw="[object HTMLAllCollection]",Ew=Function.prototype,Qv=function(){return!1};if(typeof document=="object"){var Cw=document.all;Wh(Cw)===Wh(document.all)&&(Qv=function(d){if((Tw||!d)&&(typeof d>"u"||typeof d=="object"))try{var b=Wh(d);return(b===Aw||b===Iw)&&d("")==null}catch{}return!1})}var eg=function(){if(Qv(this)||!ww(this)&&!Kv(this))throw new TypeError("Function.prototype.name sham getter called on non-function");if(xw&&_w(this,"name"))return this.name;if(this===Ew)return"";var d=Jv(this),b=Yv(d,Sw),M=b&&b[1];return M},Pw=eg,tg=function(){return Pw},kw=eu.supportsDescriptors,Mw=Xv(),zw=tg,Vy=Object.defineProperty,Bw=TypeError,Dw=function(){var d=zw();if(Mw)return d;if(!kw)throw new Bw("Shimming Function.prototype.name support requires ES5 property descriptor support.");var b=Function.prototype;return Vy(b,"name",{configurable:!0,enumerable:!1,get:function(){var M=d.call(this);return this!==b&&Vy(this,"name",{configurable:!0,enumerable:!1,value:M,writable:!1}),M}}),d},Lw=eu,Rw=Y.callBindExports,rg=eg,Fw=tg,Ow=Dw,ig=Rw(rg);Lw(ig,{getPolyfill:Fw,implementation:rg,shim:Ow});var Vw=ig,Hh,Uy;function Uw(){if(Uy)return Hh;Uy=1;const m=(async function(){}).constructor;return Hh=()=>m,Hh}var ng=Y.callBound,Nw=Y.requireSafeRegexTest(),qw=ng("Object.prototype.toString"),jw=ng("Function.prototype.toString"),$w=Nw(/^\s*async(?:\s+function(?:\s+|\()|\s*\()/),Zw=Y.requireShams()(),Ny=Y.getProto,Gw=Uw(),Ww=function(d){if(typeof d!="function")return!1;if($w(jw(d)))return!0;if(!Zw){var b=qw(d);return b==="[object AsyncFunction]"}if(!Ny)return!1;var M=Gw();return M&&M.prototype===Ny(d)},Hw=Q1,Xw=hw,Kw=Y.whichTypedArray,Jw=Sv(),Yw=Ev,Qw=Y.isRegex,e2=mw,t2=vw,r2=Vw,i2=Y.isGeneratorFunction,n2=Ww,a2=Y.callBound,o2=Y.requireShams()(),Xh=o2&&Symbol.toStringTag,s2=Object,qy=a2("Promise.prototype.then",!0),l2=function(d){if(!d||typeof d!="object"||!qy)return!1;try{return qy(d,null,function(){}),!0}catch{}return!1},jy=function(d){return!!d&&d!=="BigInt"&&d!=="Boolean"&&d!=="Null"&&d!=="Number"&&d!=="String"&&d!=="Symbol"&&d!=="Undefined"&&d!=="Math"&&d!=="JSON"&&d!=="Reflect"&&d!=="Atomics"&&d!=="Map"&&d!=="Set"&&d!=="WeakMap"&&d!=="WeakSet"&&d!=="BigInt64Array"&&d!=="BigUint64Array"&&d!=="Float32Array"&&d!=="Float64Array"&&d!=="Int16Array"&&d!=="Int32Array"&&d!=="Int8Array"&&d!=="Uint16Array"&&d!=="Uint32Array"&&d!=="Uint8Array"&&d!=="Uint8ClampedArray"&&d!=="Array"&&d!=="Date"&&d!=="FinalizationRegistry"&&d!=="Promise"&&d!=="RegExp"&&d!=="WeakRef"&&d!=="Function"&&d!=="GeneratorFunction"&&d!=="AsyncFunction"},u2=function(d){if(d==null)return d;var b=Hw(s2(d))||Xw(d)||Kw(d);if(b)return b;if(Jw(d))return"Array";if(Yw(d))return"Date";if(Qw(d))return"RegExp";if(e2(d))return"WeakRef";if(t2(d))return"FinalizationRegistry";if(typeof d=="function")return i2(d)?"GeneratorFunction":n2(d)?"AsyncFunction":"Function";if(l2(d))return"Promise";if(Xh&&Xh in d){var M=d[Xh];if(jy(M))return M}if(typeof d.constructor=="function"){var O=r2(d.constructor);if(jy(O))return O}return"Object"},c2=Y.getIntrinsic,p2=Ov,h2=T1,f2=u2,d2=Y.type,$y=Y.getProto,m2=Y.esObjectAtoms,y2=function(d){if(!h2(d))throw new d2("Reflect.getPrototypeOf called on non-object");if($y)return $y(d);var b=f2(d);if(b){var M=c2("%"+b+".prototype%",!0);if(M)return M}return p2(d.constructor)?d.constructor.prototype:d instanceof Object?m2.prototype:null},v2=y2,Zy=Y.getProto,ag=function(){return typeof Reflect=="object"&&Reflect&&Reflect.getPrototypeOf?Reflect.getPrototypeOf:Zy?function(b){return Zy(b)}:v2},og=Y.forEach,g2=Y.callBindExports,_2=ag(),x2=Y.availableTypedArrays(),hf={__proto__:null},vc=Y.gopd,Gy=Object.defineProperty;if(vc){var b2=function(m){return m.byteOffset};og(x2,function(m){if(typeof Y.commonjsGlobal[m]=="function"||typeof Y.commonjsGlobal[m]=="object"){var d=Y.commonjsGlobal[m].prototype,b=vc(d,"byteOffset");if(!b){var M=_2(d);b=vc(M,"byteOffset")}if(b&&b.get)hf[m]=g2(b.get);else if(Gy){var O=new Y.commonjsGlobal[m](2);b=vc(O,"byteOffset"),b&&b.configurable&&Gy(O,"length",{value:3}),O.length===2&&(hf[m]=b2)}}})}var w2=function(d){var b;return og(hf,function(M){if(typeof b!="number")try{var O=M(d);typeof O=="number"&&(b=O)}catch{}}),b},S2=Y.isTypedArray,Tf=function(d){return S2(d)?w2(d):!1},T2=Y.callBindExports,sg=Y.forEach,gc=Y.gopd,I2=Y.isTypedArray,A2=Y.possibleTypedArrayNames,E2=ag(),ff={__proto__:null},Wy=Object.defineProperty;if(gc){var C2=function(m){return m.length};sg(A2,function(m){var d=Y.commonjsGlobal[m];if(typeof d=="function"||typeof d=="object"){var b=d.prototype,M=gc(b,"length");if(!M){var O=E2(b);M=gc(O,"length")}if(M&&M.get)ff["$"+m]=T2(M.get);else if(Wy){var G=new Y.commonjsGlobal[m](2);M=gc(G,"length"),M&&M.configurable&&Wy(G,"length",{value:3}),G.length===2&&(ff["$"+m]=C2)}}})}var P2=function(d){var b;return sg(ff,function(M){if(typeof b!="number")try{var O=M(d);typeof O=="number"&&(b=O)}catch{}}),b},lg=function(d){return I2(d)?P2(d):!1},Hy=Y.type,k2=Gs,M2=Nv,z2=_f,B2=qv,Xy=ru,D2=Tf,L2=lg,If=function(d){if(!B2(d))throw new Hy("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");var b=d["[[Object]]"],M=d["[[CachedBufferByteLength]]"];if(k2(Xy(b))&&M!=="DETACHED")throw new Hy("Assertion failed: typed array is detached only if the byte length is ~DETACHED~");if(M==="DETACHED")return!0;var O=D2(b),G=M2(Xy(b)),l,oe=G?L2(b):"AUTO";if(oe==="AUTO")l=M;else{var W=z2(b);l=O+oe*W}return O>M||l>M},_c=Y.type,R2=gf,F2=Nv,O2=If,V2=_f,U2=qv,N2=ru,q2=Tf,j2=lg,$2=function(d){if(!U2(d))throw new _c("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");if(O2(d))throw new _c("Assertion failed: `taRecord` is out of bounds");var b=d["[[Object]]"],M=F2(N2(b)),O=M?j2(b):"AUTO";if(O!=="AUTO")return O;if(M)throw new _c("Assertion failed: array buffer is not fixed length");var G=q2(b),l=V2(b),oe=d["[[CachedBufferByteLength]]"];if(oe==="DETACHED")throw new _c("Assertion failed: typed array is detached");return R2((oe-G)/l)},Kh=Y.type,Z2=Gs,G2=Zs,W2=tu,H2=gv,X2=Y.callBound,K2=X2("SharedArrayBuffer.prototype.byteLength",!0),J2=function(d,b){var M=W2(d);if(!G2(d)&&!M)throw new Kh("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(b!=="SEQ-CST"&&b!=="UNORDERED")throw new Kh("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if(Z2(d))throw new Kh("Assertion failed: `arrayBuffer` must not be detached");return M?K2(d):H2(d)},Ky=Y.type,Y2=J2,Q2=Gs,eS=Y.isTypedArray,tS=ru,rS=function(d,b){if(!eS(d))throw new Ky("Assertion failed: `obj` must be a Typed Array");if(b!=="SEQ-CST"&&b!=="UNORDERED")throw new Ky("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");var M=tS(d),O=Q2(M)?"DETACHED":Y2(M,b);return{"[[Object]]":d,"[[CachedBufferByteLength]]":O}},xc=Y.type,iS=Ya,nS=If,aS=rS,oS=Y.isTypedArray,ug=function(d,b){if(b!=="SEQ-CST"&&b!=="UNORDERED")throw new xc("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if(!iS(d))throw new xc("Assertion failed: `O` must be an Object");if(!oS(d))throw new xc("Assertion failed: `O` must be a Typed Array");var M=aS(d,b);if(nS(M))throw new xc("`O` must be in-bounds and backed by a non-detached buffer");return M},sS=Y.syntax,bc=Y.type,lS=vf,uS=Vv,cS=If,pS=$2,hS=ug,fS=Y.availableTypedArrays(),dS=function(d,b){if(!uS(d))throw new bc("Assertion failed: `constructor` must be a constructor");if(!lS(b))throw new bc("Assertion failed: `argumentList` must be a List");if(fS.length===0)throw new sS("Assertion failed: Typed Arrays are not supported in this environment");var M;b.length===0?M=new d:b.length===1?M=new d(b[0]):b.length===2?M=new d(b[0],b[1]):M=new d(b[0],b[1],b[2]);var O=hS(M,"SEQ-CST");if(b.length===1&&typeof b[0]=="number"){if(cS(O))throw new bc("new Typed Array is out of bounds");var G=pS(O);if(G<b[0])throw new bc("`argumentList[0]` must be <= `newTypedArray.length`")}return M},en=Y.getIntrinsic,mS={__proto__:null,$Int8Array:en("%Int8Array%",!0),$Uint8Array:en("%Uint8Array%",!0),$Uint8ClampedArray:en("%Uint8ClampedArray%",!0),$Int16Array:en("%Int16Array%",!0),$Uint16Array:en("%Uint16Array%",!0),$Int32Array:en("%Int32Array%",!0),$Uint32Array:en("%Uint32Array%",!0),$BigInt64Array:en("%BigInt64Array%",!0),$BigUint64Array:en("%BigUint64Array%",!0),$Float16Array:en("%Float16Array%",!0),$Float32Array:en("%Float32Array%",!0),$Float64Array:en("%Float64Array%",!0)},yS=function(d){return mS["$"+d]},Jy=Y.syntax,Yy=Y.type,vS=Y.whichTypedArray,gS=Y.availableTypedArrays(),_S=vf,xS=v1,bS=dS,wS=yS,SS=function(d,b){if(gS.length===0)throw new Jy("Assertion failed: Typed Arrays are not supported in this environment");var M=vS(d);if(!M)throw new Yy("Assertion failed: exemplar must be a TypedArray");if(!_S(b))throw new Yy("Assertion failed: `argumentList` must be a List");var O=wS(M);if(typeof O!="function")throw new Jy("Assertion failed: `constructor` of `exemplar` ("+M+") must exist. Please report this!");var G=xS(d,O);return bS(G,b)},TS=Y.type,IS=Qx,AS=q0,ES=Gs,Jh=Y.max,Qy=Y.min,CS=Z0,PS=Zb,ev=Kb,tv=Dv,kS=_f,rv=a1,MS=SS,zS=ug,Yh=ru,iv=Tf,cg=function(d,b){var M=this;zS(M,"SEQ-CST");var O=M.length,G=ev(d),l;G===-1/0?l=0:G<0?l=Jh(O+G,0):l=Qy(G,O);var oe=typeof b>"u"?O:ev(b),W;oe===-1/0?W=0:oe<0?W=Jh(O+oe,0):W=Qy(oe,O);var ve=Jh(W-l,0),me=MS(M,[ve]);if(ve>0){if(ES(Yh(M)))throw new TS("Cannot use a Typed Array with an underlying ArrayBuffer that is detached");var Le=rv(M),le=rv(me);if(Le===le)for(var ge=Yh(M),Re=Yh(me),Ye=kS(M),je=iv(M),It=l*Ye+je,tt=iv(me),dt=tt+ve*Ye;tt<dt;){var Dt=AS(ge,It,"UINT8",!0,"UNORDERED");PS(Re,tt,"UINT8",Dt,!0,"UNORDERED"),It+=1,tt+=1}else for(var Xt=0;l<W;){var Kt=tv(l),ur=IS(M,Kt);CS(me,tv(Xt),ur,!0),l+=1,Xt+=1}}return me},BS=cg,pg=function(){return typeof Uint8Array=="function"&&Uint8Array.prototype.slice||BS},DS=eu,LS=Y.getProto,RS=pg,FS=function(){if(typeof Uint8Array=="function"){var d=RS(),b=LS(Uint8Array.prototype);DS(b,{slice:d},{slice:function(){return b.slice!==d}})}return d},OS=eu,VS=Y.callBindExports,US=cg,hg=pg,NS=FS,fg=VS(hg());OS(fg,{getPolyfill:hg,implementation:US,shim:NS});var qS=fg,dg=Y.whichTypedArray,mg=qS,nv=Y.gopd;function Xs(m){return Object.prototype.toString.call(m)}function jS(m){return Xs(m)==="[object Date]"}function $S(m){return Xs(m)==="[object RegExp]"}function ZS(m){return Xs(m)==="[object Error]"}function GS(m){return Xs(m)==="[object Boolean]"}function WS(m){return Xs(m)==="[object Number]"}function HS(m){return Xs(m)==="[object String]"}var yg=Array.isArray||function(d){return Object.prototype.toString.call(d)==="[object Array]"};function Oc(m,d){if(m.forEach)return m.forEach(d);for(var b=0;b<m.length;b++)d(m[b],b,m)}var Vc=Object.keys||function(d){var b=[];for(var M in d)b[b.length]=M;return b},XS=Object.prototype.propertyIsEnumerable,av=Object.getOwnPropertySymbols;function Uc(m){var d=Vc(m);if(av)for(var b=av(m),M=0;M<b.length;M++)XS.call(m,b[M])&&(d[d.length]=b[M]);return d}var Nc=Object.prototype.hasOwnProperty||function(m,d){return d in m};function KS(m,d){if(typeof nv!="function")return!0;var b=nv(m,d);return!b||!b.writable}function vg(m,d){if(typeof m=="object"&&m!==null){var b;if(yg(m))b=[];else if(jS(m))b=new Date(m.getTime?m.getTime():m);else if($S(m))b=new RegExp(m);else if(ZS(m))b={message:m.message};else if(GS(m)||WS(m)||HS(m))b=Object(m);else{var M=dg(m);if(M)return mg(m);if(Object.create&&Object.getPrototypeOf)b=Object.create(Object.getPrototypeOf(m));else if(m.constructor===Object)b={};else{var O=m.constructor&&m.constructor.prototype||m.__proto__||{},G=function(){};G.prototype=O,b=new G}}var l=d.includeSymbols?Uc:Vc;return Oc(l(m),function(oe){b[oe]=m[oe]}),b}return m}var Af={__proto__:null};function gg(m,d){var b=[],M=[],O=!0,G=arguments.length>2?arguments[2]:Af,l=G.includeSymbols?Uc:Vc,oe=!!G.immutable;return function W(ve){var me=oe?vg(ve,G):ve,Le={__proto__:null},le=!0,ge={node:me,node_:ve,path:[].concat(b),parent:M[M.length-1],parents:M,key:b[b.length-1],removedKeys:{__proto__:null},isRoot:b.length===0,level:b.length,circular:null,update:function(je,It){ge.isRoot||(ge.parent.node[ge.key]=je),ge.node=je,It&&(le=!1)},delete:function(je){delete ge.parent.node[ge.key],ge.parent.removedKeys[ge.key]=!0,je&&(le=!1)},remove:function(je){yg(ge.parent.node)?(ge.parent.node.splice(ge.key,1),ge.parent.removedKeys[ge.key]=!0,je&&(le=!1)):ge.delete(je)},keys:null,before:function(je){Le.before=je},after:function(je){Le.after=je},pre:function(je){Le.pre=je},post:function(je){Le.post=je},stop:function(){O=!1},block:function(){le=!1}};if(!O)return ge;function Re(){if(typeof ge.node=="object"&&ge.node!==null){(!ge.keys||ge.node_!==ge.node)&&(ge.keys=l(ge.node)),ge.isLeaf=ge.keys.length===0;for(var je=0;je<M.length;je++)if(M[je].node_===ve){ge.circular=M[je];break}}else ge.isLeaf=!0,ge.keys=null;ge.notLeaf=!ge.isLeaf,ge.notRoot=!ge.isRoot}Re();var Ye=d.call(ge,ge.node);return Ye!==void 0&&ge.update&&ge.update(Ye),Le.before&&Le.before.call(ge,ge.node),le&&(typeof ge.node=="object"&&ge.node!==null&&!ge.circular&&(M[M.length]=ge,Re(),Oc(ge.keys,function(je,It){var tt=It-1 in ge.removedKeys;tt&&(je=ge.keys[It-1]),b[b.length]=je,Le.pre&&Le.pre.call(ge,ge.node[je],je);var dt=W(ge.node[je]);oe&&Nc.call(ge.node,je)&&!KS(ge.node,je)&&!tt&&(ge.node[je]=dt.node),dt.isLast=It===ge.keys.length-1,dt.isFirst=It===0,Le.post&&Le.post.call(ge,dt),b.pop()}),M.pop()),Le.after&&Le.after.call(ge,ge.node)),ge}(m).node}function tn(m){this.options=arguments.length>1?arguments[1]:Af,this.value=m}tn.prototype.get=function(m){for(var d=this.value,b=0;d&&b<m.length;b++){var M=m[b];if(!Nc.call(d,M)||!this.options.includeSymbols&&typeof M=="symbol")return;d=d[M]}return d};tn.prototype.has=function(m){var d=this.value;if(!d&&m.length>0)return!1;for(var b=0;d&&b<m.length;b++){var M=m[b];if(!Nc.call(d,M)||!this.options.includeSymbols&&typeof M=="symbol")return!1;d=d[M]}return!0};tn.prototype.set=function(m,d){for(var b=this.value,M=0;M<m.length-1;M++){var O=m[M];Nc.call(b,O)||(b[O]={}),b=b[O]}return b[m[M]]=d,d};tn.prototype.map=function(m){return gg(this.value,m,{__proto__:null,immutable:!0,includeSymbols:!!this.options.includeSymbols})};tn.prototype.forEach=function(m){return this.value=gg(this.value,m,this.options),this.value};tn.prototype.reduce=function(m,d){var b=arguments.length===1,M=b?this.value:d;return this.forEach(function(O){(!this.isRoot||!b)&&(M=m.call(this,M,O))}),M};tn.prototype.paths=function(){var m=[];return this.forEach(function(){m[m.length]=this.path}),m};tn.prototype.nodes=function(){var m=[];return this.forEach(function(){m[m.length]=this.node}),m};tn.prototype.clone=function(){var m=[],d=[],b=this.options;return dg(this.value)?mg(this.value):function M(O){for(var G=0;G<m.length;G++)if(m[G]===O)return d[G];if(typeof O=="object"&&O!==null){var l=vg(O,b);m[m.length]=O,d[d.length]=l;var oe=b.includeSymbols?Uc:Vc;return Oc(oe(O),function(W){l[W]=M(O[W])}),m.pop(),d.pop(),l}return O}(this.value)};function _g(m){var d=arguments.length>1?arguments[1]:Af;return new tn(m,d)}Oc(Uc(tn.prototype),function(m){_g[m]=function(d){var b=[].slice.call(arguments,1),M=new tn(d);return M[m].apply(M,b)}});var JS=_g,YS=vi;function vi(m){if(!(this instanceof vi))return new vi(m);this._bbox=m||[1/0,1/0,-1/0,-1/0],this._valid=!!m}vi.prototype.include=function(m){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],m[0]),this._bbox[1]=Math.min(this._bbox[1],m[1]),this._bbox[2]=Math.max(this._bbox[2],m[0]),this._bbox[3]=Math.max(this._bbox[3],m[1]),this};vi.prototype.equals=function(m){var d;return m instanceof vi?d=m.bbox():d=m,this._bbox[0]==d[0]&&this._bbox[1]==d[1]&&this._bbox[2]==d[2]&&this._bbox[3]==d[3]};vi.prototype.center=function(m){return this._valid?[(this._bbox[0]+this._bbox[2])/2,(this._bbox[1]+this._bbox[3])/2]:null};vi.prototype.union=function(m){this._valid=!0;var d;return m instanceof vi?d=m.bbox():d=m,this._bbox[0]=Math.min(this._bbox[0],d[0]),this._bbox[1]=Math.min(this._bbox[1],d[1]),this._bbox[2]=Math.max(this._bbox[2],d[2]),this._bbox[3]=Math.max(this._bbox[3],d[3]),this};vi.prototype.bbox=function(){return this._valid?this._bbox:null};vi.prototype.contains=function(m){if(!m)return this._fastContains();if(!this._valid)return null;var d=m[0],b=m[1];return this._bbox[0]<=d&&this._bbox[1]<=b&&this._bbox[2]>=d&&this._bbox[3]>=b};vi.prototype.intersect=function(m){if(!this._valid)return null;var d;return m instanceof vi?d=m.bbox():d=m,!(this._bbox[0]>d[2]||this._bbox[2]<d[0]||this._bbox[3]<d[1]||this._bbox[1]>d[3])};vi.prototype._fastContains=function(){if(!this._valid)return new Function("return null;");var m="return "+this._bbox[0]+"<= ll[0] &&"+this._bbox[1]+"<= ll[1] &&"+this._bbox[2]+">= ll[0] &&"+this._bbox[3]+">= ll[1]";return new Function("ll",m)};vi.prototype.polygon=function(){return this._valid?{type:"Polygon",coordinates:[[[this._bbox[0],this._bbox[1]],[this._bbox[2],this._bbox[1]],[this._bbox[2],this._bbox[3]],[this._bbox[0],this._bbox[3]],[this._bbox[0],this._bbox[1]]]]}:null};var QS=cx,eT=JS,tT=YS,xg={features:["FeatureCollection"],coordinates:["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],geometry:["Feature"],geometries:["GeometryCollection"]},rT=Object.keys(xg);Lc.exports=function(m){return Ef(m).bbox()};Lc.exports.polygon=function(m){return Ef(m).polygon()};Lc.exports.bboxify=function(m){return eT(m).map(function(d){if(d){var b=rT.some(function(M){return d[M]?xg[M].indexOf(d.type)!==-1:!1});b&&(d.bbox=Ef(d).bbox(),this.update(d))}})};function Ef(m){for(var d=tT(),b=QS(m),M=0;M<b.length;M++)d.include(b[M]);return d}var iT=Lc.exports;const nT=Y.getDefaultExportFromCjs(iT),aT={methods:{getIconDetails(m){const d={};switch(m){case"cities":d.name="fa-regular fa-city";break;case"towns":d.name="fa-regular fa-house-chimney-window";break;case"islands":d.name="fa-regular fa-ship";break;case"regions":d.name="fa-regular fa-map-location-dot";break;case"national-parks":d.name="fa-kit fa-vs-icon-national-park";break;case"acco":d.name="fa-regular fa-bed";break;case"acti":d.name="fa-regular fa-person-walking";break;case"attr":d.name="fa-regular fa-camera";break;case"even":d.name="fa-regular fa-ticket";break;case"cate":d.name="fa-regular fa-utensils";break;case"reta":d.name="fa-regular fa-bag-shopping";break;case"featured":d.name="fa-solid fa-star";break;case"twnv":d.name="";break;case"vics":d.name="fa-kit fa-vs-icentre-information";break;case"outlander-castle":d.name="fa-regular fa-chess-rook";break;case"outlander-church-abbey":d.name="fa-regular fa-church";break;case"outlander-city-town-village":d.name="fa-regular fa-city";break;case"outlander-heritage":d.name="fa-regular fa-landmark";break;case"outlander-landscape-park":d.name="fa-regular fa-mountain";break;case"outlander-palace-house":d.name="fa-regular fa-crown";break;case"distilleries":d.name="fa-kit fa-vs-distillery";break;case"itinerary-stop":d.name="";break}return d}}},oT={name:"VsMapMarkerIcon",status:"prototype",release:"0.0.1",components:{VsIcon:Y.VsIcon},mixins:[aT],props:{id:{type:String,required:!0},isHovered:{type:Boolean,default:!1},number:{type:String,default:""},isMapMarker:{type:Boolean,default:!1}},computed:{mapMarkerType(){let m="fa-solid fa-location-pin";return this.id==="twnv"&&(m="fa-solid fa-location-dot"),m},parentClasses(){return this.isMapMarker?"vs-map-marker-icon--map-marker":""},markerClasses(){return[`vs-map-marker-icon__marker--${this.id}`,this.isHovered?"vs-map-marker-icon__marker--outline":""]}}},sT={key:0,class:"vs-map-marker-icon__count"};function lT(m,d,b,M,O,G){const l=R.resolveComponent("VsIcon");return R.openBlock(),R.createElementBlock("div",{"data-test":"vs-map-marker-icon",class:R.normalizeClass(["vs-map-marker-icon",G.parentClasses])},[R.createVNode(l,{icon:G.mapMarkerType,class:R.normalizeClass(["vs-map-marker-icon__marker",G.markerClasses]),size:"xl"},null,8,["icon","class"]),b.number?(R.openBlock(),R.createElementBlock("span",sT,[d[0]||(d[0]=R.createElementVNode("span",{class:"visually-hidden"}," Stop ",-1)),R.createTextVNode(" "+R.toDisplayString(b.number),1)])):(R.openBlock(),R.createBlock(l,{key:1,class:"vs-map-marker-icon__icon",icon:m.getIconDetails(b.id).name,size:"xs"},null,8,["icon"]))],2)}const qc=Y._export_sfc(oT,[["render",lT]]);let Vo=null;const uT={name:"VsMapMarker",status:"prototype",release:"0.0.1",components:{VsMapMarkerIcon:qc},props:{feature:{type:Object,required:!0},mapId:{type:String,required:!0},hasPopups:{type:Boolean,required:!0},selectedPlace:{type:String,default:null}},emits:["showDetail","setCategory"],setup(){Vo=$i()},computed:{isActive(){return!!(this.activePlace&&this.activePlace.properties&&this.activePlace.properties.id===this.feature.properties.id||this.highlightedPlace&&this.highlightedPlace.properties&&this.highlightedPlace.properties.id===this.feature.properties.id)},...Ka.mapState($i,{highlightedPlace(m){return m.getHoveredStop(this.mapId)},activePlace(m){return m.getActivePlace(this.mapId)?m.getActivePlace(this.mapId):""},activeSubcat(m){return m.selectedSubCategory}}),getMarkerIcon(){let m;return this.feature.properties.type!==""?m=this.feature.properties.type:this.activeSubcat!==null?m=this.activeSubcat:m="featured",m==="null"&&(m=""),m}},watch:{isActive(){return this.activePlace&&this.activePlace.properties.id===this.feature.properties.id||this.highlightedPlace&&this.highlightedPlace.properties.id===this.feature.properties.id?!0:(this.activePlace&&this.activePlace.properties.id===this.feature.properties.id&&Vo.setActiveMarkerPos(this.feature.geometry.coordinates),!1)},activePlace(){this.activePlace&&this.activePlace.properties.id===this.feature.properties.id&&Vo.setActiveMarkerPos(this.feature.geometry.coordinates)}},mounted(){this.hasPopups&&document.body.addEventListener("click",this.handleClickEvent)},beforeUnmount(){document.body.removeEventListener("click",this.handleClickEvent)},methods:{markerClick(){Vo.setActiveMarkerPos(this.feature.geometry.coordinates),Vo.setActivePlace({mapId:this.mapId,activeFeature:this.feature}),this.$emit("showDetail",this.feature),this.$emit("setCategory",this.feature.properties.type)},handleHover(m){Vo.setHoveredPlace({mapId:this.mapId,hoveredFeature:m})},handleClickEvent(m){const d=document.getElementsByClassName("mapboxgl-canvas");m.target===d[0]&&Vo.setActivePlace({mapId:this.mapId,activeFeature:null})}}},cT=["aria-label"];function pT(m,d,b,M,O,G){const l=R.resolveComponent("VsMapMarkerIcon");return R.openBlock(),R.createElementBlock("button",{type:"button",class:R.normalizeClass(["vs-map-marker",G.isActive?"vs-map-marker--active":""]),"data-test":"vs-map-marker",onClick:d[0]||(d[0]=(...oe)=>G.markerClick&&G.markerClick(...oe)),onKeydown:d[1]||(d[1]=R.withKeys((...oe)=>G.markerClick&&G.markerClick(...oe),["enter"])),onMouseover:d[2]||(d[2]=oe=>G.handleHover(b.feature)),onMouseleave:d[3]||(d[3]=oe=>G.handleHover("")),onFocusin:d[4]||(d[4]=oe=>G.handleHover(b.feature)),onFocusout:d[5]||(d[5]=oe=>G.handleHover("")),"aria-label":G.getMarkerIcon},[R.createVNode(l,{id:G.getMarkerIcon,"is-map-marker":!0,number:b.feature.properties.stopCount?b.feature.properties.stopCount:""},null,8,["id","number"])],42,cT)}const bg=Y._export_sfc(uT,[["render",pT]]);let js=null;const hT={name:"VsMap",status:"prototype",release:"0.0.1",components:{VsWarning:Y.VsWarning,VsLoading:Y.VsLoading},props:{overviewMapLatitude:{type:String,default:"57.81"},overviewMapLongitude:{type:String,default:"-5.51748"},overviewMapZoom:{type:String,default:"5"},mapId:{type:String,required:!0},isVisible:{type:Boolean,required:!0},places:{type:Array,required:!0},filters:{type:Array,default(){return[]}},fitToMarkers:{type:Boolean,default:!1},showPolygons:{type:Boolean,default:!1},selectedItem:{type:Object,default:null},boundsData:{type:Object,default:()=>{}},showInfoMessage:{type:Boolean,default:null},resetZoom:{type:Boolean,default:!1},showMarkerPopups:{type:Boolean,default:!0},loadBrandingImmediately:{type:Boolean,default:!1}},emits:["map-ready","setCategory","showDetail","zoom-reset"],setup(){js=$i()},data(){return{isDesktop:!1,geojsonData:{type:"FeatureCollection",features:[]},polygons:{type:"FeatureCollection",features:[]},multiPolygons:[],mapbox:{map:null,bounds:null,rotation:0,config:{container:this.$refs.mapbox,style:"https://api.visitscotland.com/maps/vector/v1/vts/resources/styles",pitchWithRotate:!1,dragRotate:!1}},markers:[],popup:null,hoveredStateId:null,activeStateId:null,showMapMessage:!0,isLoading:!0,showZoomMessage:null}},computed:{getZoom(){return this.mapbox.map?this.mapbox.map.getZoom():null},...Ka.mapState($i,{activeMarkerPostion(m){return this.mapbox.map?m.activeMarkerPos:null},highlightedPlace(m){return this.mapbox.map?m.getHoveredStop(this.mapId):null},activePlace(m){return this.mapbox.map?m.getActivePlace(this.mapId):null}})},watch:{isVisible(m){m&&this.mapbox.map!==null&&setTimeout(()=>{this.mapbox.map.resize()},20)},places:{handler(){this.geojsonData.features=[],this.initialiseMapFeatures(),this.initialiseMapMarkers()},deep:!0},showPolygons(m){m===!0?this.showMapPolygons():this.hideMapPolygons()},highlightedPlace(m){m&&(m.length===0?this.removeHoveredPolygon():m.geometry.type!=="Point"&&this.addHoveredPolygon(m))},selectedItem(m){if(m&&m.geometry.type!=="Point"){let d=[];d=this.polygons.features.filter(b=>b.properties.id===m.properties.id),d.length>0&&this.addActivePolygon(m)}m||this.removeActivePolygon()},activeMarkerPostion(m){this.checkPointIsVisible(m)||this.centreMapOnPoint(m)},showInfoMessage(m){m?this.showMapMessage=!0:this.showMapMessage=!1},resetZoom(m){m&&(this.mapbox.map.fitBounds(this.calculateBoundingBox()),this.$emit("zoom-reset"),this.showInfoMessage&&(this.showMapMessage=!0))}},mounted(){js.addMapInstance({id:this.mapId,filters:this.filters,places:this.places,activePins:this.places}),this.lazyloadMapComponent(),this.isTablet=window.innerWidth>=768,window.addEventListener("resize",this.onResize),this.loadBrandingImmediately?Hd.init({div:this.mapId}):window.addEventListener("DOMContentLoaded",()=>{Hd.init({div:this.mapId})})},methods:{addMap(){const m=this.calculateBoundingBox();this.mapbox.config.container=this.$refs.mapbox,this.mapbox.map=new Un.Map({container:this.$refs.mapbox,style:"https://api.visitscotland.com/maps/vector/v1/vts/resources/styles",bounds:m,maxZoom:18,minZoom:4,trackResize:!0}),this.mapbox.map.scrollZoom.disable(),this.mapbox.map.on("rotate",()=>{this.mapbox.rotation=this.mapbox.map.transform.angle}),this.mapbox.map.resize(),this.mapbox.map.on("load",()=>{this.addMapPolygons(),this.showMapMessage=!1,this.isLoading=!1,this.$emit("map-ready",!0),this.mapbox.map.boxZoom.enable()}),this.mapbox.map.on("zoomend",()=>{this.mapbox.map.getZoom()===4?(this.showZoomMessage="too-far",this.showMapMessage=!0):this.mapbox.map.getZoom()===18?(this.showZoomMessage="too-close",this.showMapMessage=!0):this.showInfoMessage||(this.showZoomMessage=null,this.showMapMessage=!1)})},addMapControls(){const m=new Un.NavigationControl;this.mapbox.map.addControl(m,"top-right"),this.mapbox.map.addControl(new Un.FullscreenControl)},initialiseMapFeatures(){this.places.map(m=>{if(typeof m.geometry<"u"){const d=this.getCoordinateArray(m);return this.getMapFeatures(m,d)}return m.latitude&&m.longitude?this.getItineraryMapFeatures(m):!1})},getCoordinateArray(m){return m.geometry.type==="Polygon"?[m.geometry.coordinates[0]]:m.geometry.type==="MultiPolygon"?[m.geometry.coordinates]:[m.geometry.coordinates[0],m.geometry.coordinates[1]]},getMapFeatures(m,d){return this.geojsonData.features.push({type:"Feature",geometry:{type:m.geometry.type,coordinates:d},properties:{title:m.properties.title,imageSrc:m.image,type:typeof m.properties.category<"u"?m.properties.category.id:"",id:m.properties.id},id:m.properties.id})},getItineraryMapFeatures(m){const d=this._uid;return this.geojsonData.features.push({type:"Feature",geometry:{type:"Point",coordinates:[parseFloat(m.longitude),parseFloat(m.latitude)]},properties:{title:m.title,imageSrc:m.imageSrc,type:"itinerary-stop",stopCount:m.stopCount,id:d},id:d})},initialiseMapMarkers(){let m=0;this.initialLoad&&(m=1e3),setTimeout(()=>{if(this.markers!==null){for(let d=this.markers.length-1;d>=0;d--)this.markers[d].remove();this.markers=[]}this.geojsonData.features.forEach(d=>{d.geometry.type==="Point"&&this.createMapMarker(d)})},m)},createMapMarker(m){const d=R.h(bg,{feature:m,mapId:this.mapId,hasPopups:this.showMarkerPopups,onShowDetail:O=>{this.$emit("showDetail",O)},onSetCategory:O=>{this.$emit("setCategory",O)}}),b=document.createElement("div");this.$refs.mapboxOuter.appendChild(b),R.render(d,b),m&&this.showMarkerPopups&&this.addMapPopup(m);const M=new Un.Marker(b.children[0]).setLngLat(m.geometry.coordinates).setPopup(this.popup).addTo(this.mapbox.map);this.setupMarkerListeners(M),this.markers.push(M),b.remove()},hideMapPolygons(){this.mapbox.map.setLayoutProperty("regionFills","visibility","none"),this.mapbox.map.setLayoutProperty("regionBorders","visibility","none")},showMapPolygons(){this.mapbox.map.setLayoutProperty("regionFills","visibility","visible"),this.mapbox.map.setLayoutProperty("regionBorders","visibility","visible")},addMapPolygons(){this.geojsonData.features.forEach(m=>{m.geometry.type==="Polygon"?this.polygons.features.includes(m.properties.id)||this.polygons.features.push(m):m.geometry.type==="MultiPolygon"&&(this.polygons.features.includes(m.properties.id)||this.multiPolygons.push(m))}),this.multiPolygons.forEach(m=>{const d=m.properties;m.geometry.coordinates[0].forEach(b=>{this.polygons.features.push({geometry:{type:"Polygon",coordinates:b},id:d.id,properties:{id:d.id,imageSrc:d.imageSrc,title:d.title,type:d.type},type:"Feature"})})}),this.polygons.features.length>0&&(this.mapbox.map.addSource("regions",{type:"geojson",data:this.polygons,promoteId:"id"}),this.mapbox.map.addLayer({id:"regionFills",type:"fill",source:"regions",layout:{},paint:{"fill-color":["case",["==",["feature-state","interaction-state"],"hover"],"rgba(168,48,140,0.5)",["==",["feature-state","interaction-state"],"active"],"rgba(168,48,140,0.5)","rgba(25,200,197,0.6)"],"fill-opacity":.8}}),this.mapbox.map.addLayer({id:"regionBorders",type:"line",source:"regions",layout:{},paint:{"line-color":"#fff","line-width":1}}),this.hideMapPolygons(),this.mapbox.map.on("mousemove","regionFills",m=>{m.features.length>0&&(this.addMapPopup(m),this.removeHoveredPolygon(),this.addHoveredPolygon(m.features[0]))}),this.mapbox.map.on("mouseleave","regionFills",m=>{this.removeMapPopup(m),this.removeHoveredPolygon()}),this.mapbox.map.on("click","regionFills",m=>{this.removeActivePolygon(),this.addActivePolygon(m.features[0]),this.addMapPopup(m.features[0])}))},removeActivePolygon(){this.mapbox.map.style._layers.regionFills&&(this.mapbox.map.setFeatureState({source:"regions",id:this.activeStateId},{"interaction-state":""}),this.activeStateId=null)},addActivePolygon(m){this.activeStateId=m.properties.id,this.mapbox.map.setFeatureState({source:"regions",id:this.activeStateId},{"interaction-state":"active"}),js.setActivePlace({mapId:this.mapId,activeFeature:m}),this.$emit("showDetail",m),this.$emit("setCategory","regions")},removeHoveredPolygon(){if(this.hoveredStateId){let m="";this.hoveredStateId===this.activeStateId&&(m="active"),this.mapbox.map.setFeatureState({source:"regions",id:this.hoveredStateId},{"interaction-state":m})}js.setHoveredPlace({mapId:this.mapId,hoveredFeature:""}),this.hoveredStateId=null},addHoveredPolygon(m){this.hoveredStateId=m.properties.id,this.mapbox.map.setFeatureState({source:"regions",id:this.hoveredStateId},{"interaction-state":"hover"}),this.addMapPopup(m),js.setHoveredPlace({mapId:this.mapId,hoveredFeature:m})},addMapPopup(m){let d="";m.features?d=m.features[0]:d=m;const b=this.getCoordinates(d),M=this.getPopupHtml(d);d.properties.id&&(this.removeMapPopup(m),this.popup=new Un.Popup({closeButton:!1,offset:{top:[0,20],bottom:[0,-40],left:[30,-20],right:[-30,-20]}}).setLngLat(b).setHTML(M).addTo(this.mapbox.map))},removeMapPopup(m){this.popup&&(this.popup.remove(),this.popup=null),m._popup&&m._popup.remove()},getCoordinates(m){return m.geometry.type==="Polygon"?this.findFeatureCentre(m.geometry.coordinates):m.geometry.type==="MultiPolygon"?this.findFeatureCentre(m.geometry.coordinates[0]):m.geometry.coordinates},findFeatureCentre(m){const d=[],b=[];return m[0].forEach(M=>{d.push(M[1]),b.push(M[0])}),{lat:(Math.min(...d)+Math.max(...d))/2,lng:(Math.min(...b)+Math.max(...b))/2}},getPopupHtml(m){return m.properties.imageSrc&&m.properties.stopCount?`
|
|
497
|
+
`),ie=y.createShader(y.FRAGMENT_SHADER);if(y.isContextLost())this.failedToCreate=!0;else{y.shaderSource(ie,X),y.compileShader(ie),y.attachShader(this.program,ie);var pe=y.createShader(y.VERTEX_SHADER);if(y.isContextLost())this.failedToCreate=!0;else{y.shaderSource(pe,ee),y.compileShader(pe),y.attachShader(this.program,pe),this.attributes={};var ue={};this.numAttributes=A.length;for(var he=0;he<this.numAttributes;he++)A[he]&&(y.bindAttribLocation(this.program,he,A[he]),this.attributes[A[he]]=he);y.linkProgram(this.program),y.deleteShader(pe),y.deleteShader(ie);for(var _e=0;_e<L.length;_e++){var Ie=L[_e];if(Ie&&!ue[Ie]){var Te=y.getUniformLocation(this.program,Ie);Te&&(ue[Ie]=Te)}}this.fixedUniforms=p(i,ue),this.binderUniforms=s?s.getUniforms(i,ue):[]}}};function yu(i,a,n){var s=1/Zt(n,1,a.transform.tileZoom),p=Math.pow(2,n.tileID.overscaledZ),d=n.tileSize*Math.pow(2,a.transform.tileZoom)/p,y=d*(n.tileID.canonical.x+n.tileID.wrap*p),g=d*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[s,i.fromScale,i.toScale],u_fade:i.t,u_pixel_coord_upper:[y>>16,g>>16],u_pixel_coord_lower:[65535&y,65535&g]}}mu.prototype.draw=function(i,a,n,s,p,d,y,g,w,A,z,D,L,$,q,K){var V,X=i.gl;if(!this.failedToCreate){for(var ee in i.program.set(this.program),i.setDepthMode(n),i.setStencilMode(s),i.setColorMode(p),i.setCullFace(d),this.fixedUniforms)this.fixedUniforms[ee].set(y[ee]);$&&$.setUniforms(i,this.binderUniforms,D,{zoom:L});for(var ie=(V={},V[X.LINES]=2,V[X.TRIANGLES]=3,V[X.LINE_STRIP]=1,V)[a],pe=0,ue=z.get();pe<ue.length;pe+=1){var he=ue[pe],_e=he.vaos||(he.vaos={});(_e[g]||(_e[g]=new Jo)).bind(i,this,w,$?$.getPaintVertexBuffers():[],A,he.vertexOffset,q,K),X.drawElements(a,he.primitiveLength*ie,X.UNSIGNED_SHORT,he.primitiveOffset*ie*2)}}};var vu=function(i,a,n,s){var p=a.style.light,d=p.properties.get("position"),y=[d.x,d.y,d.z],g=l.create$1();p.properties.get("anchor")==="viewport"&&l.fromRotation(g,-a.transform.angle),l.transformMat3(y,y,g);var w=p.properties.get("color");return{u_matrix:i,u_lightpos:y,u_lightintensity:p.properties.get("intensity"),u_lightcolor:[w.r,w.g,w.b],u_vertical_gradient:+n,u_opacity:s}},ea=function(i,a,n,s,p,d,y){return l.extend(vu(i,a,n,s),yu(d,a,y),{u_height_factor:-Math.pow(2,p.overscaledZ)/y.tileSize/8})},In=function(i){return{u_matrix:i}},ta=function(i,a,n,s){return l.extend(In(i),yu(n,a,s))},gu=function(i,a){return{u_matrix:i,u_world:a}},_u=function(i,a,n,s,p){return l.extend(ta(i,a,n,s),{u_world:p})},ol=function(i,a,n,s){var p,d,y=i.transform;if(s.paint.get("circle-pitch-alignment")==="map"){var g=Zt(n,1,y.zoom);p=!0,d=[g,g]}else p=!1,d=y.pixelsToGLUnits;return{u_camera_to_center_distance:y.cameraToCenterDistance,u_scale_with_map:+(s.paint.get("circle-pitch-scale")==="map"),u_matrix:i.translatePosMatrix(a.posMatrix,n,s.paint.get("circle-translate"),s.paint.get("circle-translate-anchor")),u_pitch_with_map:+p,u_device_pixel_ratio:l.browser.devicePixelRatio,u_extrude_scale:d}},ra=function(i,a,n){var s=Zt(n,1,a.zoom),p=Math.pow(2,a.zoom-n.tileID.overscaledZ),d=n.tileID.overscaleFactor();return{u_matrix:i,u_camera_to_center_distance:a.cameraToCenterDistance,u_pixels_to_tile_units:s,u_extrude_scale:[a.pixelsToGLUnits[0]/(s*p),a.pixelsToGLUnits[1]/(s*p)],u_overscale_factor:d}},xu=function(i,a,n){return{u_matrix:i,u_inv_matrix:a,u_camera_to_center_distance:n.cameraToCenterDistance,u_viewport_size:[n.width,n.height]}},ia=function(i,a,n){return n===void 0&&(n=1),{u_matrix:i,u_color:a,u_overlay:0,u_overlay_scale:n}},na=function(i){return{u_matrix:i}},bu=function(i,a,n,s){return{u_matrix:i,u_extrude_scale:Zt(a,1,n),u_intensity:s}},fo=function(i,a,n){var s=i.transform;return{u_matrix:wu(i,a,n),u_ratio:1/Zt(a,1,s.zoom),u_device_pixel_ratio:l.browser.devicePixelRatio,u_units_to_pixels:[1/s.pixelsToGLUnits[0],1/s.pixelsToGLUnits[1]]}},Ut=function(i,a,n,s){return l.extend(fo(i,a,n),{u_image:0,u_image_height:s})},Yo=function(i,a,n,s){var p=i.transform,d=Ba(a,p);return{u_matrix:wu(i,a,n),u_texsize:a.imageAtlasTexture.size,u_ratio:1/Zt(a,1,p.zoom),u_device_pixel_ratio:l.browser.devicePixelRatio,u_image:0,u_scale:[d,s.fromScale,s.toScale],u_fade:s.t,u_units_to_pixels:[1/p.pixelsToGLUnits[0],1/p.pixelsToGLUnits[1]]}},Jc=function(i,a,n,s,p){var d=i.lineAtlas,y=Ba(a,i.transform),g=n.layout.get("line-cap")==="round",w=d.getDash(s.from,g),A=d.getDash(s.to,g),z=w.width*p.fromScale,D=A.width*p.toScale;return l.extend(fo(i,a,n),{u_patternscale_a:[y/z,-w.height/2],u_patternscale_b:[y/D,-A.height/2],u_sdfgamma:d.width/(256*Math.min(z,D)*l.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:w.y,u_tex_y_b:A.y,u_mix:p.t})};function Ba(i,a){return 1/Zt(i,1,a.tileZoom)}function wu(i,a,n){return i.translatePosMatrix(a.tileID.posMatrix,a,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}var Yc=function(i,a,n,s,p){return{u_matrix:i,u_tl_parent:a,u_scale_parent:n,u_buffer_scale:1,u_fade_t:s.mix,u_opacity:s.opacity*p.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:p.paint.get("raster-brightness-min"),u_brightness_high:p.paint.get("raster-brightness-max"),u_saturation_factor:(y=p.paint.get("raster-saturation"),y>0?1-1/(1.001-y):-y),u_contrast_factor:(d=p.paint.get("raster-contrast"),d>0?1/(1-d):1+d),u_spin_weights:Su(p.paint.get("raster-hue-rotate"))};var d,y};function Su(i){i*=Math.PI/180;var a=Math.sin(i),n=Math.cos(i);return[(2*n+1)/3,(-Math.sqrt(3)*a-n+1)/3,(Math.sqrt(3)*a-n+1)/3]}var Qo,Da=function(i,a,n,s,p,d,y,g,w,A){var z=p.transform;return{u_is_size_zoom_constant:+(i==="constant"||i==="source"),u_is_size_feature_constant:+(i==="constant"||i==="camera"),u_size_t:a?a.uSizeT:0,u_size:a?a.uSize:0,u_camera_to_center_distance:z.cameraToCenterDistance,u_pitch:z.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:z.width/z.height,u_fade_change:p.options.fadeDuration?p.symbolFadeChange:1,u_matrix:d,u_label_plane_matrix:y,u_coord_matrix:g,u_is_text:+w,u_pitch_with_map:+s,u_texsize:A,u_texture:0}},mo=function(i,a,n,s,p,d,y,g,w,A,z){var D=p.transform;return l.extend(Da(i,a,n,s,p,d,y,g,w,A),{u_gamma_scale:s?Math.cos(D._pitch)*D.cameraToCenterDistance:1,u_device_pixel_ratio:l.browser.devicePixelRatio,u_is_halo:1})},es=function(i,a,n,s,p,d,y,g,w,A){return l.extend(mo(i,a,n,s,p,d,y,g,!0,w),{u_texsize_icon:A,u_texture_icon:1})},yo=function(i,a,n){return{u_matrix:i,u_opacity:a,u_color:n}},La=function(i,a,n,s,p,d){return l.extend(function(y,g,w,A){var z=w.imageManager.getPattern(y.from.toString()),D=w.imageManager.getPattern(y.to.toString()),L=w.imageManager.getPixelSize(),$=L.width,q=L.height,K=Math.pow(2,A.tileID.overscaledZ),V=A.tileSize*Math.pow(2,w.transform.tileZoom)/K,X=V*(A.tileID.canonical.x+A.tileID.wrap*K),ee=V*A.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:z.tl,u_pattern_br_a:z.br,u_pattern_tl_b:D.tl,u_pattern_br_b:D.br,u_texsize:[$,q],u_mix:g.t,u_pattern_size_a:z.displaySize,u_pattern_size_b:D.displaySize,u_scale_a:g.fromScale,u_scale_b:g.toScale,u_tile_units_to_pixels:1/Zt(A,1,w.transform.tileZoom),u_pixel_coord_upper:[X>>16,ee>>16],u_pixel_coord_lower:[65535&X,65535&ee]}}(s,d,n,p),{u_matrix:i,u_opacity:a})},Tu={fillExtrusion:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_lightpos:new l.Uniform3f(i,a.u_lightpos),u_lightintensity:new l.Uniform1f(i,a.u_lightintensity),u_lightcolor:new l.Uniform3f(i,a.u_lightcolor),u_vertical_gradient:new l.Uniform1f(i,a.u_vertical_gradient),u_opacity:new l.Uniform1f(i,a.u_opacity)}},fillExtrusionPattern:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_lightpos:new l.Uniform3f(i,a.u_lightpos),u_lightintensity:new l.Uniform1f(i,a.u_lightintensity),u_lightcolor:new l.Uniform3f(i,a.u_lightcolor),u_vertical_gradient:new l.Uniform1f(i,a.u_vertical_gradient),u_height_factor:new l.Uniform1f(i,a.u_height_factor),u_image:new l.Uniform1i(i,a.u_image),u_texsize:new l.Uniform2f(i,a.u_texsize),u_pixel_coord_upper:new l.Uniform2f(i,a.u_pixel_coord_upper),u_pixel_coord_lower:new l.Uniform2f(i,a.u_pixel_coord_lower),u_scale:new l.Uniform3f(i,a.u_scale),u_fade:new l.Uniform1f(i,a.u_fade),u_opacity:new l.Uniform1f(i,a.u_opacity)}},fill:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix)}},fillPattern:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_image:new l.Uniform1i(i,a.u_image),u_texsize:new l.Uniform2f(i,a.u_texsize),u_pixel_coord_upper:new l.Uniform2f(i,a.u_pixel_coord_upper),u_pixel_coord_lower:new l.Uniform2f(i,a.u_pixel_coord_lower),u_scale:new l.Uniform3f(i,a.u_scale),u_fade:new l.Uniform1f(i,a.u_fade)}},fillOutline:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_world:new l.Uniform2f(i,a.u_world)}},fillOutlinePattern:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_world:new l.Uniform2f(i,a.u_world),u_image:new l.Uniform1i(i,a.u_image),u_texsize:new l.Uniform2f(i,a.u_texsize),u_pixel_coord_upper:new l.Uniform2f(i,a.u_pixel_coord_upper),u_pixel_coord_lower:new l.Uniform2f(i,a.u_pixel_coord_lower),u_scale:new l.Uniform3f(i,a.u_scale),u_fade:new l.Uniform1f(i,a.u_fade)}},circle:function(i,a){return{u_camera_to_center_distance:new l.Uniform1f(i,a.u_camera_to_center_distance),u_scale_with_map:new l.Uniform1i(i,a.u_scale_with_map),u_pitch_with_map:new l.Uniform1i(i,a.u_pitch_with_map),u_extrude_scale:new l.Uniform2f(i,a.u_extrude_scale),u_device_pixel_ratio:new l.Uniform1f(i,a.u_device_pixel_ratio),u_matrix:new l.UniformMatrix4f(i,a.u_matrix)}},collisionBox:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_camera_to_center_distance:new l.Uniform1f(i,a.u_camera_to_center_distance),u_pixels_to_tile_units:new l.Uniform1f(i,a.u_pixels_to_tile_units),u_extrude_scale:new l.Uniform2f(i,a.u_extrude_scale),u_overscale_factor:new l.Uniform1f(i,a.u_overscale_factor)}},collisionCircle:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_inv_matrix:new l.UniformMatrix4f(i,a.u_inv_matrix),u_camera_to_center_distance:new l.Uniform1f(i,a.u_camera_to_center_distance),u_viewport_size:new l.Uniform2f(i,a.u_viewport_size)}},debug:function(i,a){return{u_color:new l.UniformColor(i,a.u_color),u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_overlay:new l.Uniform1i(i,a.u_overlay),u_overlay_scale:new l.Uniform1f(i,a.u_overlay_scale)}},clippingMask:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix)}},heatmap:function(i,a){return{u_extrude_scale:new l.Uniform1f(i,a.u_extrude_scale),u_intensity:new l.Uniform1f(i,a.u_intensity),u_matrix:new l.UniformMatrix4f(i,a.u_matrix)}},heatmapTexture:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_world:new l.Uniform2f(i,a.u_world),u_image:new l.Uniform1i(i,a.u_image),u_color_ramp:new l.Uniform1i(i,a.u_color_ramp),u_opacity:new l.Uniform1f(i,a.u_opacity)}},hillshade:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_image:new l.Uniform1i(i,a.u_image),u_latrange:new l.Uniform2f(i,a.u_latrange),u_light:new l.Uniform2f(i,a.u_light),u_shadow:new l.UniformColor(i,a.u_shadow),u_highlight:new l.UniformColor(i,a.u_highlight),u_accent:new l.UniformColor(i,a.u_accent)}},hillshadePrepare:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_image:new l.Uniform1i(i,a.u_image),u_dimension:new l.Uniform2f(i,a.u_dimension),u_zoom:new l.Uniform1f(i,a.u_zoom),u_unpack:new l.Uniform4f(i,a.u_unpack)}},line:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_ratio:new l.Uniform1f(i,a.u_ratio),u_device_pixel_ratio:new l.Uniform1f(i,a.u_device_pixel_ratio),u_units_to_pixels:new l.Uniform2f(i,a.u_units_to_pixels)}},lineGradient:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_ratio:new l.Uniform1f(i,a.u_ratio),u_device_pixel_ratio:new l.Uniform1f(i,a.u_device_pixel_ratio),u_units_to_pixels:new l.Uniform2f(i,a.u_units_to_pixels),u_image:new l.Uniform1i(i,a.u_image),u_image_height:new l.Uniform1f(i,a.u_image_height)}},linePattern:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_texsize:new l.Uniform2f(i,a.u_texsize),u_ratio:new l.Uniform1f(i,a.u_ratio),u_device_pixel_ratio:new l.Uniform1f(i,a.u_device_pixel_ratio),u_image:new l.Uniform1i(i,a.u_image),u_units_to_pixels:new l.Uniform2f(i,a.u_units_to_pixels),u_scale:new l.Uniform3f(i,a.u_scale),u_fade:new l.Uniform1f(i,a.u_fade)}},lineSDF:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_ratio:new l.Uniform1f(i,a.u_ratio),u_device_pixel_ratio:new l.Uniform1f(i,a.u_device_pixel_ratio),u_units_to_pixels:new l.Uniform2f(i,a.u_units_to_pixels),u_patternscale_a:new l.Uniform2f(i,a.u_patternscale_a),u_patternscale_b:new l.Uniform2f(i,a.u_patternscale_b),u_sdfgamma:new l.Uniform1f(i,a.u_sdfgamma),u_image:new l.Uniform1i(i,a.u_image),u_tex_y_a:new l.Uniform1f(i,a.u_tex_y_a),u_tex_y_b:new l.Uniform1f(i,a.u_tex_y_b),u_mix:new l.Uniform1f(i,a.u_mix)}},raster:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_tl_parent:new l.Uniform2f(i,a.u_tl_parent),u_scale_parent:new l.Uniform1f(i,a.u_scale_parent),u_buffer_scale:new l.Uniform1f(i,a.u_buffer_scale),u_fade_t:new l.Uniform1f(i,a.u_fade_t),u_opacity:new l.Uniform1f(i,a.u_opacity),u_image0:new l.Uniform1i(i,a.u_image0),u_image1:new l.Uniform1i(i,a.u_image1),u_brightness_low:new l.Uniform1f(i,a.u_brightness_low),u_brightness_high:new l.Uniform1f(i,a.u_brightness_high),u_saturation_factor:new l.Uniform1f(i,a.u_saturation_factor),u_contrast_factor:new l.Uniform1f(i,a.u_contrast_factor),u_spin_weights:new l.Uniform3f(i,a.u_spin_weights)}},symbolIcon:function(i,a){return{u_is_size_zoom_constant:new l.Uniform1i(i,a.u_is_size_zoom_constant),u_is_size_feature_constant:new l.Uniform1i(i,a.u_is_size_feature_constant),u_size_t:new l.Uniform1f(i,a.u_size_t),u_size:new l.Uniform1f(i,a.u_size),u_camera_to_center_distance:new l.Uniform1f(i,a.u_camera_to_center_distance),u_pitch:new l.Uniform1f(i,a.u_pitch),u_rotate_symbol:new l.Uniform1i(i,a.u_rotate_symbol),u_aspect_ratio:new l.Uniform1f(i,a.u_aspect_ratio),u_fade_change:new l.Uniform1f(i,a.u_fade_change),u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_label_plane_matrix:new l.UniformMatrix4f(i,a.u_label_plane_matrix),u_coord_matrix:new l.UniformMatrix4f(i,a.u_coord_matrix),u_is_text:new l.Uniform1i(i,a.u_is_text),u_pitch_with_map:new l.Uniform1i(i,a.u_pitch_with_map),u_texsize:new l.Uniform2f(i,a.u_texsize),u_texture:new l.Uniform1i(i,a.u_texture)}},symbolSDF:function(i,a){return{u_is_size_zoom_constant:new l.Uniform1i(i,a.u_is_size_zoom_constant),u_is_size_feature_constant:new l.Uniform1i(i,a.u_is_size_feature_constant),u_size_t:new l.Uniform1f(i,a.u_size_t),u_size:new l.Uniform1f(i,a.u_size),u_camera_to_center_distance:new l.Uniform1f(i,a.u_camera_to_center_distance),u_pitch:new l.Uniform1f(i,a.u_pitch),u_rotate_symbol:new l.Uniform1i(i,a.u_rotate_symbol),u_aspect_ratio:new l.Uniform1f(i,a.u_aspect_ratio),u_fade_change:new l.Uniform1f(i,a.u_fade_change),u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_label_plane_matrix:new l.UniformMatrix4f(i,a.u_label_plane_matrix),u_coord_matrix:new l.UniformMatrix4f(i,a.u_coord_matrix),u_is_text:new l.Uniform1i(i,a.u_is_text),u_pitch_with_map:new l.Uniform1i(i,a.u_pitch_with_map),u_texsize:new l.Uniform2f(i,a.u_texsize),u_texture:new l.Uniform1i(i,a.u_texture),u_gamma_scale:new l.Uniform1f(i,a.u_gamma_scale),u_device_pixel_ratio:new l.Uniform1f(i,a.u_device_pixel_ratio),u_is_halo:new l.Uniform1i(i,a.u_is_halo)}},symbolTextAndIcon:function(i,a){return{u_is_size_zoom_constant:new l.Uniform1i(i,a.u_is_size_zoom_constant),u_is_size_feature_constant:new l.Uniform1i(i,a.u_is_size_feature_constant),u_size_t:new l.Uniform1f(i,a.u_size_t),u_size:new l.Uniform1f(i,a.u_size),u_camera_to_center_distance:new l.Uniform1f(i,a.u_camera_to_center_distance),u_pitch:new l.Uniform1f(i,a.u_pitch),u_rotate_symbol:new l.Uniform1i(i,a.u_rotate_symbol),u_aspect_ratio:new l.Uniform1f(i,a.u_aspect_ratio),u_fade_change:new l.Uniform1f(i,a.u_fade_change),u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_label_plane_matrix:new l.UniformMatrix4f(i,a.u_label_plane_matrix),u_coord_matrix:new l.UniformMatrix4f(i,a.u_coord_matrix),u_is_text:new l.Uniform1i(i,a.u_is_text),u_pitch_with_map:new l.Uniform1i(i,a.u_pitch_with_map),u_texsize:new l.Uniform2f(i,a.u_texsize),u_texsize_icon:new l.Uniform2f(i,a.u_texsize_icon),u_texture:new l.Uniform1i(i,a.u_texture),u_texture_icon:new l.Uniform1i(i,a.u_texture_icon),u_gamma_scale:new l.Uniform1f(i,a.u_gamma_scale),u_device_pixel_ratio:new l.Uniform1f(i,a.u_device_pixel_ratio),u_is_halo:new l.Uniform1i(i,a.u_is_halo)}},background:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_opacity:new l.Uniform1f(i,a.u_opacity),u_color:new l.UniformColor(i,a.u_color)}},backgroundPattern:function(i,a){return{u_matrix:new l.UniformMatrix4f(i,a.u_matrix),u_opacity:new l.Uniform1f(i,a.u_opacity),u_image:new l.Uniform1i(i,a.u_image),u_pattern_tl_a:new l.Uniform2f(i,a.u_pattern_tl_a),u_pattern_br_a:new l.Uniform2f(i,a.u_pattern_br_a),u_pattern_tl_b:new l.Uniform2f(i,a.u_pattern_tl_b),u_pattern_br_b:new l.Uniform2f(i,a.u_pattern_br_b),u_texsize:new l.Uniform2f(i,a.u_texsize),u_mix:new l.Uniform1f(i,a.u_mix),u_pattern_size_a:new l.Uniform2f(i,a.u_pattern_size_a),u_pattern_size_b:new l.Uniform2f(i,a.u_pattern_size_b),u_scale_a:new l.Uniform1f(i,a.u_scale_a),u_scale_b:new l.Uniform1f(i,a.u_scale_b),u_pixel_coord_upper:new l.Uniform2f(i,a.u_pixel_coord_upper),u_pixel_coord_lower:new l.Uniform2f(i,a.u_pixel_coord_lower),u_tile_units_to_pixels:new l.Uniform1f(i,a.u_tile_units_to_pixels)}}};function Ra(i,a,n,s,p,d,y){for(var g=i.context,w=g.gl,A=i.useProgram("collisionBox"),z=[],D=0,L=0,$=0;$<s.length;$++){var q=s[$],K=a.getTile(q),V=K.getBucket(n);if(V){var X=q.posMatrix;p[0]===0&&p[1]===0||(X=i.translatePosMatrix(q.posMatrix,K,p,d));var ee=y?V.textCollisionBox:V.iconCollisionBox,ie=V.collisionCircleArray;if(ie.length>0){var pe=l.create(),ue=X;l.mul(pe,V.placementInvProjMatrix,i.transform.glCoordMatrix),l.mul(pe,pe,V.placementViewportMatrix),z.push({circleArray:ie,circleOffset:L,transform:ue,invTransform:pe}),L=D+=ie.length/4}ee&&A.draw(g,w.LINES,F.disabled,j.disabled,i.colorModeForRenderPass(),te.disabled,ra(X,i.transform,K),n.id,ee.layoutVertexBuffer,ee.indexBuffer,ee.segments,null,i.transform.zoom,null,null,ee.collisionVertexBuffer)}}if(y&&z.length){var he=i.useProgram("collisionCircle"),_e=new l.StructArrayLayout2f1f2i16;_e.resize(4*D),_e._trim();for(var Ie=0,Te=0,De=z;Te<De.length;Te+=1)for(var Ge=De[Te],Ke=0;Ke<Ge.circleArray.length/4;Ke++){var Xe=4*Ke,bt=Ge.circleArray[Xe+0],Fe=Ge.circleArray[Xe+1],nt=Ge.circleArray[Xe+2],st=Ge.circleArray[Xe+3];_e.emplace(Ie++,bt,Fe,nt,st,0),_e.emplace(Ie++,bt,Fe,nt,st,1),_e.emplace(Ie++,bt,Fe,nt,st,2),_e.emplace(Ie++,bt,Fe,nt,st,3)}(!Qo||Qo.length<2*D)&&(Qo=function(Qt){var Rr=2*Qt,Cr=new l.StructArrayLayout3ui6;Cr.resize(Rr),Cr._trim();for(var Jt=0;Jt<Rr;Jt++){var ar=6*Jt;Cr.uint16[ar+0]=4*Jt+0,Cr.uint16[ar+1]=4*Jt+1,Cr.uint16[ar+2]=4*Jt+2,Cr.uint16[ar+3]=4*Jt+2,Cr.uint16[ar+4]=4*Jt+3,Cr.uint16[ar+5]=4*Jt+0}return Cr}(D));for(var it=g.createIndexBuffer(Qo,!0),rt=g.createVertexBuffer(_e,l.collisionCircleLayout.members,!0),ot=0,et=z;ot<et.length;ot+=1){var Je=et[ot],_r=xu(Je.transform,Je.invTransform,i.transform);he.draw(g,w.TRIANGLES,F.disabled,j.disabled,i.colorModeForRenderPass(),te.disabled,_r,n.id,rt,it,l.SegmentVector.simpleSegment(0,2*Je.circleOffset,Je.circleArray.length,Je.circleArray.length/2),null,i.transform.zoom,null,null,null)}rt.destroy(),it.destroy()}}var Oi=l.identity(new Float32Array(16));function Iu(i,a,n,s,p,d){var y=l.getAnchorAlignment(i),g=-(y.horizontalAlign-.5)*a,w=-(y.verticalAlign-.5)*n,A=l.evaluateVariableOffset(i,s);return new l.Point((g/p+A[0])*d,(w/p+A[1])*d)}function Au(i,a,n,s,p,d,y,g,w,A,z){var D=i.text.placedSymbolArray,L=i.text.dynamicLayoutVertexArray,$=i.icon.dynamicLayoutVertexArray,q={};L.clear();for(var K=0;K<D.length;K++){var V=D.get(K),X=V.hidden||!V.crossTileID||i.allowVerticalPlacement&&!V.placedOrientation?null:s[V.crossTileID];if(X){var ee=new l.Point(V.anchorX,V.anchorY),ie=mt(ee,n?g:y),pe=Et(d.cameraToCenterDistance,ie.signedDistanceFromCamera),ue=p.evaluateSizeForFeature(i.textSizeData,A,V)*pe/l.ONE_EM;n&&(ue*=i.tilePixelRatio/w);for(var he=Iu(X.anchor,X.width,X.height,X.textOffset,X.textBoxScale,ue),_e=n?mt(ee.add(he),y).point:ie.point.add(a?he.rotate(-d.angle):he),Ie=i.allowVerticalPlacement&&V.placedOrientation===l.WritingMode.vertical?Math.PI/2:0,Te=0;Te<V.numGlyphs;Te++)l.addDynamicAttributes(L,_e,Ie);z&&V.associatedIconIndex>=0&&(q[V.associatedIconIndex]={shiftedAnchor:_e,angle:Ie})}else Nr(V.numGlyphs,L)}if(z){$.clear();for(var De=i.icon.placedSymbolArray,Ge=0;Ge<De.length;Ge++){var Ke=De.get(Ge);if(Ke.hidden)Nr(Ke.numGlyphs,$);else{var Xe=q[Ge];if(Xe)for(var bt=0;bt<Ke.numGlyphs;bt++)l.addDynamicAttributes($,Xe.shiftedAnchor,Xe.angle);else Nr(Ke.numGlyphs,$)}}i.icon.dynamicLayoutVertexBuffer.updateData($)}i.text.dynamicLayoutVertexBuffer.updateData(L)}function Eu(i,a,n){return n.iconsInText&&a?"symbolTextAndIcon":i?"symbolSDF":"symbolIcon"}function aa(i,a,n,s,p,d,y,g,w,A,z,D){for(var L=i.context,$=L.gl,q=i.transform,K=g==="map",V=w==="map",X=K&&n.layout.get("symbol-placement")!=="point",ee=K&&!V&&!X,ie=n.layout.get("symbol-sort-key").constantOr(1)!==void 0,pe=!1,ue=i.depthModeForSublayer(0,F.ReadOnly),he=n.layout.get("text-variable-anchor"),_e=[],Ie=0,Te=s;Ie<Te.length;Ie+=1){var De=Te[Ie],Ge=a.getTile(De),Ke=Ge.getBucket(n);if(Ke){var Xe=p?Ke.text:Ke.icon;if(Xe&&Xe.segments.get().length){var bt=Xe.programConfigurations.get(n.id),Fe=p||Ke.sdfIcons,nt=p?Ke.textSizeData:Ke.iconSizeData,st=V||q.pitch!==0,it=i.useProgram(Eu(Fe,p,Ke),bt),rt=l.evaluateSizeForZoom(nt,q.zoom),ot=void 0,et=[0,0],Je=void 0,_r=void 0,Qt=null,Rr=void 0;if(p)Je=Ge.glyphAtlasTexture,_r=$.LINEAR,ot=Ge.glyphAtlasTexture.size,Ke.iconsInText&&(et=Ge.imageAtlasTexture.size,Qt=Ge.imageAtlasTexture,Rr=st||i.options.rotating||i.options.zooming||nt.kind==="composite"||nt.kind==="camera"?$.LINEAR:$.NEAREST);else{var Cr=n.layout.get("icon-size").constantOr(0)!==1||Ke.iconsNeedLinear;Je=Ge.imageAtlasTexture,_r=Fe||i.options.rotating||i.options.zooming||Cr||st?$.LINEAR:$.NEAREST,ot=Ge.imageAtlasTexture.size}var Jt=Zt(Ge,1,i.transform.zoom),ar=ir(De.posMatrix,V,K,i.transform,Jt),ci=zt(De.posMatrix,V,K,i.transform,Jt),Zr=he&&Ke.hasTextData(),Mn=n.layout.get("icon-text-fit")!=="none"&&Zr&&Ke.hasIconData();X&&so(Ke,De.posMatrix,i,p,ar,ci,V,A);var Qr=i.translatePosMatrix(De.posMatrix,Ge,d,y),ji=X||p&&he||Mn?Oi:ar,Pi=i.translatePosMatrix(ci,Ge,d,y,!0),Co=Fe&&n.paint.get(p?"text-halo-width":"icon-halo-width").constantOr(1)!==0,qa={program:it,buffers:Xe,uniformValues:Fe?Ke.iconsInText?es(nt.kind,rt,ee,V,i,Qr,ji,Pi,ot,et):mo(nt.kind,rt,ee,V,i,Qr,ji,Pi,p,ot):Da(nt.kind,rt,ee,V,i,Qr,ji,Pi,p,ot),atlasTexture:Je,atlasTextureIcon:Qt,atlasInterpolation:_r,atlasInterpolationIcon:Rr,isSDF:Fe,hasHalo:Co};if(ie&&Ke.canOverlap){pe=!0;for(var zn=0,ja=Xe.segments.get();zn<ja.length;zn+=1){var Po=ja[zn];_e.push({segments:new l.SegmentVector([Po]),sortKey:Po.sortKey,state:qa})}}else _e.push({segments:Xe.segments,sortKey:0,state:qa})}}}pe&&_e.sort(function(Bn,pa){return Bn.sortKey-pa.sortKey});for(var Ji=0,ko=_e;Ji<ko.length;Ji+=1){var Yi=ko[Ji],xr=Yi.state;if(L.activeTexture.set($.TEXTURE0),xr.atlasTexture.bind(xr.atlasInterpolation,$.CLAMP_TO_EDGE),xr.atlasTextureIcon&&(L.activeTexture.set($.TEXTURE1),xr.atlasTextureIcon&&xr.atlasTextureIcon.bind(xr.atlasInterpolationIcon,$.CLAMP_TO_EDGE)),xr.isSDF){var cn=xr.uniformValues;xr.hasHalo&&(cn.u_is_halo=1,vo(xr.buffers,Yi.segments,n,i,xr.program,ue,z,D,cn)),cn.u_is_halo=0}vo(xr.buffers,Yi.segments,n,i,xr.program,ue,z,D,xr.uniformValues)}}function vo(i,a,n,s,p,d,y,g,w){var A=s.context;p.draw(A,A.gl.TRIANGLES,d,y,g,te.disabled,w,n.id,i.layoutVertexBuffer,i.indexBuffer,a,n.paint,s.transform.zoom,i.programConfigurations.get(n.id),i.dynamicLayoutVertexBuffer,i.opacityVertexBuffer)}function ts(i,a,n,s,p,d,y){var g,w,A,z,D,L=i.context.gl,$=n.paint.get("fill-pattern"),q=$&&$.constantOr(1),K=n.getCrossfadeParameters();y?(w=q&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",g=L.LINES):(w=q?"fillPattern":"fill",g=L.TRIANGLES);for(var V=0,X=s;V<X.length;V+=1){var ee=X[V],ie=a.getTile(ee);if(!q||ie.patternsLoaded()){var pe=ie.getBucket(n);if(pe){var ue=pe.programConfigurations.get(n.id),he=i.useProgram(w,ue);q&&(i.context.activeTexture.set(L.TEXTURE0),ie.imageAtlasTexture.bind(L.LINEAR,L.CLAMP_TO_EDGE),ue.updatePaintBuffers(K));var _e=$.constantOr(null);if(_e&&ie.imageAtlas){var Ie=ie.imageAtlas,Te=Ie.patternPositions[_e.to.toString()],De=Ie.patternPositions[_e.from.toString()];Te&&De&&ue.setConstantPatternPositions(Te,De)}var Ge=i.translatePosMatrix(ee.posMatrix,ie,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(y){z=pe.indexBuffer2,D=pe.segments2;var Ke=[L.drawingBufferWidth,L.drawingBufferHeight];A=w==="fillOutlinePattern"&&q?_u(Ge,i,K,ie,Ke):gu(Ge,Ke)}else z=pe.indexBuffer,D=pe.segments,A=q?ta(Ge,i,K,ie):In(Ge);he.draw(i.context,g,p,i.stencilModeForClipping(ee),d,te.disabled,A,n.id,pe.layoutVertexBuffer,z,D,n.paint,i.transform.zoom,ue)}}}}function sl(i,a,n,s,p,d,y){for(var g=i.context,w=g.gl,A=n.paint.get("fill-extrusion-pattern"),z=A.constantOr(1),D=n.getCrossfadeParameters(),L=n.paint.get("fill-extrusion-opacity"),$=0,q=s;$<q.length;$+=1){var K=q[$],V=a.getTile(K),X=V.getBucket(n);if(X){var ee=X.programConfigurations.get(n.id),ie=i.useProgram(z?"fillExtrusionPattern":"fillExtrusion",ee);z&&(i.context.activeTexture.set(w.TEXTURE0),V.imageAtlasTexture.bind(w.LINEAR,w.CLAMP_TO_EDGE),ee.updatePaintBuffers(D));var pe=A.constantOr(null);if(pe&&V.imageAtlas){var ue=V.imageAtlas,he=ue.patternPositions[pe.to.toString()],_e=ue.patternPositions[pe.from.toString()];he&&_e&&ee.setConstantPatternPositions(he,_e)}var Ie=i.translatePosMatrix(K.posMatrix,V,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),Te=n.paint.get("fill-extrusion-vertical-gradient"),De=z?ea(Ie,i,Te,L,K,D,V):vu(Ie,i,Te,L);ie.draw(g,g.gl.TRIANGLES,p,d,y,te.backCCW,De,n.id,X.layoutVertexBuffer,X.indexBuffer,X.segments,n.paint,i.transform.zoom,ee)}}}function rs(i,a,n,s,p,d){var y=i.context,g=y.gl,w=a.fbo;if(w){var A=i.useProgram("hillshade");y.activeTexture.set(g.TEXTURE0),g.bindTexture(g.TEXTURE_2D,w.colorAttachment.get());var z=function(D,L,$){var q=$.paint.get("hillshade-shadow-color"),K=$.paint.get("hillshade-highlight-color"),V=$.paint.get("hillshade-accent-color"),X=$.paint.get("hillshade-illumination-direction")*(Math.PI/180);$.paint.get("hillshade-illumination-anchor")==="viewport"&&(X-=D.transform.angle);var ee,ie,pe,ue=!D.options.moving;return{u_matrix:D.transform.calculatePosMatrix(L.tileID.toUnwrapped(),ue),u_image:0,u_latrange:(ee=L.tileID,ie=Math.pow(2,ee.canonical.z),pe=ee.canonical.y,[new l.MercatorCoordinate(0,pe/ie).toLngLat().lat,new l.MercatorCoordinate(0,(pe+1)/ie).toLngLat().lat]),u_light:[$.paint.get("hillshade-exaggeration"),X],u_shadow:q,u_highlight:K,u_accent:V}}(i,a,n);A.draw(y,g.TRIANGLES,s,p,d,te.disabled,z,n.id,i.rasterBoundsBuffer,i.quadTriangleIndexBuffer,i.rasterBoundsSegments)}}function Qc(i,a,n,s,p,d){var y=i.context,g=y.gl,w=a.dem;if(w&&w.data){var A=w.dim,z=w.stride,D=w.getPixels();if(y.activeTexture.set(g.TEXTURE1),y.pixelStoreUnpackPremultiplyAlpha.set(!1),a.demTexture=a.demTexture||i.getTileTexture(z),a.demTexture){var L=a.demTexture;L.update(D,{premultiply:!1}),L.bind(g.NEAREST,g.CLAMP_TO_EDGE)}else a.demTexture=new l.Texture(y,D,g.RGBA,{premultiply:!1}),a.demTexture.bind(g.NEAREST,g.CLAMP_TO_EDGE);y.activeTexture.set(g.TEXTURE0);var $=a.fbo;if(!$){var q=new l.Texture(y,{width:A,height:A,data:null},g.RGBA);q.bind(g.LINEAR,g.CLAMP_TO_EDGE),($=a.fbo=y.createFramebuffer(A,A,!0)).colorAttachment.set(q.texture)}y.bindFramebuffer.set($.framebuffer),y.viewport.set([0,0,A,A]),i.useProgram("hillshadePrepare").draw(y,g.TRIANGLES,s,p,d,te.disabled,function(K,V){var X=V.stride,ee=l.create();return l.ortho(ee,0,l.EXTENT,-l.EXTENT,0,0,1),l.translate(ee,ee,[0,-l.EXTENT,0]),{u_matrix:ee,u_image:1,u_dimension:[X,X],u_zoom:K.overscaledZ,u_unpack:V.getUnpackVector()}}(a.tileID,w),n.id,i.rasterBoundsBuffer,i.quadTriangleIndexBuffer,i.rasterBoundsSegments),a.needsHillshadePrepare=!1}}function is(i,a,n,s,p){var d=s.paint.get("raster-fade-duration");if(d>0){var y=l.browser.now(),g=(y-i.timeAdded)/d,w=a?(y-a.timeAdded)/d:-1,A=n.getSource(),z=p.coveringZoomLevel({tileSize:A.tileSize,roundZoom:A.roundZoom}),D=!a||Math.abs(a.tileID.overscaledZ-z)>Math.abs(i.tileID.overscaledZ-z),L=D&&i.refreshedUponExpiration?1:l.clamp(D?g:1-w,0,1);return i.refreshedUponExpiration&&g>=1&&(i.refreshedUponExpiration=!1),a?{opacity:1,mix:1-L}:{opacity:L,mix:0}}return{opacity:1,mix:0}}var ll=new l.Color(1,0,0,1),Cu=new l.Color(0,1,0,1),Pu=new l.Color(0,0,1,1),ns=new l.Color(1,0,1,1),ul=new l.Color(0,1,1,1);function cl(i,a,n,s){go(i,0,a+n/2,i.transform.width,n,s)}function pl(i,a,n,s){go(i,a-n/2,0,n,i.transform.height,s)}function go(i,a,n,s,p,d){var y=i.context,g=y.gl;g.enable(g.SCISSOR_TEST),g.scissor(a*l.browser.devicePixelRatio,n*l.browser.devicePixelRatio,s*l.browser.devicePixelRatio,p*l.browser.devicePixelRatio),y.clear({color:d}),g.disable(g.SCISSOR_TEST)}function ku(i,a,n){var s=i.context,p=s.gl,d=n.posMatrix,y=i.useProgram("debug"),g=F.disabled,w=j.disabled,A=i.colorModeForRenderPass();s.activeTexture.set(p.TEXTURE0),i.emptyTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),y.draw(s,p.LINE_STRIP,g,w,A,te.disabled,ia(d,l.Color.red),"$debug",i.debugBuffer,i.tileBorderIndexBuffer,i.debugSegments);var z=a.getTileByID(n.key).latestRawTileData,D=Math.floor((z&&z.byteLength||0)/1024),L=a.getTile(n).tileSize,$=512/Math.min(L,512)*(n.overscaledZ/i.transform.zoom)*.5,q=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(q+=" => "+n.overscaledZ),function(K,V){K.initDebugOverlayCanvas();var X=K.debugOverlayCanvas,ee=K.context.gl,ie=K.debugOverlayCanvas.getContext("2d");ie.clearRect(0,0,X.width,X.height),ie.shadowColor="white",ie.shadowBlur=2,ie.lineWidth=1.5,ie.strokeStyle="white",ie.textBaseline="top",ie.font="bold 36px Open Sans, sans-serif",ie.fillText(V,5,5),ie.strokeText(V,5,5),K.debugOverlayTexture.update(X),K.debugOverlayTexture.bind(ee.LINEAR,ee.CLAMP_TO_EDGE)}(i,q+" "+D+"kb"),y.draw(s,p.TRIANGLES,g,w,Q.alphaBlended,te.disabled,ia(d,l.Color.transparent,$),"$debug",i.debugBuffer,i.quadTriangleIndexBuffer,i.debugSegments)}var oa={symbol:function(i,a,n,s,p){if(i.renderPass==="translucent"){var d=j.disabled,y=i.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(g,w,A,z,D,L,$){for(var q=w.transform,K=D==="map",V=L==="map",X=0,ee=g;X<ee.length;X+=1){var ie=ee[X],pe=z.getTile(ie),ue=pe.getBucket(A);if(ue&&ue.text&&ue.text.segments.get().length){var he=l.evaluateSizeForZoom(ue.textSizeData,q.zoom),_e=Zt(pe,1,w.transform.zoom),Ie=ir(ie.posMatrix,V,K,w.transform,_e),Te=A.layout.get("icon-text-fit")!=="none"&&ue.hasIconData();if(he){var De=Math.pow(2,q.zoom-pe.tileID.overscaledZ);Au(ue,K,V,$,l.symbolSize,q,Ie,ie.posMatrix,De,he,Te)}}}}(s,i,n,a,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),p),n.paint.get("icon-opacity").constantOr(1)!==0&&aa(i,a,n,s,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),d,y),n.paint.get("text-opacity").constantOr(1)!==0&&aa(i,a,n,s,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),d,y),a.map.showCollisionBoxes&&(Ra(i,a,n,s,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),Ra(i,a,n,s,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))}},circle:function(i,a,n,s){if(i.renderPass==="translucent"){var p=n.paint.get("circle-opacity"),d=n.paint.get("circle-stroke-width"),y=n.paint.get("circle-stroke-opacity"),g=n.layout.get("circle-sort-key").constantOr(1)!==void 0;if(p.constantOr(1)!==0||d.constantOr(1)!==0&&y.constantOr(1)!==0){for(var w=i.context,A=w.gl,z=i.depthModeForSublayer(0,F.ReadOnly),D=j.disabled,L=i.colorModeForRenderPass(),$=[],q=0;q<s.length;q++){var K=s[q],V=a.getTile(K),X=V.getBucket(n);if(X){var ee=X.programConfigurations.get(n.id),ie={programConfiguration:ee,program:i.useProgram("circle",ee),layoutVertexBuffer:X.layoutVertexBuffer,indexBuffer:X.indexBuffer,uniformValues:ol(i,K,V,n)};if(g)for(var pe=0,ue=X.segments.get();pe<ue.length;pe+=1){var he=ue[pe];$.push({segments:new l.SegmentVector([he]),sortKey:he.sortKey,state:ie})}else $.push({segments:X.segments,sortKey:0,state:ie})}}g&&$.sort(function(Ge,Ke){return Ge.sortKey-Ke.sortKey});for(var _e=0,Ie=$;_e<Ie.length;_e+=1){var Te=Ie[_e],De=Te.state;De.program.draw(w,A.TRIANGLES,z,D,L,te.disabled,De.uniformValues,n.id,De.layoutVertexBuffer,De.indexBuffer,Te.segments,n.paint,i.transform.zoom,De.programConfiguration)}}}},heatmap:function(i,a,n,s){if(n.paint.get("heatmap-opacity")!==0)if(i.renderPass==="offscreen"){var p=i.context,d=p.gl,y=j.disabled,g=new Q([d.ONE,d.ONE],l.Color.transparent,[!0,!0,!0,!0]);(function($,q,K){var V=$.gl;$.activeTexture.set(V.TEXTURE1),$.viewport.set([0,0,q.width/4,q.height/4]);var X=K.heatmapFbo;if(X)V.bindTexture(V.TEXTURE_2D,X.colorAttachment.get()),$.bindFramebuffer.set(X.framebuffer);else{var ee=V.createTexture();V.bindTexture(V.TEXTURE_2D,ee),V.texParameteri(V.TEXTURE_2D,V.TEXTURE_WRAP_S,V.CLAMP_TO_EDGE),V.texParameteri(V.TEXTURE_2D,V.TEXTURE_WRAP_T,V.CLAMP_TO_EDGE),V.texParameteri(V.TEXTURE_2D,V.TEXTURE_MIN_FILTER,V.LINEAR),V.texParameteri(V.TEXTURE_2D,V.TEXTURE_MAG_FILTER,V.LINEAR),X=K.heatmapFbo=$.createFramebuffer(q.width/4,q.height/4,!1),function(ie,pe,ue,he){var _e=ie.gl;_e.texImage2D(_e.TEXTURE_2D,0,_e.RGBA,pe.width/4,pe.height/4,0,_e.RGBA,ie.extRenderToTextureHalfFloat?ie.extTextureHalfFloat.HALF_FLOAT_OES:_e.UNSIGNED_BYTE,null),he.colorAttachment.set(ue)}($,q,ee,X)}})(p,i,n),p.clear({color:l.Color.transparent});for(var w=0;w<s.length;w++){var A=s[w];if(!a.hasRenderableParent(A)){var z=a.getTile(A),D=z.getBucket(n);if(D){var L=D.programConfigurations.get(n.id);i.useProgram("heatmap",L).draw(p,d.TRIANGLES,F.disabled,y,g,te.disabled,bu(A.posMatrix,z,i.transform.zoom,n.paint.get("heatmap-intensity")),n.id,D.layoutVertexBuffer,D.indexBuffer,D.segments,n.paint,i.transform.zoom,L)}}}p.viewport.set([0,0,i.width,i.height])}else i.renderPass==="translucent"&&(i.context.setColorMode(i.colorModeForRenderPass()),function($,q){var K=$.context,V=K.gl,X=q.heatmapFbo;if(X){K.activeTexture.set(V.TEXTURE0),V.bindTexture(V.TEXTURE_2D,X.colorAttachment.get()),K.activeTexture.set(V.TEXTURE1);var ee=q.colorRampTexture;ee||(ee=q.colorRampTexture=new l.Texture(K,q.colorRamp,V.RGBA)),ee.bind(V.LINEAR,V.CLAMP_TO_EDGE),$.useProgram("heatmapTexture").draw(K,V.TRIANGLES,F.disabled,j.disabled,$.colorModeForRenderPass(),te.disabled,function(ie,pe,ue,he){var _e=l.create();l.ortho(_e,0,ie.width,ie.height,0,0,1);var Ie=ie.context.gl;return{u_matrix:_e,u_world:[Ie.drawingBufferWidth,Ie.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:pe.paint.get("heatmap-opacity")}}($,q),q.id,$.viewportBuffer,$.quadTriangleIndexBuffer,$.viewportSegments,q.paint,$.transform.zoom)}}(i,n))},line:function(i,a,n,s){if(i.renderPass==="translucent"){var p=n.paint.get("line-opacity"),d=n.paint.get("line-width");if(p.constantOr(1)!==0&&d.constantOr(1)!==0)for(var y=i.depthModeForSublayer(0,F.ReadOnly),g=i.colorModeForRenderPass(),w=n.paint.get("line-dasharray"),A=n.paint.get("line-pattern"),z=A.constantOr(1),D=n.paint.get("line-gradient"),L=n.getCrossfadeParameters(),$=z?"linePattern":w?"lineSDF":D?"lineGradient":"line",q=i.context,K=q.gl,V=!0,X=0,ee=s;X<ee.length;X+=1){var ie=ee[X],pe=a.getTile(ie);if(!z||pe.patternsLoaded()){var ue=pe.getBucket(n);if(ue){var he=ue.programConfigurations.get(n.id),_e=i.context.program.get(),Ie=i.useProgram($,he),Te=V||Ie.program!==_e,De=A.constantOr(null);if(De&&pe.imageAtlas){var Ge=pe.imageAtlas,Ke=Ge.patternPositions[De.to.toString()],Xe=Ge.patternPositions[De.from.toString()];Ke&&Xe&&he.setConstantPatternPositions(Ke,Xe)}var bt=z?Yo(i,pe,n,L):w?Jc(i,pe,n,w,L):D?Ut(i,pe,n,ue.lineClipsArray.length):fo(i,pe,n);if(z)q.activeTexture.set(K.TEXTURE0),pe.imageAtlasTexture.bind(K.LINEAR,K.CLAMP_TO_EDGE),he.updatePaintBuffers(L);else if(w&&(Te||i.lineAtlas.dirty))q.activeTexture.set(K.TEXTURE0),i.lineAtlas.bind(q);else if(D){var Fe=ue.gradients[n.id],nt=Fe.texture;if(n.gradientVersion!==Fe.version){var st=256;if(n.stepInterpolant){var it=a.getSource().maxzoom,rt=ie.canonical.z===it?Math.ceil(1<<i.transform.maxZoom-ie.canonical.z):1;st=l.clamp(l.nextPowerOfTwo(ue.maxLineLength/l.EXTENT*1024*rt),256,q.maxTextureSize)}Fe.gradient=l.renderColorRamp({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:st,image:Fe.gradient||void 0,clips:ue.lineClipsArray}),Fe.texture?Fe.texture.update(Fe.gradient):Fe.texture=new l.Texture(q,Fe.gradient,K.RGBA),Fe.version=n.gradientVersion,nt=Fe.texture}q.activeTexture.set(K.TEXTURE0),nt.bind(n.stepInterpolant?K.NEAREST:K.LINEAR,K.CLAMP_TO_EDGE)}Ie.draw(q,K.TRIANGLES,y,i.stencilModeForClipping(ie),g,te.disabled,bt,n.id,ue.layoutVertexBuffer,ue.indexBuffer,ue.segments,n.paint,i.transform.zoom,he,ue.layoutVertexBuffer2),V=!1}}}}},fill:function(i,a,n,s){var p=n.paint.get("fill-color"),d=n.paint.get("fill-opacity");if(d.constantOr(1)!==0){var y=i.colorModeForRenderPass(),g=n.paint.get("fill-pattern"),w=i.opaquePassEnabledForLayer()&&!g.constantOr(1)&&p.constantOr(l.Color.transparent).a===1&&d.constantOr(0)===1?"opaque":"translucent";if(i.renderPass===w){var A=i.depthModeForSublayer(1,i.renderPass==="opaque"?F.ReadWrite:F.ReadOnly);ts(i,a,n,s,A,y,!1)}if(i.renderPass==="translucent"&&n.paint.get("fill-antialias")){var z=i.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,F.ReadOnly);ts(i,a,n,s,z,y,!0)}}},"fill-extrusion":function(i,a,n,s){var p=n.paint.get("fill-extrusion-opacity");if(p!==0&&i.renderPass==="translucent"){var d=new F(i.context.gl.LEQUAL,F.ReadWrite,i.depthRangeFor3D);if(p!==1||n.paint.get("fill-extrusion-pattern").constantOr(1))sl(i,a,n,s,d,j.disabled,Q.disabled),sl(i,a,n,s,d,i.stencilModeFor3D(),i.colorModeForRenderPass());else{var y=i.colorModeForRenderPass();sl(i,a,n,s,d,j.disabled,y)}}},hillshade:function(i,a,n,s){if(i.renderPass==="offscreen"||i.renderPass==="translucent"){for(var p=i.context,d=i.depthModeForSublayer(0,F.ReadOnly),y=i.colorModeForRenderPass(),g=i.renderPass==="translucent"?i.stencilConfigForOverlap(s):[{},s],w=g[0],A=0,z=g[1];A<z.length;A+=1){var D=z[A],L=a.getTile(D);L.needsHillshadePrepare&&i.renderPass==="offscreen"?Qc(i,L,n,d,j.disabled,y):i.renderPass==="translucent"&&rs(i,L,n,d,w[D.overscaledZ],y)}p.viewport.set([0,0,i.width,i.height])}},raster:function(i,a,n,s){if(i.renderPass==="translucent"&&n.paint.get("raster-opacity")!==0&&s.length)for(var p=i.context,d=p.gl,y=a.getSource(),g=i.useProgram("raster"),w=i.colorModeForRenderPass(),A=y instanceof Zi?[{},s]:i.stencilConfigForOverlap(s),z=A[0],D=A[1],L=D[D.length-1].overscaledZ,$=!i.options.moving,q=0,K=D;q<K.length;q+=1){var V=K[q],X=i.depthModeForSublayer(V.overscaledZ-L,n.paint.get("raster-opacity")===1?F.ReadWrite:F.ReadOnly,d.LESS),ee=a.getTile(V),ie=i.transform.calculatePosMatrix(V.toUnwrapped(),$);ee.registerFadeDuration(n.paint.get("raster-fade-duration"));var pe=a.findLoadedParent(V,0),ue=is(ee,pe,a,n,i.transform),he=void 0,_e=void 0,Ie=n.paint.get("raster-resampling")==="nearest"?d.NEAREST:d.LINEAR;p.activeTexture.set(d.TEXTURE0),ee.texture.bind(Ie,d.CLAMP_TO_EDGE,d.LINEAR_MIPMAP_NEAREST),p.activeTexture.set(d.TEXTURE1),pe?(pe.texture.bind(Ie,d.CLAMP_TO_EDGE,d.LINEAR_MIPMAP_NEAREST),he=Math.pow(2,pe.tileID.overscaledZ-ee.tileID.overscaledZ),_e=[ee.tileID.canonical.x*he%1,ee.tileID.canonical.y*he%1]):ee.texture.bind(Ie,d.CLAMP_TO_EDGE,d.LINEAR_MIPMAP_NEAREST);var Te=Yc(ie,_e||[0,0],he||1,ue,n);y instanceof Zi?g.draw(p,d.TRIANGLES,X,j.disabled,w,te.disabled,Te,n.id,y.boundsBuffer,i.quadTriangleIndexBuffer,y.boundsSegments):g.draw(p,d.TRIANGLES,X,z[V.overscaledZ],w,te.disabled,Te,n.id,i.rasterBoundsBuffer,i.quadTriangleIndexBuffer,i.rasterBoundsSegments)}},background:function(i,a,n){var s=n.paint.get("background-color"),p=n.paint.get("background-opacity");if(p!==0){var d=i.context,y=d.gl,g=i.transform,w=g.tileSize,A=n.paint.get("background-pattern");if(!i.isPatternMissing(A)){var z=!A&&s.a===1&&p===1&&i.opaquePassEnabledForLayer()?"opaque":"translucent";if(i.renderPass===z){var D=j.disabled,L=i.depthModeForSublayer(0,z==="opaque"?F.ReadWrite:F.ReadOnly),$=i.colorModeForRenderPass(),q=i.useProgram(A?"backgroundPattern":"background"),K=g.coveringTiles({tileSize:w});A&&(d.activeTexture.set(y.TEXTURE0),i.imageManager.bind(i.context));for(var V=n.getCrossfadeParameters(),X=0,ee=K;X<ee.length;X+=1){var ie=ee[X],pe=i.transform.calculatePosMatrix(ie.toUnwrapped()),ue=A?La(pe,p,i,A,{tileID:ie,tileSize:w},V):yo(pe,p,s);q.draw(d,y.TRIANGLES,L,D,$,te.disabled,ue,n.id,i.tileExtentBuffer,i.quadTriangleIndexBuffer,i.tileExtentSegments)}}}}},debug:function(i,a,n){for(var s=0;s<n.length;s++)ku(i,a,n[s])},custom:function(i,a,n){var s=i.context,p=n.implementation;if(i.renderPass==="offscreen"){var d=p.prerender;d&&(i.setCustomLayerDefaults(),s.setColorMode(i.colorModeForRenderPass()),d.call(p,s.gl,i.transform.customLayerMatrix()),s.setDirty(),i.setBaseState())}else if(i.renderPass==="translucent"){i.setCustomLayerDefaults(),s.setColorMode(i.colorModeForRenderPass()),s.setStencilMode(j.disabled);var y=p.renderingMode==="3d"?new F(i.context.gl.LEQUAL,F.ReadWrite,i.depthRangeFor3D):i.depthModeForSublayer(0,F.ReadOnly);s.setDepthMode(y),p.render(s.gl,i.transform.customLayerMatrix()),s.setDirty(),i.setBaseState(),s.bindFramebuffer.set(null)}}},Gt=function(i,a){this.context=new B(i),this.transform=a,this._tileTextures={},this.setup(),this.numSublayers=Z.maxUnderzooming+Z.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new gn,this.gpuTimers={}};Gt.prototype.resize=function(i,a){if(this.width=i*l.browser.devicePixelRatio,this.height=a*l.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var n=0,s=this.style._order;n<s.length;n+=1)this.style._layers[s[n]].resize()},Gt.prototype.setup=function(){var i=this.context,a=new l.StructArrayLayout2i4;a.emplaceBack(0,0),a.emplaceBack(l.EXTENT,0),a.emplaceBack(0,l.EXTENT),a.emplaceBack(l.EXTENT,l.EXTENT),this.tileExtentBuffer=i.createVertexBuffer(a,pr.members),this.tileExtentSegments=l.SegmentVector.simpleSegment(0,0,4,2);var n=new l.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(l.EXTENT,0),n.emplaceBack(0,l.EXTENT),n.emplaceBack(l.EXTENT,l.EXTENT),this.debugBuffer=i.createVertexBuffer(n,pr.members),this.debugSegments=l.SegmentVector.simpleSegment(0,0,4,5);var s=new l.StructArrayLayout4i8;s.emplaceBack(0,0,0,0),s.emplaceBack(l.EXTENT,0,l.EXTENT,0),s.emplaceBack(0,l.EXTENT,0,l.EXTENT),s.emplaceBack(l.EXTENT,l.EXTENT,l.EXTENT,l.EXTENT),this.rasterBoundsBuffer=i.createVertexBuffer(s,Bi.members),this.rasterBoundsSegments=l.SegmentVector.simpleSegment(0,0,4,2);var p=new l.StructArrayLayout2i4;p.emplaceBack(0,0),p.emplaceBack(1,0),p.emplaceBack(0,1),p.emplaceBack(1,1),this.viewportBuffer=i.createVertexBuffer(p,pr.members),this.viewportSegments=l.SegmentVector.simpleSegment(0,0,4,2);var d=new l.StructArrayLayout1ui2;d.emplaceBack(0),d.emplaceBack(1),d.emplaceBack(3),d.emplaceBack(2),d.emplaceBack(0),this.tileBorderIndexBuffer=i.createIndexBuffer(d);var y=new l.StructArrayLayout3ui6;y.emplaceBack(0,1,2),y.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=i.createIndexBuffer(y),this.emptyTexture=new l.Texture(i,{width:1,height:1,data:new Uint8Array([0,0,0,0])},i.gl.RGBA);var g=this.context.gl;this.stencilClearMode=new j({func:g.ALWAYS,mask:0},0,255,g.ZERO,g.ZERO,g.ZERO)},Gt.prototype.clearStencil=function(){var i=this.context,a=i.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var n=l.create();l.ortho(n,0,this.width,this.height,0,0,1),l.scale(n,n,[a.drawingBufferWidth,a.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(i,a.TRIANGLES,F.disabled,this.stencilClearMode,Q.disabled,te.disabled,na(n),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},Gt.prototype._renderTileClippingMasks=function(i,a){if(this.currentStencilSource!==i.source&&i.isTileClipped()&&a&&a.length){this.currentStencilSource=i.source;var n=this.context,s=n.gl;this.nextStencilID+a.length>256&&this.clearStencil(),n.setColorMode(Q.disabled),n.setDepthMode(F.disabled);var p=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var d=0,y=a;d<y.length;d+=1){var g=y[d],w=this._tileClippingMaskIDs[g.key]=this.nextStencilID++;p.draw(n,s.TRIANGLES,F.disabled,new j({func:s.ALWAYS,mask:0},w,255,s.KEEP,s.KEEP,s.REPLACE),Q.disabled,te.disabled,na(g.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},Gt.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var i=this.nextStencilID++,a=this.context.gl;return new j({func:a.NOTEQUAL,mask:255},i,255,a.KEEP,a.KEEP,a.REPLACE)},Gt.prototype.stencilModeForClipping=function(i){var a=this.context.gl;return new j({func:a.EQUAL,mask:255},this._tileClippingMaskIDs[i.key],0,a.KEEP,a.KEEP,a.REPLACE)},Gt.prototype.stencilConfigForOverlap=function(i){var a,n=this.context.gl,s=i.sort(function(w,A){return A.overscaledZ-w.overscaledZ}),p=s[s.length-1].overscaledZ,d=s[0].overscaledZ-p+1;if(d>1){this.currentStencilSource=void 0,this.nextStencilID+d>256&&this.clearStencil();for(var y={},g=0;g<d;g++)y[g+p]=new j({func:n.GEQUAL,mask:255},g+this.nextStencilID,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID+=d,[y,s]}return[(a={},a[p]=j.disabled,a),s]},Gt.prototype.colorModeForRenderPass=function(){var i=this.context.gl;return this._showOverdrawInspector?new Q([i.CONSTANT_COLOR,i.ONE],new l.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?Q.unblended:Q.alphaBlended},Gt.prototype.depthModeForSublayer=function(i,a,n){if(!this.opaquePassEnabledForLayer())return F.disabled;var s=1-((1+this.currentLayer)*this.numSublayers+i)*this.depthEpsilon;return new F(n||this.context.gl.LEQUAL,a,[s,s])},Gt.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},Gt.prototype.render=function(i,a){var n=this;this.style=i,this.options=a,this.lineAtlas=i.lineAtlas,this.imageManager=i.imageManager,this.glyphManager=i.glyphManager,this.symbolFadeChange=i.placement.symbolFadeChange(l.browser.now()),this.imageManager.beginFrame();var s=this.style._order,p=this.style.sourceCaches;for(var d in p){var y=p[d];y.used&&y.prepare(this.context)}var g,w,A={},z={},D={};for(var L in p){var $=p[L];A[L]=$.getVisibleCoordinates(),z[L]=A[L].slice().reverse(),D[L]=$.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var q=0;q<s.length;q++)if(this.style._layers[s[q]].is3D()){this.opaquePassCutoff=q;break}this.renderPass="offscreen";for(var K=0,V=s;K<V.length;K+=1){var X=this.style._layers[V[K]];if(X.hasOffscreenPass()&&!X.isHidden(this.transform.zoom)){var ee=z[X.source];(X.type==="custom"||ee.length)&&this.renderLayer(this,p[X.source],X,ee)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:a.showOverdrawInspector?l.Color.black:l.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=a.showOverdrawInspector,this.depthRangeFor3D=[0,1-(i._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=s.length-1;this.currentLayer>=0;this.currentLayer--){var ie=this.style._layers[s[this.currentLayer]],pe=p[ie.source],ue=A[ie.source];this._renderTileClippingMasks(ie,ue),this.renderLayer(this,pe,ie,ue)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<s.length;this.currentLayer++){var he=this.style._layers[s[this.currentLayer]],_e=p[he.source],Ie=(he.type==="symbol"?D:z)[he.source];this._renderTileClippingMasks(he,A[he.source]),this.renderLayer(this,_e,he,Ie)}this.options.showTileBoundaries&&(l.values(this.style._layers).forEach(function(Te){Te.source&&!Te.isHidden(n.transform.zoom)&&(Te.source!==(w&&w.id)&&(w=n.style.sourceCaches[Te.source]),(!g||g.getSource().maxzoom<w.getSource().maxzoom)&&(g=w))}),g&&oa.debug(this,g,g.getVisibleCoordinates())),this.options.showPadding&&function(Te){var De=Te.transform.padding;cl(Te,Te.transform.height-(De.top||0),3,ll),cl(Te,De.bottom||0,3,Cu),pl(Te,De.left||0,3,Pu),pl(Te,Te.transform.width-(De.right||0),3,ns);var Ge=Te.transform.centerPoint;(function(Ke,Xe,bt,Fe){go(Ke,Xe-1,bt-10,2,20,Fe),go(Ke,Xe-10,bt-1,20,2,Fe)})(Te,Ge.x,Te.transform.height-Ge.y,ul)}(this),this.context.setDefault()},Gt.prototype.renderLayer=function(i,a,n,s){n.isHidden(this.transform.zoom)||(n.type==="background"||n.type==="custom"||s.length)&&(this.id=n.id,this.gpuTimingStart(n),oa[n.type](i,a,n,s,this.style.placement.variableOffsets),this.gpuTimingEnd())},Gt.prototype.gpuTimingStart=function(i){if(this.options.gpuTiming){var a=this.context.extTimerQuery,n=this.gpuTimers[i.id];n||(n=this.gpuTimers[i.id]={calls:0,cpuTime:0,query:a.createQueryEXT()}),n.calls++,a.beginQueryEXT(a.TIME_ELAPSED_EXT,n.query)}},Gt.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var i=this.context.extTimerQuery;i.endQueryEXT(i.TIME_ELAPSED_EXT)}},Gt.prototype.collectGpuTimers=function(){var i=this.gpuTimers;return this.gpuTimers={},i},Gt.prototype.queryGpuTimers=function(i){var a={};for(var n in i){var s=i[n],p=this.context.extTimerQuery,d=p.getQueryObjectEXT(s.query,p.QUERY_RESULT_EXT)/1e6;p.deleteQueryEXT(s.query),a[n]=d}return a},Gt.prototype.translatePosMatrix=function(i,a,n,s,p){if(!n[0]&&!n[1])return i;var d=p?s==="map"?this.transform.angle:0:s==="viewport"?-this.transform.angle:0;if(d){var y=Math.sin(d),g=Math.cos(d);n=[n[0]*g-n[1]*y,n[0]*y+n[1]*g]}var w=[p?n[0]:Zt(a,n[0],this.transform.zoom),p?n[1]:Zt(a,n[1],this.transform.zoom),0],A=new Float32Array(16);return l.translate(A,i,w),A},Gt.prototype.saveTileTexture=function(i){var a=this._tileTextures[i.size[0]];a?a.push(i):this._tileTextures[i.size[0]]=[i]},Gt.prototype.getTileTexture=function(i){var a=this._tileTextures[i];return a&&a.length>0?a.pop():null},Gt.prototype.isPatternMissing=function(i){if(!i)return!1;if(!i.from||!i.to)return!0;var a=this.imageManager.getPattern(i.from.toString()),n=this.imageManager.getPattern(i.to.toString());return!a||!n},Gt.prototype.useProgram=function(i,a){this.cache=this.cache||{};var n=""+i+(a?a.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[n]||(this.cache[n]=new mu(this.context,i,Kc[i],a,Tu[i],this._showOverdrawInspector)),this.cache[n]},Gt.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},Gt.prototype.setBaseState=function(){var i=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(i.FUNC_ADD)},Gt.prototype.initDebugOverlayCanvas=function(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=l.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new l.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},Gt.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var as=function(i,a){this.points=i,this.planes=a};as.fromInvProjectionMatrix=function(i,a,n){var s=Math.pow(2,n),p=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(function(y){return l.transformMat4([],y,i)}).map(function(y){return l.scale$1([],y,1/y[3]/a*s)}),d=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(function(y){var g=l.sub([],p[y[0]],p[y[1]]),w=l.sub([],p[y[2]],p[y[1]]),A=l.normalize([],l.cross([],g,w)),z=-l.dot(A,p[y[1]]);return A.concat(z)});return new as(p,d)};var sa=function(i,a){this.min=i,this.max=a,this.center=l.scale$2([],l.add([],this.min,this.max),.5)};sa.prototype.quadrant=function(i){for(var a=[i%2==0,i<2],n=l.clone$2(this.min),s=l.clone$2(this.max),p=0;p<a.length;p++)n[p]=a[p]?this.min[p]:this.center[p],s[p]=a[p]?this.center[p]:this.max[p];return s[2]=this.max[2],new sa(n,s)},sa.prototype.distanceX=function(i){return Math.max(Math.min(this.max[0],i[0]),this.min[0])-i[0]},sa.prototype.distanceY=function(i){return Math.max(Math.min(this.max[1],i[1]),this.min[1])-i[1]},sa.prototype.intersects=function(i){for(var a=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],n=!0,s=0;s<i.planes.length;s++){for(var p=i.planes[s],d=0,y=0;y<a.length;y++)d+=l.dot$1(p,a[y])>=0;if(d===0)return 0;d!==a.length&&(n=!1)}if(n)return 2;for(var g=0;g<3;g++){for(var w=Number.MAX_VALUE,A=-Number.MAX_VALUE,z=0;z<i.points.length;z++){var D=i.points[z][g]-this.min[g];w=Math.min(w,D),A=Math.max(A,D)}if(A<0||w>this.max[g]-this.min[g])return 0}return 1};var An=function(i,a,n,s){if(i===void 0&&(i=0),a===void 0&&(a=0),n===void 0&&(n=0),s===void 0&&(s=0),isNaN(i)||i<0||isNaN(a)||a<0||isNaN(n)||n<0||isNaN(s)||s<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=i,this.bottom=a,this.left=n,this.right=s};An.prototype.interpolate=function(i,a,n){return a.top!=null&&i.top!=null&&(this.top=l.number(i.top,a.top,n)),a.bottom!=null&&i.bottom!=null&&(this.bottom=l.number(i.bottom,a.bottom,n)),a.left!=null&&i.left!=null&&(this.left=l.number(i.left,a.left,n)),a.right!=null&&i.right!=null&&(this.right=l.number(i.right,a.right,n)),this},An.prototype.getCenter=function(i,a){var n=l.clamp((this.left+i-this.right)/2,0,i),s=l.clamp((this.top+a-this.bottom)/2,0,a);return new l.Point(n,s)},An.prototype.equals=function(i){return this.top===i.top&&this.bottom===i.bottom&&this.left===i.left&&this.right===i.right},An.prototype.clone=function(){return new An(this.top,this.bottom,this.left,this.right)},An.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var gt=function(i,a,n,s,p){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=p===void 0||p,this._minZoom=i||0,this._maxZoom=a||22,this._minPitch=n??0,this._maxPitch=s??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new l.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new An,this._posMatrixCache={},this._alignedPosMatrixCache={}},Nt={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};gt.prototype.clone=function(){var i=new gt(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return i.tileSize=this.tileSize,i.latRange=this.latRange,i.width=this.width,i.height=this.height,i._center=this._center,i.zoom=this.zoom,i.angle=this.angle,i._fov=this._fov,i._pitch=this._pitch,i._unmodified=this._unmodified,i._edgeInsets=this._edgeInsets.clone(),i._calcMatrices(),i},Nt.minZoom.get=function(){return this._minZoom},Nt.minZoom.set=function(i){this._minZoom!==i&&(this._minZoom=i,this.zoom=Math.max(this.zoom,i))},Nt.maxZoom.get=function(){return this._maxZoom},Nt.maxZoom.set=function(i){this._maxZoom!==i&&(this._maxZoom=i,this.zoom=Math.min(this.zoom,i))},Nt.minPitch.get=function(){return this._minPitch},Nt.minPitch.set=function(i){this._minPitch!==i&&(this._minPitch=i,this.pitch=Math.max(this.pitch,i))},Nt.maxPitch.get=function(){return this._maxPitch},Nt.maxPitch.set=function(i){this._maxPitch!==i&&(this._maxPitch=i,this.pitch=Math.min(this.pitch,i))},Nt.renderWorldCopies.get=function(){return this._renderWorldCopies},Nt.renderWorldCopies.set=function(i){i===void 0?i=!0:i===null&&(i=!1),this._renderWorldCopies=i},Nt.worldSize.get=function(){return this.tileSize*this.scale},Nt.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Nt.size.get=function(){return new l.Point(this.width,this.height)},Nt.bearing.get=function(){return-this.angle/Math.PI*180},Nt.bearing.set=function(i){var a=-l.wrap(i,-180,180)*Math.PI/180;this.angle!==a&&(this._unmodified=!1,this.angle=a,this._calcMatrices(),this.rotationMatrix=l.create$2(),l.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Nt.pitch.get=function(){return this._pitch/Math.PI*180},Nt.pitch.set=function(i){var a=l.clamp(i,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==a&&(this._unmodified=!1,this._pitch=a,this._calcMatrices())},Nt.fov.get=function(){return this._fov/Math.PI*180},Nt.fov.set=function(i){i=Math.max(.01,Math.min(60,i)),this._fov!==i&&(this._unmodified=!1,this._fov=i/180*Math.PI,this._calcMatrices())},Nt.zoom.get=function(){return this._zoom},Nt.zoom.set=function(i){var a=Math.min(Math.max(i,this.minZoom),this.maxZoom);this._zoom!==a&&(this._unmodified=!1,this._zoom=a,this.scale=this.zoomScale(a),this.tileZoom=Math.floor(a),this.zoomFraction=a-this.tileZoom,this._constrain(),this._calcMatrices())},Nt.center.get=function(){return this._center},Nt.center.set=function(i){i.lat===this._center.lat&&i.lng===this._center.lng||(this._unmodified=!1,this._center=i,this._constrain(),this._calcMatrices())},Nt.padding.get=function(){return this._edgeInsets.toJSON()},Nt.padding.set=function(i){this._edgeInsets.equals(i)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,i,1),this._calcMatrices())},Nt.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},gt.prototype.isPaddingEqual=function(i){return this._edgeInsets.equals(i)},gt.prototype.interpolatePadding=function(i,a,n){this._unmodified=!1,this._edgeInsets.interpolate(i,a,n),this._constrain(),this._calcMatrices()},gt.prototype.coveringZoomLevel=function(i){var a=(i.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/i.tileSize));return Math.max(0,a)},gt.prototype.getVisibleUnwrappedCoordinates=function(i){var a=[new l.UnwrappedTileID(0,i)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new l.Point(0,0)),s=this.pointCoordinate(new l.Point(this.width,0)),p=this.pointCoordinate(new l.Point(this.width,this.height)),d=this.pointCoordinate(new l.Point(0,this.height)),y=Math.floor(Math.min(n.x,s.x,p.x,d.x)),g=Math.floor(Math.max(n.x,s.x,p.x,d.x)),w=y-1;w<=g+1;w++)w!==0&&a.push(new l.UnwrappedTileID(w,i));return a},gt.prototype.coveringTiles=function(i){var a=this.coveringZoomLevel(i),n=a;if(i.minzoom!==void 0&&a<i.minzoom)return[];i.maxzoom!==void 0&&a>i.maxzoom&&(a=i.maxzoom);var s=l.MercatorCoordinate.fromLngLat(this.center),p=Math.pow(2,a),d=[p*s.x,p*s.y,0],y=as.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,a),g=i.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(g=a);var w=function(Te){return{aabb:new sa([Te*p,0,0],[(Te+1)*p,p,0]),zoom:0,x:0,y:0,wrap:Te,fullyVisible:!1}},A=[],z=[],D=a,L=i.reparseOverscaled?n:a;if(this._renderWorldCopies)for(var $=1;$<=3;$++)A.push(w(-$)),A.push(w($));for(A.push(w(0));A.length>0;){var q=A.pop(),K=q.x,V=q.y,X=q.fullyVisible;if(!X){var ee=q.aabb.intersects(y);if(ee===0)continue;X=ee===2}var ie=q.aabb.distanceX(d),pe=q.aabb.distanceY(d),ue=Math.max(Math.abs(ie),Math.abs(pe));if(q.zoom===D||ue>3+(1<<D-q.zoom)-2&&q.zoom>=g)z.push({tileID:new l.OverscaledTileID(q.zoom===D?L:q.zoom,q.wrap,q.zoom,K,V),distanceSq:l.sqrLen([d[0]-.5-K,d[1]-.5-V])});else for(var he=0;he<4;he++){var _e=(K<<1)+he%2,Ie=(V<<1)+(he>>1);A.push({aabb:q.aabb.quadrant(he),zoom:q.zoom+1,x:_e,y:Ie,wrap:q.wrap,fullyVisible:X})}}return z.sort(function(Te,De){return Te.distanceSq-De.distanceSq}).map(function(Te){return Te.tileID})},gt.prototype.resize=function(i,a){this.width=i,this.height=a,this.pixelsToGLUnits=[2/i,-2/a],this._constrain(),this._calcMatrices()},Nt.unmodified.get=function(){return this._unmodified},gt.prototype.zoomScale=function(i){return Math.pow(2,i)},gt.prototype.scaleZoom=function(i){return Math.log(i)/Math.LN2},gt.prototype.project=function(i){var a=l.clamp(i.lat,-this.maxValidLatitude,this.maxValidLatitude);return new l.Point(l.mercatorXfromLng(i.lng)*this.worldSize,l.mercatorYfromLat(a)*this.worldSize)},gt.prototype.unproject=function(i){return new l.MercatorCoordinate(i.x/this.worldSize,i.y/this.worldSize).toLngLat()},Nt.point.get=function(){return this.project(this.center)},gt.prototype.setLocationAtPoint=function(i,a){var n=this.pointCoordinate(a),s=this.pointCoordinate(this.centerPoint),p=this.locationCoordinate(i),d=new l.MercatorCoordinate(p.x-(n.x-s.x),p.y-(n.y-s.y));this.center=this.coordinateLocation(d),this._renderWorldCopies&&(this.center=this.center.wrap())},gt.prototype.locationPoint=function(i){return this.coordinatePoint(this.locationCoordinate(i))},gt.prototype.pointLocation=function(i){return this.coordinateLocation(this.pointCoordinate(i))},gt.prototype.locationCoordinate=function(i){return l.MercatorCoordinate.fromLngLat(i)},gt.prototype.coordinateLocation=function(i){return i.toLngLat()},gt.prototype.pointCoordinate=function(i){var a=[i.x,i.y,0,1],n=[i.x,i.y,1,1];l.transformMat4(a,a,this.pixelMatrixInverse),l.transformMat4(n,n,this.pixelMatrixInverse);var s=a[3],p=n[3],d=a[1]/s,y=n[1]/p,g=a[2]/s,w=n[2]/p,A=g===w?0:(0-g)/(w-g);return new l.MercatorCoordinate(l.number(a[0]/s,n[0]/p,A)/this.worldSize,l.number(d,y,A)/this.worldSize)},gt.prototype.coordinatePoint=function(i){var a=[i.x*this.worldSize,i.y*this.worldSize,0,1];return l.transformMat4(a,a,this.pixelMatrix),new l.Point(a[0]/a[3],a[1]/a[3])},gt.prototype.getBounds=function(){return new l.LngLatBounds().extend(this.pointLocation(new l.Point(0,0))).extend(this.pointLocation(new l.Point(this.width,0))).extend(this.pointLocation(new l.Point(this.width,this.height))).extend(this.pointLocation(new l.Point(0,this.height)))},gt.prototype.getMaxBounds=function(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new l.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},gt.prototype.setMaxBounds=function(i){i?(this.lngRange=[i.getWest(),i.getEast()],this.latRange=[i.getSouth(),i.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},gt.prototype.calculatePosMatrix=function(i,a){a===void 0&&(a=!1);var n=i.key,s=a?this._alignedPosMatrixCache:this._posMatrixCache;if(s[n])return s[n];var p=i.canonical,d=this.worldSize/this.zoomScale(p.z),y=p.x+Math.pow(2,p.z)*i.wrap,g=l.identity(new Float64Array(16));return l.translate(g,g,[y*d,p.y*d,0]),l.scale(g,g,[d/l.EXTENT,d/l.EXTENT,1]),l.multiply(g,a?this.alignedProjMatrix:this.projMatrix,g),s[n]=new Float32Array(g),s[n]},gt.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},gt.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var i,a,n,s,p=-90,d=90,y=-180,g=180,w=this.size,A=this._unmodified;if(this.latRange){var z=this.latRange;p=l.mercatorYfromLat(z[1])*this.worldSize,i=(d=l.mercatorYfromLat(z[0])*this.worldSize)-p<w.y?w.y/(d-p):0}if(this.lngRange){var D=this.lngRange;y=l.mercatorXfromLng(D[0])*this.worldSize,a=(g=l.mercatorXfromLng(D[1])*this.worldSize)-y<w.x?w.x/(g-y):0}var L=this.point,$=Math.max(a||0,i||0);if($)return this.center=this.unproject(new l.Point(a?(g+y)/2:L.x,i?(d+p)/2:L.y)),this.zoom+=this.scaleZoom($),this._unmodified=A,void(this._constraining=!1);if(this.latRange){var q=L.y,K=w.y/2;q-K<p&&(s=p+K),q+K>d&&(s=d-K)}if(this.lngRange){var V=L.x,X=w.x/2;V-X<y&&(n=y+X),V+X>g&&(n=g-X)}n===void 0&&s===void 0||(this.center=this.unproject(new l.Point(n!==void 0?n:L.x,s!==void 0?s:L.y))),this._unmodified=A,this._constraining=!1}},gt.prototype._calcMatrices=function(){if(this.height){var i=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var a=Math.PI/2+this._pitch,n=this._fov*(.5+i.y/this.height),s=Math.sin(n)*this.cameraToCenterDistance/Math.sin(l.clamp(Math.PI-a-n,.01,Math.PI-.01)),p=this.point,d=p.x,y=p.y,g=1.01*(Math.cos(Math.PI/2-this._pitch)*s+this.cameraToCenterDistance),w=this.height/50,A=new Float64Array(16);l.perspective(A,this._fov,this.width/this.height,w,g),A[8]=2*-i.x/this.width,A[9]=2*i.y/this.height,l.scale(A,A,[1,-1,1]),l.translate(A,A,[0,0,-this.cameraToCenterDistance]),l.rotateX(A,A,this._pitch),l.rotateZ(A,A,this.angle),l.translate(A,A,[-d,-y,0]),this.mercatorMatrix=l.scale([],A,[this.worldSize,this.worldSize,this.worldSize]),l.scale(A,A,[1,1,l.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=A,this.invProjMatrix=l.invert([],this.projMatrix);var z=this.width%2/2,D=this.height%2/2,L=Math.cos(this.angle),$=Math.sin(this.angle),q=d-Math.round(d)+L*z+$*D,K=y-Math.round(y)+L*D+$*z,V=new Float64Array(A);if(l.translate(V,V,[q>.5?q-1:q,K>.5?K-1:K,0]),this.alignedProjMatrix=V,A=l.create(),l.scale(A,A,[this.width/2,-this.height/2,1]),l.translate(A,A,[1,-1,0]),this.labelPlaneMatrix=A,A=l.create(),l.scale(A,A,[1,-1,1]),l.translate(A,A,[-1,-1,0]),l.scale(A,A,[2/this.width,2/this.height,1]),this.glCoordMatrix=A,this.pixelMatrix=l.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(A=l.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=A,this._posMatrixCache={},this._alignedPosMatrixCache={}}},gt.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var i=this.pointCoordinate(new l.Point(0,0)),a=[i.x*this.worldSize,i.y*this.worldSize,0,1];return l.transformMat4(a,a,this.pixelMatrix)[3]/this.cameraToCenterDistance},gt.prototype.getCameraPoint=function(){var i=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new l.Point(0,i))},gt.prototype.getCameraQueryGeometry=function(i){var a=this.getCameraPoint();if(i.length===1)return[i[0],a];for(var n=a.x,s=a.y,p=a.x,d=a.y,y=0,g=i;y<g.length;y+=1){var w=g[y];n=Math.min(n,w.x),s=Math.min(s,w.y),p=Math.max(p,w.x),d=Math.max(d,w.y)}return[new l.Point(n,s),new l.Point(p,s),new l.Point(p,d),new l.Point(n,d),new l.Point(n,s)]},Object.defineProperties(gt.prototype,Nt);var fi=function(i){var a,n,s,p;this._hashName=i&&encodeURIComponent(i),l.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(a=this._updateHashUnthrottled.bind(this),n=!1,s=null,p=function(){s=null,n&&(a(),s=setTimeout(p,300),n=!1)},function(){return n=!0,s||p(),s})};fi.prototype.addTo=function(i){return this._map=i,l.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},fi.prototype.remove=function(){return l.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},fi.prototype.getHashString=function(i){var a=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,s=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),p=Math.pow(10,s),d=Math.round(a.lng*p)/p,y=Math.round(a.lat*p)/p,g=this._map.getBearing(),w=this._map.getPitch(),A="";if(A+=i?"/"+d+"/"+y+"/"+n:n+"/"+y+"/"+d,(g||w)&&(A+="/"+Math.round(10*g)/10),w&&(A+="/"+Math.round(w)),this._hashName){var z=this._hashName,D=!1,L=l.window.location.hash.slice(1).split("&").map(function($){var q=$.split("=")[0];return q===z?(D=!0,q+"="+A):$}).filter(function($){return $});return D||L.push(z+"="+A),"#"+L.join("&")}return"#"+A},fi.prototype._getCurrentHash=function(){var i,a=this,n=l.window.location.hash.replace("#","");return this._hashName?(n.split("&").map(function(s){return s.split("=")}).forEach(function(s){s[0]===a._hashName&&(i=s)}),(i&&i[1]||"").split("/")):n.split("/")},fi.prototype._onHashChange=function(){var i=this._getCurrentHash();if(i.length>=3&&!i.some(function(n){return isNaN(n)})){var a=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(i[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+i[2],+i[1]],zoom:+i[0],bearing:a,pitch:+(i[4]||0)}),!0}return!1},fi.prototype._updateHashUnthrottled=function(){var i=l.window.location.href.replace(/(#.+)?$/,this.getHashString());try{l.window.history.replaceState(l.window.history.state,null,i)}catch{}};var _o={linearity:.3,easing:l.bezier(0,0,.3,1)},Fa=l.extend({deceleration:2500,maxSpeed:1400},_o),xo=l.extend({deceleration:20,maxSpeed:1400},_o),ep=l.extend({deceleration:1e3,maxSpeed:360},_o),tp=l.extend({deceleration:1e3,maxSpeed:90},_o),bo=function(i){this._map=i,this.clear()};function wo(i,a){(!i.duration||i.duration<a.duration)&&(i.duration=a.duration,i.easing=a.easing)}function sn(i,a,n){var s=n.maxSpeed,p=n.linearity,d=n.deceleration,y=l.clamp(i*p/(a/1e3),-s,s),g=Math.abs(y)/(d*p);return{easing:n.easing,duration:1e3*g,amount:y*(g/2)}}bo.prototype.clear=function(){this._inertiaBuffer=[]},bo.prototype.record=function(i){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:l.browser.now(),settings:i})},bo.prototype._drainInertiaBuffer=function(){for(var i=this._inertiaBuffer,a=l.browser.now();i.length>0&&a-i[0].time>160;)i.shift()},bo.prototype._onMoveEnd=function(i){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var a={zoom:0,bearing:0,pitch:0,pan:new l.Point(0,0),pinchAround:void 0,around:void 0},n=0,s=this._inertiaBuffer;n<s.length;n+=1){var p=s[n].settings;a.zoom+=p.zoomDelta||0,a.bearing+=p.bearingDelta||0,a.pitch+=p.pitchDelta||0,p.panDelta&&a.pan._add(p.panDelta),p.around&&(a.around=p.around),p.pinchAround&&(a.pinchAround=p.pinchAround)}var d=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,y={};if(a.pan.mag()){var g=sn(a.pan.mag(),d,l.extend({},Fa,i||{}));y.offset=a.pan.mult(g.amount/a.pan.mag()),y.center=this._map.transform.center,wo(y,g)}if(a.zoom){var w=sn(a.zoom,d,xo);y.zoom=this._map.transform.zoom+w.amount,wo(y,w)}if(a.bearing){var A=sn(a.bearing,d,ep);y.bearing=this._map.transform.bearing+l.clamp(A.amount,-179,179),wo(y,A)}if(a.pitch){var z=sn(a.pitch,d,tp);y.pitch=this._map.transform.pitch+z.amount,wo(y,z)}if(y.zoom||y.bearing){var D=a.pinchAround===void 0?a.around:a.pinchAround;y.around=D?this._map.unproject(D):this._map.getCenter()}return this.clear(),l.extend(y,{noMoveStart:!0})}};var dr=function(i){function a(s,p,d,y){y===void 0&&(y={});var g=H.mousePos(p.getCanvasContainer(),d),w=p.unproject(g);i.call(this,s,l.extend({point:g,lngLat:w,originalEvent:d},y)),this._defaultPrevented=!1,this.target=p}i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a;var n={defaultPrevented:{configurable:!0}};return a.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(a.prototype,n),a}(l.Event),So=function(i){function a(s,p,d){var y=s==="touchend"?d.changedTouches:d.touches,g=H.touchPos(p.getCanvasContainer(),y),w=g.map(function(D){return p.unproject(D)}),A=g.reduce(function(D,L,$,q){return D.add(L.div(q.length))},new l.Point(0,0)),z=p.unproject(A);i.call(this,s,{points:g,point:A,lngLats:w,lngLat:z,originalEvent:d}),this._defaultPrevented=!1}i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a;var n={defaultPrevented:{configurable:!0}};return a.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(a.prototype,n),a}(l.Event),Mu=function(i){function a(s,p,d){i.call(this,s,{originalEvent:d}),this._defaultPrevented=!1}i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a;var n={defaultPrevented:{configurable:!0}};return a.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(a.prototype,n),a}(l.Event),hr=function(i,a){this._map=i,this._clickTolerance=a.clickTolerance};hr.prototype.reset=function(){delete this._mousedownPos},hr.prototype.wheel=function(i){return this._firePreventable(new Mu(i.type,this._map,i))},hr.prototype.mousedown=function(i,a){return this._mousedownPos=a,this._firePreventable(new dr(i.type,this._map,i))},hr.prototype.mouseup=function(i){this._map.fire(new dr(i.type,this._map,i))},hr.prototype.click=function(i,a){this._mousedownPos&&this._mousedownPos.dist(a)>=this._clickTolerance||this._map.fire(new dr(i.type,this._map,i))},hr.prototype.dblclick=function(i){return this._firePreventable(new dr(i.type,this._map,i))},hr.prototype.mouseover=function(i){this._map.fire(new dr(i.type,this._map,i))},hr.prototype.mouseout=function(i){this._map.fire(new dr(i.type,this._map,i))},hr.prototype.touchstart=function(i){return this._firePreventable(new So(i.type,this._map,i))},hr.prototype.touchmove=function(i){this._map.fire(new So(i.type,this._map,i))},hr.prototype.touchend=function(i){this._map.fire(new So(i.type,this._map,i))},hr.prototype.touchcancel=function(i){this._map.fire(new So(i.type,this._map,i))},hr.prototype._firePreventable=function(i){if(this._map.fire(i),i.defaultPrevented)return{}},hr.prototype.isEnabled=function(){return!0},hr.prototype.isActive=function(){return!1},hr.prototype.enable=function(){},hr.prototype.disable=function(){};var Ve=function(i){this._map=i};Ve.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Ve.prototype.mousemove=function(i){this._map.fire(new dr(i.type,this._map,i))},Ve.prototype.mousedown=function(){this._delayContextMenu=!0},Ve.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new dr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Ve.prototype.contextmenu=function(i){this._delayContextMenu?this._contextMenuEvent=i:this._map.fire(new dr(i.type,this._map,i)),this._map.listens("contextmenu")&&i.preventDefault()},Ve.prototype.isEnabled=function(){return!0},Ve.prototype.isActive=function(){return!1},Ve.prototype.enable=function(){},Ve.prototype.disable=function(){};var ai=function(i,a){this._map=i,this._el=i.getCanvasContainer(),this._container=i.getContainer(),this._clickTolerance=a.clickTolerance||1};function os(i,a){for(var n={},s=0;s<i.length;s++)n[i[s].identifier]=a[s];return n}ai.prototype.isEnabled=function(){return!!this._enabled},ai.prototype.isActive=function(){return!!this._active},ai.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},ai.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},ai.prototype.mousedown=function(i,a){this.isEnabled()&&i.shiftKey&&i.button===0&&(H.disableDrag(),this._startPos=this._lastPos=a,this._active=!0)},ai.prototype.mousemoveWindow=function(i,a){if(this._active){var n=a;if(!(this._lastPos.equals(n)||!this._box&&n.dist(this._startPos)<this._clickTolerance)){var s=this._startPos;this._lastPos=n,this._box||(this._box=H.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",i));var p=Math.min(s.x,n.x),d=Math.max(s.x,n.x),y=Math.min(s.y,n.y),g=Math.max(s.y,n.y);H.setTransform(this._box,"translate("+p+"px,"+y+"px)"),this._box.style.width=d-p+"px",this._box.style.height=g-y+"px"}}},ai.prototype.mouseupWindow=function(i,a){var n=this;if(this._active&&i.button===0){var s=this._startPos,p=a;if(this.reset(),H.suppressClick(),s.x!==p.x||s.y!==p.y)return this._map.fire(new l.Event("boxzoomend",{originalEvent:i})),{cameraAnimation:function(d){return d.fitScreenCoordinates(s,p,n._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",i)}},ai.prototype.keydown=function(i){this._active&&i.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",i))},ai.prototype.blur=function(){this.reset()},ai.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(H.remove(this._box),this._box=null),H.enableDrag(),delete this._startPos,delete this._lastPos},ai.prototype._fireEvent=function(i,a){return this._map.fire(new l.Event(i,{originalEvent:a}))};var Oa=function(i){this.reset(),this.numTouches=i.numTouches};Oa.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Oa.prototype.touchstart=function(i,a,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=i.timeStamp),n.length===this.numTouches&&(this.centroid=function(s){for(var p=new l.Point(0,0),d=0,y=s;d<y.length;d+=1)p._add(y[d]);return p.div(s.length)}(a),this.touches=os(n,a)))},Oa.prototype.touchmove=function(i,a,n){if(!this.aborted&&this.centroid){var s=os(n,a);for(var p in this.touches){var d=s[p];(!d||d.dist(this.touches[p])>30)&&(this.aborted=!0)}}},Oa.prototype.touchend=function(i,a,n){if((!this.centroid||i.timeStamp-this.startTime>500)&&(this.aborted=!0),n.length===0){var s=!this.aborted&&this.centroid;if(this.reset(),s)return s}};var Vi=function(i){this.singleTap=new Oa(i),this.numTaps=i.numTaps,this.reset()};Vi.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Vi.prototype.touchstart=function(i,a,n){this.singleTap.touchstart(i,a,n)},Vi.prototype.touchmove=function(i,a,n){this.singleTap.touchmove(i,a,n)},Vi.prototype.touchend=function(i,a,n){var s=this.singleTap.touchend(i,a,n);if(s){var p=i.timeStamp-this.lastTime<500,d=!this.lastTap||this.lastTap.dist(s)<30;if(p&&d||this.reset(),this.count++,this.lastTime=i.timeStamp,this.lastTap=s,this.count===this.numTaps)return this.reset(),s}};var oi=function(){this._zoomIn=new Vi({numTouches:1,numTaps:2}),this._zoomOut=new Vi({numTouches:2,numTaps:1}),this.reset()};oi.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},oi.prototype.touchstart=function(i,a,n){this._zoomIn.touchstart(i,a,n),this._zoomOut.touchstart(i,a,n)},oi.prototype.touchmove=function(i,a,n){this._zoomIn.touchmove(i,a,n),this._zoomOut.touchmove(i,a,n)},oi.prototype.touchend=function(i,a,n){var s=this,p=this._zoomIn.touchend(i,a,n),d=this._zoomOut.touchend(i,a,n);return p?(this._active=!0,i.preventDefault(),setTimeout(function(){return s.reset()},0),{cameraAnimation:function(y){return y.easeTo({duration:300,zoom:y.getZoom()+1,around:y.unproject(p)},{originalEvent:i})}}):d?(this._active=!0,i.preventDefault(),setTimeout(function(){return s.reset()},0),{cameraAnimation:function(y){return y.easeTo({duration:300,zoom:y.getZoom()-1,around:y.unproject(d)},{originalEvent:i})}}):void 0},oi.prototype.touchcancel=function(){this.reset()},oi.prototype.enable=function(){this._enabled=!0},oi.prototype.disable=function(){this._enabled=!1,this.reset()},oi.prototype.isEnabled=function(){return this._enabled},oi.prototype.isActive=function(){return this._active};var hl={0:1,2:2},Ce=function(i){this.reset(),this._clickTolerance=i.clickTolerance||1};Ce.prototype.blur=function(){this.reset()},Ce.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Ce.prototype._correctButton=function(i,a){return!1},Ce.prototype._move=function(i,a){return{}},Ce.prototype.mousedown=function(i,a){if(!this._lastPoint){var n=H.mouseButton(i);this._correctButton(i,n)&&(this._lastPoint=a,this._eventButton=n)}},Ce.prototype.mousemoveWindow=function(i,a){var n=this._lastPoint;if(n){if(i.preventDefault(),function(s,p){var d=hl[p];return s.buttons===void 0||(s.buttons&d)!==d}(i,this._eventButton))this.reset();else if(this._moved||!(a.dist(n)<this._clickTolerance))return this._moved=!0,this._lastPoint=a,this._move(n,a)}},Ce.prototype.mouseupWindow=function(i){this._lastPoint&&H.mouseButton(i)===this._eventButton&&(this._moved&&H.suppressClick(),this.reset())},Ce.prototype.enable=function(){this._enabled=!0},Ce.prototype.disable=function(){this._enabled=!1,this.reset()},Ce.prototype.isEnabled=function(){return this._enabled},Ce.prototype.isActive=function(){return this._active};var fl=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.mousedown=function(n,s){i.prototype.mousedown.call(this,n,s),this._lastPoint&&(this._active=!0)},a.prototype._correctButton=function(n,s){return s===0&&!n.ctrlKey},a.prototype._move=function(n,s){return{around:s,panDelta:s.sub(n)}},a}(Ce),ss=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype._correctButton=function(n,s){return s===0&&n.ctrlKey||s===2},a.prototype._move=function(n,s){var p=.8*(s.x-n.x);if(p)return this._active=!0,{bearingDelta:p}},a.prototype.contextmenu=function(n){n.preventDefault()},a}(Ce),dl=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype._correctButton=function(n,s){return s===0&&n.ctrlKey||s===2},a.prototype._move=function(n,s){var p=-.5*(s.y-n.y);if(p)return this._active=!0,{pitchDelta:p}},a.prototype.contextmenu=function(n){n.preventDefault()},a}(Ce),Ai=function(i){this._minTouches=1,this._clickTolerance=i.clickTolerance||1,this.reset()};Ai.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new l.Point(0,0)},Ai.prototype.touchstart=function(i,a,n){return this._calculateTransform(i,a,n)},Ai.prototype.touchmove=function(i,a,n){if(this._active&&!(n.length<this._minTouches))return i.preventDefault(),this._calculateTransform(i,a,n)},Ai.prototype.touchend=function(i,a,n){this._calculateTransform(i,a,n),this._active&&n.length<this._minTouches&&this.reset()},Ai.prototype.touchcancel=function(){this.reset()},Ai.prototype._calculateTransform=function(i,a,n){n.length>0&&(this._active=!0);var s=os(n,a),p=new l.Point(0,0),d=new l.Point(0,0),y=0;for(var g in s){var w=s[g],A=this._touches[g];A&&(p._add(w),d._add(w.sub(A)),y++,s[g]=w)}if(this._touches=s,!(y<this._minTouches)&&d.mag()){var z=d.div(y);if(this._sum._add(z),!(this._sum.mag()<this._clickTolerance))return{around:p.div(y),panDelta:z}}},Ai.prototype.enable=function(){this._enabled=!0},Ai.prototype.disable=function(){this._enabled=!1,this.reset()},Ai.prototype.isEnabled=function(){return this._enabled},Ai.prototype.isActive=function(){return this._active};var si=function(){this.reset()};function ls(i,a,n){for(var s=0;s<i.length;s++)if(i[s].identifier===n)return a[s]}function us(i,a){return Math.log(i/a)/Math.LN2}si.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},si.prototype._start=function(i){},si.prototype._move=function(i,a,n){return{}},si.prototype.touchstart=function(i,a,n){this._firstTwoTouches||n.length<2||(this._firstTwoTouches=[n[0].identifier,n[1].identifier],this._start([a[0],a[1]]))},si.prototype.touchmove=function(i,a,n){if(this._firstTwoTouches){i.preventDefault();var s=this._firstTwoTouches,p=s[1],d=ls(n,a,s[0]),y=ls(n,a,p);if(d&&y){var g=this._aroundCenter?null:d.add(y).div(2);return this._move([d,y],g,i)}}},si.prototype.touchend=function(i,a,n){if(this._firstTwoTouches){var s=this._firstTwoTouches,p=s[1],d=ls(n,a,s[0]),y=ls(n,a,p);d&&y||(this._active&&H.suppressClick(),this.reset())}},si.prototype.touchcancel=function(){this.reset()},si.prototype.enable=function(i){this._enabled=!0,this._aroundCenter=!!i&&i.around==="center"},si.prototype.disable=function(){this._enabled=!1,this.reset()},si.prototype.isEnabled=function(){return this._enabled},si.prototype.isActive=function(){return this._active};var li=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.reset=function(){i.prototype.reset.call(this),delete this._distance,delete this._startDistance},a.prototype._start=function(n){this._startDistance=this._distance=n[0].dist(n[1])},a.prototype._move=function(n,s){var p=this._distance;if(this._distance=n[0].dist(n[1]),this._active||!(Math.abs(us(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:us(this._distance,p),pinchAround:s}},a}(si);function ln(i,a){return 180*i.angleWith(a)/Math.PI}var zu=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.reset=function(){i.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},a.prototype._start=function(n){this._startVector=this._vector=n[0].sub(n[1]),this._minDiameter=n[0].dist(n[1])},a.prototype._move=function(n,s){var p=this._vector;if(this._vector=n[0].sub(n[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:ln(this._vector,p),pinchAround:s}},a.prototype._isBelowThreshold=function(n){this._minDiameter=Math.min(this._minDiameter,n.mag());var s=25/(Math.PI*this._minDiameter)*360,p=ln(n,this._startVector);return Math.abs(p)<s},a}(si);function To(i){return Math.abs(i.y)>Math.abs(i.x)}var ml=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.reset=function(){i.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},a.prototype._start=function(n){this._lastPoints=n,To(n[0].sub(n[1]))&&(this._valid=!1)},a.prototype._move=function(n,s,p){var d=n[0].sub(this._lastPoints[0]),y=n[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(d,y,p.timeStamp),this._valid)return this._lastPoints=n,this._active=!0,{pitchDelta:(d.y+y.y)/2*-.5}},a.prototype.gestureBeginsVertically=function(n,s,p){if(this._valid!==void 0)return this._valid;var d=n.mag()>=2,y=s.mag()>=2;if(d||y){if(!d||!y)return this._firstMove===void 0&&(this._firstMove=p),p-this._firstMove<100&&void 0;var g=n.y>0==s.y>0;return To(n)&&To(s)&&g}},a}(si),yl={panStep:100,bearingStep:15,pitchStep:10},Ui=function(){var i=yl;this._panStep=i.panStep,this._bearingStep=i.bearingStep,this._pitchStep=i.pitchStep,this._rotationDisabled=!1};function di(i){return i*(2-i)}Ui.prototype.blur=function(){this.reset()},Ui.prototype.reset=function(){this._active=!1},Ui.prototype.keydown=function(i){var a=this;if(!(i.altKey||i.ctrlKey||i.metaKey)){var n=0,s=0,p=0,d=0,y=0;switch(i.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:i.shiftKey?s=-1:(i.preventDefault(),d=-1);break;case 39:i.shiftKey?s=1:(i.preventDefault(),d=1);break;case 38:i.shiftKey?p=1:(i.preventDefault(),y=-1);break;case 40:i.shiftKey?p=-1:(i.preventDefault(),y=1);break;default:return}return this._rotationDisabled&&(s=0,p=0),{cameraAnimation:function(g){var w=g.getZoom();g.easeTo({duration:300,easeId:"keyboardHandler",easing:di,zoom:n?Math.round(w)+n*(i.shiftKey?2:1):w,bearing:g.getBearing()+s*a._bearingStep,pitch:g.getPitch()+p*a._pitchStep,offset:[-d*a._panStep,-y*a._panStep],center:g.getCenter()},{originalEvent:i})}}}},Ui.prototype.enable=function(){this._enabled=!0},Ui.prototype.disable=function(){this._enabled=!1,this.reset()},Ui.prototype.isEnabled=function(){return this._enabled},Ui.prototype.isActive=function(){return this._active},Ui.prototype.disableRotation=function(){this._rotationDisabled=!0},Ui.prototype.enableRotation=function(){this._rotationDisabled=!1};var ht=function(i,a){this._map=i,this._el=i.getCanvasContainer(),this._handler=a,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,l.bindAll(["_onTimeout"],this)};ht.prototype.setZoomRate=function(i){this._defaultZoomRate=i},ht.prototype.setWheelZoomRate=function(i){this._wheelZoomRate=i},ht.prototype.isEnabled=function(){return!!this._enabled},ht.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},ht.prototype.isZooming=function(){return!!this._zooming},ht.prototype.enable=function(i){this.isEnabled()||(this._enabled=!0,this._aroundCenter=i&&i.around==="center")},ht.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},ht.prototype.wheel=function(i){if(this.isEnabled()){var a=i.deltaMode===l.window.WheelEvent.DOM_DELTA_LINE?40*i.deltaY:i.deltaY,n=l.browser.now(),s=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,a!==0&&a%4.000244140625==0?this._type="wheel":a!==0&&Math.abs(a)<4?this._type="trackpad":s>400?(this._type=null,this._lastValue=a,this._timeout=setTimeout(this._onTimeout,40,i)):this._type||(this._type=Math.abs(s*a)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,a+=this._lastValue)),i.shiftKey&&a&&(a/=4),this._type&&(this._lastWheelEvent=i,this._delta-=a,this._active||this._start(i)),i.preventDefault()}},ht.prototype._onTimeout=function(i){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(i)},ht.prototype._start=function(i){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var a=H.mousePos(this._el,i);this._around=l.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(a)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},ht.prototype.renderFrame=function(){var i=this;if(this._frameId&&(this._frameId=null,this.isActive())){var a=this._map.transform;if(this._delta!==0){var n=this._type==="wheel"&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,s=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&s!==0&&(s=1/s);var p=typeof this._targetZoom=="number"?a.zoomScale(this._targetZoom):a.scale;this._targetZoom=Math.min(a.maxZoom,Math.max(a.minZoom,a.scaleZoom(p*s))),this._type==="wheel"&&(this._startZoom=a.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var d,y=typeof this._targetZoom=="number"?this._targetZoom:a.zoom,g=this._startZoom,w=this._easing,A=!1;if(this._type==="wheel"&&g&&w){var z=Math.min((l.browser.now()-this._lastWheelEventTime)/200,1),D=w(z);d=l.number(g,y,D),z<1?this._frameId||(this._frameId=!0):A=!0}else d=y,A=!0;return this._active=!0,A&&(this._active=!1,this._finishTimeout=setTimeout(function(){i._zooming=!1,i._handler._triggerRenderFrame(),delete i._targetZoom,delete i._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!A,zoomDelta:d-a.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},ht.prototype._smoothOutEasing=function(i){var a=l.ease;if(this._prevEase){var n=this._prevEase,s=(l.browser.now()-n.start)/n.duration,p=n.easing(s+.01)-n.easing(s),d=.27/Math.sqrt(p*p+1e-4)*.01,y=Math.sqrt(.0729-d*d);a=l.bezier(d,y,.25,1)}return this._prevEase={start:l.browser.now(),duration:i,easing:a},a},ht.prototype.blur=function(){this.reset()},ht.prototype.reset=function(){this._active=!1};var Hi=function(i,a){this._clickZoom=i,this._tapZoom=a};Hi.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Hi.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Hi.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Hi.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var Ei=function(){this.reset()};Ei.prototype.reset=function(){this._active=!1},Ei.prototype.blur=function(){this.reset()},Ei.prototype.dblclick=function(i,a){return i.preventDefault(),{cameraAnimation:function(n){n.easeTo({duration:300,zoom:n.getZoom()+(i.shiftKey?-1:1),around:n.unproject(a)},{originalEvent:i})}}},Ei.prototype.enable=function(){this._enabled=!0},Ei.prototype.disable=function(){this._enabled=!1,this.reset()},Ei.prototype.isEnabled=function(){return this._enabled},Ei.prototype.isActive=function(){return this._active};var Dr=function(){this._tap=new Vi({numTouches:1,numTaps:1}),this.reset()};Dr.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},Dr.prototype.touchstart=function(i,a,n){this._swipePoint||(this._tapTime&&i.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?n.length>0&&(this._swipePoint=a[0],this._swipeTouch=n[0].identifier):this._tap.touchstart(i,a,n))},Dr.prototype.touchmove=function(i,a,n){if(this._tapTime){if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;var s=a[0],p=s.y-this._swipePoint.y;return this._swipePoint=s,i.preventDefault(),this._active=!0,{zoomDelta:p/128}}}else this._tap.touchmove(i,a,n)},Dr.prototype.touchend=function(i,a,n){this._tapTime?this._swipePoint&&n.length===0&&this.reset():this._tap.touchend(i,a,n)&&(this._tapTime=i.timeStamp)},Dr.prototype.touchcancel=function(){this.reset()},Dr.prototype.enable=function(){this._enabled=!0},Dr.prototype.disable=function(){this._enabled=!1,this.reset()},Dr.prototype.isEnabled=function(){return this._enabled},Dr.prototype.isActive=function(){return this._active};var la=function(i,a,n){this._el=i,this._mousePan=a,this._touchPan=n};la.prototype.enable=function(i){this._inertiaOptions=i||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},la.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},la.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},la.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var En=function(i,a,n){this._pitchWithRotate=i.pitchWithRotate,this._mouseRotate=a,this._mousePitch=n};En.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},En.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},En.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},En.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var Ni=function(i,a,n,s){this._el=i,this._touchZoom=a,this._touchRotate=n,this._tapDragZoom=s,this._rotationDisabled=!1,this._enabled=!0};Ni.prototype.enable=function(i){this._touchZoom.enable(i),this._rotationDisabled||this._touchRotate.enable(i),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},Ni.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},Ni.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},Ni.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},Ni.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},Ni.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var jr=function(i){return i.zoom||i.drag||i.pitch||i.rotate},Io=function(i){function a(){i.apply(this,arguments)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a}(l.Event);function Ze(i){return i.panDelta&&i.panDelta.mag()||i.zoomDelta||i.bearingDelta||i.pitchDelta}var Ne=function(i,a){this._map=i,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new bo(i),this._bearingSnap=a.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(a),l.bindAll(["handleEvent","handleWindowEvent"],this);var n=this._el;this._listeners=[[n,"touchstart",{passive:!0}],[n,"touchmove",{passive:!1}],[n,"touchend",void 0],[n,"touchcancel",void 0],[n,"mousedown",void 0],[n,"mousemove",void 0],[n,"mouseup",void 0],[l.window.document,"mousemove",{capture:!0}],[l.window.document,"mouseup",void 0],[n,"mouseover",void 0],[n,"mouseout",void 0],[n,"dblclick",void 0],[n,"click",void 0],[n,"keydown",{capture:!1}],[n,"keyup",void 0],[n,"wheel",{passive:!1}],[n,"contextmenu",void 0],[l.window,"blur",void 0]];for(var s=0,p=this._listeners;s<p.length;s+=1){var d=p[s],y=d[0];H.addEventListener(y,d[1],y===l.window.document?this.handleWindowEvent:this.handleEvent,d[2])}};Ne.prototype.destroy=function(){for(var i=0,a=this._listeners;i<a.length;i+=1){var n=a[i],s=n[0];H.removeEventListener(s,n[1],s===l.window.document?this.handleWindowEvent:this.handleEvent,n[2])}},Ne.prototype._addDefaultHandlers=function(i){var a=this._map,n=a.getCanvasContainer();this._add("mapEvent",new hr(a,i));var s=a.boxZoom=new ai(a,i);this._add("boxZoom",s);var p=new oi,d=new Ei;a.doubleClickZoom=new Hi(d,p),this._add("tapZoom",p),this._add("clickZoom",d);var y=new Dr;this._add("tapDragZoom",y);var g=a.touchPitch=new ml;this._add("touchPitch",g);var w=new ss(i),A=new dl(i);a.dragRotate=new En(i,w,A),this._add("mouseRotate",w,["mousePitch"]),this._add("mousePitch",A,["mouseRotate"]);var z=new fl(i),D=new Ai(i);a.dragPan=new la(n,z,D),this._add("mousePan",z),this._add("touchPan",D,["touchZoom","touchRotate"]);var L=new zu,$=new li;a.touchZoomRotate=new Ni(n,$,L,y),this._add("touchRotate",L,["touchPan","touchZoom"]),this._add("touchZoom",$,["touchPan","touchRotate"]);var q=a.scrollZoom=new ht(a,this);this._add("scrollZoom",q,["mousePan"]);var K=a.keyboard=new Ui;this._add("keyboard",K),this._add("blockableMapEvent",new Ve(a));for(var V=0,X=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];V<X.length;V+=1){var ee=X[V];i.interactive&&i[ee]&&a[ee].enable(i[ee])}},Ne.prototype._add=function(i,a,n){this._handlers.push({handlerName:i,handler:a,allowed:n}),this._handlersById[i]=a},Ne.prototype.stop=function(i){if(!this._updatingCamera){for(var a=0,n=this._handlers;a<n.length;a+=1)n[a].handler.reset();this._inertia.clear(),this._fireEvents({},{},i),this._changes=[]}},Ne.prototype.isActive=function(){for(var i=0,a=this._handlers;i<a.length;i+=1)if(a[i].handler.isActive())return!0;return!1},Ne.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},Ne.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},Ne.prototype.isMoving=function(){return!!jr(this._eventsInProgress)||this.isZooming()},Ne.prototype._blockedByActive=function(i,a,n){for(var s in i)if(s!==n&&(!a||a.indexOf(s)<0))return!0;return!1},Ne.prototype.handleWindowEvent=function(i){this.handleEvent(i,i.type+"Window")},Ne.prototype._getMapTouches=function(i){for(var a=[],n=0,s=i;n<s.length;n+=1){var p=s[n];this._el.contains(p.target)&&a.push(p)}return a},Ne.prototype.handleEvent=function(i,a){this._updatingCamera=!0;for(var n=i.type==="renderFrame"?void 0:i,s={needsRenderFrame:!1},p={},d={},y=i.touches?this._getMapTouches(i.touches):void 0,g=y?H.touchPos(this._el,y):H.mousePos(this._el,i),w=0,A=this._handlers;w<A.length;w+=1){var z=A[w],D=z.handlerName,L=z.handler,$=z.allowed;if(L.isEnabled()){var q=void 0;this._blockedByActive(d,$,D)?L.reset():L[a||i.type]&&(q=L[a||i.type](i,g,y),this.mergeHandlerResult(s,p,q,D,n),q&&q.needsRenderFrame&&this._triggerRenderFrame()),(q||L.isActive())&&(d[D]=L)}}var K={};for(var V in this._previousActiveHandlers)d[V]||(K[V]=n);this._previousActiveHandlers=d,(Object.keys(K).length||Ze(s))&&(this._changes.push([s,p,K]),this._triggerRenderFrame()),(Object.keys(d).length||Ze(s))&&this._map._stop(!0),this._updatingCamera=!1;var X=s.cameraAnimation;X&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],X(this._map))},Ne.prototype.mergeHandlerResult=function(i,a,n,s,p){if(n){l.extend(i,n);var d={handlerName:s,originalEvent:n.originalEvent||p};n.zoomDelta!==void 0&&(a.zoom=d),n.panDelta!==void 0&&(a.drag=d),n.pitchDelta!==void 0&&(a.pitch=d),n.bearingDelta!==void 0&&(a.rotate=d)}},Ne.prototype._applyChanges=function(){for(var i={},a={},n={},s=0,p=this._changes;s<p.length;s+=1){var d=p[s],y=d[0],g=d[1],w=d[2];y.panDelta&&(i.panDelta=(i.panDelta||new l.Point(0,0))._add(y.panDelta)),y.zoomDelta&&(i.zoomDelta=(i.zoomDelta||0)+y.zoomDelta),y.bearingDelta&&(i.bearingDelta=(i.bearingDelta||0)+y.bearingDelta),y.pitchDelta&&(i.pitchDelta=(i.pitchDelta||0)+y.pitchDelta),y.around!==void 0&&(i.around=y.around),y.pinchAround!==void 0&&(i.pinchAround=y.pinchAround),y.noInertia&&(i.noInertia=y.noInertia),l.extend(a,g),l.extend(n,w)}this._updateMapTransform(i,a,n),this._changes=[]},Ne.prototype._updateMapTransform=function(i,a,n){var s=this._map,p=s.transform;if(!Ze(i))return this._fireEvents(a,n,!0);var d=i.panDelta,y=i.zoomDelta,g=i.bearingDelta,w=i.pitchDelta,A=i.around,z=i.pinchAround;z!==void 0&&(A=z),s._stop(!0),A=A||s.transform.centerPoint;var D=p.pointLocation(d?A.sub(d):A);g&&(p.bearing+=g),w&&(p.pitch+=w),y&&(p.zoom+=y),p.setLocationAtPoint(D,A),this._map._update(),i.noInertia||this._inertia.record(i),this._fireEvents(a,n,!0)},Ne.prototype._fireEvents=function(i,a,n){var s=this,p=jr(this._eventsInProgress),d=jr(i),y={};for(var g in i)this._eventsInProgress[g]||(y[g+"start"]=i[g].originalEvent),this._eventsInProgress[g]=i[g];for(var w in!p&&d&&this._fireEvent("movestart",d.originalEvent),y)this._fireEvent(w,y[w]);for(var A in d&&this._fireEvent("move",d.originalEvent),i)this._fireEvent(A,i[A].originalEvent);var z,D={};for(var L in this._eventsInProgress){var $=this._eventsInProgress[L],q=$.handlerName,K=$.originalEvent;this._handlersById[q].isActive()||(delete this._eventsInProgress[L],D[L+"end"]=z=a[q]||K)}for(var V in D)this._fireEvent(V,D[V]);var X=jr(this._eventsInProgress);if(n&&(p||d)&&!X){this._updatingCamera=!0;var ee=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),ie=function(pe){return pe!==0&&-s._bearingSnap<pe&&pe<s._bearingSnap};ee?(ie(ee.bearing||this._map.getBearing())&&(ee.bearing=0),this._map.easeTo(ee,{originalEvent:z})):(this._map.fire(new l.Event("moveend",{originalEvent:z})),ie(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},Ne.prototype._fireEvent=function(i,a){this._map.fire(new l.Event(i,a?{originalEvent:a}:{}))},Ne.prototype._requestFrame=function(){var i=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add(function(a){delete i._frameId,i.handleEvent(new Io("renderFrame",{timeStamp:a})),i._applyChanges()})},Ne.prototype._triggerRenderFrame=function(){this._frameId===void 0&&(this._frameId=this._requestFrame())};var cs=function(i){function a(n,s){i.call(this),this._moving=!1,this._zooming=!1,this.transform=n,this._bearingSnap=s.bearingSnap,l.bindAll(["_renderFrameCallback"],this)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.getCenter=function(){return new l.LngLat(this.transform.center.lng,this.transform.center.lat)},a.prototype.setCenter=function(n,s){return this.jumpTo({center:n},s)},a.prototype.panBy=function(n,s,p){return n=l.Point.convert(n).mult(-1),this.panTo(this.transform.center,l.extend({offset:n},s),p)},a.prototype.panTo=function(n,s,p){return this.easeTo(l.extend({center:n},s),p)},a.prototype.getZoom=function(){return this.transform.zoom},a.prototype.setZoom=function(n,s){return this.jumpTo({zoom:n},s),this},a.prototype.zoomTo=function(n,s,p){return this.easeTo(l.extend({zoom:n},s),p)},a.prototype.zoomIn=function(n,s){return this.zoomTo(this.getZoom()+1,n,s),this},a.prototype.zoomOut=function(n,s){return this.zoomTo(this.getZoom()-1,n,s),this},a.prototype.getBearing=function(){return this.transform.bearing},a.prototype.setBearing=function(n,s){return this.jumpTo({bearing:n},s),this},a.prototype.getPadding=function(){return this.transform.padding},a.prototype.setPadding=function(n,s){return this.jumpTo({padding:n},s),this},a.prototype.rotateTo=function(n,s,p){return this.easeTo(l.extend({bearing:n},s),p)},a.prototype.resetNorth=function(n,s){return this.rotateTo(0,l.extend({duration:1e3},n),s),this},a.prototype.resetNorthPitch=function(n,s){return this.easeTo(l.extend({bearing:0,pitch:0,duration:1e3},n),s),this},a.prototype.snapToNorth=function(n,s){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(n,s):this},a.prototype.getPitch=function(){return this.transform.pitch},a.prototype.setPitch=function(n,s){return this.jumpTo({pitch:n},s),this},a.prototype.cameraForBounds=function(n,s){n=l.LngLatBounds.convert(n);var p=s&&s.bearing||0;return this._cameraForBoxAndBearing(n.getNorthWest(),n.getSouthEast(),p,s)},a.prototype._cameraForBoxAndBearing=function(n,s,p,d){var y={top:0,bottom:0,right:0,left:0};if(typeof(d=l.extend({padding:y,offset:[0,0],maxZoom:this.transform.maxZoom},d)).padding=="number"){var g=d.padding;d.padding={top:g,bottom:g,right:g,left:g}}d.padding=l.extend(y,d.padding);var w=this.transform,A=w.padding,z=w.project(l.LngLat.convert(n)),D=w.project(l.LngLat.convert(s)),L=z.rotate(-p*Math.PI/180),$=D.rotate(-p*Math.PI/180),q=new l.Point(Math.max(L.x,$.x),Math.max(L.y,$.y)),K=new l.Point(Math.min(L.x,$.x),Math.min(L.y,$.y)),V=q.sub(K),X=(w.width-(A.left+A.right+d.padding.left+d.padding.right))/V.x,ee=(w.height-(A.top+A.bottom+d.padding.top+d.padding.bottom))/V.y;if(!(ee<0||X<0)){var ie=Math.min(w.scaleZoom(w.scale*Math.min(X,ee)),d.maxZoom),pe=typeof d.offset.x=="number"?new l.Point(d.offset.x,d.offset.y):l.Point.convert(d.offset),ue=new l.Point((d.padding.left-d.padding.right)/2,(d.padding.top-d.padding.bottom)/2).rotate(p*Math.PI/180),he=pe.add(ue).mult(w.scale/w.zoomScale(ie));return{center:w.unproject(z.add(D).div(2).sub(he)),zoom:ie,bearing:p}}l.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},a.prototype.fitBounds=function(n,s,p){return this._fitInternal(this.cameraForBounds(n,s),s,p)},a.prototype.fitScreenCoordinates=function(n,s,p,d,y){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(l.Point.convert(n)),this.transform.pointLocation(l.Point.convert(s)),p,d),d,y)},a.prototype._fitInternal=function(n,s,p){return n?(delete(s=l.extend(n,s)).padding,s.linear?this.easeTo(s,p):this.flyTo(s,p)):this},a.prototype.jumpTo=function(n,s){this.stop();var p=this.transform,d=!1,y=!1,g=!1;return"zoom"in n&&p.zoom!==+n.zoom&&(d=!0,p.zoom=+n.zoom),n.center!==void 0&&(p.center=l.LngLat.convert(n.center)),"bearing"in n&&p.bearing!==+n.bearing&&(y=!0,p.bearing=+n.bearing),"pitch"in n&&p.pitch!==+n.pitch&&(g=!0,p.pitch=+n.pitch),n.padding==null||p.isPaddingEqual(n.padding)||(p.padding=n.padding),this.fire(new l.Event("movestart",s)).fire(new l.Event("move",s)),d&&this.fire(new l.Event("zoomstart",s)).fire(new l.Event("zoom",s)).fire(new l.Event("zoomend",s)),y&&this.fire(new l.Event("rotatestart",s)).fire(new l.Event("rotate",s)).fire(new l.Event("rotateend",s)),g&&this.fire(new l.Event("pitchstart",s)).fire(new l.Event("pitch",s)).fire(new l.Event("pitchend",s)),this.fire(new l.Event("moveend",s))},a.prototype.easeTo=function(n,s){var p=this;this._stop(!1,n.easeId),((n=l.extend({offset:[0,0],duration:500,easing:l.ease},n)).animate===!1||!n.essential&&l.browser.prefersReducedMotion)&&(n.duration=0);var d=this.transform,y=this.getZoom(),g=this.getBearing(),w=this.getPitch(),A=this.getPadding(),z="zoom"in n?+n.zoom:y,D="bearing"in n?this._normalizeBearing(n.bearing,g):g,L="pitch"in n?+n.pitch:w,$="padding"in n?n.padding:d.padding,q=l.Point.convert(n.offset),K=d.centerPoint.add(q),V=d.pointLocation(K),X=l.LngLat.convert(n.center||V);this._normalizeCenter(X);var ee,ie,pe=d.project(V),ue=d.project(X).sub(pe),he=d.zoomScale(z-y);n.around&&(ee=l.LngLat.convert(n.around),ie=d.locationPoint(ee));var _e={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||z!==y,this._rotating=this._rotating||g!==D,this._pitching=this._pitching||L!==w,this._padding=!d.isPaddingEqual($),this._easeId=n.easeId,this._prepareEase(s,n.noMoveStart,_e),this._ease(function(Ie){if(p._zooming&&(d.zoom=l.number(y,z,Ie)),p._rotating&&(d.bearing=l.number(g,D,Ie)),p._pitching&&(d.pitch=l.number(w,L,Ie)),p._padding&&(d.interpolatePadding(A,$,Ie),K=d.centerPoint.add(q)),ee)d.setLocationAtPoint(ee,ie);else{var Te=d.zoomScale(d.zoom-y),De=z>y?Math.min(2,he):Math.max(.5,he),Ge=Math.pow(De,1-Ie),Ke=d.unproject(pe.add(ue.mult(Ie*Ge)).mult(Te));d.setLocationAtPoint(d.renderWorldCopies?Ke.wrap():Ke,K)}p._fireMoveEvents(s)},function(Ie){p._afterEase(s,Ie)},n),this},a.prototype._prepareEase=function(n,s,p){p===void 0&&(p={}),this._moving=!0,s||p.moving||this.fire(new l.Event("movestart",n)),this._zooming&&!p.zooming&&this.fire(new l.Event("zoomstart",n)),this._rotating&&!p.rotating&&this.fire(new l.Event("rotatestart",n)),this._pitching&&!p.pitching&&this.fire(new l.Event("pitchstart",n))},a.prototype._fireMoveEvents=function(n){this.fire(new l.Event("move",n)),this._zooming&&this.fire(new l.Event("zoom",n)),this._rotating&&this.fire(new l.Event("rotate",n)),this._pitching&&this.fire(new l.Event("pitch",n))},a.prototype._afterEase=function(n,s){if(!this._easeId||!s||this._easeId!==s){delete this._easeId;var p=this._zooming,d=this._rotating,y=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,p&&this.fire(new l.Event("zoomend",n)),d&&this.fire(new l.Event("rotateend",n)),y&&this.fire(new l.Event("pitchend",n)),this.fire(new l.Event("moveend",n))}},a.prototype.flyTo=function(n,s){var p=this;if(!n.essential&&l.browser.prefersReducedMotion){var d=l.pick(n,["center","zoom","bearing","pitch","around"]);return this.jumpTo(d,s)}this.stop(),n=l.extend({offset:[0,0],speed:1.2,curve:1.42,easing:l.ease},n);var y=this.transform,g=this.getZoom(),w=this.getBearing(),A=this.getPitch(),z=this.getPadding(),D="zoom"in n?l.clamp(+n.zoom,y.minZoom,y.maxZoom):g,L="bearing"in n?this._normalizeBearing(n.bearing,w):w,$="pitch"in n?+n.pitch:A,q="padding"in n?n.padding:y.padding,K=y.zoomScale(D-g),V=l.Point.convert(n.offset),X=y.centerPoint.add(V),ee=y.pointLocation(X),ie=l.LngLat.convert(n.center||ee);this._normalizeCenter(ie);var pe=y.project(ee),ue=y.project(ie).sub(pe),he=n.curve,_e=Math.max(y.width,y.height),Ie=_e/K,Te=ue.mag();if("minZoom"in n){var De=l.clamp(Math.min(n.minZoom,g,D),y.minZoom,y.maxZoom),Ge=_e/y.zoomScale(De-g);he=Math.sqrt(Ge/Te*2)}var Ke=he*he;function Xe(et){var Je=(Ie*Ie-_e*_e+(et?-1:1)*Ke*Ke*Te*Te)/(2*(et?Ie:_e)*Ke*Te);return Math.log(Math.sqrt(Je*Je+1)-Je)}function bt(et){return(Math.exp(et)-Math.exp(-et))/2}function Fe(et){return(Math.exp(et)+Math.exp(-et))/2}var nt=Xe(0),st=function(et){return Fe(nt)/Fe(nt+he*et)},it=function(et){return _e*((Fe(nt)*(bt(Je=nt+he*et)/Fe(Je))-bt(nt))/Ke)/Te;var Je},rt=(Xe(1)-nt)/he;if(Math.abs(Te)<1e-6||!isFinite(rt)){if(Math.abs(_e-Ie)<1e-6)return this.easeTo(n,s);var ot=Ie<_e?-1:1;rt=Math.abs(Math.log(Ie/_e))/he,it=function(){return 0},st=function(et){return Math.exp(ot*he*et)}}return n.duration="duration"in n?+n.duration:1e3*rt/("screenSpeed"in n?+n.screenSpeed/he:+n.speed),n.maxDuration&&n.duration>n.maxDuration&&(n.duration=0),this._zooming=!0,this._rotating=w!==L,this._pitching=$!==A,this._padding=!y.isPaddingEqual(q),this._prepareEase(s,!1),this._ease(function(et){var Je=et*rt,_r=1/st(Je);y.zoom=et===1?D:g+y.scaleZoom(_r),p._rotating&&(y.bearing=l.number(w,L,et)),p._pitching&&(y.pitch=l.number(A,$,et)),p._padding&&(y.interpolatePadding(z,q,et),X=y.centerPoint.add(V));var Qt=et===1?ie:y.unproject(pe.add(ue.mult(it(Je))).mult(_r));y.setLocationAtPoint(y.renderWorldCopies?Qt.wrap():Qt,X),p._fireMoveEvents(s)},function(){return p._afterEase(s)},n),this},a.prototype.isEasing=function(){return!!this._easeFrameId},a.prototype.stop=function(){return this._stop()},a.prototype._stop=function(n,s){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var p=this._onEaseEnd;delete this._onEaseEnd,p.call(this,s)}if(!n){var d=this.handlers;d&&d.stop(!1)}return this},a.prototype._ease=function(n,s,p){p.animate===!1||p.duration===0?(n(1),s()):(this._easeStart=l.browser.now(),this._easeOptions=p,this._onEaseFrame=n,this._onEaseEnd=s,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},a.prototype._renderFrameCallback=function(){var n=Math.min((l.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(n)),n<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},a.prototype._normalizeBearing=function(n,s){n=l.wrap(n,-180,180);var p=Math.abs(n-s);return Math.abs(n-360-s)<p&&(n-=360),Math.abs(n+360-s)<p&&(n+=360),n},a.prototype._normalizeCenter=function(n){var s=this.transform;if(s.renderWorldCopies&&!s.lngRange){var p=n.lng-s.center.lng;n.lng+=p>180?-360:p<-180?360:0}},a}(l.Evented),$r=function(i){i===void 0&&(i={}),this.options=i,l.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};$r.prototype.getDefaultPosition=function(){return"bottom-right"},$r.prototype.onAdd=function(i){var a=this.options&&this.options.compact;return this._map=i,this._container=H.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=H.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=H.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),a&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),a===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},$r.prototype.onRemove=function(){H.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},$r.prototype._setElementTitle=function(i,a){var n=this._map._getUIString("AttributionControl."+a);i.title=n,i.setAttribute("aria-label",n)},$r.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},$r.prototype._updateEditLink=function(){var i=this._editLink;i||(i=this._editLink=this._container.querySelector(".mapbox-improve-map"));var a=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||l.config.ACCESS_TOKEN}];if(i){var n=a.reduce(function(s,p,d){return p.value&&(s+=p.key+"="+p.value+(d<a.length-1?"&":"")),s},"?");i.href=l.config.FEEDBACK_URL+"/"+n+(this._map._hash?this._map._hash.getHashString(!0):""),i.rel="noopener nofollow",this._setElementTitle(i,"MapFeedback")}},$r.prototype._updateData=function(i){!i||i.sourceDataType!=="metadata"&&i.sourceDataType!=="visibility"&&i.dataType!=="style"||(this._updateAttributions(),this._updateEditLink())},$r.prototype._updateAttributions=function(){if(this._map.style){var i=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?i=i.concat(this.options.customAttribution.map(function(g){return typeof g!="string"?"":g})):typeof this.options.customAttribution=="string"&&i.push(this.options.customAttribution)),this._map.style.stylesheet){var a=this._map.style.stylesheet;this.styleOwner=a.owner,this.styleId=a.id}var n=this._map.style.sourceCaches;for(var s in n){var p=n[s];if(p.used){var d=p.getSource();d.attribution&&i.indexOf(d.attribution)<0&&i.push(d.attribution)}}i.sort(function(g,w){return g.length-w.length});var y=(i=i.filter(function(g,w){for(var A=w+1;A<i.length;A++)if(i[A].indexOf(g)>=0)return!1;return!0})).join(" | ");y!==this._attribHTML&&(this._attribHTML=y,i.length?(this._innerContainer.innerHTML=y,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},$r.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var qi=function(){l.bindAll(["_updateLogo"],this),l.bindAll(["_updateCompact"],this)};qi.prototype.onAdd=function(i){this._map=i,this._container=H.create("div","mapboxgl-ctrl");var a=H.create("a","mapboxgl-ctrl-logo");return a.target="_blank",a.rel="noopener nofollow",a.href="https://www.mapbox.com/",a.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),a.setAttribute("rel","noopener nofollow"),this._container.appendChild(a),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},qi.prototype.onRemove=function(){H.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},qi.prototype.getDefaultPosition=function(){return"bottom-left"},qi.prototype._updateLogo=function(i){i&&i.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")},qi.prototype._logoRequired=function(){if(this._map.style){var i=this._map.style.sourceCaches;for(var a in i)if(i[a].getSource().mapbox_logo)return!0;return!1}},qi.prototype._updateCompact=function(){var i=this._container.children;if(i.length){var a=i[0];this._map.getCanvasContainer().offsetWidth<250?a.classList.add("mapboxgl-compact"):a.classList.remove("mapboxgl-compact")}};var Lr=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Lr.prototype.add=function(i){var a=++this._id;return this._queue.push({callback:i,id:a,cancelled:!1}),a},Lr.prototype.remove=function(i){for(var a=this._currentlyRunning,n=0,s=a?this._queue.concat(a):this._queue;n<s.length;n+=1){var p=s[n];if(p.id===i)return void(p.cancelled=!0)}},Lr.prototype.run=function(i){i===void 0&&(i=0);var a=this._currentlyRunning=this._queue;this._queue=[];for(var n=0,s=a;n<s.length;n+=1){var p=s[n];if(!p.cancelled&&(p.callback(i),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},Lr.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var Xi={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},vl=l.window.HTMLImageElement,ps=l.window.HTMLElement,kt=l.window.ImageBitmap,Er={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Bu=function(i){function a(s){var p=this;if((s=l.extend({},Er,s)).minZoom!=null&&s.maxZoom!=null&&s.minZoom>s.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(s.minPitch!=null&&s.maxPitch!=null&&s.minPitch>s.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(s.minPitch!=null&&s.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(s.maxPitch!=null&&s.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var d=new gt(s.minZoom,s.maxZoom,s.minPitch,s.maxPitch,s.renderWorldCopies);if(i.call(this,d,s),this._interactive=s.interactive,this._maxTileCacheSize=s.maxTileCacheSize,this._failIfMajorPerformanceCaveat=s.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=s.preserveDrawingBuffer,this._antialias=s.antialias,this._trackResize=s.trackResize,this._bearingSnap=s.bearingSnap,this._refreshExpiredTiles=s.refreshExpiredTiles,this._fadeDuration=s.fadeDuration,this._crossSourceCollisions=s.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=s.collectResourceTiming,this._renderTaskQueue=new Lr,this._controls=[],this._mapId=l.uniqueId(),this._locale=l.extend({},Xi,s.locale),this._clickTolerance=s.clickTolerance,this._requestManager=new l.RequestManager(s.transformRequest,s.accessToken),typeof s.container=="string"){if(this._container=l.window.document.getElementById(s.container),!this._container)throw new Error("Container '"+s.container+"' not found.")}else{if(!(s.container instanceof ps))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=s.container}if(s.maxBounds&&this.setMaxBounds(s.maxBounds),l.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return p._update(!1)}),this.on("moveend",function(){return p._update(!1)}),this.on("zoom",function(){return p._update(!0)}),l.window!==void 0&&(l.window.addEventListener("online",this._onWindowOnline,!1),l.window.addEventListener("resize",this._onWindowResize,!1),l.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Ne(this,s),this._hash=s.hash&&new fi(typeof s.hash=="string"&&s.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:s.center,zoom:s.zoom,bearing:s.bearing,pitch:s.pitch}),s.bounds&&(this.resize(),this.fitBounds(s.bounds,l.extend({},s.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=s.localIdeographFontFamily,s.style&&this.setStyle(s.style,{localIdeographFontFamily:s.localIdeographFontFamily}),s.attributionControl&&this.addControl(new $r({customAttribution:s.customAttribution})),this.addControl(new qi,s.logoPosition),this.on("style.load",function(){p.transform.unmodified&&p.jumpTo(p.style.stylesheet)}),this.on("data",function(y){p._update(y.dataType==="style"),p.fire(new l.Event(y.dataType+"data",y))}),this.on("dataloading",function(y){p.fire(new l.Event(y.dataType+"dataloading",y))})}i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a;var n={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return a.prototype._getMapId=function(){return this._mapId},a.prototype.addControl=function(s,p){if(p===void 0&&(p=s.getDefaultPosition?s.getDefaultPosition():"top-right"),!s||!s.onAdd)return this.fire(new l.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var d=s.onAdd(this);this._controls.push(s);var y=this._controlPositions[p];return p.indexOf("bottom")!==-1?y.insertBefore(d,y.firstChild):y.appendChild(d),this},a.prototype.removeControl=function(s){if(!s||!s.onRemove)return this.fire(new l.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var p=this._controls.indexOf(s);return p>-1&&this._controls.splice(p,1),s.onRemove(this),this},a.prototype.hasControl=function(s){return this._controls.indexOf(s)>-1},a.prototype.resize=function(s){var p=this._containerDimensions(),d=p[0],y=p[1];if(d===this.transform.width&&y===this.transform.height)return this;this._resizeCanvas(d,y),this.transform.resize(d,y),this.painter.resize(d,y);var g=!this._moving;return g&&this.fire(new l.Event("movestart",s)).fire(new l.Event("move",s)),this.fire(new l.Event("resize",s)),g&&this.fire(new l.Event("moveend",s)),this},a.prototype.getBounds=function(){return this.transform.getBounds()},a.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},a.prototype.setMaxBounds=function(s){return this.transform.setMaxBounds(l.LngLatBounds.convert(s)),this._update()},a.prototype.setMinZoom=function(s){if((s=s??-2)>=-2&&s<=this.transform.maxZoom)return this.transform.minZoom=s,this._update(),this.getZoom()<s&&this.setZoom(s),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},a.prototype.getMinZoom=function(){return this.transform.minZoom},a.prototype.setMaxZoom=function(s){if((s=s??22)>=this.transform.minZoom)return this.transform.maxZoom=s,this._update(),this.getZoom()>s&&this.setZoom(s),this;throw new Error("maxZoom must be greater than the current minZoom")},a.prototype.getMaxZoom=function(){return this.transform.maxZoom},a.prototype.setMinPitch=function(s){if((s=s??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(s>=0&&s<=this.transform.maxPitch)return this.transform.minPitch=s,this._update(),this.getPitch()<s&&this.setPitch(s),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},a.prototype.getMinPitch=function(){return this.transform.minPitch},a.prototype.setMaxPitch=function(s){if((s=s??60)>60)throw new Error("maxPitch must be less than or equal to 60");if(s>=this.transform.minPitch)return this.transform.maxPitch=s,this._update(),this.getPitch()>s&&this.setPitch(s),this;throw new Error("maxPitch must be greater than the current minPitch")},a.prototype.getMaxPitch=function(){return this.transform.maxPitch},a.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},a.prototype.setRenderWorldCopies=function(s){return this.transform.renderWorldCopies=s,this._update()},a.prototype.project=function(s){return this.transform.locationPoint(l.LngLat.convert(s))},a.prototype.unproject=function(s){return this.transform.pointLocation(l.Point.convert(s))},a.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},a.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},a.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},a.prototype._createDelegatedListener=function(s,p,d){var y,g=this;if(s==="mouseenter"||s==="mouseover"){var w=!1;return{layer:p,listener:d,delegates:{mousemove:function(z){var D=g.getLayer(p)?g.queryRenderedFeatures(z.point,{layers:[p]}):[];D.length?w||(w=!0,d.call(g,new dr(s,g,z.originalEvent,{features:D}))):w=!1},mouseout:function(){w=!1}}}}if(s==="mouseleave"||s==="mouseout"){var A=!1;return{layer:p,listener:d,delegates:{mousemove:function(z){(g.getLayer(p)?g.queryRenderedFeatures(z.point,{layers:[p]}):[]).length?A=!0:A&&(A=!1,d.call(g,new dr(s,g,z.originalEvent)))},mouseout:function(z){A&&(A=!1,d.call(g,new dr(s,g,z.originalEvent)))}}}}return{layer:p,listener:d,delegates:(y={},y[s]=function(z){var D=g.getLayer(p)?g.queryRenderedFeatures(z.point,{layers:[p]}):[];D.length&&(z.features=D,d.call(g,z),delete z.features)},y)}},a.prototype.on=function(s,p,d){if(d===void 0)return i.prototype.on.call(this,s,p);var y=this._createDelegatedListener(s,p,d);for(var g in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[s]=this._delegatedListeners[s]||[],this._delegatedListeners[s].push(y),y.delegates)this.on(g,y.delegates[g]);return this},a.prototype.once=function(s,p,d){if(d===void 0)return i.prototype.once.call(this,s,p);var y=this._createDelegatedListener(s,p,d);for(var g in y.delegates)this.once(g,y.delegates[g]);return this},a.prototype.off=function(s,p,d){var y=this;return d===void 0?i.prototype.off.call(this,s,p):(this._delegatedListeners&&this._delegatedListeners[s]&&function(g){for(var w=g[s],A=0;A<w.length;A++){var z=w[A];if(z.layer===p&&z.listener===d){for(var D in z.delegates)y.off(D,z.delegates[D]);return w.splice(A,1),y}}}(this._delegatedListeners),this)},a.prototype.queryRenderedFeatures=function(s,p){if(!this.style)return[];var d;if(p!==void 0||s===void 0||s instanceof l.Point||Array.isArray(s)||(p=s,s=void 0),p=p||{},(s=s||[[0,0],[this.transform.width,this.transform.height]])instanceof l.Point||typeof s[0]=="number")d=[l.Point.convert(s)];else{var y=l.Point.convert(s[0]),g=l.Point.convert(s[1]);d=[y,new l.Point(g.x,y.y),g,new l.Point(y.x,g.y),y]}return this.style.queryRenderedFeatures(d,p,this.transform)},a.prototype.querySourceFeatures=function(s,p){return this.style.querySourceFeatures(s,p)},a.prototype.setStyle=function(s,p){return(p=l.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},p)).diff!==!1&&p.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&s?(this._diffStyle(s,p),this):(this._localIdeographFontFamily=p.localIdeographFontFamily,this._updateStyle(s,p))},a.prototype._getUIString=function(s){var p=this._locale[s];if(p==null)throw new Error("Missing UI string '"+s+"'");return p},a.prototype._updateStyle=function(s,p){return this.style&&(this.style.setEventedParent(null),this.style._remove()),s?(this.style=new ni(this,p||{}),this.style.setEventedParent(this,{style:this.style}),typeof s=="string"?this.style.loadURL(s):this.style.loadJSON(s),this):(delete this.style,this)},a.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new ni(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},a.prototype._diffStyle=function(s,p){var d=this;if(typeof s=="string"){var y=this._requestManager.normalizeStyleURL(s),g=this._requestManager.transformRequest(y,l.ResourceType.Style);l.getJSON(g,function(w,A){w?d.fire(new l.ErrorEvent(w)):A&&d._updateDiff(A,p)})}else typeof s=="object"&&this._updateDiff(s,p)},a.prototype._updateDiff=function(s,p){try{this.style.setState(s)&&this._update(!0)}catch(d){l.warnOnce("Unable to perform style diff: "+(d.message||d.error||d)+". Rebuilding the style from scratch."),this._updateStyle(s,p)}},a.prototype.getStyle=function(){if(this.style)return this.style.serialize()},a.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():l.warnOnce("There is no style added to the map.")},a.prototype.addSource=function(s,p){return this._lazyInitEmptyStyle(),this.style.addSource(s,p),this._update(!0)},a.prototype.isSourceLoaded=function(s){var p=this.style&&this.style.sourceCaches[s];if(p!==void 0)return p.loaded();this.fire(new l.ErrorEvent(new Error("There is no source with ID '"+s+"'")))},a.prototype.areTilesLoaded=function(){var s=this.style&&this.style.sourceCaches;for(var p in s){var d=s[p]._tiles;for(var y in d){var g=d[y];if(g.state!=="loaded"&&g.state!=="errored")return!1}}return!0},a.prototype.addSourceType=function(s,p,d){return this._lazyInitEmptyStyle(),this.style.addSourceType(s,p,d)},a.prototype.removeSource=function(s){return this.style.removeSource(s),this._update(!0)},a.prototype.getSource=function(s){return this.style.getSource(s)},a.prototype.addImage=function(s,p,d){d===void 0&&(d={});var y=d.pixelRatio;y===void 0&&(y=1);var g=d.sdf;g===void 0&&(g=!1);var w=d.stretchX,A=d.stretchY,z=d.content;if(this._lazyInitEmptyStyle(),p instanceof vl||kt&&p instanceof kt){var D=l.browser.getImageData(p);this.style.addImage(s,{data:new l.RGBAImage({width:D.width,height:D.height},D.data),pixelRatio:y,stretchX:w,stretchY:A,content:z,sdf:g,version:0})}else{if(p.width===void 0||p.height===void 0)return this.fire(new l.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var L=p;this.style.addImage(s,{data:new l.RGBAImage({width:p.width,height:p.height},new Uint8Array(p.data)),pixelRatio:y,stretchX:w,stretchY:A,content:z,sdf:g,version:0,userImage:L}),L.onAdd&&L.onAdd(this,s)}},a.prototype.updateImage=function(s,p){var d=this.style.getImage(s);if(!d)return this.fire(new l.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var y=p instanceof vl||kt&&p instanceof kt?l.browser.getImageData(p):p,g=y.width,w=y.height,A=y.data;return g===void 0||w===void 0?this.fire(new l.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))):g!==d.data.width||w!==d.data.height?this.fire(new l.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(d.data.replace(A,!(p instanceof vl||kt&&p instanceof kt)),void this.style.updateImage(s,d))},a.prototype.hasImage=function(s){return s?!!this.style.getImage(s):(this.fire(new l.ErrorEvent(new Error("Missing required image id"))),!1)},a.prototype.removeImage=function(s){this.style.removeImage(s)},a.prototype.loadImage=function(s,p){l.getImage(this._requestManager.transformRequest(s,l.ResourceType.Image),p)},a.prototype.listImages=function(){return this.style.listImages()},a.prototype.addLayer=function(s,p){return this._lazyInitEmptyStyle(),this.style.addLayer(s,p),this._update(!0)},a.prototype.moveLayer=function(s,p){return this.style.moveLayer(s,p),this._update(!0)},a.prototype.removeLayer=function(s){return this.style.removeLayer(s),this._update(!0)},a.prototype.getLayer=function(s){return this.style.getLayer(s)},a.prototype.setLayerZoomRange=function(s,p,d){return this.style.setLayerZoomRange(s,p,d),this._update(!0)},a.prototype.setFilter=function(s,p,d){return d===void 0&&(d={}),this.style.setFilter(s,p,d),this._update(!0)},a.prototype.getFilter=function(s){return this.style.getFilter(s)},a.prototype.setPaintProperty=function(s,p,d,y){return y===void 0&&(y={}),this.style.setPaintProperty(s,p,d,y),this._update(!0)},a.prototype.getPaintProperty=function(s,p){return this.style.getPaintProperty(s,p)},a.prototype.setLayoutProperty=function(s,p,d,y){return y===void 0&&(y={}),this.style.setLayoutProperty(s,p,d,y),this._update(!0)},a.prototype.getLayoutProperty=function(s,p){return this.style.getLayoutProperty(s,p)},a.prototype.setLight=function(s,p){return p===void 0&&(p={}),this._lazyInitEmptyStyle(),this.style.setLight(s,p),this._update(!0)},a.prototype.getLight=function(){return this.style.getLight()},a.prototype.setFeatureState=function(s,p){return this.style.setFeatureState(s,p),this._update()},a.prototype.removeFeatureState=function(s,p){return this.style.removeFeatureState(s,p),this._update()},a.prototype.getFeatureState=function(s){return this.style.getFeatureState(s)},a.prototype.getContainer=function(){return this._container},a.prototype.getCanvasContainer=function(){return this._canvasContainer},a.prototype.getCanvas=function(){return this._canvas},a.prototype._containerDimensions=function(){var s=0,p=0;return this._container&&(s=this._container.clientWidth||400,p=this._container.clientHeight||300),[s,p]},a.prototype._detectMissingCSS=function(){l.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&l.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},a.prototype._setupContainer=function(){var s=this._container;s.classList.add("mapboxgl-map"),(this._missingCSSCanary=H.create("div","mapboxgl-canary",s)).style.visibility="hidden",this._detectMissingCSS();var p=this._canvasContainer=H.create("div","mapboxgl-canvas-container",s);this._interactive&&p.classList.add("mapboxgl-interactive"),this._canvas=H.create("canvas","mapboxgl-canvas",p),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");var d=this._containerDimensions();this._resizeCanvas(d[0],d[1]);var y=this._controlContainer=H.create("div","mapboxgl-control-container",s),g=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(w){g[w]=H.create("div","mapboxgl-ctrl-"+w,y)}),this._container.addEventListener("scroll",this._onMapScroll,!1)},a.prototype._resizeCanvas=function(s,p){var d=l.browser.devicePixelRatio||1;this._canvas.width=d*s,this._canvas.height=d*p,this._canvas.style.width=s+"px",this._canvas.style.height=p+"px"},a.prototype._setupPainter=function(){var s=l.extend({},le.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),p=this._canvas.getContext("webgl",s)||this._canvas.getContext("experimental-webgl",s);p?(this.painter=new Gt(p,this.transform),l.webpSupported.testSupport(p)):this.fire(new l.ErrorEvent(new Error("Failed to initialize WebGL")))},a.prototype._contextLost=function(s){s.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new l.Event("webglcontextlost",{originalEvent:s}))},a.prototype._contextRestored=function(s){this._setupPainter(),this.resize(),this._update(),this.fire(new l.Event("webglcontextrestored",{originalEvent:s}))},a.prototype._onMapScroll=function(s){if(s.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},a.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},a.prototype._update=function(s){return this.style?(this._styleDirty=this._styleDirty||s,this._sourcesDirty=!0,this.triggerRepaint(),this):this},a.prototype._requestRenderFrame=function(s){return this._update(),this._renderTaskQueue.add(s)},a.prototype._cancelRenderFrame=function(s){this._renderTaskQueue.remove(s)},a.prototype._render=function(s){var p,d=this,y=0,g=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(p=g.createQueryEXT(),g.beginQueryEXT(g.TIME_ELAPSED_EXT,p),y=l.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(s),!this._removed){var w=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var A=this.transform.zoom,z=l.browser.now();this.style.zoomHistory.update(A,z);var D=new l.EvaluationParameters(A,{now:z,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),L=D.crossFadingFactor();L===1&&L===this._crossFadingFactor||(w=!0,this._crossFadingFactor=L),this.style.update(D)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new l.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new l.Event("load"))),this.style&&(this.style.hasTransitions()||w)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var $=l.browser.now()-y;g.endQueryEXT(g.TIME_ELAPSED_EXT,p),setTimeout(function(){var V=g.getQueryObjectEXT(p,g.QUERY_RESULT_EXT)/1e6;g.deleteQueryEXT(p),d.fire(new l.Event("gpu-timing-frame",{cpuTime:$,gpuTime:V}))},50)}if(this.listens("gpu-timing-layer")){var q=this.painter.collectGpuTimers();setTimeout(function(){var V=d.painter.queryGpuTimers(q);d.fire(new l.Event("gpu-timing-layer",{layerTimes:V}))},50)}var K=this._sourcesDirty||this._styleDirty||this._placementDirty;return K||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new l.Event("idle")),!this._loaded||this._fullyLoaded||K||(this._fullyLoaded=!0),this}},a.prototype.remove=function(){this._hash&&this._hash.remove();for(var s=0,p=this._controls;s<p.length;s+=1)p[s].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),l.window!==void 0&&(l.window.removeEventListener("resize",this._onWindowResize,!1),l.window.removeEventListener("orientationchange",this._onWindowResize,!1),l.window.removeEventListener("online",this._onWindowOnline,!1));var d=this.painter.context.gl.getExtension("WEBGL_lose_context");d&&d.loseContext(),ua(this._canvasContainer),ua(this._controlContainer),ua(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new l.Event("remove"))},a.prototype.triggerRepaint=function(){var s=this;this.style&&!this._frame&&(this._frame=l.browser.frame(function(p){s._frame=null,s._render(p)}))},a.prototype._onWindowOnline=function(){this._update()},a.prototype._onWindowResize=function(s){this._trackResize&&this.resize({originalEvent:s})._update()},n.showTileBoundaries.get=function(){return!!this._showTileBoundaries},n.showTileBoundaries.set=function(s){this._showTileBoundaries!==s&&(this._showTileBoundaries=s,this._update())},n.showPadding.get=function(){return!!this._showPadding},n.showPadding.set=function(s){this._showPadding!==s&&(this._showPadding=s,this._update())},n.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},n.showCollisionBoxes.set=function(s){this._showCollisionBoxes!==s&&(this._showCollisionBoxes=s,s?this.style._generateCollisionBoxes():this._update())},n.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},n.showOverdrawInspector.set=function(s){this._showOverdrawInspector!==s&&(this._showOverdrawInspector=s,this._update())},n.repaint.get=function(){return!!this._repaint},n.repaint.set=function(s){this._repaint!==s&&(this._repaint=s,this.triggerRepaint())},n.vertices.get=function(){return!!this._vertices},n.vertices.set=function(s){this._vertices=s,this._update()},a.prototype._setCacheLimits=function(s,p){l.setCacheLimits(s,p)},n.version.get=function(){return l.version},Object.defineProperties(a.prototype,n),a}(cs);function ua(i){i.parentNode&&i.parentNode.removeChild(i)}var gl={showCompass:!0,showZoom:!0,visualizePitch:!1},un=function(i){var a=this;this.options=l.extend({},gl,i),this._container=H.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",function(n){return n.preventDefault()}),this.options.showZoom&&(l.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",function(n){return a._map.zoomIn({},{originalEvent:n})}),H.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",function(n){return a._map.zoomOut({},{originalEvent:n})}),H.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(l.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",function(n){a.options.visualizePitch?a._map.resetNorthPitch({},{originalEvent:n}):a._map.resetNorth({},{originalEvent:n})}),this._compassIcon=H.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};un.prototype._updateZoomButtons=function(){var i=this._map.getZoom(),a=i===this._map.getMaxZoom(),n=i===this._map.getMinZoom();this._zoomInButton.disabled=a,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",a.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())},un.prototype._rotateCompassArrow=function(){var i=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=i},un.prototype.onAdd=function(i){return this._map=i,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new ui(this._map,this._compass,this.options.visualizePitch)),this._container},un.prototype.onRemove=function(){H.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map},un.prototype._createButton=function(i,a){var n=H.create("button",i,this._container);return n.type="button",n.addEventListener("click",a),n},un.prototype._setButtonTitle=function(i,a){var n=this._map._getUIString("NavigationControl."+a);i.title=n,i.setAttribute("aria-label",n)};var ui=function(i,a,n){n===void 0&&(n=!1),this._clickTolerance=10,this.element=a,this.mouseRotate=new ss({clickTolerance:i.dragRotate._mouseRotate._clickTolerance}),this.map=i,n&&(this.mousePitch=new dl({clickTolerance:i.dragRotate._mousePitch._clickTolerance})),l.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),H.addEventListener(a,"mousedown",this.mousedown),H.addEventListener(a,"touchstart",this.touchstart,{passive:!1}),H.addEventListener(a,"touchmove",this.touchmove),H.addEventListener(a,"touchend",this.touchend),H.addEventListener(a,"touchcancel",this.reset)};function Va(i,a,n){if(i=new l.LngLat(i.lng,i.lat),a){var s=new l.LngLat(i.lng-360,i.lat),p=new l.LngLat(i.lng+360,i.lat),d=n.locationPoint(i).distSqr(a);n.locationPoint(s).distSqr(a)<d?i=s:n.locationPoint(p).distSqr(a)<d&&(i=p)}for(;Math.abs(i.lng-n.center.lng)>180;){var y=n.locationPoint(i);if(y.x>=0&&y.y>=0&&y.x<=n.width&&y.y<=n.height)break;i.lng>n.center.lng?i.lng-=360:i.lng+=360}return i}ui.prototype.down=function(i,a){this.mouseRotate.mousedown(i,a),this.mousePitch&&this.mousePitch.mousedown(i,a),H.disableDrag()},ui.prototype.move=function(i,a){var n=this.map,s=this.mouseRotate.mousemoveWindow(i,a);if(s&&s.bearingDelta&&n.setBearing(n.getBearing()+s.bearingDelta),this.mousePitch){var p=this.mousePitch.mousemoveWindow(i,a);p&&p.pitchDelta&&n.setPitch(n.getPitch()+p.pitchDelta)}},ui.prototype.off=function(){var i=this.element;H.removeEventListener(i,"mousedown",this.mousedown),H.removeEventListener(i,"touchstart",this.touchstart,{passive:!1}),H.removeEventListener(i,"touchmove",this.touchmove),H.removeEventListener(i,"touchend",this.touchend),H.removeEventListener(i,"touchcancel",this.reset),this.offTemp()},ui.prototype.offTemp=function(){H.enableDrag(),H.removeEventListener(l.window,"mousemove",this.mousemove),H.removeEventListener(l.window,"mouseup",this.mouseup)},ui.prototype.mousedown=function(i){this.down(l.extend({},i,{ctrlKey:!0,preventDefault:function(){return i.preventDefault()}}),H.mousePos(this.element,i)),H.addEventListener(l.window,"mousemove",this.mousemove),H.addEventListener(l.window,"mouseup",this.mouseup)},ui.prototype.mousemove=function(i){this.move(i,H.mousePos(this.element,i))},ui.prototype.mouseup=function(i){this.mouseRotate.mouseupWindow(i),this.mousePitch&&this.mousePitch.mouseupWindow(i),this.offTemp()},ui.prototype.touchstart=function(i){i.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=H.touchPos(this.element,i.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return i.preventDefault()}},this._startPos))},ui.prototype.touchmove=function(i){i.targetTouches.length!==1?this.reset():(this._lastPos=H.touchPos(this.element,i.targetTouches)[0],this.move({preventDefault:function(){return i.preventDefault()}},this._lastPos))},ui.prototype.touchend=function(i){i.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},ui.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var Ki={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function hs(i,a,n){var s=i.classList;for(var p in Ki)s.remove("mapboxgl-"+n+"-anchor-"+p);s.add("mapboxgl-"+n+"-anchor-"+a)}var Ua,Ao=function(i){function a(n,s){if(i.call(this),(n instanceof l.window.HTMLElement||s)&&(n=l.extend({element:n},s)),l.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=n&&n.anchor||"center",this._color=n&&n.color||"#3FB1CE",this._scale=n&&n.scale||1,this._draggable=n&&n.draggable||!1,this._clickTolerance=n&&n.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=n&&n.rotation||0,this._rotationAlignment=n&&n.rotationAlignment||"auto",this._pitchAlignment=n&&n.pitchAlignment&&n.pitchAlignment!=="auto"?n.pitchAlignment:this._rotationAlignment,n&&n.element)this._element=n.element,this._offset=l.Point.convert(n&&n.offset||[0,0]);else{this._defaultMarker=!0,this._element=H.create("div"),this._element.setAttribute("aria-label","Map marker");var p=H.createNS("http://www.w3.org/2000/svg","svg");p.setAttributeNS(null,"display","block"),p.setAttributeNS(null,"height","41px"),p.setAttributeNS(null,"width","27px"),p.setAttributeNS(null,"viewBox","0 0 27 41");var d=H.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"stroke","none"),d.setAttributeNS(null,"stroke-width","1"),d.setAttributeNS(null,"fill","none"),d.setAttributeNS(null,"fill-rule","evenodd");var y=H.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"fill-rule","nonzero");var g=H.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"transform","translate(3.0, 29.0)"),g.setAttributeNS(null,"fill","#000000");for(var w=0,A=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];w<A.length;w+=1){var z=A[w],D=H.createNS("http://www.w3.org/2000/svg","ellipse");D.setAttributeNS(null,"opacity","0.04"),D.setAttributeNS(null,"cx","10.5"),D.setAttributeNS(null,"cy","5.80029008"),D.setAttributeNS(null,"rx",z.rx),D.setAttributeNS(null,"ry",z.ry),g.appendChild(D)}var L=H.createNS("http://www.w3.org/2000/svg","g");L.setAttributeNS(null,"fill",this._color);var $=H.createNS("http://www.w3.org/2000/svg","path");$.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),L.appendChild($);var q=H.createNS("http://www.w3.org/2000/svg","g");q.setAttributeNS(null,"opacity","0.25"),q.setAttributeNS(null,"fill","#000000");var K=H.createNS("http://www.w3.org/2000/svg","path");K.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),q.appendChild(K);var V=H.createNS("http://www.w3.org/2000/svg","g");V.setAttributeNS(null,"transform","translate(6.0, 7.0)"),V.setAttributeNS(null,"fill","#FFFFFF");var X=H.createNS("http://www.w3.org/2000/svg","g");X.setAttributeNS(null,"transform","translate(8.0, 8.0)");var ee=H.createNS("http://www.w3.org/2000/svg","circle");ee.setAttributeNS(null,"fill","#000000"),ee.setAttributeNS(null,"opacity","0.25"),ee.setAttributeNS(null,"cx","5.5"),ee.setAttributeNS(null,"cy","5.5"),ee.setAttributeNS(null,"r","5.4999962");var ie=H.createNS("http://www.w3.org/2000/svg","circle");ie.setAttributeNS(null,"fill","#FFFFFF"),ie.setAttributeNS(null,"cx","5.5"),ie.setAttributeNS(null,"cy","5.5"),ie.setAttributeNS(null,"r","5.4999962"),X.appendChild(ee),X.appendChild(ie),y.appendChild(g),y.appendChild(L),y.appendChild(q),y.appendChild(V),y.appendChild(X),p.appendChild(y),p.setAttributeNS(null,"height",41*this._scale+"px"),p.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(p),this._offset=l.Point.convert(n&&n.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",function(pe){pe.preventDefault()}),this._element.addEventListener("mousedown",function(pe){pe.preventDefault()}),hs(this._element,this._anchor,"marker"),this._popup=null}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.addTo=function(n){return this.remove(),this._map=n,n.getCanvasContainer().appendChild(this._element),n.on("move",this._update),n.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},a.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),H.remove(this._element),this._popup&&this._popup.remove(),this},a.prototype.getLngLat=function(){return this._lngLat},a.prototype.setLngLat=function(n){return this._lngLat=l.LngLat.convert(n),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},a.prototype.getElement=function(){return this._element},a.prototype.setPopup=function(n){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),n){if(!("offset"in n.options)){var s=Math.sqrt(Math.pow(13.5,2)/2);n.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[s,-1*(24.6+s)],"bottom-right":[-s,-1*(24.6+s)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=n,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},a.prototype._onKeyPress=function(n){var s=n.code,p=n.charCode||n.keyCode;s!=="Space"&&s!=="Enter"&&p!==32&&p!==13||this.togglePopup()},a.prototype._onMapClick=function(n){var s=n.originalEvent.target,p=this._element;this._popup&&(s===p||p.contains(s))&&this.togglePopup()},a.prototype.getPopup=function(){return this._popup},a.prototype.togglePopup=function(){var n=this._popup;return n?(n.isOpen()?n.remove():n.addTo(this._map),this):this},a.prototype._update=function(n){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=Va(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var s="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?s="rotateZ("+this._rotation+"deg)":this._rotationAlignment==="map"&&(s="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var p="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?p="rotateX(0deg)":this._pitchAlignment==="map"&&(p="rotateX("+this._map.getPitch()+"deg)"),n&&n.type!=="moveend"||(this._pos=this._pos.round()),H.setTransform(this._element,Ki[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+p+" "+s)}},a.prototype.getOffset=function(){return this._offset},a.prototype.setOffset=function(n){return this._offset=l.Point.convert(n),this._update(),this},a.prototype._onMove=function(n){if(!this._isDragging){var s=this._clickTolerance||this._map._clickTolerance;this._isDragging=n.point.dist(this._pointerdownPos)>=s}this._isDragging&&(this._pos=n.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new l.Event("dragstart"))),this.fire(new l.Event("drag")))},a.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new l.Event("dragend")),this._state="inactive"},a.prototype._addDragHandler=function(n){this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(this._pos).add(this._offset),this._pointerdownPos=n.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},a.prototype.setDraggable=function(n){return this._draggable=!!n,this._map&&(n?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},a.prototype.isDraggable=function(){return this._draggable},a.prototype.setRotation=function(n){return this._rotation=n||0,this._update(),this},a.prototype.getRotation=function(){return this._rotation},a.prototype.setRotationAlignment=function(n){return this._rotationAlignment=n||"auto",this._update(),this},a.prototype.getRotationAlignment=function(){return this._rotationAlignment},a.prototype.setPitchAlignment=function(n){return this._pitchAlignment=n&&n!=="auto"?n:this._rotationAlignment,this._update(),this},a.prototype.getPitchAlignment=function(){return this._pitchAlignment},a}(l.Evented),_l={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Na=0,ca=!1,xl=function(i){function a(n){i.call(this),this.options=l.extend({},_l,n),l.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.onAdd=function(n){var s;return this._map=n,this._container=H.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),s=this._setupUI,Ua!==void 0?s(Ua):l.window.navigator.permissions!==void 0?l.window.navigator.permissions.query({name:"geolocation"}).then(function(p){s(Ua=p.state!=="denied")}):s(Ua=!!l.window.navigator.geolocation),this._container},a.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(l.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),H.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Na=0,ca=!1},a.prototype._isOutOfMapMaxBounds=function(n){var s=this._map.getMaxBounds(),p=n.coords;return s&&(p.longitude<s.getWest()||p.longitude>s.getEast()||p.latitude<s.getSouth()||p.latitude>s.getNorth())},a.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},a.prototype._onSuccess=function(n){if(this._map){if(this._isOutOfMapMaxBounds(n))return this._setErrorState(),this.fire(new l.Event("outofmaxbounds",n)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=n,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(n),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(n),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new l.Event("geolocate",n)),this._finish()}},a.prototype._updateCamera=function(n){var s=new l.LngLat(n.coords.longitude,n.coords.latitude),p=n.coords.accuracy,d=this._map.getBearing(),y=l.extend({bearing:d},this.options.fitBoundsOptions);this._map.fitBounds(s.toBounds(p),y,{geolocateSource:!0})},a.prototype._updateMarker=function(n){if(n){var s=new l.LngLat(n.coords.longitude,n.coords.latitude);this._accuracyCircleMarker.setLngLat(s).addTo(this._map),this._userLocationDotMarker.setLngLat(s).addTo(this._map),this._accuracy=n.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},a.prototype._updateCircleRadius=function(){var n=this._map._container.clientHeight/2,s=this._map.unproject([0,n]),p=this._map.unproject([1,n]),d=s.distanceTo(p),y=Math.ceil(2*this._accuracy/d);this._circleElement.style.width=y+"px",this._circleElement.style.height=y+"px"},a.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},a.prototype._onError=function(n){if(this._map){if(this.options.trackUserLocation)if(n.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(n.code===3&&ca)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new l.Event("error",n)),this._finish()}},a.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},a.prototype._setupUI=function(n){var s=this;if(this._container.addEventListener("contextmenu",function(y){return y.preventDefault()}),this._geolocateButton=H.create("button","mapboxgl-ctrl-geolocate",this._container),H.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",n===!1){l.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var p=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=p,this._geolocateButton.setAttribute("aria-label",p)}else{var d=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=d,this._geolocateButton.setAttribute("aria-label",d)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=H.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Ao(this._dotElement),this._circleElement=H.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ao({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",function(y){y.geolocateSource||s._watchState!=="ACTIVE_LOCK"||y.originalEvent&&y.originalEvent.type==="resize"||(s._watchState="BACKGROUND",s._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),s._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),s.fire(new l.Event("trackuserlocationend")))})},a.prototype.trigger=function(){if(!this._setup)return l.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new l.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Na--,ca=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new l.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new l.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){var n;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Na>1?(n={maximumAge:6e5,timeout:0},ca=!0):(n=this.options.positionOptions,ca=!1),this._geolocationWatchID=l.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,n)}}else l.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},a.prototype._clearWatch=function(){l.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},a}(l.Evented),Cn={maxWidth:100,unit:"metric"},Pn=function(i){this.options=l.extend({},Cn,i),l.bindAll(["_onMove","setUnit"],this)};function fs(i,a,n){var s=n&&n.maxWidth||100,p=i._container.clientHeight/2,d=i.unproject([0,p]),y=i.unproject([s,p]),g=d.distanceTo(y);if(n&&n.unit==="imperial"){var w=3.2808*g;w>5280?kn(a,s,w/5280,i._getUIString("ScaleControl.Miles")):kn(a,s,w,i._getUIString("ScaleControl.Feet"))}else n&&n.unit==="nautical"?kn(a,s,g/1852,i._getUIString("ScaleControl.NauticalMiles")):g>=1e3?kn(a,s,g/1e3,i._getUIString("ScaleControl.Kilometers")):kn(a,s,g,i._getUIString("ScaleControl.Meters"))}function kn(i,a,n,s){var p,d,y,g=(p=n,(d=Math.pow(10,(""+Math.floor(p)).length-1))*(y=(y=p/d)>=10?10:y>=5?5:y>=3?3:y>=2?2:y>=1?1:function(w){var A=Math.pow(10,Math.ceil(-Math.log(w)/Math.LN10));return Math.round(w*A)/A}(y)));i.style.width=a*(g/n)+"px",i.innerHTML=g+" "+s}Pn.prototype.getDefaultPosition=function(){return"bottom-left"},Pn.prototype._onMove=function(){fs(this._map,this._container,this.options)},Pn.prototype.onAdd=function(i){return this._map=i,this._container=H.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",i.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Pn.prototype.onRemove=function(){H.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Pn.prototype.setUnit=function(i){this.options.unit=i,fs(this._map,this._container,this.options)};var Ci=function(i){this._fullscreen=!1,i&&i.container&&(i.container instanceof l.window.HTMLElement?this._container=i.container:l.warnOnce("Full screen control 'container' must be a DOM element.")),l.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in l.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in l.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in l.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in l.window.document&&(this._fullscreenchange="MSFullscreenChange")};Ci.prototype.onAdd=function(i){return this._map=i,this._container||(this._container=this._map.getContainer()),this._controlContainer=H.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",l.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Ci.prototype.onRemove=function(){H.remove(this._controlContainer),this._map=null,l.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Ci.prototype._checkFullscreenSupport=function(){return!!(l.window.document.fullscreenEnabled||l.window.document.mozFullScreenEnabled||l.window.document.msFullscreenEnabled||l.window.document.webkitFullscreenEnabled)},Ci.prototype._setupUI=function(){var i=this._fullscreenButton=H.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);H.create("span","mapboxgl-ctrl-icon",i).setAttribute("aria-hidden",!0),i.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),l.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Ci.prototype._updateTitle=function(){var i=this._getTitle();this._fullscreenButton.setAttribute("aria-label",i),this._fullscreenButton.title=i},Ci.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Ci.prototype._isFullscreen=function(){return this._fullscreen},Ci.prototype._changeIcon=function(){(l.window.document.fullscreenElement||l.window.document.mozFullScreenElement||l.window.document.webkitFullscreenElement||l.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Ci.prototype._onClickFullscreen=function(){this._isFullscreen()?l.window.document.exitFullscreen?l.window.document.exitFullscreen():l.window.document.mozCancelFullScreen?l.window.document.mozCancelFullScreen():l.window.document.msExitFullscreen?l.window.document.msExitFullscreen():l.window.document.webkitCancelFullScreen&&l.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var bl={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Eo=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),wl=function(i){function a(n){i.call(this),this.options=l.extend(Object.create(bl),n),l.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return i&&(a.__proto__=i),(a.prototype=Object.create(i&&i.prototype)).constructor=a,a.prototype.addTo=function(n){return this._map&&this.remove(),this._map=n,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new l.Event("open")),this},a.prototype.isOpen=function(){return!!this._map},a.prototype.remove=function(){return this._content&&H.remove(this._content),this._container&&(H.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new l.Event("close")),this},a.prototype.getLngLat=function(){return this._lngLat},a.prototype.setLngLat=function(n){return this._lngLat=l.LngLat.convert(n),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},a.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},a.prototype.getElement=function(){return this._container},a.prototype.setText=function(n){return this.setDOMContent(l.window.document.createTextNode(n))},a.prototype.setHTML=function(n){var s,p=l.window.document.createDocumentFragment(),d=l.window.document.createElement("body");for(d.innerHTML=n;s=d.firstChild;)p.appendChild(s);return this.setDOMContent(p)},a.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},a.prototype.setMaxWidth=function(n){return this.options.maxWidth=n,this._update(),this},a.prototype.setDOMContent=function(n){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=H.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(n),this._createCloseButton(),this._update(),this._focusFirstElement(),this},a.prototype.addClassName=function(n){this._container&&this._container.classList.add(n)},a.prototype.removeClassName=function(n){this._container&&this._container.classList.remove(n)},a.prototype.setOffset=function(n){return this.options.offset=n,this._update(),this},a.prototype.toggleClassName=function(n){if(this._container)return this._container.classList.toggle(n)},a.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=H.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},a.prototype._onMouseUp=function(n){this._update(n.point)},a.prototype._onMouseMove=function(n){this._update(n.point)},a.prototype._onDrag=function(n){this._update(n.point)},a.prototype._update=function(n){var s=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=H.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=H.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(D){return s._container.classList.add(D)}),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Va(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||n)){var p=this._pos=this._trackPointer&&n?n:this._map.project(this._lngLat),d=this.options.anchor,y=function D(L){if(L){if(typeof L=="number"){var $=Math.round(Math.sqrt(.5*Math.pow(L,2)));return{center:new l.Point(0,0),top:new l.Point(0,L),"top-left":new l.Point($,$),"top-right":new l.Point(-$,$),bottom:new l.Point(0,-L),"bottom-left":new l.Point($,-$),"bottom-right":new l.Point(-$,-$),left:new l.Point(L,0),right:new l.Point(-L,0)}}if(L instanceof l.Point||Array.isArray(L)){var q=l.Point.convert(L);return{center:q,top:q,"top-left":q,"top-right":q,bottom:q,"bottom-left":q,"bottom-right":q,left:q,right:q}}return{center:l.Point.convert(L.center||[0,0]),top:l.Point.convert(L.top||[0,0]),"top-left":l.Point.convert(L["top-left"]||[0,0]),"top-right":l.Point.convert(L["top-right"]||[0,0]),bottom:l.Point.convert(L.bottom||[0,0]),"bottom-left":l.Point.convert(L["bottom-left"]||[0,0]),"bottom-right":l.Point.convert(L["bottom-right"]||[0,0]),left:l.Point.convert(L.left||[0,0]),right:l.Point.convert(L.right||[0,0])}}return D(new l.Point(0,0))}(this.options.offset);if(!d){var g,w=this._container.offsetWidth,A=this._container.offsetHeight;g=p.y+y.bottom.y<A?["top"]:p.y>this._map.transform.height-A?["bottom"]:[],p.x<w/2?g.push("left"):p.x>this._map.transform.width-w/2&&g.push("right"),d=g.length===0?"bottom":g.join("-")}var z=p.add(y[d]).round();H.setTransform(this._container,Ki[d]+" translate("+z.x+"px,"+z.y+"px)"),hs(this._container,d,"popup")}},a.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var n=this._container.querySelector(Eo);n&&n.focus()}},a.prototype._onClose=function(){this.remove()},a}(l.Evented),ds={version:l.version,supported:le,setRTLTextPlugin:l.setRTLTextPlugin,getRTLTextPluginStatus:l.getRTLTextPluginStatus,Map:Bu,NavigationControl:un,GeolocateControl:xl,AttributionControl:$r,ScaleControl:Pn,FullscreenControl:Ci,Popup:wl,Marker:Ao,Style:ni,LngLat:l.LngLat,LngLatBounds:l.LngLatBounds,Point:l.Point,MercatorCoordinate:l.MercatorCoordinate,Evented:l.Evented,config:l.config,prewarm:function(){de().acquire(fe)},clearPrewarmedResources:function(){var i=Ue;i&&(i.isPreloaded()&&i.numActive()===1?(i.release(fe),Ue=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return l.config.ACCESS_TOKEN},set accessToken(i){l.config.ACCESS_TOKEN=i},get baseApiUrl(){return l.config.API_URL},set baseApiUrl(i){l.config.API_URL=i},get workerCount(){return be.workerCount},set workerCount(i){be.workerCount=i},get maxParallelImageRequests(){return l.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(i){l.config.MAX_PARALLEL_IMAGE_REQUESTS=i},clearStorage:function(i){l.clearTileCache(i)},workerUrl:""};return ds}),O})})(av);var tx=av.exports;const Un=Y.getDefaultExportFromCjs(tx);var Dc={exports:{}},rx=nx,ix={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"};function nx(m){if(!m||!m.type)return null;var f=ix[m.type];if(!f)return null;if(f==="geometry")return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:m}]};if(f==="feature")return{type:"FeatureCollection",features:[m]};if(f==="featurecollection")return m}function Sc(m){switch(m&&m.type||null){case"FeatureCollection":return m.features=m.features.reduce(function(f,b){return f.concat(Sc(b))},[]),m;case"Feature":return m.geometry?Sc(m.geometry).map(function(f){var b={type:"Feature",properties:JSON.parse(JSON.stringify(m.properties)),geometry:f};return m.id!==void 0&&(b.id=m.id),b}):[m];case"MultiPoint":return m.coordinates.map(function(f){return{type:"Point",coordinates:f}});case"MultiPolygon":return m.coordinates.map(function(f){return{type:"Polygon",coordinates:f}});case"MultiLineString":return m.coordinates.map(function(f){return{type:"LineString",coordinates:f}});case"GeometryCollection":return m.geometries.map(Sc).reduce(function(f,b){return f.concat(b)},[]);case"Point":case"Polygon":case"LineString":return[m]}}const ax=Object.freeze(Object.defineProperty({__proto__:null,default:Sc},Symbol.toStringTag,{value:"Module"})),ox=Y.getAugmentedNamespace(ax);var sx=function(f){return b(f);function b(M){return Array.isArray(M)&&M.length&&typeof M[0]=="number"?[M]:M.reduce(function(O,G){return Array.isArray(G)&&Array.isArray(G[0])?O.concat(b(G)):(O.push(G),O)},[])}},lx=rx,Tc=ox,ux=sx;Tc instanceof Function||(Tc=Tc.default);var cx=function(m){if(!m)return[];var f=Tc(lx(m)),b=[];return f.features.forEach(function(M){M.geometry&&(b=b.concat(ux(M.geometry.coordinates)))}),b},Xd=Object.prototype.toString,ov=function(f){var b=Xd.call(f),M=b==="[object Arguments]";return M||(M=b!=="[object Array]"&&f!==null&&typeof f=="object"&&typeof f.length=="number"&&f.length>=0&&Xd.call(f.callee)==="[object Function]"),M},Dp,Kd;function px(){if(Kd)return Dp;Kd=1;var m;if(!Object.keys){var f=Object.prototype.hasOwnProperty,b=Object.prototype.toString,M=ov,O=Object.prototype.propertyIsEnumerable,G=!O.call({toString:null},"toString"),l=O.call(function(){},"prototype"),le=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],H=function(se){var ge=se.constructor;return ge&&ge.prototype===se},ve={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},me=function(){if(typeof window>"u")return!1;for(var se in window)try{if(!ve["$"+se]&&f.call(window,se)&&window[se]!==null&&typeof window[se]=="object")try{H(window[se])}catch{return!0}}catch{return!0}return!1}(),Le=function(se){if(typeof window>"u"||!me)return H(se);try{return H(se)}catch{return!1}};m=function(ge){var Re=ge!==null&&typeof ge=="object",Ye=b.call(ge)==="[object Function]",je=M(ge),It=Re&&b.call(ge)==="[object String]",tt=[];if(!Re&&!Ye&&!je)throw new TypeError("Object.keys called on a non-object");var dt=l&&Ye;if(It&&ge.length>0&&!f.call(ge,0))for(var Dt=0;Dt<ge.length;++Dt)tt.push(String(Dt));if(je&&ge.length>0)for(var jt=0;jt<ge.length;++jt)tt.push(String(jt));else for(var Kt in ge)!(dt&&Kt==="prototype")&&f.call(ge,Kt)&&tt.push(String(Kt));if(G)for(var ur=Le(ge),Sr=0;Sr<le.length;++Sr)!(ur&&le[Sr]==="constructor")&&f.call(ge,le[Sr])&&tt.push(le[Sr]);return tt}}return Dp=m,Dp}var hx=Array.prototype.slice,fx=ov,Jd=Object.keys,Ic=Jd?function(f){return Jd(f)}:px(),Yd=Object.keys;Ic.shim=function(){if(Object.keys){var f=function(){var b=Object.keys(arguments);return b&&b.length===arguments.length}(1,2);f||(Object.keys=function(M){return fx(M)?Yd(hx.call(M)):Yd(M)})}else Object.keys=Ic;return Object.keys||Ic};var dx=Ic,mx=dx,yx=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",vx=Object.prototype.toString,gx=Array.prototype.concat,Qd=Y.defineDataProperty,_x=function(m){return typeof m=="function"&&vx.call(m)==="[object Function]"},sv=Y.hasPropertyDescriptors_1(),xx=function(m,f,b,M){if(f in m){if(M===!0){if(m[f]===b)return}else if(!_x(M)||!M())return}sv?Qd(m,f,b,!0):Qd(m,f,b)},lv=function(m,f){var b=arguments.length>2?arguments[2]:{},M=mx(f);yx&&(M=gx.call(M,Object.getOwnPropertySymbols(f)));for(var O=0;O<M.length;O+=1)xx(m,M[O],f[M[O]],b[M[O]])};lv.supportsDescriptors=!!sv;var eu=lv,df=typeof Map=="function"&&Map.prototype,Lp=Object.getOwnPropertyDescriptor&&df?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Ec=df&&Lp&&typeof Lp.get=="function"?Lp.get:null,em=df&&Map.prototype.forEach,mf=typeof Set=="function"&&Set.prototype,Rp=Object.getOwnPropertyDescriptor&&mf?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Cc=mf&&Rp&&typeof Rp.get=="function"?Rp.get:null,tm=mf&&Set.prototype.forEach,bx=typeof WeakMap=="function"&&WeakMap.prototype,Xl=bx?WeakMap.prototype.has:null,wx=typeof WeakSet=="function"&&WeakSet.prototype,Kl=wx?WeakSet.prototype.has:null,Sx=typeof WeakRef=="function"&&WeakRef.prototype,rm=Sx?WeakRef.prototype.deref:null,Tx=Boolean.prototype.valueOf,Ix=Object.prototype.toString,Ax=Function.prototype.toString,Ex=String.prototype.match,yf=String.prototype.slice,Xa=String.prototype.replace,Cx=String.prototype.toUpperCase,im=String.prototype.toLowerCase,uv=RegExp.prototype.test,nm=Array.prototype.concat,Nn=Array.prototype.join,Px=Array.prototype.slice,am=Math.floor,ef=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Fp=Object.getOwnPropertySymbols,tf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,$s=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Jl=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===$s||!0)?Symbol.toStringTag:null,cv=Object.prototype.propertyIsEnumerable,om=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(m){return m.__proto__}:null);function sm(m,f){if(m===1/0||m===-1/0||m!==m||m&&m>-1e3&&m<1e3||uv.call(/e/,f))return f;var b=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof m=="number"){var M=m<0?-am(-m):am(m);if(M!==m){var O=String(M),G=yf.call(f,O.length+1);return Xa.call(O,b,"$&_")+"."+Xa.call(Xa.call(G,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Xa.call(f,b,"$&_")}var rf=Y.require$$0,lm=rf.custom,um=fv(lm)?lm:null,pv={__proto__:null,double:'"',single:"'"},kx={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},Mx=function m(f,b,M,O){var G=b||{};if(ba(G,"quoteStyle")&&!ba(pv,G.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ba(G,"maxStringLength")&&(typeof G.maxStringLength=="number"?G.maxStringLength<0&&G.maxStringLength!==1/0:G.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var l=ba(G,"customInspect")?G.customInspect:!0;if(typeof l!="boolean"&&l!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ba(G,"indent")&&G.indent!==null&&G.indent!==" "&&!(parseInt(G.indent,10)===G.indent&&G.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ba(G,"numericSeparator")&&typeof G.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var le=G.numericSeparator;if(typeof f>"u")return"undefined";if(f===null)return"null";if(typeof f=="boolean")return f?"true":"false";if(typeof f=="string")return mv(f,G);if(typeof f=="number"){if(f===0)return 1/0/f>0?"0":"-0";var H=String(f);return le?sm(f,H):H}if(typeof f=="bigint"){var ve=String(f)+"n";return le?sm(f,ve):ve}var me=typeof G.depth>"u"?5:G.depth;if(typeof M>"u"&&(M=0),M>=me&&me>0&&typeof f=="object")return nf(f)?"[Array]":"[Object]";var Le=Xx(G,M);if(typeof O>"u")O=[];else if(dv(O,f)>=0)return"[Circular]";function se(Lt,Tr,Sa){if(Tr&&(O=Px.call(O),O.push(Tr)),Sa){var ii={depth:G.depth};return ba(G,"quoteStyle")&&(ii.quoteStyle=G.quoteStyle),m(Lt,ii,M+1,O)}return m(Lt,G,M+1,O)}if(typeof f=="function"&&!cm(f)){var ge=Ux(f),Re=fc(f,se);return"[Function"+(ge?": "+ge:" (anonymous)")+"]"+(Re.length>0?" { "+Nn.call(Re,", ")+" }":"")}if(fv(f)){var Ye=$s?Xa.call(String(f),/^(Symbol\(.*\))_[^)]*$/,"$1"):tf.call(f);return typeof f=="object"&&!$s?Hl(Ye):Ye}if(Gx(f)){for(var je="<"+im.call(String(f.nodeName)),It=f.attributes||[],tt=0;tt<It.length;tt++)je+=" "+It[tt].name+"="+hv(zx(It[tt].value),"double",G);return je+=">",f.childNodes&&f.childNodes.length&&(je+="..."),je+="</"+im.call(String(f.nodeName))+">",je}if(nf(f)){if(f.length===0)return"[]";var dt=fc(f,se);return Le&&!Hx(dt)?"["+af(dt,Le)+"]":"[ "+Nn.call(dt,", ")+" ]"}if(Dx(f)){var Dt=fc(f,se);return!("cause"in Error.prototype)&&"cause"in f&&!cv.call(f,"cause")?"{ ["+String(f)+"] "+Nn.call(nm.call("[cause]: "+se(f.cause),Dt),", ")+" }":Dt.length===0?"["+String(f)+"]":"{ ["+String(f)+"] "+Nn.call(Dt,", ")+" }"}if(typeof f=="object"&&l){if(um&&typeof f[um]=="function"&&rf)return rf(f,{depth:me-M});if(l!=="symbol"&&typeof f.inspect=="function")return f.inspect()}if(Nx(f)){var jt=[];return em&&em.call(f,function(Lt,Tr){jt.push(se(Tr,f,!0)+" => "+se(Lt,f))}),pm("Map",Ec.call(f),jt,Le)}if($x(f)){var Kt=[];return tm&&tm.call(f,function(Lt){Kt.push(se(Lt,f))}),pm("Set",Cc.call(f),Kt,Le)}if(qx(f))return Op("WeakMap");if(Zx(f))return Op("WeakSet");if(jx(f))return Op("WeakRef");if(Rx(f))return Hl(se(Number(f)));if(Ox(f))return Hl(se(ef.call(f)));if(Fx(f))return Hl(Tx.call(f));if(Lx(f))return Hl(se(String(f)));if(typeof window<"u"&&f===window)return"{ [object Window] }";if(typeof globalThis<"u"&&f===globalThis||typeof Y.commonjsGlobal<"u"&&f===Y.commonjsGlobal)return"{ [object globalThis] }";if(!Bx(f)&&!cm(f)){var ur=fc(f,se),Sr=om?om(f)===Object.prototype:f instanceof Object||f.constructor===Object,cr=f instanceof Object?"":"null prototype",Xr=!Sr&&Jl&&Object(f)===f&&Jl in f?yf.call(Ja(f),8,-1):cr?"Object":"",gr=Sr||typeof f.constructor!="function"?"":f.constructor.name?f.constructor.name+" ":"",gi=gr+(Xr||cr?"["+Nn.call(nm.call([],Xr||[],cr||[]),": ")+"] ":"");return ur.length===0?gi+"{}":Le?gi+"{"+af(ur,Le)+"}":gi+"{ "+Nn.call(ur,", ")+" }"}return String(f)};function hv(m,f,b){var M=b.quoteStyle||f,O=pv[M];return O+m+O}function zx(m){return Xa.call(String(m),/"/g,""")}function No(m){return!Jl||!(typeof m=="object"&&(Jl in m||typeof m[Jl]<"u"))}function nf(m){return Ja(m)==="[object Array]"&&No(m)}function Bx(m){return Ja(m)==="[object Date]"&&No(m)}function cm(m){return Ja(m)==="[object RegExp]"&&No(m)}function Dx(m){return Ja(m)==="[object Error]"&&No(m)}function Lx(m){return Ja(m)==="[object String]"&&No(m)}function Rx(m){return Ja(m)==="[object Number]"&&No(m)}function Fx(m){return Ja(m)==="[object Boolean]"&&No(m)}function fv(m){if($s)return m&&typeof m=="object"&&m instanceof Symbol;if(typeof m=="symbol")return!0;if(!m||typeof m!="object"||!tf)return!1;try{return tf.call(m),!0}catch{}return!1}function Ox(m){if(!m||typeof m!="object"||!ef)return!1;try{return ef.call(m),!0}catch{}return!1}var Vx=Object.prototype.hasOwnProperty||function(m){return m in this};function ba(m,f){return Vx.call(m,f)}function Ja(m){return Ix.call(m)}function Ux(m){if(m.name)return m.name;var f=Ex.call(Ax.call(m),/^function\s*([\w$]+)/);return f?f[1]:null}function dv(m,f){if(m.indexOf)return m.indexOf(f);for(var b=0,M=m.length;b<M;b++)if(m[b]===f)return b;return-1}function Nx(m){if(!Ec||!m||typeof m!="object")return!1;try{Ec.call(m);try{Cc.call(m)}catch{return!0}return m instanceof Map}catch{}return!1}function qx(m){if(!Xl||!m||typeof m!="object")return!1;try{Xl.call(m,Xl);try{Kl.call(m,Kl)}catch{return!0}return m instanceof WeakMap}catch{}return!1}function jx(m){if(!rm||!m||typeof m!="object")return!1;try{return rm.call(m),!0}catch{}return!1}function $x(m){if(!Cc||!m||typeof m!="object")return!1;try{Cc.call(m);try{Ec.call(m)}catch{return!0}return m instanceof Set}catch{}return!1}function Zx(m){if(!Kl||!m||typeof m!="object")return!1;try{Kl.call(m,Kl);try{Xl.call(m,Xl)}catch{return!0}return m instanceof WeakSet}catch{}return!1}function Gx(m){return!m||typeof m!="object"?!1:typeof HTMLElement<"u"&&m instanceof HTMLElement?!0:typeof m.nodeName=="string"&&typeof m.getAttribute=="function"}function mv(m,f){if(m.length>f.maxStringLength){var b=m.length-f.maxStringLength,M="... "+b+" more character"+(b>1?"s":"");return mv(yf.call(m,0,f.maxStringLength),f)+M}var O=kx[f.quoteStyle||"single"];O.lastIndex=0;var G=Xa.call(Xa.call(m,O,"\\$1"),/[\x00-\x1f]/g,Wx);return hv(G,"single",f)}function Wx(m){var f=m.charCodeAt(0),b={8:"b",9:"t",10:"n",12:"f",13:"r"}[f];return b?"\\"+b:"\\x"+(f<16?"0":"")+Cx.call(f.toString(16))}function Hl(m){return"Object("+m+")"}function Op(m){return m+" { ? }"}function pm(m,f,b,M){var O=M?af(b,M):Nn.call(b,", ");return m+" ("+f+") {"+O+"}"}function Hx(m){for(var f=0;f<m.length;f++)if(dv(m[f],`
|
|
498
|
+
`)>=0)return!1;return!0}function Xx(m,f){var b;if(m.indent===" ")b=" ";else if(typeof m.indent=="number"&&m.indent>0)b=Nn.call(Array(m.indent+1)," ");else return null;return{base:b,prev:Nn.call(Array(f+1),b)}}function af(m,f){if(m.length===0)return"";var b=`
|
|
499
|
+
`+f.prev+f.base;return b+Nn.call(m,","+b)+`
|
|
500
|
+
`+f.prev}function fc(m,f){var b=nf(m),M=[];if(b){M.length=m.length;for(var O=0;O<m.length;O++)M[O]=ba(m,O)?f(m[O],m):""}var G=typeof Fp=="function"?Fp(m):[],l;if($s){l={};for(var le=0;le<G.length;le++)l["$"+G[le]]=G[le]}for(var H in m)ba(m,H)&&(b&&String(Number(H))===H&&H<m.length||$s&&l["$"+H]instanceof Symbol||(uv.call(/[^\w$]/,H)?M.push(f(H,m)+": "+f(m[H],m)):M.push(H+": "+f(m[H],m))));if(typeof Fp=="function")for(var ve=0;ve<G.length;ve++)cv.call(m,G[ve])&&M.push("["+f(G[ve])+"]: "+f(m[G[ve]],m));return M}var Lc=function(f){return typeof f=="string"||typeof f=="symbol"},Ya=function(f){return!!f&&(typeof f=="function"||typeof f=="object")},hm=Y.type,Kx=Mx,Jx=Lc,Yx=Ya,Qx=function(f,b){if(!Yx(f))throw new hm("Assertion failed: Type(O) is not Object");if(!Jx(b))throw new hm("Assertion failed: P is not a Property Key, got "+Kx(b));return f[b]},e0=Y._isNaN,wa=function(f){return(typeof f=="number"||typeof f=="bigint")&&!e0(f)&&f!==1/0&&f!==-1/0},t0=Y.abs,r0=Y.floor,i0=Y._isNaN,n0=wa,Rc=function(f){if(typeof f!="number"||i0(f)||!n0(f))return!1;var b=t0(f);return r0(b)===b},a0=Y.callBindExports,yv=Y.callBound,o0=Y.getIntrinsic,of=o0("%ArrayBuffer%",!0),Ac=yv("ArrayBuffer.prototype.byteLength",!0),s0=yv("Object.prototype.toString"),fm=!!of&&!Ac&&new of(0).slice,dm=!!fm&&a0(fm),Zs=Ac||dm?function(f){if(!f||typeof f!="object")return!1;try{return Ac?Ac(f):dm(f,0),!0}catch{return!1}}:of?function(f){return s0(f)==="[object ArrayBuffer]"}:function(f){return!1},l0=Y.callBound,mm=l0("ArrayBuffer.prototype.byteLength",!0),u0=Zs,vv=function(f){return u0(f)?mm?mm(f):f.byteLength:NaN},c0=Y.callBound,ym=c0("SharedArrayBuffer.prototype.byteLength",!0),tu=ym?function(f){if(!f||typeof f!="object")return!1;try{return ym(f),!0}catch{return!1}}:function(f){return!1},p0=Y.type,h0=vv,f0=Y.availableTypedArrays(),d0=Y.callBound,m0=Zs,y0=tu,v0=d0("SharedArrayBuffer.prototype.byteLength",!0),Gs=function(f){var b=y0(f);if(!m0(f)&&!b)throw new p0("Assertion failed: `arrayBuffer` must be an Object with an [[ArrayBufferData]] internal slot");if((b?v0:h0)(f)===0)try{new Y.commonjsGlobal[f0[0]](f)}catch(M){return!!M&&M.name==="TypeError"}return!1},Vp,vm;function gv(){if(vm)return Vp;vm=1;var m=Y.type,f=Y.requireHasown(),b=Ya,M=Lc;return Vp=function(G,l){if(!b(G))throw new m("Assertion failed: `O` must be an Object");if(!M(l))throw new m("Assertion failed: `P` must be a Property Key");return f(G,l)},Vp}var g0=Y.getIntrinsic,_v=g0("%Array%"),_0=!_v.isArray&&Y.callBound("Object.prototype.toString"),xv=_v.isArray||function(f){return _0(f)==="[object Array]"},vf=xv,Up,gm;function bv(){return gm||(gm=1,Up=function(f){return f==="BIGUINT64"||f==="BIGINT64"}),Up}var Np,_m;function x0(){return _m||(_m=1,Np=function(f){return f==="UINT8"||f==="UINT8C"||f==="UINT16"||f==="UINT32"||f==="BIGUINT64"}),Np}var qp,xm;function b0(){if(xm)return qp;xm=1;var m=Y.pow;return qp=function(b){var M=b[3]&128?-1:1,O=(b[3]&127)<<1|b[2]>>7,G=(b[2]&127)<<16|b[1]<<8|b[0];return O===0&&G===0?M===1?0:-0:O===255&&G===0?M===1?1/0:-1/0:O===255&&G!==0?NaN:(O-=127,O===-127?M*G*m(2,-149):M*(1+G*m(2,-23))*m(2,O))},qp}var jp,bm;function w0(){if(bm)return jp;bm=1;var m=Y.pow;return jp=function(b){var M=b[7]&128?-1:1,O=(b[7]&127)<<4|(b[6]&240)>>4,G=(b[6]&15)*281474976710656+b[5]*1099511627776+b[4]*4294967296+b[3]*16777216+b[2]*65536+b[1]*256+b[0];return O===0&&G===0?M*0:O===2047&&G!==0?NaN:O===2047&&G===0?M*(1/0):(O-=1023,O===-1023?M*G*5e-324:M*(1+G/4503599627370496)*m(2,O))},jp}var $p,wm;function S0(){if(wm)return $p;wm=1;var m=Y.getIntrinsic,f=Y.pow,b=m("%Number%"),M=m("%BigInt%",!0);return $p=function(G,l,le,H){for(var ve=H?M:b,me=ve(0),Le=0;Le<G.length;Le++)me+=ve(G[Le]*f(2,8*Le));if(!le){var se=l*8;G[l-1]&128&&(me-=ve(f(2,se)))}return me},$p}var Zp,Sm;function T0(){return Sm||(Sm=1,Zp=function(f,b){for(var M=0;M<f.length;M+=1)if(!b(f[M],M,f))return!1;return!0}),Zp}var Gp,Tm;function I0(){return Tm||(Tm=1,Gp=function(f){return typeof f=="number"&&f>=0&&f<=255&&(f|0)===f}),Gp}var Ws={__proto__:null,name:{__proto__:null,$Int8Array:"INT8",$Uint8Array:"UINT8",$Uint8ClampedArray:"UINT8C",$Int16Array:"INT16",$Uint16Array:"UINT16",$Int32Array:"INT32",$Uint32Array:"UINT32",$BigInt64Array:"BIGINT64",$BigUint64Array:"BIGUINT64",$Float32Array:"FLOAT32",$Float64Array:"FLOAT64"},size:{__proto__:null,$INT8:1,$UINT8:1,$UINT8C:1,$INT16:2,$UINT16:2,$INT32:4,$UINT32:4,$BIGINT64:8,$BIGUINT64:8,$FLOAT32:4,$FLOAT64:8},choices:'"INT8", "UINT8", "UINT8C", "INT16", "UINT16", "INT32", "UINT32", "BIGINT64", "BIGUINT64", "FLOAT32", or "FLOAT64"'},Wp,Im;function A0(){if(Im)return Wp;Im=1;var m=Y.getIntrinsic,f=Y.callBound,b=Y.range,M=Y.syntax,O=Y.type,G=m("%BigInt%",!0),l=gv(),le=vf,H=bv(),ve=x0(),me=b0(),Le=w0(),se=S0(),ge=T0(),Re=I0(),Ye=f("Array.prototype.reverse"),je=f("Array.prototype.slice"),It=Ws;return Wp=function(dt,Dt,jt){if(!l(It.size,"$"+dt))throw new O("Assertion failed: `type` must be a TypedArray element type");if(!le(Dt)||!ge(Dt,Re))throw new O("Assertion failed: `rawBytes` must be an Array of bytes");if(typeof jt!="boolean")throw new O("Assertion failed: `isLittleEndian` must be a Boolean");var Kt=It.size["$"+dt];if(Dt.length!==Kt)throw new b("Assertion failed: `rawBytes` must have a length of "+Kt+" for type "+dt);var ur=H(dt);if(ur&&!G)throw new M("this environment does not support BigInts");return Dt=je(Dt,0,Kt),jt||Ye(Dt),dt==="FLOAT32"?me(Dt):dt==="FLOAT64"?Le(Dt):se(Dt,Kt,ve(dt),ur)},Wp}var Hp,Am;function wv(){if(Am)return Hp;Am=1;var m={}.toString;return Hp=Array.isArray||function(f){return m.call(f)=="[object Array]"},Hp}var Xp,Em;function E0(){if(Em)return Xp;Em=1;var m=Y.getIntrinsic,f=m("%Array.prototype.concat%"),b=Y.callBindExports,M=Y.callBound,O=M("Array.prototype.slice"),G=Y.requireShams$1()(),l=G&&Symbol.isConcatSpreadable,le=[],H=l?b.apply(f,le):null,ve=l?wv():null;return Xp=l?function(Le){for(var se=0;se<arguments.length;se+=1){var ge=arguments[se];if(ge&&typeof ge=="object"&&typeof ge[l]=="boolean"){le[l]||(le[l]=!0);var Re=ve(ge)?O(ge):[ge];Re[l]=!0,arguments[se]=Re}}return H(arguments)}:b(f,le),Xp}var C0=Y.type,P0=Y.callBound,k0=P0("TypedArray.prototype.buffer",!0),M0=Y.isTypedArray,ru=k0||function(f){if(!M0(f))throw new C0("Not a Typed Array");return f.buffer},Kp,Cm;function Sv(){if(Cm)return Kp;Cm=1;var m=Y.getIntrinsic,f=m("%Uint8Array%",!0),b=m("%Uint32Array%",!0),M=ru,O=b&&new b([305419896]),G=O&&new f(M(O));return Kp=G?G[0]===120?"little":G[0]===18?"big":G[0]===52?"mixed":"unknown":"indeterminate",Kp}var z0=Y.getIntrinsic,B0=Y.syntax,_a=Y.type,D0=Y.callBound,L0=Rc,R0=z0("%Uint8Array%",!0),Jp=D0("Array.prototype.slice"),F0=Gs,O0=A0(),V0=Zs,U0=tu,Pm=E0(),dc=Ws,N0=Sv(),q0=function(f,b,M,O,G){var l=U0(f);if(!V0(f)&&!l)throw new _a("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!L0(b))throw new _a("Assertion failed: `byteIndex` must be an integer");if(typeof M!="string"||typeof dc.size["$"+M]!="number")throw new _a("Assertion failed: `type` must be one of "+dc.choices);if(typeof O!="boolean")throw new _a("Assertion failed: `isTypedArray` must be a boolean");if(G!=="SEQ-CST"&&G!=="UNORDERED")throw new _a("Assertion failed: `order` must be either `SEQ-CST` or `UNORDERED`");if(arguments.length>5&&typeof arguments[5]!="boolean")throw new _a("Assertion failed: `isLittleEndian` must be a boolean, if present");if(F0(f))throw new _a("Assertion failed: `arrayBuffer` is detached");if(b<0)throw new _a("Assertion failed: `byteIndex` must be non-negative");var le=dc.size["$"+M];if(!le)throw new _a("Assertion failed: `type` must be one of "+dc.choices);var H;if(l)throw new B0("SharedArrayBuffer is not supported by this implementation");H=Jp(new R0(f,b),0,le);var ve=arguments.length>5?arguments[5]:N0==="little",me=ve?Jp(Pm([0,0,0,0,0,0,0,0],H),-le):Jp(Pm(H,[0,0,0,0,0,0,0,0]),0,le);return O0(M,me,ve)},km=Y._isNaN,Tv=function(f,b){return f===b?f===0?1/f===1/b:!0:km(f)&&km(b)},mc=Y.type,j0=Ya,$0=Lc,Mm=Tv,zm=function(){try{return delete[].length,!0}catch{return!1}}(),Z0=function(f,b,M,O){if(!j0(f))throw new mc("Assertion failed: `O` must be an Object");if(!$0(b))throw new mc("Assertion failed: `P` must be a Property Key");if(typeof O!="boolean")throw new mc("Assertion failed: `Throw` must be a Boolean");if(O){if(f[b]=M,zm&&!Mm(f[b],M))throw new mc("Attempted to assign to readonly property.");return!0}try{return f[b]=M,zm?Mm(f[b],M):!0}catch{return!1}},Yp,Bm;function G0(){if(Bm)return Yp;Bm=1;var m=Y.getIntrinsic,f=m("%BigInt%",!0),b=Y.type,M=Y.syntax;return Yp=function(G){if(typeof G!="string")throw new b("`argument` must be a string");if(!f)throw new M("BigInts are not supported in this environment");try{return f(G)}catch{return}},Yp}var Qp,Dm;function W0(){return Dm||(Dm=1,Qp=function(f){return f===null||typeof f!="function"&&typeof f!="object"}),Qp}var Iv=Y.callBound,H0=Iv("Date.prototype.getDay"),X0=function(f){try{return H0(f),!0}catch{return!1}},K0=Iv("Object.prototype.toString"),J0="[object Date]",Y0=Y.requireShams()(),Av=function(f){return typeof f!="object"||f===null?!1:Y0?X0(f):K0(f)===J0},sf={exports:{}},Ev=Y.callBound,Q0=Ev("Object.prototype.toString"),eb=Y.requireHasSymbols()(),tb=Y.requireSafeRegexTest();if(eb){var rb=Ev("Symbol.prototype.toString"),ib=tb(/^Symbol\(.*\)$/),nb=function(f){return typeof f.valueOf()!="symbol"?!1:ib(rb(f))};sf.exports=function(f){if(typeof f=="symbol")return!0;if(!f||typeof f!="object"||Q0(f)!=="[object Symbol]")return!1;try{return nb(f)}catch{return!1}}}else sf.exports=function(f){return!1};var Cv=sf.exports,eh,Lm;function ab(){if(Lm)return eh;Lm=1;var m=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol",f=W0(),b=Y.isCallable,M=Av,O=Cv,G=function(H,ve){if(typeof H>"u"||H===null)throw new TypeError("Cannot call method on "+H);if(typeof ve!="string"||ve!=="number"&&ve!=="string")throw new TypeError('hint must be "string" or "number"');var me=ve==="string"?["toString","valueOf"]:["valueOf","toString"],Le,se,ge;for(ge=0;ge<me.length;++ge)if(Le=H[me[ge]],b(Le)&&(se=Le.call(H),f(se)))return se;throw new TypeError("No default value")},l=function(H,ve){var me=H[ve];if(me!==null&&typeof me<"u"){if(!b(me))throw new TypeError(me+" returned for property "+String(ve)+" of object "+H+" is not a function");return me}};return eh=function(H){if(f(H))return H;var ve="default";arguments.length>1&&(arguments[1]===String?ve="string":arguments[1]===Number&&(ve="number"));var me;if(m&&(Symbol.toPrimitive?me=l(H,Symbol.toPrimitive):O(H)&&(me=Symbol.prototype.valueOf)),typeof me<"u"){var Le=me.call(H,ve);if(f(Le))return Le;throw new TypeError("unable to convert exotic object to primitive")}return ve==="default"&&(M(H)||O(H))&&(ve="string"),G(H,ve==="default"?"number":ve)},eh}var th,Rm;function Pv(){if(Rm)return th;Rm=1;var m=ab();return th=function(b){return arguments.length>1?m(b,arguments[1]):m(b)},th}var rh,Fm;function kv(){if(Fm)return rh;Fm=1;var m=Y.getIntrinsic,f=m("%BigInt%",!0),b=m("%Number%"),M=Y.type,O=Y.syntax,G=G0(),l=Pv();return rh=function(H){if(!f)throw new O("BigInts are not supported in this environment");var ve=l(H,b);if(ve==null)throw new M("Cannot convert null or undefined to a BigInt");if(typeof ve=="boolean")return f(ve?1:0);if(typeof ve=="number")throw new M("Cannot convert a Number value to a BigInt");if(typeof ve=="string"){var me=G(ve);if(typeof me>"u")throw new M("Failed to parse String to BigInt");return me}if(typeof ve=="symbol")throw new M("Cannot convert a Symbol value to a BigInt");if(typeof ve!="bigint")throw new O("Assertion failed: unknown primitive type");return ve},rh}var ih,Om;function Mv(){if(Om)return ih;Om=1;var m=Y.getIntrinsic,f=m("%BigInt%",!0),b=Y.range,M=Y.type,O=f&&f(0);return ih=function(l,le){if(typeof l!="bigint"||typeof le!="bigint")throw new M("Assertion failed: `n` and `d` arguments must be BigInts");if(le===O)throw new b("Division by zero");return l===O?O:l%le},ih}var nh,Vm;function zv(){return Vm||(Vm=1,nh=function(f,b,M){var O=f(b,M);return O>=0?O:O+M}),nh}var ah,Um;function ob(){if(Um)return ah;Um=1;var m=Y.getIntrinsic,f=m("%BigInt%",!0),b=Y.pow,M=kv(),O=Mv(),G=zv(),l=f&&BigInt(b(2,32))*BigInt(b(2,31)),le=f&&BigInt(b(2,32))*BigInt(b(2,32));return ah=function(ve){var me=M(ve),Le=G(O,me,le);return Le>=l?Le-le:Le},ah}var oh,Nm;function sb(){if(Nm)return oh;Nm=1;var m=Y.getIntrinsic,f=m("%BigInt%",!0),b=Y.pow,M=kv(),O=Mv(),G=zv(),l=f&&BigInt(b(2,32))*BigInt(b(2,32));return oh=function(H){var ve=M(H),me=G(O,ve,l);return me},oh}var sh,qm;function lb(){if(qm)return sh;qm=1;var m=Y.floor;return sh=function(b,M){var O=b%M;return m(O>=0?O:O+M)},sh}var lh,jm;function ub(){return jm||(jm=1,lh=lb()),lh}var uh,$m;function Hs(){if($m)return uh;$m=1;var m=ub();return uh=function(b,M){return m(b,M)},uh}var ch,Zm;function cb(){return Zm||(Zm=1,ch=function(f){return f===null||typeof f!="function"&&typeof f!="object"}),ch}var ph,Gm;function Bv(){if(Gm)return ph;Gm=1;var m=Y.type;return ph=function(b){if(b==null)throw new m(arguments.length>0&&arguments[1]||"Cannot call method on "+b);return b},ph}var pb=Y.getIntrinsic,hb=pb("%String%"),fb=Y.type,Dv=function(f){if(typeof f=="symbol")throw new fb("Cannot convert a Symbol value to a string");return hb(f)},hh,Wm;function Lv(){if(Wm)return hh;Wm=1;var m=Bv(),f=Dv,b=Y.callBound,M=b("String.prototype.replace"),O=/^\s$/.test(""),G=O?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,l=O?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;return hh=function(){var H=f(m(this));return M(M(H,G,""),l,"")},hh}var fh,Hm;function Rv(){if(Hm)return fh;Hm=1;var m=Lv(),f="",b="";return fh=function(){return String.prototype.trim&&f.trim()===f&&b.trim()===b&&("_"+b).trim()==="_"+b&&(b+"_").trim()===b+"_"?String.prototype.trim:m},fh}var dh,Xm;function db(){if(Xm)return dh;Xm=1;var m=Y.hasPropertyDescriptors_1(),f=Y.defineDataProperty,b=Rv();return dh=function(){var O=b();return String.prototype.trim!==O&&(m?f(String.prototype,"trim",O,!0):f(String.prototype,"trim",O)),O},dh}var mh,Km;function mb(){if(Km)return mh;Km=1;var m=Y.callBindExports,f=eu,b=Bv(),M=Lv(),O=Rv(),G=db(),l=m(O()),le=function(ve){return b(ve),l(ve)};return f(le,{getPolyfill:O,implementation:M,shim:G}),mh=le,mh}var yh,Jm;function yb(){if(Jm)return yh;Jm=1;var m=Y.getIntrinsic,f=m("%RegExp%"),b=Y.type,M=m("%parseInt%"),O=Y.callBound,G=Y.requireSafeRegexTest(),l=O("String.prototype.slice"),le=G(/^0b[01]+$/i),H=G(/^0o[0-7]+$/i),ve=G(/^[-+]0x[0-9a-f]+$/i),me=["
","",""].join(""),Le=new f("["+me+"]","g"),se=G(Le),ge=mb();return yh=function Re(Ye){if(typeof Ye!="string")throw new b("Assertion failed: `argument` is not a String");if(le(Ye))return+M(l(Ye,2),2);if(H(Ye))return+M(l(Ye,2),8);if(se(Ye)||ve(Ye))return NaN;var je=ge(Ye);return je!==Ye?Re(je):+Ye},yh}var vb=Y.getIntrinsic,Ym=Y.type,gb=vb("%Number%"),_b=cb(),xb=Pv(),bb=yb(),Qa=function(f){var b=_b(f)?f:xb(f,gb);if(typeof b=="symbol")throw new Ym("Cannot convert a Symbol value to a number");if(typeof b=="bigint")throw new Ym("Conversion from 'BigInt' to 'number' is not allowed.");return typeof b=="string"?bb(b):+b},wb=Y.floor,gf=function(f){return typeof f=="bigint"?f:wb(f)},Qm=gf,Sb=Y.type,qo=function(f){if(typeof f!="number"&&typeof f!="bigint")throw new Sb("argument must be a Number or a BigInt");var b=f<0?-Qm(-f):Qm(f);return b===0?0:b},vh,ey;function Tb(){if(ey)return vh;ey=1;var m=Hs(),f=Qa,b=qo,M=wa,O=65536;return vh=function(l){var le=f(l);if(!M(le)||le===0)return 0;var H=b(le),ve=m(H,O);return ve>=32768?ve-O:ve},vh}var gh,ty;function Ib(){if(ty)return gh;ty=1;var m=Hs(),f=Qa,b=qo,M=wa,O=2147483648,G=4294967296;return gh=function(le){var H=f(le);if(!M(H)||H===0)return 0;var ve=b(H),me=m(ve,G),Le=me>=O?me-G:me;return Le===0?0:Le},gh}var _h,ry;function Ab(){if(ry)return _h;ry=1;var m=Hs(),f=Qa,b=qo,M=wa;return _h=function(G){var l=f(G);if(!M(l)||l===0)return 0;var le=b(l),H=m(le,256);return H>=128?H-256:H},_h}var xh,iy;function Eb(){if(iy)return xh;iy=1;var m=Hs(),f=Qa,b=qo,M=wa,O=65536;return xh=function(l){var le=f(l);if(!M(le)||le===0)return 0;var H=b(le),ve=m(H,O);return ve===0?0:ve},xh}var bh,ny;function Cb(){if(ny)return bh;ny=1;var m=Hs(),f=Qa,b=qo,M=wa,O=4294967296;return bh=function(l){var le=f(l);if(!M(le)||le===0)return 0;var H=b(le),ve=m(H,O);return ve===0?0:ve},bh}var wh,ay;function Pb(){if(ay)return wh;ay=1;var m=wa,f=Hs(),b=Qa,M=qo;return wh=function(G){var l=b(G);if(!m(l)||l===0)return 0;var le=M(l),H=f(le,256);return H},wh}var Sh,oy;function kb(){if(oy)return Sh;oy=1;var m=Y.type,f=Y.max,b=Y.min;return Sh=function(O,G,l){if(typeof O!="number"||typeof G!="number"||typeof l!="number"||!(G<=l))throw new m("Assertion failed: all three arguments must be MVs, and `lower` must be `<= upper`");return b(f(G,O),l)},Sh}var Th,sy;function Mb(){if(sy)return Th;sy=1;var m=kb(),f=Qa,b=gf,M=Y._isNaN;return Th=function(G){var l=f(G);if(M(l))return 0;var le=m(l,0,255),H=b(le);return le<H+.5?H:le>H+.5?H+1:H%2===0?H:H+1},Th}var Ih,ly;function Fv(){return ly||(ly=1,Ih=function(f){return f===0&&1/f===-1/0}),Ih}var Ah,uy;function zb(){if(uy)return Ah;uy=1;var m=Y.abs,f=Y.floor,b=Y.pow,M=wa,O=Y._isNaN,G=Fv(),l=34028234663852886e22;return Ah=function(H,ve){if(O(H))return ve?[0,0,192,127]:[127,192,0,0];var me;if(H===0)return me=G(H)?128:0,ve?[0,0,0,me]:[me,0,0,0];if(m(H)>l||!M(H))return me=H<0?255:127,ve?[0,0,128,me]:[me,128,0,0];var Le=H<0?1:0;H=m(H);for(var se=0;H>=2;)se+=1,H/=2;for(;H<1;)se-=1,H*=2;var ge=H-1;ge*=b(2,23)+.5,ge=f(ge),se+=127,se<<=23;var Re=Le<<31|se|ge,Ye=Re&255;Re>>=8;var je=Re&255;Re>>=8;var It=Re&255;Re>>=8;var tt=Re&255;return ve?[Ye,je,It,tt]:[tt,It,je,Ye]},Ah}var Eh,cy;function Bb(){if(cy)return Eh;cy=1;var m=1075,f=54;return Eh=function(M){var O="";if(M===0)return O;for(var G=m,l,le=0;le<m;le+=1)if(l=M*2,l>=1?(M=l-1,O+="1",G===m&&(G=le)):(M=l,O+="0"),l===1||le-G>f)return O;return O},Eh}var Ch,py;function Db(){if(py)return Ch;py=1;var m=Y.floor;return Ch=function(b){for(var M="",O;b>0;)O=b/2,b=m(O),O===b?M="0"+M:M="1"+M;return M},Ch}var Ph,hy;function Lb(){if(hy)return Ph;hy=1;var m=Y.getIntrinsic,f=m("%parseInt%"),b=Y.abs,M=Y.floor,O=Fv(),G=Y.callBound,l=G("String.prototype.indexOf"),le=G("String.prototype.slice"),H=Bb(),ve=Db(),me=1023,Le="11111111111",se="00000000000",ge=se+se+se+se+"0000000";return Ph=function(Ye,je){var It=Ye<0||O(Ye)?"1":"0",tt,dt;if(isNaN(Ye))tt=Le,dt="1"+ge;else if(!isFinite(Ye))tt=Le,dt="0"+ge;else if(Ye===0)tt=se,dt="0"+ge;else{Ye=b(Ye);var Dt=M(Ye),jt=ve(Dt),Kt=H(Ye-Dt),ur;if(jt)tt=jt.length-1;else{var Sr=l(Kt,"1");Sr>-1&&(ur=Sr+1),tt=-ur}dt=jt+Kt,tt<0?(tt<=-me&&(ur=me-1),dt=le(dt,ur)):dt=le(dt,1),tt=le(se+ve(tt+me),-11),dt=le(dt+ge+"0",0,52)}for(var cr=It+tt+dt,Xr=[],gr=0;gr<8;gr++){var gi=je?8-gr-1:gr;Xr[gi]=f(le(cr,gr*8,(gr+1)*8),2)}return Xr},Ph}var kh,fy;function Rb(){if(fy)return kh;fy=1;var m=Y.getIntrinsic,f=m("%Number%"),b=m("%BigInt%",!0);return kh=function(O,G,l){var le=typeof O=="bigint"?b:f;O<0&&(O>>>=0);for(var H=[],ve=0;ve<G;ve++)H[l?ve:G-1-ve]=f(O&le(255)),O>>=le(8);return H},kh}var Mh,dy;function Fb(){if(dy)return Mh;dy=1;var m=Y.type,f=gv(),b=ob(),M=sb(),O=Tb(),G=Ib(),l=Ab(),le=Eb(),H=Cb(),ve=Pb(),me=Mb(),Le=zb(),se=Lb(),ge=Rb(),Re=Ws,Ye={__proto__:null,$INT8:l,$UINT8:ve,$UINT8C:me,$INT16:O,$UINT16:le,$INT32:G,$UINT32:H,$BIGINT64:b,$BIGUINT64:M};return Mh=function(It,tt,dt){if(typeof It!="string"||!f(Re.size,"$"+It))throw new m("Assertion failed: `type` must be a TypedArray element type");if(typeof tt!="number"&&typeof tt!="bigint")throw new m("Assertion failed: `value` must be a Number or a BigInt");if(typeof dt!="boolean")throw new m("Assertion failed: `isLittleEndian` must be a Boolean");if(It==="FLOAT32")return Le(tt,dt);if(It==="FLOAT64")return se(tt,dt);var Dt=Re.size["$"+It],jt=Ye["$"+It],Kt=jt(tt);return ge(Kt,Dt,dt)},Mh}var zh,my;function Ob(){return my||(my=1,zh=function(f,b){for(var M=0;M<f.length;M+=1)b(f[M],M,f)}),zh}var Vb=Y.getIntrinsic,Ub=Y.syntax,xa=Y.type,Nb=Rc,qb=Vb("%Uint8Array%",!0),jb=bv(),$b=Gs,Zb=Fb(),Gb=Zs,Wb=tu,Hb=Y.requireHasown(),Bh=Ws,Xb=Sv(),Kb=Ob(),Jb=function(f,b,M,O,G,l){var le=Wb(f);if(!Gb(f)&&!le)throw new xa("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!Nb(b)||b<0)throw new xa("Assertion failed: `byteIndex` must be a non-negative integer");if(typeof M!="string"||!Hb(Bh.size,"$"+M))throw new xa("Assertion failed: `type` must be one of "+Bh.choices);if(typeof O!="number"&&typeof O!="bigint")throw new xa("Assertion failed: `value` must be a Number or a BigInt");if(typeof G!="boolean")throw new xa("Assertion failed: `isTypedArray` must be a boolean");if(l!=="SEQ-CST"&&l!=="UNORDERED"&&l!=="INIT")throw new xa('Assertion failed: `order` must be `"SEQ-CST"`, `"UNORDERED"`, or `"INIT"`');if(arguments.length>6&&typeof arguments[6]!="boolean")throw new xa("Assertion failed: `isLittleEndian` must be a boolean, if present");if($b(f))throw new xa("Assertion failed: ArrayBuffer is detached");if(jb(M)?typeof O!="bigint":typeof O!="number")throw new xa("Assertion failed: `value` must be a BigInt if type is ~BIGINT64~ or ~BIGUINT64~, otherwise a Number");var H=Bh.size["$"+M],ve=arguments.length>6?arguments[6]:Xb==="little",me=Zb(M,O,ve);if(le)throw new Ub("SharedArrayBuffer is not supported by this implementation");var Le=new qb(f,b,H);Kb(me,function(se,ge){Le[ge]=se})},Yb=Qa,Qb=qo,e1=Y._isNaN,t1=wa,r1=function(f){var b=Yb(f);return e1(b)||b===0?0:t1(b)?Qb(b):b},i1=Y.syntax,n1=Y.type,a1=Rc,o1=Y.whichTypedArray,yy=Ws,_f=function(f){var b=o1(f);if(!b)throw new n1("Assertion failed: `O` must be a TypedArray");var M=yy.size["$"+yy.name["$"+b]];if(!a1(M)||M<0)throw new i1("Assertion failed: Unknown TypedArray type `"+b+"`");return M},s1=Y.syntax,l1=Y.type,u1=Y.whichTypedArray,c1=Ws,p1=function(f){var b=u1(f);if(!b)throw new l1("Assertion failed: `O` must be a TypedArray");var M=c1.name["$"+b];if(typeof M!="string")throw new s1("Assertion failed: Unknown TypedArray type `"+b+"`");return M},lf={exports:{}},h1=Y.getIntrinsic,Dh,vy;function xf(){if(vy)return Dh;vy=1;var m=Y.type,f=Y.requireHasown(),b={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};return Dh=function(O){if(!O||typeof O!="object")return!1;for(var G in O)if(f(O,G)&&!b[G])return!1;var l=f(O,"[[Value]]")||f(O,"[[Writable]]"),le=f(O,"[[Get]]")||f(O,"[[Set]]");if(l&&le)throw new m("Property Descriptors may not be both accessor and data descriptors");return!0},Dh}var Lh,gy;function f1(){if(gy)return Lh;gy=1;var m=Y.hasPropertyDescriptors_1,f=Y.esDefineProperty,b=m.hasArrayLengthDefineBug(),M=b&&xv,O=Y.callBound,G=O("Object.prototype.propertyIsEnumerable");return Lh=function(le,H,ve,me,Le,se){if(!f){if(!le(se)||!se["[[Configurable]]"]||!se["[[Writable]]"]||Le in me&&G(me,Le)!==!!se["[[Enumerable]]"])return!1;var ge=se["[[Value]]"];return me[Le]=ge,H(me[Le],ge)}return b&&Le==="length"&&"[[Value]]"in se&&M(me)&&me.length!==se["[[Value]]"]?(me.length=se["[[Value]]"],me.length===se["[[Value]]"]):(f(me,Le,ve(se)),!0)},Lh}var Rh,_y;function d1(){return _y||(_y=1,Rh=function(f){if(typeof f>"u")return f;var b={};return"[[Value]]"in f&&(b.value=f["[[Value]]"]),"[[Writable]]"in f&&(b.writable=!!f["[[Writable]]"]),"[[Get]]"in f&&(b.get=f["[[Get]]"]),"[[Set]]"in f&&(b.set=f["[[Set]]"]),"[[Enumerable]]"in f&&(b.enumerable=!!f["[[Enumerable]]"]),"[[Configurable]]"in f&&(b.configurable=!!f["[[Configurable]]"]),b}),Rh}var Fh,xy;function m1(){if(xy)return Fh;xy=1;var m=Y.type,f=xf(),b=d1();return Fh=function(O){if(typeof O<"u"&&!f(O))throw new m("Assertion failed: `Desc` must be a Property Descriptor");return b(O)},Fh}var Oh,by;function y1(){if(by)return Oh;by=1;var m=Y.type,f=Y.requireHasown(),b=xf();return Oh=function(O){if(typeof O>"u")return!1;if(!b(O))throw new m("Assertion failed: `Desc` must be a Property Descriptor");return!(!f(O,"[[Value]]")&&!f(O,"[[Writable]]"))},Oh}var Ov=Y.isCallable,Vh,wy;function v1(){return wy||(wy=1,Vh=function(f){return!!f}),Vh}var Uh,Sy;function g1(){if(Sy)return Uh;Sy=1;var m=Y.requireHasown(),f=Y.type,b=Ya,M=Ov,O=v1();return Uh=function(l){if(!b(l))throw new f("ToPropertyDescriptor requires an object");var le={};if(m(l,"enumerable")&&(le["[[Enumerable]]"]=O(l.enumerable)),m(l,"configurable")&&(le["[[Configurable]]"]=O(l.configurable)),m(l,"value")&&(le["[[Value]]"]=l.value),m(l,"writable")&&(le["[[Writable]]"]=O(l.writable)),m(l,"get")){var H=l.get;if(typeof H<"u"&&!M(H))throw new f("getter must be a function");le["[[Get]]"]=H}if(m(l,"set")){var ve=l.set;if(typeof ve<"u"&&!M(ve))throw new f("setter must be a function");le["[[Set]]"]=ve}if((m(le,"[[Get]]")||m(le,"[[Set]]"))&&(m(le,"[[Value]]")||m(le,"[[Writable]]")))throw new f("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return le},Uh}var Nh,Ty;function _1(){if(Ty)return Nh;Ty=1;var m=Y.type,f=Ya,b=xf(),M=f1(),O=m1(),G=y1(),l=Lc,le=Tv,H=g1();return Nh=function(me,Le,se){if(!f(me))throw new m("Assertion failed: Type(O) is not Object");if(!l(Le))throw new m("Assertion failed: P is not a Property Key");var ge=b(se)?se:H(se);if(!b(ge))throw new m("Assertion failed: Desc is not a valid Property Descriptor");return M(G,le,O,me,Le,ge)},Nh}var x1=h1,Iy=x1("%Reflect.construct%",!0),Pc=_1();try{Pc({},"",{"[[Get]]":function(){}})}catch{Pc=null}if(Pc&&Iy){var Ay={},Ey={};Pc(Ey,"length",{"[[Get]]":function(){throw Ay},"[[Enumerable]]":!0}),lf.exports=function(f){try{Iy(f,Ey)}catch(b){return b===Ay}}}else lf.exports=function(f){return typeof f=="function"&&!!f.prototype};var Vv=lf.exports,b1=Y.getIntrinsic,Cy=b1("%Symbol.species%",!0),qh=Y.type,Py=Ya,w1=Vv,S1=function(f,b){if(!Py(f))throw new qh("Assertion failed: Type(O) is not Object");var M=f.constructor;if(typeof M>"u")return b;if(!Py(M))throw new qh("O.constructor is not an Object");var O=Cy?M[Cy]:void 0;if(O==null)return b;if(w1(O))return O;throw new qh("no constructor found")},T1=Y.type,Uv=Y.callBound,ky=Uv("%ArrayBuffer.prototype.resizable%",!0),My=Uv("%SharedArrayBuffer.prototype.growable%",!0),I1=Zs,A1=tu,Nv=function(f){var b=I1(f),M=A1(f);if(!b&&!M)throw new T1("Assertion failed: `arrayBuffer` must be an ArrayBuffer or SharedArrayBuffer");return b&&ky?!ky(f):M&&My?!My(f):!0},E1=Rc,zy=Y.requireHasown(),C1=Y.isTypedArray,P1=E1,qv=function(f){return!!f&&typeof f=="object"&&zy(f,"[[Object]]")&&zy(f,"[[CachedBufferByteLength]]")&&(P1(f["[[CachedBufferByteLength]]"])&&f["[[CachedBufferByteLength]]"]>=0||f["[[CachedBufferByteLength]]"]==="DETACHED")&&C1(f["[[Object]]"])},k1=Ya,jv=Y.callBound,M1=jv("String.prototype.valueOf"),z1=function(f){try{return M1(f),!0}catch{return!1}},B1=jv("Object.prototype.toString"),D1="[object String]",L1=Y.requireShams()(),R1=function(f){return typeof f=="string"?!0:!f||typeof f!="object"?!1:L1?z1(f):B1(f)===D1},$v=Y.callBound,F1=$v("Number.prototype.toString"),O1=function(f){try{return F1(f),!0}catch{return!1}},V1=$v("Object.prototype.toString"),U1="[object Number]",N1=Y.requireShams()(),q1=function(f){return typeof f=="number"?!0:!f||typeof f!="object"?!1:N1?O1(f):V1(f)===U1},Zv=Y.callBound,j1=Zv("Boolean.prototype.toString"),$1=Zv("Object.prototype.toString"),Z1=function(f){try{return j1(f),!0}catch{return!1}},G1="[object Boolean]",W1=Y.requireShams()(),H1=function(f){return typeof f=="boolean"?!0:f===null||typeof f!="object"?!1:W1?Z1(f):$1(f)===G1},uf={exports:{}},By=typeof BigInt<"u"&&BigInt,X1=function(){return typeof By=="function"&&typeof BigInt=="function"&&typeof By(42)=="bigint"&&typeof BigInt(42)=="bigint"},K1=X1();if(K1){var J1=BigInt.prototype.valueOf,Y1=function(f){try{return J1.call(f),!0}catch{}return!1};uf.exports=function(f){return f===null||typeof f>"u"||typeof f=="boolean"||typeof f=="string"||typeof f=="number"||typeof f=="symbol"||typeof f=="function"?!1:typeof f=="bigint"?!0:Y1(f)}}else uf.exports=function(f){return!1};var Q1=uf.exports,ew=R1,tw=q1,rw=H1,iw=Cv,nw=Q1,aw=function(f){if(f==null||typeof f!="object"&&typeof f!="function")return null;if(ew(f))return"String";if(tw(f))return"Number";if(rw(f))return"Boolean";if(iw(f))return"Symbol";if(nw(f))return"BigInt"},bf=typeof Map=="function"&&Map.prototype?Map:null,ow=typeof Set=="function"&&Set.prototype?Set:null,kc;bf||(kc=function(f){return!1});var Gv=bf?Map.prototype.has:null,Dy=ow?Set.prototype.has:null;!kc&&!Gv&&(kc=function(f){return!1});var sw=kc||function(f){if(!f||typeof f!="object")return!1;try{if(Gv.call(f),Dy)try{Dy.call(f)}catch{return!0}return f instanceof bf}catch{}return!1},lw=typeof Map=="function"&&Map.prototype?Map:null,wf=typeof Set=="function"&&Set.prototype?Set:null,Mc;wf||(Mc=function(f){return!1});var Ly=lw?Map.prototype.has:null,Wv=wf?Set.prototype.has:null;!Mc&&!Wv&&(Mc=function(f){return!1});var uw=Mc||function(f){if(!f||typeof f!="object")return!1;try{if(Wv.call(f),Ly)try{Ly.call(f)}catch{return!0}return f instanceof wf}catch{}return!1},zc=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,Ry=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,Bc;zc||(Bc=function(f){return!1});var cf=zc?zc.prototype.has:null,jh=Ry?Ry.prototype.has:null;!Bc&&!cf&&(Bc=function(f){return!1});var cw=Bc||function(f){if(!f||typeof f!="object")return!1;try{if(cf.call(f,cf),jh)try{jh.call(f,jh)}catch{return!0}return f instanceof zc}catch{}return!1},pf={exports:{}},pw=Y.getIntrinsic,Hv=Y.callBound,hw=pw("%WeakSet%",!0),$h=Hv("WeakSet.prototype.has",!0);if($h){var Zh=Hv("WeakMap.prototype.has",!0);pf.exports=function(f){if(!f||typeof f!="object")return!1;try{if($h(f,$h),Zh)try{Zh(f,Zh)}catch{return!0}return f instanceof hw}catch{}return!1}}else pf.exports=function(f){return!1};var fw=pf.exports,dw=sw,mw=uw,yw=cw,vw=fw,gw=function(f){if(f&&typeof f=="object"){if(dw(f))return"Map";if(mw(f))return"Set";if(yw(f))return"WeakMap";if(vw(f))return"WeakSet"}return!1},_w=Y.callBound,xw=_w("WeakRef.prototype.deref",!0),bw=typeof WeakRef>"u"?function(f){return!1}:function(f){if(!f||typeof f!="object")return!1;try{return xw(f),!0}catch{return!1}},ww=Y.callBound,Fy=ww("FinalizationRegistry.prototype.register",!0),Sw=Fy?function(f){if(!f||typeof f!="object")return!1;try{return Fy(f,{},null),!0}catch{return!1}}:function(f){return!1},Ql=function(){return typeof(function(){}).name=="string"},Yl=Object.getOwnPropertyDescriptor;if(Yl)try{Yl([],"length")}catch{Yl=null}Ql.functionsHaveConfigurableNames=function(){if(!Ql()||!Yl)return!1;var f=Yl(function(){},"name");return!!f&&!!f.configurable};var Tw=Function.prototype.bind;Ql.boundFunctionsHaveNames=function(){return Ql()&&typeof Tw=="function"&&(function(){}).bind().name!==""};var Xv=Ql,Kv=Y.isCallable,Iw=Y.requireHasown(),Aw=Xv(),Sf=Y.callBound,Jv=Sf("Function.prototype.toString"),Yv=Sf("String.prototype.match"),Gh=Sf("Object.prototype.toString"),Ew=/^class /,Cw=function(f){if(Kv(f)||typeof f!="function")return!1;try{var b=Yv(Jv(f),Ew);return!!b}catch{}return!1},Pw=/\s*function\s+([^(\s]*)\s*/,kw=!(0 in[,]),Mw="[object Object]",zw="[object HTMLAllCollection]",Bw=Function.prototype,Qv=function(){return!1};if(typeof document=="object"){var Dw=document.all;Gh(Dw)===Gh(document.all)&&(Qv=function(f){if((kw||!f)&&(typeof f>"u"||typeof f=="object"))try{var b=Gh(f);return(b===zw||b===Mw)&&f("")==null}catch{}return!1})}var eg=function(){if(Qv(this)||!Cw(this)&&!Kv(this))throw new TypeError("Function.prototype.name sham getter called on non-function");if(Aw&&Iw(this,"name"))return this.name;if(this===Bw)return"";var f=Jv(this),b=Yv(f,Pw),M=b&&b[1];return M},Lw=eg,tg=function(){return Lw},Rw=eu.supportsDescriptors,Fw=Xv(),Ow=tg,Oy=Object.defineProperty,Vw=TypeError,Uw=function(){var f=Ow();if(Fw)return f;if(!Rw)throw new Vw("Shimming Function.prototype.name support requires ES5 property descriptor support.");var b=Function.prototype;return Oy(b,"name",{configurable:!0,enumerable:!1,get:function(){var M=f.call(this);return this!==b&&Oy(this,"name",{configurable:!0,enumerable:!1,value:M,writable:!1}),M}}),f},Nw=eu,qw=Y.callBindExports,rg=eg,jw=tg,$w=Uw,ig=qw(rg);Nw(ig,{getPolyfill:jw,implementation:rg,shim:$w});var Zw=ig,Wh,Vy;function Gw(){if(Vy)return Wh;Vy=1;const m=(async function(){}).constructor;return Wh=()=>m,Wh}var ng=Y.callBound,Ww=Y.requireSafeRegexTest(),Hw=ng("Object.prototype.toString"),Xw=ng("Function.prototype.toString"),Kw=Ww(/^\s*async(?:\s+function(?:\s+|\()|\s*\()/),Jw=Y.requireShams()(),Uy=Y.getProto,Yw=Gw(),Qw=function(f){if(typeof f!="function")return!1;if(Kw(Xw(f)))return!0;if(!Jw){var b=Hw(f);return b==="[object AsyncFunction]"}if(!Uy)return!1;var M=Yw();return M&&M.prototype===Uy(f)},e2=aw,t2=gw,r2=Y.whichTypedArray,i2=wv(),n2=Av,a2=Y.isRegex,o2=bw,s2=Sw,l2=Zw,u2=Y.isGeneratorFunction,c2=Qw,p2=Y.callBound,h2=Y.requireShams()(),Hh=h2&&Symbol.toStringTag,f2=Object,Ny=p2("Promise.prototype.then",!0),d2=function(f){if(!f||typeof f!="object"||!Ny)return!1;try{return Ny(f,null,function(){}),!0}catch{}return!1},qy=function(f){return!!f&&f!=="BigInt"&&f!=="Boolean"&&f!=="Null"&&f!=="Number"&&f!=="String"&&f!=="Symbol"&&f!=="Undefined"&&f!=="Math"&&f!=="JSON"&&f!=="Reflect"&&f!=="Atomics"&&f!=="Map"&&f!=="Set"&&f!=="WeakMap"&&f!=="WeakSet"&&f!=="BigInt64Array"&&f!=="BigUint64Array"&&f!=="Float32Array"&&f!=="Float64Array"&&f!=="Int16Array"&&f!=="Int32Array"&&f!=="Int8Array"&&f!=="Uint16Array"&&f!=="Uint32Array"&&f!=="Uint8Array"&&f!=="Uint8ClampedArray"&&f!=="Array"&&f!=="Date"&&f!=="FinalizationRegistry"&&f!=="Promise"&&f!=="RegExp"&&f!=="WeakRef"&&f!=="Function"&&f!=="GeneratorFunction"&&f!=="AsyncFunction"},m2=function(f){if(f==null)return f;var b=e2(f2(f))||t2(f)||r2(f);if(b)return b;if(i2(f))return"Array";if(n2(f))return"Date";if(a2(f))return"RegExp";if(o2(f))return"WeakRef";if(s2(f))return"FinalizationRegistry";if(typeof f=="function")return u2(f)?"GeneratorFunction":c2(f)?"AsyncFunction":"Function";if(d2(f))return"Promise";if(Hh&&Hh in f){var M=f[Hh];if(qy(M))return M}if(typeof f.constructor=="function"){var O=l2(f.constructor);if(qy(O))return O}return"Object"},y2=Y.getIntrinsic,v2=Ov,g2=k1,_2=m2,x2=Y.type,jy=Y.getProto,b2=Y.esObjectAtoms,w2=function(f){if(!g2(f))throw new x2("Reflect.getPrototypeOf called on non-object");if(jy)return jy(f);var b=_2(f);if(b){var M=y2("%"+b+".prototype%",!0);if(M)return M}return v2(f.constructor)?f.constructor.prototype:f instanceof Object?b2.prototype:null},S2=w2,$y=Y.getProto,ag=function(){return typeof Reflect=="object"&&Reflect&&Reflect.getPrototypeOf?Reflect.getPrototypeOf:$y?function(b){return $y(b)}:S2},og=Y.forEach,T2=Y.callBindExports,I2=ag(),A2=Y.availableTypedArrays(),hf={__proto__:null},yc=Y.gopd,Zy=Object.defineProperty;if(yc){var E2=function(m){return m.byteOffset};og(A2,function(m){if(typeof Y.commonjsGlobal[m]=="function"||typeof Y.commonjsGlobal[m]=="object"){var f=Y.commonjsGlobal[m].prototype,b=yc(f,"byteOffset");if(!b){var M=I2(f);b=yc(M,"byteOffset")}if(b&&b.get)hf[m]=T2(b.get);else if(Zy){var O=new Y.commonjsGlobal[m](2);b=yc(O,"byteOffset"),b&&b.configurable&&Zy(O,"length",{value:3}),O.length===2&&(hf[m]=E2)}}})}var C2=function(f){var b;return og(hf,function(M){if(typeof b!="number")try{var O=M(f);typeof O=="number"&&(b=O)}catch{}}),b},P2=Y.isTypedArray,Tf=function(f){return P2(f)?C2(f):!1},k2=Y.callBindExports,sg=Y.forEach,vc=Y.gopd,M2=Y.isTypedArray,z2=Y.possibleTypedArrayNames,B2=ag(),ff={__proto__:null},Gy=Object.defineProperty;if(vc){var D2=function(m){return m.length};sg(z2,function(m){var f=Y.commonjsGlobal[m];if(typeof f=="function"||typeof f=="object"){var b=f.prototype,M=vc(b,"length");if(!M){var O=B2(b);M=vc(O,"length")}if(M&&M.get)ff["$"+m]=k2(M.get);else if(Gy){var G=new Y.commonjsGlobal[m](2);M=vc(G,"length"),M&&M.configurable&&Gy(G,"length",{value:3}),G.length===2&&(ff["$"+m]=D2)}}})}var L2=function(f){var b;return sg(ff,function(M){if(typeof b!="number")try{var O=M(f);typeof O=="number"&&(b=O)}catch{}}),b},lg=function(f){return M2(f)?L2(f):!1},Wy=Y.type,R2=Gs,F2=Nv,O2=_f,V2=qv,Hy=ru,U2=Tf,N2=lg,If=function(f){if(!V2(f))throw new Wy("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");var b=f["[[Object]]"],M=f["[[CachedBufferByteLength]]"];if(R2(Hy(b))&&M!=="DETACHED")throw new Wy("Assertion failed: typed array is detached only if the byte length is ~DETACHED~");if(M==="DETACHED")return!0;var O=U2(b),G=F2(Hy(b)),l,le=G?N2(b):"AUTO";if(le==="AUTO")l=M;else{var H=O2(b);l=O+le*H}return O>M||l>M},gc=Y.type,q2=gf,j2=Nv,$2=If,Z2=_f,G2=qv,W2=ru,H2=Tf,X2=lg,K2=function(f){if(!G2(f))throw new gc("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");if($2(f))throw new gc("Assertion failed: `taRecord` is out of bounds");var b=f["[[Object]]"],M=j2(W2(b)),O=M?X2(b):"AUTO";if(O!=="AUTO")return O;if(M)throw new gc("Assertion failed: array buffer is not fixed length");var G=H2(b),l=Z2(b),le=f["[[CachedBufferByteLength]]"];if(le==="DETACHED")throw new gc("Assertion failed: typed array is detached");return q2((le-G)/l)},Xh=Y.type,J2=Gs,Y2=Zs,Q2=tu,eS=vv,tS=Y.callBound,rS=tS("SharedArrayBuffer.prototype.byteLength",!0),iS=function(f,b){var M=Q2(f);if(!Y2(f)&&!M)throw new Xh("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(b!=="SEQ-CST"&&b!=="UNORDERED")throw new Xh("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if(J2(f))throw new Xh("Assertion failed: `arrayBuffer` must not be detached");return M?rS(f):eS(f)},Xy=Y.type,nS=iS,aS=Gs,oS=Y.isTypedArray,sS=ru,lS=function(f,b){if(!oS(f))throw new Xy("Assertion failed: `obj` must be a Typed Array");if(b!=="SEQ-CST"&&b!=="UNORDERED")throw new Xy("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");var M=sS(f),O=aS(M)?"DETACHED":nS(M,b);return{"[[Object]]":f,"[[CachedBufferByteLength]]":O}},_c=Y.type,uS=Ya,cS=If,pS=lS,hS=Y.isTypedArray,ug=function(f,b){if(b!=="SEQ-CST"&&b!=="UNORDERED")throw new _c("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if(!uS(f))throw new _c("Assertion failed: `O` must be an Object");if(!hS(f))throw new _c("Assertion failed: `O` must be a Typed Array");var M=pS(f,b);if(cS(M))throw new _c("`O` must be in-bounds and backed by a non-detached buffer");return M},fS=Y.syntax,xc=Y.type,dS=vf,mS=Vv,yS=If,vS=K2,gS=ug,_S=Y.availableTypedArrays(),xS=function(f,b){if(!mS(f))throw new xc("Assertion failed: `constructor` must be a constructor");if(!dS(b))throw new xc("Assertion failed: `argumentList` must be a List");if(_S.length===0)throw new fS("Assertion failed: Typed Arrays are not supported in this environment");var M;b.length===0?M=new f:b.length===1?M=new f(b[0]):b.length===2?M=new f(b[0],b[1]):M=new f(b[0],b[1],b[2]);var O=gS(M,"SEQ-CST");if(b.length===1&&typeof b[0]=="number"){if(yS(O))throw new xc("new Typed Array is out of bounds");var G=vS(O);if(G<b[0])throw new xc("`argumentList[0]` must be <= `newTypedArray.length`")}return M},en=Y.getIntrinsic,bS={__proto__:null,$Int8Array:en("%Int8Array%",!0),$Uint8Array:en("%Uint8Array%",!0),$Uint8ClampedArray:en("%Uint8ClampedArray%",!0),$Int16Array:en("%Int16Array%",!0),$Uint16Array:en("%Uint16Array%",!0),$Int32Array:en("%Int32Array%",!0),$Uint32Array:en("%Uint32Array%",!0),$BigInt64Array:en("%BigInt64Array%",!0),$BigUint64Array:en("%BigUint64Array%",!0),$Float16Array:en("%Float16Array%",!0),$Float32Array:en("%Float32Array%",!0),$Float64Array:en("%Float64Array%",!0)},wS=function(f){return bS["$"+f]},Ky=Y.syntax,Jy=Y.type,SS=Y.whichTypedArray,TS=Y.availableTypedArrays(),IS=vf,AS=S1,ES=xS,CS=wS,PS=function(f,b){if(TS.length===0)throw new Ky("Assertion failed: Typed Arrays are not supported in this environment");var M=SS(f);if(!M)throw new Jy("Assertion failed: exemplar must be a TypedArray");if(!IS(b))throw new Jy("Assertion failed: `argumentList` must be a List");var O=CS(M);if(typeof O!="function")throw new Ky("Assertion failed: `constructor` of `exemplar` ("+M+") must exist. Please report this!");var G=AS(f,O);return ES(G,b)},kS=Y.type,MS=Qx,zS=q0,BS=Gs,Kh=Y.max,Yy=Y.min,DS=Z0,LS=Jb,Qy=r1,ev=Dv,RS=_f,tv=p1,FS=PS,OS=ug,Jh=ru,rv=Tf,cg=function(f,b){var M=this;OS(M,"SEQ-CST");var O=M.length,G=Qy(f),l;G===-1/0?l=0:G<0?l=Kh(O+G,0):l=Yy(G,O);var le=typeof b>"u"?O:Qy(b),H;le===-1/0?H=0:le<0?H=Kh(O+le,0):H=Yy(le,O);var ve=Kh(H-l,0),me=FS(M,[ve]);if(ve>0){if(BS(Jh(M)))throw new kS("Cannot use a Typed Array with an underlying ArrayBuffer that is detached");var Le=tv(M),se=tv(me);if(Le===se)for(var ge=Jh(M),Re=Jh(me),Ye=RS(M),je=rv(M),It=l*Ye+je,tt=rv(me),dt=tt+ve*Ye;tt<dt;){var Dt=zS(ge,It,"UINT8",!0,"UNORDERED");LS(Re,tt,"UINT8",Dt,!0,"UNORDERED"),It+=1,tt+=1}else for(var jt=0;l<H;){var Kt=ev(l),ur=MS(M,Kt);DS(me,ev(jt),ur,!0),l+=1,jt+=1}}return me},VS=cg,pg=function(){return typeof Uint8Array=="function"&&Uint8Array.prototype.slice||VS},US=eu,NS=Y.getProto,qS=pg,jS=function(){if(typeof Uint8Array=="function"){var f=qS(),b=NS(Uint8Array.prototype);US(b,{slice:f},{slice:function(){return b.slice!==f}})}return f},$S=eu,ZS=Y.callBindExports,GS=cg,hg=pg,WS=jS,fg=ZS(hg());$S(fg,{getPolyfill:hg,implementation:GS,shim:WS});var HS=fg,dg=Y.whichTypedArray,mg=HS,iv=Y.gopd;function Xs(m){return Object.prototype.toString.call(m)}function XS(m){return Xs(m)==="[object Date]"}function KS(m){return Xs(m)==="[object RegExp]"}function JS(m){return Xs(m)==="[object Error]"}function YS(m){return Xs(m)==="[object Boolean]"}function QS(m){return Xs(m)==="[object Number]"}function eT(m){return Xs(m)==="[object String]"}var yg=Array.isArray||function(f){return Object.prototype.toString.call(f)==="[object Array]"};function Fc(m,f){if(m.forEach)return m.forEach(f);for(var b=0;b<m.length;b++)f(m[b],b,m)}var Oc=Object.keys||function(f){var b=[];for(var M in f)b[b.length]=M;return b},tT=Object.prototype.propertyIsEnumerable,nv=Object.getOwnPropertySymbols;function Vc(m){var f=Oc(m);if(nv)for(var b=nv(m),M=0;M<b.length;M++)tT.call(m,b[M])&&(f[f.length]=b[M]);return f}var Uc=Object.prototype.hasOwnProperty||function(m,f){return f in m};function rT(m,f){if(typeof iv!="function")return!0;var b=iv(m,f);return!b||!b.writable}function vg(m,f){if(typeof m=="object"&&m!==null){var b;if(yg(m))b=[];else if(XS(m))b=new Date(m.getTime?m.getTime():m);else if(KS(m))b=new RegExp(m);else if(JS(m))b={message:m.message};else if(YS(m)||QS(m)||eT(m))b=Object(m);else{var M=dg(m);if(M)return mg(m);if(Object.create&&Object.getPrototypeOf)b=Object.create(Object.getPrototypeOf(m));else if(m.constructor===Object)b={};else{var O=m.constructor&&m.constructor.prototype||m.__proto__||{},G=function(){};G.prototype=O,b=new G}}var l=f.includeSymbols?Vc:Oc;return Fc(l(m),function(le){b[le]=m[le]}),b}return m}var Af={__proto__:null};function gg(m,f){var b=[],M=[],O=!0,G=arguments.length>2?arguments[2]:Af,l=G.includeSymbols?Vc:Oc,le=!!G.immutable;return function H(ve){var me=le?vg(ve,G):ve,Le={__proto__:null},se=!0,ge={node:me,node_:ve,path:[].concat(b),parent:M[M.length-1],parents:M,key:b[b.length-1],removedKeys:{__proto__:null},isRoot:b.length===0,level:b.length,circular:null,update:function(je,It){ge.isRoot||(ge.parent.node[ge.key]=je),ge.node=je,It&&(se=!1)},delete:function(je){delete ge.parent.node[ge.key],ge.parent.removedKeys[ge.key]=!0,je&&(se=!1)},remove:function(je){yg(ge.parent.node)?(ge.parent.node.splice(ge.key,1),ge.parent.removedKeys[ge.key]=!0,je&&(se=!1)):ge.delete(je)},keys:null,before:function(je){Le.before=je},after:function(je){Le.after=je},pre:function(je){Le.pre=je},post:function(je){Le.post=je},stop:function(){O=!1},block:function(){se=!1}};if(!O)return ge;function Re(){if(typeof ge.node=="object"&&ge.node!==null){(!ge.keys||ge.node_!==ge.node)&&(ge.keys=l(ge.node)),ge.isLeaf=ge.keys.length===0;for(var je=0;je<M.length;je++)if(M[je].node_===ve){ge.circular=M[je];break}}else ge.isLeaf=!0,ge.keys=null;ge.notLeaf=!ge.isLeaf,ge.notRoot=!ge.isRoot}Re();var Ye=f.call(ge,ge.node);return Ye!==void 0&&ge.update&&ge.update(Ye),Le.before&&Le.before.call(ge,ge.node),se&&(typeof ge.node=="object"&&ge.node!==null&&!ge.circular&&(M[M.length]=ge,Re(),Fc(ge.keys,function(je,It){var tt=It-1 in ge.removedKeys;tt&&(je=ge.keys[It-1]),b[b.length]=je,Le.pre&&Le.pre.call(ge,ge.node[je],je);var dt=H(ge.node[je]);le&&Uc.call(ge.node,je)&&!rT(ge.node,je)&&!tt&&(ge.node[je]=dt.node),dt.isLast=It===ge.keys.length-1,dt.isFirst=It===0,Le.post&&Le.post.call(ge,dt),b.pop()}),M.pop()),Le.after&&Le.after.call(ge,ge.node)),ge}(m).node}function tn(m){this.options=arguments.length>1?arguments[1]:Af,this.value=m}tn.prototype.get=function(m){for(var f=this.value,b=0;f&&b<m.length;b++){var M=m[b];if(!Uc.call(f,M)||!this.options.includeSymbols&&typeof M=="symbol")return;f=f[M]}return f};tn.prototype.has=function(m){var f=this.value;if(!f&&m.length>0)return!1;for(var b=0;f&&b<m.length;b++){var M=m[b];if(!Uc.call(f,M)||!this.options.includeSymbols&&typeof M=="symbol")return!1;f=f[M]}return!0};tn.prototype.set=function(m,f){for(var b=this.value,M=0;M<m.length-1;M++){var O=m[M];Uc.call(b,O)||(b[O]={}),b=b[O]}return b[m[M]]=f,f};tn.prototype.map=function(m){return gg(this.value,m,{__proto__:null,immutable:!0,includeSymbols:!!this.options.includeSymbols})};tn.prototype.forEach=function(m){return this.value=gg(this.value,m,this.options),this.value};tn.prototype.reduce=function(m,f){var b=arguments.length===1,M=b?this.value:f;return this.forEach(function(O){(!this.isRoot||!b)&&(M=m.call(this,M,O))}),M};tn.prototype.paths=function(){var m=[];return this.forEach(function(){m[m.length]=this.path}),m};tn.prototype.nodes=function(){var m=[];return this.forEach(function(){m[m.length]=this.node}),m};tn.prototype.clone=function(){var m=[],f=[],b=this.options;return dg(this.value)?mg(this.value):function M(O){for(var G=0;G<m.length;G++)if(m[G]===O)return f[G];if(typeof O=="object"&&O!==null){var l=vg(O,b);m[m.length]=O,f[f.length]=l;var le=b.includeSymbols?Vc:Oc;return Fc(le(O),function(H){l[H]=M(O[H])}),m.pop(),f.pop(),l}return O}(this.value)};function _g(m){var f=arguments.length>1?arguments[1]:Af;return new tn(m,f)}Fc(Vc(tn.prototype),function(m){_g[m]=function(f){var b=[].slice.call(arguments,1),M=new tn(f);return M[m].apply(M,b)}});var iT=_g,nT=vi;function vi(m){if(!(this instanceof vi))return new vi(m);this._bbox=m||[1/0,1/0,-1/0,-1/0],this._valid=!!m}vi.prototype.include=function(m){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],m[0]),this._bbox[1]=Math.min(this._bbox[1],m[1]),this._bbox[2]=Math.max(this._bbox[2],m[0]),this._bbox[3]=Math.max(this._bbox[3],m[1]),this};vi.prototype.equals=function(m){var f;return m instanceof vi?f=m.bbox():f=m,this._bbox[0]==f[0]&&this._bbox[1]==f[1]&&this._bbox[2]==f[2]&&this._bbox[3]==f[3]};vi.prototype.center=function(m){return this._valid?[(this._bbox[0]+this._bbox[2])/2,(this._bbox[1]+this._bbox[3])/2]:null};vi.prototype.union=function(m){this._valid=!0;var f;return m instanceof vi?f=m.bbox():f=m,this._bbox[0]=Math.min(this._bbox[0],f[0]),this._bbox[1]=Math.min(this._bbox[1],f[1]),this._bbox[2]=Math.max(this._bbox[2],f[2]),this._bbox[3]=Math.max(this._bbox[3],f[3]),this};vi.prototype.bbox=function(){return this._valid?this._bbox:null};vi.prototype.contains=function(m){if(!m)return this._fastContains();if(!this._valid)return null;var f=m[0],b=m[1];return this._bbox[0]<=f&&this._bbox[1]<=b&&this._bbox[2]>=f&&this._bbox[3]>=b};vi.prototype.intersect=function(m){if(!this._valid)return null;var f;return m instanceof vi?f=m.bbox():f=m,!(this._bbox[0]>f[2]||this._bbox[2]<f[0]||this._bbox[3]<f[1]||this._bbox[1]>f[3])};vi.prototype._fastContains=function(){if(!this._valid)return new Function("return null;");var m="return "+this._bbox[0]+"<= ll[0] &&"+this._bbox[1]+"<= ll[1] &&"+this._bbox[2]+">= ll[0] &&"+this._bbox[3]+">= ll[1]";return new Function("ll",m)};vi.prototype.polygon=function(){return this._valid?{type:"Polygon",coordinates:[[[this._bbox[0],this._bbox[1]],[this._bbox[2],this._bbox[1]],[this._bbox[2],this._bbox[3]],[this._bbox[0],this._bbox[3]],[this._bbox[0],this._bbox[1]]]]}:null};var aT=cx,oT=iT,sT=nT,xg={features:["FeatureCollection"],coordinates:["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],geometry:["Feature"],geometries:["GeometryCollection"]},lT=Object.keys(xg);Dc.exports=function(m){return Ef(m).bbox()};Dc.exports.polygon=function(m){return Ef(m).polygon()};Dc.exports.bboxify=function(m){return oT(m).map(function(f){if(f){var b=lT.some(function(M){return f[M]?xg[M].indexOf(f.type)!==-1:!1});b&&(f.bbox=Ef(f).bbox(),this.update(f))}})};function Ef(m){for(var f=sT(),b=aT(m),M=0;M<b.length;M++)f.include(b[M]);return f}var uT=Dc.exports;const cT=Y.getDefaultExportFromCjs(uT),pT={methods:{getIconDetails(m){const f={};switch(m){case"cities":f.name="fa-regular fa-city";break;case"towns":f.name="fa-regular fa-house-chimney-window";break;case"islands":f.name="fa-regular fa-ship";break;case"regions":f.name="fa-regular fa-map-location-dot";break;case"national-parks":f.name="fa-kit fa-vs-icon-national-park";break;case"acco":f.name="fa-regular fa-bed";break;case"acti":f.name="fa-regular fa-person-walking";break;case"attr":f.name="fa-regular fa-camera";break;case"even":f.name="fa-regular fa-ticket";break;case"cate":f.name="fa-regular fa-utensils";break;case"reta":f.name="fa-regular fa-bag-shopping";break;case"featured":f.name="fa-solid fa-star";break;case"twnv":f.name="";break;case"vics":f.name="fa-kit fa-vs-icentre-information";break;case"outlander-castle":f.name="fa-regular fa-chess-rook";break;case"outlander-church-abbey":f.name="fa-regular fa-church";break;case"outlander-city-town-village":f.name="fa-regular fa-city";break;case"outlander-heritage":f.name="fa-regular fa-landmark";break;case"outlander-landscape-park":f.name="fa-regular fa-mountain";break;case"outlander-palace-house":f.name="fa-regular fa-crown";break;case"distilleries":f.name="fa-kit fa-vs-distillery";break;case"itinerary-stop":f.name="";break}return f}}},hT={name:"VsMapMarkerIcon",status:"prototype",release:"0.0.1",components:{VsIcon:Y.VsIcon},mixins:[pT],props:{id:{type:String,required:!0},isHovered:{type:Boolean,default:!1},number:{type:String,default:""},isMapMarker:{type:Boolean,default:!1}},computed:{mapMarkerType(){let m="fa-solid fa-location-pin";return this.id==="twnv"&&(m="fa-solid fa-location-dot"),m},parentClasses(){return this.isMapMarker?"vs-map-marker-icon--map-marker":""},markerClasses(){return[`vs-map-marker-icon__marker--${this.id}`,this.isHovered?"vs-map-marker-icon__marker--outline":""]}}},fT={key:0,class:"vs-map-marker-icon__count"};function dT(m,f,b,M,O,G){const l=R.resolveComponent("VsIcon");return R.openBlock(),R.createElementBlock("div",{"data-test":"vs-map-marker-icon",class:R.normalizeClass(["vs-map-marker-icon",G.parentClasses])},[R.createVNode(l,{icon:G.mapMarkerType,class:R.normalizeClass(["vs-map-marker-icon__marker",G.markerClasses]),size:"xl"},null,8,["icon","class"]),b.number?(R.openBlock(),R.createElementBlock("span",fT,[f[0]||(f[0]=R.createElementVNode("span",{class:"visually-hidden"}," Stop ",-1)),R.createTextVNode(" "+R.toDisplayString(b.number),1)])):(R.openBlock(),R.createBlock(l,{key:1,class:"vs-map-marker-icon__icon",icon:m.getIconDetails(b.id).name,size:"xs"},null,8,["icon"]))],2)}const Nc=Y._export_sfc(hT,[["render",dT]]);let Vo=null;const mT={name:"VsMapMarker",status:"prototype",release:"0.0.1",components:{VsMapMarkerIcon:Nc},props:{feature:{type:Object,required:!0},mapId:{type:String,required:!0},hasPopups:{type:Boolean,required:!0},selectedPlace:{type:String,default:null}},emits:["showDetail","setCategory"],setup(){Vo=$i()},computed:{isActive(){return!!(this.activePlace&&this.activePlace.properties&&this.activePlace.properties.id===this.feature.properties.id||this.highlightedPlace&&this.highlightedPlace.properties&&this.highlightedPlace.properties.id===this.feature.properties.id)},...Ka.mapState($i,{highlightedPlace(m){return m.getHoveredStop(this.mapId)},activePlace(m){return m.getActivePlace(this.mapId)?m.getActivePlace(this.mapId):""},activeSubcat(m){return m.selectedSubCategory}}),getMarkerIcon(){let m;return this.feature.properties.type!==""?m=this.feature.properties.type:this.activeSubcat!==null?m=this.activeSubcat:m="featured",m==="null"&&(m=""),m}},watch:{isActive(){return this.activePlace&&this.activePlace.properties.id===this.feature.properties.id||this.highlightedPlace&&this.highlightedPlace.properties.id===this.feature.properties.id?!0:(this.activePlace&&this.activePlace.properties.id===this.feature.properties.id&&Vo.setActiveMarkerPos(this.feature.geometry.coordinates),!1)},activePlace(){this.activePlace&&this.activePlace.properties.id===this.feature.properties.id&&Vo.setActiveMarkerPos(this.feature.geometry.coordinates)}},mounted(){this.hasPopups&&document.body.addEventListener("click",this.handleClickEvent)},beforeUnmount(){document.body.removeEventListener("click",this.handleClickEvent)},methods:{markerClick(){Vo.setActiveMarkerPos(this.feature.geometry.coordinates),Vo.setActivePlace({mapId:this.mapId,activeFeature:this.feature}),this.$emit("showDetail",this.feature),this.$emit("setCategory",this.feature.properties.type)},handleHover(m){Vo.setHoveredPlace({mapId:this.mapId,hoveredFeature:m})},handleClickEvent(m){const f=document.getElementsByClassName("mapboxgl-canvas");m.target===f[0]&&Vo.setActivePlace({mapId:this.mapId,activeFeature:null})}}},yT=["aria-label"];function vT(m,f,b,M,O,G){const l=R.resolveComponent("VsMapMarkerIcon");return R.openBlock(),R.createElementBlock("button",{type:"button",class:R.normalizeClass(["vs-map-marker",G.isActive?"vs-map-marker--active":""]),"data-test":"vs-map-marker",onClick:f[0]||(f[0]=(...le)=>G.markerClick&&G.markerClick(...le)),onKeydown:f[1]||(f[1]=R.withKeys((...le)=>G.markerClick&&G.markerClick(...le),["enter"])),onMouseover:f[2]||(f[2]=le=>G.handleHover(b.feature)),onMouseleave:f[3]||(f[3]=le=>G.handleHover("")),onFocusin:f[4]||(f[4]=le=>G.handleHover(b.feature)),onFocusout:f[5]||(f[5]=le=>G.handleHover("")),"aria-label":G.getMarkerIcon},[R.createVNode(l,{id:G.getMarkerIcon,"is-map-marker":!0,number:b.feature.properties.stopCount?b.feature.properties.stopCount:""},null,8,["id","number"])],42,yT)}const bg=Y._export_sfc(mT,[["render",vT]]);let js=null;const gT={name:"VsMap",status:"prototype",release:"0.0.1",components:{VsWarning:Y.VsWarning,VsLoading:Y.VsLoading},props:{overviewMapLatitude:{type:String,default:"57.81"},overviewMapLongitude:{type:String,default:"-5.51748"},overviewMapZoom:{type:String,default:"5"},mapId:{type:String,required:!0},isVisible:{type:Boolean,required:!0},places:{type:Array,required:!0},filters:{type:Array,default(){return[]}},fitToMarkers:{type:Boolean,default:!1},showPolygons:{type:Boolean,default:!1},selectedItem:{type:Object,default:null},boundsData:{type:Object,default:()=>{}},showInfoMessage:{type:Boolean,default:null},resetZoom:{type:Boolean,default:!1},showMarkerPopups:{type:Boolean,default:!0},loadBrandingImmediately:{type:Boolean,default:!1}},emits:["map-ready","setCategory","showDetail","zoom-reset"],setup(){js=$i()},data(){return{isDesktop:!1,geojsonData:{type:"FeatureCollection",features:[]},polygons:{type:"FeatureCollection",features:[]},multiPolygons:[],mapbox:{map:null,bounds:null,rotation:0,config:{container:this.$refs.mapbox,style:"https://api.visitscotland.com/maps/vector/v1/vts/resources/styles",pitchWithRotate:!1,dragRotate:!1}},markers:[],popup:null,hoveredStateId:null,activeStateId:null,showMapMessage:!0,isLoading:!0,showZoomMessage:null}},computed:{getZoom(){return this.mapbox.map?this.mapbox.map.getZoom():null},...Ka.mapState($i,{activeMarkerPostion(m){return this.mapbox.map?m.activeMarkerPos:null},highlightedPlace(m){return this.mapbox.map?m.getHoveredStop(this.mapId):null},activePlace(m){return this.mapbox.map?m.getActivePlace(this.mapId):null}})},watch:{isVisible(m){m&&this.mapbox.map!==null&&setTimeout(()=>{this.mapbox.map.resize()},20)},places:{handler(){this.geojsonData.features=[],this.initialiseMapFeatures(),this.initialiseMapMarkers()},deep:!0},showPolygons(m){m===!0?this.showMapPolygons():this.hideMapPolygons()},highlightedPlace(m){m&&(m.length===0?this.removeHoveredPolygon():m.geometry.type!=="Point"&&this.addHoveredPolygon(m))},selectedItem(m){if(m&&m.geometry.type!=="Point"){let f=[];f=this.polygons.features.filter(b=>b.properties.id===m.properties.id),f.length>0&&this.addActivePolygon(m)}m||this.removeActivePolygon()},activeMarkerPostion(m){this.checkPointIsVisible(m)||this.centreMapOnPoint(m)},showInfoMessage(m){m?this.showMapMessage=!0:this.showMapMessage=!1},resetZoom(m){m&&(this.mapbox.map.fitBounds(this.calculateBoundingBox()),this.$emit("zoom-reset"),this.showInfoMessage&&(this.showMapMessage=!0))}},mounted(){js.addMapInstance({id:this.mapId,filters:this.filters,places:this.places,activePins:this.places}),this.lazyloadMapComponent(),this.isTablet=window.innerWidth>=768,window.addEventListener("resize",this.onResize),this.loadBrandingImmediately?Hd.init({div:this.mapId}):window.addEventListener("DOMContentLoaded",()=>{Hd.init({div:this.mapId})})},methods:{addMap(){const m=this.calculateBoundingBox();this.mapbox.config.container=this.$refs.mapbox,this.mapbox.map=new Un.Map({container:this.$refs.mapbox,style:"https://api.visitscotland.com/maps/vector/v1/vts/resources/styles",bounds:m,maxZoom:18,minZoom:4,trackResize:!0}),this.mapbox.map.scrollZoom.disable(),this.mapbox.map.on("rotate",()=>{this.mapbox.rotation=this.mapbox.map.transform.angle}),this.mapbox.map.resize(),this.mapbox.map.on("load",()=>{this.addMapPolygons(),this.showMapMessage=!1,this.isLoading=!1,this.$emit("map-ready",!0),this.mapbox.map.boxZoom.enable()}),this.mapbox.map.on("zoomend",()=>{this.mapbox.map.getZoom()===4?(this.showZoomMessage="too-far",this.showMapMessage=!0):this.mapbox.map.getZoom()===18?(this.showZoomMessage="too-close",this.showMapMessage=!0):this.showInfoMessage||(this.showZoomMessage=null,this.showMapMessage=!1)})},addMapControls(){const m=new Un.NavigationControl;this.mapbox.map.addControl(m,"top-right"),this.mapbox.map.addControl(new Un.FullscreenControl)},initialiseMapFeatures(){this.places.map(m=>{if(typeof m.geometry<"u"){const f=this.getCoordinateArray(m);return this.getMapFeatures(m,f)}return m.latitude&&m.longitude?this.getItineraryMapFeatures(m):!1})},getCoordinateArray(m){return m.geometry.type==="Polygon"?[m.geometry.coordinates[0]]:m.geometry.type==="MultiPolygon"?[m.geometry.coordinates]:[m.geometry.coordinates[0],m.geometry.coordinates[1]]},getMapFeatures(m,f){return this.geojsonData.features.push({type:"Feature",geometry:{type:m.geometry.type,coordinates:f},properties:{title:m.properties.title,imageSrc:m.image,type:typeof m.properties.category<"u"?m.properties.category.id:"",id:m.properties.id},id:m.properties.id})},getItineraryMapFeatures(m){const f=this._uid;return this.geojsonData.features.push({type:"Feature",geometry:{type:"Point",coordinates:[parseFloat(m.longitude),parseFloat(m.latitude)]},properties:{title:m.title,imageSrc:m.imageSrc,type:"itinerary-stop",stopCount:m.stopCount,id:f},id:f})},initialiseMapMarkers(){let m=0;this.initialLoad&&(m=1e3),setTimeout(()=>{if(this.markers!==null){for(let f=this.markers.length-1;f>=0;f--)this.markers[f].remove();this.markers=[]}this.geojsonData.features.forEach(f=>{f.geometry.type==="Point"&&this.createMapMarker(f)})},m)},createMapMarker(m){const f=R.h(bg,{feature:m,mapId:this.mapId,hasPopups:this.showMarkerPopups,onShowDetail:O=>{this.$emit("showDetail",O)},onSetCategory:O=>{this.$emit("setCategory",O)}}),b=document.createElement("div");this.$refs.mapboxOuter.appendChild(b),R.render(f,b),m&&this.showMarkerPopups&&this.addMapPopup(m);const M=new Un.Marker(b.children[0]).setLngLat(m.geometry.coordinates).setPopup(this.popup).addTo(this.mapbox.map);this.setupMarkerListeners(M),this.markers.push(M),b.remove()},hideMapPolygons(){this.mapbox.map.setLayoutProperty("regionFills","visibility","none"),this.mapbox.map.setLayoutProperty("regionBorders","visibility","none")},showMapPolygons(){this.mapbox.map.setLayoutProperty("regionFills","visibility","visible"),this.mapbox.map.setLayoutProperty("regionBorders","visibility","visible")},addMapPolygons(){this.geojsonData.features.forEach(m=>{m.geometry.type==="Polygon"?this.polygons.features.includes(m.properties.id)||this.polygons.features.push(m):m.geometry.type==="MultiPolygon"&&(this.polygons.features.includes(m.properties.id)||this.multiPolygons.push(m))}),this.multiPolygons.forEach(m=>{const f=m.properties;m.geometry.coordinates[0].forEach(b=>{this.polygons.features.push({geometry:{type:"Polygon",coordinates:b},id:f.id,properties:{id:f.id,imageSrc:f.imageSrc,title:f.title,type:f.type},type:"Feature"})})}),this.polygons.features.length>0&&(this.mapbox.map.addSource("regions",{type:"geojson",data:this.polygons,promoteId:"id"}),this.mapbox.map.addLayer({id:"regionFills",type:"fill",source:"regions",layout:{},paint:{"fill-color":["case",["==",["feature-state","interaction-state"],"hover"],"rgba(168,48,140,0.5)",["==",["feature-state","interaction-state"],"active"],"rgba(168,48,140,0.5)","rgba(25,200,197,0.6)"],"fill-opacity":.8}}),this.mapbox.map.addLayer({id:"regionBorders",type:"line",source:"regions",layout:{},paint:{"line-color":"#fff","line-width":1}}),this.hideMapPolygons(),this.mapbox.map.on("mousemove","regionFills",m=>{m.features.length>0&&(this.addMapPopup(m),this.removeHoveredPolygon(),this.addHoveredPolygon(m.features[0]))}),this.mapbox.map.on("mouseleave","regionFills",m=>{this.removeMapPopup(m),this.removeHoveredPolygon()}),this.mapbox.map.on("click","regionFills",m=>{this.removeActivePolygon(),this.addActivePolygon(m.features[0]),this.addMapPopup(m.features[0])}))},removeActivePolygon(){this.mapbox.map.style._layers.regionFills&&(this.mapbox.map.setFeatureState({source:"regions",id:this.activeStateId},{"interaction-state":""}),this.activeStateId=null)},addActivePolygon(m){this.activeStateId=m.properties.id,this.mapbox.map.setFeatureState({source:"regions",id:this.activeStateId},{"interaction-state":"active"}),js.setActivePlace({mapId:this.mapId,activeFeature:m}),this.$emit("showDetail",m),this.$emit("setCategory","regions")},removeHoveredPolygon(){if(this.hoveredStateId){let m="";this.hoveredStateId===this.activeStateId&&(m="active"),this.mapbox.map.setFeatureState({source:"regions",id:this.hoveredStateId},{"interaction-state":m})}js.setHoveredPlace({mapId:this.mapId,hoveredFeature:""}),this.hoveredStateId=null},addHoveredPolygon(m){this.hoveredStateId=m.properties.id,this.mapbox.map.setFeatureState({source:"regions",id:this.hoveredStateId},{"interaction-state":"hover"}),this.addMapPopup(m),js.setHoveredPlace({mapId:this.mapId,hoveredFeature:m})},addMapPopup(m){let f="";m.features?f=m.features[0]:f=m;const b=this.getCoordinates(f),M=this.getPopupHtml(f);f.properties.id&&(this.removeMapPopup(m),this.popup=new Un.Popup({closeButton:!1,offset:{top:[0,20],bottom:[0,-40],left:[30,-20],right:[-30,-20]}}).setLngLat(b).setHTML(M).addTo(this.mapbox.map))},removeMapPopup(m){this.popup&&(this.popup.remove(),this.popup=null),m._popup&&m._popup.remove()},getCoordinates(m){return m.geometry.type==="Polygon"?this.findFeatureCentre(m.geometry.coordinates):m.geometry.type==="MultiPolygon"?this.findFeatureCentre(m.geometry.coordinates[0]):m.geometry.coordinates},findFeatureCentre(m){const f=[],b=[];return m[0].forEach(M=>{f.push(M[1]),b.push(M[0])}),{lat:(Math.min(...f)+Math.max(...f))/2,lng:(Math.min(...b)+Math.max(...b))/2}},getPopupHtml(m){return m.properties.imageSrc&&m.properties.stopCount?`
|
|
501
501
|
<img class="vs-map__popup-image" src="${m.properties.imageSrc}" />
|
|
502
502
|
<div>
|
|
503
503
|
<h4 class="vs-map__popup-subtitle">Stop ${m.properties.stopCount}</h4>
|
|
@@ -505,4 +505,4 @@ uniform `+z+" "+D+" u_"+L+`;
|
|
|
505
505
|
</div>
|
|
506
506
|
`:`
|
|
507
507
|
<p class="vs-map__popup-title">${m.properties.title}</p>
|
|
508
|
-
`},setupMarkerListeners(m){document.body.addEventListener("keyup",b=>{(b.key==="Escape"||b.key==="Tab")&&(this.removeMapPopup(m),this.showMarkerPopups&&js.setActivePlace({mapId:this.mapId,activeFeature:null}))}),m.getElement().addEventListener("keyup",b=>{b.key==="Enter"&&(m._popup.isOpen()||m._popup.addTo(this.mapbox.map))})},fitToBounds(){this.mapbox.map.fitBounds(nT(this.geojsonData),{padding:{top:100,bottom:100,left:100,right:100}})},initialiseMapComponent(){this.addMap(),this.addMapControls(),this.places.length&&this.initialiseMapFeatures(),this.geojsonData.features.length&&(this.initialiseMapMarkers(),this.fitToMarkers&&this.fitToBounds())},lazyloadMapComponent(){if(Un.supported({failIfMajorPerformanceCaveat:!0}),!("IntersectionObserver"in window)){this.initialiseMapComponent();return}this.observer=new IntersectionObserver(m=>{m[0].intersectionRatio>0&&(this.observer.unobserve(this.$el),this.initialiseMapComponent())}),this.observer.observe(this.$el)},onResize(){this.isTablet=window.innerWidth>=768},getBoundsFromPolygon(){const m=this.boundsData.coordinates[0];return m.reduce((d,b)=>d.extend(b),new Un.LngLatBounds(m[0],m[0]))},checkPointIsVisible(){return this.mapbox.map.getBounds().contains(this.activeMarkerPostion)},centreMapOnPoint(m){this.mapbox.map.flyTo({center:m})},calculateBoundingBox(){let m;if(typeof this.boundsData>"u"||this.boundsData.type==="undefined")m=[[-7.555827,54.608836],[-.778285,60.880894]];else if(this.boundsData.type==="bounds"){const d=new Un.LngLat(this.boundsData.coordinates[1][0],this.boundsData.coordinates[1][1]),b=new Un.LngLat(this.boundsData.coordinates[0][0],this.boundsData.coordinates[0][1]);m=new Un.LngLatBounds(d,b)}else this.boundsData.type==="Polygon"?m=this.getBoundsFromPolygon():m=[[-7.555827,54.608836],[-.778285,60.880894]];return m}}},fT={class:"vs-map","data-test":"vs-map"},dT={class:"vs-map__message-box"},mT={class:"vs-map__message-text"},yT={ref:"mapboxOuter",class:"vs-map__map-outer"},vT=["id"];function gT(m,d,b,M,O,G){const l=R.resolveComponent("VsLoading"),oe=R.resolveComponent("VsWarning");return R.openBlock(),R.createElementBlock("div",fT,[O.showMapMessage?(R.openBlock(),R.createElementBlock("div",{key:0,class:R.normalizeClass(["vs-map__message",O.showZoomMessage?"":"vs-map__message--with-overlay"]),"data-test":"vs-map__message"},[R.createElementVNode("div",dT,[O.isLoading?(R.openBlock(),R.createBlock(l,{key:0,class:"vs-map__loading"})):R.createCommentVNode("",!0),R.createElementVNode("p",mT,[O.isLoading?R.renderSlot(m.$slots,"map-loading-text",{key:0}):b.showInfoMessage?R.renderSlot(m.$slots,"info-message",{key:1}):O.showZoomMessage==="too-close"?R.renderSlot(m.$slots,"zoom-too-close",{key:2}):O.showZoomMessage==="too-far"?R.renderSlot(m.$slots,"zoom-too-far",{key:3}):R.createCommentVNode("",!0)])])],2)):R.createCommentVNode("",!0),R.createElementVNode("div",yT,[R.createElementVNode("div",{id:b.mapId,class:"vs-map__map",ref:"mapbox"},null,8,vT)],512),R.createVNode(oe,{class:"vs-map__no-js"},{default:R.withCtx(()=>[R.renderSlot(m.$slots,"no-js")]),_:3})])}const wg=Y._export_sfc(hT,[["render",gT]]),_T={name:"VsMapWithSidebarCategories",status:"prototype",release:"0.0.1",components:{VsMapMarkerIcon:qc,VsIcon:Y.VsIcon},props:{categoryName:{type:String,required:!0},type:{type:String,required:!0},hasSubCat:{type:Boolean,default:!1}},data(){return{isHovered:!1}},methods:{selectCategory(m){this.hasSubCat?this.$parent.$emit("set-subcategory",m):(this.$parent.$emit("set-category",m),this.$parent.$emit("set-stage",1))}}},xT={class:"vs-main-map-category","data-test":"vs-main-map-category"};function bT(m,d,b,M,O,G){const l=R.resolveComponent("VsMapMarkerIcon"),oe=R.resolveComponent("VsIcon");return R.openBlock(),R.createElementBlock("div",xT,[R.createElementVNode("button",{type:"button",class:R.normalizeClass(["vs-main-map-category__button",`vs-main-map-category__button--${b.type}`]),"data-test":"vs-main-map-category__button",onClick:d[0]||(d[0]=W=>G.selectCategory(b.type)),onMouseover:d[1]||(d[1]=W=>O.isHovered=!0),onMouseout:d[2]||(d[2]=W=>O.isHovered=!1),onFocusin:d[3]||(d[3]=W=>O.isHovered=!0),onFocusout:d[4]||(d[4]=W=>O.isHovered=!1)},[R.createElementVNode("div",null,[R.createVNode(l,{class:"vs-main-map-category__icon",id:b.type,"is-hovered":O.isHovered},null,8,["id","is-hovered"]),R.createTextVNode(" "+R.toDisplayString(b.categoryName),1)]),R.createVNode(oe,{icon:"fa-regular fa-arrow-right",variant:"highlight",size:"xs",class:"vs-main-map-category__icon align-self-center me-0"})],34)])}const wT=Y._export_sfc(_T,[["render",bT]]);let wc=null;const ST={name:"VsMapWithSidebarSubCategories",status:"prototype",release:"0.0.1",components:{BFormGroup:Y.ku,BFormCheckboxGroup:Y.uu,BFormCheckbox:Y.fn,VsMapMarkerIcon:qc},props:{data:{type:Array,required:!0},selectedSubCategory:{type:String,required:!0}},data(){return{selected:[]}},computed:{activeSubcatFilters(){return wc?wc.activeSubcatFilters:null},...Ka.mapState($i,{activeSubcatFilters(m){return m.activeSubcatFilters}})},mounted(){wc=$i(),this.selected=this.activeSubcatFilters,this.emitter&&(this.emitter.on("clearSelectedSubcats",()=>{this.selected=[]}),this.emitter.on("submitCheckboxData",()=>{this.checkboxesChangeSubmit()}));const m=document.getElementsByClassName("vs-main-map-subcategory")[0];m&&m.querySelectorAll('input[type="checkbox"]')[0].focus()},beforeUnmount(){this.emitter&&this.emitter.off("submitCheckboxData")},methods:{checkboxesChangeSubmit(){wc.setActiveSubcatFilters(this.selected),this.$parent.$emit("subcategories-filtered",this.selected)},emitChange(){this.emitter&&this.emitter.emit("checkboxes-selected",this.selected)}}},TT={class:"vs-main-map-subcategory","data-test":"vs-main-map-subcategory"};function IT(m,d,b,M,O,G){const l=R.resolveComponent("VsMapMarkerIcon"),oe=R.resolveComponent("BFormCheckbox"),W=R.resolveComponent("BFormCheckboxGroup"),ve=R.resolveComponent("BFormGroup");return R.openBlock(),R.createElementBlock("div",TT,[R.createVNode(ve,null,{default:R.withCtx(()=>[R.createVNode(W,{id:"checkbox-group-1",modelValue:O.selected,"onUpdate:modelValue":d[0]||(d[0]=me=>O.selected=me),name:b.data.name},{default:R.withCtx(()=>[(R.openBlock(!0),R.createElementBlock(R.Fragment,null,R.renderList(b.data,me=>(R.openBlock(),R.createBlock(oe,{key:me.id,value:me.id,onChange:G.emitChange},{default:R.withCtx(()=>[R.createVNode(l,{class:"vs-main-map-subcategory__icon",id:b.selectedSubCategory},null,8,["id"]),R.createTextVNode(" "+R.toDisplayString(me.name),1)]),_:2},1032,["value","onChange"]))),128))]),_:1},8,["modelValue","name"])]),_:1})])}const AT=Y._export_sfc(ST,[["render",IT]]);let Qh=null;const ET={name:"VsMapWithSidebarListItem",status:"prototype",release:"0.0.1",components:{VsImg:Y.VsImg,VsIcon:Y.VsIcon},inject:["mapId"],props:{itemData:{type:Object,required:!0},fromEndpoint:{type:Boolean,default:!1},focussed:{type:Boolean,default:!1}},data(){return{formattedData:{}}},computed:{isActive(){return!!(this.highlightedPlace&&this.formattedData&&this.highlightedPlace.properties.id===this.formattedData.properties.id)},...Ka.mapState($i,{highlightedPlace(m){return m.getHoveredStop(this.mapId)}})},created(){this.fromEndpoint?this.formatApiData():this.formattedData=this.itemData},mounted(){Qh=$i(),this.focussed&&this.$refs.btn.focus()},methods:{showItemDetail(m){Qh.setActivePlace({mapId:this.mapId,activeFeature:m}),this.$parent.$emit("show-item-detail",m),this.$parent.$emit("set-stage",2)},itemHover(m){Qh.setHoveredPlace({mapId:this.mapId,hoveredFeature:m})},formatApiData(){this.formattedData={geometry:{coordinates:[this.itemData.longitude,this.itemData.latitude],type:"Point"},properties:{category:this.itemData.category[0],description:this.itemData.description,id:this.itemData.id,image:typeof this.itemData.images<"u"?this.itemData.images[0].mediaUrl:"",title:this.itemData.name,link:{label:this.itemData.website.label,link:this.itemData.website.link,type:this.itemData.website.type}},type:"Point"}}}},CT={class:"vs-map-with-sidebar-list-item__img-container"},PT={class:"vs-map-with-sidebar-list-item__text"};function kT(m,d,b,M,O,G){const l=R.resolveComponent("VsImg"),oe=R.resolveComponent("VsIcon");return R.openBlock(),R.createElementBlock("button",{type:"button",class:R.normalizeClass(["vs-map-with-sidebar-list-item",G.isActive?"vs-map-with-sidebar-list-item--hovered":""]),"data-test":"vs-map-with-sidebar-list-item",onClick:d[0]||(d[0]=W=>G.showItemDetail(O.formattedData)),onKeyup:d[1]||(d[1]=R.withKeys(W=>G.showItemDetail(O.formattedData),["enter"])),onMouseover:d[2]||(d[2]=W=>G.itemHover(O.formattedData)),onMouseleave:d[3]||(d[3]=W=>G.itemHover("")),onFocusin:d[4]||(d[4]=W=>G.itemHover(O.formattedData)),onFocusout:d[5]||(d[5]=W=>G.itemHover("")),ref:"btn"},[R.createElementVNode("div",CT,[typeof O.formattedData.properties.image<"u"?(R.openBlock(),R.createBlock(l,{key:0,src:O.formattedData.properties.image,class:"vs-map-with-sidebar-list-item__img"},null,8,["src"])):R.createCommentVNode("",!0)]),R.createElementVNode("span",PT,R.toDisplayString(O.formattedData.properties.title),1),R.createVNode(oe,{icon:"fa-regular fa-arrow-right",variant:"highlight",size:"xxs",class:"vs-map-with-sidebar-list-item__icon"})],34)}const MT=Y._export_sfc(ET,[["render",kT]]),zT={name:"VsMapWithSidebarDetail",status:"prototype",release:"0.0.1",components:{VsImg:Y.VsImg,VsHeading:Y.VsHeading},props:{contentData:{type:Object,required:!0},headingLevel:{type:String,default:"3"}},computed:{showTitle(){return typeof this.contentData.properties.title<"u"||typeof this.contentData.properties.placeTitle<"u"}}},BT={class:"vs-map-with-sidebar-detail","data-test":"vs-map-with-sidebar-detail"},DT={key:2,"data-test":"vs-map-with-sidebar-detail__address",class:"vs-map-with-sidebar-detail__address"},LT={key:3,class:"mt-100"},RT=["innerHTML"];function FT(m,d,b,M,O,G){const l=R.resolveComponent("VsImg"),oe=R.resolveComponent("VsHeading");return R.openBlock(),R.createElementBlock("div",BT,[typeof b.contentData.properties.image<"u"?(R.openBlock(),R.createBlock(l,{key:0,src:b.contentData.properties.image,class:"vs-map-with-sidebar-detail__image mb-125 mb-lg-075"},null,8,["src"])):R.createCommentVNode("",!0),G.showTitle?(R.openBlock(),R.createBlock(oe,{key:1,level:b.headingLevel,"heading-style":"heading-xxs",class:"vs-map-with-sidebar-detail__heading mt-0","data-test":"vs-map-with-sidebar-detail__heading"},{default:R.withCtx(()=>[typeof b.contentData.properties.placeTitle<"u"?(R.openBlock(),R.createElementBlock(R.Fragment,{key:0},[R.createTextVNode(R.toDisplayString(b.contentData.properties.placeTitle),1)],64)):(R.openBlock(),R.createElementBlock(R.Fragment,{key:1},[R.createTextVNode(R.toDisplayString(b.contentData.properties.title),1)],64))]),_:1},8,["level"])):R.createCommentVNode("",!0),typeof b.contentData.properties.address<"u"?(R.openBlock(),R.createElementBlock("p",DT,R.toDisplayString(b.contentData.properties.address.shortAddress),1)):R.createCommentVNode("",!0),b.contentData.properties.subtitle?(R.openBlock(),R.createElementBlock("p",LT,R.toDisplayString(b.contentData.properties.subtitle),1)):R.createCommentVNode("",!0),R.createElementVNode("div",{"data-test":"vs-map-with-sidebar-detail__description",class:"vs-map-with-sidebar-detail__description mb-150",innerHTML:b.contentData.properties.description},null,8,RT)])}const OT=Y._export_sfc(zT,[["render",FT]]),VT={name:"VsMapWithSidebarButtons",status:"prototype",release:"0.0.1",components:{VsButton:Y.VsButton},inject:["filtersAppliedText","clearFiltersText"],props:{contentData:{type:Object,required:!0},filterCount:{type:Number,default:null}},emits:["clear-filters"],computed:{websiteDataExists(){return typeof this.contentData.properties.website<"u"&&this.contentData.properties.website.link!==this.contentData.properties.link.link}},methods:{filtersClick(){this.$parent.$emit("set-stage",0)},clearFiltersClick(){this.$emit("clear-filters")}}};function UT(m,d,b,M,O,G){const l=R.resolveComponent("VsButton");return R.openBlock(),R.createElementBlock("div",{class:R.normalizeClass(["vs-map-with-sidebar-buttons",b.filterCount!==null?"vs-map-with-sidebar-buttons--filters":""]),"data-test":"vs-map-with-sidebar-buttons"},[b.filterCount!==null?(R.openBlock(),R.createElementBlock(R.Fragment,{key:0},[R.createVNode(l,{class:"vs-map-with-sidebar-buttons__clear-filters","data-test":"vs-map-with-sidebar-buttons__clear-filters",variant:"secondary",size:"sm",onClick:G.clearFiltersClick},{default:R.withCtx(()=>[R.createTextVNode(R.toDisplayString(G.clearFiltersText),1)]),_:1},8,["onClick"]),R.createVNode(l,{class:"vs-map-with-sidebar-buttons__filters","data-test":"vs-map-with-sidebar-buttons__filters",variant:"secondary",icon:"vs-icon-control-filters",size:"sm",onClick:G.filtersClick},{default:R.withCtx(()=>[R.createTextVNode(R.toDisplayString(b.filterCount)+" "+R.toDisplayString(G.filtersAppliedText),1)]),_:1},8,["onClick"])],64)):(R.openBlock(),R.createElementBlock(R.Fragment,{key:1},[R.createVNode(l,{href:b.contentData.properties.link.link,"data-test":"vs-map-with-sidebar-buttons__discover",class:"mb-050"},{default:R.withCtx(()=>[R.createTextVNode(R.toDisplayString(b.contentData.properties.link.label),1)]),_:1},8,["href"]),G.websiteDataExists?(R.openBlock(),R.createBlock(l,{key:0,href:b.contentData.properties.website.link,target:"_blank",rel:"noopener noreferrer","data-test":"vs-map-with-sidebar-buttons__website",variant:"secondary"},{default:R.withCtx(()=>[R.createTextVNode(R.toDisplayString(b.contentData.properties.website.label),1)]),_:1},8,["href"])):R.createCommentVNode("",!0)],64))],2)}const NT=Y._export_sfc(VT,[["render",UT]]),qT={name:"VsMapWithSidebarControls",status:"prototype",release:"0.0.1",components:{VsButton:Y.VsButton},inject:["clearSelectionText","applyFiltersText"],data(){return{isDisabled:!0}},computed:{...Ka.mapState($i,{getSubcatFilters(m){return m.activeSubcatFilters}})},mounted(){this.disableSubmitButton()},methods:{clearSelection(){this.emitter&&this.emitter.emit("clearSelectedSubcats"),this.isDisabled=!0},submitCheckboxes(){this.emitter&&this.emitter.emit("submitCheckboxData")},disableSubmitButton(){this.emitter&&this.emitter.on("checkboxes-selected",m=>{m.length>0?this.isDisabled=!1:this.isDisabled=!0}),this.getSubcatFilters.length>0&&(this.isDisabled=!1)}}},jT={class:"vs-main-map-controls","data-test":"vs-main-map-controls"};function $T(m,d,b,M,O,G){const l=R.resolveComponent("VsButton");return R.openBlock(),R.createElementBlock("div",jT,[R.createVNode(l,{class:"vs-main-map-controls__clear-selection","data-test":"vs-main-map-subcategory__clear-selection",size:"sm",variant:"secondary",onClick:G.clearSelection,onKeyup:R.withKeys(G.clearSelection,["enter"])},{default:R.withCtx(()=>[R.createTextVNode(R.toDisplayString(G.clearSelectionText),1)]),_:1},8,["onClick","onKeyup"]),R.createVNode(l,{class:"vs-main-map-controls__apply-filters","data-test":"vs-main-map-subcategory__apply-filters",size:"sm",onKeypress:R.withKeys(G.submitCheckboxes,["enter"]),onClick:G.submitCheckboxes,"aria-disabled":O.isDisabled,disabled:O.isDisabled},{default:R.withCtx(()=>[R.createTextVNode(R.toDisplayString(G.applyFiltersText),1)]),_:1},8,["onKeypress","onClick","aria-disabled","disabled"])])}const ZT=Y._export_sfc(qT,[["render",$T]]);let ef=null;const GT={name:"VsMapWithSidebarPanel",status:"prototype",release:"0.0.1",components:{VsButton:Y.VsButton,VsMapWithSidebarCategory:wT,VsMapWithSidebarSubcategory:AT,VsHeading:Y.VsHeading,VsMapWithSidebarListItem:MT,VsMapWithSidebarDetail:OT,VsMapWithSidebarButtons:NT,VsMapWithSidebarControls:ZT},inject:["filters","filtersWithLocations","placesData","regions","mapId","focussedListItem"],props:{categoryHeading:{type:String,default:""},headingLevel:{type:String,default:"2"},selectedCategory:{type:String,default:""},selectedSubcategory:{type:String,default:null},currentStage:{type:Number,required:!0},selectedItem:{type:Object,default:null},hovered:{type:String,default:""},subcategoryLocations:{type:Array,default:null},currentEndpointData:{type:Array,default:()=>[]},panelStatus:{type:String,default:null},panelMessage:{type:String,default:null},totalPins:{type:Number,default:0},currentListItemFocus:{type:Number,default:0}},emits:["close-panel","load-more-places","set-stage","set-subcategory"],data(){return{placesLoaded:1}},computed:{currentHeading(){let m="";if(this.selectedSubcategory!==null)m=this.selectedSubcategoryData[0].label;else switch(this.currentStage){case 0:m=this.categoryHeading;break;case 1:case 2:m=this.currentFilter.label;break}return m},currentData(){return this.selectedCategory==="regions"?this.regions:this.placesData},panelClasses(){let m="";return this.currentStage===2&&(m+=" vs-map-with-sidebar-panel--small-padding"),m},headerClasses(){return this.currentStage===1?"vs-map-with-sidebar-panel__header-section--with-spacer":this.currentStage===2?"vs-map-with-sidebar-panel__header-section--overlapped":""},currentFilter(){let m="";return this.filters.forEach(d=>{d.id===this.selectedCategory&&(m=d)}),m},currentPlaceData(){let m=this.placesData;return this.selectedCategory==="regions"&&(m=this.regions),this.currentEndpointData.length>0?this.refineEndpointData(this.currentEndpointData):m.filter(d=>typeof d.properties<"u"&&this.selectedItem?d.properties.id===this.selectedItem.properties.id:!1)},selectedSubcategoryData(){return this.selectedSubcategory?this.filters.filter(d=>d.id===this.selectedSubcategory):[]},...Ka.mapState($i,{subCatFilterCount(m){return m.activeSubcatFilters.length}}),detailHeadingLevel(){return(parseInt(this.headingLevel,10)+1).toString()},showLoadMore(){return!(this.subcategoryLocations.length>=this.totalPins||this.subcategoryLocations.length===0)}},watch:{currentFilter(){this.placesLoaded=1}},mounted(){ef=$i()},methods:{closePanel(){this.$emit("close-panel"),window.innerWidth>=1292&&this.currentStage===2&&this.$emit("set-subcategory",null)},stageBack(){if(this.selectedSubcategory&&this.currentStage===0)this.$emit("set-subcategory",null);else if(this.selectedSubcategory!==null&&this.subcategoryLocations===null)this.setStage(0);else{const m=this.currentStage-1;this.setStage(m)}},resetPanel(){ef.setSelectedSubcat(null),this.setStage(0)},setStage(m){m===0&&(this.placesLoaded=1),this.$emit("set-stage",m)},subCatExists(m){return typeof m.subCategory<"u"&&m.subCategory.length>0},refineEndpointData(m){const d=[{isEndpoint:!0,properties:{category:m[0].category[0].id,id:m[0].id,image:m[0].images[0].mediaUrl,placeTitle:m[0].name,description:m[0].description,link:{label:m[0].productLink.label,link:m[0].productLink.link,type:m[0].productLink.type},website:{label:m[0].website.label,link:m[0].website.link,type:m[0].website.type},address:{shortAddress:""}}}];return typeof m[0].address<"u"&&(d[0].properties.address.shortAddress=m[0].address.shortAddress),d},clearSubCatFilters(){ef.setActiveSubcatFilters([]),this.setStage(0)},loadMorePlaces(){this.placesLoaded+=1,this.$emit("load-more-places",this.placesLoaded)}}},WT={class:"vs-map-with-sidebar-panel__buttons d-lg-none"},HT={key:0,class:"vs-map-with-sidebar-panel__back"},XT={key:1,class:"vs-map-with-sidebar-panel__back"},KT={class:"vs-map-with-sidebar-panel__close"},JT={key:0,class:"vs-map-with-sidebar-panel__back d-none d-lg-block"},YT={key:2,class:"vs-map-with-sidebar-panel__bottom-message"},QT={class:"vs-map-with-sidebar-panel__list-container"},eI={key:3,class:"vs-map-with-sidebar-panel__overlay"},tI={key:0,class:"vs-map-with-sidebar-panel__overlay-box"},rI={class:"vs-map-with-sidebar-panel__overlay-text"};function iI(m,d,b,M,O,G){const l=R.resolveComponent("VsButton"),oe=R.resolveComponent("VsHeading"),W=R.resolveComponent("VsMapWithSidebarSubcategory"),ve=R.resolveComponent("VsMapWithSidebarControls"),me=R.resolveComponent("VsMapWithSidebarCategory"),Le=R.resolveComponent("VsMapWithSidebarListItem"),le=R.resolveComponent("VsMapWithSidebarButtons"),ge=R.resolveComponent("VsMapWithSidebarDetail");return R.openBlock(),R.createElementBlock("section",{"data-test":"vs-map-with-sidebar-panel",class:R.normalizeClass(["vs-map-with-sidebar-panel",G.panelClasses])},[R.createElementVNode("div",{class:R.normalizeClass(["vs-map-with-sidebar-panel__header-section",G.headerClasses])},[R.createElementVNode("div",WT,[b.currentStage>1||b.selectedSubcategory?(R.openBlock(),R.createElementBlock("div",HT,[R.createVNode(l,{class:"vs-map-with-sidebar-panel_menu",icon:"vs-icon-control-menu",size:"sm",onClick:G.stageBack,"data-test":"vs-map-with-sidebar__menu-toggle",variant:"secondary"},{default:R.withCtx(()=>[R.renderSlot(m.$slots,"menu-btn-text")]),_:3},8,["onClick"])])):R.createCommentVNode("",!0),b.currentStage===1||b.selectedSubcategory?(R.openBlock(),R.createElementBlock("div",XT,[R.createVNode(l,{"icon-only":"",icon:"fa-regular fa-arrow-left",size:"md",variant:"subtle",onClick:G.stageBack,"data-test":"vs-map-with-sidebar-panel--btn-back"},{default:R.withCtx(()=>[R.renderSlot(m.$slots,"back-btn-text")]),_:3},8,["onClick"])])):R.createCommentVNode("",!0),R.createElementVNode("div",KT,[R.createVNode(l,{"icon-only":"",icon:"vs-icon-control-dismiss",size:"md",variant:"subtle",onClick:G.closePanel,"data-test":"vs-map-with-sidebar-panel--btn-close"},{default:R.withCtx(()=>[R.renderSlot(m.$slots,"close-side-panel-text")]),_:3},8,["onClick"])])]),b.currentStage>0||b.selectedSubcategory?(R.openBlock(),R.createElementBlock("div",JT,[R.createVNode(l,{"icon-only":"",icon:"fa-regular fa-arrow-left",size:"md",variant:"subtle",onClick:G.stageBack,"data-test":"vs-map-with-sidebar-panel--btn-back"},{default:R.withCtx(()=>[R.renderSlot(m.$slots,"back-btn-text")]),_:3},8,["onClick"])])):R.createCommentVNode("",!0),G.currentHeading!==""?(R.openBlock(),R.createBlock(oe,{key:1,level:b.headingLevel,"heading-style":b.currentStage===0?"heading-m":"heading-xs",class:R.normalizeClass(["vs-map-with-sidebar-panel__heading text-center mt-200 mt-lg-0",b.currentStage===2?"d-none d-lg-block":""]),"data-test":"vs-map-with-sidebar-panel__heading"},{default:R.withCtx(()=>[R.createTextVNode(R.toDisplayString(G.currentHeading),1)]),_:1},8,["level","heading-style","class"])):R.createCommentVNode("",!0),R.createElementVNode("div",{class:R.normalizeClass(["vs-map-with-sidebar-panel__reset",b.currentStage<2?"d-lg-none":""])},[R.createVNode(l,{"icon-only":"",icon:"vs-icon-control-dismiss",size:"md",variant:"subtle",onClick:G.resetPanel,"data-test":"vs-map-with-sidebar-panel--btn-reset"},{default:R.withCtx(()=>[R.renderSlot(m.$slots,"reset-side-panel-text")]),_:3},8,["onClick"])],2)],2),b.currentStage===0?(R.openBlock(),R.createElementBlock(R.Fragment,{key:0},[b.selectedSubcategory!==null?(R.openBlock(),R.createElementBlock(R.Fragment,{key:0},[R.createVNode(W,{data:G.selectedSubcategoryData[0].subCategory,"selected-sub-category":b.selectedSubcategory},null,8,["data","selected-sub-category"]),R.createVNode(ve)],64)):(R.openBlock(!0),R.createElementBlock(R.Fragment,{key:1},R.renderList(G.filtersWithLocations,Re=>(R.openBlock(),R.createBlock(me,{key:Re.id,"category-name":Re.label,type:Re.id,"has-sub-cat":G.subCatExists(Re)},null,8,["category-name","type","has-sub-cat"]))),128)),b.panelMessage!==null?(R.openBlock(),R.createElementBlock("div",YT,[R.createElementVNode("p",null,R.toDisplayString(b.panelMessage),1)])):R.createCommentVNode("",!0)],64)):R.createCommentVNode("",!0),b.currentStage===1?(R.openBlock(),R.createElementBlock(R.Fragment,{key:1},[b.selectedSubcategory!==null?(R.openBlock(),R.createElementBlock(R.Fragment,{key:0},[R.createElementVNode("div",QT,[(R.openBlock(!0),R.createElementBlock(R.Fragment,null,R.renderList(b.subcategoryLocations,(Re,Ye)=>(R.openBlock(),R.createBlock(Le,{key:Re.id,"item-data":Re,"from-endpoint":!0,focussed:Ye===b.currentListItemFocus,onShowItemDetail:je=>m.showDetail(Re)},null,8,["item-data","focussed","onShowItemDetail"]))),128)),G.showLoadMore?(R.openBlock(),R.createBlock(l,{key:0,class:"vs-map-with-sidebar-panel__load-more","data-test":"vs-map-with-sidebar-panel__load-more",onClick:d[0]||(d[0]=Re=>G.loadMorePlaces()),onKeyup:d[1]||(d[1]=R.withKeys(Re=>G.loadMorePlaces(),["enter"]))},{default:R.withCtx(()=>[R.renderSlot(m.$slots,"load-more-text")]),_:3})):R.createCommentVNode("",!0)]),R.createVNode(le,{"content-data":{},"filter-count":m.subCatFilterCount,onClearFilters:G.clearSubCatFilters},null,8,["filter-count","onClearFilters"])],64)):(R.openBlock(!0),R.createElementBlock(R.Fragment,{key:1},R.renderList(G.currentData,Re=>(R.openBlock(),R.createElementBlock("div",{key:Re.id},[typeof Re.properties<"u"&&Re.properties.category.id===b.selectedCategory?(R.openBlock(),R.createBlock(Le,{key:0,"item-data":Re,onShowItemDetail:Ye=>m.showDetail(Re)},null,8,["item-data","onShowItemDetail"])):R.createCommentVNode("",!0)]))),128))],64)):R.createCommentVNode("",!0),b.currentStage===2?(R.openBlock(),R.createElementBlock(R.Fragment,{key:2},[R.createVNode(ge,{"heading-level":G.detailHeadingLevel,"content-data":G.currentPlaceData[0]},null,8,["heading-level","content-data"]),R.createVNode(le,{"content-data":G.currentPlaceData[0]},null,8,["content-data"])],64)):R.createCommentVNode("",!0),b.panelStatus!==null?(R.openBlock(),R.createElementBlock("div",eI,[m.$slots["panel-loading-message"]&&b.panelStatus!=="map-loading"?(R.openBlock(),R.createElementBlock("div",tI,[R.createElementVNode("p",rI,[R.renderSlot(m.$slots,"panel-loading-message")])])):R.createCommentVNode("",!0)])):R.createCommentVNode("",!0)],2)}const nI=Y._export_sfc(GT,[["render",iI]]);let Sc=null;const aI={name:"VsMapWithSidebar",status:"prototype",release:"0.0.1",components:{VsContainer:Y.VsContainer,VsRow:Y.VsRow,VsCol:Y.VsCol,VsMap:wg,VsButton:Y.VsButton,VsMapWithSidebarPanel:nI,VsButtonToggleGroup:Y.VsButtonToggleGroup,VsWarning:Y.VsWarning},provide(){return{filters:this.filters,filtersWithLocations:this.filtersWithLocations,placesData:this.placesData,mapId:this.mapId,regions:this.regionsData,clearSelectionText:this.clearSelectionText,applyFiltersText:this.applyFiltersText,subCatList:this.subCatList,filtersAppliedText:this.filtersAppliedText,clearFiltersText:this.clearFiltersText,focussedListItem:this.focussedListItem}},props:{categoryHeading:{type:String,default:""},filters:{type:Array,required:!0},placesData:{type:Array,required:!0},mapId:{type:String,required:!0},mainHeadingExists:{type:Boolean,default:!1},initialSelected:{type:String,default:""},toggleData:{type:Array,default:()=>[]},buttonsLabel:{type:String,default:""},clearSelectionText:{type:String,required:!0},applyFiltersText:{type:String,required:!0},detailsEndpoint:{type:String,default:""},regionBounds:{type:Object,default:()=>{}},clearFiltersText:{type:String,required:!0},filtersAppliedText:{type:String,required:!0},placeId:{type:String,default:null},mapFilterMessage:{type:String,required:!0},mapNoResultsMessage:{type:String,required:!0},panelMessage:{type:String,default:null},loadBrandingImmediately:{type:Boolean,default:!1}},data(){return{panelVisible:!1,selectedCategory:"",filterCategories:this.filters,selectedItem:null,activePins:this.placesData,currentlyHovered:"",showRegions:!1,regions:[],subCatList:null,selectedToggle:"",currentEndpointData:[],mapStatus:"",panelStatus:"map-loading",mapReady:!1,showPanelMessage:null,currentPanelEndpointFilters:"",totalEndpointPins:0,focussedListItem:0,resetZoom:!1,currentStage:0,selectedSubCategory:null}},computed:{mapDisplayClass(){return this.panelVisible?"d-none d-lg-block":""},panelDisplayClass(){return this.panelVisible?"":"d-none d-lg-block"},regionsData(){return this.placesData.filter(m=>m.geometry.type==="Polygon"||m.geometry.type==="MultiPolygon")},...Ka.mapState($i,{subCatActiveFilters(m){return m.activeSubcatFilters}}),infoMessage(){let m="";switch(this.mapStatus){case"no-results":m=this.mapNoResultsMessage;break;case"filter-results":m=this.mapFilterMessage;break}return m},existingCategories(){return this.placesData?[...new Set(this.placesData.map(m=>m.properties.category.id))]:[]},filtersWithLocations(){return this.filters.filter(m=>!!(this.existingCategories.includes(m.id)||m.subCategory&&m.subCategory.length))},togglesWithLocations(){return this.existingCategories.indexOf("vics")===-1?this.toggleData.filter(m=>m.value!=="icentres"):this.toggleData}},watch:{selectedSubCategory(m){m===null&&(this.mapStatus="",this.resetZoom=!0)}},mounted(){Sc=$i(),this.selectedToggle=this.initialSelected,this.emitter&&this.emitter.on("clearSelectedSubcats",()=>{this.resetZoom=!0})},methods:{openMenu(){this.setStage(0),this.openPanel()},closePanel(){this.panelVisible=!1},openPanel(){this.panelVisible=!0},showDetail(m){document.fullscreenElement&&document.exitFullscreen(),this.selectedItem=m,this.setStage(2),this.openPanel(),this.selectedSubCategory===null&&this.filterPlaces(this.selectedCategory)},setCategory(m){this.selectedCategory=m,this.selectedSubCategory===null&&this.filterPlaces(m)},setSubCategory(m){Sc.setSelectedSubcat(m),this.selectedSubCategory=m,m!==null?(this.getSubcatMarkerData(),this.selectedCategory=m):(Sc.setActiveSubcatFilters([]),this.showAllPlaces())},filterSubCategories(m){let d="";m.forEach(b=>{const M=`&cat=${b}`;d+=M}),this.currentPanelEndpointFilters=d,this.getSubcatMarkerData(d),this.getSubcatPanelData(d,0)},getSubcatMarkerData(m){const d=this.filters.filter(b=>b.id===this.selectedSubCategory);if(d.length>0){let b=d[0].pinsEndpoint;typeof m<"u"&&(b+=m),this.activePins=[],typeof m>"u"?(this.activePins=[],this.mapStatus="filter-results"):Y.axios.get(b).then(M=>{this.totalEndpointPins=M.data.features.length,this.totalEndpointPins===0?this.mapStatus="no-results":(M.data.features.forEach(O=>{const G=O;G.properties.apiData=!0,this.activePins.push(G)}),this.mapStatus="")})}},getSubcatPanelData(m,d){let M=this.filters.filter(O=>O.id===this.selectedSubCategory)[0].listProductsEndPoint;typeof m<"u"&&(M+=m),d!==0&&(M+=`${m}&page=${d}`),this.panelStatus="loading-data",Y.axios.get(M).then(O=>{typeof O.data.data.products<"u"?(this.setStage(1),d===0?(this.subCatList=O.data.data.products,this.focussedListItem=0):(this.focussedListItem=d*24,this.subCatList=this.subCatList.concat(O.data.data.products))):this.mapStatus="no-results",this.panelStatus=null})},setStage(m){if(m===2&&this.detailsEndpoint!==""&&this.selectedSubCategory!==null){const d=`${this.detailsEndpoint}${this.selectedItem.properties.id}`;Y.axios.get(d).then(b=>{const M=[];M.push(b.data.data),this.currentEndpointData=M,this.currentStage=m})}else this.currentStage=m,this.currentStage===0?(this.currentEndpointData=[],this.selectedSubCategory===null?(this.resetZoom=!0,this.showAllPlaces(),this.mapStatus=""):this.getSubcatMarkerData(),this.selectedToggle="places"):this.currentStage===1&&this.selectedSubCategory===null&&this.filterPlaces(this.selectedCategory);m!==2&&(Sc.setActivePlace({mapId:this.mapId,activeFeature:""}),this.selectedItem=null)},filterPlaces(m){if(m==="regions")this.showRegions=!0,this.activePins=[],this.selectedToggle="regions";else{this.showRegions=!1,this.selectedToggle="places";const d=this.placesData.filter(b=>typeof b.properties<"u"?b.properties.category.id===m:!1);this.activePins=d}},loadMorePlaces(m){this.getSubcatPanelData(this.currentPanelEndpointFilters,m)},showAllPlaces(){this.activePins=this.placesData,this.showRegions=!1},onToggleChanged(m){m==="regions"?(this.setCategory("regions"),this.setStage(1)):m==="icentres"?(this.setCategory("vics"),this.setStage(1)):m==="places-regional"?(this.setCategory("twnv"),this.setStage(1)):(this.showAllPlaces(),this.setStage(0))},setMapReady(m){this.mapReady=m,m?this.panelStatus=null:this.panelStatus="loading"},categoryHasData(m){return this.existingCategories.indexOf(m)!==-1}}};function oI(m,d,b,M,O,G){const l=R.resolveComponent("VsMapWithSidebarPanel"),oe=R.resolveComponent("VsButton"),W=R.resolveComponent("VsMap"),ve=R.resolveComponent("VsButtonToggleGroup"),me=R.resolveComponent("VsWarning"),Le=R.resolveComponent("VsCol"),le=R.resolveComponent("VsRow"),ge=R.resolveComponent("VsContainer");return R.openBlock(),R.createBlock(ge,{"data-test":"vs-map-with-sidebar"},{default:R.withCtx(()=>[R.createVNode(le,null,{default:R.withCtx(()=>[R.createVNode(Le,null,{default:R.withCtx(()=>[R.createElementVNode("div",{class:"vs-map-with-sidebar",ref:b.mapId},[R.createElementVNode("div",{class:R.normalizeClass(["vs-map-with-sidebar__side-panel",G.panelDisplayClass]),"data-test":"vs-map-with-sidebar__side-panel"},[R.createVNode(l,{"category-heading":b.categoryHeading,"selected-category":O.selectedCategory,"selected-subcategory":O.selectedSubCategory,"current-stage":O.currentStage,"selected-item":O.selectedItem,"heading-level":b.mainHeadingExists?"3":"2","subcategory-locations":O.subCatList,"current-endpoint-data":O.currentEndpointData,"panel-status":O.panelStatus,"panel-message":O.currentStage===0?b.panelMessage:null,"total-pins":O.totalEndpointPins,"current-list-item-focus":O.focussedListItem,onSetCategory:G.setCategory,onSetSubcategory:G.setSubCategory,onSubcategoriesFiltered:G.filterSubCategories,onSetStage:G.setStage,onClosePanel:G.closePanel,onShowItemDetail:G.showDetail,onFilterPlaces:G.filterPlaces,onLoadMorePlaces:G.loadMorePlaces},{closePanelText:R.withCtx(()=>[R.renderSlot(m.$slots,"close-side-panel-text")]),"reset-side-panel-text":R.withCtx(()=>[R.renderSlot(m.$slots,"reset-side-panel-text")]),"menu-btn-text":R.withCtx(()=>[R.renderSlot(m.$slots,"menu-btn-text")]),"panel-loading-message":R.withCtx(()=>[R.renderSlot(m.$slots,"panel-loading-message")]),"load-more-text":R.withCtx(()=>[R.renderSlot(m.$slots,"load-more-text")]),_:3},8,["category-heading","selected-category","selected-subcategory","current-stage","selected-item","heading-level","subcategory-locations","current-endpoint-data","panel-status","panel-message","total-pins","current-list-item-focus","onSetCategory","onSetSubcategory","onSubcategoriesFiltered","onSetStage","onClosePanel","onShowItemDetail","onFilterPlaces","onLoadMorePlaces"])],2),R.createElementVNode("div",{class:R.normalizeClass(["vs-map-with-sidebar__map",G.mapDisplayClass])},[R.createVNode(oe,{class:"vs-map-with-sidebar__map-toggle",icon:"vs-icon-control-menu",size:"sm",onClick:G.openMenu,"data-test":"vs-map-with-sidebar__map-toggle",variant:"secondary"},{default:R.withCtx(()=>[R.renderSlot(m.$slots,"open-side-panel-text")]),_:3},8,["onClick"]),R.createVNode(W,{"is-visible":!O.panelVisible,labels:{},filters:G.filtersWithLocations,places:O.activePins,"selected-item":O.selectedItem,"map-id":b.mapId,"show-polygons":O.showRegions,"show-info-message":O.mapStatus!=="",onShowDetail:G.showDetail,onSetCategory:G.setCategory,onMapReady:G.setMapReady,onZoomReset:d[0]||(d[0]=Re=>O.resetZoom=!1),"bounds-data":b.regionBounds,"reset-zoom":O.resetZoom,"show-marker-popups":!1,"load-branding-immediately":b.loadBrandingImmediately},{"map-loading-text":R.withCtx(()=>[R.renderSlot(m.$slots,"map-loading-text")]),"info-message":R.withCtx(()=>[R.createTextVNode(R.toDisplayString(G.infoMessage),1)]),"zoom-too-close":R.withCtx(()=>[R.renderSlot(m.$slots,"zoom-too-close")]),"zoom-too-far":R.withCtx(()=>[R.renderSlot(m.$slots,"zoom-too-far")]),"no-js":R.withCtx(()=>[R.renderSlot(m.$slots,"no-js")]),_:3},8,["is-visible","filters","places","selected-item","map-id","show-polygons","show-info-message","onShowDetail","onSetCategory","onMapReady","bounds-data","reset-zoom","load-branding-immediately"]),G.togglesWithLocations.length>1?(R.openBlock(),R.createBlock(ve,{key:0,"data-test":"vs-map-with-sidebar__map-toggle-group","initial-selected":O.selectedToggle,options:G.togglesWithLocations,"buttons-label":b.buttonsLabel,onToggleChanged:G.onToggleChanged},null,8,["initial-selected","options","buttons-label","onToggleChanged"])):R.createCommentVNode("",!0)],2)],512),R.createVNode(me,{class:"vs-map-with-sidebar__no-js"},{default:R.withCtx(()=>[R.renderSlot(m.$slots,"no-js")]),_:3})]),_:3})]),_:3})]),_:3})}const sI=Y._export_sfc(aI,[["render",oI]]);exports.VsMap=wg;exports.VsMapMarker=bg;exports.VsMapMarkerIcon=qc;exports.VsMapWithSidebar=sI;
|
|
508
|
+
`},setupMarkerListeners(m){document.body.addEventListener("keyup",b=>{(b.key==="Escape"||b.key==="Tab")&&(this.removeMapPopup(m),this.showMarkerPopups&&js.setActivePlace({mapId:this.mapId,activeFeature:null}))}),m.getElement().addEventListener("keyup",b=>{b.key==="Enter"&&(m._popup.isOpen()||m._popup.addTo(this.mapbox.map))})},fitToBounds(){this.mapbox.map.fitBounds(cT(this.geojsonData),{padding:{top:100,bottom:100,left:100,right:100}})},initialiseMapComponent(){this.addMap(),this.addMapControls(),this.places.length&&this.initialiseMapFeatures(),this.geojsonData.features.length&&(this.initialiseMapMarkers(),this.fitToMarkers&&this.fitToBounds())},lazyloadMapComponent(){if(Un.supported({failIfMajorPerformanceCaveat:!0}),!("IntersectionObserver"in window)){this.initialiseMapComponent();return}this.observer=new IntersectionObserver(m=>{m[0].intersectionRatio>0&&(this.observer.unobserve(this.$el),this.initialiseMapComponent())}),this.observer.observe(this.$el)},onResize(){this.isTablet=window.innerWidth>=768},getBoundsFromPolygon(){const m=this.boundsData.coordinates[0];return m.reduce((f,b)=>f.extend(b),new Un.LngLatBounds(m[0],m[0]))},checkPointIsVisible(){return this.mapbox.map.getBounds().contains(this.activeMarkerPostion)},centreMapOnPoint(m){this.mapbox.map.flyTo({center:m})},calculateBoundingBox(){let m;if(typeof this.boundsData>"u"||this.boundsData.type==="undefined")m=[[-7.555827,54.608836],[-.778285,60.880894]];else if(this.boundsData.type==="bounds"){const f=new Un.LngLat(this.boundsData.coordinates[1][0],this.boundsData.coordinates[1][1]),b=new Un.LngLat(this.boundsData.coordinates[0][0],this.boundsData.coordinates[0][1]);m=new Un.LngLatBounds(f,b)}else this.boundsData.type==="Polygon"?m=this.getBoundsFromPolygon():m=[[-7.555827,54.608836],[-.778285,60.880894]];return m}}},_T={class:"vs-map","data-test":"vs-map"},xT={class:"vs-map__message-box"},bT={class:"vs-map__message-text"},wT={ref:"mapboxOuter",class:"vs-map__map-outer"},ST=["id"];function TT(m,f,b,M,O,G){const l=R.resolveComponent("VsLoading"),le=R.resolveComponent("VsWarning");return R.openBlock(),R.createElementBlock("div",_T,[O.showMapMessage?(R.openBlock(),R.createElementBlock("div",{key:0,class:R.normalizeClass(["vs-map__message",O.showZoomMessage?"":"vs-map__message--with-overlay"]),"data-test":"vs-map__message"},[R.createElementVNode("div",xT,[O.isLoading?(R.openBlock(),R.createBlock(l,{key:0,class:"vs-map__loading"})):R.createCommentVNode("",!0),R.createElementVNode("p",bT,[O.isLoading?R.renderSlot(m.$slots,"map-loading-text",{key:0}):b.showInfoMessage?R.renderSlot(m.$slots,"info-message",{key:1}):O.showZoomMessage==="too-close"?R.renderSlot(m.$slots,"zoom-too-close",{key:2}):O.showZoomMessage==="too-far"?R.renderSlot(m.$slots,"zoom-too-far",{key:3}):R.createCommentVNode("",!0)])])],2)):R.createCommentVNode("",!0),R.createElementVNode("div",wT,[R.createElementVNode("div",{id:b.mapId,class:"vs-map__map",ref:"mapbox"},null,8,ST)],512),R.createVNode(le,{class:"vs-map__no-js"},{default:R.withCtx(()=>[R.renderSlot(m.$slots,"no-js")]),_:3})])}const wg=Y._export_sfc(gT,[["render",TT]]),IT={name:"VsMapWithSidebarCategories",status:"prototype",release:"0.0.1",components:{VsMapMarkerIcon:Nc,VsIcon:Y.VsIcon},props:{categoryName:{type:String,required:!0},type:{type:String,required:!0},hasSubCat:{type:Boolean,default:!1}},data(){return{isHovered:!1}},methods:{selectCategory(m){this.hasSubCat?this.$parent.$emit("set-subcategory",m):(this.$parent.$emit("set-category",m),this.$parent.$emit("set-stage",1))}}},AT={class:"vs-main-map-category","data-test":"vs-main-map-category"};function ET(m,f,b,M,O,G){const l=R.resolveComponent("VsMapMarkerIcon"),le=R.resolveComponent("VsIcon");return R.openBlock(),R.createElementBlock("div",AT,[R.createElementVNode("button",{type:"button",class:R.normalizeClass(["vs-main-map-category__button",`vs-main-map-category__button--${b.type}`]),"data-test":"vs-main-map-category__button",onClick:f[0]||(f[0]=H=>G.selectCategory(b.type)),onMouseover:f[1]||(f[1]=H=>O.isHovered=!0),onMouseout:f[2]||(f[2]=H=>O.isHovered=!1),onFocusin:f[3]||(f[3]=H=>O.isHovered=!0),onFocusout:f[4]||(f[4]=H=>O.isHovered=!1)},[R.createElementVNode("div",null,[R.createVNode(l,{class:"vs-main-map-category__icon",id:b.type,"is-hovered":O.isHovered},null,8,["id","is-hovered"]),R.createTextVNode(" "+R.toDisplayString(b.categoryName),1)]),R.createVNode(le,{icon:"fa-regular fa-arrow-right",variant:"highlight",size:"xs",class:"vs-main-map-category__icon align-self-center me-0"})],34)])}const CT=Y._export_sfc(IT,[["render",ET]]);let bc=null;const PT={name:"VsMapWithSidebarSubCategories",status:"prototype",release:"0.0.1",components:{BFormGroup:Y.ku,BFormCheckboxGroup:Y.uu,BFormCheckbox:Y.fn,VsMapMarkerIcon:Nc},props:{data:{type:Array,required:!0},selectedSubCategory:{type:String,required:!0}},data(){return{selected:[]}},computed:{activeSubcatFilters(){return bc?bc.activeSubcatFilters:null},...Ka.mapState($i,{activeSubcatFilters(m){return m.activeSubcatFilters}})},mounted(){bc=$i(),this.selected=this.activeSubcatFilters,this.emitter&&(this.emitter.on("clearSelectedSubcats",()=>{this.selected=[]}),this.emitter.on("submitCheckboxData",()=>{this.checkboxesChangeSubmit()}));const m=document.getElementsByClassName("vs-main-map-subcategory")[0];m&&m.querySelectorAll('input[type="checkbox"]')[0].focus()},beforeUnmount(){this.emitter&&this.emitter.off("submitCheckboxData")},methods:{checkboxesChangeSubmit(){bc.setActiveSubcatFilters(this.selected),this.$parent.$emit("subcategories-filtered",this.selected)},emitChange(){this.emitter&&this.emitter.emit("checkboxes-selected",this.selected)}}},kT={class:"vs-main-map-subcategory","data-test":"vs-main-map-subcategory"};function MT(m,f,b,M,O,G){const l=R.resolveComponent("VsMapMarkerIcon"),le=R.resolveComponent("BFormCheckbox"),H=R.resolveComponent("BFormCheckboxGroup"),ve=R.resolveComponent("BFormGroup");return R.openBlock(),R.createElementBlock("div",kT,[R.createVNode(ve,null,{default:R.withCtx(()=>[R.createVNode(H,{id:"checkbox-group-1",modelValue:O.selected,"onUpdate:modelValue":f[0]||(f[0]=me=>O.selected=me),name:b.data.name},{default:R.withCtx(()=>[(R.openBlock(!0),R.createElementBlock(R.Fragment,null,R.renderList(b.data,me=>(R.openBlock(),R.createBlock(le,{key:me.id,value:me.id,onChange:G.emitChange},{default:R.withCtx(()=>[R.createVNode(l,{class:"vs-main-map-subcategory__icon",id:b.selectedSubCategory},null,8,["id"]),R.createTextVNode(" "+R.toDisplayString(me.name),1)]),_:2},1032,["value","onChange"]))),128))]),_:1},8,["modelValue","name"])]),_:1})])}const zT=Y._export_sfc(PT,[["render",MT]]);let Yh=null;const BT={name:"VsMapWithSidebarListItem",status:"prototype",release:"0.0.1",components:{VsImg:Y.VsImg,VsIcon:Y.VsIcon},inject:["mapId"],props:{itemData:{type:Object,required:!0},fromEndpoint:{type:Boolean,default:!1},focussed:{type:Boolean,default:!1}},data(){return{formattedData:{}}},computed:{isActive(){return!!(this.highlightedPlace&&this.formattedData&&this.highlightedPlace.properties.id===this.formattedData.properties.id)},...Ka.mapState($i,{highlightedPlace(m){return m.getHoveredStop(this.mapId)}})},created(){this.fromEndpoint?this.formatApiData():this.formattedData=this.itemData},mounted(){Yh=$i(),this.focussed&&this.$refs.btn.focus()},methods:{showItemDetail(m){Yh.setActivePlace({mapId:this.mapId,activeFeature:m}),this.$parent.$emit("show-item-detail",m),this.$parent.$emit("set-stage",2)},itemHover(m){Yh.setHoveredPlace({mapId:this.mapId,hoveredFeature:m})},formatApiData(){this.formattedData={geometry:{coordinates:[this.itemData.longitude,this.itemData.latitude],type:"Point"},properties:{category:this.itemData.category[0],description:this.itemData.description,id:this.itemData.id,image:typeof this.itemData.images<"u"?this.itemData.images[0].mediaUrl:"",title:this.itemData.name,link:{label:this.itemData.website.label,link:this.itemData.website.link,type:this.itemData.website.type}},type:"Point"}}}},DT={class:"vs-map-with-sidebar-list-item__img-container"},LT={class:"vs-map-with-sidebar-list-item__text"};function RT(m,f,b,M,O,G){const l=R.resolveComponent("VsImg"),le=R.resolveComponent("VsIcon");return R.openBlock(),R.createElementBlock("button",{type:"button",class:R.normalizeClass(["vs-map-with-sidebar-list-item",G.isActive?"vs-map-with-sidebar-list-item--hovered":""]),"data-test":"vs-map-with-sidebar-list-item",onClick:f[0]||(f[0]=H=>G.showItemDetail(O.formattedData)),onKeyup:f[1]||(f[1]=R.withKeys(H=>G.showItemDetail(O.formattedData),["enter"])),onMouseover:f[2]||(f[2]=H=>G.itemHover(O.formattedData)),onMouseleave:f[3]||(f[3]=H=>G.itemHover("")),onFocusin:f[4]||(f[4]=H=>G.itemHover(O.formattedData)),onFocusout:f[5]||(f[5]=H=>G.itemHover("")),ref:"btn"},[R.createElementVNode("div",DT,[typeof O.formattedData.properties.image<"u"?(R.openBlock(),R.createBlock(l,{key:0,src:O.formattedData.properties.image,class:"vs-map-with-sidebar-list-item__img"},null,8,["src"])):R.createCommentVNode("",!0)]),R.createElementVNode("span",LT,R.toDisplayString(O.formattedData.properties.title),1),R.createVNode(le,{icon:"fa-regular fa-arrow-right",variant:"highlight",size:"xxs",class:"vs-map-with-sidebar-list-item__icon"})],34)}const FT=Y._export_sfc(BT,[["render",RT]]),OT={name:"VsMapWithSidebarDetail",status:"prototype",release:"0.0.1",components:{VsImg:Y.VsImg,VsHeading:Y.VsHeading},props:{contentData:{type:Object,required:!0},headingLevel:{type:String,default:"3"}},computed:{showTitle(){return typeof this.contentData.properties.title<"u"||typeof this.contentData.properties.placeTitle<"u"}}},VT={class:"vs-map-with-sidebar-detail","data-test":"vs-map-with-sidebar-detail"},UT={key:2,"data-test":"vs-map-with-sidebar-detail__address",class:"vs-map-with-sidebar-detail__address"},NT={key:3,class:"mt-100"},qT=["innerHTML"];function jT(m,f,b,M,O,G){const l=R.resolveComponent("VsImg"),le=R.resolveComponent("VsHeading");return R.openBlock(),R.createElementBlock("div",VT,[typeof b.contentData.properties.image<"u"?(R.openBlock(),R.createBlock(l,{key:0,src:b.contentData.properties.image,class:"vs-map-with-sidebar-detail__image mb-125 mb-lg-075"},null,8,["src"])):R.createCommentVNode("",!0),G.showTitle?(R.openBlock(),R.createBlock(le,{key:1,level:b.headingLevel,"heading-style":"heading-xxs",class:"vs-map-with-sidebar-detail__heading mt-0","data-test":"vs-map-with-sidebar-detail__heading"},{default:R.withCtx(()=>[typeof b.contentData.properties.placeTitle<"u"?(R.openBlock(),R.createElementBlock(R.Fragment,{key:0},[R.createTextVNode(R.toDisplayString(b.contentData.properties.placeTitle),1)],64)):(R.openBlock(),R.createElementBlock(R.Fragment,{key:1},[R.createTextVNode(R.toDisplayString(b.contentData.properties.title),1)],64))]),_:1},8,["level"])):R.createCommentVNode("",!0),typeof b.contentData.properties.address<"u"?(R.openBlock(),R.createElementBlock("p",UT,R.toDisplayString(b.contentData.properties.address.shortAddress),1)):R.createCommentVNode("",!0),b.contentData.properties.subtitle?(R.openBlock(),R.createElementBlock("p",NT,R.toDisplayString(b.contentData.properties.subtitle),1)):R.createCommentVNode("",!0),R.createElementVNode("div",{"data-test":"vs-map-with-sidebar-detail__description",class:"vs-map-with-sidebar-detail__description mb-150",innerHTML:b.contentData.properties.description},null,8,qT)])}const $T=Y._export_sfc(OT,[["render",jT]]),ZT={name:"VsMapWithSidebarButtons",status:"prototype",release:"0.0.1",components:{VsButton:Y.VsButton},inject:["filtersAppliedText","clearFiltersText"],props:{contentData:{type:Object,required:!0},filterCount:{type:Number,default:null}},emits:["clear-filters"],computed:{websiteDataExists(){return typeof this.contentData.properties.website<"u"&&this.contentData.properties.website.link!==this.contentData.properties.link.link}},methods:{filtersClick(){this.$parent.$emit("set-stage",0)},clearFiltersClick(){this.$emit("clear-filters")}}};function GT(m,f,b,M,O,G){const l=R.resolveComponent("VsButton");return R.openBlock(),R.createElementBlock("div",{class:R.normalizeClass(["vs-map-with-sidebar-buttons",b.filterCount!==null?"vs-map-with-sidebar-buttons--filters":""]),"data-test":"vs-map-with-sidebar-buttons"},[b.filterCount!==null?(R.openBlock(),R.createElementBlock(R.Fragment,{key:0},[R.createVNode(l,{class:"vs-map-with-sidebar-buttons__clear-filters","data-test":"vs-map-with-sidebar-buttons__clear-filters",variant:"secondary",size:"sm",onClick:G.clearFiltersClick},{default:R.withCtx(()=>[R.createTextVNode(R.toDisplayString(G.clearFiltersText),1)]),_:1},8,["onClick"]),R.createVNode(l,{class:"vs-map-with-sidebar-buttons__filters","data-test":"vs-map-with-sidebar-buttons__filters",variant:"secondary",icon:"vs-icon-control-filters",size:"sm",onClick:G.filtersClick},{default:R.withCtx(()=>[R.createTextVNode(R.toDisplayString(b.filterCount)+" "+R.toDisplayString(G.filtersAppliedText),1)]),_:1},8,["onClick"])],64)):(R.openBlock(),R.createElementBlock(R.Fragment,{key:1},[R.createVNode(l,{href:b.contentData.properties.link.link,"data-test":"vs-map-with-sidebar-buttons__discover",class:"mb-050"},{default:R.withCtx(()=>[R.createTextVNode(R.toDisplayString(b.contentData.properties.link.label),1)]),_:1},8,["href"]),G.websiteDataExists?(R.openBlock(),R.createBlock(l,{key:0,href:b.contentData.properties.website.link,target:"_blank",rel:"noopener noreferrer","data-test":"vs-map-with-sidebar-buttons__website",variant:"secondary"},{default:R.withCtx(()=>[R.createTextVNode(R.toDisplayString(b.contentData.properties.website.label),1)]),_:1},8,["href"])):R.createCommentVNode("",!0)],64))],2)}const WT=Y._export_sfc(ZT,[["render",GT]]),HT={name:"VsMapWithSidebarControls",status:"prototype",release:"0.0.1",components:{VsButton:Y.VsButton},inject:["clearSelectionText","applyFiltersText"],data(){return{isDisabled:!0}},computed:{...Ka.mapState($i,{getSubcatFilters(m){return m.activeSubcatFilters}})},mounted(){this.disableSubmitButton()},methods:{clearSelection(){this.emitter&&this.emitter.emit("clearSelectedSubcats"),this.isDisabled=!0},submitCheckboxes(){this.emitter&&this.emitter.emit("submitCheckboxData")},disableSubmitButton(){this.emitter&&this.emitter.on("checkboxes-selected",m=>{m.length>0?this.isDisabled=!1:this.isDisabled=!0}),this.getSubcatFilters.length>0&&(this.isDisabled=!1)}}},XT={class:"vs-main-map-controls","data-test":"vs-main-map-controls"};function KT(m,f,b,M,O,G){const l=R.resolveComponent("VsButton");return R.openBlock(),R.createElementBlock("div",XT,[R.createVNode(l,{class:"vs-main-map-controls__clear-selection","data-test":"vs-main-map-subcategory__clear-selection",size:"sm",variant:"secondary",onClick:G.clearSelection,onKeyup:R.withKeys(G.clearSelection,["enter"])},{default:R.withCtx(()=>[R.createTextVNode(R.toDisplayString(G.clearSelectionText),1)]),_:1},8,["onClick","onKeyup"]),R.createVNode(l,{class:"vs-main-map-controls__apply-filters","data-test":"vs-main-map-subcategory__apply-filters",size:"sm",onKeypress:R.withKeys(G.submitCheckboxes,["enter"]),onClick:G.submitCheckboxes,"aria-disabled":O.isDisabled,disabled:O.isDisabled},{default:R.withCtx(()=>[R.createTextVNode(R.toDisplayString(G.applyFiltersText),1)]),_:1},8,["onKeypress","onClick","aria-disabled","disabled"])])}const JT=Y._export_sfc(HT,[["render",KT]]);let Qh=null;const YT={name:"VsMapWithSidebarPanel",status:"prototype",release:"0.0.1",components:{VsButton:Y.VsButton,VsMapWithSidebarCategory:CT,VsMapWithSidebarSubcategory:zT,VsHeading:Y.VsHeading,VsMapWithSidebarListItem:FT,VsMapWithSidebarDetail:$T,VsMapWithSidebarButtons:WT,VsMapWithSidebarControls:JT},inject:["filters","filtersWithLocations","placesData","regions","mapId","focussedListItem"],props:{categoryHeading:{type:String,default:""},headingLevel:{type:String,default:"2"},selectedCategory:{type:String,default:""},selectedSubcategory:{type:String,default:null},currentStage:{type:Number,required:!0},selectedItem:{type:Object,default:null},hovered:{type:String,default:""},subcategoryLocations:{type:Array,default:null},currentEndpointData:{type:Array,default:()=>[]},panelStatus:{type:String,default:null},panelMessage:{type:String,default:null},totalPins:{type:Number,default:0},currentListItemFocus:{type:Number,default:0}},emits:["close-panel","load-more-places","set-stage","set-subcategory"],data(){return{placesLoaded:1}},computed:{currentHeading(){let m="";if(this.selectedSubcategory!==null)m=this.selectedSubcategoryData[0].label;else switch(this.currentStage){case 0:m=this.categoryHeading;break;case 1:case 2:m=this.currentFilter.label;break}return m},currentData(){return this.selectedCategory==="regions"?this.regions:this.placesData},panelClasses(){let m="";return this.currentStage===2&&(m+=" vs-map-with-sidebar-panel--small-padding"),m},headerClasses(){return this.currentStage===1?"vs-map-with-sidebar-panel__header-section--with-spacer":this.currentStage===2?"vs-map-with-sidebar-panel__header-section--overlapped":""},currentFilter(){let m="";return this.filters.forEach(f=>{f.id===this.selectedCategory&&(m=f)}),m},currentPlaceData(){let m=this.placesData;return this.selectedCategory==="regions"&&(m=this.regions),this.currentEndpointData.length>0?this.refineEndpointData(this.currentEndpointData):m.filter(f=>typeof f.properties<"u"&&this.selectedItem?f.properties.id===this.selectedItem.properties.id:!1)},selectedSubcategoryData(){return this.selectedSubcategory?this.filters.filter(f=>f.id===this.selectedSubcategory):[]},...Ka.mapState($i,{subCatFilterCount(m){return m.activeSubcatFilters.length}}),detailHeadingLevel(){return(parseInt(this.headingLevel,10)+1).toString()},showLoadMore(){return!(this.subcategoryLocations.length>=this.totalPins||this.subcategoryLocations.length===0)}},watch:{currentFilter(){this.placesLoaded=1}},mounted(){Qh=$i()},methods:{closePanel(){this.$emit("close-panel"),window.innerWidth>=1292&&this.currentStage===2&&this.$emit("set-subcategory",null)},stageBack(){if(this.selectedSubcategory&&this.currentStage===0)this.$emit("set-subcategory",null);else if(this.selectedSubcategory!==null&&this.subcategoryLocations===null)this.setStage(0);else{const m=this.currentStage-1;this.setStage(m)}},resetPanel(){Qh.setSelectedSubcat(null),this.setStage(0)},setStage(m){m===0&&(this.placesLoaded=1),this.$emit("set-stage",m)},subCatExists(m){return typeof m.subCategory<"u"&&m.subCategory.length>0},refineEndpointData(m){const f=[{isEndpoint:!0,properties:{category:m[0].category[0].id,id:m[0].id,image:m[0].images[0].mediaUrl,placeTitle:m[0].name,description:m[0].description,link:{label:m[0].productLink.label,link:m[0].productLink.link,type:m[0].productLink.type},website:{label:m[0].website.label,link:m[0].website.link,type:m[0].website.type},address:{shortAddress:""}}}];return typeof m[0].address<"u"&&(f[0].properties.address.shortAddress=m[0].address.shortAddress),f},clearSubCatFilters(){Qh.setActiveSubcatFilters([]),this.setStage(0)},loadMorePlaces(){this.placesLoaded+=1,this.$emit("load-more-places",this.placesLoaded)}}},QT={class:"vs-map-with-sidebar-panel__buttons d-lg-none"},eI={key:0,class:"vs-map-with-sidebar-panel__back"},tI={key:1,class:"vs-map-with-sidebar-panel__back"},rI={class:"vs-map-with-sidebar-panel__close"},iI={key:0,class:"vs-map-with-sidebar-panel__back d-none d-lg-block"},nI={key:2,class:"vs-map-with-sidebar-panel__bottom-message"},aI={class:"vs-map-with-sidebar-panel__list-container"},oI={key:3,class:"vs-map-with-sidebar-panel__overlay"},sI={key:0,class:"vs-map-with-sidebar-panel__overlay-box"},lI={class:"vs-map-with-sidebar-panel__overlay-text"};function uI(m,f,b,M,O,G){const l=R.resolveComponent("VsButton"),le=R.resolveComponent("VsHeading"),H=R.resolveComponent("VsMapWithSidebarSubcategory"),ve=R.resolveComponent("VsMapWithSidebarControls"),me=R.resolveComponent("VsMapWithSidebarCategory"),Le=R.resolveComponent("VsMapWithSidebarListItem"),se=R.resolveComponent("VsMapWithSidebarButtons"),ge=R.resolveComponent("VsMapWithSidebarDetail");return R.openBlock(),R.createElementBlock("section",{"data-test":"vs-map-with-sidebar-panel",class:R.normalizeClass(["vs-map-with-sidebar-panel",G.panelClasses])},[R.createElementVNode("div",{class:R.normalizeClass(["vs-map-with-sidebar-panel__header-section",G.headerClasses])},[R.createElementVNode("div",QT,[b.currentStage>1||b.selectedSubcategory?(R.openBlock(),R.createElementBlock("div",eI,[R.createVNode(l,{class:"vs-map-with-sidebar-panel_menu",icon:"vs-icon-control-menu",size:"sm",onClick:G.stageBack,"data-test":"vs-map-with-sidebar__menu-toggle",variant:"secondary"},{default:R.withCtx(()=>[R.renderSlot(m.$slots,"menu-btn-text")]),_:3},8,["onClick"])])):R.createCommentVNode("",!0),b.currentStage===1||b.selectedSubcategory?(R.openBlock(),R.createElementBlock("div",tI,[R.createVNode(l,{"icon-only":"",icon:"fa-regular fa-arrow-left",size:"md",variant:"subtle",onClick:G.stageBack,"data-test":"vs-map-with-sidebar-panel--btn-back"},{default:R.withCtx(()=>[R.renderSlot(m.$slots,"back-btn-text")]),_:3},8,["onClick"])])):R.createCommentVNode("",!0),R.createElementVNode("div",rI,[R.createVNode(l,{"icon-only":"",icon:"vs-icon-control-dismiss",size:"md",variant:"subtle",onClick:G.closePanel,"data-test":"vs-map-with-sidebar-panel--btn-close"},{default:R.withCtx(()=>[R.renderSlot(m.$slots,"close-side-panel-text")]),_:3},8,["onClick"])])]),b.currentStage>0||b.selectedSubcategory?(R.openBlock(),R.createElementBlock("div",iI,[R.createVNode(l,{"icon-only":"",icon:"fa-regular fa-arrow-left",size:"md",variant:"subtle",onClick:G.stageBack,"data-test":"vs-map-with-sidebar-panel--btn-back"},{default:R.withCtx(()=>[R.renderSlot(m.$slots,"back-btn-text")]),_:3},8,["onClick"])])):R.createCommentVNode("",!0),G.currentHeading!==""?(R.openBlock(),R.createBlock(le,{key:1,level:b.headingLevel,"heading-style":b.currentStage===0?"heading-m":"heading-xs",class:R.normalizeClass(["vs-map-with-sidebar-panel__heading text-center mt-200 mt-lg-0",b.currentStage===2?"d-none d-lg-block":""]),"data-test":"vs-map-with-sidebar-panel__heading"},{default:R.withCtx(()=>[R.createTextVNode(R.toDisplayString(G.currentHeading),1)]),_:1},8,["level","heading-style","class"])):R.createCommentVNode("",!0),R.createElementVNode("div",{class:R.normalizeClass(["vs-map-with-sidebar-panel__reset",b.currentStage<2?"d-lg-none":""])},[R.createVNode(l,{"icon-only":"",icon:"vs-icon-control-dismiss",size:"md",variant:"subtle",onClick:G.resetPanel,"data-test":"vs-map-with-sidebar-panel--btn-reset"},{default:R.withCtx(()=>[R.renderSlot(m.$slots,"reset-side-panel-text")]),_:3},8,["onClick"])],2)],2),b.currentStage===0?(R.openBlock(),R.createElementBlock(R.Fragment,{key:0},[b.selectedSubcategory!==null?(R.openBlock(),R.createElementBlock(R.Fragment,{key:0},[R.createVNode(H,{data:G.selectedSubcategoryData[0].subCategory,"selected-sub-category":b.selectedSubcategory},null,8,["data","selected-sub-category"]),R.createVNode(ve)],64)):(R.openBlock(!0),R.createElementBlock(R.Fragment,{key:1},R.renderList(G.filtersWithLocations,Re=>(R.openBlock(),R.createBlock(me,{key:Re.id,"category-name":Re.label,type:Re.id,"has-sub-cat":G.subCatExists(Re)},null,8,["category-name","type","has-sub-cat"]))),128)),b.panelMessage!==null?(R.openBlock(),R.createElementBlock("div",nI,[R.createElementVNode("p",null,R.toDisplayString(b.panelMessage),1)])):R.createCommentVNode("",!0)],64)):R.createCommentVNode("",!0),b.currentStage===1?(R.openBlock(),R.createElementBlock(R.Fragment,{key:1},[b.selectedSubcategory!==null?(R.openBlock(),R.createElementBlock(R.Fragment,{key:0},[R.createElementVNode("div",aI,[(R.openBlock(!0),R.createElementBlock(R.Fragment,null,R.renderList(b.subcategoryLocations,(Re,Ye)=>(R.openBlock(),R.createBlock(Le,{key:Re.id,"item-data":Re,"from-endpoint":!0,focussed:Ye===b.currentListItemFocus,onShowItemDetail:je=>m.showDetail(Re)},null,8,["item-data","focussed","onShowItemDetail"]))),128)),G.showLoadMore?(R.openBlock(),R.createBlock(l,{key:0,class:"vs-map-with-sidebar-panel__load-more","data-test":"vs-map-with-sidebar-panel__load-more",onClick:f[0]||(f[0]=Re=>G.loadMorePlaces()),onKeyup:f[1]||(f[1]=R.withKeys(Re=>G.loadMorePlaces(),["enter"]))},{default:R.withCtx(()=>[R.renderSlot(m.$slots,"load-more-text")]),_:3})):R.createCommentVNode("",!0)]),R.createVNode(se,{"content-data":{},"filter-count":m.subCatFilterCount,onClearFilters:G.clearSubCatFilters},null,8,["filter-count","onClearFilters"])],64)):(R.openBlock(!0),R.createElementBlock(R.Fragment,{key:1},R.renderList(G.currentData,Re=>(R.openBlock(),R.createElementBlock("div",{key:Re.id},[typeof Re.properties<"u"&&Re.properties.category.id===b.selectedCategory?(R.openBlock(),R.createBlock(Le,{key:0,"item-data":Re,onShowItemDetail:Ye=>m.showDetail(Re)},null,8,["item-data","onShowItemDetail"])):R.createCommentVNode("",!0)]))),128))],64)):R.createCommentVNode("",!0),b.currentStage===2?(R.openBlock(),R.createElementBlock(R.Fragment,{key:2},[R.createVNode(ge,{"heading-level":G.detailHeadingLevel,"content-data":G.currentPlaceData[0]},null,8,["heading-level","content-data"]),R.createVNode(se,{"content-data":G.currentPlaceData[0]},null,8,["content-data"])],64)):R.createCommentVNode("",!0),b.panelStatus!==null?(R.openBlock(),R.createElementBlock("div",oI,[m.$slots["panel-loading-message"]&&b.panelStatus!=="map-loading"?(R.openBlock(),R.createElementBlock("div",sI,[R.createElementVNode("p",lI,[R.renderSlot(m.$slots,"panel-loading-message")])])):R.createCommentVNode("",!0)])):R.createCommentVNode("",!0)],2)}const cI=Y._export_sfc(YT,[["render",uI]]);let wc=null;const pI={name:"VsMapWithSidebar",status:"prototype",release:"0.0.1",components:{VsContainer:Y.VsContainer,VsRow:Y.VsRow,VsCol:Y.VsCol,VsMap:wg,VsButton:Y.VsButton,VsMapWithSidebarPanel:cI,VsButtonToggleGroup:Y.VsButtonToggleGroup,VsWarning:Y.VsWarning},provide(){return{filters:this.filters,filtersWithLocations:this.filtersWithLocations,placesData:this.placesData,mapId:this.mapId,regions:this.regionsData,clearSelectionText:this.clearSelectionText,applyFiltersText:this.applyFiltersText,subCatList:this.subCatList,filtersAppliedText:this.filtersAppliedText,clearFiltersText:this.clearFiltersText,focussedListItem:this.focussedListItem}},props:{categoryHeading:{type:String,default:""},filters:{type:Array,required:!0},placesData:{type:Array,required:!0},mapId:{type:String,required:!0},mainHeadingExists:{type:Boolean,default:!1},initialSelected:{type:String,default:""},toggleData:{type:Array,default:()=>[]},buttonsLabel:{type:String,default:""},clearSelectionText:{type:String,required:!0},applyFiltersText:{type:String,required:!0},detailsEndpoint:{type:String,default:""},regionBounds:{type:Object,default:()=>{}},clearFiltersText:{type:String,required:!0},filtersAppliedText:{type:String,required:!0},placeId:{type:String,default:null},mapFilterMessage:{type:String,required:!0},mapNoResultsMessage:{type:String,required:!0},panelMessage:{type:String,default:null},loadBrandingImmediately:{type:Boolean,default:!1}},data(){return{panelVisible:!1,selectedCategory:"",filterCategories:this.filters,selectedItem:null,activePins:this.placesData,currentlyHovered:"",showRegions:!1,regions:[],subCatList:null,selectedToggle:"",currentEndpointData:[],mapStatus:"",panelStatus:"map-loading",mapReady:!1,showPanelMessage:null,currentPanelEndpointFilters:"",totalEndpointPins:0,focussedListItem:0,resetZoom:!1,currentStage:0,selectedSubCategory:null}},computed:{mapDisplayClass(){return this.panelVisible?"d-none d-lg-block":""},panelDisplayClass(){return this.panelVisible?"":"d-none d-lg-block"},regionsData(){return this.placesData.filter(m=>m.geometry.type==="Polygon"||m.geometry.type==="MultiPolygon")},...Ka.mapState($i,{subCatActiveFilters(m){return m.activeSubcatFilters}}),infoMessage(){let m="";switch(this.mapStatus){case"no-results":m=this.mapNoResultsMessage;break;case"filter-results":m=this.mapFilterMessage;break}return m},existingCategories(){return this.placesData?[...new Set(this.placesData.map(m=>m.properties.category.id))]:[]},filtersWithLocations(){return this.filters.filter(m=>!!(this.existingCategories.includes(m.id)||m.subCategory&&m.subCategory.length))},togglesWithLocations(){return this.existingCategories.indexOf("vics")===-1?this.toggleData.filter(m=>m.value!=="icentres"):this.toggleData}},watch:{selectedSubCategory(m){m===null&&(this.mapStatus="",this.resetZoom=!0)}},mounted(){wc=$i(),this.selectedToggle=this.initialSelected,this.emitter&&this.emitter.on("clearSelectedSubcats",()=>{this.resetZoom=!0})},methods:{openMenu(){this.setStage(0),this.openPanel()},closePanel(){this.panelVisible=!1},openPanel(){this.panelVisible=!0},showDetail(m){document.fullscreenElement&&document.exitFullscreen(),this.selectedItem=m,this.setStage(2),this.openPanel(),this.selectedSubCategory===null&&this.filterPlaces(this.selectedCategory)},setCategory(m){this.selectedCategory=m,this.selectedSubCategory===null&&this.filterPlaces(m)},setSubCategory(m){wc.setSelectedSubcat(m),this.selectedSubCategory=m,m!==null?(this.getSubcatMarkerData(),this.selectedCategory=m):(wc.setActiveSubcatFilters([]),this.showAllPlaces())},filterSubCategories(m){let f="";m.forEach(b=>{const M=`&cat=${b}`;f+=M}),this.currentPanelEndpointFilters=f,this.getSubcatMarkerData(f),this.getSubcatPanelData(f,0)},getSubcatMarkerData(m){const f=this.filters.filter(b=>b.id===this.selectedSubCategory);if(f.length>0){let b=f[0].pinsEndpoint;typeof m<"u"&&(b+=m),this.activePins=[],typeof m>"u"?(this.activePins=[],this.mapStatus="filter-results"):Y.axios.get(b).then(M=>{this.totalEndpointPins=M.data.features.length,this.totalEndpointPins===0?this.mapStatus="no-results":(M.data.features.forEach(O=>{const G=O;G.properties.apiData=!0,this.activePins.push(G)}),this.mapStatus="")})}},getSubcatPanelData(m,f){let M=this.filters.filter(O=>O.id===this.selectedSubCategory)[0].listProductsEndPoint;typeof m<"u"&&(M+=m),f!==0&&(M+=`${m}&page=${f}`),this.panelStatus="loading-data",Y.axios.get(M).then(O=>{typeof O.data.data.products<"u"?(this.setStage(1),f===0?(this.subCatList=O.data.data.products,this.focussedListItem=0):(this.focussedListItem=f*24,this.subCatList=this.subCatList.concat(O.data.data.products))):this.mapStatus="no-results",this.panelStatus=null})},setStage(m){if(m===2&&this.detailsEndpoint!==""&&this.selectedSubCategory!==null){const f=`${this.detailsEndpoint}${this.selectedItem.properties.id}`;Y.axios.get(f).then(b=>{const M=[];M.push(b.data.data),this.currentEndpointData=M,this.currentStage=m})}else this.currentStage=m,this.currentStage===0?(this.currentEndpointData=[],this.selectedSubCategory===null?(this.resetZoom=!0,this.showAllPlaces(),this.mapStatus=""):this.getSubcatMarkerData(),this.selectedToggle="places"):this.currentStage===1&&this.selectedSubCategory===null&&this.filterPlaces(this.selectedCategory);m!==2&&(wc.setActivePlace({mapId:this.mapId,activeFeature:""}),this.selectedItem=null)},filterPlaces(m){if(m==="regions")this.showRegions=!0,this.activePins=[],this.selectedToggle="regions";else{this.showRegions=!1,this.selectedToggle="places";const f=this.placesData.filter(b=>typeof b.properties<"u"?b.properties.category.id===m:!1);this.activePins=f}},loadMorePlaces(m){this.getSubcatPanelData(this.currentPanelEndpointFilters,m)},showAllPlaces(){this.activePins=this.placesData,this.showRegions=!1},onToggleChanged(m){m==="regions"?(this.setCategory("regions"),this.setStage(1)):m==="icentres"?(this.setCategory("vics"),this.setStage(1)):m==="places-regional"?(this.setCategory("twnv"),this.setStage(1)):(this.showAllPlaces(),this.setStage(0))},setMapReady(m){this.mapReady=m,m?this.panelStatus=null:this.panelStatus="loading"},categoryHasData(m){return this.existingCategories.indexOf(m)!==-1}}};function hI(m,f,b,M,O,G){const l=R.resolveComponent("VsMapWithSidebarPanel"),le=R.resolveComponent("VsButton"),H=R.resolveComponent("VsMap"),ve=R.resolveComponent("VsButtonToggleGroup"),me=R.resolveComponent("VsWarning"),Le=R.resolveComponent("VsCol"),se=R.resolveComponent("VsRow"),ge=R.resolveComponent("VsContainer");return R.openBlock(),R.createBlock(ge,{"data-test":"vs-map-with-sidebar"},{default:R.withCtx(()=>[R.createVNode(se,null,{default:R.withCtx(()=>[R.createVNode(Le,null,{default:R.withCtx(()=>[R.createElementVNode("div",{class:"vs-map-with-sidebar",ref:b.mapId},[R.createElementVNode("div",{class:R.normalizeClass(["vs-map-with-sidebar__side-panel",G.panelDisplayClass]),"data-test":"vs-map-with-sidebar__side-panel"},[R.createVNode(l,{"category-heading":b.categoryHeading,"selected-category":O.selectedCategory,"selected-subcategory":O.selectedSubCategory,"current-stage":O.currentStage,"selected-item":O.selectedItem,"heading-level":b.mainHeadingExists?"3":"2","subcategory-locations":O.subCatList,"current-endpoint-data":O.currentEndpointData,"panel-status":O.panelStatus,"panel-message":O.currentStage===0?b.panelMessage:null,"total-pins":O.totalEndpointPins,"current-list-item-focus":O.focussedListItem,onSetCategory:G.setCategory,onSetSubcategory:G.setSubCategory,onSubcategoriesFiltered:G.filterSubCategories,onSetStage:G.setStage,onClosePanel:G.closePanel,onShowItemDetail:G.showDetail,onFilterPlaces:G.filterPlaces,onLoadMorePlaces:G.loadMorePlaces},{closePanelText:R.withCtx(()=>[R.renderSlot(m.$slots,"close-side-panel-text")]),"reset-side-panel-text":R.withCtx(()=>[R.renderSlot(m.$slots,"reset-side-panel-text")]),"menu-btn-text":R.withCtx(()=>[R.renderSlot(m.$slots,"menu-btn-text")]),"panel-loading-message":R.withCtx(()=>[R.renderSlot(m.$slots,"panel-loading-message")]),"load-more-text":R.withCtx(()=>[R.renderSlot(m.$slots,"load-more-text")]),_:3},8,["category-heading","selected-category","selected-subcategory","current-stage","selected-item","heading-level","subcategory-locations","current-endpoint-data","panel-status","panel-message","total-pins","current-list-item-focus","onSetCategory","onSetSubcategory","onSubcategoriesFiltered","onSetStage","onClosePanel","onShowItemDetail","onFilterPlaces","onLoadMorePlaces"])],2),R.createElementVNode("div",{class:R.normalizeClass(["vs-map-with-sidebar__map",G.mapDisplayClass])},[R.createVNode(le,{class:"vs-map-with-sidebar__map-toggle",icon:"vs-icon-control-menu",size:"sm",onClick:G.openMenu,"data-test":"vs-map-with-sidebar__map-toggle",variant:"secondary"},{default:R.withCtx(()=>[R.renderSlot(m.$slots,"open-side-panel-text")]),_:3},8,["onClick"]),R.createVNode(H,{"is-visible":!O.panelVisible,labels:{},filters:G.filtersWithLocations,places:O.activePins,"selected-item":O.selectedItem,"map-id":b.mapId,"show-polygons":O.showRegions,"show-info-message":O.mapStatus!=="",onShowDetail:G.showDetail,onSetCategory:G.setCategory,onMapReady:G.setMapReady,onZoomReset:f[0]||(f[0]=Re=>O.resetZoom=!1),"bounds-data":b.regionBounds,"reset-zoom":O.resetZoom,"show-marker-popups":!1,"load-branding-immediately":b.loadBrandingImmediately},{"map-loading-text":R.withCtx(()=>[R.renderSlot(m.$slots,"map-loading-text")]),"info-message":R.withCtx(()=>[R.createTextVNode(R.toDisplayString(G.infoMessage),1)]),"zoom-too-close":R.withCtx(()=>[R.renderSlot(m.$slots,"zoom-too-close")]),"zoom-too-far":R.withCtx(()=>[R.renderSlot(m.$slots,"zoom-too-far")]),"no-js":R.withCtx(()=>[R.renderSlot(m.$slots,"no-js")]),_:3},8,["is-visible","filters","places","selected-item","map-id","show-polygons","show-info-message","onShowDetail","onSetCategory","onMapReady","bounds-data","reset-zoom","load-branding-immediately"]),G.togglesWithLocations.length>1?(R.openBlock(),R.createBlock(ve,{key:0,"data-test":"vs-map-with-sidebar__map-toggle-group","initial-selected":O.selectedToggle,options:G.togglesWithLocations,"buttons-label":b.buttonsLabel,onToggleChanged:G.onToggleChanged},null,8,["initial-selected","options","buttons-label","onToggleChanged"])):R.createCommentVNode("",!0)],2)],512),R.createVNode(me,{class:"vs-map-with-sidebar__no-js"},{default:R.withCtx(()=>[R.renderSlot(m.$slots,"no-js")]),_:3})]),_:3})]),_:3})]),_:3})}const fI=Y._export_sfc(pI,[["render",hI]]);exports.VsMap=wg;exports.VsMapMarker=bg;exports.VsMapMarkerIcon=Nc;exports.VsMapWithSidebar=fI;
|