@performant-software/geospatial 2.1.0-beta.5 → 2.1.0-beta.51

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.
Files changed (1069) hide show
  1. package/dist/index.cjs.js +1 -1
  2. package/dist/index.cjs10.js +1 -1
  3. package/dist/index.cjs10.js.map +1 -1
  4. package/dist/index.cjs100.js +1 -1
  5. package/dist/index.cjs100.js.map +1 -1
  6. package/dist/index.cjs101.js +1 -1
  7. package/dist/index.cjs101.js.map +1 -1
  8. package/dist/index.cjs102.js +1 -1
  9. package/dist/index.cjs102.js.map +1 -1
  10. package/dist/index.cjs103.js +1 -1
  11. package/dist/index.cjs103.js.map +1 -1
  12. package/dist/index.cjs104.js +1 -1
  13. package/dist/index.cjs104.js.map +1 -1
  14. package/dist/index.cjs105.js +1 -1
  15. package/dist/index.cjs105.js.map +1 -1
  16. package/dist/index.cjs106.js +1 -1
  17. package/dist/index.cjs106.js.map +1 -1
  18. package/dist/index.cjs107.js +1 -1
  19. package/dist/index.cjs107.js.map +1 -1
  20. package/dist/index.cjs108.js +1 -1
  21. package/dist/index.cjs108.js.map +1 -1
  22. package/dist/index.cjs109.js +1 -1
  23. package/dist/index.cjs109.js.map +1 -1
  24. package/dist/index.cjs11.js +1 -1
  25. package/dist/index.cjs11.js.map +1 -1
  26. package/dist/index.cjs110.js +1 -13
  27. package/dist/index.cjs110.js.map +1 -1
  28. package/dist/index.cjs111.js +1 -1
  29. package/dist/index.cjs111.js.map +1 -1
  30. package/dist/index.cjs112.js +1 -1
  31. package/dist/index.cjs112.js.map +1 -1
  32. package/dist/index.cjs113.js +1 -1
  33. package/dist/index.cjs113.js.map +1 -1
  34. package/dist/index.cjs114.js +1 -1
  35. package/dist/index.cjs114.js.map +1 -1
  36. package/dist/index.cjs115.js +1 -1
  37. package/dist/index.cjs115.js.map +1 -1
  38. package/dist/index.cjs116.js +1 -1
  39. package/dist/index.cjs116.js.map +1 -1
  40. package/dist/index.cjs117.js +1 -1
  41. package/dist/index.cjs117.js.map +1 -1
  42. package/dist/index.cjs118.js +1 -1
  43. package/dist/index.cjs118.js.map +1 -1
  44. package/dist/index.cjs119.js +1 -1
  45. package/dist/index.cjs119.js.map +1 -1
  46. package/dist/index.cjs12.js +1 -1
  47. package/dist/index.cjs12.js.map +1 -1
  48. package/dist/index.cjs120.js +1 -1
  49. package/dist/index.cjs120.js.map +1 -1
  50. package/dist/index.cjs121.js +1 -1
  51. package/dist/index.cjs121.js.map +1 -1
  52. package/dist/index.cjs122.js +1 -1
  53. package/dist/index.cjs122.js.map +1 -1
  54. package/dist/index.cjs123.js +1 -1
  55. package/dist/index.cjs123.js.map +1 -1
  56. package/dist/index.cjs124.js +1 -1
  57. package/dist/index.cjs124.js.map +1 -1
  58. package/dist/index.cjs125.js +1 -1
  59. package/dist/index.cjs125.js.map +1 -1
  60. package/dist/index.cjs126.js +1 -1
  61. package/dist/index.cjs126.js.map +1 -1
  62. package/dist/index.cjs127.js +1 -1
  63. package/dist/index.cjs127.js.map +1 -1
  64. package/dist/index.cjs128.js +13 -1
  65. package/dist/index.cjs128.js.map +1 -1
  66. package/dist/index.cjs129.js +1 -1
  67. package/dist/index.cjs129.js.map +1 -1
  68. package/dist/index.cjs13.js +1 -1
  69. package/dist/index.cjs13.js.map +1 -1
  70. package/dist/index.cjs130.js +1 -1
  71. package/dist/index.cjs130.js.map +1 -1
  72. package/dist/index.cjs131.js +1 -1
  73. package/dist/index.cjs131.js.map +1 -1
  74. package/dist/index.cjs132.js +1 -1
  75. package/dist/index.cjs132.js.map +1 -1
  76. package/dist/index.cjs133.js +1 -1
  77. package/dist/index.cjs133.js.map +1 -1
  78. package/dist/index.cjs134.js +1 -1
  79. package/dist/index.cjs134.js.map +1 -1
  80. package/dist/index.cjs135.js +1 -1
  81. package/dist/index.cjs135.js.map +1 -1
  82. package/dist/index.cjs136.js +1 -1
  83. package/dist/index.cjs136.js.map +1 -1
  84. package/dist/index.cjs137.js +1 -1
  85. package/dist/index.cjs137.js.map +1 -1
  86. package/dist/index.cjs138.js +1 -1
  87. package/dist/index.cjs138.js.map +1 -1
  88. package/dist/index.cjs139.js +1 -1
  89. package/dist/index.cjs139.js.map +1 -1
  90. package/dist/index.cjs14.js +1 -1
  91. package/dist/index.cjs14.js.map +1 -1
  92. package/dist/index.cjs140.js +1 -1
  93. package/dist/index.cjs140.js.map +1 -1
  94. package/dist/index.cjs141.js +1 -1
  95. package/dist/index.cjs141.js.map +1 -1
  96. package/dist/index.cjs142.js +1 -1
  97. package/dist/index.cjs142.js.map +1 -1
  98. package/dist/index.cjs143.js +1 -1
  99. package/dist/index.cjs143.js.map +1 -1
  100. package/dist/index.cjs144.js +1 -1
  101. package/dist/index.cjs144.js.map +1 -1
  102. package/dist/index.cjs145.js +1 -1
  103. package/dist/index.cjs145.js.map +1 -1
  104. package/dist/index.cjs146.js +1 -1
  105. package/dist/index.cjs146.js.map +1 -1
  106. package/dist/index.cjs147.js +1 -1
  107. package/dist/index.cjs147.js.map +1 -1
  108. package/dist/index.cjs148.js +1 -1
  109. package/dist/index.cjs148.js.map +1 -1
  110. package/dist/index.cjs149.js +1 -1
  111. package/dist/index.cjs149.js.map +1 -1
  112. package/dist/index.cjs15.js +1 -1
  113. package/dist/index.cjs15.js.map +1 -1
  114. package/dist/index.cjs150.js +1 -1
  115. package/dist/index.cjs150.js.map +1 -1
  116. package/dist/index.cjs151.js +1 -1
  117. package/dist/index.cjs151.js.map +1 -1
  118. package/dist/index.cjs152.js +1 -1
  119. package/dist/index.cjs152.js.map +1 -1
  120. package/dist/index.cjs153.js +1 -1
  121. package/dist/index.cjs153.js.map +1 -1
  122. package/dist/index.cjs154.js +1 -1
  123. package/dist/index.cjs154.js.map +1 -1
  124. package/dist/index.cjs155.js +1 -1
  125. package/dist/index.cjs155.js.map +1 -1
  126. package/dist/index.cjs156.js +1 -1
  127. package/dist/index.cjs156.js.map +1 -1
  128. package/dist/index.cjs157.js +1 -1
  129. package/dist/index.cjs157.js.map +1 -1
  130. package/dist/index.cjs158.js +1 -1
  131. package/dist/index.cjs158.js.map +1 -1
  132. package/dist/index.cjs159.js +1 -1
  133. package/dist/index.cjs159.js.map +1 -1
  134. package/dist/index.cjs16.js +1 -1
  135. package/dist/index.cjs16.js.map +1 -1
  136. package/dist/index.cjs160.js +1 -1
  137. package/dist/index.cjs160.js.map +1 -1
  138. package/dist/index.cjs161.js +1 -1
  139. package/dist/index.cjs161.js.map +1 -1
  140. package/dist/index.cjs162.js +1 -1
  141. package/dist/index.cjs162.js.map +1 -1
  142. package/dist/index.cjs163.js +1 -1
  143. package/dist/index.cjs163.js.map +1 -1
  144. package/dist/index.cjs164.js +1 -1
  145. package/dist/index.cjs164.js.map +1 -1
  146. package/dist/index.cjs165.js +1 -1
  147. package/dist/index.cjs165.js.map +1 -1
  148. package/dist/index.cjs166.js +1 -1
  149. package/dist/index.cjs166.js.map +1 -1
  150. package/dist/index.cjs167.js +1 -1
  151. package/dist/index.cjs167.js.map +1 -1
  152. package/dist/index.cjs168.js +1 -1
  153. package/dist/index.cjs168.js.map +1 -1
  154. package/dist/index.cjs169.js +1 -1
  155. package/dist/index.cjs169.js.map +1 -1
  156. package/dist/index.cjs17.js +1 -1
  157. package/dist/index.cjs17.js.map +1 -1
  158. package/dist/index.cjs170.js +1 -1
  159. package/dist/index.cjs170.js.map +1 -1
  160. package/dist/index.cjs171.js +1 -1
  161. package/dist/index.cjs171.js.map +1 -1
  162. package/dist/index.cjs172.js +1 -1
  163. package/dist/index.cjs172.js.map +1 -1
  164. package/dist/index.cjs173.js +1 -1
  165. package/dist/index.cjs173.js.map +1 -1
  166. package/dist/index.cjs174.js +1 -1
  167. package/dist/index.cjs174.js.map +1 -1
  168. package/dist/index.cjs175.js +1 -1
  169. package/dist/index.cjs175.js.map +1 -1
  170. package/dist/index.cjs176.js +1 -1
  171. package/dist/index.cjs176.js.map +1 -1
  172. package/dist/index.cjs177.js +1 -1
  173. package/dist/index.cjs177.js.map +1 -1
  174. package/dist/index.cjs178.js +1 -4
  175. package/dist/index.cjs178.js.map +1 -1
  176. package/dist/index.cjs179.js +1 -1
  177. package/dist/index.cjs179.js.map +1 -1
  178. package/dist/index.cjs18.js +1 -1
  179. package/dist/index.cjs18.js.map +1 -1
  180. package/dist/index.cjs180.js +1 -1
  181. package/dist/index.cjs180.js.map +1 -1
  182. package/dist/index.cjs181.js +1 -1
  183. package/dist/index.cjs181.js.map +1 -1
  184. package/dist/index.cjs182.js +1 -1
  185. package/dist/index.cjs182.js.map +1 -1
  186. package/dist/index.cjs183.js +1 -1
  187. package/dist/index.cjs183.js.map +1 -1
  188. package/dist/index.cjs184.js +1 -1
  189. package/dist/index.cjs184.js.map +1 -1
  190. package/dist/index.cjs185.js +1 -1
  191. package/dist/index.cjs185.js.map +1 -1
  192. package/dist/index.cjs186.js +1 -1
  193. package/dist/index.cjs186.js.map +1 -1
  194. package/dist/index.cjs187.js +1 -1
  195. package/dist/index.cjs187.js.map +1 -1
  196. package/dist/index.cjs188.js +4 -1
  197. package/dist/index.cjs188.js.map +1 -1
  198. package/dist/index.cjs189.js +1 -1
  199. package/dist/index.cjs189.js.map +1 -1
  200. package/dist/index.cjs19.js +1 -1
  201. package/dist/index.cjs19.js.map +1 -1
  202. package/dist/index.cjs190.js +1 -1
  203. package/dist/index.cjs190.js.map +1 -1
  204. package/dist/index.cjs191.js +1 -1
  205. package/dist/index.cjs191.js.map +1 -1
  206. package/dist/index.cjs192.js +1 -1
  207. package/dist/index.cjs192.js.map +1 -1
  208. package/dist/index.cjs193.js +1 -1
  209. package/dist/index.cjs193.js.map +1 -1
  210. package/dist/index.cjs194.js +1 -1
  211. package/dist/index.cjs194.js.map +1 -1
  212. package/dist/index.cjs195.js +1 -1
  213. package/dist/index.cjs195.js.map +1 -1
  214. package/dist/index.cjs196.js +1 -1
  215. package/dist/index.cjs196.js.map +1 -1
  216. package/dist/index.cjs197.js +1 -1
  217. package/dist/index.cjs197.js.map +1 -1
  218. package/dist/index.cjs198.js +1 -1
  219. package/dist/index.cjs198.js.map +1 -1
  220. package/dist/index.cjs199.js +1 -1
  221. package/dist/index.cjs199.js.map +1 -1
  222. package/dist/index.cjs2.js +1 -1
  223. package/dist/index.cjs20.js +1 -1
  224. package/dist/index.cjs20.js.map +1 -1
  225. package/dist/index.cjs200.js +1 -1
  226. package/dist/index.cjs200.js.map +1 -1
  227. package/dist/index.cjs201.js +1 -1
  228. package/dist/index.cjs201.js.map +1 -1
  229. package/dist/index.cjs202.js +1 -1
  230. package/dist/index.cjs202.js.map +1 -1
  231. package/dist/index.cjs203.js +1 -1
  232. package/dist/index.cjs203.js.map +1 -1
  233. package/dist/index.cjs204.js +1 -1
  234. package/dist/index.cjs204.js.map +1 -1
  235. package/dist/index.cjs205.js +1 -1
  236. package/dist/index.cjs205.js.map +1 -1
  237. package/dist/index.cjs206.js +1 -1
  238. package/dist/index.cjs206.js.map +1 -1
  239. package/dist/index.cjs207.js +1 -1
  240. package/dist/index.cjs207.js.map +1 -1
  241. package/dist/index.cjs208.js +1 -1
  242. package/dist/index.cjs208.js.map +1 -1
  243. package/dist/index.cjs209.js +1 -1
  244. package/dist/index.cjs209.js.map +1 -1
  245. package/dist/index.cjs21.js +1 -1
  246. package/dist/index.cjs21.js.map +1 -1
  247. package/dist/index.cjs210.js +1 -1
  248. package/dist/index.cjs210.js.map +1 -1
  249. package/dist/index.cjs211.js +1 -1
  250. package/dist/index.cjs211.js.map +1 -1
  251. package/dist/index.cjs212.js +1 -1
  252. package/dist/index.cjs212.js.map +1 -1
  253. package/dist/index.cjs213.js +1 -1
  254. package/dist/index.cjs213.js.map +1 -1
  255. package/dist/index.cjs214.js +1 -1
  256. package/dist/index.cjs214.js.map +1 -1
  257. package/dist/index.cjs215.js +1 -1
  258. package/dist/index.cjs215.js.map +1 -1
  259. package/dist/index.cjs216.js +1 -1
  260. package/dist/index.cjs216.js.map +1 -1
  261. package/dist/index.cjs217.js +1 -1
  262. package/dist/index.cjs217.js.map +1 -1
  263. package/dist/index.cjs218.js +1 -1
  264. package/dist/index.cjs218.js.map +1 -1
  265. package/dist/index.cjs219.js +1 -1
  266. package/dist/index.cjs219.js.map +1 -1
  267. package/dist/index.cjs22.js +1 -1
  268. package/dist/index.cjs22.js.map +1 -1
  269. package/dist/index.cjs220.js +1 -1
  270. package/dist/index.cjs220.js.map +1 -1
  271. package/dist/index.cjs221.js +1 -1
  272. package/dist/index.cjs221.js.map +1 -1
  273. package/dist/index.cjs222.js +1 -1
  274. package/dist/index.cjs222.js.map +1 -1
  275. package/dist/index.cjs223.js +1 -1
  276. package/dist/index.cjs223.js.map +1 -1
  277. package/dist/index.cjs224.js +1 -1
  278. package/dist/index.cjs224.js.map +1 -1
  279. package/dist/index.cjs225.js +1 -1
  280. package/dist/index.cjs225.js.map +1 -1
  281. package/dist/index.cjs226.js +1 -1
  282. package/dist/index.cjs226.js.map +1 -1
  283. package/dist/index.cjs227.js +1 -1
  284. package/dist/index.cjs227.js.map +1 -1
  285. package/dist/index.cjs228.js +1 -1
  286. package/dist/index.cjs228.js.map +1 -1
  287. package/dist/index.cjs229.js +1 -1
  288. package/dist/index.cjs229.js.map +1 -1
  289. package/dist/index.cjs23.js +1 -1
  290. package/dist/index.cjs23.js.map +1 -1
  291. package/dist/index.cjs230.js +1 -1
  292. package/dist/index.cjs230.js.map +1 -1
  293. package/dist/index.cjs231.js +1 -1
  294. package/dist/index.cjs231.js.map +1 -1
  295. package/dist/index.cjs232.js +1 -1
  296. package/dist/index.cjs232.js.map +1 -1
  297. package/dist/index.cjs233.js +1 -1
  298. package/dist/index.cjs233.js.map +1 -1
  299. package/dist/index.cjs234.js +1 -1
  300. package/dist/index.cjs234.js.map +1 -1
  301. package/dist/index.cjs235.js +1 -1
  302. package/dist/index.cjs235.js.map +1 -1
  303. package/dist/index.cjs236.js +1 -1
  304. package/dist/index.cjs236.js.map +1 -1
  305. package/dist/index.cjs237.js +1 -1
  306. package/dist/index.cjs237.js.map +1 -1
  307. package/dist/index.cjs238.js +1 -1
  308. package/dist/index.cjs238.js.map +1 -1
  309. package/dist/index.cjs239.js +1 -1
  310. package/dist/index.cjs239.js.map +1 -1
  311. package/dist/index.cjs24.js +1 -1
  312. package/dist/index.cjs24.js.map +1 -1
  313. package/dist/index.cjs240.js +1 -1
  314. package/dist/index.cjs240.js.map +1 -1
  315. package/dist/index.cjs241.js +1 -1
  316. package/dist/index.cjs241.js.map +1 -1
  317. package/dist/index.cjs242.js +1 -1
  318. package/dist/index.cjs242.js.map +1 -1
  319. package/dist/index.cjs243.js +1 -1
  320. package/dist/index.cjs243.js.map +1 -1
  321. package/dist/index.cjs244.js +1 -1
  322. package/dist/index.cjs244.js.map +1 -1
  323. package/dist/index.cjs245.js +1 -1
  324. package/dist/index.cjs245.js.map +1 -1
  325. package/dist/index.cjs246.js +1 -1
  326. package/dist/index.cjs246.js.map +1 -1
  327. package/dist/index.cjs247.js +1 -1
  328. package/dist/index.cjs247.js.map +1 -1
  329. package/dist/index.cjs248.js +1 -1
  330. package/dist/index.cjs248.js.map +1 -1
  331. package/dist/index.cjs249.js +1 -1
  332. package/dist/index.cjs249.js.map +1 -1
  333. package/dist/index.cjs25.js +1 -1
  334. package/dist/index.cjs25.js.map +1 -1
  335. package/dist/index.cjs250.js +1 -1
  336. package/dist/index.cjs250.js.map +1 -1
  337. package/dist/index.cjs251.js +1 -1
  338. package/dist/index.cjs251.js.map +1 -1
  339. package/dist/index.cjs252.js +1 -1
  340. package/dist/index.cjs252.js.map +1 -1
  341. package/dist/index.cjs253.js +1 -1
  342. package/dist/index.cjs253.js.map +1 -1
  343. package/dist/index.cjs254.js +1 -1
  344. package/dist/index.cjs254.js.map +1 -1
  345. package/dist/index.cjs255.js +2 -0
  346. package/dist/index.cjs255.js.map +1 -0
  347. package/dist/index.cjs256.js +2 -0
  348. package/dist/index.cjs256.js.map +1 -0
  349. package/dist/index.cjs257.js +2 -0
  350. package/dist/index.cjs257.js.map +1 -0
  351. package/dist/index.cjs258.js +2 -0
  352. package/dist/index.cjs258.js.map +1 -0
  353. package/dist/index.cjs259.js +2 -0
  354. package/dist/index.cjs259.js.map +1 -0
  355. package/dist/index.cjs26.js +1 -1
  356. package/dist/index.cjs26.js.map +1 -1
  357. package/dist/index.cjs260.js +2 -0
  358. package/dist/index.cjs260.js.map +1 -0
  359. package/dist/index.cjs261.js +2 -0
  360. package/dist/index.cjs261.js.map +1 -0
  361. package/dist/index.cjs262.js +2 -0
  362. package/dist/index.cjs262.js.map +1 -0
  363. package/dist/index.cjs263.js +2 -0
  364. package/dist/index.cjs263.js.map +1 -0
  365. package/dist/index.cjs264.js +2 -0
  366. package/dist/index.cjs264.js.map +1 -0
  367. package/dist/index.cjs265.js +2 -0
  368. package/dist/index.cjs265.js.map +1 -0
  369. package/dist/index.cjs266.js +2 -0
  370. package/dist/index.cjs266.js.map +1 -0
  371. package/dist/index.cjs267.js +2 -0
  372. package/dist/index.cjs267.js.map +1 -0
  373. package/dist/index.cjs268.js +2 -0
  374. package/dist/index.cjs268.js.map +1 -0
  375. package/dist/index.cjs269.js +2 -0
  376. package/dist/index.cjs269.js.map +1 -0
  377. package/dist/index.cjs27.js +1 -1
  378. package/dist/index.cjs27.js.map +1 -1
  379. package/dist/index.cjs270.js +2 -0
  380. package/dist/index.cjs270.js.map +1 -0
  381. package/dist/index.cjs28.js +1 -1
  382. package/dist/index.cjs28.js.map +1 -1
  383. package/dist/index.cjs29.js +1 -1
  384. package/dist/index.cjs29.js.map +1 -1
  385. package/dist/index.cjs3.js +1 -1
  386. package/dist/index.cjs3.js.map +1 -1
  387. package/dist/index.cjs30.js +1 -1
  388. package/dist/index.cjs30.js.map +1 -1
  389. package/dist/index.cjs31.js +1 -1
  390. package/dist/index.cjs31.js.map +1 -1
  391. package/dist/index.cjs32.js +1 -1
  392. package/dist/index.cjs32.js.map +1 -1
  393. package/dist/index.cjs33.js +1 -1
  394. package/dist/index.cjs33.js.map +1 -1
  395. package/dist/index.cjs34.js +1 -1
  396. package/dist/index.cjs34.js.map +1 -1
  397. package/dist/index.cjs35.js +1 -1
  398. package/dist/index.cjs35.js.map +1 -1
  399. package/dist/index.cjs36.js +1 -1
  400. package/dist/index.cjs36.js.map +1 -1
  401. package/dist/index.cjs37.js +1 -1
  402. package/dist/index.cjs37.js.map +1 -1
  403. package/dist/index.cjs38.js +1 -1
  404. package/dist/index.cjs38.js.map +1 -1
  405. package/dist/index.cjs39.js +1 -1
  406. package/dist/index.cjs39.js.map +1 -1
  407. package/dist/index.cjs4.js +1 -1
  408. package/dist/index.cjs40.js +1 -1
  409. package/dist/index.cjs40.js.map +1 -1
  410. package/dist/index.cjs41.js +1 -1
  411. package/dist/index.cjs41.js.map +1 -1
  412. package/dist/index.cjs42.js +1 -1
  413. package/dist/index.cjs42.js.map +1 -1
  414. package/dist/index.cjs43.js +1 -1
  415. package/dist/index.cjs43.js.map +1 -1
  416. package/dist/index.cjs44.js +1 -1
  417. package/dist/index.cjs44.js.map +1 -1
  418. package/dist/index.cjs45.js +1 -1
  419. package/dist/index.cjs45.js.map +1 -1
  420. package/dist/index.cjs46.js +1 -1
  421. package/dist/index.cjs48.js +1 -1
  422. package/dist/index.cjs48.js.map +1 -1
  423. package/dist/index.cjs49.js +1 -1
  424. package/dist/index.cjs49.js.map +1 -1
  425. package/dist/index.cjs5.js +1 -1
  426. package/dist/index.cjs5.js.map +1 -1
  427. package/dist/index.cjs50.js +1 -1
  428. package/dist/index.cjs50.js.map +1 -1
  429. package/dist/index.cjs51.js +1 -1
  430. package/dist/index.cjs51.js.map +1 -1
  431. package/dist/index.cjs52.js +1 -1
  432. package/dist/index.cjs52.js.map +1 -1
  433. package/dist/index.cjs54.js +9 -1
  434. package/dist/index.cjs54.js.map +1 -1
  435. package/dist/index.cjs55.js +13 -3
  436. package/dist/index.cjs55.js.map +1 -1
  437. package/dist/index.cjs56.js +1 -19
  438. package/dist/index.cjs56.js.map +1 -1
  439. package/dist/index.cjs57.js +1 -1
  440. package/dist/index.cjs57.js.map +1 -1
  441. package/dist/index.cjs58.js +1 -1
  442. package/dist/index.cjs58.js.map +1 -1
  443. package/dist/index.cjs59.js +1 -1
  444. package/dist/index.cjs59.js.map +1 -1
  445. package/dist/index.cjs6.js +1 -1
  446. package/dist/index.cjs60.js +1 -1
  447. package/dist/index.cjs61.js +1 -1
  448. package/dist/index.cjs61.js.map +1 -1
  449. package/dist/index.cjs62.js +1 -1
  450. package/dist/index.cjs62.js.map +1 -1
  451. package/dist/index.cjs63.js +1 -1
  452. package/dist/index.cjs63.js.map +1 -1
  453. package/dist/index.cjs64.js +1 -1
  454. package/dist/index.cjs64.js.map +1 -1
  455. package/dist/index.cjs65.js +1 -1
  456. package/dist/index.cjs65.js.map +1 -1
  457. package/dist/index.cjs66.js +1 -1
  458. package/dist/index.cjs66.js.map +1 -1
  459. package/dist/index.cjs67.js +1 -1
  460. package/dist/index.cjs67.js.map +1 -1
  461. package/dist/index.cjs68.js +1 -1
  462. package/dist/index.cjs68.js.map +1 -1
  463. package/dist/index.cjs69.js +1 -1
  464. package/dist/index.cjs69.js.map +1 -1
  465. package/dist/index.cjs7.js +1 -1
  466. package/dist/index.cjs70.js +1 -1
  467. package/dist/index.cjs70.js.map +1 -1
  468. package/dist/index.cjs71.js +1 -1
  469. package/dist/index.cjs71.js.map +1 -1
  470. package/dist/index.cjs72.js +1 -1
  471. package/dist/index.cjs72.js.map +1 -1
  472. package/dist/index.cjs73.js +1 -1
  473. package/dist/index.cjs73.js.map +1 -1
  474. package/dist/index.cjs74.js +1 -1
  475. package/dist/index.cjs74.js.map +1 -1
  476. package/dist/index.cjs75.js +1 -1
  477. package/dist/index.cjs75.js.map +1 -1
  478. package/dist/index.cjs76.js +1 -1
  479. package/dist/index.cjs76.js.map +1 -1
  480. package/dist/index.cjs77.js +1 -1
  481. package/dist/index.cjs77.js.map +1 -1
  482. package/dist/index.cjs78.js +1 -1
  483. package/dist/index.cjs78.js.map +1 -1
  484. package/dist/index.cjs79.js +1 -1
  485. package/dist/index.cjs79.js.map +1 -1
  486. package/dist/index.cjs8.js +1 -1
  487. package/dist/index.cjs80.js +1 -1
  488. package/dist/index.cjs80.js.map +1 -1
  489. package/dist/index.cjs81.js +1 -1
  490. package/dist/index.cjs81.js.map +1 -1
  491. package/dist/index.cjs82.js +1 -1
  492. package/dist/index.cjs82.js.map +1 -1
  493. package/dist/index.cjs83.js +1 -1
  494. package/dist/index.cjs83.js.map +1 -1
  495. package/dist/index.cjs84.js +1 -1
  496. package/dist/index.cjs84.js.map +1 -1
  497. package/dist/index.cjs85.js +1 -1
  498. package/dist/index.cjs85.js.map +1 -1
  499. package/dist/index.cjs86.js +1 -1
  500. package/dist/index.cjs86.js.map +1 -1
  501. package/dist/index.cjs87.js +1 -1
  502. package/dist/index.cjs87.js.map +1 -1
  503. package/dist/index.cjs88.js +1 -1
  504. package/dist/index.cjs88.js.map +1 -1
  505. package/dist/index.cjs89.js +1 -1
  506. package/dist/index.cjs89.js.map +1 -1
  507. package/dist/index.cjs9.js +1 -1
  508. package/dist/index.cjs9.js.map +1 -1
  509. package/dist/index.cjs90.js +1 -1
  510. package/dist/index.cjs90.js.map +1 -1
  511. package/dist/index.cjs91.js +1 -1
  512. package/dist/index.cjs91.js.map +1 -1
  513. package/dist/index.cjs92.js +1 -1
  514. package/dist/index.cjs92.js.map +1 -1
  515. package/dist/index.cjs93.js +1 -1
  516. package/dist/index.cjs93.js.map +1 -1
  517. package/dist/index.cjs94.js +1 -1
  518. package/dist/index.cjs94.js.map +1 -1
  519. package/dist/index.cjs95.js +1 -1
  520. package/dist/index.cjs95.js.map +1 -1
  521. package/dist/index.cjs96.js +1 -1
  522. package/dist/index.cjs96.js.map +1 -1
  523. package/dist/index.cjs97.js +1 -1
  524. package/dist/index.cjs97.js.map +1 -1
  525. package/dist/index.cjs98.js +1 -1
  526. package/dist/index.cjs98.js.map +1 -1
  527. package/dist/index.cjs99.js +1 -1
  528. package/dist/index.cjs99.js.map +1 -1
  529. package/dist/index.es.js +8 -6
  530. package/dist/index.es.js.map +1 -1
  531. package/dist/index.es10.js +39 -2102
  532. package/dist/index.es10.js.map +1 -1
  533. package/dist/index.es100.js +11 -10
  534. package/dist/index.es100.js.map +1 -1
  535. package/dist/index.es101.js +12 -3
  536. package/dist/index.es101.js.map +1 -1
  537. package/dist/index.es102.js +85 -5
  538. package/dist/index.es102.js.map +1 -1
  539. package/dist/index.es103.js +3 -3
  540. package/dist/index.es103.js.map +1 -1
  541. package/dist/index.es104.js +14 -7
  542. package/dist/index.es104.js.map +1 -1
  543. package/dist/index.es105.js +11 -7
  544. package/dist/index.es105.js.map +1 -1
  545. package/dist/index.es106.js +6 -7
  546. package/dist/index.es106.js.map +1 -1
  547. package/dist/index.es107.js +6 -8
  548. package/dist/index.es107.js.map +1 -1
  549. package/dist/index.es108.js +6 -3
  550. package/dist/index.es108.js.map +1 -1
  551. package/dist/index.es109.js +8 -4
  552. package/dist/index.es109.js.map +1 -1
  553. package/dist/index.es11.js +2102 -19
  554. package/dist/index.es11.js.map +1 -1
  555. package/dist/index.es110.js +4 -58
  556. package/dist/index.es110.js.map +1 -1
  557. package/dist/index.es111.js +4 -14
  558. package/dist/index.es111.js.map +1 -1
  559. package/dist/index.es112.js +4 -6
  560. package/dist/index.es112.js.map +1 -1
  561. package/dist/index.es113.js +6 -5
  562. package/dist/index.es113.js.map +1 -1
  563. package/dist/index.es114.js +5 -7
  564. package/dist/index.es114.js.map +1 -1
  565. package/dist/index.es115.js +3 -16
  566. package/dist/index.es115.js.map +1 -1
  567. package/dist/index.es116.js +6 -12
  568. package/dist/index.es116.js.map +1 -1
  569. package/dist/index.es117.js +12 -4
  570. package/dist/index.es117.js.map +1 -1
  571. package/dist/index.es118.js +10 -5
  572. package/dist/index.es118.js.map +1 -1
  573. package/dist/index.es119.js +3 -8
  574. package/dist/index.es119.js.map +1 -1
  575. package/dist/index.es12.js +19 -12
  576. package/dist/index.es12.js.map +1 -1
  577. package/dist/index.es120.js +3 -4
  578. package/dist/index.es120.js.map +1 -1
  579. package/dist/index.es121.js +2 -6
  580. package/dist/index.es121.js.map +1 -1
  581. package/dist/index.es122.js +7 -8
  582. package/dist/index.es122.js.map +1 -1
  583. package/dist/index.es123.js +8 -3
  584. package/dist/index.es123.js.map +1 -1
  585. package/dist/index.es124.js +8 -3
  586. package/dist/index.es124.js.map +1 -1
  587. package/dist/index.es125.js +8 -10
  588. package/dist/index.es125.js.map +1 -1
  589. package/dist/index.es126.js +4 -5
  590. package/dist/index.es126.js.map +1 -1
  591. package/dist/index.es127.js +4 -4
  592. package/dist/index.es127.js.map +1 -1
  593. package/dist/index.es128.js +57 -8
  594. package/dist/index.es128.js.map +1 -1
  595. package/dist/index.es129.js +13 -5
  596. package/dist/index.es129.js.map +1 -1
  597. package/dist/index.es13.js +12 -6
  598. package/dist/index.es13.js.map +1 -1
  599. package/dist/index.es130.js +5 -16
  600. package/dist/index.es130.js.map +1 -1
  601. package/dist/index.es131.js +5 -11
  602. package/dist/index.es131.js.map +1 -1
  603. package/dist/index.es132.js +9 -3
  604. package/dist/index.es132.js.map +1 -1
  605. package/dist/index.es133.js +17 -3
  606. package/dist/index.es133.js.map +1 -1
  607. package/dist/index.es134.js +13 -8
  608. package/dist/index.es134.js.map +1 -1
  609. package/dist/index.es135.js +4 -6
  610. package/dist/index.es135.js.map +1 -1
  611. package/dist/index.es136.js +5 -12
  612. package/dist/index.es136.js.map +1 -1
  613. package/dist/index.es137.js +8 -12
  614. package/dist/index.es137.js.map +1 -1
  615. package/dist/index.es138.js +6 -6
  616. package/dist/index.es138.js.map +1 -1
  617. package/dist/index.es139.js +6 -5
  618. package/dist/index.es139.js.map +1 -1
  619. package/dist/index.es14.js +6 -5
  620. package/dist/index.es14.js.map +1 -1
  621. package/dist/index.es140.js +8 -5
  622. package/dist/index.es140.js.map +1 -1
  623. package/dist/index.es141.js +3 -17
  624. package/dist/index.es141.js.map +1 -1
  625. package/dist/index.es142.js +3 -17
  626. package/dist/index.es142.js.map +1 -1
  627. package/dist/index.es143.js +10 -4
  628. package/dist/index.es143.js.map +1 -1
  629. package/dist/index.es144.js +5 -17
  630. package/dist/index.es144.js.map +1 -1
  631. package/dist/index.es145.js +4 -23
  632. package/dist/index.es145.js.map +1 -1
  633. package/dist/index.es146.js +9 -6
  634. package/dist/index.es146.js.map +1 -1
  635. package/dist/index.es147.js +6 -5
  636. package/dist/index.es147.js.map +1 -1
  637. package/dist/index.es148.js +17 -6
  638. package/dist/index.es148.js.map +1 -1
  639. package/dist/index.es149.js +12 -5
  640. package/dist/index.es149.js.map +1 -1
  641. package/dist/index.es15.js +6 -28
  642. package/dist/index.es15.js.map +1 -1
  643. package/dist/index.es150.js +3 -12
  644. package/dist/index.es150.js.map +1 -1
  645. package/dist/index.es151.js +3 -6
  646. package/dist/index.es151.js.map +1 -1
  647. package/dist/index.es152.js +8 -4
  648. package/dist/index.es152.js.map +1 -1
  649. package/dist/index.es153.js +5 -3
  650. package/dist/index.es153.js.map +1 -1
  651. package/dist/index.es154.js +12 -4
  652. package/dist/index.es154.js.map +1 -1
  653. package/dist/index.es155.js +12 -4
  654. package/dist/index.es155.js.map +1 -1
  655. package/dist/index.es156.js +6 -4
  656. package/dist/index.es156.js.map +1 -1
  657. package/dist/index.es157.js +5 -4
  658. package/dist/index.es157.js.map +1 -1
  659. package/dist/index.es158.js +5 -12
  660. package/dist/index.es158.js.map +1 -1
  661. package/dist/index.es159.js +16 -14
  662. package/dist/index.es159.js.map +1 -1
  663. package/dist/index.es16.js +6 -8
  664. package/dist/index.es16.js.map +1 -1
  665. package/dist/index.es160.js +16 -8
  666. package/dist/index.es160.js.map +1 -1
  667. package/dist/index.es161.js +4 -6
  668. package/dist/index.es161.js.map +1 -1
  669. package/dist/index.es162.js +16 -6
  670. package/dist/index.es162.js.map +1 -1
  671. package/dist/index.es163.js +22 -8
  672. package/dist/index.es163.js.map +1 -1
  673. package/dist/index.es164.js +6 -28
  674. package/dist/index.es164.js.map +1 -1
  675. package/dist/index.es165.js +5 -55
  676. package/dist/index.es165.js.map +1 -1
  677. package/dist/index.es166.js +8 -48
  678. package/dist/index.es166.js.map +1 -1
  679. package/dist/index.es167.js +7 -39
  680. package/dist/index.es167.js.map +1 -1
  681. package/dist/index.es168.js +13 -11
  682. package/dist/index.es168.js.map +1 -1
  683. package/dist/index.es169.js +7 -11
  684. package/dist/index.es169.js.map +1 -1
  685. package/dist/index.es17.js +5 -5
  686. package/dist/index.es17.js.map +1 -1
  687. package/dist/index.es170.js +6 -29
  688. package/dist/index.es170.js.map +1 -1
  689. package/dist/index.es171.js +6 -11
  690. package/dist/index.es171.js.map +1 -1
  691. package/dist/index.es172.js +6 -13
  692. package/dist/index.es172.js.map +1 -1
  693. package/dist/index.es173.js +4 -50
  694. package/dist/index.es173.js.map +1 -1
  695. package/dist/index.es174.js +4 -64
  696. package/dist/index.es174.js.map +1 -1
  697. package/dist/index.es175.js +5 -4
  698. package/dist/index.es175.js.map +1 -1
  699. package/dist/index.es176.js +12 -7
  700. package/dist/index.es176.js.map +1 -1
  701. package/dist/index.es177.js +12 -145
  702. package/dist/index.es177.js.map +1 -1
  703. package/dist/index.es178.js +8 -12196
  704. package/dist/index.es178.js.map +1 -1
  705. package/dist/index.es179.js +9 -3
  706. package/dist/index.es179.js.map +1 -1
  707. package/dist/index.es18.js +28 -10
  708. package/dist/index.es18.js.map +1 -1
  709. package/dist/index.es180.js +9 -3
  710. package/dist/index.es180.js.map +1 -1
  711. package/dist/index.es181.js +8 -35
  712. package/dist/index.es181.js.map +1 -1
  713. package/dist/index.es182.js +10 -3
  714. package/dist/index.es182.js.map +1 -1
  715. package/dist/index.es183.js +475 -20
  716. package/dist/index.es183.js.map +1 -1
  717. package/dist/index.es184.js +36 -2
  718. package/dist/index.es184.js.map +1 -1
  719. package/dist/index.es185.js +43 -3
  720. package/dist/index.es185.js.map +1 -1
  721. package/dist/index.es186.js +74 -2
  722. package/dist/index.es186.js.map +1 -1
  723. package/dist/index.es187.js +31 -30
  724. package/dist/index.es187.js.map +1 -1
  725. package/dist/index.es188.js +12196 -12
  726. package/dist/index.es188.js.map +1 -1
  727. package/dist/index.es189.js +3 -16
  728. package/dist/index.es189.js.map +1 -1
  729. package/dist/index.es19.js +8 -17
  730. package/dist/index.es19.js.map +1 -1
  731. package/dist/index.es190.js +3 -11
  732. package/dist/index.es190.js.map +1 -1
  733. package/dist/index.es191.js +34 -319
  734. package/dist/index.es191.js.map +1 -1
  735. package/dist/index.es192.js +3 -77
  736. package/dist/index.es192.js.map +1 -1
  737. package/dist/index.es193.js +23 -3
  738. package/dist/index.es193.js.map +1 -1
  739. package/dist/index.es194.js +2 -18
  740. package/dist/index.es194.js.map +1 -1
  741. package/dist/index.es195.js +3 -13
  742. package/dist/index.es195.js.map +1 -1
  743. package/dist/index.es196.js +2 -33
  744. package/dist/index.es196.js.map +1 -1
  745. package/dist/index.es197.js +31 -4
  746. package/dist/index.es197.js.map +1 -1
  747. package/dist/index.es198.js +13 -2
  748. package/dist/index.es198.js.map +1 -1
  749. package/dist/index.es199.js +13 -7
  750. package/dist/index.es199.js.map +1 -1
  751. package/dist/index.es2.js +3 -3
  752. package/dist/index.es20.js +5 -5
  753. package/dist/index.es20.js.map +1 -1
  754. package/dist/index.es200.js +8 -4
  755. package/dist/index.es200.js.map +1 -1
  756. package/dist/index.es201.js +321 -4
  757. package/dist/index.es201.js.map +1 -1
  758. package/dist/index.es202.js +75 -3
  759. package/dist/index.es202.js.map +1 -1
  760. package/dist/index.es203.js +2 -2
  761. package/dist/index.es203.js.map +1 -1
  762. package/dist/index.es204.js +15 -8
  763. package/dist/index.es204.js.map +1 -1
  764. package/dist/index.es205.js +10 -21
  765. package/dist/index.es205.js.map +1 -1
  766. package/dist/index.es206.js +29 -20
  767. package/dist/index.es206.js.map +1 -1
  768. package/dist/index.es207.js +4 -13
  769. package/dist/index.es207.js.map +1 -1
  770. package/dist/index.es208.js +2 -17
  771. package/dist/index.es208.js.map +1 -1
  772. package/dist/index.es209.js +7 -5
  773. package/dist/index.es209.js.map +1 -1
  774. package/dist/index.es21.js +10 -5
  775. package/dist/index.es21.js.map +1 -1
  776. package/dist/index.es210.js +4 -8
  777. package/dist/index.es210.js.map +1 -1
  778. package/dist/index.es211.js +4 -7
  779. package/dist/index.es211.js.map +1 -1
  780. package/dist/index.es212.js +3 -22
  781. package/dist/index.es212.js.map +1 -1
  782. package/dist/index.es213.js +3 -10
  783. package/dist/index.es213.js.map +1 -1
  784. package/dist/index.es214.js +9 -9
  785. package/dist/index.es214.js.map +1 -1
  786. package/dist/index.es215.js +22 -4
  787. package/dist/index.es215.js.map +1 -1
  788. package/dist/index.es216.js +21 -10
  789. package/dist/index.es216.js.map +1 -1
  790. package/dist/index.es217.js +13 -8
  791. package/dist/index.es217.js.map +1 -1
  792. package/dist/index.es218.js +16 -22
  793. package/dist/index.es218.js.map +1 -1
  794. package/dist/index.es219.js +5 -11
  795. package/dist/index.es219.js.map +1 -1
  796. package/dist/index.es22.js +17 -5
  797. package/dist/index.es22.js.map +1 -1
  798. package/dist/index.es220.js +8 -18
  799. package/dist/index.es220.js.map +1 -1
  800. package/dist/index.es221.js +7 -4
  801. package/dist/index.es221.js.map +1 -1
  802. package/dist/index.es222.js +20 -16
  803. package/dist/index.es222.js.map +1 -1
  804. package/dist/index.es223.js +8 -10
  805. package/dist/index.es223.js.map +1 -1
  806. package/dist/index.es224.js +9 -4
  807. package/dist/index.es224.js.map +1 -1
  808. package/dist/index.es225.js +3 -4
  809. package/dist/index.es225.js.map +1 -1
  810. package/dist/index.es226.js +10 -45
  811. package/dist/index.es226.js.map +1 -1
  812. package/dist/index.es227.js +8 -22
  813. package/dist/index.es227.js.map +1 -1
  814. package/dist/index.es228.js +23 -3
  815. package/dist/index.es228.js.map +1 -1
  816. package/dist/index.es229.js +10 -6
  817. package/dist/index.es229.js.map +1 -1
  818. package/dist/index.es23.js +5 -7
  819. package/dist/index.es23.js.map +1 -1
  820. package/dist/index.es230.js +17 -4
  821. package/dist/index.es230.js.map +1 -1
  822. package/dist/index.es231.js +4 -25
  823. package/dist/index.es231.js.map +1 -1
  824. package/dist/index.es232.js +17 -16
  825. package/dist/index.es232.js.map +1 -1
  826. package/dist/index.es233.js +11 -30
  827. package/dist/index.es233.js.map +1 -1
  828. package/dist/index.es234.js +3 -21
  829. package/dist/index.es234.js.map +1 -1
  830. package/dist/index.es235.js +4 -75
  831. package/dist/index.es235.js.map +1 -1
  832. package/dist/index.es236.js +2 -21
  833. package/dist/index.es236.js.map +1 -1
  834. package/dist/index.es237.js +231 -45
  835. package/dist/index.es237.js.map +1 -1
  836. package/dist/index.es238.js +4 -55
  837. package/dist/index.es238.js.map +1 -1
  838. package/dist/index.es239.js +4 -9
  839. package/dist/index.es239.js.map +1 -1
  840. package/dist/index.es24.js +5 -7
  841. package/dist/index.es24.js.map +1 -1
  842. package/dist/index.es240.js +4 -21
  843. package/dist/index.es240.js.map +1 -1
  844. package/dist/index.es241.js +3 -66
  845. package/dist/index.es241.js.map +1 -1
  846. package/dist/index.es242.js +42 -39
  847. package/dist/index.es242.js.map +1 -1
  848. package/dist/index.es243.js +21 -64
  849. package/dist/index.es243.js.map +1 -1
  850. package/dist/index.es244.js +5 -8
  851. package/dist/index.es244.js.map +1 -1
  852. package/dist/index.es245.js +7 -3
  853. package/dist/index.es245.js.map +1 -1
  854. package/dist/index.es246.js +2 -13
  855. package/dist/index.es246.js.map +1 -1
  856. package/dist/index.es247.js +21 -56
  857. package/dist/index.es247.js.map +1 -1
  858. package/dist/index.es248.js +14 -54
  859. package/dist/index.es248.js.map +1 -1
  860. package/dist/index.es249.js +30 -2
  861. package/dist/index.es249.js.map +1 -1
  862. package/dist/index.es25.js +5 -4
  863. package/dist/index.es25.js.map +1 -1
  864. package/dist/index.es250.js +21 -15
  865. package/dist/index.es250.js.map +1 -1
  866. package/dist/index.es251.js +75 -4
  867. package/dist/index.es251.js.map +1 -1
  868. package/dist/index.es252.js +18 -68
  869. package/dist/index.es252.js.map +1 -1
  870. package/dist/index.es253.js +48 -3
  871. package/dist/index.es253.js.map +1 -1
  872. package/dist/index.es254.js +51 -21
  873. package/dist/index.es254.js.map +1 -1
  874. package/dist/index.es255.js +12 -0
  875. package/dist/index.es255.js.map +1 -0
  876. package/dist/index.es256.js +24 -0
  877. package/dist/index.es256.js.map +1 -0
  878. package/dist/index.es257.js +69 -0
  879. package/dist/index.es257.js.map +1 -0
  880. package/dist/index.es258.js +46 -0
  881. package/dist/index.es258.js.map +1 -0
  882. package/dist/index.es259.js +69 -0
  883. package/dist/index.es259.js.map +1 -0
  884. package/dist/index.es26.js +7 -4
  885. package/dist/index.es26.js.map +1 -1
  886. package/dist/index.es260.js +12 -0
  887. package/dist/index.es260.js.map +1 -0
  888. package/dist/index.es261.js +7 -0
  889. package/dist/index.es261.js.map +1 -0
  890. package/dist/index.es262.js +16 -0
  891. package/dist/index.es262.js.map +1 -0
  892. package/dist/index.es263.js +63 -0
  893. package/dist/index.es263.js.map +1 -0
  894. package/dist/index.es264.js +60 -0
  895. package/dist/index.es264.js.map +1 -0
  896. package/dist/index.es265.js +19 -0
  897. package/dist/index.es265.js.map +1 -0
  898. package/dist/index.es266.js +6 -0
  899. package/dist/index.es266.js.map +1 -0
  900. package/dist/index.es267.js +8 -0
  901. package/dist/index.es267.js.map +1 -0
  902. package/dist/index.es268.js +74 -0
  903. package/dist/index.es268.js.map +1 -0
  904. package/dist/index.es269.js +7 -0
  905. package/dist/index.es269.js.map +1 -0
  906. package/dist/index.es27.js +6 -6
  907. package/dist/index.es27.js.map +1 -1
  908. package/dist/index.es270.js +28 -0
  909. package/dist/index.es270.js.map +1 -0
  910. package/dist/index.es28.js +4 -15
  911. package/dist/index.es28.js.map +1 -1
  912. package/dist/index.es29.js +4 -12
  913. package/dist/index.es29.js.map +1 -1
  914. package/dist/index.es3.js +22 -63
  915. package/dist/index.es3.js.map +1 -1
  916. package/dist/index.es30.js +7 -15
  917. package/dist/index.es30.js.map +1 -1
  918. package/dist/index.es31.js +14 -6
  919. package/dist/index.es31.js.map +1 -1
  920. package/dist/index.es32.js +12 -5
  921. package/dist/index.es32.js.map +1 -1
  922. package/dist/index.es33.js +15 -4
  923. package/dist/index.es33.js.map +1 -1
  924. package/dist/index.es34.js +6 -17
  925. package/dist/index.es34.js.map +1 -1
  926. package/dist/index.es35.js +5 -18
  927. package/dist/index.es35.js.map +1 -1
  928. package/dist/index.es36.js +4 -14
  929. package/dist/index.es36.js.map +1 -1
  930. package/dist/index.es37.js +17 -5
  931. package/dist/index.es37.js.map +1 -1
  932. package/dist/index.es38.js +17 -6
  933. package/dist/index.es38.js.map +1 -1
  934. package/dist/index.es39.js +13 -9
  935. package/dist/index.es39.js.map +1 -1
  936. package/dist/index.es4.js +8 -8
  937. package/dist/index.es40.js +6 -4
  938. package/dist/index.es40.js.map +1 -1
  939. package/dist/index.es41.js +6 -18
  940. package/dist/index.es41.js.map +1 -1
  941. package/dist/index.es42.js +10 -6
  942. package/dist/index.es42.js.map +1 -1
  943. package/dist/index.es43.js +4 -6
  944. package/dist/index.es43.js.map +1 -1
  945. package/dist/index.es44.js +21 -1
  946. package/dist/index.es44.js.map +1 -1
  947. package/dist/index.es45.js +1 -39
  948. package/dist/index.es45.js.map +1 -1
  949. package/dist/index.es46.js +2 -2
  950. package/dist/index.es48.js +245 -61
  951. package/dist/index.es48.js.map +1 -1
  952. package/dist/index.es49.js +66 -9
  953. package/dist/index.es49.js.map +1 -1
  954. package/dist/index.es5.js +30 -22
  955. package/dist/index.es5.js.map +1 -1
  956. package/dist/index.es50.js +8 -9
  957. package/dist/index.es50.js.map +1 -1
  958. package/dist/index.es51.js +9 -84
  959. package/dist/index.es51.js.map +1 -1
  960. package/dist/index.es52.js +84 -5
  961. package/dist/index.es52.js.map +1 -1
  962. package/dist/index.es53.js +2 -2
  963. package/dist/index.es54.js +30 -2
  964. package/dist/index.es54.js.map +1 -1
  965. package/dist/index.es55.js +593 -21
  966. package/dist/index.es55.js.map +1 -1
  967. package/dist/index.es56.js +26 -600
  968. package/dist/index.es56.js.map +1 -1
  969. package/dist/index.es57.js +2 -107
  970. package/dist/index.es57.js.map +1 -1
  971. package/dist/index.es58.js +107 -10
  972. package/dist/index.es58.js.map +1 -1
  973. package/dist/index.es59.js +10 -2
  974. package/dist/index.es59.js.map +1 -1
  975. package/dist/index.es6.js +6 -6
  976. package/dist/index.es60.js +2 -2
  977. package/dist/index.es61.js +29 -2
  978. package/dist/index.es61.js.map +1 -1
  979. package/dist/index.es62.js +89 -273
  980. package/dist/index.es62.js.map +1 -1
  981. package/dist/index.es63.js +75 -14
  982. package/dist/index.es63.js.map +1 -1
  983. package/dist/index.es64.js +38 -18
  984. package/dist/index.es64.js.map +1 -1
  985. package/dist/index.es65.js +28 -4
  986. package/dist/index.es65.js.map +1 -1
  987. package/dist/index.es66.js +2 -4
  988. package/dist/index.es66.js.map +1 -1
  989. package/dist/index.es67.js +2 -4
  990. package/dist/index.es67.js.map +1 -1
  991. package/dist/index.es68.js +27 -4
  992. package/dist/index.es68.js.map +1 -1
  993. package/dist/index.es69.js +54 -3
  994. package/dist/index.es69.js.map +1 -1
  995. package/dist/index.es7.js +7 -7
  996. package/dist/index.es70.js +48 -5
  997. package/dist/index.es70.js.map +1 -1
  998. package/dist/index.es71.js +39 -5
  999. package/dist/index.es71.js.map +1 -1
  1000. package/dist/index.es72.js +12 -5
  1001. package/dist/index.es72.js.map +1 -1
  1002. package/dist/index.es73.js +12 -5
  1003. package/dist/index.es73.js.map +1 -1
  1004. package/dist/index.es74.js +30 -5
  1005. package/dist/index.es74.js.map +1 -1
  1006. package/dist/index.es75.js +12 -5
  1007. package/dist/index.es75.js.map +1 -1
  1008. package/dist/index.es76.js +14 -5
  1009. package/dist/index.es76.js.map +1 -1
  1010. package/dist/index.es77.js +50 -9
  1011. package/dist/index.es77.js.map +1 -1
  1012. package/dist/index.es78.js +65 -4
  1013. package/dist/index.es78.js.map +1 -1
  1014. package/dist/index.es79.js +4 -6
  1015. package/dist/index.es79.js.map +1 -1
  1016. package/dist/index.es8.js +2 -2
  1017. package/dist/index.es80.js +273 -6
  1018. package/dist/index.es80.js.map +1 -1
  1019. package/dist/index.es81.js +14 -9
  1020. package/dist/index.es81.js.map +1 -1
  1021. package/dist/index.es82.js +18 -11
  1022. package/dist/index.es82.js.map +1 -1
  1023. package/dist/index.es83.js +4 -12
  1024. package/dist/index.es83.js.map +1 -1
  1025. package/dist/index.es84.js +3 -85
  1026. package/dist/index.es84.js.map +1 -1
  1027. package/dist/index.es85.js +4 -3
  1028. package/dist/index.es85.js.map +1 -1
  1029. package/dist/index.es86.js +4 -14
  1030. package/dist/index.es86.js.map +1 -1
  1031. package/dist/index.es87.js +3 -11
  1032. package/dist/index.es87.js.map +1 -1
  1033. package/dist/index.es88.js +3 -7
  1034. package/dist/index.es88.js.map +1 -1
  1035. package/dist/index.es89.js +3 -7
  1036. package/dist/index.es89.js.map +1 -1
  1037. package/dist/index.es9.js +19 -9
  1038. package/dist/index.es9.js.map +1 -1
  1039. package/dist/index.es90.js +3 -7
  1040. package/dist/index.es90.js.map +1 -1
  1041. package/dist/index.es91.js +3 -8
  1042. package/dist/index.es91.js.map +1 -1
  1043. package/dist/index.es92.js +3 -4
  1044. package/dist/index.es92.js.map +1 -1
  1045. package/dist/index.es93.js +3 -4
  1046. package/dist/index.es93.js.map +1 -1
  1047. package/dist/index.es94.js +3 -4
  1048. package/dist/index.es94.js.map +1 -1
  1049. package/dist/index.es95.js +9 -6
  1050. package/dist/index.es95.js.map +1 -1
  1051. package/dist/index.es96.js +4 -7
  1052. package/dist/index.es96.js.map +1 -1
  1053. package/dist/index.es97.js +5 -3
  1054. package/dist/index.es97.js.map +1 -1
  1055. package/dist/index.es98.js +5 -7
  1056. package/dist/index.es98.js.map +1 -1
  1057. package/dist/index.es99.js +9 -12
  1058. package/dist/index.es99.js.map +1 -1
  1059. package/package.json +3 -2
  1060. package/src/components/GeoJsonLayer.js +10 -66
  1061. package/src/components/LocationMarkers.js +75 -10
  1062. package/src/index.js +1 -0
  1063. package/src/utils/Map.js +40 -1
  1064. package/src/utils/MapStyles.js +9 -3
  1065. package/types/components/GeoJsonLayer.js.flow +10 -66
  1066. package/types/components/LocationMarkers.js.flow +75 -10
  1067. package/types/index.js.flow +1 -0
  1068. package/types/utils/Map.js.flow +40 -1
  1069. package/types/utils/MapStyles.js.flow +9 -3
@@ -1,4 +1,4 @@
1
- "use strict";const nu=require("./index.cjs52.js"),ou=require("./index.cjs59.js");(function(cu,od){(function(en,tn){cu.exports=tn()})(nu.commonjsGlobal,function(){var en,tn,_l;function yl(c,Wi){if(!en)en=Wi;else if(!tn)tn=Wi;else{var ie="var sharedChunk = {}; ("+en+")(sharedChunk); ("+tn+")(sharedChunk);",Hi={};en(Hi),_l=Wi(Hi),typeof window<"u"&&(_l.workerUrl=window.URL.createObjectURL(new Blob([ie],{type:"text/javascript"})))}}yl(["exports"],function(c){function Wi(i,e,r,a){return new(r||(r=Promise))(function(o,u){function d(x){try{_(a.next(x))}catch(b){u(b)}}function f(x){try{_(a.throw(x))}catch(b){u(b)}}function _(x){var b;x.done?o(x.value):(b=x.value,b instanceof r?b:new r(function(T){T(b)})).then(d,f)}_((a=a.apply(i,e||[])).next())})}function ie(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}typeof SuppressedError=="function"&&SuppressedError;var Hi=ci;function ci(i,e){this.x=i,this.y=e}ci.prototype={clone:function(){return new ci(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,e){return this.clone()._rotateAround(i,e)},matMult:function(i){return this.clone()._matMult(i)},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(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var e=i.x-this.x,r=i.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,e){return Math.atan2(this.x*e-this.y*i,this.x*i+this.y*e)},_matMult:function(i){var e=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=e,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var e=Math.cos(i),r=Math.sin(i),a=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=a,this},_rotateAround:function(i,e){var r=Math.cos(i),a=Math.sin(i),o=e.y+a*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-a*(this.y-e.y),this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},ci.convert=function(i){return i instanceof ci?i:Array.isArray(i)?new ci(i[0],i[1]):i};var Be=ie(Hi),ls=Fs;function Fs(i,e,r,a){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(a-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=e,this.p2x=r,this.p2y=a}Fs.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,e){if(e===void 0&&(e=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,a=0;a<8;a++){var o=this.sampleCurveX(r)-i;if(Math.abs(o)<e)return r;var u=this.sampleCurveDerivativeX(r);if(Math.abs(u)<1e-6)break;r-=o/u}var d=0,f=1;for(r=i,a=0;a<20&&(o=this.sampleCurveX(r),!(Math.abs(o-i)<e));a++)i>o?d=r:f=r,r=.5*(f-d)+d;return r},solve:function(i,e){return this.sampleCurveY(this.solveCurveX(i,e))}};var cs=ie(ls);let ei,Pt;function ua(){return ei==null&&(ei=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),ei}function Tr(){if(Pt==null&&(Pt=!1,ua())){const e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let a=0;a<5*5;a++){const o=4*a;e.fillStyle=`rgb(${o},${o+1},${o+2})`,e.fillRect(a%5,Math.floor(a/5),1,1)}const r=e.getImageData(0,0,5,5).data;for(let a=0;a<5*5*4;a++)if(a%4!=3&&r[a]!==a){Pt=!0;break}}}return Pt||!1}function Os(i,e,r,a){const o=new cs(i,e,r,a);return function(u){return o.solve(u)}}const hs=Os(.25,.1,.25,1);function Ki(i,e,r){return Math.min(r,Math.max(e,i))}function Vs(i,e,r){const a=r-e,o=((i-e)%a+a)%a+e;return o===e?r:o}function $t(i,...e){for(const r of e)for(const a in r)i[a]=r[a];return i}let pa=1;function mt(i,e,r){const a={};for(const o in i)a[o]=e.call(r||this,i[o],o,i);return a}function us(i,e,r){const a={};for(const o in i)e.call(r||this,i[o],o,i)&&(a[o]=i[o]);return a}function $i(i){return Array.isArray(i)?i.map($i):typeof i=="object"&&i?mt(i,$i):i}const Ir={};function ti(i){Ir[i]||(typeof console<"u"&&console.warn(i),Ir[i]=!0)}function vi(i,e,r){return(r.y-i.y)*(e.x-i.x)>(e.y-i.y)*(r.x-i.x)}function cr(i){let e=0;for(let r,a,o=0,u=i.length,d=u-1;o<u;d=o++)r=i[o],a=i[d],e+=(a.x-r.x)*(r.y+a.y);return e}function ki(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}let Nr=null;function Ns(i){return typeof ImageBitmap<"u"&&i instanceof ImageBitmap}const da="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Us(i,e,r,a,o){return Wi(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const u=new VideoFrame(i,{timestamp:0});try{const d=u==null?void 0:u.format;if(!d||!d.startsWith("BGR")&&!d.startsWith("RGB"))throw new Error(`Unrecognized format ${d}`);const f=d.startsWith("BGR"),_=new Uint8ClampedArray(a*o*4);if(yield u.copyTo(_,function(x,b,T,A,C){const P=4*Math.max(-b,0),D=(Math.max(0,T)-T)*A*4+P,V=4*A,$=Math.max(0,b),H=Math.max(0,T);return{rect:{x:$,y:H,width:Math.min(x.width,b+A)-$,height:Math.min(x.height,T+C)-H},layout:[{offset:D,stride:V}]}}(i,e,r,a,o)),f)for(let x=0;x<_.length;x+=4){const b=_[x];_[x]=_[x+2],_[x+2]=b}return _}finally{u.close()}})}let Yi,ct,hi,Ur;const ps={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(i){const e=requestAnimationFrame(i);return{cancel:()=>cancelAnimationFrame(e)}},getImageData(i,e=0){return this.getImageCanvasContext(i).getImageData(-e,-e,i.width+2*e,i.height+2*e)},getImageCanvasContext(i){const e=window.document.createElement("canvas"),r=e.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("failed to create canvas 2d context");return e.width=i.width,e.height=i.height,r.drawImage(i,0,0,i.width,i.height),r},resolveURL:i=>(hi||(hi=document.createElement("a")),hi.href=i,hi.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(Ur==null&&(Ur=matchMedia("(prefers-reduced-motion: reduce)")),Ur.matches)}},ds={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};class Ar extends Error{constructor(e,r,a,o){super(`AJAXError: ${r} (${e}): ${a}`),this.status=e,this.statusText=r,this.url=a,this.body=o}}const ji=ki()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href,zi=i=>ds.REGISTERED_PROTOCOLS[i.substring(0,i.indexOf("://"))];function $s(i,e){const r=new AbortController,a=new Request(i.url,{method:i.method||"GET",body:i.body,credentials:i.credentials,headers:i.headers,cache:i.cache,referrer:ji(),signal:r.signal});let o=!1,u=!1;return i.type==="json"&&a.headers.set("Accept","application/json"),u||fetch(a).then(d=>d.ok?(f=>{(i.type==="arrayBuffer"||i.type==="image"?f.arrayBuffer():i.type==="json"?f.json():f.text()).then(_=>{u||(o=!0,e(null,_,f.headers.get("Cache-Control"),f.headers.get("Expires")))}).catch(_=>{u||e(new Error(_.message))})})(d):d.blob().then(f=>e(new Ar(d.status,d.statusText,i.url,f)))).catch(d=>{d.code!==20&&e(new Error(d.message))}),{cancel:()=>{u=!0,o||r.abort()}}}const Mr=function(i,e){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){if(ki()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e);if(!ki())return(zi(i.url)||$s)(i,e)}if(!(/^file:/.test(r=i.url)||/^file:/.test(ji())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return $s(i,e);if(ki()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e,void 0,!0)}var r;return function(a,o){const u=new XMLHttpRequest;u.open(a.method||"GET",a.url,!0),a.type!=="arrayBuffer"&&a.type!=="image"||(u.responseType="arraybuffer");for(const d in a.headers)u.setRequestHeader(d,a.headers[d]);return a.type==="json"&&(u.responseType="text",u.setRequestHeader("Accept","application/json")),u.withCredentials=a.credentials==="include",u.onerror=()=>{o(new Error(u.statusText))},u.onload=()=>{if((u.status>=200&&u.status<300||u.status===0)&&u.response!==null){let d=u.response;if(a.type==="json")try{d=JSON.parse(u.response)}catch(f){return o(f)}o(null,d,u.getResponseHeader("Cache-Control"),u.getResponseHeader("Expires"))}else{const d=new Blob([u.response],{type:u.getResponseHeader("Content-Type")});o(new Ar(u.status,u.statusText,a.url,d))}},u.send(a.body),{cancel:()=>u.abort()}}(i,e)},js=function(i,e){return Mr($t(i,{type:"arrayBuffer"}),e)};function hr(i){if(!i||i.indexOf("://")<=0||i.indexOf("data:image/")===0||i.indexOf("blob:")===0)return!0;const e=new URL(i),r=window.location;return e.protocol===r.protocol&&e.host===r.host}function fs(i,e,r){r[i]&&r[i].indexOf(e)!==-1||(r[i]=r[i]||[],r[i].push(e))}function $r(i,e,r){if(r&&r[i]){const a=r[i].indexOf(e);a!==-1&&r[i].splice(a,1)}}class Er{constructor(e,r={}){$t(this,r),this.type=e}}class Cr extends Er{constructor(e,r={}){super("error",$t({error:e},r))}}class jr{on(e,r){return this._listeners=this._listeners||{},fs(e,r,this._listeners),this}off(e,r){return $r(e,r,this._listeners),$r(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},fs(e,r,this._oneTimeListeners),this):new Promise(a=>this.once(e,a))}fire(e,r){typeof e=="string"&&(e=new Er(e,r||{}));const a=e.type;if(this.listens(a)){e.target=this;const o=this._listeners&&this._listeners[a]?this._listeners[a].slice():[];for(const f of o)f.call(this,e);const u=this._oneTimeListeners&&this._oneTimeListeners[a]?this._oneTimeListeners[a].slice():[];for(const f of u)$r(a,f,this._oneTimeListeners),f.call(this,e);const d=this._eventedParent;d&&($t(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),d.fire(e))}else e instanceof Cr&&console.error(e.error);return this}listens(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)}setEventedParent(e,r){return this._eventedParent=e,this._eventedParentData=r,this}}var re={$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"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},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:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,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",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},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:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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:{},"viewport-glyph":{},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-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},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}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},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"}}};const ui=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Di(i,e){const r={};for(const a in i)a!=="ref"&&(r[a]=i[a]);return ui.forEach(a=>{a in e&&(r[a]=e[a])}),r}function nt(i,e){if(Array.isArray(i)){if(!Array.isArray(e)||i.length!==e.length)return!1;for(let r=0;r<i.length;r++)if(!nt(i[r],e[r]))return!1;return!0}if(typeof i=="object"&&i!==null&&e!==null){if(typeof e!="object"||Object.keys(i).length!==Object.keys(e).length)return!1;for(const r in i)if(!nt(i[r],e[r]))return!1;return!0}return i===e}const Ye={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 Ji(i,e,r){r.push({command:Ye.addSource,args:[i,e[i]]})}function ms(i,e,r){e.push({command:Ye.removeSource,args:[i]}),r[i]=!0}function ur(i,e,r,a){ms(i,r,a),Ji(i,e,r)}function fa(i,e,r){let a;for(a in i[r])if(Object.prototype.hasOwnProperty.call(i[r],a)&&a!=="data"&&!nt(i[r][a],e[r][a]))return!1;for(a in e[r])if(Object.prototype.hasOwnProperty.call(e[r],a)&&a!=="data"&&!nt(i[r][a],e[r][a]))return!1;return!0}function gs(i,e,r,a,o,u){let d;for(d in e=e||{},i=i||{})Object.prototype.hasOwnProperty.call(i,d)&&(nt(i[d],e[d])||r.push({command:u,args:[a,d,e[d],o]}));for(d in e)Object.prototype.hasOwnProperty.call(e,d)&&!Object.prototype.hasOwnProperty.call(i,d)&&(nt(i[d],e[d])||r.push({command:u,args:[a,d,e[d],o]}))}function Pr(i){return i.id}function qr(i,e){return i[e.id]=e,i}class fe{constructor(e,r,a,o){this.message=(e?`${e}: `:"")+a,o&&(this.identifier=o),r!=null&&r.__line__&&(this.line=r.__line__)}}function Qi(i,...e){for(const r of e)for(const a in r)i[a]=r[a];return i}class vt extends Error{constructor(e,r){super(r),this.message=r,this.key=e}}class Zr{constructor(e,r=[]){this.parent=e,this.bindings={};for(const[a,o]of r)this.bindings[a]=o}concat(e){return new Zr(this,e)}get(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.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const pr={kind:"null"},ge={kind:"number"},Ue={kind:"string"},Fe={kind:"boolean"},ii={kind:"color"},er={kind:"object"},Ve={kind:"value"},dr={kind:"collator"},R={kind:"formatted"},I={kind:"padding"},M={kind:"resolvedImage"},k={kind:"variableAnchorOffsetCollection"};function O(i,e){return{kind:"array",itemType:i,N:e}}function N(i){if(i.kind==="array"){const e=N(i.itemType);return typeof i.N=="number"?`array<${e}, ${i.N}>`:i.itemType.kind==="value"?"array":`array<${e}>`}return i.kind}const K=[pr,ge,Ue,Fe,ii,R,er,O(Ve),I,M,k];function Z(i,e){if(e.kind==="error")return null;if(i.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!Z(i.itemType,e.itemType))&&(typeof i.N!="number"||i.N===e.N))return null}else{if(i.kind===e.kind)return null;if(i.kind==="value"){for(const r of K)if(!Z(r,e))return null}}return`Expected ${N(i)} but found ${N(e)} instead.`}function j(i,e){return e.some(r=>r.kind===i.kind)}function W(i,e){return e.some(r=>r==="null"?i===null:r==="array"?Array.isArray(i):r==="object"?i&&!Array.isArray(i)&&typeof i=="object":r===typeof i)}function se(i,e){return i.kind==="array"&&e.kind==="array"?i.itemType.kind===e.itemType.kind&&typeof i.N=="number":i.kind===e.kind}const ae=.96422,le=.82521,Pe=4/29,Re=6/29,Te=3*Re*Re,ze=Re*Re*Re,Oe=Math.PI/180,tt=180/Math.PI;function st(i){return(i%=360)<0&&(i+=360),i}function Ke([i,e,r,a]){let o,u;const d=Wt((.2225045*(i=He(i))+.7168786*(e=He(e))+.0606169*(r=He(r)))/1);i===e&&e===r?o=u=d:(o=Wt((.4360747*i+.3850649*e+.1430804*r)/ae),u=Wt((.0139322*i+.0971045*e+.7141733*r)/le));const f=116*d-16;return[f<0?0:f,500*(o-d),200*(d-u),a]}function He(i){return i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function Wt(i){return i>ze?Math.pow(i,1/3):i/Te+Pe}function ot([i,e,r,a]){let o=(i+16)/116,u=isNaN(e)?o:o+e/500,d=isNaN(r)?o:o-r/200;return o=1*jt(o),u=ae*jt(u),d=le*jt(d),[kt(3.1338561*u-1.6168667*o-.4906146*d),kt(-.9787684*u+1.9161415*o+.033454*d),kt(.0719453*u-.2289914*o+1.4052427*d),a]}function kt(i){return(i=i<=.00304?12.92*i:1.055*Math.pow(i,1/2.4)-.055)<0?0:i>1?1:i}function jt(i){return i>Re?i*i*i:Te*(i-Pe)}function Li(i){return parseInt(i.padEnd(2,i),16)/255}function co(i,e){return _s(e?i/100:i,0,1)}function _s(i,e,r){return Math.min(Math.max(e,i),r)}function ys(i){return!i.some(Number.isNaN)}const xl={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class it{constructor(e,r,a,o=1,u=!0){this.r=e,this.g=r,this.b=a,this.a=o,u||(this.r*=o,this.g*=o,this.b*=o,o||this.overwriteGetter("rgb",[e,r,a,o]))}static parse(e){if(e instanceof it)return e;if(typeof e!="string")return;const r=function(a){if((a=a.toLowerCase().trim())==="transparent")return[0,0,0,0];const o=xl[a];if(o){const[d,f,_]=o;return[d/255,f/255,_/255,1]}if(a.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(a)){const d=a.length<6?1:2;let f=1;return[Li(a.slice(f,f+=d)),Li(a.slice(f,f+=d)),Li(a.slice(f,f+=d)),Li(a.slice(f,f+d)||"ff")]}if(a.startsWith("rgb")){const d=a.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(d){const[f,_,x,b,T,A,C,P,D,V,$,H]=d,q=[b||" ",C||" ",V].join("");if(q===" "||q===" /"||q===",,"||q===",,,"){const Y=[x,A,D].join(""),Q=Y==="%%%"?100:Y===""?255:0;if(Q){const oe=[_s(+_/Q,0,1),_s(+T/Q,0,1),_s(+P/Q,0,1),$?co(+$,H):1];if(ys(oe))return oe}}return}}const u=a.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(u){const[d,f,_,x,b,T,A,C,P]=u,D=[_||" ",b||" ",A].join("");if(D===" "||D===" /"||D===",,"||D===",,,"){const V=[+f,_s(+x,0,100),_s(+T,0,100),C?co(+C,P):1];if(ys(V))return function([$,H,q,Y]){function Q(oe){const be=(oe+$/30)%12,Ae=H*Math.min(q,1-q);return q-Ae*Math.max(-1,Math.min(be-3,9-be,1))}return $=st($),H/=100,q/=100,[Q(0),Q(8),Q(4),Y]}(V)}}}(e);return r?new it(...r,!1):void 0}get rgb(){const{r:e,g:r,b:a,a:o}=this,u=o||1/0;return this.overwriteGetter("rgb",[e/u,r/u,a/u,o])}get hcl(){return this.overwriteGetter("hcl",function(e){const[r,a,o,u]=Ke(e),d=Math.sqrt(a*a+o*o);return[Math.round(1e4*d)?st(Math.atan2(o,a)*tt):NaN,d,r,u]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Ke(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){const[e,r,a,o]=this.rgb;return`rgba(${[e,r,a].map(u=>Math.round(255*u)).join(",")},${o})`}}it.black=new it(0,0,0,1),it.white=new it(1,1,1,1),it.transparent=new it(0,0,0,0),it.red=new it(1,0,0,1);class rn{constructor(e,r,a){this.sensitivity=e?r?"variant":"case":r?"accent":"base",this.locale=a,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,r){return this.collator.compare(e,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class ma{constructor(e,r,a,o,u){this.text=e,this.image=r,this.scale=a,this.fontStack=o,this.textColor=u}}class Ht{constructor(e){this.sections=e}static fromString(e){return new Ht([new ma(e,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof Ht?e:Ht.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}}class bi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof bi)return e;if(typeof e=="number")return new bi([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const r of e)if(typeof r!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new bi(e)}}toString(){return JSON.stringify(this.values)}}const vl=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Bi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Bi)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let r=0;r<e.length;r+=2){const a=e[r],o=e[r+1];if(typeof a!="string"||!vl.has(a)||!Array.isArray(o)||o.length!==2||typeof o[0]!="number"||typeof o[1]!="number")return}return new Bi(e)}}toString(){return JSON.stringify(this.values)}}class qt{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new qt({name:e,available:!1}):null}}function ga(i,e,r,a){return typeof i=="number"&&i>=0&&i<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:`Invalid rgba value [${[i,e,r,a].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof a=="number"?[i,e,r,a]:[i,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function xs(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof it||i instanceof rn||i instanceof Ht||i instanceof bi||i instanceof Bi||i instanceof qt)return!0;if(Array.isArray(i)){for(const e of i)if(!xs(e))return!1;return!0}if(typeof i=="object"){for(const e in i)if(!xs(i[e]))return!1;return!0}return!1}function gt(i){if(i===null)return pr;if(typeof i=="string")return Ue;if(typeof i=="boolean")return Fe;if(typeof i=="number")return ge;if(i instanceof it)return ii;if(i instanceof rn)return dr;if(i instanceof Ht)return R;if(i instanceof bi)return I;if(i instanceof Bi)return k;if(i instanceof qt)return M;if(Array.isArray(i)){const e=i.length;let r;for(const a of i){const o=gt(a);if(r){if(r===o)continue;r=Ve;break}r=o}return O(r||Ve,e)}return er}function Je(i){const e=typeof i;return i===null?"":e==="string"||e==="number"||e==="boolean"?String(i):i instanceof it||i instanceof Ht||i instanceof bi||i instanceof Bi||i instanceof qt?i.toString():JSON.stringify(i)}class Gr{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!xs(e[1]))return r.error("invalid value");const a=e[1];let o=gt(a);const u=r.expectedType;return o.kind!=="array"||o.N!==0||!u||u.kind!=="array"||typeof u.N=="number"&&u.N!==0||(o=u),new Gr(o,a)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class bt{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const _a={string:Ue,number:ge,boolean:Fe,object:er};class Ri{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let a,o=1;const u=e[0];if(u==="array"){let f,_;if(e.length>2){const x=e[1];if(typeof x!="string"||!(x in _a)||x==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);f=_a[x],o++}else f=Ve;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);_=e[2],o++}a=O(f,_)}else{if(!_a[u])throw new Error(`Types doesn't contain name = ${u}`);a=_a[u]}const d=[];for(;o<e.length;o++){const f=r.parse(e[o],o,Ve);if(!f)return null;d.push(f)}return new Ri(a,d)}evaluate(e){for(let r=0;r<this.args.length;r++){const a=this.args[r].evaluate(e);if(!Z(this.type,gt(a)))return a;if(r===this.args.length-1)throw new bt(`Expected value to be of type ${N(this.type)}, but found ${N(gt(a))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const sn={"to-boolean":Fe,"to-color":ii,"to-number":ge,"to-string":Ue};class kr{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const a=e[0];if(!sn[a])throw new Error(`Can't parse ${a} as it is not part of the known types`);if((a==="to-boolean"||a==="to-string")&&e.length!==2)return r.error("Expected one argument.");const o=sn[a],u=[];for(let d=1;d<e.length;d++){const f=r.parse(e[d],d,Ve);if(!f)return null;u.push(f)}return new kr(o,u)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let r,a;for(const o of this.args){if(r=o.evaluate(e),a=null,r instanceof it)return r;if(typeof r=="string"){const u=e.parseColor(r);if(u)return u}else if(Array.isArray(r)&&(a=r.length<3||r.length>4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:ga(r[0],r[1],r[2],r[3]),!a))return new it(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new bt(a||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"padding":{let r;for(const a of this.args){r=a.evaluate(e);const o=bi.parse(r);if(o)return o}throw new bt(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"variableAnchorOffsetCollection":{let r;for(const a of this.args){r=a.evaluate(e);const o=Bi.parse(r);if(o)return o}throw new bt(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"number":{let r=null;for(const a of this.args){if(r=a.evaluate(e),r===null)return 0;const o=Number(r);if(!isNaN(o))return o}throw new bt(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return Ht.fromString(Je(this.args[0].evaluate(e)));case"resolvedImage":return qt.fromString(Je(this.args[0].evaluate(e)));default:return Je(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const ho=["Unknown","Point","LineString","Polygon"];class an{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?ho[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let r=this._parseColorCache[e];return r||(r=this._parseColorCache[e]=it.parse(e)),r}}class ya{constructor(e,r,a=[],o,u=new Zr,d=[]){this.registry=e,this.path=a,this.key=a.map(f=>`[${f}]`).join(""),this.scope=u,this.errors=d,this.expectedType=o,this._isConstant=r}parse(e,r,a,o,u={}){return r?this.concat(r,a,o)._parse(e,u):this._parse(e,u)}_parse(e,r){function a(o,u,d){return d==="assert"?new Ri(u,[o]):d==="coerce"?new kr(u,[o]):o}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", []].');const 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;const u=this.registry[o];if(u){let d=u.parse(e,this);if(!d)return null;if(this.expectedType){const f=this.expectedType,_=d.type;if(f.kind!=="string"&&f.kind!=="number"&&f.kind!=="boolean"&&f.kind!=="object"&&f.kind!=="array"||_.kind!=="value")if(f.kind!=="color"&&f.kind!=="formatted"&&f.kind!=="resolvedImage"||_.kind!=="value"&&_.kind!=="string")if(f.kind!=="padding"||_.kind!=="value"&&_.kind!=="number"&&_.kind!=="array")if(f.kind!=="variableAnchorOffsetCollection"||_.kind!=="value"&&_.kind!=="array"){if(this.checkSubtype(f,_))return null}else d=a(d,f,r.typeAnnotation||"coerce");else d=a(d,f,r.typeAnnotation||"coerce");else d=a(d,f,r.typeAnnotation||"coerce");else d=a(d,f,r.typeAnnotation||"assert")}if(!(d instanceof Gr)&&d.type.kind!=="resolvedImage"&&this._isConstant(d)){const f=new an;try{d=new Gr(d.type,d.evaluate(f))}catch(_){return this.error(_.message),null}}return d}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.`)}concat(e,r,a){const o=typeof e=="number"?this.path.concat(e):this.path,u=a?this.scope.concat(a):this.scope;return new ya(this.registry,this._isConstant,o,r||null,u,this.errors)}error(e,...r){const a=`${this.key}${r.map(o=>`[${o}]`).join("")}`;this.errors.push(new vt(a,e))}checkSubtype(e,r){const a=Z(e,r);return a&&this.error(a),a}}class xa{constructor(e,r,a){this.type=dr,this.locale=a,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");const a=e[1];if(typeof a!="object"||Array.isArray(a))return r.error("Collator options argument must be an object.");const o=r.parse(a["case-sensitive"]!==void 0&&a["case-sensitive"],1,Fe);if(!o)return null;const u=r.parse(a["diacritic-sensitive"]!==void 0&&a["diacritic-sensitive"],1,Fe);if(!u)return null;let d=null;return a.locale&&(d=r.parse(a.locale,1,Ue),!d)?null:new xa(o,u,d)}evaluate(e){return new rn(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}const zr=8192;function nn(i,e){i[0]=Math.min(i[0],e[0]),i[1]=Math.min(i[1],e[1]),i[2]=Math.max(i[2],e[0]),i[3]=Math.max(i[3],e[1])}function qs(i,e){return!(i[0]<=e[0]||i[2]>=e[2]||i[1]<=e[1]||i[3]>=e[3])}function uo(i,e){const r=(180+i[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,o=Math.pow(2,e.z);return[Math.round(r*o*zr),Math.round(a*o*zr)]}function bl(i,e,r){const a=i[0]-e[0],o=i[1]-e[1],u=i[0]-r[0],d=i[1]-r[1];return a*d-u*o==0&&a*u<=0&&o*d<=0}function on(i,e){let r=!1;for(let d=0,f=e.length;d<f;d++){const _=e[d];for(let x=0,b=_.length;x<b-1;x++){if(bl(i,_[x],_[x+1]))return!1;(o=_[x])[1]>(a=i)[1]!=(u=_[x+1])[1]>a[1]&&a[0]<(u[0]-o[0])*(a[1]-o[1])/(u[1]-o[1])+o[0]&&(r=!r)}}var a,o,u;return r}function ln(i,e){for(let r=0;r<e.length;r++)if(on(i,e[r]))return!0;return!1}function po(i,e,r,a){const o=a[0]-r[0],u=a[1]-r[1],d=(i[0]-r[0])*u-o*(i[1]-r[1]),f=(e[0]-r[0])*u-o*(e[1]-r[1]);return d>0&&f<0||d<0&&f>0}function wl(i,e,r){for(const x of r)for(let b=0;b<x.length-1;++b)if((f=[(d=x[b+1])[0]-(u=x[b])[0],d[1]-u[1]])[0]*(_=[(o=e)[0]-(a=i)[0],o[1]-a[1]])[1]-f[1]*_[0]!=0&&po(a,o,u,d)&&po(u,d,a,o))return!0;var a,o,u,d,f,_;return!1}function fo(i,e){for(let r=0;r<i.length;++r)if(!on(i[r],e))return!1;for(let r=0;r<i.length-1;++r)if(wl(i[r],i[r+1],e))return!1;return!0}function mo(i,e){for(let r=0;r<e.length;r++)if(fo(i,e[r]))return!0;return!1}function va(i,e,r){const a=[];for(let o=0;o<i.length;o++){const u=[];for(let d=0;d<i[o].length;d++){const f=uo(i[o][d],r);nn(e,f),u.push(f)}a.push(u)}return a}function go(i,e,r){const a=[];for(let o=0;o<i.length;o++){const u=va(i[o],e,r);a.push(u)}return a}function _o(i,e,r,a){if(i[0]<r[0]||i[0]>r[2]){const o=.5*a;let u=i[0]-r[0]>o?-a:r[0]-i[0]>o?a:0;u===0&&(u=i[0]-r[2]>o?-a:r[2]-i[0]>o?a:0),i[0]+=u}nn(e,i)}function cn(i,e,r,a){const o=Math.pow(2,a.z)*zr,u=[a.x*zr,a.y*zr],d=[];for(const f of i)for(const _ of f){const x=[_.x+u[0],_.y+u[1]];_o(x,e,r,o),d.push(x)}return d}function hn(i,e,r,a){const o=Math.pow(2,a.z)*zr,u=[a.x*zr,a.y*zr],d=[];for(const _ of i){const x=[];for(const b of _){const T=[b.x+u[0],b.y+u[1]];nn(e,T),x.push(T)}d.push(x)}if(e[2]-e[0]<=o/2){(f=e)[0]=f[1]=1/0,f[2]=f[3]=-1/0;for(const _ of d)for(const x of _)_o(x,e,r,o)}var f;return d}class Xr{constructor(e,r){this.type=Fe,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(xs(e[1])){const a=e[1];if(a.type==="FeatureCollection")for(let o=0;o<a.features.length;++o){const u=a.features[o].geometry.type;if(u==="Polygon"||u==="MultiPolygon")return new Xr(a,a.features[o].geometry)}else if(a.type==="Feature"){const o=a.geometry.type;if(o==="Polygon"||o==="MultiPolygon")return new Xr(a,a.geometry)}else if(a.type==="Polygon"||a.type==="MultiPolygon")return new Xr(a,a)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return function(r,a){const o=[1/0,1/0,-1/0,-1/0],u=[1/0,1/0,-1/0,-1/0],d=r.canonicalID();if(a.type==="Polygon"){const f=va(a.coordinates,u,d),_=cn(r.geometry(),o,u,d);if(!qs(o,u))return!1;for(const x of _)if(!on(x,f))return!1}if(a.type==="MultiPolygon"){const f=go(a.coordinates,u,d),_=cn(r.geometry(),o,u,d);if(!qs(o,u))return!1;for(const x of _)if(!ln(x,f))return!1}return!0}(e,this.geometries);if(e.geometryType()==="LineString")return function(r,a){const o=[1/0,1/0,-1/0,-1/0],u=[1/0,1/0,-1/0,-1/0],d=r.canonicalID();if(a.type==="Polygon"){const f=va(a.coordinates,u,d),_=hn(r.geometry(),o,u,d);if(!qs(o,u))return!1;for(const x of _)if(!fo(x,f))return!1}if(a.type==="MultiPolygon"){const f=go(a.coordinates,u,d),_=hn(r.geometry(),o,u,d);if(!qs(o,u))return!1;for(const x of _)if(!mo(x,f))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class ba{constructor(e,r){this.type=r.type,this.name=e,this.boundExpression=r}static parse(e,r){if(e.length!==2||typeof e[1]!="string")return r.error("'var' expression requires exactly one string literal argument.");const a=e[1];return r.scope.has(a)?new ba(a,r.scope.get(a)):r.error(`Unknown variable "${a}". Make sure "${a}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class Fi{constructor(e,r,a,o){this.name=e,this.type=r,this._evaluate=a,this.args=o}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,r){const a=e[0],o=Fi.definitions[a];if(!o)return r.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0);const u=Array.isArray(o)?o[0]:o.type,d=Array.isArray(o)?[[o[1],o[2]]]:o.overloads,f=d.filter(([x])=>!Array.isArray(x)||x.length===e.length-1);let _=null;for(const[x,b]of f){_=new ya(r.registry,wa,r.path,null,r.scope);const T=[];let A=!1;for(let C=1;C<e.length;C++){const P=e[C],D=Array.isArray(x)?x[C-1]:x.type,V=_.parse(P,1+T.length,D);if(!V){A=!0;break}T.push(V)}if(!A)if(Array.isArray(x)&&x.length!==T.length)_.error(`Expected ${x.length} arguments, but found ${T.length} instead.`);else{for(let C=0;C<T.length;C++){const P=Array.isArray(x)?x[C]:x.type,D=T[C];_.concat(C+1).checkSubtype(P,D.type)}if(_.errors.length===0)return new Fi(a,u,b,T)}}if(f.length===1)r.errors.push(..._.errors);else{const x=(f.length?f:d).map(([T])=>{return A=T,Array.isArray(A)?`(${A.map(N).join(", ")})`:`(${N(A.type)}...)`;var A}).join(" | "),b=[];for(let T=1;T<e.length;T++){const A=r.parse(e[T],1+b.length);if(!A)return null;b.push(N(A.type))}r.error(`Expected arguments of type ${x}, but found (${b.join(", ")}) instead.`)}return null}static register(e,r){Fi.definitions=r;for(const a in r)e[a]=Fi}}function wa(i){if(i instanceof ba)return wa(i.boundExpression);if(i instanceof Fi&&i.name==="error"||i instanceof xa||i instanceof Xr)return!1;const e=i instanceof kr||i instanceof Ri;let r=!0;return i.eachChild(a=>{r=e?r&&wa(a):r&&a instanceof Gr}),!!r&&Sa(i)&&Ta(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Sa(i){if(i instanceof Fi&&(i.name==="get"&&i.args.length===1||i.name==="feature-state"||i.name==="has"&&i.args.length===1||i.name==="properties"||i.name==="geometry-type"||i.name==="id"||/^filter-/.test(i.name))||i instanceof Xr)return!1;let e=!0;return i.eachChild(r=>{e&&!Sa(r)&&(e=!1)}),e}function Zs(i){if(i instanceof Fi&&i.name==="feature-state")return!1;let e=!0;return i.eachChild(r=>{e&&!Zs(r)&&(e=!1)}),e}function Ta(i,e){if(i instanceof Fi&&e.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild(a=>{r&&!Ta(a,e)&&(r=!1)}),r}function vs(i,e){const r=i.length-1;let a,o,u=0,d=r,f=0;for(;u<=d;)if(f=Math.floor((u+d)/2),a=i[f],o=i[f+1],a<=e){if(f===r||e<o)return f;u=f+1}else{if(!(a>e))throw new bt("Input is not a number.");d=f-1}return 0}class Dr{constructor(e,r,a){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(const[o,u]of a)this.labels.push(o),this.outputs.push(u)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");const a=r.parse(e[1],1,ge);if(!a)return null;const o=[];let u=null;r.expectedType&&r.expectedType.kind!=="value"&&(u=r.expectedType);for(let d=1;d<e.length;d+=2){const f=d===1?-1/0:e[d],_=e[d+1],x=d,b=d+1;if(typeof f!="number")return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',x);if(o.length&&o[o.length-1][0]>=f)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',x);const T=r.parse(_,b,u);if(!T)return null;u=u||T.type,o.push([f,T])}return new Dr(u,a,o)}evaluate(e){const r=this.labels,a=this.outputs;if(r.length===1)return a[0].evaluate(e);const o=this.input.evaluate(e);if(o<=r[0])return a[0].evaluate(e);const u=r.length;return o>=r[u-1]?a[u-1].evaluate(e):a[vs(r,o)].evaluate(e)}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Xe(i,e,r){return i+r*(e-i)}function Ia(i,e,r){return i.map((a,o)=>Xe(a,e[o],r))}const wi={number:Xe,color:function(i,e,r,a="rgb"){switch(a){case"rgb":{const[o,u,d,f]=Ia(i.rgb,e.rgb,r);return new it(o,u,d,f,!1)}case"hcl":{const[o,u,d,f]=i.hcl,[_,x,b,T]=e.hcl;let A,C;if(isNaN(o)||isNaN(_))isNaN(o)?isNaN(_)?A=NaN:(A=_,d!==1&&d!==0||(C=x)):(A=o,b!==1&&b!==0||(C=u));else{let H=_-o;_>o&&H>180?H-=360:_<o&&o-_>180&&(H+=360),A=o+r*H}const[P,D,V,$]=function([H,q,Y,Q]){return H=isNaN(H)?0:H*Oe,ot([Y,Math.cos(H)*q,Math.sin(H)*q,Q])}([A,C??Xe(u,x,r),Xe(d,b,r),Xe(f,T,r)]);return new it(P,D,V,$,!1)}case"lab":{const[o,u,d,f]=ot(Ia(i.lab,e.lab,r));return new it(o,u,d,f,!1)}}},array:Ia,padding:function(i,e,r){return new bi(Ia(i.values,e.values,r))},variableAnchorOffsetCollection:function(i,e,r){const a=i.values,o=e.values;if(a.length!==o.length)throw new bt(`Cannot interpolate values of different length. from: ${i.toString()}, to: ${e.toString()}`);const u=[];for(let d=0;d<a.length;d+=2){if(a[d]!==o[d])throw new bt(`Cannot interpolate values containing mismatched anchors. from[${d}]: ${a[d]}, to[${d}]: ${o[d]}`);u.push(a[d]);const[f,_]=a[d+1],[x,b]=o[d+1];u.push([Xe(f,x,r),Xe(_,b,r)])}return new Bi(u)}};class Si{constructor(e,r,a,o,u){this.type=e,this.operator=r,this.interpolation=a,this.input=o,this.labels=[],this.outputs=[];for(const[d,f]of u)this.labels.push(d),this.outputs.push(f)}static interpolationFactor(e,r,a,o){let u=0;if(e.name==="exponential")u=un(r,e.base,a,o);else if(e.name==="linear")u=un(r,1,a,o);else if(e.name==="cubic-bezier"){const d=e.controlPoints;u=new cs(d[0],d[1],d[2],d[3]).solve(un(r,1,a,o))}return u}static parse(e,r){let[a,o,u,...d]=e;if(!Array.isArray(o)||o.length===0)return r.error("Expected an interpolation type expression.",1);if(o[0]==="linear")o={name:"linear"};else if(o[0]==="exponential"){const x=o[1];if(typeof x!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);o={name:"exponential",base:x}}else{if(o[0]!=="cubic-bezier")return r.error(`Unknown interpolation type ${String(o[0])}`,1,0);{const x=o.slice(1);if(x.length!==4||x.some(b=>typeof b!="number"||b<0||b>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);o={name:"cubic-bezier",controlPoints:x}}}if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(u=r.parse(u,2,ge),!u)return null;const f=[];let _=null;a==="interpolate-hcl"||a==="interpolate-lab"?_=ii:r.expectedType&&r.expectedType.kind!=="value"&&(_=r.expectedType);for(let x=0;x<d.length;x+=2){const b=d[x],T=d[x+1],A=x+3,C=x+4;if(typeof b!="number")return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',A);if(f.length&&f[f.length-1][0]>=b)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',A);const P=r.parse(T,C,_);if(!P)return null;_=_||P.type,f.push([b,P])}return se(_,ge)||se(_,ii)||se(_,I)||se(_,k)||se(_,O(ge))?new Si(_,a,o,u,f):r.error(`Type ${N(_)} is not interpolatable.`)}evaluate(e){const r=this.labels,a=this.outputs;if(r.length===1)return a[0].evaluate(e);const o=this.input.evaluate(e);if(o<=r[0])return a[0].evaluate(e);const u=r.length;if(o>=r[u-1])return a[u-1].evaluate(e);const d=vs(r,o),f=Si.interpolationFactor(this.interpolation,o,r[d],r[d+1]),_=a[d].evaluate(e),x=a[d+1].evaluate(e);switch(this.operator){case"interpolate":return wi[this.type.kind](_,x,f);case"interpolate-hcl":return wi.color(_,x,f,"hcl");case"interpolate-lab":return wi.color(_,x,f,"lab")}}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function un(i,e,r,a){const o=a-r,u=i-r;return o===0?0:e===1?u/o:(Math.pow(e,u)-1)/(Math.pow(e,o)-1)}class Aa{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expectected at least one argument.");let a=null;const o=r.expectedType;o&&o.kind!=="value"&&(a=o);const u=[];for(const f of e.slice(1)){const _=r.parse(f,1+u.length,a,void 0,{typeAnnotation:"omit"});if(!_)return null;a=a||_.type,u.push(_)}if(!a)throw new Error("No output type");const d=o&&u.some(f=>Z(o,f.type));return new Aa(d?Ve:a,u)}evaluate(e){let r,a=null,o=0;for(const u of this.args)if(o++,a=u.evaluate(e),a&&a instanceof qt&&!a.available&&(r||(r=a.name),a=null,o===this.args.length&&(a=r)),a!==null)break;return a}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}class Ma{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const a=[];for(let u=1;u<e.length-1;u+=2){const d=e[u];if(typeof d!="string")return r.error(`Expected string, but found ${typeof d} instead.`,u);if(/[^a-zA-Z0-9_]/.test(d))return r.error("Variable names must contain only alphanumeric characters or '_'.",u);const f=r.parse(e[u+1],u+1);if(!f)return null;a.push([d,f])}const o=r.parse(e[e.length-1],e.length-1,r.expectedType,a);return o?new Ma(a,o):null}outputDefined(){return this.result.outputDefined()}}class pn{constructor(e,r,a){this.type=e,this.index=r,this.input=a}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,ge),o=r.parse(e[2],2,O(r.expectedType||Ve));return a&&o?new pn(o.type.itemType,a,o):null}evaluate(e){const r=this.index.evaluate(e),a=this.input.evaluate(e);if(r<0)throw new bt(`Array index out of bounds: ${r} < 0.`);if(r>=a.length)throw new bt(`Array index out of bounds: ${r} > ${a.length-1}.`);if(r!==Math.floor(r))throw new bt(`Array index must be an integer, but found ${r} instead.`);return a[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class dn{constructor(e,r){this.type=Fe,this.needle=e,this.haystack=r}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,Ve),o=r.parse(e[2],2,Ve);return a&&o?j(a.type,[Fe,Ue,ge,pr,Ve])?new dn(a,o):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${N(a.type)} instead`):null}evaluate(e){const r=this.needle.evaluate(e),a=this.haystack.evaluate(e);if(!a)return!1;if(!W(r,["boolean","string","number","null"]))throw new bt(`Expected first argument to be of type boolean, string, number or null, but found ${N(gt(r))} instead.`);if(!W(a,["string","array"]))throw new bt(`Expected second argument to be of type array or string, but found ${N(gt(a))} instead.`);return a.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class Ea{constructor(e,r,a){this.type=ge,this.needle=e,this.haystack=r,this.fromIndex=a}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,Ve),o=r.parse(e[2],2,Ve);if(!a||!o)return null;if(!j(a.type,[Fe,Ue,ge,pr,Ve]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${N(a.type)} instead`);if(e.length===4){const u=r.parse(e[3],3,ge);return u?new Ea(a,o,u):null}return new Ea(a,o)}evaluate(e){const r=this.needle.evaluate(e),a=this.haystack.evaluate(e);if(!W(r,["boolean","string","number","null"]))throw new bt(`Expected first argument to be of type boolean, string, number or null, but found ${N(gt(r))} instead.`);if(!W(a,["string","array"]))throw new bt(`Expected second argument to be of type array or string, but found ${N(gt(a))} instead.`);if(this.fromIndex){const o=this.fromIndex.evaluate(e);return a.indexOf(r,o)}return a.indexOf(r)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class fn{constructor(e,r,a,o,u,d){this.inputType=e,this.type=r,this.input=a,this.cases=o,this.outputs=u,this.otherwise=d}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let a,o;r.expectedType&&r.expectedType.kind!=="value"&&(o=r.expectedType);const u={},d=[];for(let x=2;x<e.length-1;x+=2){let b=e[x];const T=e[x+1];Array.isArray(b)||(b=[b]);const A=r.concat(x);if(b.length===0)return A.error("Expected at least one branch label.");for(const P of b){if(typeof P!="number"&&typeof P!="string")return A.error("Branch labels must be numbers or strings.");if(typeof P=="number"&&Math.abs(P)>Number.MAX_SAFE_INTEGER)return A.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof P=="number"&&Math.floor(P)!==P)return A.error("Numeric branch labels must be integer values.");if(a){if(A.checkSubtype(a,gt(P)))return null}else a=gt(P);if(u[String(P)]!==void 0)return A.error("Branch labels must be unique.");u[String(P)]=d.length}const C=r.parse(T,x,o);if(!C)return null;o=o||C.type,d.push(C)}const f=r.parse(e[1],1,Ve);if(!f)return null;const _=r.parse(e[e.length-1],e.length-1,o);return _?f.type.kind!=="value"&&r.concat(1).checkSubtype(a,f.type)?null:new fn(a,o,f,u,d,_):null}evaluate(e){const r=this.input.evaluate(e);return(gt(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}}class mn{constructor(e,r,a){this.type=e,this.branches=r,this.otherwise=a}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error("Expected an odd number of arguments.");let a;r.expectedType&&r.expectedType.kind!=="value"&&(a=r.expectedType);const o=[];for(let d=1;d<e.length-1;d+=2){const f=r.parse(e[d],d,Fe);if(!f)return null;const _=r.parse(e[d+1],d+1,a);if(!_)return null;o.push([f,_]),a=a||_.type}const u=r.parse(e[e.length-1],e.length-1,a);if(!u)return null;if(!a)throw new Error("Can't infer output type");return new mn(a,o,u)}evaluate(e){for(const[r,a]of this.branches)if(r.evaluate(e))return a.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[r,a]of this.branches)e(r),e(a);e(this.otherwise)}outputDefined(){return this.branches.every(([e,r])=>r.outputDefined())&&this.otherwise.outputDefined()}}class Ca{constructor(e,r,a,o){this.type=e,this.input=r,this.beginIndex=a,this.endIndex=o}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,Ve),o=r.parse(e[2],2,ge);if(!a||!o)return null;if(!j(a.type,[O(Ve),Ue,Ve]))return r.error(`Expected first argument to be of type array or string, but found ${N(a.type)} instead`);if(e.length===4){const u=r.parse(e[3],3,ge);return u?new Ca(a.type,a,o,u):null}return new Ca(a.type,a,o)}evaluate(e){const r=this.input.evaluate(e),a=this.beginIndex.evaluate(e);if(!W(r,["string","array"]))throw new bt(`Expected first argument to be of type array or string, but found ${N(gt(r))} instead.`);if(this.endIndex){const o=this.endIndex.evaluate(e);return r.slice(a,o)}return r.slice(a)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function yo(i,e){return i==="=="||i==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function xo(i,e,r,a){return a.compare(e,r)===0}function bs(i,e,r){const a=i!=="=="&&i!=="!=";return class lu{constructor(u,d,f){this.type=Fe,this.lhs=u,this.rhs=d,this.collator=f,this.hasUntypedArgument=u.type.kind==="value"||d.type.kind==="value"}static parse(u,d){if(u.length!==3&&u.length!==4)return d.error("Expected two or three arguments.");const f=u[0];let _=d.parse(u[1],1,Ve);if(!_)return null;if(!yo(f,_.type))return d.concat(1).error(`"${f}" comparisons are not supported for type '${N(_.type)}'.`);let x=d.parse(u[2],2,Ve);if(!x)return null;if(!yo(f,x.type))return d.concat(2).error(`"${f}" comparisons are not supported for type '${N(x.type)}'.`);if(_.type.kind!==x.type.kind&&_.type.kind!=="value"&&x.type.kind!=="value")return d.error(`Cannot compare types '${N(_.type)}' and '${N(x.type)}'.`);a&&(_.type.kind==="value"&&x.type.kind!=="value"?_=new Ri(x.type,[_]):_.type.kind!=="value"&&x.type.kind==="value"&&(x=new Ri(_.type,[x])));let b=null;if(u.length===4){if(_.type.kind!=="string"&&x.type.kind!=="string"&&_.type.kind!=="value"&&x.type.kind!=="value")return d.error("Cannot use collator to compare non-string types.");if(b=d.parse(u[3],3,dr),!b)return null}return new lu(_,x,b)}evaluate(u){const d=this.lhs.evaluate(u),f=this.rhs.evaluate(u);if(a&&this.hasUntypedArgument){const _=gt(d),x=gt(f);if(_.kind!==x.kind||_.kind!=="string"&&_.kind!=="number")throw new bt(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${_.kind}, ${x.kind}) instead.`)}if(this.collator&&!a&&this.hasUntypedArgument){const _=gt(d),x=gt(f);if(_.kind!=="string"||x.kind!=="string")return e(u,d,f)}return this.collator?r(u,d,f,this.collator.evaluate(u)):e(u,d,f)}eachChild(u){u(this.lhs),u(this.rhs),this.collator&&u(this.collator)}outputDefined(){return!0}}}const Sl=bs("==",function(i,e,r){return e===r},xo),Tl=bs("!=",function(i,e,r){return e!==r},function(i,e,r,a){return!xo(0,e,r,a)}),Il=bs("<",function(i,e,r){return e<r},function(i,e,r,a){return a.compare(e,r)<0}),Al=bs(">",function(i,e,r){return e>r},function(i,e,r,a){return a.compare(e,r)>0}),Ml=bs("<=",function(i,e,r){return e<=r},function(i,e,r,a){return a.compare(e,r)<=0}),El=bs(">=",function(i,e,r){return e>=r},function(i,e,r,a){return a.compare(e,r)>=0});class gn{constructor(e,r,a,o,u){this.type=Ue,this.number=e,this.locale=r,this.currency=a,this.minFractionDigits=o,this.maxFractionDigits=u}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");const a=r.parse(e[1],1,ge);if(!a)return null;const o=e[2];if(typeof o!="object"||Array.isArray(o))return r.error("NumberFormat options argument must be an object.");let u=null;if(o.locale&&(u=r.parse(o.locale,1,Ue),!u))return null;let d=null;if(o.currency&&(d=r.parse(o.currency,1,Ue),!d))return null;let f=null;if(o["min-fraction-digits"]&&(f=r.parse(o["min-fraction-digits"],1,ge),!f))return null;let _=null;return o["max-fraction-digits"]&&(_=r.parse(o["max-fraction-digits"],1,ge),!_)?null:new gn(a,u,d,f,_)}evaluate(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))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Pa{constructor(e){this.type=R,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const a=e[1];if(!Array.isArray(a)&&typeof a=="object")return r.error("First argument must be an image or text section.");const o=[];let u=!1;for(let d=1;d<=e.length-1;++d){const f=e[d];if(u&&typeof f=="object"&&!Array.isArray(f)){u=!1;let _=null;if(f["font-scale"]&&(_=r.parse(f["font-scale"],1,ge),!_))return null;let x=null;if(f["text-font"]&&(x=r.parse(f["text-font"],1,O(Ue)),!x))return null;let b=null;if(f["text-color"]&&(b=r.parse(f["text-color"],1,ii),!b))return null;const T=o[o.length-1];T.scale=_,T.font=x,T.textColor=b}else{const _=r.parse(e[d],1,Ve);if(!_)return null;const x=_.type.kind;if(x!=="string"&&x!=="value"&&x!=="null"&&x!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");u=!0,o.push({content:_,scale:null,font:null,textColor:null})}}return new Pa(o)}evaluate(e){return new Ht(this.sections.map(r=>{const a=r.content.evaluate(e);return gt(a)===M?new ma("",a,null,null,null):new ma(Je(a),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null)}))}eachChild(e){for(const r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor)}outputDefined(){return!1}}class _n{constructor(e){this.type=M,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");const a=r.parse(e[1],1,Ue);return a?new _n(a):r.error("No image name provided.")}evaluate(e){const r=this.input.evaluate(e),a=qt.fromString(r);return a&&e.availableImages&&(a.available=e.availableImages.indexOf(r)>-1),a}eachChild(e){e(this.input)}outputDefined(){return!1}}class yn{constructor(e){this.type=ge,this.input=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);const a=r.parse(e[1],1);return a?a.type.kind!=="array"&&a.type.kind!=="string"&&a.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${N(a.type)} instead.`):new yn(a):null}evaluate(e){const r=this.input.evaluate(e);if(typeof r=="string"||Array.isArray(r))return r.length;throw new bt(`Expected value to be of type string or array, but found ${N(gt(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const ws={"==":Sl,"!=":Tl,">":Al,"<":Il,">=":El,"<=":Ml,array:Ri,at:pn,boolean:Ri,case:mn,coalesce:Aa,collator:xa,format:Pa,image:_n,in:dn,"index-of":Ea,interpolate:Si,"interpolate-hcl":Si,"interpolate-lab":Si,length:yn,let:Ma,literal:Gr,match:fn,number:Ri,"number-format":gn,object:Ri,slice:Ca,step:Dr,string:Ri,"to-boolean":kr,"to-color":kr,"to-number":kr,"to-string":kr,var:ba,within:Xr};function vo(i,[e,r,a,o]){e=e.evaluate(i),r=r.evaluate(i),a=a.evaluate(i);const u=o?o.evaluate(i):1,d=ga(e,r,a,u);if(d)throw new bt(d);return new it(e/255,r/255,a/255,u,!1)}function bo(i,e){return i in e}function xn(i,e){const r=e[i];return r===void 0?null:r}function Wr(i){return{type:i}}function wo(i){return{result:"success",value:i}}function Lr(i){return{result:"error",value:i}}function Ss(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function So(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function vn(i){return!!i.expression&&i.expression.interpolated}function Qe(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function _t(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function Cl(i){return i}function We(i,e){const r=e.type==="color",a=i.stops&&typeof i.stops[0][0]=="object",o=a||!(a||i.property!==void 0),u=i.type||(vn(e)?"exponential":"interval");if(r||e.type==="padding"){const b=r?it.parse:bi.parse;(i=Qi({},i)).stops&&(i.stops=i.stops.map(T=>[T[0],b(T[1])])),i.default=b(i.default?i.default:e.default)}if(i.colorSpace&&(d=i.colorSpace)!=="rgb"&&d!=="hcl"&&d!=="lab")throw new Error(`Unknown color space: "${i.colorSpace}"`);var d;let f,_,x;if(u==="exponential")f=Gs;else if(u==="interval")f=dt;else if(u==="categorical"){f=yt,_=Object.create(null);for(const b of i.stops)_[b[0]]=b[1];x=typeof i.stops[0][0]}else{if(u!=="identity")throw new Error(`Unknown function type "${u}"`);f=To}if(a){const b={},T=[];for(let P=0;P<i.stops.length;P++){const D=i.stops[P],V=D[0].zoom;b[V]===void 0&&(b[V]={zoom:V,type:i.type,property:i.property,default:i.default,stops:[]},T.push(V)),b[V].stops.push([D[0].value,D[1]])}const A=[];for(const P of T)A.push([b[P].zoom,We(b[P],e)]);const C={name:"linear"};return{kind:"composite",interpolationType:C,interpolationFactor:Si.interpolationFactor.bind(void 0,C),zoomStops:A.map(P=>P[0]),evaluate:({zoom:P},D)=>Gs({stops:A,base:i.base},e,P).evaluate(P,D)}}if(o){const b=u==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:b,interpolationFactor:Si.interpolationFactor.bind(void 0,b),zoomStops:i.stops.map(T=>T[0]),evaluate:({zoom:T})=>f(i,e,T,_,x)}}return{kind:"source",evaluate(b,T){const A=T&&T.properties?T.properties[i.property]:void 0;return A===void 0?Hr(i.default,e.default):f(i,e,A,_,x)}}}function Hr(i,e,r){return i!==void 0?i:e!==void 0?e:r!==void 0?r:void 0}function yt(i,e,r,a,o){return Hr(typeof r===o?a[r]:void 0,i.default,e.default)}function dt(i,e,r){if(Qe(r)!=="number")return Hr(i.default,e.default);const a=i.stops.length;if(a===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[a-1][0])return i.stops[a-1][1];const o=vs(i.stops.map(u=>u[0]),r);return i.stops[o][1]}function Gs(i,e,r){const a=i.base!==void 0?i.base:1;if(Qe(r)!=="number")return Hr(i.default,e.default);const o=i.stops.length;if(o===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[o-1][0])return i.stops[o-1][1];const u=vs(i.stops.map(b=>b[0]),r),d=function(b,T,A,C){const P=C-A,D=b-A;return P===0?0:T===1?D/P:(Math.pow(T,D)-1)/(Math.pow(T,P)-1)}(r,a,i.stops[u][0],i.stops[u+1][0]),f=i.stops[u][1],_=i.stops[u+1][1],x=wi[e.type]||Cl;return typeof f.evaluate=="function"?{evaluate(...b){const T=f.evaluate.apply(void 0,b),A=_.evaluate.apply(void 0,b);if(T!==void 0&&A!==void 0)return x(T,A,d,i.colorSpace)}}:x(f,_,d,i.colorSpace)}function To(i,e,r){switch(e.type){case"color":r=it.parse(r);break;case"formatted":r=Ht.fromString(r.toString());break;case"resolvedImage":r=qt.fromString(r.toString());break;case"padding":r=bi.parse(r);break;default:Qe(r)===e.type||e.type==="enum"&&e.values[r]||(r=void 0)}return Hr(r,i.default,e.default)}Fi.register(ws,{error:[{kind:"error"},[Ue],(i,[e])=>{throw new bt(e.evaluate(i))}],typeof:[Ue,[Ve],(i,[e])=>N(gt(e.evaluate(i)))],"to-rgba":[O(ge,4),[ii],(i,[e])=>{const[r,a,o,u]=e.evaluate(i).rgb;return[255*r,255*a,255*o,u]}],rgb:[ii,[ge,ge,ge],vo],rgba:[ii,[ge,ge,ge,ge],vo],has:{type:Fe,overloads:[[[Ue],(i,[e])=>bo(e.evaluate(i),i.properties())],[[Ue,er],(i,[e,r])=>bo(e.evaluate(i),r.evaluate(i))]]},get:{type:Ve,overloads:[[[Ue],(i,[e])=>xn(e.evaluate(i),i.properties())],[[Ue,er],(i,[e,r])=>xn(e.evaluate(i),r.evaluate(i))]]},"feature-state":[Ve,[Ue],(i,[e])=>xn(e.evaluate(i),i.featureState||{})],properties:[er,[],i=>i.properties()],"geometry-type":[Ue,[],i=>i.geometryType()],id:[Ve,[],i=>i.id()],zoom:[ge,[],i=>i.globals.zoom],"heatmap-density":[ge,[],i=>i.globals.heatmapDensity||0],"line-progress":[ge,[],i=>i.globals.lineProgress||0],accumulated:[Ve,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[ge,Wr(ge),(i,e)=>{let r=0;for(const a of e)r+=a.evaluate(i);return r}],"*":[ge,Wr(ge),(i,e)=>{let r=1;for(const a of e)r*=a.evaluate(i);return r}],"-":{type:ge,overloads:[[[ge,ge],(i,[e,r])=>e.evaluate(i)-r.evaluate(i)],[[ge],(i,[e])=>-e.evaluate(i)]]},"/":[ge,[ge,ge],(i,[e,r])=>e.evaluate(i)/r.evaluate(i)],"%":[ge,[ge,ge],(i,[e,r])=>e.evaluate(i)%r.evaluate(i)],ln2:[ge,[],()=>Math.LN2],pi:[ge,[],()=>Math.PI],e:[ge,[],()=>Math.E],"^":[ge,[ge,ge],(i,[e,r])=>Math.pow(e.evaluate(i),r.evaluate(i))],sqrt:[ge,[ge],(i,[e])=>Math.sqrt(e.evaluate(i))],log10:[ge,[ge],(i,[e])=>Math.log(e.evaluate(i))/Math.LN10],ln:[ge,[ge],(i,[e])=>Math.log(e.evaluate(i))],log2:[ge,[ge],(i,[e])=>Math.log(e.evaluate(i))/Math.LN2],sin:[ge,[ge],(i,[e])=>Math.sin(e.evaluate(i))],cos:[ge,[ge],(i,[e])=>Math.cos(e.evaluate(i))],tan:[ge,[ge],(i,[e])=>Math.tan(e.evaluate(i))],asin:[ge,[ge],(i,[e])=>Math.asin(e.evaluate(i))],acos:[ge,[ge],(i,[e])=>Math.acos(e.evaluate(i))],atan:[ge,[ge],(i,[e])=>Math.atan(e.evaluate(i))],min:[ge,Wr(ge),(i,e)=>Math.min(...e.map(r=>r.evaluate(i)))],max:[ge,Wr(ge),(i,e)=>Math.max(...e.map(r=>r.evaluate(i)))],abs:[ge,[ge],(i,[e])=>Math.abs(e.evaluate(i))],round:[ge,[ge],(i,[e])=>{const r=e.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}],floor:[ge,[ge],(i,[e])=>Math.floor(e.evaluate(i))],ceil:[ge,[ge],(i,[e])=>Math.ceil(e.evaluate(i))],"filter-==":[Fe,[Ue,Ve],(i,[e,r])=>i.properties()[e.value]===r.value],"filter-id-==":[Fe,[Ve],(i,[e])=>i.id()===e.value],"filter-type-==":[Fe,[Ue],(i,[e])=>i.geometryType()===e.value],"filter-<":[Fe,[Ue,Ve],(i,[e,r])=>{const a=i.properties()[e.value],o=r.value;return typeof a==typeof o&&a<o}],"filter-id-<":[Fe,[Ve],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r<a}],"filter->":[Fe,[Ue,Ve],(i,[e,r])=>{const a=i.properties()[e.value],o=r.value;return typeof a==typeof o&&a>o}],"filter-id->":[Fe,[Ve],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r>a}],"filter-<=":[Fe,[Ue,Ve],(i,[e,r])=>{const a=i.properties()[e.value],o=r.value;return typeof a==typeof o&&a<=o}],"filter-id-<=":[Fe,[Ve],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r<=a}],"filter->=":[Fe,[Ue,Ve],(i,[e,r])=>{const a=i.properties()[e.value],o=r.value;return typeof a==typeof o&&a>=o}],"filter-id->=":[Fe,[Ve],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r>=a}],"filter-has":[Fe,[Ve],(i,[e])=>e.value in i.properties()],"filter-has-id":[Fe,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[Fe,[O(Ue)],(i,[e])=>e.value.indexOf(i.geometryType())>=0],"filter-id-in":[Fe,[O(Ve)],(i,[e])=>e.value.indexOf(i.id())>=0],"filter-in-small":[Fe,[Ue,O(Ve)],(i,[e,r])=>r.value.indexOf(i.properties()[e.value])>=0],"filter-in-large":[Fe,[Ue,O(Ve)],(i,[e,r])=>function(a,o,u,d){for(;u<=d;){const f=u+d>>1;if(o[f]===a)return!0;o[f]>a?d=f-1:u=f+1}return!1}(i.properties()[e.value],r.value,0,r.value.length-1)],all:{type:Fe,overloads:[[[Fe,Fe],(i,[e,r])=>e.evaluate(i)&&r.evaluate(i)],[Wr(Fe),(i,e)=>{for(const r of e)if(!r.evaluate(i))return!1;return!0}]]},any:{type:Fe,overloads:[[[Fe,Fe],(i,[e,r])=>e.evaluate(i)||r.evaluate(i)],[Wr(Fe),(i,e)=>{for(const r of e)if(r.evaluate(i))return!0;return!1}]]},"!":[Fe,[Fe],(i,[e])=>!e.evaluate(i)],"is-supported-script":[Fe,[Ue],(i,[e])=>{const r=i.globals&&i.globals.isSupportedScript;return!r||r(e.evaluate(i))}],upcase:[Ue,[Ue],(i,[e])=>e.evaluate(i).toUpperCase()],downcase:[Ue,[Ue],(i,[e])=>e.evaluate(i).toLowerCase()],concat:[Ue,Wr(Ve),(i,e)=>e.map(r=>Je(r.evaluate(i))).join("")],"resolved-locale":[Ue,[dr],(i,[e])=>e.evaluate(i).resolvedLocale()]});class bn{constructor(e,r){var a;this.expression=e,this._warningHistory={},this._evaluator=new an,this._defaultValue=r?(a=r).type==="color"&&_t(a.default)?new it(0,0,0,0):a.type==="color"?it.parse(a.default)||null:a.type==="padding"?bi.parse(a.default)||null:a.type==="variableAnchorOffsetCollection"?Bi.parse(a.default)||null:a.default===void 0?null:a.default:null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(e,r,a,o,u,d){return this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=a,this._evaluator.canonical=o,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=d,this.expression.evaluate(this._evaluator)}evaluate(e,r,a,o,u,d){this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=a||null,this._evaluator.canonical=o,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=d||null;try{const f=this.expression.evaluate(this._evaluator);if(f==null||typeof f=="number"&&f!=f)return this._defaultValue;if(this._enumValues&&!(f in this._enumValues))throw new bt(`Expected value to be one of ${Object.keys(this._enumValues).map(_=>JSON.stringify(_)).join(", ")}, but found ${JSON.stringify(f)} instead.`);return f}catch(f){return this._warningHistory[f.message]||(this._warningHistory[f.message]=!0,typeof console<"u"&&console.warn(f.message)),this._defaultValue}}}function ka(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in ws}function za(i,e){const r=new ya(ws,wa,[],e?function(o){const u={color:ii,string:Ue,number:ge,enum:Ue,boolean:Fe,formatted:R,padding:I,resolvedImage:M,variableAnchorOffsetCollection:k};return o.type==="array"?O(u[o.value]||Ve,o.length):u[o.type]}(e):void 0),a=r.parse(i,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?wo(new bn(a,e)):Lr(r.errors)}class wn{constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!Zs(r.expression)}evaluateWithoutErrorHandling(e,r,a,o,u,d){return this._styleExpression.evaluateWithoutErrorHandling(e,r,a,o,u,d)}evaluate(e,r,a,o,u,d){return this._styleExpression.evaluate(e,r,a,o,u,d)}}class Da{constructor(e,r,a,o){this.kind=e,this.zoomStops=a,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!Zs(r.expression),this.interpolationType=o}evaluateWithoutErrorHandling(e,r,a,o,u,d){return this._styleExpression.evaluateWithoutErrorHandling(e,r,a,o,u,d)}evaluate(e,r,a,o,u,d){return this._styleExpression.evaluate(e,r,a,o,u,d)}interpolationFactor(e,r,a){return this.interpolationType?Si.interpolationFactor(this.interpolationType,e,r,a):0}}function Sn(i,e){const r=za(i,e);if(r.result==="error")return r;const a=r.value.expression,o=Sa(a);if(!o&&!Ss(e))return Lr([new vt("","data expressions not supported")]);const u=Ta(a,["zoom"]);if(!u&&!So(e))return Lr([new vt("","zoom expressions not supported")]);const d=Ws(a);return d||u?d instanceof vt?Lr([d]):d instanceof Si&&!vn(e)?Lr([new vt("",'"interpolate" expressions cannot be used with this property')]):wo(d?new Da(o?"camera":"composite",r.value,d.labels,d instanceof Si?d.interpolation:void 0):new wn(o?"constant":"source",r.value)):Lr([new vt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Xs{constructor(e,r){this._parameters=e,this._specification=r,Qi(this,We(this._parameters,this._specification))}static deserialize(e){return new Xs(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Ws(i){let e=null;if(i instanceof Ma)e=Ws(i.result);else if(i instanceof Aa){for(const r of i.args)if(e=Ws(r),e)break}else(i instanceof Dr||i instanceof Si)&&i.input instanceof Fi&&i.input.name==="zoom"&&(e=i);return e instanceof vt||i.eachChild(r=>{const a=Ws(r);a instanceof vt?e=a:!e&&a?e=new vt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&a&&e!==a&&(e=new vt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function Hs(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(const e of i.slice(1))if(!Hs(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const Pl={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Tn(i){if(i==null)return{filter:()=>!0,needGeometry:!1};Hs(i)||(i=La(i));const e=za(i,Pl);if(e.result==="error")throw new Error(e.value.map(r=>`${r.key}: ${r.message}`).join(", "));return{filter:(r,a,o)=>e.value.evaluate(r,a,{},o),needGeometry:Io(i)}}function kl(i,e){return i<e?-1:i>e?1:0}function Io(i){if(!Array.isArray(i))return!1;if(i[0]==="within")return!0;for(let e=1;e<i.length;e++)if(Io(i[e]))return!0;return!1}function La(i){if(!i)return!0;const e=i[0];return i.length<=1?e!=="any":e==="=="?In(i[1],i[2],"=="):e==="!="?Ks(In(i[1],i[2],"==")):e==="<"||e===">"||e==="<="||e===">="?In(i[1],i[2],e):e==="any"?(r=i.slice(1),["any"].concat(r.map(La))):e==="all"?["all"].concat(i.slice(1).map(La)):e==="none"?["all"].concat(i.slice(1).map(La).map(Ks)):e==="in"?Ao(i[1],i.slice(2)):e==="!in"?Ks(Ao(i[1],i.slice(2))):e==="has"?Mo(i[1]):e==="!has"?Ks(Mo(i[1])):e!=="within"||i;var r}function In(i,e,r){switch(i){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,i,e]}}function Ao(i,e){if(e.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?["filter-in-large",i,["literal",e.sort(kl)]]:["filter-in-small",i,["literal",e]]}}function Mo(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function Ks(i){return["!",i]}function Ba(i){const e=typeof i;if(e==="number"||e==="boolean"||e==="string"||i==null)return JSON.stringify(i);if(Array.isArray(i)){let o="[";for(const u of i)o+=`${Ba(u)},`;return`${o}]`}const r=Object.keys(i).sort();let a="{";for(let o=0;o<r.length;o++)a+=`${JSON.stringify(r[o])}:${Ba(i[r[o]])},`;return`${a}}`}function Ra(i){let e="";for(const r of ui)e+=`/${Ba(i[r])}`;return e}function Eo(i){const e=i.value;return e?[new fe(i.key,e,"constants have been deprecated as of v8")]:[]}function wt(i){return i instanceof Number||i instanceof String||i instanceof Boolean?i.valueOf():i}function Kr(i){if(Array.isArray(i))return i.map(Kr);if(i instanceof Object&&!(i instanceof Number||i instanceof String||i instanceof Boolean)){const e={};for(const r in i)e[r]=Kr(i[r]);return e}return wt(i)}function pi(i){const e=i.key,r=i.value,a=i.valueSpec||{},o=i.objectElementValidators||{},u=i.style,d=i.styleSpec,f=i.validateSpec;let _=[];const x=Qe(r);if(x!=="object")return[new fe(e,r,`object expected, ${x} found`)];for(const b in r){const T=b.split(".")[0],A=a[T]||a["*"];let C;if(o[T])C=o[T];else if(a[T])C=f;else if(o["*"])C=o["*"];else{if(!a["*"]){_.push(new fe(e,r[b],`unknown property "${b}"`));continue}C=f}_=_.concat(C({key:(e&&`${e}.`)+b,value:r[b],valueSpec:A,style:u,styleSpec:d,object:r,objectKey:b,validateSpec:f},r))}for(const b in a)o[b]||a[b].required&&a[b].default===void 0&&r[b]===void 0&&_.push(new fe(e,r,`missing required property "${b}"`));return _}function Ts(i){const e=i.value,r=i.valueSpec,a=i.style,o=i.styleSpec,u=i.key,d=i.arrayElementValidator||i.validateSpec;if(Qe(e)!=="array")return[new fe(u,e,`array expected, ${Qe(e)} found`)];if(r.length&&e.length!==r.length)return[new fe(u,e,`array length ${r.length} expected, length ${e.length} found`)];if(r["min-length"]&&e.length<r["min-length"])return[new fe(u,e,`array length at least ${r["min-length"]} expected, length ${e.length} found`)];let f={type:r.value,values:r.values};o.$version<7&&(f.function=r.function),Qe(r.value)==="object"&&(f=r.value);let _=[];for(let x=0;x<e.length;x++)_=_.concat(d({array:e,arrayIndex:x,value:e[x],valueSpec:f,validateSpec:i.validateSpec,style:a,styleSpec:o,key:`${u}[${x}]`}));return _}function Ys(i){const e=i.key,r=i.value,a=i.valueSpec;let o=Qe(r);return o==="number"&&r!=r&&(o="NaN"),o!=="number"?[new fe(e,r,`number expected, ${o} found`)]:"minimum"in a&&r<a.minimum?[new fe(e,r,`${r} is less than the minimum value ${a.minimum}`)]:"maximum"in a&&r>a.maximum?[new fe(e,r,`${r} is greater than the maximum value ${a.maximum}`)]:[]}function Fa(i){const e=i.valueSpec,r=wt(i.value.type);let a,o,u,d={};const f=r!=="categorical"&&i.value.property===void 0,_=!f,x=Qe(i.value.stops)==="array"&&Qe(i.value.stops[0])==="array"&&Qe(i.value.stops[0][0])==="object",b=pi({key:i.key,value:i.value,valueSpec:i.styleSpec.function,validateSpec:i.validateSpec,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(C){if(r==="identity")return[new fe(C.key,C.value,'identity function may not have a "stops" property')];let P=[];const D=C.value;return P=P.concat(Ts({key:C.key,value:D,valueSpec:C.valueSpec,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec,arrayElementValidator:T})),Qe(D)==="array"&&D.length===0&&P.push(new fe(C.key,D,"array must have at least one stop")),P},default:function(C){return C.validateSpec({key:C.key,value:C.value,valueSpec:e,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec})}}});return r==="identity"&&f&&b.push(new fe(i.key,i.value,'missing required property "property"')),r==="identity"||i.value.stops||b.push(new fe(i.key,i.value,'missing required property "stops"')),r==="exponential"&&i.valueSpec.expression&&!vn(i.valueSpec)&&b.push(new fe(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(_&&!Ss(i.valueSpec)?b.push(new fe(i.key,i.value,"property functions not supported")):f&&!So(i.valueSpec)&&b.push(new fe(i.key,i.value,"zoom functions not supported"))),r!=="categorical"&&!x||i.value.property!==void 0||b.push(new fe(i.key,i.value,'"property" property is required')),b;function T(C){let P=[];const D=C.value,V=C.key;if(Qe(D)!=="array")return[new fe(V,D,`array expected, ${Qe(D)} found`)];if(D.length!==2)return[new fe(V,D,`array length 2 expected, length ${D.length} found`)];if(x){if(Qe(D[0])!=="object")return[new fe(V,D,`object expected, ${Qe(D[0])} found`)];if(D[0].zoom===void 0)return[new fe(V,D,"object stop key must have zoom")];if(D[0].value===void 0)return[new fe(V,D,"object stop key must have value")];if(u&&u>wt(D[0].zoom))return[new fe(V,D[0].zoom,"stop zoom values must appear in ascending order")];wt(D[0].zoom)!==u&&(u=wt(D[0].zoom),o=void 0,d={}),P=P.concat(pi({key:`${V}[0]`,value:D[0],valueSpec:{zoom:{}},validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec,objectElementValidators:{zoom:Ys,value:A}}))}else P=P.concat(A({key:`${V}[0]`,value:D[0],valueSpec:{},validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec},D));return ka(Kr(D[1]))?P.concat([new fe(`${V}[1]`,D[1],"expressions are not allowed in function stops.")]):P.concat(C.validateSpec({key:`${V}[1]`,value:D[1],valueSpec:e,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec}))}function A(C,P){const D=Qe(C.value),V=wt(C.value),$=C.value!==null?C.value:P;if(a){if(D!==a)return[new fe(C.key,$,`${D} stop domain type must match previous stop domain type ${a}`)]}else a=D;if(D!=="number"&&D!=="string"&&D!=="boolean")return[new fe(C.key,$,"stop domain value must be a number, string, or boolean")];if(D!=="number"&&r!=="categorical"){let H=`number expected, ${D} found`;return Ss(e)&&r===void 0&&(H+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new fe(C.key,$,H)]}return r!=="categorical"||D!=="number"||isFinite(V)&&Math.floor(V)===V?r!=="categorical"&&D==="number"&&o!==void 0&&V<o?[new fe(C.key,$,"stop domain values must appear in ascending order")]:(o=V,r==="categorical"&&V in d?[new fe(C.key,$,"stop domain values must be unique")]:(d[V]=!0,[])):[new fe(C.key,$,`integer expected, found ${V}`)]}}function Yr(i){const e=(i.expressionContext==="property"?Sn:za)(Kr(i.value),i.valueSpec);if(e.result==="error")return e.value.map(a=>new fe(`${i.key}${a.key}`,i.value,a.message));const r=e.value.expression||e.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!r.outputDefined())return[new fe(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!Zs(r))return[new fe(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!Zs(r))return[new fe(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!Ta(r,["zoom","feature-state"]))return[new fe(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!Sa(r))return[new fe(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Js(i){const e=i.key,r=i.value,a=i.valueSpec,o=[];return Array.isArray(a.values)?a.values.indexOf(wt(r))===-1&&o.push(new fe(e,r,`expected one of [${a.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(a.values).indexOf(wt(r))===-1&&o.push(new fe(e,r,`expected one of [${Object.keys(a.values).join(", ")}], ${JSON.stringify(r)} found`)),o}function Is(i){return Hs(Kr(i.value))?Yr(Qi({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Co(i)}function Co(i){const e=i.value,r=i.key;if(Qe(e)!=="array")return[new fe(r,e,`array expected, ${Qe(e)} found`)];const a=i.styleSpec;let o,u=[];if(e.length<1)return[new fe(r,e,"filter array must have at least 1 element")];switch(u=u.concat(Js({key:`${r}[0]`,value:e[0],valueSpec:a.filter_operator,style:i.style,styleSpec:i.styleSpec})),wt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&wt(e[1])==="$type"&&u.push(new fe(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&u.push(new fe(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(o=Qe(e[1]),o!=="string"&&u.push(new fe(`${r}[1]`,e[1],`string expected, ${o} found`)));for(let d=2;d<e.length;d++)o=Qe(e[d]),wt(e[1])==="$type"?u=u.concat(Js({key:`${r}[${d}]`,value:e[d],valueSpec:a.geometry_type,style:i.style,styleSpec:i.styleSpec})):o!=="string"&&o!=="number"&&o!=="boolean"&&u.push(new fe(`${r}[${d}]`,e[d],`string, number, or boolean expected, ${o} found`));break;case"any":case"all":case"none":for(let d=1;d<e.length;d++)u=u.concat(Co({key:`${r}[${d}]`,value:e[d],style:i.style,styleSpec:i.styleSpec}));break;case"has":case"!has":o=Qe(e[1]),e.length!==2?u.push(new fe(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):o!=="string"&&u.push(new fe(`${r}[1]`,e[1],`string expected, ${o} found`));break;case"within":o=Qe(e[1]),e.length!==2?u.push(new fe(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):o!=="object"&&u.push(new fe(`${r}[1]`,e[1],`object expected, ${o} found`))}return u}function Po(i,e){const r=i.key,a=i.validateSpec,o=i.style,u=i.styleSpec,d=i.value,f=i.objectKey,_=u[`${e}_${i.layerType}`];if(!_)return[];const x=f.match(/^(.*)-transition$/);if(e==="paint"&&x&&_[x[1]]&&_[x[1]].transition)return a({key:r,value:d,valueSpec:u.transition,style:o,styleSpec:u});const b=i.valueSpec||_[f];if(!b)return[new fe(r,d,`unknown property "${f}"`)];let T;if(Qe(d)==="string"&&Ss(b)&&!b.tokens&&(T=/^{([^}]+)}$/.exec(d)))return[new fe(r,d,`"${f}" does not support interpolation syntax
1
+ "use strict";const nu=require("./index.cjs56.js"),ou=require("./index.cjs60.js");(function(cu,od){(function(en,tn){cu.exports=tn()})(nu.commonjsGlobal,function(){var en,tn,_l;function yl(c,Wi){if(!en)en=Wi;else if(!tn)tn=Wi;else{var ie="var sharedChunk = {}; ("+en+")(sharedChunk); ("+tn+")(sharedChunk);",Hi={};en(Hi),_l=Wi(Hi),typeof window<"u"&&(_l.workerUrl=window.URL.createObjectURL(new Blob([ie],{type:"text/javascript"})))}}yl(["exports"],function(c){function Wi(i,e,r,a){return new(r||(r=Promise))(function(o,u){function d(x){try{_(a.next(x))}catch(b){u(b)}}function f(x){try{_(a.throw(x))}catch(b){u(b)}}function _(x){var b;x.done?o(x.value):(b=x.value,b instanceof r?b:new r(function(T){T(b)})).then(d,f)}_((a=a.apply(i,e||[])).next())})}function ie(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}typeof SuppressedError=="function"&&SuppressedError;var Hi=ci;function ci(i,e){this.x=i,this.y=e}ci.prototype={clone:function(){return new ci(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,e){return this.clone()._rotateAround(i,e)},matMult:function(i){return this.clone()._matMult(i)},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(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var e=i.x-this.x,r=i.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,e){return Math.atan2(this.x*e-this.y*i,this.x*i+this.y*e)},_matMult:function(i){var e=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=e,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var e=Math.cos(i),r=Math.sin(i),a=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=a,this},_rotateAround:function(i,e){var r=Math.cos(i),a=Math.sin(i),o=e.y+a*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-a*(this.y-e.y),this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},ci.convert=function(i){return i instanceof ci?i:Array.isArray(i)?new ci(i[0],i[1]):i};var Be=ie(Hi),ls=Fs;function Fs(i,e,r,a){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(a-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=e,this.p2x=r,this.p2y=a}Fs.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,e){if(e===void 0&&(e=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,a=0;a<8;a++){var o=this.sampleCurveX(r)-i;if(Math.abs(o)<e)return r;var u=this.sampleCurveDerivativeX(r);if(Math.abs(u)<1e-6)break;r-=o/u}var d=0,f=1;for(r=i,a=0;a<20&&(o=this.sampleCurveX(r),!(Math.abs(o-i)<e));a++)i>o?d=r:f=r,r=.5*(f-d)+d;return r},solve:function(i,e){return this.sampleCurveY(this.solveCurveX(i,e))}};var cs=ie(ls);let ei,Pt;function ua(){return ei==null&&(ei=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),ei}function Tr(){if(Pt==null&&(Pt=!1,ua())){const e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let a=0;a<5*5;a++){const o=4*a;e.fillStyle=`rgb(${o},${o+1},${o+2})`,e.fillRect(a%5,Math.floor(a/5),1,1)}const r=e.getImageData(0,0,5,5).data;for(let a=0;a<5*5*4;a++)if(a%4!=3&&r[a]!==a){Pt=!0;break}}}return Pt||!1}function Os(i,e,r,a){const o=new cs(i,e,r,a);return function(u){return o.solve(u)}}const hs=Os(.25,.1,.25,1);function Ki(i,e,r){return Math.min(r,Math.max(e,i))}function Vs(i,e,r){const a=r-e,o=((i-e)%a+a)%a+e;return o===e?r:o}function $t(i,...e){for(const r of e)for(const a in r)i[a]=r[a];return i}let pa=1;function mt(i,e,r){const a={};for(const o in i)a[o]=e.call(r||this,i[o],o,i);return a}function us(i,e,r){const a={};for(const o in i)e.call(r||this,i[o],o,i)&&(a[o]=i[o]);return a}function $i(i){return Array.isArray(i)?i.map($i):typeof i=="object"&&i?mt(i,$i):i}const Ir={};function ti(i){Ir[i]||(typeof console<"u"&&console.warn(i),Ir[i]=!0)}function vi(i,e,r){return(r.y-i.y)*(e.x-i.x)>(e.y-i.y)*(r.x-i.x)}function cr(i){let e=0;for(let r,a,o=0,u=i.length,d=u-1;o<u;d=o++)r=i[o],a=i[d],e+=(a.x-r.x)*(r.y+a.y);return e}function ki(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}let Nr=null;function Ns(i){return typeof ImageBitmap<"u"&&i instanceof ImageBitmap}const da="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Us(i,e,r,a,o){return Wi(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const u=new VideoFrame(i,{timestamp:0});try{const d=u==null?void 0:u.format;if(!d||!d.startsWith("BGR")&&!d.startsWith("RGB"))throw new Error(`Unrecognized format ${d}`);const f=d.startsWith("BGR"),_=new Uint8ClampedArray(a*o*4);if(yield u.copyTo(_,function(x,b,T,A,C){const P=4*Math.max(-b,0),D=(Math.max(0,T)-T)*A*4+P,V=4*A,$=Math.max(0,b),H=Math.max(0,T);return{rect:{x:$,y:H,width:Math.min(x.width,b+A)-$,height:Math.min(x.height,T+C)-H},layout:[{offset:D,stride:V}]}}(i,e,r,a,o)),f)for(let x=0;x<_.length;x+=4){const b=_[x];_[x]=_[x+2],_[x+2]=b}return _}finally{u.close()}})}let Yi,ct,hi,Ur;const ps={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(i){const e=requestAnimationFrame(i);return{cancel:()=>cancelAnimationFrame(e)}},getImageData(i,e=0){return this.getImageCanvasContext(i).getImageData(-e,-e,i.width+2*e,i.height+2*e)},getImageCanvasContext(i){const e=window.document.createElement("canvas"),r=e.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("failed to create canvas 2d context");return e.width=i.width,e.height=i.height,r.drawImage(i,0,0,i.width,i.height),r},resolveURL:i=>(hi||(hi=document.createElement("a")),hi.href=i,hi.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(Ur==null&&(Ur=matchMedia("(prefers-reduced-motion: reduce)")),Ur.matches)}},ds={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};class Ar extends Error{constructor(e,r,a,o){super(`AJAXError: ${r} (${e}): ${a}`),this.status=e,this.statusText=r,this.url=a,this.body=o}}const ji=ki()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href,zi=i=>ds.REGISTERED_PROTOCOLS[i.substring(0,i.indexOf("://"))];function $s(i,e){const r=new AbortController,a=new Request(i.url,{method:i.method||"GET",body:i.body,credentials:i.credentials,headers:i.headers,cache:i.cache,referrer:ji(),signal:r.signal});let o=!1,u=!1;return i.type==="json"&&a.headers.set("Accept","application/json"),u||fetch(a).then(d=>d.ok?(f=>{(i.type==="arrayBuffer"||i.type==="image"?f.arrayBuffer():i.type==="json"?f.json():f.text()).then(_=>{u||(o=!0,e(null,_,f.headers.get("Cache-Control"),f.headers.get("Expires")))}).catch(_=>{u||e(new Error(_.message))})})(d):d.blob().then(f=>e(new Ar(d.status,d.statusText,i.url,f)))).catch(d=>{d.code!==20&&e(new Error(d.message))}),{cancel:()=>{u=!0,o||r.abort()}}}const Mr=function(i,e){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){if(ki()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e);if(!ki())return(zi(i.url)||$s)(i,e)}if(!(/^file:/.test(r=i.url)||/^file:/.test(ji())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return $s(i,e);if(ki()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e,void 0,!0)}var r;return function(a,o){const u=new XMLHttpRequest;u.open(a.method||"GET",a.url,!0),a.type!=="arrayBuffer"&&a.type!=="image"||(u.responseType="arraybuffer");for(const d in a.headers)u.setRequestHeader(d,a.headers[d]);return a.type==="json"&&(u.responseType="text",u.setRequestHeader("Accept","application/json")),u.withCredentials=a.credentials==="include",u.onerror=()=>{o(new Error(u.statusText))},u.onload=()=>{if((u.status>=200&&u.status<300||u.status===0)&&u.response!==null){let d=u.response;if(a.type==="json")try{d=JSON.parse(u.response)}catch(f){return o(f)}o(null,d,u.getResponseHeader("Cache-Control"),u.getResponseHeader("Expires"))}else{const d=new Blob([u.response],{type:u.getResponseHeader("Content-Type")});o(new Ar(u.status,u.statusText,a.url,d))}},u.send(a.body),{cancel:()=>u.abort()}}(i,e)},js=function(i,e){return Mr($t(i,{type:"arrayBuffer"}),e)};function hr(i){if(!i||i.indexOf("://")<=0||i.indexOf("data:image/")===0||i.indexOf("blob:")===0)return!0;const e=new URL(i),r=window.location;return e.protocol===r.protocol&&e.host===r.host}function fs(i,e,r){r[i]&&r[i].indexOf(e)!==-1||(r[i]=r[i]||[],r[i].push(e))}function $r(i,e,r){if(r&&r[i]){const a=r[i].indexOf(e);a!==-1&&r[i].splice(a,1)}}class Er{constructor(e,r={}){$t(this,r),this.type=e}}class Cr extends Er{constructor(e,r={}){super("error",$t({error:e},r))}}class jr{on(e,r){return this._listeners=this._listeners||{},fs(e,r,this._listeners),this}off(e,r){return $r(e,r,this._listeners),$r(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},fs(e,r,this._oneTimeListeners),this):new Promise(a=>this.once(e,a))}fire(e,r){typeof e=="string"&&(e=new Er(e,r||{}));const a=e.type;if(this.listens(a)){e.target=this;const o=this._listeners&&this._listeners[a]?this._listeners[a].slice():[];for(const f of o)f.call(this,e);const u=this._oneTimeListeners&&this._oneTimeListeners[a]?this._oneTimeListeners[a].slice():[];for(const f of u)$r(a,f,this._oneTimeListeners),f.call(this,e);const d=this._eventedParent;d&&($t(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),d.fire(e))}else e instanceof Cr&&console.error(e.error);return this}listens(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)}setEventedParent(e,r){return this._eventedParent=e,this._eventedParentData=r,this}}var re={$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"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},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:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,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",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},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:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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:{},"viewport-glyph":{},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-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},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}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},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"}}};const ui=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Di(i,e){const r={};for(const a in i)a!=="ref"&&(r[a]=i[a]);return ui.forEach(a=>{a in e&&(r[a]=e[a])}),r}function nt(i,e){if(Array.isArray(i)){if(!Array.isArray(e)||i.length!==e.length)return!1;for(let r=0;r<i.length;r++)if(!nt(i[r],e[r]))return!1;return!0}if(typeof i=="object"&&i!==null&&e!==null){if(typeof e!="object"||Object.keys(i).length!==Object.keys(e).length)return!1;for(const r in i)if(!nt(i[r],e[r]))return!1;return!0}return i===e}const Ye={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 Ji(i,e,r){r.push({command:Ye.addSource,args:[i,e[i]]})}function ms(i,e,r){e.push({command:Ye.removeSource,args:[i]}),r[i]=!0}function ur(i,e,r,a){ms(i,r,a),Ji(i,e,r)}function fa(i,e,r){let a;for(a in i[r])if(Object.prototype.hasOwnProperty.call(i[r],a)&&a!=="data"&&!nt(i[r][a],e[r][a]))return!1;for(a in e[r])if(Object.prototype.hasOwnProperty.call(e[r],a)&&a!=="data"&&!nt(i[r][a],e[r][a]))return!1;return!0}function gs(i,e,r,a,o,u){let d;for(d in e=e||{},i=i||{})Object.prototype.hasOwnProperty.call(i,d)&&(nt(i[d],e[d])||r.push({command:u,args:[a,d,e[d],o]}));for(d in e)Object.prototype.hasOwnProperty.call(e,d)&&!Object.prototype.hasOwnProperty.call(i,d)&&(nt(i[d],e[d])||r.push({command:u,args:[a,d,e[d],o]}))}function Pr(i){return i.id}function qr(i,e){return i[e.id]=e,i}class fe{constructor(e,r,a,o){this.message=(e?`${e}: `:"")+a,o&&(this.identifier=o),r!=null&&r.__line__&&(this.line=r.__line__)}}function Qi(i,...e){for(const r of e)for(const a in r)i[a]=r[a];return i}class vt extends Error{constructor(e,r){super(r),this.message=r,this.key=e}}class Zr{constructor(e,r=[]){this.parent=e,this.bindings={};for(const[a,o]of r)this.bindings[a]=o}concat(e){return new Zr(this,e)}get(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.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const pr={kind:"null"},ge={kind:"number"},Ue={kind:"string"},Fe={kind:"boolean"},ii={kind:"color"},er={kind:"object"},Ve={kind:"value"},dr={kind:"collator"},R={kind:"formatted"},I={kind:"padding"},M={kind:"resolvedImage"},k={kind:"variableAnchorOffsetCollection"};function O(i,e){return{kind:"array",itemType:i,N:e}}function N(i){if(i.kind==="array"){const e=N(i.itemType);return typeof i.N=="number"?`array<${e}, ${i.N}>`:i.itemType.kind==="value"?"array":`array<${e}>`}return i.kind}const K=[pr,ge,Ue,Fe,ii,R,er,O(Ve),I,M,k];function Z(i,e){if(e.kind==="error")return null;if(i.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!Z(i.itemType,e.itemType))&&(typeof i.N!="number"||i.N===e.N))return null}else{if(i.kind===e.kind)return null;if(i.kind==="value"){for(const r of K)if(!Z(r,e))return null}}return`Expected ${N(i)} but found ${N(e)} instead.`}function j(i,e){return e.some(r=>r.kind===i.kind)}function W(i,e){return e.some(r=>r==="null"?i===null:r==="array"?Array.isArray(i):r==="object"?i&&!Array.isArray(i)&&typeof i=="object":r===typeof i)}function se(i,e){return i.kind==="array"&&e.kind==="array"?i.itemType.kind===e.itemType.kind&&typeof i.N=="number":i.kind===e.kind}const ae=.96422,le=.82521,Pe=4/29,Re=6/29,Te=3*Re*Re,ze=Re*Re*Re,Oe=Math.PI/180,tt=180/Math.PI;function st(i){return(i%=360)<0&&(i+=360),i}function Ke([i,e,r,a]){let o,u;const d=Wt((.2225045*(i=He(i))+.7168786*(e=He(e))+.0606169*(r=He(r)))/1);i===e&&e===r?o=u=d:(o=Wt((.4360747*i+.3850649*e+.1430804*r)/ae),u=Wt((.0139322*i+.0971045*e+.7141733*r)/le));const f=116*d-16;return[f<0?0:f,500*(o-d),200*(d-u),a]}function He(i){return i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function Wt(i){return i>ze?Math.pow(i,1/3):i/Te+Pe}function ot([i,e,r,a]){let o=(i+16)/116,u=isNaN(e)?o:o+e/500,d=isNaN(r)?o:o-r/200;return o=1*jt(o),u=ae*jt(u),d=le*jt(d),[kt(3.1338561*u-1.6168667*o-.4906146*d),kt(-.9787684*u+1.9161415*o+.033454*d),kt(.0719453*u-.2289914*o+1.4052427*d),a]}function kt(i){return(i=i<=.00304?12.92*i:1.055*Math.pow(i,1/2.4)-.055)<0?0:i>1?1:i}function jt(i){return i>Re?i*i*i:Te*(i-Pe)}function Li(i){return parseInt(i.padEnd(2,i),16)/255}function co(i,e){return _s(e?i/100:i,0,1)}function _s(i,e,r){return Math.min(Math.max(e,i),r)}function ys(i){return!i.some(Number.isNaN)}const xl={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class it{constructor(e,r,a,o=1,u=!0){this.r=e,this.g=r,this.b=a,this.a=o,u||(this.r*=o,this.g*=o,this.b*=o,o||this.overwriteGetter("rgb",[e,r,a,o]))}static parse(e){if(e instanceof it)return e;if(typeof e!="string")return;const r=function(a){if((a=a.toLowerCase().trim())==="transparent")return[0,0,0,0];const o=xl[a];if(o){const[d,f,_]=o;return[d/255,f/255,_/255,1]}if(a.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(a)){const d=a.length<6?1:2;let f=1;return[Li(a.slice(f,f+=d)),Li(a.slice(f,f+=d)),Li(a.slice(f,f+=d)),Li(a.slice(f,f+d)||"ff")]}if(a.startsWith("rgb")){const d=a.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(d){const[f,_,x,b,T,A,C,P,D,V,$,H]=d,q=[b||" ",C||" ",V].join("");if(q===" "||q===" /"||q===",,"||q===",,,"){const Y=[x,A,D].join(""),Q=Y==="%%%"?100:Y===""?255:0;if(Q){const oe=[_s(+_/Q,0,1),_s(+T/Q,0,1),_s(+P/Q,0,1),$?co(+$,H):1];if(ys(oe))return oe}}return}}const u=a.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(u){const[d,f,_,x,b,T,A,C,P]=u,D=[_||" ",b||" ",A].join("");if(D===" "||D===" /"||D===",,"||D===",,,"){const V=[+f,_s(+x,0,100),_s(+T,0,100),C?co(+C,P):1];if(ys(V))return function([$,H,q,Y]){function Q(oe){const be=(oe+$/30)%12,Ae=H*Math.min(q,1-q);return q-Ae*Math.max(-1,Math.min(be-3,9-be,1))}return $=st($),H/=100,q/=100,[Q(0),Q(8),Q(4),Y]}(V)}}}(e);return r?new it(...r,!1):void 0}get rgb(){const{r:e,g:r,b:a,a:o}=this,u=o||1/0;return this.overwriteGetter("rgb",[e/u,r/u,a/u,o])}get hcl(){return this.overwriteGetter("hcl",function(e){const[r,a,o,u]=Ke(e),d=Math.sqrt(a*a+o*o);return[Math.round(1e4*d)?st(Math.atan2(o,a)*tt):NaN,d,r,u]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Ke(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){const[e,r,a,o]=this.rgb;return`rgba(${[e,r,a].map(u=>Math.round(255*u)).join(",")},${o})`}}it.black=new it(0,0,0,1),it.white=new it(1,1,1,1),it.transparent=new it(0,0,0,0),it.red=new it(1,0,0,1);class rn{constructor(e,r,a){this.sensitivity=e?r?"variant":"case":r?"accent":"base",this.locale=a,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,r){return this.collator.compare(e,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class ma{constructor(e,r,a,o,u){this.text=e,this.image=r,this.scale=a,this.fontStack=o,this.textColor=u}}class Ht{constructor(e){this.sections=e}static fromString(e){return new Ht([new ma(e,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof Ht?e:Ht.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}}class bi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof bi)return e;if(typeof e=="number")return new bi([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const r of e)if(typeof r!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new bi(e)}}toString(){return JSON.stringify(this.values)}}const vl=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Bi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Bi)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let r=0;r<e.length;r+=2){const a=e[r],o=e[r+1];if(typeof a!="string"||!vl.has(a)||!Array.isArray(o)||o.length!==2||typeof o[0]!="number"||typeof o[1]!="number")return}return new Bi(e)}}toString(){return JSON.stringify(this.values)}}class qt{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new qt({name:e,available:!1}):null}}function ga(i,e,r,a){return typeof i=="number"&&i>=0&&i<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:`Invalid rgba value [${[i,e,r,a].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof a=="number"?[i,e,r,a]:[i,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function xs(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof it||i instanceof rn||i instanceof Ht||i instanceof bi||i instanceof Bi||i instanceof qt)return!0;if(Array.isArray(i)){for(const e of i)if(!xs(e))return!1;return!0}if(typeof i=="object"){for(const e in i)if(!xs(i[e]))return!1;return!0}return!1}function gt(i){if(i===null)return pr;if(typeof i=="string")return Ue;if(typeof i=="boolean")return Fe;if(typeof i=="number")return ge;if(i instanceof it)return ii;if(i instanceof rn)return dr;if(i instanceof Ht)return R;if(i instanceof bi)return I;if(i instanceof Bi)return k;if(i instanceof qt)return M;if(Array.isArray(i)){const e=i.length;let r;for(const a of i){const o=gt(a);if(r){if(r===o)continue;r=Ve;break}r=o}return O(r||Ve,e)}return er}function Je(i){const e=typeof i;return i===null?"":e==="string"||e==="number"||e==="boolean"?String(i):i instanceof it||i instanceof Ht||i instanceof bi||i instanceof Bi||i instanceof qt?i.toString():JSON.stringify(i)}class Gr{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!xs(e[1]))return r.error("invalid value");const a=e[1];let o=gt(a);const u=r.expectedType;return o.kind!=="array"||o.N!==0||!u||u.kind!=="array"||typeof u.N=="number"&&u.N!==0||(o=u),new Gr(o,a)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class bt{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const _a={string:Ue,number:ge,boolean:Fe,object:er};class Ri{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let a,o=1;const u=e[0];if(u==="array"){let f,_;if(e.length>2){const x=e[1];if(typeof x!="string"||!(x in _a)||x==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);f=_a[x],o++}else f=Ve;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);_=e[2],o++}a=O(f,_)}else{if(!_a[u])throw new Error(`Types doesn't contain name = ${u}`);a=_a[u]}const d=[];for(;o<e.length;o++){const f=r.parse(e[o],o,Ve);if(!f)return null;d.push(f)}return new Ri(a,d)}evaluate(e){for(let r=0;r<this.args.length;r++){const a=this.args[r].evaluate(e);if(!Z(this.type,gt(a)))return a;if(r===this.args.length-1)throw new bt(`Expected value to be of type ${N(this.type)}, but found ${N(gt(a))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const sn={"to-boolean":Fe,"to-color":ii,"to-number":ge,"to-string":Ue};class kr{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const a=e[0];if(!sn[a])throw new Error(`Can't parse ${a} as it is not part of the known types`);if((a==="to-boolean"||a==="to-string")&&e.length!==2)return r.error("Expected one argument.");const o=sn[a],u=[];for(let d=1;d<e.length;d++){const f=r.parse(e[d],d,Ve);if(!f)return null;u.push(f)}return new kr(o,u)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let r,a;for(const o of this.args){if(r=o.evaluate(e),a=null,r instanceof it)return r;if(typeof r=="string"){const u=e.parseColor(r);if(u)return u}else if(Array.isArray(r)&&(a=r.length<3||r.length>4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:ga(r[0],r[1],r[2],r[3]),!a))return new it(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new bt(a||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"padding":{let r;for(const a of this.args){r=a.evaluate(e);const o=bi.parse(r);if(o)return o}throw new bt(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"variableAnchorOffsetCollection":{let r;for(const a of this.args){r=a.evaluate(e);const o=Bi.parse(r);if(o)return o}throw new bt(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"number":{let r=null;for(const a of this.args){if(r=a.evaluate(e),r===null)return 0;const o=Number(r);if(!isNaN(o))return o}throw new bt(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return Ht.fromString(Je(this.args[0].evaluate(e)));case"resolvedImage":return qt.fromString(Je(this.args[0].evaluate(e)));default:return Je(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const ho=["Unknown","Point","LineString","Polygon"];class an{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?ho[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let r=this._parseColorCache[e];return r||(r=this._parseColorCache[e]=it.parse(e)),r}}class ya{constructor(e,r,a=[],o,u=new Zr,d=[]){this.registry=e,this.path=a,this.key=a.map(f=>`[${f}]`).join(""),this.scope=u,this.errors=d,this.expectedType=o,this._isConstant=r}parse(e,r,a,o,u={}){return r?this.concat(r,a,o)._parse(e,u):this._parse(e,u)}_parse(e,r){function a(o,u,d){return d==="assert"?new Ri(u,[o]):d==="coerce"?new kr(u,[o]):o}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", []].');const 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;const u=this.registry[o];if(u){let d=u.parse(e,this);if(!d)return null;if(this.expectedType){const f=this.expectedType,_=d.type;if(f.kind!=="string"&&f.kind!=="number"&&f.kind!=="boolean"&&f.kind!=="object"&&f.kind!=="array"||_.kind!=="value")if(f.kind!=="color"&&f.kind!=="formatted"&&f.kind!=="resolvedImage"||_.kind!=="value"&&_.kind!=="string")if(f.kind!=="padding"||_.kind!=="value"&&_.kind!=="number"&&_.kind!=="array")if(f.kind!=="variableAnchorOffsetCollection"||_.kind!=="value"&&_.kind!=="array"){if(this.checkSubtype(f,_))return null}else d=a(d,f,r.typeAnnotation||"coerce");else d=a(d,f,r.typeAnnotation||"coerce");else d=a(d,f,r.typeAnnotation||"coerce");else d=a(d,f,r.typeAnnotation||"assert")}if(!(d instanceof Gr)&&d.type.kind!=="resolvedImage"&&this._isConstant(d)){const f=new an;try{d=new Gr(d.type,d.evaluate(f))}catch(_){return this.error(_.message),null}}return d}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.`)}concat(e,r,a){const o=typeof e=="number"?this.path.concat(e):this.path,u=a?this.scope.concat(a):this.scope;return new ya(this.registry,this._isConstant,o,r||null,u,this.errors)}error(e,...r){const a=`${this.key}${r.map(o=>`[${o}]`).join("")}`;this.errors.push(new vt(a,e))}checkSubtype(e,r){const a=Z(e,r);return a&&this.error(a),a}}class xa{constructor(e,r,a){this.type=dr,this.locale=a,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");const a=e[1];if(typeof a!="object"||Array.isArray(a))return r.error("Collator options argument must be an object.");const o=r.parse(a["case-sensitive"]!==void 0&&a["case-sensitive"],1,Fe);if(!o)return null;const u=r.parse(a["diacritic-sensitive"]!==void 0&&a["diacritic-sensitive"],1,Fe);if(!u)return null;let d=null;return a.locale&&(d=r.parse(a.locale,1,Ue),!d)?null:new xa(o,u,d)}evaluate(e){return new rn(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}const zr=8192;function nn(i,e){i[0]=Math.min(i[0],e[0]),i[1]=Math.min(i[1],e[1]),i[2]=Math.max(i[2],e[0]),i[3]=Math.max(i[3],e[1])}function qs(i,e){return!(i[0]<=e[0]||i[2]>=e[2]||i[1]<=e[1]||i[3]>=e[3])}function uo(i,e){const r=(180+i[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,o=Math.pow(2,e.z);return[Math.round(r*o*zr),Math.round(a*o*zr)]}function bl(i,e,r){const a=i[0]-e[0],o=i[1]-e[1],u=i[0]-r[0],d=i[1]-r[1];return a*d-u*o==0&&a*u<=0&&o*d<=0}function on(i,e){let r=!1;for(let d=0,f=e.length;d<f;d++){const _=e[d];for(let x=0,b=_.length;x<b-1;x++){if(bl(i,_[x],_[x+1]))return!1;(o=_[x])[1]>(a=i)[1]!=(u=_[x+1])[1]>a[1]&&a[0]<(u[0]-o[0])*(a[1]-o[1])/(u[1]-o[1])+o[0]&&(r=!r)}}var a,o,u;return r}function ln(i,e){for(let r=0;r<e.length;r++)if(on(i,e[r]))return!0;return!1}function po(i,e,r,a){const o=a[0]-r[0],u=a[1]-r[1],d=(i[0]-r[0])*u-o*(i[1]-r[1]),f=(e[0]-r[0])*u-o*(e[1]-r[1]);return d>0&&f<0||d<0&&f>0}function wl(i,e,r){for(const x of r)for(let b=0;b<x.length-1;++b)if((f=[(d=x[b+1])[0]-(u=x[b])[0],d[1]-u[1]])[0]*(_=[(o=e)[0]-(a=i)[0],o[1]-a[1]])[1]-f[1]*_[0]!=0&&po(a,o,u,d)&&po(u,d,a,o))return!0;var a,o,u,d,f,_;return!1}function fo(i,e){for(let r=0;r<i.length;++r)if(!on(i[r],e))return!1;for(let r=0;r<i.length-1;++r)if(wl(i[r],i[r+1],e))return!1;return!0}function mo(i,e){for(let r=0;r<e.length;r++)if(fo(i,e[r]))return!0;return!1}function va(i,e,r){const a=[];for(let o=0;o<i.length;o++){const u=[];for(let d=0;d<i[o].length;d++){const f=uo(i[o][d],r);nn(e,f),u.push(f)}a.push(u)}return a}function go(i,e,r){const a=[];for(let o=0;o<i.length;o++){const u=va(i[o],e,r);a.push(u)}return a}function _o(i,e,r,a){if(i[0]<r[0]||i[0]>r[2]){const o=.5*a;let u=i[0]-r[0]>o?-a:r[0]-i[0]>o?a:0;u===0&&(u=i[0]-r[2]>o?-a:r[2]-i[0]>o?a:0),i[0]+=u}nn(e,i)}function cn(i,e,r,a){const o=Math.pow(2,a.z)*zr,u=[a.x*zr,a.y*zr],d=[];for(const f of i)for(const _ of f){const x=[_.x+u[0],_.y+u[1]];_o(x,e,r,o),d.push(x)}return d}function hn(i,e,r,a){const o=Math.pow(2,a.z)*zr,u=[a.x*zr,a.y*zr],d=[];for(const _ of i){const x=[];for(const b of _){const T=[b.x+u[0],b.y+u[1]];nn(e,T),x.push(T)}d.push(x)}if(e[2]-e[0]<=o/2){(f=e)[0]=f[1]=1/0,f[2]=f[3]=-1/0;for(const _ of d)for(const x of _)_o(x,e,r,o)}var f;return d}class Xr{constructor(e,r){this.type=Fe,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(xs(e[1])){const a=e[1];if(a.type==="FeatureCollection")for(let o=0;o<a.features.length;++o){const u=a.features[o].geometry.type;if(u==="Polygon"||u==="MultiPolygon")return new Xr(a,a.features[o].geometry)}else if(a.type==="Feature"){const o=a.geometry.type;if(o==="Polygon"||o==="MultiPolygon")return new Xr(a,a.geometry)}else if(a.type==="Polygon"||a.type==="MultiPolygon")return new Xr(a,a)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return function(r,a){const o=[1/0,1/0,-1/0,-1/0],u=[1/0,1/0,-1/0,-1/0],d=r.canonicalID();if(a.type==="Polygon"){const f=va(a.coordinates,u,d),_=cn(r.geometry(),o,u,d);if(!qs(o,u))return!1;for(const x of _)if(!on(x,f))return!1}if(a.type==="MultiPolygon"){const f=go(a.coordinates,u,d),_=cn(r.geometry(),o,u,d);if(!qs(o,u))return!1;for(const x of _)if(!ln(x,f))return!1}return!0}(e,this.geometries);if(e.geometryType()==="LineString")return function(r,a){const o=[1/0,1/0,-1/0,-1/0],u=[1/0,1/0,-1/0,-1/0],d=r.canonicalID();if(a.type==="Polygon"){const f=va(a.coordinates,u,d),_=hn(r.geometry(),o,u,d);if(!qs(o,u))return!1;for(const x of _)if(!fo(x,f))return!1}if(a.type==="MultiPolygon"){const f=go(a.coordinates,u,d),_=hn(r.geometry(),o,u,d);if(!qs(o,u))return!1;for(const x of _)if(!mo(x,f))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class ba{constructor(e,r){this.type=r.type,this.name=e,this.boundExpression=r}static parse(e,r){if(e.length!==2||typeof e[1]!="string")return r.error("'var' expression requires exactly one string literal argument.");const a=e[1];return r.scope.has(a)?new ba(a,r.scope.get(a)):r.error(`Unknown variable "${a}". Make sure "${a}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class Fi{constructor(e,r,a,o){this.name=e,this.type=r,this._evaluate=a,this.args=o}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,r){const a=e[0],o=Fi.definitions[a];if(!o)return r.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0);const u=Array.isArray(o)?o[0]:o.type,d=Array.isArray(o)?[[o[1],o[2]]]:o.overloads,f=d.filter(([x])=>!Array.isArray(x)||x.length===e.length-1);let _=null;for(const[x,b]of f){_=new ya(r.registry,wa,r.path,null,r.scope);const T=[];let A=!1;for(let C=1;C<e.length;C++){const P=e[C],D=Array.isArray(x)?x[C-1]:x.type,V=_.parse(P,1+T.length,D);if(!V){A=!0;break}T.push(V)}if(!A)if(Array.isArray(x)&&x.length!==T.length)_.error(`Expected ${x.length} arguments, but found ${T.length} instead.`);else{for(let C=0;C<T.length;C++){const P=Array.isArray(x)?x[C]:x.type,D=T[C];_.concat(C+1).checkSubtype(P,D.type)}if(_.errors.length===0)return new Fi(a,u,b,T)}}if(f.length===1)r.errors.push(..._.errors);else{const x=(f.length?f:d).map(([T])=>{return A=T,Array.isArray(A)?`(${A.map(N).join(", ")})`:`(${N(A.type)}...)`;var A}).join(" | "),b=[];for(let T=1;T<e.length;T++){const A=r.parse(e[T],1+b.length);if(!A)return null;b.push(N(A.type))}r.error(`Expected arguments of type ${x}, but found (${b.join(", ")}) instead.`)}return null}static register(e,r){Fi.definitions=r;for(const a in r)e[a]=Fi}}function wa(i){if(i instanceof ba)return wa(i.boundExpression);if(i instanceof Fi&&i.name==="error"||i instanceof xa||i instanceof Xr)return!1;const e=i instanceof kr||i instanceof Ri;let r=!0;return i.eachChild(a=>{r=e?r&&wa(a):r&&a instanceof Gr}),!!r&&Sa(i)&&Ta(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Sa(i){if(i instanceof Fi&&(i.name==="get"&&i.args.length===1||i.name==="feature-state"||i.name==="has"&&i.args.length===1||i.name==="properties"||i.name==="geometry-type"||i.name==="id"||/^filter-/.test(i.name))||i instanceof Xr)return!1;let e=!0;return i.eachChild(r=>{e&&!Sa(r)&&(e=!1)}),e}function Zs(i){if(i instanceof Fi&&i.name==="feature-state")return!1;let e=!0;return i.eachChild(r=>{e&&!Zs(r)&&(e=!1)}),e}function Ta(i,e){if(i instanceof Fi&&e.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild(a=>{r&&!Ta(a,e)&&(r=!1)}),r}function vs(i,e){const r=i.length-1;let a,o,u=0,d=r,f=0;for(;u<=d;)if(f=Math.floor((u+d)/2),a=i[f],o=i[f+1],a<=e){if(f===r||e<o)return f;u=f+1}else{if(!(a>e))throw new bt("Input is not a number.");d=f-1}return 0}class Dr{constructor(e,r,a){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(const[o,u]of a)this.labels.push(o),this.outputs.push(u)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");const a=r.parse(e[1],1,ge);if(!a)return null;const o=[];let u=null;r.expectedType&&r.expectedType.kind!=="value"&&(u=r.expectedType);for(let d=1;d<e.length;d+=2){const f=d===1?-1/0:e[d],_=e[d+1],x=d,b=d+1;if(typeof f!="number")return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',x);if(o.length&&o[o.length-1][0]>=f)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',x);const T=r.parse(_,b,u);if(!T)return null;u=u||T.type,o.push([f,T])}return new Dr(u,a,o)}evaluate(e){const r=this.labels,a=this.outputs;if(r.length===1)return a[0].evaluate(e);const o=this.input.evaluate(e);if(o<=r[0])return a[0].evaluate(e);const u=r.length;return o>=r[u-1]?a[u-1].evaluate(e):a[vs(r,o)].evaluate(e)}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Xe(i,e,r){return i+r*(e-i)}function Ia(i,e,r){return i.map((a,o)=>Xe(a,e[o],r))}const wi={number:Xe,color:function(i,e,r,a="rgb"){switch(a){case"rgb":{const[o,u,d,f]=Ia(i.rgb,e.rgb,r);return new it(o,u,d,f,!1)}case"hcl":{const[o,u,d,f]=i.hcl,[_,x,b,T]=e.hcl;let A,C;if(isNaN(o)||isNaN(_))isNaN(o)?isNaN(_)?A=NaN:(A=_,d!==1&&d!==0||(C=x)):(A=o,b!==1&&b!==0||(C=u));else{let H=_-o;_>o&&H>180?H-=360:_<o&&o-_>180&&(H+=360),A=o+r*H}const[P,D,V,$]=function([H,q,Y,Q]){return H=isNaN(H)?0:H*Oe,ot([Y,Math.cos(H)*q,Math.sin(H)*q,Q])}([A,C??Xe(u,x,r),Xe(d,b,r),Xe(f,T,r)]);return new it(P,D,V,$,!1)}case"lab":{const[o,u,d,f]=ot(Ia(i.lab,e.lab,r));return new it(o,u,d,f,!1)}}},array:Ia,padding:function(i,e,r){return new bi(Ia(i.values,e.values,r))},variableAnchorOffsetCollection:function(i,e,r){const a=i.values,o=e.values;if(a.length!==o.length)throw new bt(`Cannot interpolate values of different length. from: ${i.toString()}, to: ${e.toString()}`);const u=[];for(let d=0;d<a.length;d+=2){if(a[d]!==o[d])throw new bt(`Cannot interpolate values containing mismatched anchors. from[${d}]: ${a[d]}, to[${d}]: ${o[d]}`);u.push(a[d]);const[f,_]=a[d+1],[x,b]=o[d+1];u.push([Xe(f,x,r),Xe(_,b,r)])}return new Bi(u)}};class Si{constructor(e,r,a,o,u){this.type=e,this.operator=r,this.interpolation=a,this.input=o,this.labels=[],this.outputs=[];for(const[d,f]of u)this.labels.push(d),this.outputs.push(f)}static interpolationFactor(e,r,a,o){let u=0;if(e.name==="exponential")u=un(r,e.base,a,o);else if(e.name==="linear")u=un(r,1,a,o);else if(e.name==="cubic-bezier"){const d=e.controlPoints;u=new cs(d[0],d[1],d[2],d[3]).solve(un(r,1,a,o))}return u}static parse(e,r){let[a,o,u,...d]=e;if(!Array.isArray(o)||o.length===0)return r.error("Expected an interpolation type expression.",1);if(o[0]==="linear")o={name:"linear"};else if(o[0]==="exponential"){const x=o[1];if(typeof x!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);o={name:"exponential",base:x}}else{if(o[0]!=="cubic-bezier")return r.error(`Unknown interpolation type ${String(o[0])}`,1,0);{const x=o.slice(1);if(x.length!==4||x.some(b=>typeof b!="number"||b<0||b>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);o={name:"cubic-bezier",controlPoints:x}}}if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(u=r.parse(u,2,ge),!u)return null;const f=[];let _=null;a==="interpolate-hcl"||a==="interpolate-lab"?_=ii:r.expectedType&&r.expectedType.kind!=="value"&&(_=r.expectedType);for(let x=0;x<d.length;x+=2){const b=d[x],T=d[x+1],A=x+3,C=x+4;if(typeof b!="number")return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',A);if(f.length&&f[f.length-1][0]>=b)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',A);const P=r.parse(T,C,_);if(!P)return null;_=_||P.type,f.push([b,P])}return se(_,ge)||se(_,ii)||se(_,I)||se(_,k)||se(_,O(ge))?new Si(_,a,o,u,f):r.error(`Type ${N(_)} is not interpolatable.`)}evaluate(e){const r=this.labels,a=this.outputs;if(r.length===1)return a[0].evaluate(e);const o=this.input.evaluate(e);if(o<=r[0])return a[0].evaluate(e);const u=r.length;if(o>=r[u-1])return a[u-1].evaluate(e);const d=vs(r,o),f=Si.interpolationFactor(this.interpolation,o,r[d],r[d+1]),_=a[d].evaluate(e),x=a[d+1].evaluate(e);switch(this.operator){case"interpolate":return wi[this.type.kind](_,x,f);case"interpolate-hcl":return wi.color(_,x,f,"hcl");case"interpolate-lab":return wi.color(_,x,f,"lab")}}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function un(i,e,r,a){const o=a-r,u=i-r;return o===0?0:e===1?u/o:(Math.pow(e,u)-1)/(Math.pow(e,o)-1)}class Aa{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expectected at least one argument.");let a=null;const o=r.expectedType;o&&o.kind!=="value"&&(a=o);const u=[];for(const f of e.slice(1)){const _=r.parse(f,1+u.length,a,void 0,{typeAnnotation:"omit"});if(!_)return null;a=a||_.type,u.push(_)}if(!a)throw new Error("No output type");const d=o&&u.some(f=>Z(o,f.type));return new Aa(d?Ve:a,u)}evaluate(e){let r,a=null,o=0;for(const u of this.args)if(o++,a=u.evaluate(e),a&&a instanceof qt&&!a.available&&(r||(r=a.name),a=null,o===this.args.length&&(a=r)),a!==null)break;return a}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}class Ma{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const a=[];for(let u=1;u<e.length-1;u+=2){const d=e[u];if(typeof d!="string")return r.error(`Expected string, but found ${typeof d} instead.`,u);if(/[^a-zA-Z0-9_]/.test(d))return r.error("Variable names must contain only alphanumeric characters or '_'.",u);const f=r.parse(e[u+1],u+1);if(!f)return null;a.push([d,f])}const o=r.parse(e[e.length-1],e.length-1,r.expectedType,a);return o?new Ma(a,o):null}outputDefined(){return this.result.outputDefined()}}class pn{constructor(e,r,a){this.type=e,this.index=r,this.input=a}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,ge),o=r.parse(e[2],2,O(r.expectedType||Ve));return a&&o?new pn(o.type.itemType,a,o):null}evaluate(e){const r=this.index.evaluate(e),a=this.input.evaluate(e);if(r<0)throw new bt(`Array index out of bounds: ${r} < 0.`);if(r>=a.length)throw new bt(`Array index out of bounds: ${r} > ${a.length-1}.`);if(r!==Math.floor(r))throw new bt(`Array index must be an integer, but found ${r} instead.`);return a[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class dn{constructor(e,r){this.type=Fe,this.needle=e,this.haystack=r}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,Ve),o=r.parse(e[2],2,Ve);return a&&o?j(a.type,[Fe,Ue,ge,pr,Ve])?new dn(a,o):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${N(a.type)} instead`):null}evaluate(e){const r=this.needle.evaluate(e),a=this.haystack.evaluate(e);if(!a)return!1;if(!W(r,["boolean","string","number","null"]))throw new bt(`Expected first argument to be of type boolean, string, number or null, but found ${N(gt(r))} instead.`);if(!W(a,["string","array"]))throw new bt(`Expected second argument to be of type array or string, but found ${N(gt(a))} instead.`);return a.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class Ea{constructor(e,r,a){this.type=ge,this.needle=e,this.haystack=r,this.fromIndex=a}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,Ve),o=r.parse(e[2],2,Ve);if(!a||!o)return null;if(!j(a.type,[Fe,Ue,ge,pr,Ve]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${N(a.type)} instead`);if(e.length===4){const u=r.parse(e[3],3,ge);return u?new Ea(a,o,u):null}return new Ea(a,o)}evaluate(e){const r=this.needle.evaluate(e),a=this.haystack.evaluate(e);if(!W(r,["boolean","string","number","null"]))throw new bt(`Expected first argument to be of type boolean, string, number or null, but found ${N(gt(r))} instead.`);if(!W(a,["string","array"]))throw new bt(`Expected second argument to be of type array or string, but found ${N(gt(a))} instead.`);if(this.fromIndex){const o=this.fromIndex.evaluate(e);return a.indexOf(r,o)}return a.indexOf(r)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class fn{constructor(e,r,a,o,u,d){this.inputType=e,this.type=r,this.input=a,this.cases=o,this.outputs=u,this.otherwise=d}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let a,o;r.expectedType&&r.expectedType.kind!=="value"&&(o=r.expectedType);const u={},d=[];for(let x=2;x<e.length-1;x+=2){let b=e[x];const T=e[x+1];Array.isArray(b)||(b=[b]);const A=r.concat(x);if(b.length===0)return A.error("Expected at least one branch label.");for(const P of b){if(typeof P!="number"&&typeof P!="string")return A.error("Branch labels must be numbers or strings.");if(typeof P=="number"&&Math.abs(P)>Number.MAX_SAFE_INTEGER)return A.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof P=="number"&&Math.floor(P)!==P)return A.error("Numeric branch labels must be integer values.");if(a){if(A.checkSubtype(a,gt(P)))return null}else a=gt(P);if(u[String(P)]!==void 0)return A.error("Branch labels must be unique.");u[String(P)]=d.length}const C=r.parse(T,x,o);if(!C)return null;o=o||C.type,d.push(C)}const f=r.parse(e[1],1,Ve);if(!f)return null;const _=r.parse(e[e.length-1],e.length-1,o);return _?f.type.kind!=="value"&&r.concat(1).checkSubtype(a,f.type)?null:new fn(a,o,f,u,d,_):null}evaluate(e){const r=this.input.evaluate(e);return(gt(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}}class mn{constructor(e,r,a){this.type=e,this.branches=r,this.otherwise=a}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error("Expected an odd number of arguments.");let a;r.expectedType&&r.expectedType.kind!=="value"&&(a=r.expectedType);const o=[];for(let d=1;d<e.length-1;d+=2){const f=r.parse(e[d],d,Fe);if(!f)return null;const _=r.parse(e[d+1],d+1,a);if(!_)return null;o.push([f,_]),a=a||_.type}const u=r.parse(e[e.length-1],e.length-1,a);if(!u)return null;if(!a)throw new Error("Can't infer output type");return new mn(a,o,u)}evaluate(e){for(const[r,a]of this.branches)if(r.evaluate(e))return a.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[r,a]of this.branches)e(r),e(a);e(this.otherwise)}outputDefined(){return this.branches.every(([e,r])=>r.outputDefined())&&this.otherwise.outputDefined()}}class Ca{constructor(e,r,a,o){this.type=e,this.input=r,this.beginIndex=a,this.endIndex=o}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,Ve),o=r.parse(e[2],2,ge);if(!a||!o)return null;if(!j(a.type,[O(Ve),Ue,Ve]))return r.error(`Expected first argument to be of type array or string, but found ${N(a.type)} instead`);if(e.length===4){const u=r.parse(e[3],3,ge);return u?new Ca(a.type,a,o,u):null}return new Ca(a.type,a,o)}evaluate(e){const r=this.input.evaluate(e),a=this.beginIndex.evaluate(e);if(!W(r,["string","array"]))throw new bt(`Expected first argument to be of type array or string, but found ${N(gt(r))} instead.`);if(this.endIndex){const o=this.endIndex.evaluate(e);return r.slice(a,o)}return r.slice(a)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function yo(i,e){return i==="=="||i==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function xo(i,e,r,a){return a.compare(e,r)===0}function bs(i,e,r){const a=i!=="=="&&i!=="!=";return class lu{constructor(u,d,f){this.type=Fe,this.lhs=u,this.rhs=d,this.collator=f,this.hasUntypedArgument=u.type.kind==="value"||d.type.kind==="value"}static parse(u,d){if(u.length!==3&&u.length!==4)return d.error("Expected two or three arguments.");const f=u[0];let _=d.parse(u[1],1,Ve);if(!_)return null;if(!yo(f,_.type))return d.concat(1).error(`"${f}" comparisons are not supported for type '${N(_.type)}'.`);let x=d.parse(u[2],2,Ve);if(!x)return null;if(!yo(f,x.type))return d.concat(2).error(`"${f}" comparisons are not supported for type '${N(x.type)}'.`);if(_.type.kind!==x.type.kind&&_.type.kind!=="value"&&x.type.kind!=="value")return d.error(`Cannot compare types '${N(_.type)}' and '${N(x.type)}'.`);a&&(_.type.kind==="value"&&x.type.kind!=="value"?_=new Ri(x.type,[_]):_.type.kind!=="value"&&x.type.kind==="value"&&(x=new Ri(_.type,[x])));let b=null;if(u.length===4){if(_.type.kind!=="string"&&x.type.kind!=="string"&&_.type.kind!=="value"&&x.type.kind!=="value")return d.error("Cannot use collator to compare non-string types.");if(b=d.parse(u[3],3,dr),!b)return null}return new lu(_,x,b)}evaluate(u){const d=this.lhs.evaluate(u),f=this.rhs.evaluate(u);if(a&&this.hasUntypedArgument){const _=gt(d),x=gt(f);if(_.kind!==x.kind||_.kind!=="string"&&_.kind!=="number")throw new bt(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${_.kind}, ${x.kind}) instead.`)}if(this.collator&&!a&&this.hasUntypedArgument){const _=gt(d),x=gt(f);if(_.kind!=="string"||x.kind!=="string")return e(u,d,f)}return this.collator?r(u,d,f,this.collator.evaluate(u)):e(u,d,f)}eachChild(u){u(this.lhs),u(this.rhs),this.collator&&u(this.collator)}outputDefined(){return!0}}}const Sl=bs("==",function(i,e,r){return e===r},xo),Tl=bs("!=",function(i,e,r){return e!==r},function(i,e,r,a){return!xo(0,e,r,a)}),Il=bs("<",function(i,e,r){return e<r},function(i,e,r,a){return a.compare(e,r)<0}),Al=bs(">",function(i,e,r){return e>r},function(i,e,r,a){return a.compare(e,r)>0}),Ml=bs("<=",function(i,e,r){return e<=r},function(i,e,r,a){return a.compare(e,r)<=0}),El=bs(">=",function(i,e,r){return e>=r},function(i,e,r,a){return a.compare(e,r)>=0});class gn{constructor(e,r,a,o,u){this.type=Ue,this.number=e,this.locale=r,this.currency=a,this.minFractionDigits=o,this.maxFractionDigits=u}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");const a=r.parse(e[1],1,ge);if(!a)return null;const o=e[2];if(typeof o!="object"||Array.isArray(o))return r.error("NumberFormat options argument must be an object.");let u=null;if(o.locale&&(u=r.parse(o.locale,1,Ue),!u))return null;let d=null;if(o.currency&&(d=r.parse(o.currency,1,Ue),!d))return null;let f=null;if(o["min-fraction-digits"]&&(f=r.parse(o["min-fraction-digits"],1,ge),!f))return null;let _=null;return o["max-fraction-digits"]&&(_=r.parse(o["max-fraction-digits"],1,ge),!_)?null:new gn(a,u,d,f,_)}evaluate(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))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Pa{constructor(e){this.type=R,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const a=e[1];if(!Array.isArray(a)&&typeof a=="object")return r.error("First argument must be an image or text section.");const o=[];let u=!1;for(let d=1;d<=e.length-1;++d){const f=e[d];if(u&&typeof f=="object"&&!Array.isArray(f)){u=!1;let _=null;if(f["font-scale"]&&(_=r.parse(f["font-scale"],1,ge),!_))return null;let x=null;if(f["text-font"]&&(x=r.parse(f["text-font"],1,O(Ue)),!x))return null;let b=null;if(f["text-color"]&&(b=r.parse(f["text-color"],1,ii),!b))return null;const T=o[o.length-1];T.scale=_,T.font=x,T.textColor=b}else{const _=r.parse(e[d],1,Ve);if(!_)return null;const x=_.type.kind;if(x!=="string"&&x!=="value"&&x!=="null"&&x!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");u=!0,o.push({content:_,scale:null,font:null,textColor:null})}}return new Pa(o)}evaluate(e){return new Ht(this.sections.map(r=>{const a=r.content.evaluate(e);return gt(a)===M?new ma("",a,null,null,null):new ma(Je(a),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null)}))}eachChild(e){for(const r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor)}outputDefined(){return!1}}class _n{constructor(e){this.type=M,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");const a=r.parse(e[1],1,Ue);return a?new _n(a):r.error("No image name provided.")}evaluate(e){const r=this.input.evaluate(e),a=qt.fromString(r);return a&&e.availableImages&&(a.available=e.availableImages.indexOf(r)>-1),a}eachChild(e){e(this.input)}outputDefined(){return!1}}class yn{constructor(e){this.type=ge,this.input=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);const a=r.parse(e[1],1);return a?a.type.kind!=="array"&&a.type.kind!=="string"&&a.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${N(a.type)} instead.`):new yn(a):null}evaluate(e){const r=this.input.evaluate(e);if(typeof r=="string"||Array.isArray(r))return r.length;throw new bt(`Expected value to be of type string or array, but found ${N(gt(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const ws={"==":Sl,"!=":Tl,">":Al,"<":Il,">=":El,"<=":Ml,array:Ri,at:pn,boolean:Ri,case:mn,coalesce:Aa,collator:xa,format:Pa,image:_n,in:dn,"index-of":Ea,interpolate:Si,"interpolate-hcl":Si,"interpolate-lab":Si,length:yn,let:Ma,literal:Gr,match:fn,number:Ri,"number-format":gn,object:Ri,slice:Ca,step:Dr,string:Ri,"to-boolean":kr,"to-color":kr,"to-number":kr,"to-string":kr,var:ba,within:Xr};function vo(i,[e,r,a,o]){e=e.evaluate(i),r=r.evaluate(i),a=a.evaluate(i);const u=o?o.evaluate(i):1,d=ga(e,r,a,u);if(d)throw new bt(d);return new it(e/255,r/255,a/255,u,!1)}function bo(i,e){return i in e}function xn(i,e){const r=e[i];return r===void 0?null:r}function Wr(i){return{type:i}}function wo(i){return{result:"success",value:i}}function Lr(i){return{result:"error",value:i}}function Ss(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function So(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function vn(i){return!!i.expression&&i.expression.interpolated}function Qe(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function _t(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function Cl(i){return i}function We(i,e){const r=e.type==="color",a=i.stops&&typeof i.stops[0][0]=="object",o=a||!(a||i.property!==void 0),u=i.type||(vn(e)?"exponential":"interval");if(r||e.type==="padding"){const b=r?it.parse:bi.parse;(i=Qi({},i)).stops&&(i.stops=i.stops.map(T=>[T[0],b(T[1])])),i.default=b(i.default?i.default:e.default)}if(i.colorSpace&&(d=i.colorSpace)!=="rgb"&&d!=="hcl"&&d!=="lab")throw new Error(`Unknown color space: "${i.colorSpace}"`);var d;let f,_,x;if(u==="exponential")f=Gs;else if(u==="interval")f=dt;else if(u==="categorical"){f=yt,_=Object.create(null);for(const b of i.stops)_[b[0]]=b[1];x=typeof i.stops[0][0]}else{if(u!=="identity")throw new Error(`Unknown function type "${u}"`);f=To}if(a){const b={},T=[];for(let P=0;P<i.stops.length;P++){const D=i.stops[P],V=D[0].zoom;b[V]===void 0&&(b[V]={zoom:V,type:i.type,property:i.property,default:i.default,stops:[]},T.push(V)),b[V].stops.push([D[0].value,D[1]])}const A=[];for(const P of T)A.push([b[P].zoom,We(b[P],e)]);const C={name:"linear"};return{kind:"composite",interpolationType:C,interpolationFactor:Si.interpolationFactor.bind(void 0,C),zoomStops:A.map(P=>P[0]),evaluate:({zoom:P},D)=>Gs({stops:A,base:i.base},e,P).evaluate(P,D)}}if(o){const b=u==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:b,interpolationFactor:Si.interpolationFactor.bind(void 0,b),zoomStops:i.stops.map(T=>T[0]),evaluate:({zoom:T})=>f(i,e,T,_,x)}}return{kind:"source",evaluate(b,T){const A=T&&T.properties?T.properties[i.property]:void 0;return A===void 0?Hr(i.default,e.default):f(i,e,A,_,x)}}}function Hr(i,e,r){return i!==void 0?i:e!==void 0?e:r!==void 0?r:void 0}function yt(i,e,r,a,o){return Hr(typeof r===o?a[r]:void 0,i.default,e.default)}function dt(i,e,r){if(Qe(r)!=="number")return Hr(i.default,e.default);const a=i.stops.length;if(a===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[a-1][0])return i.stops[a-1][1];const o=vs(i.stops.map(u=>u[0]),r);return i.stops[o][1]}function Gs(i,e,r){const a=i.base!==void 0?i.base:1;if(Qe(r)!=="number")return Hr(i.default,e.default);const o=i.stops.length;if(o===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[o-1][0])return i.stops[o-1][1];const u=vs(i.stops.map(b=>b[0]),r),d=function(b,T,A,C){const P=C-A,D=b-A;return P===0?0:T===1?D/P:(Math.pow(T,D)-1)/(Math.pow(T,P)-1)}(r,a,i.stops[u][0],i.stops[u+1][0]),f=i.stops[u][1],_=i.stops[u+1][1],x=wi[e.type]||Cl;return typeof f.evaluate=="function"?{evaluate(...b){const T=f.evaluate.apply(void 0,b),A=_.evaluate.apply(void 0,b);if(T!==void 0&&A!==void 0)return x(T,A,d,i.colorSpace)}}:x(f,_,d,i.colorSpace)}function To(i,e,r){switch(e.type){case"color":r=it.parse(r);break;case"formatted":r=Ht.fromString(r.toString());break;case"resolvedImage":r=qt.fromString(r.toString());break;case"padding":r=bi.parse(r);break;default:Qe(r)===e.type||e.type==="enum"&&e.values[r]||(r=void 0)}return Hr(r,i.default,e.default)}Fi.register(ws,{error:[{kind:"error"},[Ue],(i,[e])=>{throw new bt(e.evaluate(i))}],typeof:[Ue,[Ve],(i,[e])=>N(gt(e.evaluate(i)))],"to-rgba":[O(ge,4),[ii],(i,[e])=>{const[r,a,o,u]=e.evaluate(i).rgb;return[255*r,255*a,255*o,u]}],rgb:[ii,[ge,ge,ge],vo],rgba:[ii,[ge,ge,ge,ge],vo],has:{type:Fe,overloads:[[[Ue],(i,[e])=>bo(e.evaluate(i),i.properties())],[[Ue,er],(i,[e,r])=>bo(e.evaluate(i),r.evaluate(i))]]},get:{type:Ve,overloads:[[[Ue],(i,[e])=>xn(e.evaluate(i),i.properties())],[[Ue,er],(i,[e,r])=>xn(e.evaluate(i),r.evaluate(i))]]},"feature-state":[Ve,[Ue],(i,[e])=>xn(e.evaluate(i),i.featureState||{})],properties:[er,[],i=>i.properties()],"geometry-type":[Ue,[],i=>i.geometryType()],id:[Ve,[],i=>i.id()],zoom:[ge,[],i=>i.globals.zoom],"heatmap-density":[ge,[],i=>i.globals.heatmapDensity||0],"line-progress":[ge,[],i=>i.globals.lineProgress||0],accumulated:[Ve,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[ge,Wr(ge),(i,e)=>{let r=0;for(const a of e)r+=a.evaluate(i);return r}],"*":[ge,Wr(ge),(i,e)=>{let r=1;for(const a of e)r*=a.evaluate(i);return r}],"-":{type:ge,overloads:[[[ge,ge],(i,[e,r])=>e.evaluate(i)-r.evaluate(i)],[[ge],(i,[e])=>-e.evaluate(i)]]},"/":[ge,[ge,ge],(i,[e,r])=>e.evaluate(i)/r.evaluate(i)],"%":[ge,[ge,ge],(i,[e,r])=>e.evaluate(i)%r.evaluate(i)],ln2:[ge,[],()=>Math.LN2],pi:[ge,[],()=>Math.PI],e:[ge,[],()=>Math.E],"^":[ge,[ge,ge],(i,[e,r])=>Math.pow(e.evaluate(i),r.evaluate(i))],sqrt:[ge,[ge],(i,[e])=>Math.sqrt(e.evaluate(i))],log10:[ge,[ge],(i,[e])=>Math.log(e.evaluate(i))/Math.LN10],ln:[ge,[ge],(i,[e])=>Math.log(e.evaluate(i))],log2:[ge,[ge],(i,[e])=>Math.log(e.evaluate(i))/Math.LN2],sin:[ge,[ge],(i,[e])=>Math.sin(e.evaluate(i))],cos:[ge,[ge],(i,[e])=>Math.cos(e.evaluate(i))],tan:[ge,[ge],(i,[e])=>Math.tan(e.evaluate(i))],asin:[ge,[ge],(i,[e])=>Math.asin(e.evaluate(i))],acos:[ge,[ge],(i,[e])=>Math.acos(e.evaluate(i))],atan:[ge,[ge],(i,[e])=>Math.atan(e.evaluate(i))],min:[ge,Wr(ge),(i,e)=>Math.min(...e.map(r=>r.evaluate(i)))],max:[ge,Wr(ge),(i,e)=>Math.max(...e.map(r=>r.evaluate(i)))],abs:[ge,[ge],(i,[e])=>Math.abs(e.evaluate(i))],round:[ge,[ge],(i,[e])=>{const r=e.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}],floor:[ge,[ge],(i,[e])=>Math.floor(e.evaluate(i))],ceil:[ge,[ge],(i,[e])=>Math.ceil(e.evaluate(i))],"filter-==":[Fe,[Ue,Ve],(i,[e,r])=>i.properties()[e.value]===r.value],"filter-id-==":[Fe,[Ve],(i,[e])=>i.id()===e.value],"filter-type-==":[Fe,[Ue],(i,[e])=>i.geometryType()===e.value],"filter-<":[Fe,[Ue,Ve],(i,[e,r])=>{const a=i.properties()[e.value],o=r.value;return typeof a==typeof o&&a<o}],"filter-id-<":[Fe,[Ve],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r<a}],"filter->":[Fe,[Ue,Ve],(i,[e,r])=>{const a=i.properties()[e.value],o=r.value;return typeof a==typeof o&&a>o}],"filter-id->":[Fe,[Ve],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r>a}],"filter-<=":[Fe,[Ue,Ve],(i,[e,r])=>{const a=i.properties()[e.value],o=r.value;return typeof a==typeof o&&a<=o}],"filter-id-<=":[Fe,[Ve],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r<=a}],"filter->=":[Fe,[Ue,Ve],(i,[e,r])=>{const a=i.properties()[e.value],o=r.value;return typeof a==typeof o&&a>=o}],"filter-id->=":[Fe,[Ve],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r>=a}],"filter-has":[Fe,[Ve],(i,[e])=>e.value in i.properties()],"filter-has-id":[Fe,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[Fe,[O(Ue)],(i,[e])=>e.value.indexOf(i.geometryType())>=0],"filter-id-in":[Fe,[O(Ve)],(i,[e])=>e.value.indexOf(i.id())>=0],"filter-in-small":[Fe,[Ue,O(Ve)],(i,[e,r])=>r.value.indexOf(i.properties()[e.value])>=0],"filter-in-large":[Fe,[Ue,O(Ve)],(i,[e,r])=>function(a,o,u,d){for(;u<=d;){const f=u+d>>1;if(o[f]===a)return!0;o[f]>a?d=f-1:u=f+1}return!1}(i.properties()[e.value],r.value,0,r.value.length-1)],all:{type:Fe,overloads:[[[Fe,Fe],(i,[e,r])=>e.evaluate(i)&&r.evaluate(i)],[Wr(Fe),(i,e)=>{for(const r of e)if(!r.evaluate(i))return!1;return!0}]]},any:{type:Fe,overloads:[[[Fe,Fe],(i,[e,r])=>e.evaluate(i)||r.evaluate(i)],[Wr(Fe),(i,e)=>{for(const r of e)if(r.evaluate(i))return!0;return!1}]]},"!":[Fe,[Fe],(i,[e])=>!e.evaluate(i)],"is-supported-script":[Fe,[Ue],(i,[e])=>{const r=i.globals&&i.globals.isSupportedScript;return!r||r(e.evaluate(i))}],upcase:[Ue,[Ue],(i,[e])=>e.evaluate(i).toUpperCase()],downcase:[Ue,[Ue],(i,[e])=>e.evaluate(i).toLowerCase()],concat:[Ue,Wr(Ve),(i,e)=>e.map(r=>Je(r.evaluate(i))).join("")],"resolved-locale":[Ue,[dr],(i,[e])=>e.evaluate(i).resolvedLocale()]});class bn{constructor(e,r){var a;this.expression=e,this._warningHistory={},this._evaluator=new an,this._defaultValue=r?(a=r).type==="color"&&_t(a.default)?new it(0,0,0,0):a.type==="color"?it.parse(a.default)||null:a.type==="padding"?bi.parse(a.default)||null:a.type==="variableAnchorOffsetCollection"?Bi.parse(a.default)||null:a.default===void 0?null:a.default:null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(e,r,a,o,u,d){return this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=a,this._evaluator.canonical=o,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=d,this.expression.evaluate(this._evaluator)}evaluate(e,r,a,o,u,d){this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=a||null,this._evaluator.canonical=o,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=d||null;try{const f=this.expression.evaluate(this._evaluator);if(f==null||typeof f=="number"&&f!=f)return this._defaultValue;if(this._enumValues&&!(f in this._enumValues))throw new bt(`Expected value to be one of ${Object.keys(this._enumValues).map(_=>JSON.stringify(_)).join(", ")}, but found ${JSON.stringify(f)} instead.`);return f}catch(f){return this._warningHistory[f.message]||(this._warningHistory[f.message]=!0,typeof console<"u"&&console.warn(f.message)),this._defaultValue}}}function ka(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in ws}function za(i,e){const r=new ya(ws,wa,[],e?function(o){const u={color:ii,string:Ue,number:ge,enum:Ue,boolean:Fe,formatted:R,padding:I,resolvedImage:M,variableAnchorOffsetCollection:k};return o.type==="array"?O(u[o.value]||Ve,o.length):u[o.type]}(e):void 0),a=r.parse(i,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?wo(new bn(a,e)):Lr(r.errors)}class wn{constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!Zs(r.expression)}evaluateWithoutErrorHandling(e,r,a,o,u,d){return this._styleExpression.evaluateWithoutErrorHandling(e,r,a,o,u,d)}evaluate(e,r,a,o,u,d){return this._styleExpression.evaluate(e,r,a,o,u,d)}}class Da{constructor(e,r,a,o){this.kind=e,this.zoomStops=a,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!Zs(r.expression),this.interpolationType=o}evaluateWithoutErrorHandling(e,r,a,o,u,d){return this._styleExpression.evaluateWithoutErrorHandling(e,r,a,o,u,d)}evaluate(e,r,a,o,u,d){return this._styleExpression.evaluate(e,r,a,o,u,d)}interpolationFactor(e,r,a){return this.interpolationType?Si.interpolationFactor(this.interpolationType,e,r,a):0}}function Sn(i,e){const r=za(i,e);if(r.result==="error")return r;const a=r.value.expression,o=Sa(a);if(!o&&!Ss(e))return Lr([new vt("","data expressions not supported")]);const u=Ta(a,["zoom"]);if(!u&&!So(e))return Lr([new vt("","zoom expressions not supported")]);const d=Ws(a);return d||u?d instanceof vt?Lr([d]):d instanceof Si&&!vn(e)?Lr([new vt("",'"interpolate" expressions cannot be used with this property')]):wo(d?new Da(o?"camera":"composite",r.value,d.labels,d instanceof Si?d.interpolation:void 0):new wn(o?"constant":"source",r.value)):Lr([new vt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Xs{constructor(e,r){this._parameters=e,this._specification=r,Qi(this,We(this._parameters,this._specification))}static deserialize(e){return new Xs(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Ws(i){let e=null;if(i instanceof Ma)e=Ws(i.result);else if(i instanceof Aa){for(const r of i.args)if(e=Ws(r),e)break}else(i instanceof Dr||i instanceof Si)&&i.input instanceof Fi&&i.input.name==="zoom"&&(e=i);return e instanceof vt||i.eachChild(r=>{const a=Ws(r);a instanceof vt?e=a:!e&&a?e=new vt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&a&&e!==a&&(e=new vt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function Hs(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(const e of i.slice(1))if(!Hs(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const Pl={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Tn(i){if(i==null)return{filter:()=>!0,needGeometry:!1};Hs(i)||(i=La(i));const e=za(i,Pl);if(e.result==="error")throw new Error(e.value.map(r=>`${r.key}: ${r.message}`).join(", "));return{filter:(r,a,o)=>e.value.evaluate(r,a,{},o),needGeometry:Io(i)}}function kl(i,e){return i<e?-1:i>e?1:0}function Io(i){if(!Array.isArray(i))return!1;if(i[0]==="within")return!0;for(let e=1;e<i.length;e++)if(Io(i[e]))return!0;return!1}function La(i){if(!i)return!0;const e=i[0];return i.length<=1?e!=="any":e==="=="?In(i[1],i[2],"=="):e==="!="?Ks(In(i[1],i[2],"==")):e==="<"||e===">"||e==="<="||e===">="?In(i[1],i[2],e):e==="any"?(r=i.slice(1),["any"].concat(r.map(La))):e==="all"?["all"].concat(i.slice(1).map(La)):e==="none"?["all"].concat(i.slice(1).map(La).map(Ks)):e==="in"?Ao(i[1],i.slice(2)):e==="!in"?Ks(Ao(i[1],i.slice(2))):e==="has"?Mo(i[1]):e==="!has"?Ks(Mo(i[1])):e!=="within"||i;var r}function In(i,e,r){switch(i){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,i,e]}}function Ao(i,e){if(e.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?["filter-in-large",i,["literal",e.sort(kl)]]:["filter-in-small",i,["literal",e]]}}function Mo(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function Ks(i){return["!",i]}function Ba(i){const e=typeof i;if(e==="number"||e==="boolean"||e==="string"||i==null)return JSON.stringify(i);if(Array.isArray(i)){let o="[";for(const u of i)o+=`${Ba(u)},`;return`${o}]`}const r=Object.keys(i).sort();let a="{";for(let o=0;o<r.length;o++)a+=`${JSON.stringify(r[o])}:${Ba(i[r[o]])},`;return`${a}}`}function Ra(i){let e="";for(const r of ui)e+=`/${Ba(i[r])}`;return e}function Eo(i){const e=i.value;return e?[new fe(i.key,e,"constants have been deprecated as of v8")]:[]}function wt(i){return i instanceof Number||i instanceof String||i instanceof Boolean?i.valueOf():i}function Kr(i){if(Array.isArray(i))return i.map(Kr);if(i instanceof Object&&!(i instanceof Number||i instanceof String||i instanceof Boolean)){const e={};for(const r in i)e[r]=Kr(i[r]);return e}return wt(i)}function pi(i){const e=i.key,r=i.value,a=i.valueSpec||{},o=i.objectElementValidators||{},u=i.style,d=i.styleSpec,f=i.validateSpec;let _=[];const x=Qe(r);if(x!=="object")return[new fe(e,r,`object expected, ${x} found`)];for(const b in r){const T=b.split(".")[0],A=a[T]||a["*"];let C;if(o[T])C=o[T];else if(a[T])C=f;else if(o["*"])C=o["*"];else{if(!a["*"]){_.push(new fe(e,r[b],`unknown property "${b}"`));continue}C=f}_=_.concat(C({key:(e&&`${e}.`)+b,value:r[b],valueSpec:A,style:u,styleSpec:d,object:r,objectKey:b,validateSpec:f},r))}for(const b in a)o[b]||a[b].required&&a[b].default===void 0&&r[b]===void 0&&_.push(new fe(e,r,`missing required property "${b}"`));return _}function Ts(i){const e=i.value,r=i.valueSpec,a=i.style,o=i.styleSpec,u=i.key,d=i.arrayElementValidator||i.validateSpec;if(Qe(e)!=="array")return[new fe(u,e,`array expected, ${Qe(e)} found`)];if(r.length&&e.length!==r.length)return[new fe(u,e,`array length ${r.length} expected, length ${e.length} found`)];if(r["min-length"]&&e.length<r["min-length"])return[new fe(u,e,`array length at least ${r["min-length"]} expected, length ${e.length} found`)];let f={type:r.value,values:r.values};o.$version<7&&(f.function=r.function),Qe(r.value)==="object"&&(f=r.value);let _=[];for(let x=0;x<e.length;x++)_=_.concat(d({array:e,arrayIndex:x,value:e[x],valueSpec:f,validateSpec:i.validateSpec,style:a,styleSpec:o,key:`${u}[${x}]`}));return _}function Ys(i){const e=i.key,r=i.value,a=i.valueSpec;let o=Qe(r);return o==="number"&&r!=r&&(o="NaN"),o!=="number"?[new fe(e,r,`number expected, ${o} found`)]:"minimum"in a&&r<a.minimum?[new fe(e,r,`${r} is less than the minimum value ${a.minimum}`)]:"maximum"in a&&r>a.maximum?[new fe(e,r,`${r} is greater than the maximum value ${a.maximum}`)]:[]}function Fa(i){const e=i.valueSpec,r=wt(i.value.type);let a,o,u,d={};const f=r!=="categorical"&&i.value.property===void 0,_=!f,x=Qe(i.value.stops)==="array"&&Qe(i.value.stops[0])==="array"&&Qe(i.value.stops[0][0])==="object",b=pi({key:i.key,value:i.value,valueSpec:i.styleSpec.function,validateSpec:i.validateSpec,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(C){if(r==="identity")return[new fe(C.key,C.value,'identity function may not have a "stops" property')];let P=[];const D=C.value;return P=P.concat(Ts({key:C.key,value:D,valueSpec:C.valueSpec,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec,arrayElementValidator:T})),Qe(D)==="array"&&D.length===0&&P.push(new fe(C.key,D,"array must have at least one stop")),P},default:function(C){return C.validateSpec({key:C.key,value:C.value,valueSpec:e,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec})}}});return r==="identity"&&f&&b.push(new fe(i.key,i.value,'missing required property "property"')),r==="identity"||i.value.stops||b.push(new fe(i.key,i.value,'missing required property "stops"')),r==="exponential"&&i.valueSpec.expression&&!vn(i.valueSpec)&&b.push(new fe(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(_&&!Ss(i.valueSpec)?b.push(new fe(i.key,i.value,"property functions not supported")):f&&!So(i.valueSpec)&&b.push(new fe(i.key,i.value,"zoom functions not supported"))),r!=="categorical"&&!x||i.value.property!==void 0||b.push(new fe(i.key,i.value,'"property" property is required')),b;function T(C){let P=[];const D=C.value,V=C.key;if(Qe(D)!=="array")return[new fe(V,D,`array expected, ${Qe(D)} found`)];if(D.length!==2)return[new fe(V,D,`array length 2 expected, length ${D.length} found`)];if(x){if(Qe(D[0])!=="object")return[new fe(V,D,`object expected, ${Qe(D[0])} found`)];if(D[0].zoom===void 0)return[new fe(V,D,"object stop key must have zoom")];if(D[0].value===void 0)return[new fe(V,D,"object stop key must have value")];if(u&&u>wt(D[0].zoom))return[new fe(V,D[0].zoom,"stop zoom values must appear in ascending order")];wt(D[0].zoom)!==u&&(u=wt(D[0].zoom),o=void 0,d={}),P=P.concat(pi({key:`${V}[0]`,value:D[0],valueSpec:{zoom:{}},validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec,objectElementValidators:{zoom:Ys,value:A}}))}else P=P.concat(A({key:`${V}[0]`,value:D[0],valueSpec:{},validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec},D));return ka(Kr(D[1]))?P.concat([new fe(`${V}[1]`,D[1],"expressions are not allowed in function stops.")]):P.concat(C.validateSpec({key:`${V}[1]`,value:D[1],valueSpec:e,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec}))}function A(C,P){const D=Qe(C.value),V=wt(C.value),$=C.value!==null?C.value:P;if(a){if(D!==a)return[new fe(C.key,$,`${D} stop domain type must match previous stop domain type ${a}`)]}else a=D;if(D!=="number"&&D!=="string"&&D!=="boolean")return[new fe(C.key,$,"stop domain value must be a number, string, or boolean")];if(D!=="number"&&r!=="categorical"){let H=`number expected, ${D} found`;return Ss(e)&&r===void 0&&(H+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new fe(C.key,$,H)]}return r!=="categorical"||D!=="number"||isFinite(V)&&Math.floor(V)===V?r!=="categorical"&&D==="number"&&o!==void 0&&V<o?[new fe(C.key,$,"stop domain values must appear in ascending order")]:(o=V,r==="categorical"&&V in d?[new fe(C.key,$,"stop domain values must be unique")]:(d[V]=!0,[])):[new fe(C.key,$,`integer expected, found ${V}`)]}}function Yr(i){const e=(i.expressionContext==="property"?Sn:za)(Kr(i.value),i.valueSpec);if(e.result==="error")return e.value.map(a=>new fe(`${i.key}${a.key}`,i.value,a.message));const r=e.value.expression||e.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!r.outputDefined())return[new fe(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!Zs(r))return[new fe(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!Zs(r))return[new fe(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!Ta(r,["zoom","feature-state"]))return[new fe(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!Sa(r))return[new fe(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Js(i){const e=i.key,r=i.value,a=i.valueSpec,o=[];return Array.isArray(a.values)?a.values.indexOf(wt(r))===-1&&o.push(new fe(e,r,`expected one of [${a.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(a.values).indexOf(wt(r))===-1&&o.push(new fe(e,r,`expected one of [${Object.keys(a.values).join(", ")}], ${JSON.stringify(r)} found`)),o}function Is(i){return Hs(Kr(i.value))?Yr(Qi({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Co(i)}function Co(i){const e=i.value,r=i.key;if(Qe(e)!=="array")return[new fe(r,e,`array expected, ${Qe(e)} found`)];const a=i.styleSpec;let o,u=[];if(e.length<1)return[new fe(r,e,"filter array must have at least 1 element")];switch(u=u.concat(Js({key:`${r}[0]`,value:e[0],valueSpec:a.filter_operator,style:i.style,styleSpec:i.styleSpec})),wt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&wt(e[1])==="$type"&&u.push(new fe(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&u.push(new fe(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(o=Qe(e[1]),o!=="string"&&u.push(new fe(`${r}[1]`,e[1],`string expected, ${o} found`)));for(let d=2;d<e.length;d++)o=Qe(e[d]),wt(e[1])==="$type"?u=u.concat(Js({key:`${r}[${d}]`,value:e[d],valueSpec:a.geometry_type,style:i.style,styleSpec:i.styleSpec})):o!=="string"&&o!=="number"&&o!=="boolean"&&u.push(new fe(`${r}[${d}]`,e[d],`string, number, or boolean expected, ${o} found`));break;case"any":case"all":case"none":for(let d=1;d<e.length;d++)u=u.concat(Co({key:`${r}[${d}]`,value:e[d],style:i.style,styleSpec:i.styleSpec}));break;case"has":case"!has":o=Qe(e[1]),e.length!==2?u.push(new fe(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):o!=="string"&&u.push(new fe(`${r}[1]`,e[1],`string expected, ${o} found`));break;case"within":o=Qe(e[1]),e.length!==2?u.push(new fe(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):o!=="object"&&u.push(new fe(`${r}[1]`,e[1],`object expected, ${o} found`))}return u}function Po(i,e){const r=i.key,a=i.validateSpec,o=i.style,u=i.styleSpec,d=i.value,f=i.objectKey,_=u[`${e}_${i.layerType}`];if(!_)return[];const x=f.match(/^(.*)-transition$/);if(e==="paint"&&x&&_[x[1]]&&_[x[1]].transition)return a({key:r,value:d,valueSpec:u.transition,style:o,styleSpec:u});const b=i.valueSpec||_[f];if(!b)return[new fe(r,d,`unknown property "${f}"`)];let T;if(Qe(d)==="string"&&Ss(b)&&!b.tokens&&(T=/^{([^}]+)}$/.exec(d)))return[new fe(r,d,`"${f}" does not support interpolation syntax
2
2
  Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(T[1])} }\`.`)];const A=[];return i.layerType==="symbol"&&(f==="text-field"&&o&&!o.glyphs&&A.push(new fe(r,d,'use of "text-field" requires a style "glyphs" property')),f==="text-font"&&_t(Kr(d))&&wt(d.type)==="identity"&&A.push(new fe(r,d,'"text-font" does not support identity functions'))),A.concat(a({key:i.key,value:d,valueSpec:b,style:o,styleSpec:u,expressionContext:"property",propertyType:e,propertyKey:f}))}function ko(i){return Po(i,"paint")}function zo(i){return Po(i,"layout")}function Do(i){let e=[];const r=i.value,a=i.key,o=i.style,u=i.styleSpec;r.type||r.ref||e.push(new fe(a,r,'either "type" or "ref" is required'));let d=wt(r.type);const f=wt(r.ref);if(r.id){const _=wt(r.id);for(let x=0;x<i.arrayIndex;x++){const b=o.layers[x];wt(b.id)===_&&e.push(new fe(a,r.id,`duplicate layer id "${r.id}", previously used at line ${b.id.__line__}`))}}if("ref"in r){let _;["type","source","source-layer","filter","layout"].forEach(x=>{x in r&&e.push(new fe(a,r[x],`"${x}" is prohibited for ref layers`))}),o.layers.forEach(x=>{wt(x.id)===f&&(_=x)}),_?_.ref?e.push(new fe(a,r.ref,"ref cannot reference another ref layer")):d=wt(_.type):e.push(new fe(a,r.ref,`ref layer "${f}" not found`))}else if(d!=="background")if(r.source){const _=o.sources&&o.sources[r.source],x=_&&wt(_.type);_?x==="vector"&&d==="raster"?e.push(new fe(a,r.source,`layer "${r.id}" requires a raster source`)):x!=="raster-dem"&&d==="hillshade"?e.push(new fe(a,r.source,`layer "${r.id}" requires a raster-dem source`)):x==="raster"&&d!=="raster"?e.push(new fe(a,r.source,`layer "${r.id}" requires a vector source`)):x!=="vector"||r["source-layer"]?x==="raster-dem"&&d!=="hillshade"?e.push(new fe(a,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):d!=="line"||!r.paint||!r.paint["line-gradient"]||x==="geojson"&&_.lineMetrics||e.push(new fe(a,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new fe(a,r,`layer "${r.id}" must specify a "source-layer"`)):e.push(new fe(a,r.source,`source "${r.source}" not found`))}else e.push(new fe(a,r,'missing required property "source"'));return e=e.concat(pi({key:a,value:r,valueSpec:u.layer,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,objectElementValidators:{"*":()=>[],type:()=>i.validateSpec({key:`${a}.type`,value:r.type,valueSpec:u.layer.type,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,object:r,objectKey:"type"}),filter:Is,layout:_=>pi({layer:r,key:_.key,value:_.value,style:_.style,styleSpec:_.styleSpec,validateSpec:_.validateSpec,objectElementValidators:{"*":x=>zo(Qi({layerType:d},x))}}),paint:_=>pi({layer:r,key:_.key,value:_.value,style:_.style,styleSpec:_.styleSpec,validateSpec:_.validateSpec,objectElementValidators:{"*":x=>ko(Qi({layerType:d},x))}})}})),e}function tr(i){const e=i.value,r=i.key,a=Qe(e);return a!=="string"?[new fe(r,e,`string expected, ${a} found`)]:[]}const Qs={promoteId:function({key:i,value:e}){if(Qe(e)==="string")return tr({key:i,value:e});{const r=[];for(const a in e)r.push(...tr({key:`${i}.${a}`,value:e[a]}));return r}}};function Ti(i){const e=i.value,r=i.key,a=i.styleSpec,o=i.style,u=i.validateSpec;if(!e.type)return[new fe(r,e,'"type" is required')];const d=wt(e.type);let f;switch(d){case"vector":case"raster":return f=pi({key:r,value:e,valueSpec:a[`source_${d.replace("-","_")}`],style:i.style,styleSpec:a,objectElementValidators:Qs,validateSpec:u}),f;case"raster-dem":return f=function(_){var x;const b=(x=_.sourceName)!==null&&x!==void 0?x:"",T=_.value,A=_.styleSpec,C=A.source_raster_dem,P=_.style;let D=[];const V=Qe(T);if(T===void 0)return D;if(V!=="object")return D.push(new fe("source_raster_dem",T,`object expected, ${V} found`)),D;const $=wt(T.encoding)==="custom",H=["redFactor","greenFactor","blueFactor","baseShift"],q=_.value.encoding?`"${_.value.encoding}"`:"Default";for(const Y in T)!$&&H.includes(Y)?D.push(new fe(Y,T[Y],`In "${b}": "${Y}" is only valid when "encoding" is set to "custom". ${q} encoding found`)):C[Y]?D=D.concat(_.validateSpec({key:Y,value:T[Y],valueSpec:C[Y],validateSpec:_.validateSpec,style:P,styleSpec:A})):D.push(new fe(Y,T[Y],`unknown property "${Y}"`));return D}({sourceName:r,value:e,style:i.style,styleSpec:a,validateSpec:u}),f;case"geojson":if(f=pi({key:r,value:e,valueSpec:a.source_geojson,style:o,styleSpec:a,validateSpec:u,objectElementValidators:Qs}),e.cluster)for(const _ in e.clusterProperties){const[x,b]=e.clusterProperties[_],T=typeof x=="string"?[x,["accumulated"],["get",_]]:x;f.push(...Yr({key:`${r}.${_}.map`,value:b,validateSpec:u,expressionContext:"cluster-map"})),f.push(...Yr({key:`${r}.${_}.reduce`,value:T,validateSpec:u,expressionContext:"cluster-reduce"}))}return f;case"video":return pi({key:r,value:e,valueSpec:a.source_video,style:o,validateSpec:u,styleSpec:a});case"image":return pi({key:r,value:e,valueSpec:a.source_image,style:o,validateSpec:u,styleSpec:a});case"canvas":return[new fe(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Js({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:o,validateSpec:u,styleSpec:a})}}function ea(i){const e=i.value,r=i.styleSpec,a=r.light,o=i.style;let u=[];const d=Qe(e);if(e===void 0)return u;if(d!=="object")return u=u.concat([new fe("light",e,`object expected, ${d} found`)]),u;for(const f in e){const _=f.match(/^(.*)-transition$/);u=u.concat(_&&a[_[1]]&&a[_[1]].transition?i.validateSpec({key:f,value:e[f],valueSpec:r.transition,validateSpec:i.validateSpec,style:o,styleSpec:r}):a[f]?i.validateSpec({key:f,value:e[f],valueSpec:a[f],validateSpec:i.validateSpec,style:o,styleSpec:r}):[new fe(f,e[f],`unknown property "${f}"`)])}return u}function Lo(i){const e=i.value,r=i.styleSpec,a=r.terrain,o=i.style;let u=[];const d=Qe(e);if(e===void 0)return u;if(d!=="object")return u=u.concat([new fe("terrain",e,`object expected, ${d} found`)]),u;for(const f in e)u=u.concat(a[f]?i.validateSpec({key:f,value:e[f],valueSpec:a[f],validateSpec:i.validateSpec,style:o,styleSpec:r}):[new fe(f,e[f],`unknown property "${f}"`)]);return u}function Bo(i){let e=[];const r=i.value,a=i.key;if(Array.isArray(r)){const o=[],u=[];for(const d in r)r[d].id&&o.includes(r[d].id)&&e.push(new fe(a,r,`all the sprites' ids must be unique, but ${r[d].id} is duplicated`)),o.push(r[d].id),r[d].url&&u.includes(r[d].url)&&e.push(new fe(a,r,`all the sprites' URLs must be unique, but ${r[d].url} is duplicated`)),u.push(r[d].url),e=e.concat(pi({key:`${a}[${d}]`,value:r[d],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:i.validateSpec}));return e}return tr({key:a,value:r})}const Ro={"*":()=>[],array:Ts,boolean:function(i){const e=i.value,r=i.key,a=Qe(e);return a!=="boolean"?[new fe(r,e,`boolean expected, ${a} found`)]:[]},number:Ys,color:function(i){const e=i.key,r=i.value,a=Qe(r);return a!=="string"?[new fe(e,r,`color expected, ${a} found`)]:it.parse(String(r))?[]:[new fe(e,r,`color expected, "${r}" found`)]},constants:Eo,enum:Js,filter:Is,function:Fa,layer:Do,object:pi,source:Ti,light:ea,terrain:Lo,string:tr,formatted:function(i){return tr(i).length===0?[]:Yr(i)},resolvedImage:function(i){return tr(i).length===0?[]:Yr(i)},padding:function(i){const e=i.key,r=i.value;if(Qe(r)==="array"){if(r.length<1||r.length>4)return[new fe(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];const a={type:"number"};let o=[];for(let u=0;u<r.length;u++)o=o.concat(i.validateSpec({key:`${e}[${u}]`,value:r[u],validateSpec:i.validateSpec,valueSpec:a}));return o}return Ys({key:e,value:r,valueSpec:{}})},variableAnchorOffsetCollection:function(i){const e=i.key,r=i.value,a=Qe(r),o=i.styleSpec;if(a!=="array"||r.length<1||r.length%2!=0)return[new fe(e,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let u=[];for(let d=0;d<r.length;d+=2)u=u.concat(Js({key:`${e}[${d}]`,value:r[d],valueSpec:o.layout_symbol["text-anchor"]})),u=u.concat(Ts({key:`${e}[${d+1}]`,value:r[d+1],valueSpec:{length:2,value:"number"},validateSpec:i.validateSpec,style:i.style,styleSpec:o}));return u},sprite:Bo};function fr(i){const e=i.value,r=i.valueSpec,a=i.styleSpec;return i.validateSpec=fr,r.expression&&_t(wt(e))?Fa(i):r.expression&&ka(Kr(e))?Yr(i):r.type&&Ro[r.type]?Ro[r.type](i):pi(Qi({},i,{valueSpec:r.type?a[r.type]:r}))}function Fo(i){const e=i.value,r=i.key,a=tr(i);return a.length||(e.indexOf("{fontstack}")===-1&&a.push(new fe(r,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&a.push(new fe(r,e,'"glyphs" url must include a "{range}" token'))),a}function Oi(i,e=re){let r=[];return r=r.concat(fr({key:"",value:i,valueSpec:e.$root,styleSpec:e,style:i,validateSpec:fr,objectElementValidators:{glyphs:Fo,"*":()=>[]}})),i.constants&&(r=r.concat(Eo({key:"constants",value:i.constants,style:i,styleSpec:e,validateSpec:fr}))),Oa(r)}function mr(i){return function(e){return i({...e,validateSpec:fr})}}function Oa(i){return[].concat(i).sort((e,r)=>e.line-r.line)}function gr(i){return function(...e){return Oa(i.apply(this,e))}}Oi.source=gr(mr(Ti)),Oi.sprite=gr(mr(Bo)),Oi.glyphs=gr(mr(Fo)),Oi.light=gr(mr(ea)),Oi.terrain=gr(mr(Lo)),Oi.layer=gr(mr(Do)),Oi.filter=gr(mr(Is)),Oi.paintProperty=gr(mr(ko)),Oi.layoutProperty=gr(mr(zo));const _r=Oi,zl=_r.light,An=_r.paintProperty,Oo=_r.layoutProperty;function Va(i,e){let r=!1;if(e&&e.length)for(const a of e)i.fire(new Cr(new Error(a.message))),r=!0;return r}class As{constructor(e,r,a){const o=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;const d=new Int32Array(this.arrayBuffer);e=d[0],this.d=(r=d[1])+2*(a=d[2]);for(let _=0;_<this.d*this.d;_++){const x=d[3+_],b=d[3+_+1];o.push(x===b?null:d.subarray(x,b))}const f=d[3+o.length+1];this.keys=d.subarray(d[3+o.length],f),this.bboxes=d.subarray(f),this.insert=this._insertReadonly}else{this.d=r+2*a;for(let d=0;d<this.d*this.d;d++)o.push([]);this.keys=[],this.bboxes=[]}this.n=r,this.extent=e,this.padding=a,this.scale=r/e,this.uid=0;const u=a/r*e;this.min=-u,this.max=e+u}insert(e,r,a,o,u){this._forEachCell(r,a,o,u,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(r),this.bboxes.push(a),this.bboxes.push(o),this.bboxes.push(u)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,r,a,o,u,d){this.cells[u].push(d)}query(e,r,a,o,u){const d=this.min,f=this.max;if(e<=d&&r<=d&&f<=a&&f<=o&&!u)return Array.prototype.slice.call(this.keys);{const _=[];return this._forEachCell(e,r,a,o,this._queryCell,_,{},u),_}}_queryCell(e,r,a,o,u,d,f,_){const x=this.cells[u];if(x!==null){const b=this.keys,T=this.bboxes;for(let A=0;A<x.length;A++){const C=x[A];if(f[C]===void 0){const P=4*C;(_?_(T[P+0],T[P+1],T[P+2],T[P+3]):e<=T[P+2]&&r<=T[P+3]&&a>=T[P+0]&&o>=T[P+1])?(f[C]=!0,d.push(b[C])):f[C]=!1}}}}_forEachCell(e,r,a,o,u,d,f,_){const x=this._convertToCellCoord(e),b=this._convertToCellCoord(r),T=this._convertToCellCoord(a),A=this._convertToCellCoord(o);for(let C=x;C<=T;C++)for(let P=b;P<=A;P++){const D=this.d*P+C;if((!_||_(this._convertFromCellCoord(C),this._convertFromCellCoord(P),this._convertFromCellCoord(C+1),this._convertFromCellCoord(P+1)))&&u.call(this,e,r,a,o,D,d,f,_))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const e=this.cells,r=3+this.cells.length+1+1;let a=0;for(let d=0;d<this.cells.length;d++)a+=this.cells[d].length;const o=new Int32Array(r+a+this.keys.length+this.bboxes.length);o[0]=this.extent,o[1]=this.n,o[2]=this.padding;let u=r;for(let d=0;d<e.length;d++){const f=e[d];o[3+d]=u,o.set(f,u),u+=f.length}return o[3+e.length]=u,o.set(this.keys,u),u+=this.keys.length,o[3+e.length+1]=u,o.set(this.bboxes,u),u+=this.bboxes.length,o.buffer}static serialize(e,r){const a=e.toArrayBuffer();return r&&r.push(a),{buffer:a}}static deserialize(e){return new As(e.buffer)}}const yr={};function we(i,e,r={}){if(yr[i])throw new Error(`${i} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:i,writeable:!1}),yr[i]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}we("Object",Object),we("TransferableGridIndex",As),we("Color",it),we("Error",Error),we("AJAXError",Ar),we("ResolvedImage",qt),we("StylePropertyFunction",Xs),we("StyleExpression",bn,{omit:["_evaluator"]}),we("ZoomDependentExpression",Da),we("ZoomConstantExpression",wn),we("CompoundExpression",Fi,{omit:["_evaluate"]});for(const i in ws)ws[i]._classRegistryKey||we(`Expression_${i}`,ws[i]);function Na(i){return i&&typeof ArrayBuffer<"u"&&(i instanceof ArrayBuffer||i.constructor&&i.constructor.name==="ArrayBuffer")}function Br(i,e){if(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob)return i;if(Na(i)||Ns(i))return e&&e.push(i),i;if(ArrayBuffer.isView(i)){const r=i;return e&&e.push(r.buffer),r}if(i instanceof ImageData)return e&&e.push(i.data.buffer),i;if(Array.isArray(i)){const r=[];for(const a of i)r.push(Br(a,e));return r}if(typeof i=="object"){const r=i.constructor,a=r._classRegistryKey;if(!a)throw new Error("can't serialize object of unregistered class");if(!yr[a])throw new Error(`${a} is not registered.`);const o=r.serialize?r.serialize(i,e):{};if(r.serialize){if(e&&o===e[e.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const u in i){if(!i.hasOwnProperty(u)||yr[a].omit.indexOf(u)>=0)continue;const d=i[u];o[u]=yr[a].shallow.indexOf(u)>=0?d:Br(d,e)}i instanceof Error&&(o.message=i.message)}if(o.$name)throw new Error("$name property is reserved for worker serialization logic.");return a!=="Object"&&(o.$name=a),o}throw new Error("can't serialize object of type "+typeof i)}function Ms(i){if(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob||Na(i)||Ns(i)||ArrayBuffer.isView(i)||i instanceof ImageData)return i;if(Array.isArray(i))return i.map(Ms);if(typeof i=="object"){const e=i.$name||"Object";if(!yr[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:r}=yr[e];if(!r)throw new Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(i);const a=Object.create(r.prototype);for(const o of Object.keys(i)){if(o==="$name")continue;const u=i[o];a[o]=yr[e].shallow.indexOf(o)>=0?u:Ms(u)}return a}throw new Error("can't deserialize object of type "+typeof i)}class Vo{constructor(){this.first=!0}update(e,r){const a=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=a,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=a,!0):(this.lastFloorZoom>a?(this.lastIntegerZoom=a+1,this.lastIntegerZoomTime=r):this.lastFloorZoom<a&&(this.lastIntegerZoom=a,this.lastIntegerZoomTime=r),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=a,!0))}}const ve={"Latin-1 Supplement":i=>i>=128&&i<=255,Arabic:i=>i>=1536&&i<=1791,"Arabic Supplement":i=>i>=1872&&i<=1919,"Arabic Extended-A":i=>i>=2208&&i<=2303,"Hangul Jamo":i=>i>=4352&&i<=4607,"Unified Canadian Aboriginal Syllabics":i=>i>=5120&&i<=5759,Khmer:i=>i>=6016&&i<=6143,"Unified Canadian Aboriginal Syllabics Extended":i=>i>=6320&&i<=6399,"General Punctuation":i=>i>=8192&&i<=8303,"Letterlike Symbols":i=>i>=8448&&i<=8527,"Number Forms":i=>i>=8528&&i<=8591,"Miscellaneous Technical":i=>i>=8960&&i<=9215,"Control Pictures":i=>i>=9216&&i<=9279,"Optical Character Recognition":i=>i>=9280&&i<=9311,"Enclosed Alphanumerics":i=>i>=9312&&i<=9471,"Geometric Shapes":i=>i>=9632&&i<=9727,"Miscellaneous Symbols":i=>i>=9728&&i<=9983,"Miscellaneous Symbols and Arrows":i=>i>=11008&&i<=11263,"CJK Radicals Supplement":i=>i>=11904&&i<=12031,"Kangxi Radicals":i=>i>=12032&&i<=12255,"Ideographic Description Characters":i=>i>=12272&&i<=12287,"CJK Symbols and Punctuation":i=>i>=12288&&i<=12351,Hiragana:i=>i>=12352&&i<=12447,Katakana:i=>i>=12448&&i<=12543,Bopomofo:i=>i>=12544&&i<=12591,"Hangul Compatibility Jamo":i=>i>=12592&&i<=12687,Kanbun:i=>i>=12688&&i<=12703,"Bopomofo Extended":i=>i>=12704&&i<=12735,"CJK Strokes":i=>i>=12736&&i<=12783,"Katakana Phonetic Extensions":i=>i>=12784&&i<=12799,"Enclosed CJK Letters and Months":i=>i>=12800&&i<=13055,"CJK Compatibility":i=>i>=13056&&i<=13311,"CJK Unified Ideographs Extension A":i=>i>=13312&&i<=19903,"Yijing Hexagram Symbols":i=>i>=19904&&i<=19967,"CJK Unified Ideographs":i=>i>=19968&&i<=40959,"Yi Syllables":i=>i>=40960&&i<=42127,"Yi Radicals":i=>i>=42128&&i<=42191,"Hangul Jamo Extended-A":i=>i>=43360&&i<=43391,"Hangul Syllables":i=>i>=44032&&i<=55215,"Hangul Jamo Extended-B":i=>i>=55216&&i<=55295,"Private Use Area":i=>i>=57344&&i<=63743,"CJK Compatibility Ideographs":i=>i>=63744&&i<=64255,"Arabic Presentation Forms-A":i=>i>=64336&&i<=65023,"Vertical Forms":i=>i>=65040&&i<=65055,"CJK Compatibility Forms":i=>i>=65072&&i<=65103,"Small Form Variants":i=>i>=65104&&i<=65135,"Arabic Presentation Forms-B":i=>i>=65136&&i<=65279,"Halfwidth and Fullwidth Forms":i=>i>=65280&&i<=65519};function Mn(i){for(const e of i)if(Cn(e.charCodeAt(0)))return!0;return!1}function En(i){for(const e of i)if(!Dl(e.charCodeAt(0)))return!1;return!0}function Dl(i){return!(ve.Arabic(i)||ve["Arabic Supplement"](i)||ve["Arabic Extended-A"](i)||ve["Arabic Presentation Forms-A"](i)||ve["Arabic Presentation Forms-B"](i))}function Cn(i){return!(i!==746&&i!==747&&(i<4352||!(ve["Bopomofo Extended"](i)||ve.Bopomofo(i)||ve["CJK Compatibility Forms"](i)&&!(i>=65097&&i<=65103)||ve["CJK Compatibility Ideographs"](i)||ve["CJK Compatibility"](i)||ve["CJK Radicals Supplement"](i)||ve["CJK Strokes"](i)||!(!ve["CJK Symbols and Punctuation"](i)||i>=12296&&i<=12305||i>=12308&&i<=12319||i===12336)||ve["CJK Unified Ideographs Extension A"](i)||ve["CJK Unified Ideographs"](i)||ve["Enclosed CJK Letters and Months"](i)||ve["Hangul Compatibility Jamo"](i)||ve["Hangul Jamo Extended-A"](i)||ve["Hangul Jamo Extended-B"](i)||ve["Hangul Jamo"](i)||ve["Hangul Syllables"](i)||ve.Hiragana(i)||ve["Ideographic Description Characters"](i)||ve.Kanbun(i)||ve["Kangxi Radicals"](i)||ve["Katakana Phonetic Extensions"](i)||ve.Katakana(i)&&i!==12540||!(!ve["Halfwidth and Fullwidth Forms"](i)||i===65288||i===65289||i===65293||i>=65306&&i<=65310||i===65339||i===65341||i===65343||i>=65371&&i<=65503||i===65507||i>=65512&&i<=65519)||!(!ve["Small Form Variants"](i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||ve["Unified Canadian Aboriginal Syllabics"](i)||ve["Unified Canadian Aboriginal Syllabics Extended"](i)||ve["Vertical Forms"](i)||ve["Yijing Hexagram Symbols"](i)||ve["Yi Syllables"](i)||ve["Yi Radicals"](i))))}function No(i){return!(Cn(i)||function(e){return!!(ve["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||ve["General Punctuation"](e)&&(e===8214||e===8224||e===8225||e===8240||e===8241||e===8251||e===8252||e===8258||e===8263||e===8264||e===8265||e===8273)||ve["Letterlike Symbols"](e)||ve["Number Forms"](e)||ve["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||e===9003||e>=9085&&e<=9114||e>=9150&&e<=9165||e===9167||e>=9169&&e<=9179||e>=9186&&e<=9215)||ve["Control Pictures"](e)&&e!==9251||ve["Optical Character Recognition"](e)||ve["Enclosed Alphanumerics"](e)||ve["Geometric Shapes"](e)||ve["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||ve["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||ve["CJK Symbols and Punctuation"](e)||ve.Katakana(e)||ve["Private Use Area"](e)||ve["CJK Compatibility Forms"](e)||ve["Small Form Variants"](e)||ve["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(i))}function Uo(i){return i>=1424&&i<=2303||ve["Arabic Presentation Forms-A"](i)||ve["Arabic Presentation Forms-B"](i)}function $o(i,e){return!(!e&&Uo(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||ve.Khmer(i))}function Ll(i){for(const e of i)if(Uo(e.charCodeAt(0)))return!0;return!1}const Pn="deferred",kn="loading",zn="loaded";let Dn=null,di="unavailable",Rr=null;const ta=function(i){i&&typeof i=="string"&&i.indexOf("NetworkError")>-1&&(di="error"),Dn&&Dn(i)};function Ln(){ia.fire(new Er("pluginStateChange",{pluginStatus:di,pluginURL:Rr}))}const ia=new jr,Bn=function(){return di},jo=function(){if(di!==Pn||!Rr)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");di=kn,Ln(),Rr&&js({url:Rr},i=>{i?ta(i):(di=zn,Ln())})},Ii={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>di===zn||Ii.applyArabicShaping!=null,isLoading:()=>di===kn,setState(i){if(!ki())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");di=i.pluginStatus,Rr=i.pluginURL},isParsed(){if(!ki())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return Ii.applyArabicShaping!=null&&Ii.processBidirectionalText!=null&&Ii.processStyledBidirectionalText!=null},getPluginURL(){if(!ki())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return Rr}};class ht{constructor(e,r){this.zoom=e,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.zoomHistory=r.zoomHistory,this.transition=r.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Vo,this.transition={})}isSupportedScript(e){return function(r,a){for(const o of r)if(!$o(o.charCodeAt(0),a))return!1;return!0}(e,Ii.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const e=this.zoom,r=e-Math.floor(e),a=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*a}:{fromScale:.5,toScale:1,t:1-(1-a)*r}}}class Ua{constructor(e,r){this.property=e,this.value=r,this.expression=function(a,o){if(_t(a))return new Xs(a,o);if(ka(a)){const u=Sn(a,o);if(u.result==="error")throw new Error(u.value.map(d=>`${d.key}: ${d.message}`).join(", "));return u.value}{let u=a;return o.type==="color"&&typeof a=="string"?u=it.parse(a):o.type!=="padding"||typeof a!="number"&&!Array.isArray(a)?o.type==="variableAnchorOffsetCollection"&&Array.isArray(a)&&(u=Bi.parse(a)):u=bi.parse(a),{kind:"constant",evaluate:()=>u}}}(r===void 0?e.specification.default:r,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,r,a){return this.property.possiblyEvaluate(this,e,r,a)}}class Rn{constructor(e){this.property=e,this.value=new Ua(e,void 0)}transitioned(e,r){return new Zo(this.property,this.value,r,$t({},e.transition,this.transition),e.now)}untransitioned(){return new Zo(this.property,this.value,null,{},0)}}class qo{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return $i(this._values[e].value.value)}setValue(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Rn(this._values[e].property)),this._values[e].value=new Ua(this._values[e].property,r===null?void 0:$i(r))}getTransition(e){return $i(this._values[e].transition)}setTransition(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Rn(this._values[e].property)),this._values[e].transition=$i(r)||void 0}serialize(){const e={};for(const r of Object.keys(this._values)){const a=this.getValue(r);a!==void 0&&(e[r]=a);const o=this.getTransition(r);o!==void 0&&(e[`${r}-transition`]=o)}return e}transitioned(e,r){const a=new Go(this._properties);for(const o of Object.keys(this._values))a._values[o]=this._values[o].transitioned(e,r._values[o]);return a}untransitioned(){const e=new Go(this._properties);for(const r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}}class Zo{constructor(e,r,a,o,u){this.property=e,this.value=r,this.begin=u+o.delay||0,this.end=this.begin+o.duration||0,e.specification.transition&&(o.delay||o.duration)&&(this.prior=a)}possiblyEvaluate(e,r,a){const o=e.now||0,u=this.value.possiblyEvaluate(e,r,a),d=this.prior;if(d){if(o>this.end)return this.prior=null,u;if(this.value.isDataDriven())return this.prior=null,u;if(o<this.begin)return d.possiblyEvaluate(e,r,a);{const f=(o-this.begin)/(this.end-this.begin);return this.property.interpolate(d.possiblyEvaluate(e,r,a),u,function(_){if(_<=0)return 0;if(_>=1)return 1;const x=_*_,b=x*_;return 4*(_<.5?b:3*(_-x)+b-.75)}(f))}}return u}}class Go{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,r,a){const o=new $a(this._properties);for(const u of Object.keys(this._values))o._values[u]=this._values[u].possiblyEvaluate(e,r,a);return o}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Bl{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}hasValue(e){return this._values[e].value!==void 0}getValue(e){return $i(this._values[e].value)}setValue(e,r){this._values[e]=new Ua(this._values[e].property,r===null?void 0:$i(r))}serialize(){const e={};for(const r of Object.keys(this._values)){const a=this.getValue(r);a!==void 0&&(e[r]=a)}return e}possiblyEvaluate(e,r,a){const o=new $a(this._properties);for(const u of Object.keys(this._values))o._values[u]=this._values[u].possiblyEvaluate(e,r,a);return o}}class ri{constructor(e,r,a){this.property=e,this.value=r,this.parameters=a}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,r,a,o){return this.property.evaluate(this.value,this.parameters,e,r,a,o)}}class $a{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Ce{constructor(e){this.specification=e}possiblyEvaluate(e,r){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(r)}interpolate(e,r,a){const o=wi[this.specification.type];return o?o(e,r,a):e}}class De{constructor(e,r){this.specification=e,this.overrides=r}possiblyEvaluate(e,r,a,o){return new ri(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(r,null,{},a,o)}:e.expression,r)}interpolate(e,r,a){if(e.value.kind!=="constant"||r.value.kind!=="constant")return e;if(e.value.value===void 0||r.value.value===void 0)return new ri(this,{kind:"constant",value:void 0},e.parameters);const o=wi[this.specification.type];if(o){const u=o(e.value.value,r.value.value,a);return new ri(this,{kind:"constant",value:u},e.parameters)}return e}evaluate(e,r,a,o,u,d){return e.kind==="constant"?e.value:e.evaluate(r,a,o,u,d)}}class ra extends De{possiblyEvaluate(e,r,a,o){if(e.value===void 0)return new ri(this,{kind:"constant",value:void 0},r);if(e.expression.kind==="constant"){const u=e.expression.evaluate(r,null,{},a,o),d=e.property.specification.type==="resolvedImage"&&typeof u!="string"?u.name:u,f=this._calculate(d,d,d,r);return new ri(this,{kind:"constant",value:f},r)}if(e.expression.kind==="camera"){const u=this._calculate(e.expression.evaluate({zoom:r.zoom-1}),e.expression.evaluate({zoom:r.zoom}),e.expression.evaluate({zoom:r.zoom+1}),r);return new ri(this,{kind:"constant",value:u},r)}return new ri(this,e.expression,r)}evaluate(e,r,a,o,u,d){if(e.kind==="source"){const f=e.evaluate(r,a,o,u,d);return this._calculate(f,f,f,r)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(r.zoom)-1},a,o),e.evaluate({zoom:Math.floor(r.zoom)},a,o),e.evaluate({zoom:Math.floor(r.zoom)+1},a,o),r):e.value}_calculate(e,r,a,o){return o.zoom>o.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:a,to:r}}interpolate(e){return e}}class Fn{constructor(e){this.specification=e}possiblyEvaluate(e,r,a,o){if(e.value!==void 0){if(e.expression.kind==="constant"){const u=e.expression.evaluate(r,null,{},a,o);return this._calculate(u,u,u,r)}return this._calculate(e.expression.evaluate(new ht(Math.floor(r.zoom-1),r)),e.expression.evaluate(new ht(Math.floor(r.zoom),r)),e.expression.evaluate(new ht(Math.floor(r.zoom+1),r)),r)}}_calculate(e,r,a,o){return o.zoom>o.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:a,to:r}}interpolate(e){return e}}class On{constructor(e){this.specification=e}possiblyEvaluate(e,r,a,o){return!!e.expression.evaluate(r,null,{},a,o)}interpolate(){return!1}}class Mt{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const r in e){const a=e[r];a.specification.overridable&&this.overridableProperties.push(r);const o=this.defaultPropertyValues[r]=new Ua(a,void 0),u=this.defaultTransitionablePropertyValues[r]=new Rn(a);this.defaultTransitioningPropertyValues[r]=u.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=o.possiblyEvaluate({})}}}we("DataDrivenProperty",De),we("DataConstantProperty",Ce),we("CrossFadedDataDrivenProperty",ra),we("CrossFadedProperty",Fn),we("ColorRampProperty",On);const Vn="-transition";class Vi extends jr{constructor(e,r){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1},e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new Bl(r.layout)),r.paint)){this._transitionablePaint=new qo(r.paint);for(const a in e.paint)this.setPaintProperty(a,e.paint[a],{validate:!1});for(const a in e.layout)this.setLayoutProperty(a,e.layout[a],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new $a(r.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,r,a={}){r!=null&&this._validate(Oo,`layers.${this.id}.layout.${e}`,e,r,a)||(e!=="visibility"?this._unevaluatedLayout.setValue(e,r):this.visibility=r)}getPaintProperty(e){return e.endsWith(Vn)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,r,a={}){if(r!=null&&this._validate(An,`layers.${this.id}.paint.${e}`,e,r,a))return!1;if(e.endsWith(Vn))return this._transitionablePaint.setTransition(e.slice(0,-11),r||void 0),!1;{const o=this._transitionablePaint._values[e],u=o.property.specification["property-type"]==="cross-faded-data-driven",d=o.value.isDataDriven(),f=o.value;this._transitionablePaint.setValue(e,r),this._handleSpecialPaintPropertyUpdate(e);const _=this._transitionablePaint._values[e].value;return _.isDataDriven()||d||u||this._handleOverridablePaintPropertyUpdate(e,f,_)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,r,a){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||this.visibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,r){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,r)}serialize(){const e={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&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),us(e,(r,a)=>!(r===void 0||a==="layout"&&!Object.keys(r).length||a==="paint"&&!Object.keys(r).length))}_validate(e,r,a,o,u={}){return(!u||u.validate!==!1)&&Va(this,e.call(_r,{key:r,layerType:this.type,objectKey:a,value:o,styleSpec:re,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const r=this.paint.get(e);if(r instanceof ri&&Ss(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}}const Xo={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Jr{constructor(e,r){this._structArray=e,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class St{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,r){return e._trim(),r&&(e.isTransferred=!0,r.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const r=Object.create(this.prototype);return r.arrayBuffer=e.arrayBuffer,r.length=e.length,r.capacity=e.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function xt(i,e=1){let r=0,a=0;return{members:i.map(o=>{const u=Xo[o.type].BYTES_PER_ELEMENT,d=r=Es(r,Math.max(e,u)),f=o.components||1;return a=Math.max(a,u),r+=u*f,{name:o.name,type:o.type,components:f,offset:d}}),size:Es(r,Math.max(a,e)),alignment:e}}function Es(i,e){return Math.ceil(i/e)*e}class sa extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){const a=this.length;return this.resize(a+1),this.emplace(a,e,r)}emplace(e,r,a){const o=2*e;return this.int16[o+0]=r,this.int16[o+1]=a,e}}sa.prototype.bytesPerElement=4,we("StructArrayLayout2i4",sa);class aa extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,r,a)}emplace(e,r,a,o){const u=3*e;return this.int16[u+0]=r,this.int16[u+1]=a,this.int16[u+2]=o,e}}aa.prototype.bytesPerElement=6,we("StructArrayLayout3i6",aa);class Qr extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,o){const u=this.length;return this.resize(u+1),this.emplace(u,e,r,a,o)}emplace(e,r,a,o,u){const d=4*e;return this.int16[d+0]=r,this.int16[d+1]=a,this.int16[d+2]=o,this.int16[d+3]=u,e}}Qr.prototype.bytesPerElement=8,we("StructArrayLayout4i8",Qr);class Nn extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,u,d){const f=this.length;return this.resize(f+1),this.emplace(f,e,r,a,o,u,d)}emplace(e,r,a,o,u,d,f){const _=6*e;return this.int16[_+0]=r,this.int16[_+1]=a,this.int16[_+2]=o,this.int16[_+3]=u,this.int16[_+4]=d,this.int16[_+5]=f,e}}Nn.prototype.bytesPerElement=12,we("StructArrayLayout2i4i12",Nn);class Un extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,u,d){const f=this.length;return this.resize(f+1),this.emplace(f,e,r,a,o,u,d)}emplace(e,r,a,o,u,d,f){const _=4*e,x=8*e;return this.int16[_+0]=r,this.int16[_+1]=a,this.uint8[x+4]=o,this.uint8[x+5]=u,this.uint8[x+6]=d,this.uint8[x+7]=f,e}}Un.prototype.bytesPerElement=8,we("StructArrayLayout2i4ub8",Un);class Cs extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){const a=this.length;return this.resize(a+1),this.emplace(a,e,r)}emplace(e,r,a){const o=2*e;return this.float32[o+0]=r,this.float32[o+1]=a,e}}Cs.prototype.bytesPerElement=8,we("StructArrayLayout2f8",Cs);class $n extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,u,d,f,_,x,b){const T=this.length;return this.resize(T+1),this.emplace(T,e,r,a,o,u,d,f,_,x,b)}emplace(e,r,a,o,u,d,f,_,x,b,T){const A=10*e;return this.uint16[A+0]=r,this.uint16[A+1]=a,this.uint16[A+2]=o,this.uint16[A+3]=u,this.uint16[A+4]=d,this.uint16[A+5]=f,this.uint16[A+6]=_,this.uint16[A+7]=x,this.uint16[A+8]=b,this.uint16[A+9]=T,e}}$n.prototype.bytesPerElement=20,we("StructArrayLayout10ui20",$n);class jn extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,u,d,f,_,x,b,T,A){const C=this.length;return this.resize(C+1),this.emplace(C,e,r,a,o,u,d,f,_,x,b,T,A)}emplace(e,r,a,o,u,d,f,_,x,b,T,A,C){const P=12*e;return this.int16[P+0]=r,this.int16[P+1]=a,this.int16[P+2]=o,this.int16[P+3]=u,this.uint16[P+4]=d,this.uint16[P+5]=f,this.uint16[P+6]=_,this.uint16[P+7]=x,this.int16[P+8]=b,this.int16[P+9]=T,this.int16[P+10]=A,this.int16[P+11]=C,e}}jn.prototype.bytesPerElement=24,we("StructArrayLayout4i4ui4i24",jn);class et extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,r,a)}emplace(e,r,a,o){const u=3*e;return this.float32[u+0]=r,this.float32[u+1]=a,this.float32[u+2]=o,e}}et.prototype.bytesPerElement=12,we("StructArrayLayout3f12",et);class h extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint32[1*e+0]=r,e}}h.prototype.bytesPerElement=4,we("StructArrayLayout1ul4",h);class t extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,u,d,f,_,x){const b=this.length;return this.resize(b+1),this.emplace(b,e,r,a,o,u,d,f,_,x)}emplace(e,r,a,o,u,d,f,_,x,b){const T=10*e,A=5*e;return this.int16[T+0]=r,this.int16[T+1]=a,this.int16[T+2]=o,this.int16[T+3]=u,this.int16[T+4]=d,this.int16[T+5]=f,this.uint32[A+3]=_,this.uint16[T+8]=x,this.uint16[T+9]=b,e}}t.prototype.bytesPerElement=20,we("StructArrayLayout6i1ul2ui20",t);class s extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,u,d){const f=this.length;return this.resize(f+1),this.emplace(f,e,r,a,o,u,d)}emplace(e,r,a,o,u,d,f){const _=6*e;return this.int16[_+0]=r,this.int16[_+1]=a,this.int16[_+2]=o,this.int16[_+3]=u,this.int16[_+4]=d,this.int16[_+5]=f,e}}s.prototype.bytesPerElement=12,we("StructArrayLayout2i2i2i12",s);class n extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,u){const d=this.length;return this.resize(d+1),this.emplace(d,e,r,a,o,u)}emplace(e,r,a,o,u,d){const f=4*e,_=8*e;return this.float32[f+0]=r,this.float32[f+1]=a,this.float32[f+2]=o,this.int16[_+6]=u,this.int16[_+7]=d,e}}n.prototype.bytesPerElement=16,we("StructArrayLayout2f1f2i16",n);class l extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a,o){const u=this.length;return this.resize(u+1),this.emplace(u,e,r,a,o)}emplace(e,r,a,o,u){const d=12*e,f=3*e;return this.uint8[d+0]=r,this.uint8[d+1]=a,this.float32[f+1]=o,this.float32[f+2]=u,e}}l.prototype.bytesPerElement=12,we("StructArrayLayout2ub2f12",l);class p extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,r,a)}emplace(e,r,a,o){const u=3*e;return this.uint16[u+0]=r,this.uint16[u+1]=a,this.uint16[u+2]=o,e}}p.prototype.bytesPerElement=6,we("StructArrayLayout3ui6",p);class m extends St{_refreshViews(){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)}emplaceBack(e,r,a,o,u,d,f,_,x,b,T,A,C,P,D,V,$){const H=this.length;return this.resize(H+1),this.emplace(H,e,r,a,o,u,d,f,_,x,b,T,A,C,P,D,V,$)}emplace(e,r,a,o,u,d,f,_,x,b,T,A,C,P,D,V,$,H){const q=24*e,Y=12*e,Q=48*e;return this.int16[q+0]=r,this.int16[q+1]=a,this.uint16[q+2]=o,this.uint16[q+3]=u,this.uint32[Y+2]=d,this.uint32[Y+3]=f,this.uint32[Y+4]=_,this.uint16[q+10]=x,this.uint16[q+11]=b,this.uint16[q+12]=T,this.float32[Y+7]=A,this.float32[Y+8]=C,this.uint8[Q+36]=P,this.uint8[Q+37]=D,this.uint8[Q+38]=V,this.uint32[Y+10]=$,this.int16[q+22]=H,e}}m.prototype.bytesPerElement=48,we("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",m);class g extends St{_refreshViews(){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)}emplaceBack(e,r,a,o,u,d,f,_,x,b,T,A,C,P,D,V,$,H,q,Y,Q,oe,be,Ae,xe,ye,de,Se){const me=this.length;return this.resize(me+1),this.emplace(me,e,r,a,o,u,d,f,_,x,b,T,A,C,P,D,V,$,H,q,Y,Q,oe,be,Ae,xe,ye,de,Se)}emplace(e,r,a,o,u,d,f,_,x,b,T,A,C,P,D,V,$,H,q,Y,Q,oe,be,Ae,xe,ye,de,Se,me){const ue=32*e,ke=16*e;return this.int16[ue+0]=r,this.int16[ue+1]=a,this.int16[ue+2]=o,this.int16[ue+3]=u,this.int16[ue+4]=d,this.int16[ue+5]=f,this.int16[ue+6]=_,this.int16[ue+7]=x,this.uint16[ue+8]=b,this.uint16[ue+9]=T,this.uint16[ue+10]=A,this.uint16[ue+11]=C,this.uint16[ue+12]=P,this.uint16[ue+13]=D,this.uint16[ue+14]=V,this.uint16[ue+15]=$,this.uint16[ue+16]=H,this.uint16[ue+17]=q,this.uint16[ue+18]=Y,this.uint16[ue+19]=Q,this.uint16[ue+20]=oe,this.uint16[ue+21]=be,this.uint16[ue+22]=Ae,this.uint32[ke+12]=xe,this.float32[ke+13]=ye,this.float32[ke+14]=de,this.uint16[ue+30]=Se,this.uint16[ue+31]=me,e}}g.prototype.bytesPerElement=64,we("StructArrayLayout8i15ui1ul2f2ui64",g);class y extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.float32[1*e+0]=r,e}}y.prototype.bytesPerElement=4,we("StructArrayLayout1f4",y);class v extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,r,a)}emplace(e,r,a,o){const u=3*e;return this.uint16[6*e+0]=r,this.float32[u+1]=a,this.float32[u+2]=o,e}}v.prototype.bytesPerElement=12,we("StructArrayLayout1ui2f12",v);class w extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,r,a)}emplace(e,r,a,o){const u=4*e;return this.uint32[2*e+0]=r,this.uint16[u+2]=a,this.uint16[u+3]=o,e}}w.prototype.bytesPerElement=8,we("StructArrayLayout1ul2ui8",w);class S extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){const a=this.length;return this.resize(a+1),this.emplace(a,e,r)}emplace(e,r,a){const o=2*e;return this.uint16[o+0]=r,this.uint16[o+1]=a,e}}S.prototype.bytesPerElement=4,we("StructArrayLayout2ui4",S);class E extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint16[1*e+0]=r,e}}E.prototype.bytesPerElement=2,we("StructArrayLayout1ui2",E);class B extends St{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a,o){const u=this.length;return this.resize(u+1),this.emplace(u,e,r,a,o)}emplace(e,r,a,o,u){const d=4*e;return this.float32[d+0]=r,this.float32[d+1]=a,this.float32[d+2]=o,this.float32[d+3]=u,e}}B.prototype.bytesPerElement=16,we("StructArrayLayout4f16",B);class L extends Jr{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new Be(this.anchorPointX,this.anchorPointY)}}L.prototype.size=20;class F extends t{get(e){return new L(this,e)}}we("CollisionBoxArray",F);class z extends Jr{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}z.prototype.size=48;class G extends m{get(e){return new z(this,e)}}we("PlacedSymbolArray",G);class J extends Jr{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}J.prototype.size=64;class U extends g{get(e){return new J(this,e)}}we("SymbolInstanceArray",U);class X extends y{getoffsetX(e){return this.float32[1*e+0]}}we("GlyphOffsetArray",X);class ee extends aa{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}we("SymbolLineVertexArray",ee);class te extends Jr{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}te.prototype.size=12;class ne extends v{get(e){return new te(this,e)}}we("TextAnchorOffsetArray",ne);class he extends Jr{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}he.prototype.size=8;class ce extends w{get(e){return new he(this,e)}}we("FeatureIndexArray",ce);class pe extends sa{}class Ie extends sa{}class qe extends sa{}class _e extends Nn{}class Le extends Un{}class Me extends Cs{}class rt extends $n{}class je extends jn{}class Ne extends et{}class Ze extends h{}class Tt extends s{}class lt extends l{}class Zt extends p{}class Lt extends S{}const Et=xt([{name:"a_pos",components:2,type:"Int16"}],4),{members:Ai}=Et;class ut{constructor(e=[]){this.segments=e}prepareSegment(e,r,a,o){let u=this.segments[this.segments.length-1];return e>ut.MAX_VERTEX_ARRAY_LENGTH&&ti(`Max vertices per segment is ${ut.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!u||u.vertexLength+e>ut.MAX_VERTEX_ARRAY_LENGTH||u.sortKey!==o)&&(u={vertexOffset:r.length,primitiveOffset:a.length,vertexLength:0,primitiveLength:0},o!==void 0&&(u.sortKey=o),this.segments.push(u)),u}get(){return this.segments}destroy(){for(const e of this.segments)for(const r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,a,o){return new ut([{vertexOffset:e,primitiveOffset:r,vertexLength:a,primitiveLength:o,vaos:{},sortKey:0}])}}function ir(i,e){return 256*(i=Ki(Math.floor(i),0,255))+Ki(Math.floor(e),0,255)}ut.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,we("SegmentVector",ut);const rr=xt([{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"}]);var Fr={exports:{}},es={exports:{}};es.exports=function(i,e){var r,a,o,u,d,f,_,x;for(a=i.length-(r=3&i.length),o=e,d=3432918353,f=461845907,x=0;x<a;)_=255&i.charCodeAt(x)|(255&i.charCodeAt(++x))<<8|(255&i.charCodeAt(++x))<<16|(255&i.charCodeAt(++x))<<24,++x,o=27492+(65535&(u=5*(65535&(o=(o^=_=(65535&(_=(_=(65535&_)*d+(((_>>>16)*d&65535)<<16)&4294967295)<<15|_>>>17))*f+(((_>>>16)*f&65535)<<16)&4294967295)<<13|o>>>19))+((5*(o>>>16)&65535)<<16)&4294967295))+((58964+(u>>>16)&65535)<<16);switch(_=0,r){case 3:_^=(255&i.charCodeAt(x+2))<<16;case 2:_^=(255&i.charCodeAt(x+1))<<8;case 1:o^=_=(65535&(_=(_=(65535&(_^=255&i.charCodeAt(x)))*d+(((_>>>16)*d&65535)<<16)&4294967295)<<15|_>>>17))*f+(((_>>>16)*f&65535)<<16)&4294967295}return o^=i.length,o=2246822507*(65535&(o^=o>>>16))+((2246822507*(o>>>16)&65535)<<16)&4294967295,o=3266489909*(65535&(o^=o>>>13))+((3266489909*(o>>>16)&65535)<<16)&4294967295,(o^=o>>>16)>>>0};var Ps=es.exports,Kt={exports:{}};Kt.exports=function(i,e){for(var r,a=i.length,o=e^a,u=0;a>=4;)r=1540483477*(65535&(r=255&i.charCodeAt(u)|(255&i.charCodeAt(++u))<<8|(255&i.charCodeAt(++u))<<16|(255&i.charCodeAt(++u))<<24))+((1540483477*(r>>>16)&65535)<<16),o=1540483477*(65535&o)+((1540483477*(o>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),a-=4,++u;switch(a){case 3:o^=(255&i.charCodeAt(u+2))<<16;case 2:o^=(255&i.charCodeAt(u+1))<<8;case 1:o=1540483477*(65535&(o^=255&i.charCodeAt(u)))+((1540483477*(o>>>16)&65535)<<16)}return o=1540483477*(65535&(o^=o>>>13))+((1540483477*(o>>>16)&65535)<<16),(o^=o>>>15)>>>0};var Gt=Ps,si=Kt.exports;Fr.exports=Gt,Fr.exports.murmur3=Gt,Fr.exports.murmur2=si;var ts=ie(Fr.exports);class It{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,a,o){this.ids.push(Bt(e)),this.positions.push(r,a,o)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const r=Bt(e);let a=0,o=this.ids.length-1;for(;a<o;){const d=a+o>>1;this.ids[d]>=r?o=d:a=d+1}const u=[];for(;this.ids[a]===r;)u.push({index:this.positions[3*a],start:this.positions[3*a+1],end:this.positions[3*a+2]}),a++;return u}static serialize(e,r){const a=new Float64Array(e.ids),o=new Uint32Array(e.positions);return fi(a,o,0,a.length-1),r&&r.push(a.buffer,o.buffer),{ids:a,positions:o}}static deserialize(e){const r=new It;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}}function Bt(i){const e=+i;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:ts(String(i))}function fi(i,e,r,a){for(;r<a;){const o=i[r+a>>1];let u=r-1,d=a+1;for(;;){do u++;while(i[u]<o);do d--;while(i[d]>o);if(u>=d)break;At(i,u,d),At(e,3*u,3*d),At(e,3*u+1,3*d+1),At(e,3*u+2,3*d+2)}d-r<a-d?(fi(i,e,r,d),r=d+1):(fi(i,e,d+1,a),a=d)}}function At(i,e,r){const a=i[e];i[e]=i[r],i[r]=a}we("FeaturePositionMap",It);class is{constructor(e,r){this.gl=e.gl,this.location=r}}class ja extends is{constructor(e,r){super(e,r),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}}class Wo extends is{constructor(e,r){super(e,r),this.current=[0,0,0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]&&e[3]===this.current[3]||(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}}class Ho extends is{constructor(e,r){super(e,r),this.current=it.transparent}set(e){e.r===this.current.r&&e.g===this.current.g&&e.b===this.current.b&&e.a===this.current.a||(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}}const Rl=new Float32Array(16);function qn(i){return[ir(255*i.r,255*i.g),ir(255*i.b,255*i.a)]}class sr{constructor(e,r,a){this.value=e,this.uniformNames=r.map(o=>`u_${o}`),this.type=a}setUniform(e,r,a){e.set(a.constantOr(this.value))}getBinding(e,r,a){return this.type==="color"?new Ho(e,r):new ja(e,r)}}class rs{constructor(e,r){this.uniformNames=r.map(a=>`u_${a}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=e.tlbr}setUniform(e,r,a,o){const 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)}getBinding(e,r,a){return a.substr(0,9)==="u_pattern"?new Wo(e,r):new ja(e,r)}}class ar{constructor(e,r,a,o){this.expression=e,this.type=a,this.maxValue=0,this.paintVertexAttributes=r.map(u=>({name:`a_${u}`,type:"Float32",components:a==="color"?2:1,offset:0})),this.paintVertexArray=new o}populatePaintArray(e,r,a,o,u){const d=this.paintVertexArray.length,f=this.expression.evaluate(new ht(0),r,{},o,[],u);this.paintVertexArray.resize(e),this._setPaintValue(d,e,f)}updatePaintArray(e,r,a,o){const u=this.expression.evaluate({zoom:0},a,o);this._setPaintValue(e,r,u)}_setPaintValue(e,r,a){if(this.type==="color"){const o=qn(a);for(let u=e;u<r;u++)this.paintVertexArray.emplace(u,o[0],o[1])}else{for(let o=e;o<r;o++)this.paintVertexArray.emplace(o,a);this.maxValue=Math.max(this.maxValue,Math.abs(a))}}upload(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))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Ni{constructor(e,r,a,o,u,d){this.expression=e,this.uniformNames=r.map(f=>`u_${f}_t`),this.type=a,this.useIntegerZoom=o,this.zoom=u,this.maxValue=0,this.paintVertexAttributes=r.map(f=>({name:`a_${f}`,type:"Float32",components:a==="color"?4:2,offset:0})),this.paintVertexArray=new d}populatePaintArray(e,r,a,o,u){const d=this.expression.evaluate(new ht(this.zoom),r,{},o,[],u),f=this.expression.evaluate(new ht(this.zoom+1),r,{},o,[],u),_=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(_,e,d,f)}updatePaintArray(e,r,a,o){const u=this.expression.evaluate({zoom:this.zoom},a,o),d=this.expression.evaluate({zoom:this.zoom+1},a,o);this._setPaintValue(e,r,u,d)}_setPaintValue(e,r,a,o){if(this.type==="color"){const u=qn(a),d=qn(o);for(let f=e;f<r;f++)this.paintVertexArray.emplace(f,u[0],u[1],d[0],d[1])}else{for(let u=e;u<r;u++)this.paintVertexArray.emplace(u,a,o);this.maxValue=Math.max(this.maxValue,Math.abs(a),Math.abs(o))}}upload(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))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,r){const a=this.useIntegerZoom?Math.floor(r.zoom):r.zoom,o=Ki(this.expression.interpolationFactor(a,this.zoom,this.zoom+1),0,1);e.set(o)}getBinding(e,r,a){return new ja(e,r)}}class nr{constructor(e,r,a,o,u,d){this.expression=e,this.type=r,this.useIntegerZoom=a,this.zoom=o,this.layerId=d,this.zoomInPaintVertexArray=new u,this.zoomOutPaintVertexArray=new u}populatePaintArray(e,r,a){const o=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(o,e,r.patterns&&r.patterns[this.layerId],a)}updatePaintArray(e,r,a,o,u){this._setPaintValues(e,r,a.patterns&&a.patterns[this.layerId],u)}_setPaintValues(e,r,a,o){if(!o||!a)return;const{min:u,mid:d,max:f}=a,_=o[u],x=o[d],b=o[f];if(_&&x&&b)for(let T=e;T<r;T++)this.zoomInPaintVertexArray.emplace(T,x.tl[0],x.tl[1],x.br[0],x.br[1],_.tl[0],_.tl[1],_.br[0],_.br[1],x.pixelRatio,_.pixelRatio),this.zoomOutPaintVertexArray.emplace(T,x.tl[0],x.tl[1],x.br[0],x.br[1],b.tl[0],b.tl[1],b.br[0],b.br[1],x.pixelRatio,b.pixelRatio)}upload(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,rr.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,rr.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class Zn{constructor(e,r,a){this.binders={},this._buffers=[];const o=[];for(const u in e.paint._values){if(!a(u))continue;const d=e.paint.get(u);if(!(d instanceof ri&&Ss(d.property.specification)))continue;const f=uu(u,e.type),_=d.value,x=d.property.specification.type,b=d.property.useIntegerZoom,T=d.property.specification["property-type"],A=T==="cross-faded"||T==="cross-faded-data-driven";if(_.kind==="constant")this.binders[u]=A?new rs(_.value,f):new sr(_.value,f,x),o.push(`/u_${u}`);else if(_.kind==="source"||A){const C=Ac(u,x,"source");this.binders[u]=A?new nr(_,x,b,r,C,e.id):new ar(_,f,x,C),o.push(`/a_${u}`)}else{const C=Ac(u,x,"composite");this.binders[u]=new Ni(_,f,x,b,r,C),o.push(`/z_${u}`)}}this.cacheKey=o.sort().join("")}getMaxValue(e){const r=this.binders[e];return r instanceof ar||r instanceof Ni?r.maxValue:0}populatePaintArrays(e,r,a,o,u){for(const d in this.binders){const f=this.binders[d];(f instanceof ar||f instanceof Ni||f instanceof nr)&&f.populatePaintArray(e,r,a,o,u)}}setConstantPatternPositions(e,r){for(const a in this.binders){const o=this.binders[a];o instanceof rs&&o.setConstantPatternPositions(e,r)}}updatePaintArrays(e,r,a,o,u){let d=!1;for(const f in e){const _=r.getPositions(f);for(const x of _){const b=a.feature(x.index);for(const T in this.binders){const A=this.binders[T];if((A instanceof ar||A instanceof Ni||A instanceof nr)&&A.expression.isStateDependent===!0){const C=o.paint.get(T);A.expression=C.value,A.updatePaintArray(x.start,x.end,b,e[f],u),d=!0}}}}return d}defines(){const e=[];for(const r in this.binders){const a=this.binders[r];(a instanceof sr||a instanceof rs)&&e.push(...a.uniformNames.map(o=>`#define HAS_UNIFORM_${o}`))}return e}getBinderAttributes(){const e=[];for(const r in this.binders){const a=this.binders[r];if(a instanceof ar||a instanceof Ni)for(let o=0;o<a.paintVertexAttributes.length;o++)e.push(a.paintVertexAttributes[o].name);else if(a instanceof nr)for(let o=0;o<rr.members.length;o++)e.push(rr.members[o].name)}return e}getBinderUniforms(){const e=[];for(const r in this.binders){const a=this.binders[r];if(a instanceof sr||a instanceof rs||a instanceof Ni)for(const o of a.uniformNames)e.push(o)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,r){const a=[];for(const o in this.binders){const u=this.binders[o];if(u instanceof sr||u instanceof rs||u instanceof Ni){for(const d of u.uniformNames)if(r[d]){const f=u.getBinding(e,r[d],d);a.push({name:d,property:o,binding:f})}}}return a}setUniforms(e,r,a,o){for(const{name:u,property:d,binding:f}of r)this.binders[d].setUniform(f,o,a.get(d),u)}updatePaintBuffers(e){this._buffers=[];for(const r in this.binders){const a=this.binders[r];if(e&&a instanceof nr){const o=e.fromScale===2?a.zoomInPaintVertexBuffer:a.zoomOutPaintVertexBuffer;o&&this._buffers.push(o)}else(a instanceof ar||a instanceof Ni)&&a.paintVertexBuffer&&this._buffers.push(a.paintVertexBuffer)}}upload(e){for(const r in this.binders){const a=this.binders[r];(a instanceof ar||a instanceof Ni||a instanceof nr)&&a.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const r=this.binders[e];(r instanceof ar||r instanceof Ni||r instanceof nr)&&r.destroy()}}}class xr{constructor(e,r,a=()=>!0){this.programConfigurations={};for(const o of e)this.programConfigurations[o.id]=new Zn(o,r,a);this.needsUpload=!1,this._featureMap=new It,this._bufferOffset=0}populatePaintArrays(e,r,a,o,u,d){for(const f in this.programConfigurations)this.programConfigurations[f].populatePaintArrays(e,r,o,u,d);r.id!==void 0&&this._featureMap.add(r.id,a,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,a,o){for(const u of a)this.needsUpload=this.programConfigurations[u.id].updatePaintArrays(e,this._featureMap,r,u,o)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}function uu(i,e){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"]}[i]||[i.replace(`${e}-`,"").replace(/-/g,"_")]}function Ac(i,e,r){const a={color:{source:Cs,composite:B},number:{source:y,composite:Cs}},o=function(u){return{"line-pattern":{source:rt,composite:rt},"fill-pattern":{source:rt,composite:rt},"fill-extrusion-pattern":{source:rt,composite:rt}}[u]}(i);return o&&o[r]||a[e][r]}we("ConstantBinder",sr),we("CrossFadedConstantBinder",rs),we("SourceExpressionBinder",ar),we("CrossFadedCompositeBinder",nr),we("CompositeExpressionBinder",Ni),we("ProgramConfiguration",Zn,{omit:["_buffers"]}),we("ProgramConfigurationSet",xr);const zt=8192,Fl=Math.pow(2,14)-1,Mc=-Fl-1;function na(i){const e=zt/i.extent,r=i.loadGeometry();for(let a=0;a<r.length;a++){const o=r[a];for(let u=0;u<o.length;u++){const d=o[u],f=Math.round(d.x*e),_=Math.round(d.y*e);d.x=Ki(f,Mc,Fl),d.y=Ki(_,Mc,Fl),(f<d.x||f>d.x+1||_<d.y||_>d.y+1)&&ti("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function oa(i,e){return{type:i.type,id:i.id,properties:i.properties,geometry:e?na(i):[]}}function Ko(i,e,r,a,o){i.emplaceBack(2*e+(a+1)/2,2*r+(o+1)/2)}class Ol{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Ie,this.indexArray=new Zt,this.segments=new ut,this.programConfigurations=new xr(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,a){const o=this.layers[0],u=[];let d=null,f=!1;o.type==="circle"&&(d=o.layout.get("circle-sort-key"),f=!d.isConstant());for(const{feature:_,id:x,index:b,sourceLayerIndex:T}of e){const A=this.layers[0]._featureFilter.needGeometry,C=oa(_,A);if(!this.layers[0]._featureFilter.filter(new ht(this.zoom),C,a))continue;const P=f?d.evaluate(C,{},a):void 0,D={id:x,properties:_.properties,type:_.type,sourceLayerIndex:T,index:b,geometry:A?C.geometry:na(_),patterns:{},sortKey:P};u.push(D)}f&&u.sort((_,x)=>_.sortKey-x.sortKey);for(const _ of u){const{geometry:x,index:b,sourceLayerIndex:T}=_,A=e[b].feature;this.addFeature(_,x,b,a),r.featureIndex.insert(A,x,b,T,this.index)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Ai),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,r,a,o){for(const u of r)for(const d of u){const f=d.x,_=d.y;if(f<0||f>=zt||_<0||_>=zt)continue;const x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),b=x.vertexLength;Ko(this.layoutVertexArray,f,_,-1,-1),Ko(this.layoutVertexArray,f,_,1,-1),Ko(this.layoutVertexArray,f,_,1,1),Ko(this.layoutVertexArray,f,_,-1,1),this.indexArray.emplaceBack(b,b+1,b+2),this.indexArray.emplaceBack(b,b+3,b+2),x.vertexLength+=4,x.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,{},o)}}function Ec(i,e){for(let r=0;r<i.length;r++)if(qa(e,i[r]))return!0;for(let r=0;r<e.length;r++)if(qa(i,e[r]))return!0;return!!Vl(i,e)}function pu(i,e,r){return!!qa(i,e)||!!Nl(e,i,r)}function Cc(i,e){if(i.length===1)return kc(e,i[0]);for(let r=0;r<e.length;r++){const a=e[r];for(let o=0;o<a.length;o++)if(qa(i,a[o]))return!0}for(let r=0;r<i.length;r++)if(kc(e,i[r]))return!0;for(let r=0;r<e.length;r++)if(Vl(i,e[r]))return!0;return!1}function du(i,e,r){if(i.length>1){if(Vl(i,e))return!0;for(let a=0;a<e.length;a++)if(Nl(e[a],i,r))return!0}for(let a=0;a<i.length;a++)if(Nl(i[a],e,r))return!0;return!1}function Vl(i,e){if(i.length===0||e.length===0)return!1;for(let r=0;r<i.length-1;r++){const a=i[r],o=i[r+1];for(let u=0;u<e.length-1;u++)if(fu(a,o,e[u],e[u+1]))return!0}return!1}function fu(i,e,r,a){return vi(i,r,a)!==vi(e,r,a)&&vi(i,e,r)!==vi(i,e,a)}function Nl(i,e,r){const a=r*r;if(e.length===1)return i.distSqr(e[0])<a;for(let o=1;o<e.length;o++)if(Pc(i,e[o-1],e[o])<a)return!0;return!1}function Pc(i,e,r){const a=e.distSqr(r);if(a===0)return i.distSqr(e);const o=((i.x-e.x)*(r.x-e.x)+(i.y-e.y)*(r.y-e.y))/a;return i.distSqr(o<0?e:o>1?r:r.sub(e)._mult(o)._add(e))}function kc(i,e){let r,a,o,u=!1;for(let d=0;d<i.length;d++){r=i[d];for(let f=0,_=r.length-1;f<r.length;_=f++)a=r[f],o=r[_],a.y>e.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(u=!u)}return u}function qa(i,e){let r=!1;for(let a=0,o=i.length-1;a<i.length;o=a++){const u=i[a],d=i[o];u.y>e.y!=d.y>e.y&&e.x<(d.x-u.x)*(e.y-u.y)/(d.y-u.y)+u.x&&(r=!r)}return r}function mu(i,e,r){const a=r[0],o=r[2];if(i.x<a.x&&e.x<a.x||i.x>o.x&&e.x>o.x||i.y<a.y&&e.y<a.y||i.y>o.y&&e.y>o.y)return!1;const u=vi(i,e,r[0]);return u!==vi(i,e,r[1])||u!==vi(i,e,r[2])||u!==vi(i,e,r[3])}function Gn(i,e,r){const a=e.paint.get(i).value;return a.kind==="constant"?a.value:r.programConfigurations.get(e.id).getMaxValue(i)}function Yo(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function Jo(i,e,r,a,o){if(!e[0]&&!e[1])return i;const u=Be.convert(e)._mult(o);r==="viewport"&&u._rotate(-a);const d=[];for(let f=0;f<i.length;f++)d.push(i[f].sub(u));return d}let zc,Dc;we("CircleBucket",Ol,{omit:["layers"]});var gu={get paint(){return Dc=Dc||new Mt({"circle-radius":new De(re.paint_circle["circle-radius"]),"circle-color":new De(re.paint_circle["circle-color"]),"circle-blur":new De(re.paint_circle["circle-blur"]),"circle-opacity":new De(re.paint_circle["circle-opacity"]),"circle-translate":new Ce(re.paint_circle["circle-translate"]),"circle-translate-anchor":new Ce(re.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Ce(re.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Ce(re.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new De(re.paint_circle["circle-stroke-width"]),"circle-stroke-color":new De(re.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new De(re.paint_circle["circle-stroke-opacity"])})},get layout(){return zc=zc||new Mt({"circle-sort-key":new De(re.layout_circle["circle-sort-key"])})}},mi=1e-6,Za=typeof Float32Array<"u"?Float32Array:Array;function Ul(i){return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}function Lc(i,e,r){var a=e[0],o=e[1],u=e[2],d=e[3],f=e[4],_=e[5],x=e[6],b=e[7],T=e[8],A=e[9],C=e[10],P=e[11],D=e[12],V=e[13],$=e[14],H=e[15],q=r[0],Y=r[1],Q=r[2],oe=r[3];return i[0]=q*a+Y*f+Q*T+oe*D,i[1]=q*o+Y*_+Q*A+oe*V,i[2]=q*u+Y*x+Q*C+oe*$,i[3]=q*d+Y*b+Q*P+oe*H,i[4]=(q=r[4])*a+(Y=r[5])*f+(Q=r[6])*T+(oe=r[7])*D,i[5]=q*o+Y*_+Q*A+oe*V,i[6]=q*u+Y*x+Q*C+oe*$,i[7]=q*d+Y*b+Q*P+oe*H,i[8]=(q=r[8])*a+(Y=r[9])*f+(Q=r[10])*T+(oe=r[11])*D,i[9]=q*o+Y*_+Q*A+oe*V,i[10]=q*u+Y*x+Q*C+oe*$,i[11]=q*d+Y*b+Q*P+oe*H,i[12]=(q=r[12])*a+(Y=r[13])*f+(Q=r[14])*T+(oe=r[15])*D,i[13]=q*o+Y*_+Q*A+oe*V,i[14]=q*u+Y*x+Q*C+oe*$,i[15]=q*d+Y*b+Q*P+oe*H,i}Math.hypot||(Math.hypot=function(){for(var i=0,e=arguments.length;e--;)i+=arguments[e]*arguments[e];return Math.sqrt(i)});var Xn,_u=Lc;function Qo(i,e,r){var a=e[0],o=e[1],u=e[2],d=e[3];return i[0]=r[0]*a+r[4]*o+r[8]*u+r[12]*d,i[1]=r[1]*a+r[5]*o+r[9]*u+r[13]*d,i[2]=r[2]*a+r[6]*o+r[10]*u+r[14]*d,i[3]=r[3]*a+r[7]*o+r[11]*u+r[15]*d,i}Xn=new Za(4),Za!=Float32Array&&(Xn[0]=0,Xn[1]=0,Xn[2]=0,Xn[3]=0);class yu extends Vi{constructor(e){super(e,gu)}createBucket(e){return new Ol(e)}queryRadius(e){const r=e;return Gn("circle-radius",this,r)+Gn("circle-stroke-width",this,r)+Yo(this.paint.get("circle-translate"))}queryIntersectsFeature(e,r,a,o,u,d,f,_){const x=Jo(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),d.angle,f),b=this.paint.get("circle-radius").evaluate(r,a)+this.paint.get("circle-stroke-width").evaluate(r,a),T=this.paint.get("circle-pitch-alignment")==="map",A=T?x:function(P,D){return P.map(V=>Bc(V,D))}(x,_),C=T?b*f:b;for(const P of o)for(const D of P){const V=T?D:Bc(D,_);let $=C;const H=Qo([],[D.x,D.y,0,1],_);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?$*=H[3]/d.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&($*=d.cameraToCenterDistance/H[3]),pu(A,V,$))return!0}return!1}}function Bc(i,e){const r=Qo([],[i.x,i.y,0,1],e);return new Be(r[0]/r[3],r[1]/r[3])}class Rc extends Ol{}let Fc;we("HeatmapBucket",Rc,{omit:["layers"]});var xu={get paint(){return Fc=Fc||new Mt({"heatmap-radius":new De(re.paint_heatmap["heatmap-radius"]),"heatmap-weight":new De(re.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ce(re.paint_heatmap["heatmap-intensity"]),"heatmap-color":new On(re.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ce(re.paint_heatmap["heatmap-opacity"])})}};function $l(i,{width:e,height:r},a,o){if(o){if(o instanceof Uint8ClampedArray)o=new Uint8Array(o.buffer);else if(o.length!==e*r*a)throw new RangeError(`mismatched image size. expected: ${o.length} but got: ${e*r*a}`)}else o=new Uint8Array(e*r*a);return i.width=e,i.height=r,i.data=o,i}function Oc(i,{width:e,height:r},a){if(e===i.width&&r===i.height)return;const o=$l({},{width:e,height:r},a);jl(i,o,{x:0,y:0},{x:0,y:0},{width:Math.min(i.width,e),height:Math.min(i.height,r)},a),i.width=e,i.height=r,i.data=o.data}function jl(i,e,r,a,o,u){if(o.width===0||o.height===0)return e;if(o.width>i.width||o.height>i.height||r.x>i.width-o.width||r.y>i.height-o.height)throw new RangeError("out of range source coordinates for image copy");if(o.width>e.width||o.height>e.height||a.x>e.width-o.width||a.y>e.height-o.height)throw new RangeError("out of range destination coordinates for image copy");const d=i.data,f=e.data;if(d===f)throw new Error("srcData equals dstData, so image is already copied");for(let _=0;_<o.height;_++){const x=((r.y+_)*i.width+r.x)*u,b=((a.y+_)*e.width+a.x)*u;for(let T=0;T<o.width*u;T++)f[b+T]=d[x+T]}return e}class Wn{constructor(e,r){$l(this,e,1,r)}resize(e){Oc(this,e,1)}clone(){return new Wn({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,a,o,u){jl(e,r,a,o,u,1)}}class qi{constructor(e,r){$l(this,e,4,r)}resize(e){Oc(this,e,4)}replace(e,r){r?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new qi({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,a,o,u){jl(e,r,a,o,u,4)}}function Vc(i){const e={},r=i.resolution||256,a=i.clips?i.clips.length:1,o=i.image||new qi({width:r,height:a});if(Math.log(r)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${r}`);const u=(d,f,_)=>{e[i.evaluationKey]=_;const x=i.expression.evaluate(e);o.data[d+f+0]=Math.floor(255*x.r/x.a),o.data[d+f+1]=Math.floor(255*x.g/x.a),o.data[d+f+2]=Math.floor(255*x.b/x.a),o.data[d+f+3]=Math.floor(255*x.a)};if(i.clips)for(let d=0,f=0;d<a;++d,f+=4*r)for(let _=0,x=0;_<r;_++,x+=4){const b=_/(r-1),{start:T,end:A}=i.clips[d];u(f,x,T*(1-b)+A*b)}else for(let d=0,f=0;d<r;d++,f+=4)u(0,f,d/(r-1));return o}we("AlphaImage",Wn),we("RGBAImage",qi);class vu extends Vi{createBucket(e){return new Rc(e)}constructor(e){super(e,xu),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){e==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Vc({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}}let Nc;var bu={get paint(){return Nc=Nc||new Mt({"hillshade-illumination-direction":new Ce(re.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Ce(re.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Ce(re.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Ce(re.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Ce(re.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Ce(re.paint_hillshade["hillshade-accent-color"])})}};class wu extends Vi{constructor(e){super(e,bu)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}}const Su=xt([{name:"a_pos",components:2,type:"Int16"}],4),{members:Tu}=Su;var ql={exports:{}};function el(i,e,r){r=r||2;var a,o,u,d,f,_,x,b=e&&e.length,T=b?e[0]*r:i.length,A=Uc(i,0,T,r,!0),C=[];if(!A||A.next===A.prev)return C;if(b&&(A=function(D,V,$,H){var q,Y,Q,oe=[];for(q=0,Y=V.length;q<Y;q++)(Q=Uc(D,V[q]*H,q<Y-1?V[q+1]*H:D.length,H,!1))===Q.next&&(Q.steiner=!0),oe.push(zu(Q));for(oe.sort(Cu),q=0;q<oe.length;q++)$=Pu(oe[q],$);return $}(i,e,A,r)),i.length>80*r){a=u=i[0],o=d=i[1];for(var P=r;P<T;P+=r)(f=i[P])<a&&(a=f),(_=i[P+1])<o&&(o=_),f>u&&(u=f),_>d&&(d=_);x=(x=Math.max(u-a,d-o))!==0?32767/x:0}return Hn(A,C,r,a,o,x,0),C}function Uc(i,e,r,a,o){var u,d;if(o===Xl(i,e,r,a)>0)for(u=e;u<r;u+=a)d=qc(u,i[u],i[u+1],d);else for(u=r-a;u>=e;u-=a)d=qc(u,i[u],i[u+1],d);return d&&tl(d,d.next)&&(Yn(d),d=d.next),d}function la(i,e){if(!i)return i;e||(e=i);var r,a=i;do if(r=!1,a.steiner||!tl(a,a.next)&&Ct(a.prev,a,a.next)!==0)a=a.next;else{if(Yn(a),(a=e=a.prev)===a.next)break;r=!0}while(r||a!==e);return e}function Hn(i,e,r,a,o,u,d){if(i){!d&&u&&function(b,T,A,C){var P=b;do P.z===0&&(P.z=Zl(P.x,P.y,T,A,C)),P.prevZ=P.prev,P.nextZ=P.next,P=P.next;while(P!==b);P.prevZ.nextZ=null,P.prevZ=null,function(D){var V,$,H,q,Y,Q,oe,be,Ae=1;do{for($=D,D=null,Y=null,Q=0;$;){for(Q++,H=$,oe=0,V=0;V<Ae&&(oe++,H=H.nextZ);V++);for(be=Ae;oe>0||be>0&&H;)oe!==0&&(be===0||!H||$.z<=H.z)?(q=$,$=$.nextZ,oe--):(q=H,H=H.nextZ,be--),Y?Y.nextZ=q:D=q,q.prevZ=Y,Y=q;$=H}Y.nextZ=null,Ae*=2}while(Q>1)}(P)}(i,a,o,u);for(var f,_,x=i;i.prev!==i.next;)if(f=i.prev,_=i.next,u?Au(i,a,o,u):Iu(i))e.push(f.i/r|0),e.push(i.i/r|0),e.push(_.i/r|0),Yn(i),i=_.next,x=_.next;else if((i=_)===x){d?d===1?Hn(i=Mu(la(i),e,r),e,r,a,o,u,2):d===2&&Eu(i,e,r,a,o,u):Hn(la(i),e,r,a,o,u,1);break}}}function Iu(i){var e=i.prev,r=i,a=i.next;if(Ct(e,r,a)>=0)return!1;for(var o=e.x,u=r.x,d=a.x,f=e.y,_=r.y,x=a.y,b=o<u?o<d?o:d:u<d?u:d,T=f<_?f<x?f:x:_<x?_:x,A=o>u?o>d?o:d:u>d?u:d,C=f>_?f>x?f:x:_>x?_:x,P=a.next;P!==e;){if(P.x>=b&&P.x<=A&&P.y>=T&&P.y<=C&&Ga(o,f,u,_,d,x,P.x,P.y)&&Ct(P.prev,P,P.next)>=0)return!1;P=P.next}return!0}function Au(i,e,r,a){var o=i.prev,u=i,d=i.next;if(Ct(o,u,d)>=0)return!1;for(var f=o.x,_=u.x,x=d.x,b=o.y,T=u.y,A=d.y,C=f<_?f<x?f:x:_<x?_:x,P=b<T?b<A?b:A:T<A?T:A,D=f>_?f>x?f:x:_>x?_:x,V=b>T?b>A?b:A:T>A?T:A,$=Zl(C,P,e,r,a),H=Zl(D,V,e,r,a),q=i.prevZ,Y=i.nextZ;q&&q.z>=$&&Y&&Y.z<=H;){if(q.x>=C&&q.x<=D&&q.y>=P&&q.y<=V&&q!==o&&q!==d&&Ga(f,b,_,T,x,A,q.x,q.y)&&Ct(q.prev,q,q.next)>=0||(q=q.prevZ,Y.x>=C&&Y.x<=D&&Y.y>=P&&Y.y<=V&&Y!==o&&Y!==d&&Ga(f,b,_,T,x,A,Y.x,Y.y)&&Ct(Y.prev,Y,Y.next)>=0))return!1;Y=Y.nextZ}for(;q&&q.z>=$;){if(q.x>=C&&q.x<=D&&q.y>=P&&q.y<=V&&q!==o&&q!==d&&Ga(f,b,_,T,x,A,q.x,q.y)&&Ct(q.prev,q,q.next)>=0)return!1;q=q.prevZ}for(;Y&&Y.z<=H;){if(Y.x>=C&&Y.x<=D&&Y.y>=P&&Y.y<=V&&Y!==o&&Y!==d&&Ga(f,b,_,T,x,A,Y.x,Y.y)&&Ct(Y.prev,Y,Y.next)>=0)return!1;Y=Y.nextZ}return!0}function Mu(i,e,r){var a=i;do{var o=a.prev,u=a.next.next;!tl(o,u)&&$c(o,a,a.next,u)&&Kn(o,u)&&Kn(u,o)&&(e.push(o.i/r|0),e.push(a.i/r|0),e.push(u.i/r|0),Yn(a),Yn(a.next),a=i=u),a=a.next}while(a!==i);return la(a)}function Eu(i,e,r,a,o,u){var d=i;do{for(var f=d.next.next;f!==d.prev;){if(d.i!==f.i&&Du(d,f)){var _=jc(d,f);return d=la(d,d.next),_=la(_,_.next),Hn(d,e,r,a,o,u,0),void Hn(_,e,r,a,o,u,0)}f=f.next}d=d.next}while(d!==i)}function Cu(i,e){return i.x-e.x}function Pu(i,e){var r=function(o,u){var d,f=u,_=o.x,x=o.y,b=-1/0;do{if(x<=f.y&&x>=f.next.y&&f.next.y!==f.y){var T=f.x+(x-f.y)*(f.next.x-f.x)/(f.next.y-f.y);if(T<=_&&T>b&&(b=T,d=f.x<f.next.x?f:f.next,T===_))return d}f=f.next}while(f!==u);if(!d)return null;var A,C=d,P=d.x,D=d.y,V=1/0;f=d;do _>=f.x&&f.x>=P&&_!==f.x&&Ga(x<D?_:b,x,P,D,x<D?b:_,x,f.x,f.y)&&(A=Math.abs(x-f.y)/(_-f.x),Kn(f,o)&&(A<V||A===V&&(f.x>d.x||f.x===d.x&&ku(d,f)))&&(d=f,V=A)),f=f.next;while(f!==C);return d}(i,e);if(!r)return e;var a=jc(r,i);return la(a,a.next),la(r,r.next)}function ku(i,e){return Ct(i.prev,i,e.prev)<0&&Ct(e.next,i,i.next)<0}function Zl(i,e,r,a,o){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-r)*o|0)|i<<8))|i<<4))|i<<2))|i<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-a)*o|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function zu(i){var e=i,r=i;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==i);return r}function Ga(i,e,r,a,o,u,d,f){return(o-d)*(e-f)>=(i-d)*(u-f)&&(i-d)*(a-f)>=(r-d)*(e-f)&&(r-d)*(u-f)>=(o-d)*(a-f)}function Du(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!function(r,a){var o=r;do{if(o.i!==r.i&&o.next.i!==r.i&&o.i!==a.i&&o.next.i!==a.i&&$c(o,o.next,r,a))return!0;o=o.next}while(o!==r);return!1}(i,e)&&(Kn(i,e)&&Kn(e,i)&&function(r,a){var o=r,u=!1,d=(r.x+a.x)/2,f=(r.y+a.y)/2;do o.y>f!=o.next.y>f&&o.next.y!==o.y&&d<(o.next.x-o.x)*(f-o.y)/(o.next.y-o.y)+o.x&&(u=!u),o=o.next;while(o!==r);return u}(i,e)&&(Ct(i.prev,i,e.prev)||Ct(i,e.prev,e))||tl(i,e)&&Ct(i.prev,i,i.next)>0&&Ct(e.prev,e,e.next)>0)}function Ct(i,e,r){return(e.y-i.y)*(r.x-e.x)-(e.x-i.x)*(r.y-e.y)}function tl(i,e){return i.x===e.x&&i.y===e.y}function $c(i,e,r,a){var o=rl(Ct(i,e,r)),u=rl(Ct(i,e,a)),d=rl(Ct(r,a,i)),f=rl(Ct(r,a,e));return o!==u&&d!==f||!(o!==0||!il(i,r,e))||!(u!==0||!il(i,a,e))||!(d!==0||!il(r,i,a))||!(f!==0||!il(r,e,a))}function il(i,e,r){return e.x<=Math.max(i.x,r.x)&&e.x>=Math.min(i.x,r.x)&&e.y<=Math.max(i.y,r.y)&&e.y>=Math.min(i.y,r.y)}function rl(i){return i>0?1:i<0?-1:0}function Kn(i,e){return Ct(i.prev,i,i.next)<0?Ct(i,e,i.next)>=0&&Ct(i,i.prev,e)>=0:Ct(i,e,i.prev)<0||Ct(i,i.next,e)<0}function jc(i,e){var r=new Gl(i.i,i.x,i.y),a=new Gl(e.i,e.x,e.y),o=i.next,u=e.prev;return i.next=e,e.prev=i,r.next=o,o.prev=r,a.next=r,r.prev=a,u.next=a,a.prev=u,a}function qc(i,e,r,a){var o=new Gl(i,e,r);return a?(o.next=a.next,o.prev=a,a.next.prev=o,a.next=o):(o.prev=o,o.next=o),o}function Yn(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function Gl(i,e,r){this.i=i,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Xl(i,e,r,a){for(var o=0,u=e,d=r-a;u<r;u+=a)o+=(i[d]-i[u])*(i[u+1]+i[d+1]),d=u;return o}ql.exports=el,ql.exports.default=el,el.deviation=function(i,e,r,a){var o=e&&e.length,u=Math.abs(Xl(i,0,o?e[0]*r:i.length,r));if(o)for(var d=0,f=e.length;d<f;d++)u-=Math.abs(Xl(i,e[d]*r,d<f-1?e[d+1]*r:i.length,r));var _=0;for(d=0;d<a.length;d+=3){var x=a[d]*r,b=a[d+1]*r,T=a[d+2]*r;_+=Math.abs((i[x]-i[T])*(i[b+1]-i[x+1])-(i[x]-i[b])*(i[T+1]-i[x+1]))}return u===0&&_===0?0:Math.abs((_-u)/u)},el.flatten=function(i){for(var e=i[0][0].length,r={vertices:[],holes:[],dimensions:e},a=0,o=0;o<i.length;o++){for(var u=0;u<i[o].length;u++)for(var d=0;d<e;d++)r.vertices.push(i[o][u][d]);o>0&&r.holes.push(a+=i[o-1].length)}return r};var Zc=ie(ql.exports);function Lu(i,e,r,a,o){Gc(i,e,r||0,a||i.length-1,o||Bu)}function Gc(i,e,r,a,o){for(;a>r;){if(a-r>600){var u=a-r+1,d=e-r+1,f=Math.log(u),_=.5*Math.exp(2*f/3),x=.5*Math.sqrt(f*_*(u-_)/u)*(d-u/2<0?-1:1);Gc(i,e,Math.max(r,Math.floor(e-d*_/u+x)),Math.min(a,Math.floor(e+(u-d)*_/u+x)),o)}var b=i[e],T=r,A=a;for(Jn(i,r,e),o(i[a],b)>0&&Jn(i,r,a);T<A;){for(Jn(i,T,A),T++,A--;o(i[T],b)<0;)T++;for(;o(i[A],b)>0;)A--}o(i[r],b)===0?Jn(i,r,A):Jn(i,++A,a),A<=e&&(r=A+1),e<=A&&(a=A-1)}}function Jn(i,e,r){var a=i[e];i[e]=i[r],i[r]=a}function Bu(i,e){return i<e?-1:i>e?1:0}function Wl(i,e){const r=i.length;if(r<=1)return[i];const a=[];let o,u;for(let d=0;d<r;d++){const f=cr(i[d]);f!==0&&(i[d].area=Math.abs(f),u===void 0&&(u=f<0),u===f<0?(o&&a.push(o),o=[i[d]]):o.push(i[d]))}if(o&&a.push(o),e>1)for(let d=0;d<a.length;d++)a[d].length<=e||(Lu(a[d],e,1,a[d].length-1,Ru),a[d]=a[d].slice(0,e));return a}function Ru(i,e){return e.area-i.area}function Hl(i,e,r){const a=r.patternDependencies;let o=!1;for(const u of e){const d=u.paint.get(`${i}-pattern`);d.isConstant()||(o=!0);const f=d.constantOr(null);f&&(o=!0,a[f.to]=!0,a[f.from]=!0)}return o}function Kl(i,e,r,a,o){const u=o.patternDependencies;for(const d of e){const f=d.paint.get(`${i}-pattern`).value;if(f.kind!=="constant"){let _=f.evaluate({zoom:a-1},r,{},o.availableImages),x=f.evaluate({zoom:a},r,{},o.availableImages),b=f.evaluate({zoom:a+1},r,{},o.availableImages);_=_&&_.name?_.name:_,x=x&&x.name?x.name:x,b=b&&b.name?b.name:b,u[_]=!0,u[x]=!0,u[b]=!0,r.patterns[d.id]={min:_,mid:x,max:b}}}return r}class Yl{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new qe,this.indexArray=new Zt,this.indexArray2=new Lt,this.programConfigurations=new xr(e.layers,e.zoom),this.segments=new ut,this.segments2=new ut,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,a){this.hasPattern=Hl("fill",this.layers,r);const o=this.layers[0].layout.get("fill-sort-key"),u=!o.isConstant(),d=[];for(const{feature:f,id:_,index:x,sourceLayerIndex:b}of e){const T=this.layers[0]._featureFilter.needGeometry,A=oa(f,T);if(!this.layers[0]._featureFilter.filter(new ht(this.zoom),A,a))continue;const C=u?o.evaluate(A,{},a,r.availableImages):void 0,P={id:_,properties:f.properties,type:f.type,sourceLayerIndex:b,index:x,geometry:T?A.geometry:na(f),patterns:{},sortKey:C};d.push(P)}u&&d.sort((f,_)=>f.sortKey-_.sortKey);for(const f of d){const{geometry:_,index:x,sourceLayerIndex:b}=f;if(this.hasPattern){const T=Kl("fill",this.layers,f,this.zoom,r);this.patternFeatures.push(T)}else this.addFeature(f,_,x,a,{});r.featureIndex.insert(e[x].feature,_,x,b,this.index)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,a)}addFeatures(e,r,a){for(const o of this.patternFeatures)this.addFeature(o,o.geometry,o.index,r,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Tu),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,r,a,o,u){for(const d of Wl(r,500)){let f=0;for(const C of d)f+=C.length;const _=this.segments.prepareSegment(f,this.layoutVertexArray,this.indexArray),x=_.vertexLength,b=[],T=[];for(const C of d){if(C.length===0)continue;C!==d[0]&&T.push(b.length/2);const P=this.segments2.prepareSegment(C.length,this.layoutVertexArray,this.indexArray2),D=P.vertexLength;this.layoutVertexArray.emplaceBack(C[0].x,C[0].y),this.indexArray2.emplaceBack(D+C.length-1,D),b.push(C[0].x),b.push(C[0].y);for(let V=1;V<C.length;V++)this.layoutVertexArray.emplaceBack(C[V].x,C[V].y),this.indexArray2.emplaceBack(D+V-1,D+V),b.push(C[V].x),b.push(C[V].y);P.vertexLength+=C.length,P.primitiveLength+=C.length}const A=Zc(b,T);for(let C=0;C<A.length;C+=3)this.indexArray.emplaceBack(x+A[C],x+A[C+1],x+A[C+2]);_.vertexLength+=f,_.primitiveLength+=A.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,u,o)}}let Xc,Wc;we("FillBucket",Yl,{omit:["layers","patternFeatures"]});var Fu={get paint(){return Wc=Wc||new Mt({"fill-antialias":new Ce(re.paint_fill["fill-antialias"]),"fill-opacity":new De(re.paint_fill["fill-opacity"]),"fill-color":new De(re.paint_fill["fill-color"]),"fill-outline-color":new De(re.paint_fill["fill-outline-color"]),"fill-translate":new Ce(re.paint_fill["fill-translate"]),"fill-translate-anchor":new Ce(re.paint_fill["fill-translate-anchor"]),"fill-pattern":new ra(re.paint_fill["fill-pattern"])})},get layout(){return Xc=Xc||new Mt({"fill-sort-key":new De(re.layout_fill["fill-sort-key"])})}};class Ou extends Vi{constructor(e){super(e,Fu)}recalculate(e,r){super.recalculate(e,r);const a=this.paint._values["fill-outline-color"];a.value.kind==="constant"&&a.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new Yl(e)}queryRadius(){return Yo(this.paint.get("fill-translate"))}queryIntersectsFeature(e,r,a,o,u,d,f){return Cc(Jo(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),d.angle,f),o)}isTileClipped(){return!0}}const Vu=xt([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Nu=xt([{name:"a_centroid",components:2,type:"Int16"}],4),{members:Uu}=Vu;var ks={},$u=Hi,Hc=Xa;function Xa(i,e,r,a,o){this.properties={},this.extent=r,this.type=0,this._pbf=i,this._geometry=-1,this._keys=a,this._values=o,i.readFields(ju,this,e)}function ju(i,e,r){i==1?e.id=r.readVarint():i==2?function(a,o){for(var u=a.readVarint()+a.pos;a.pos<u;){var d=o._keys[a.readVarint()],f=o._values[a.readVarint()];o.properties[d]=f}}(r,e):i==3?e.type=r.readVarint():i==4&&(e._geometry=r.pos)}function qu(i){for(var e,r,a=0,o=0,u=i.length,d=u-1;o<u;d=o++)a+=((r=i[d]).x-(e=i[o]).x)*(e.y+r.y);return a}Xa.types=["Unknown","Point","LineString","Polygon"],Xa.prototype.loadGeometry=function(){var i=this._pbf;i.pos=this._geometry;for(var e,r=i.readVarint()+i.pos,a=1,o=0,u=0,d=0,f=[];i.pos<r;){if(o<=0){var _=i.readVarint();a=7&_,o=_>>3}if(o--,a===1||a===2)u+=i.readSVarint(),d+=i.readSVarint(),a===1&&(e&&f.push(e),e=[]),e.push(new $u(u,d));else{if(a!==7)throw new Error("unknown command "+a);e&&e.push(e[0].clone())}}return e&&f.push(e),f},Xa.prototype.bbox=function(){var i=this._pbf;i.pos=this._geometry;for(var e=i.readVarint()+i.pos,r=1,a=0,o=0,u=0,d=1/0,f=-1/0,_=1/0,x=-1/0;i.pos<e;){if(a<=0){var b=i.readVarint();r=7&b,a=b>>3}if(a--,r===1||r===2)(o+=i.readSVarint())<d&&(d=o),o>f&&(f=o),(u+=i.readSVarint())<_&&(_=u),u>x&&(x=u);else if(r!==7)throw new Error("unknown command "+r)}return[d,_,f,x]},Xa.prototype.toGeoJSON=function(i,e,r){var a,o,u=this.extent*Math.pow(2,r),d=this.extent*i,f=this.extent*e,_=this.loadGeometry(),x=Xa.types[this.type];function b(C){for(var P=0;P<C.length;P++){var D=C[P];C[P]=[360*(D.x+d)/u-180,360/Math.PI*Math.atan(Math.exp((180-360*(D.y+f)/u)*Math.PI/180))-90]}}switch(this.type){case 1:var T=[];for(a=0;a<_.length;a++)T[a]=_[a][0];b(_=T);break;case 2:for(a=0;a<_.length;a++)b(_[a]);break;case 3:for(_=function(C){var P=C.length;if(P<=1)return[C];for(var D,V,$=[],H=0;H<P;H++){var q=qu(C[H]);q!==0&&(V===void 0&&(V=q<0),V===q<0?(D&&$.push(D),D=[C[H]]):D.push(C[H]))}return D&&$.push(D),$}(_),a=0;a<_.length;a++)for(o=0;o<_[a].length;o++)b(_[a][o])}_.length===1?_=_[0]:x="Multi"+x;var A={type:"Feature",geometry:{type:x,coordinates:_},properties:this.properties};return"id"in this&&(A.id=this.id),A};var Zu=Hc,Kc=Yc;function Yc(i,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=i,this._keys=[],this._values=[],this._features=[],i.readFields(Gu,this,e),this.length=this._features.length}function Gu(i,e,r){i===15?e.version=r.readVarint():i===1?e.name=r.readString():i===5?e.extent=r.readVarint():i===2?e._features.push(r.pos):i===3?e._keys.push(r.readString()):i===4&&e._values.push(function(a){for(var o=null,u=a.readVarint()+a.pos;a.pos<u;){var d=a.readVarint()>>3;o=d===1?a.readString():d===2?a.readFloat():d===3?a.readDouble():d===4?a.readVarint64():d===5?a.readVarint():d===6?a.readSVarint():d===7?a.readBoolean():null}return o}(r))}Yc.prototype.feature=function(i){if(i<0||i>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[i];var e=this._pbf.readVarint()+this._pbf.pos;return new Zu(this._pbf,e,this.extent,this._keys,this._values)};var Xu=Kc;function Wu(i,e,r){if(i===3){var a=new Xu(r,r.readVarint()+r.pos);a.length&&(e[a.name]=a)}}ks.VectorTile=function(i,e){this.layers=i.readFields(Wu,{},e)},ks.VectorTileFeature=Hc,ks.VectorTileLayer=Kc;const Hu=ks.VectorTileFeature.types,Jl=Math.pow(2,13);function Qn(i,e,r,a,o,u,d,f){i.emplaceBack(e,r,2*Math.floor(a*Jl)+d,o*Jl*2,u*Jl*2,Math.round(f))}class Ql{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new _e,this.centroidVertexArray=new pe,this.indexArray=new Zt,this.programConfigurations=new xr(e.layers,e.zoom),this.segments=new ut,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,a){this.features=[],this.hasPattern=Hl("fill-extrusion",this.layers,r);for(const{feature:o,id:u,index:d,sourceLayerIndex:f}of e){const _=this.layers[0]._featureFilter.needGeometry,x=oa(o,_);if(!this.layers[0]._featureFilter.filter(new ht(this.zoom),x,a))continue;const b={id:u,sourceLayerIndex:f,index:d,geometry:_?x.geometry:na(o),properties:o.properties,type:o.type,patterns:{}};this.hasPattern?this.features.push(Kl("fill-extrusion",this.layers,b,this.zoom,r)):this.addFeature(b,b.geometry,d,a,{}),r.featureIndex.insert(o,b.geometry,d,f,this.index,!0)}}addFeatures(e,r,a){for(const o of this.features){const{geometry:u}=o;this.addFeature(o,u,o.index,r,a)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,a)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Uu),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Nu.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,r,a,o,u){const d={x:0,y:0,vertexCount:0};for(const f of Wl(r,500)){let _=0;for(const P of f)_+=P.length;let x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const P of f){if(P.length===0||Yu(P))continue;let D=0;for(let V=0;V<P.length;V++){const $=P[V];if(V>=1){const H=P[V-1];if(!Ku($,H)){x.vertexLength+4>ut.MAX_VERTEX_ARRAY_LENGTH&&(x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const q=$.sub(H)._perp()._unit(),Y=H.dist($);D+Y>32768&&(D=0),Qn(this.layoutVertexArray,$.x,$.y,q.x,q.y,0,0,D),Qn(this.layoutVertexArray,$.x,$.y,q.x,q.y,0,1,D),d.x+=2*$.x,d.y+=2*$.y,d.vertexCount+=2,D+=Y,Qn(this.layoutVertexArray,H.x,H.y,q.x,q.y,0,0,D),Qn(this.layoutVertexArray,H.x,H.y,q.x,q.y,0,1,D),d.x+=2*H.x,d.y+=2*H.y,d.vertexCount+=2;const Q=x.vertexLength;this.indexArray.emplaceBack(Q,Q+2,Q+1),this.indexArray.emplaceBack(Q+1,Q+2,Q+3),x.vertexLength+=4,x.primitiveLength+=2}}}}if(x.vertexLength+_>ut.MAX_VERTEX_ARRAY_LENGTH&&(x=this.segments.prepareSegment(_,this.layoutVertexArray,this.indexArray)),Hu[e.type]!=="Polygon")continue;const b=[],T=[],A=x.vertexLength;for(const P of f)if(P.length!==0){P!==f[0]&&T.push(b.length/2);for(let D=0;D<P.length;D++){const V=P[D];Qn(this.layoutVertexArray,V.x,V.y,0,0,1,1,0),d.x+=V.x,d.y+=V.y,d.vertexCount+=1,b.push(V.x),b.push(V.y)}}const C=Zc(b,T);for(let P=0;P<C.length;P+=3)this.indexArray.emplaceBack(A+C[P],A+C[P+2],A+C[P+1]);x.primitiveLength+=C.length/3,x.vertexLength+=_}for(let f=0;f<d.vertexCount;f++)this.centroidVertexArray.emplaceBack(Math.floor(d.x/d.vertexCount),Math.floor(d.y/d.vertexCount));this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,u,o)}}function Ku(i,e){return i.x===e.x&&(i.x<0||i.x>zt)||i.y===e.y&&(i.y<0||i.y>zt)}function Yu(i){return i.every(e=>e.x<0)||i.every(e=>e.x>zt)||i.every(e=>e.y<0)||i.every(e=>e.y>zt)}let Jc;we("FillExtrusionBucket",Ql,{omit:["layers","features"]});var Ju={get paint(){return Jc=Jc||new Mt({"fill-extrusion-opacity":new Ce(re["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new De(re["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ce(re["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ce(re["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ra(re["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new De(re["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new De(re["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ce(re["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Qu extends Vi{constructor(e){super(e,Ju)}createBucket(e){return new Ql(e)}queryRadius(){return Yo(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(e,r,a,o,u,d,f,_){const x=Jo(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),d.angle,f),b=this.paint.get("fill-extrusion-height").evaluate(r,a),T=this.paint.get("fill-extrusion-base").evaluate(r,a),A=function(P,D,V,$){const H=[];for(const q of P){const Y=[q.x,q.y,0,1];Qo(Y,Y,D),H.push(new Be(Y[0]/Y[3],Y[1]/Y[3]))}return H}(x,_),C=function(P,D,V,$){const H=[],q=[],Y=$[8]*D,Q=$[9]*D,oe=$[10]*D,be=$[11]*D,Ae=$[8]*V,xe=$[9]*V,ye=$[10]*V,de=$[11]*V;for(const Se of P){const me=[],ue=[];for(const ke of Se){const Ee=ke.x,$e=ke.y,pt=$[0]*Ee+$[4]*$e+$[12],ft=$[1]*Ee+$[5]*$e+$[13],Ft=$[2]*Ee+$[6]*$e+$[14],Ui=$[3]*Ee+$[7]*$e+$[15],gi=Ft+oe,Dt=Ui+be,Xt=pt+Ae,Jt=ft+xe,_i=Ft+ye,yi=Ui+de,Ot=new Be((pt+Y)/Dt,(ft+Q)/Dt);Ot.z=gi/Dt,me.push(Ot);const Vt=new Be(Xt/yi,Jt/yi);Vt.z=_i/yi,ue.push(Vt)}H.push(me),q.push(ue)}return[H,q]}(o,T,b,_);return function(P,D,V){let $=1/0;Cc(V,D)&&($=Qc(V,D[0]));for(let H=0;H<D.length;H++){const q=D[H],Y=P[H];for(let Q=0;Q<q.length-1;Q++){const oe=q[Q],be=[oe,q[Q+1],Y[Q+1],Y[Q],oe];Ec(V,be)&&($=Math.min($,Qc(V,be)))}}return $!==1/0&&$}(C[0],C[1],A)}}function eo(i,e){return i.x*e.x+i.y*e.y}function Qc(i,e){if(i.length===1){let r=0;const a=e[r++];let o;for(;!o||a.equals(o);)if(o=e[r++],!o)return 1/0;for(;r<e.length;r++){const u=e[r],d=i[0],f=o.sub(a),_=u.sub(a),x=d.sub(a),b=eo(f,f),T=eo(f,_),A=eo(_,_),C=eo(x,f),P=eo(x,_),D=b*A-T*T,V=(A*C-T*P)/D,$=(b*P-T*C)/D,H=a.z*(1-V-$)+o.z*V+u.z*$;if(isFinite(H))return H}return 1/0}{let r=1/0;for(const a of e)r=Math.min(r,a.z);return r}}const ep=xt([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:tp}=ep,ip=xt([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:rp}=ip,sp=ks.VectorTileFeature.types,ap=Math.cos(Math.PI/180*37.5),eh=Math.pow(2,14)/.5;class ec{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new Le,this.layoutVertexArray2=new Me,this.indexArray=new Zt,this.programConfigurations=new xr(e.layers,e.zoom),this.segments=new ut,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,a){this.hasPattern=Hl("line",this.layers,r);const o=this.layers[0].layout.get("line-sort-key"),u=!o.isConstant(),d=[];for(const{feature:f,id:_,index:x,sourceLayerIndex:b}of e){const T=this.layers[0]._featureFilter.needGeometry,A=oa(f,T);if(!this.layers[0]._featureFilter.filter(new ht(this.zoom),A,a))continue;const C=u?o.evaluate(A,{},a):void 0,P={id:_,properties:f.properties,type:f.type,sourceLayerIndex:b,index:x,geometry:T?A.geometry:na(f),patterns:{},sortKey:C};d.push(P)}u&&d.sort((f,_)=>f.sortKey-_.sortKey);for(const f of d){const{geometry:_,index:x,sourceLayerIndex:b}=f;if(this.hasPattern){const T=Kl("line",this.layers,f,this.zoom,r);this.patternFeatures.push(T)}else this.addFeature(f,_,x,a,{});r.featureIndex.insert(e[x].feature,_,x,b,this.index)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,a)}addFeatures(e,r,a){for(const o of this.patternFeatures)this.addFeature(o,o.geometry,o.index,r,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,rp)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,tp),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,r,a,o,u){const d=this.layers[0].layout,f=d.get("line-join").evaluate(e,{}),_=d.get("line-cap"),x=d.get("line-miter-limit"),b=d.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const T of r)this.addLine(T,e,f,_,x,b);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,u,o)}addLine(e,r,a,o,u,d){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let $=0;$<e.length-1;$++)this.totalDistance+=e[$].dist(e[$+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const f=sp[r.type]==="Polygon";let _=e.length;for(;_>=2&&e[_-1].equals(e[_-2]);)_--;let x=0;for(;x<_-1&&e[x].equals(e[x+1]);)x++;if(_<(f?3:2))return;a==="bevel"&&(u=1.05);const b=this.overscaling<=16?15*zt/(512*this.overscaling):0,T=this.segments.prepareSegment(10*_,this.layoutVertexArray,this.indexArray);let A,C,P,D,V;this.e1=this.e2=-1,f&&(A=e[_-2],V=e[x].sub(A)._unit()._perp());for(let $=x;$<_;$++){if(P=$===_-1?f?e[x+1]:void 0:e[$+1],P&&e[$].equals(P))continue;V&&(D=V),A&&(C=A),A=e[$],V=P?P.sub(A)._unit()._perp():D,D=D||V;let H=D.add(V);H.x===0&&H.y===0||H._unit();const q=D.x*V.x+D.y*V.y,Y=H.x*V.x+H.y*V.y,Q=Y!==0?1/Y:1/0,oe=2*Math.sqrt(2-2*Y),be=Y<ap&&C&&P,Ae=D.x*V.y-D.y*V.x>0;if(be&&$>x){const de=A.dist(C);if(de>2*b){const Se=A.sub(A.sub(C)._mult(b/de)._round());this.updateDistance(C,Se),this.addCurrentVertex(Se,D,0,0,T),C=Se}}const xe=C&&P;let ye=xe?a:f?"butt":o;if(xe&&ye==="round"&&(Q<d?ye="miter":Q<=2&&(ye="fakeround")),ye==="miter"&&Q>u&&(ye="bevel"),ye==="bevel"&&(Q>2&&(ye="flipbevel"),Q<u&&(ye="miter")),C&&this.updateDistance(C,A),ye==="miter")H._mult(Q),this.addCurrentVertex(A,H,0,0,T);else if(ye==="flipbevel"){if(Q>100)H=V.mult(-1);else{const de=Q*D.add(V).mag()/D.sub(V).mag();H._perp()._mult(de*(Ae?-1:1))}this.addCurrentVertex(A,H,0,0,T),this.addCurrentVertex(A,H.mult(-1),0,0,T)}else if(ye==="bevel"||ye==="fakeround"){const de=-Math.sqrt(Q*Q-1),Se=Ae?de:0,me=Ae?0:de;if(C&&this.addCurrentVertex(A,D,Se,me,T),ye==="fakeround"){const ue=Math.round(180*oe/Math.PI/20);for(let ke=1;ke<ue;ke++){let Ee=ke/ue;if(Ee!==.5){const pt=Ee-.5;Ee+=Ee*pt*(Ee-1)*((1.0904+q*(q*(3.55645-1.43519*q)-3.2452))*pt*pt+(.848013+q*(.215638*q-1.06021)))}const $e=V.sub(D)._mult(Ee)._add(D)._unit()._mult(Ae?-1:1);this.addHalfVertex(A,$e.x,$e.y,!1,Ae,0,T)}}P&&this.addCurrentVertex(A,V,-Se,-me,T)}else if(ye==="butt")this.addCurrentVertex(A,H,0,0,T);else if(ye==="square"){const de=C?1:-1;this.addCurrentVertex(A,H,de,de,T)}else ye==="round"&&(C&&(this.addCurrentVertex(A,D,0,0,T),this.addCurrentVertex(A,D,1,1,T,!0)),P&&(this.addCurrentVertex(A,V,-1,-1,T,!0),this.addCurrentVertex(A,V,0,0,T)));if(be&&$<_-1){const de=A.dist(P);if(de>2*b){const Se=A.add(P.sub(A)._mult(b/de)._round());this.updateDistance(A,Se),this.addCurrentVertex(Se,V,0,0,T),A=Se}}}}addCurrentVertex(e,r,a,o,u,d=!1){const f=r.y*o-r.x,_=-r.y-r.x*o;this.addHalfVertex(e,r.x+r.y*a,r.y-r.x*a,d,!1,a,u),this.addHalfVertex(e,f,_,d,!0,-o,u),this.distance>eh/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,r,a,o,u,d))}addHalfVertex({x:e,y:r},a,o,u,d,f,_){const x=.5*(this.lineClips?this.scaledDistance*(eh-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(u?1:0),(r<<1)+(d?1:0),Math.round(63*a)+128,Math.round(63*o)+128,1+(f===0?0:f<0?-1:1)|(63&x)<<2,x>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const b=_.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,b),_.primitiveLength++),d?this.e2=b:this.e1=b}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,r){this.distance+=e.dist(r),this.updateScaledDistance()}}let th,ih;we("LineBucket",ec,{omit:["layers","patternFeatures"]});var rh={get paint(){return ih=ih||new Mt({"line-opacity":new De(re.paint_line["line-opacity"]),"line-color":new De(re.paint_line["line-color"]),"line-translate":new Ce(re.paint_line["line-translate"]),"line-translate-anchor":new Ce(re.paint_line["line-translate-anchor"]),"line-width":new De(re.paint_line["line-width"]),"line-gap-width":new De(re.paint_line["line-gap-width"]),"line-offset":new De(re.paint_line["line-offset"]),"line-blur":new De(re.paint_line["line-blur"]),"line-dasharray":new Fn(re.paint_line["line-dasharray"]),"line-pattern":new ra(re.paint_line["line-pattern"]),"line-gradient":new On(re.paint_line["line-gradient"])})},get layout(){return th=th||new Mt({"line-cap":new Ce(re.layout_line["line-cap"]),"line-join":new De(re.layout_line["line-join"]),"line-miter-limit":new Ce(re.layout_line["line-miter-limit"]),"line-round-limit":new Ce(re.layout_line["line-round-limit"]),"line-sort-key":new De(re.layout_line["line-sort-key"])})}};class np extends De{possiblyEvaluate(e,r){return r=new ht(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(e,r)}evaluate(e,r,a,o){return r=$t({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(e,r,a,o)}}let sl;class op extends Vi{constructor(e){super(e,rh),this.gradientVersion=0,sl||(sl=new np(rh.paint.properties["line-width"].specification),sl.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){const r=this.gradientExpression();this.stepInterpolant=!!function(a){return a._styleExpression!==void 0}(r)&&r._styleExpression.expression instanceof Dr,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,r){super.recalculate(e,r),this.paint._values["line-floorwidth"]=sl.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new ec(e)}queryRadius(e){const r=e,a=sh(Gn("line-width",this,r),Gn("line-gap-width",this,r)),o=Gn("line-offset",this,r);return a/2+Math.abs(o)+Yo(this.paint.get("line-translate"))}queryIntersectsFeature(e,r,a,o,u,d,f){const _=Jo(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),d.angle,f),x=f/2*sh(this.paint.get("line-width").evaluate(r,a),this.paint.get("line-gap-width").evaluate(r,a)),b=this.paint.get("line-offset").evaluate(r,a);return b&&(o=function(T,A){const C=[];for(let P=0;P<T.length;P++){const D=T[P],V=[];for(let $=0;$<D.length;$++){const H=D[$-1],q=D[$],Y=D[$+1],Q=$===0?new Be(0,0):q.sub(H)._unit()._perp(),oe=$===D.length-1?new Be(0,0):Y.sub(q)._unit()._perp(),be=Q._add(oe)._unit(),Ae=be.x*oe.x+be.y*oe.y;Ae!==0&&be._mult(1/Ae),V.push(be._mult(A)._add(q))}C.push(V)}return C}(o,b*f)),function(T,A,C){for(let P=0;P<A.length;P++){const D=A[P];if(T.length>=3){for(let V=0;V<D.length;V++)if(qa(T,D[V]))return!0}if(du(T,D,C))return!0}return!1}(_,o,x)}isTileClipped(){return!0}}function sh(i,e){return e>0?e+2*i:i}const lp=xt([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),cp=xt([{name:"a_projected_pos",components:3,type:"Float32"}],4);xt([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const hp=xt([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);xt([{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"}]);const ah=xt([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),up=xt([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function pp(i,e,r){return i.sections.forEach(a=>{a.text=function(o,u,d){const f=u.layout.get("text-transform").evaluate(d,{});return f==="uppercase"?o=o.toLocaleUpperCase():f==="lowercase"&&(o=o.toLocaleLowerCase()),Ii.applyArabicShaping&&(o=Ii.applyArabicShaping(o)),o}(a.text,e,r)}),i}xt([{name:"triangle",components:3,type:"Uint16"}]),xt([{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"}]),xt([{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",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),xt([{type:"Float32",name:"offsetX"}]),xt([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),xt([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const to={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Rt=24,nh=at,oh=function(i,e,r,a,o){var u,d,f=8*o-a-1,_=(1<<f)-1,x=_>>1,b=-7,T=r?o-1:0,A=r?-1:1,C=i[e+T];for(T+=A,u=C&(1<<-b)-1,C>>=-b,b+=f;b>0;u=256*u+i[e+T],T+=A,b-=8);for(d=u&(1<<-b)-1,u>>=-b,b+=a;b>0;d=256*d+i[e+T],T+=A,b-=8);if(u===0)u=1-x;else{if(u===_)return d?NaN:1/0*(C?-1:1);d+=Math.pow(2,a),u-=x}return(C?-1:1)*d*Math.pow(2,u-a)},lh=function(i,e,r,a,o,u){var d,f,_,x=8*u-o-1,b=(1<<x)-1,T=b>>1,A=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=a?0:u-1,P=a?1:-1,D=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(f=isNaN(e)?1:0,d=b):(d=Math.floor(Math.log(e)/Math.LN2),e*(_=Math.pow(2,-d))<1&&(d--,_*=2),(e+=d+T>=1?A/_:A*Math.pow(2,1-T))*_>=2&&(d++,_/=2),d+T>=b?(f=0,d=b):d+T>=1?(f=(e*_-1)*Math.pow(2,o),d+=T):(f=e*Math.pow(2,T-1)*Math.pow(2,o),d=0));o>=8;i[r+C]=255&f,C+=P,f/=256,o-=8);for(d=d<<o|f,x+=o;x>0;i[r+C]=255&d,C+=P,d/=256,x-=8);i[r+C-P]|=128*D};function at(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}at.Varint=0,at.Fixed64=1,at.Bytes=2,at.Fixed32=5;var tc=4294967296,ch=1/tc,hh=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function ss(i){return i.type===at.Bytes?i.readVarint()+i.pos:i.pos+1}function Wa(i,e,r){return r?4294967296*e+(i>>>0):4294967296*(e>>>0)+(i>>>0)}function uh(i,e,r){var a=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(a);for(var o=r.pos-1;o>=i;o--)r.buf[o+a]=r.buf[o]}function dp(i,e){for(var r=0;r<i.length;r++)e.writeVarint(i[r])}function fp(i,e){for(var r=0;r<i.length;r++)e.writeSVarint(i[r])}function mp(i,e){for(var r=0;r<i.length;r++)e.writeFloat(i[r])}function gp(i,e){for(var r=0;r<i.length;r++)e.writeDouble(i[r])}function _p(i,e){for(var r=0;r<i.length;r++)e.writeBoolean(i[r])}function yp(i,e){for(var r=0;r<i.length;r++)e.writeFixed32(i[r])}function xp(i,e){for(var r=0;r<i.length;r++)e.writeSFixed32(i[r])}function vp(i,e){for(var r=0;r<i.length;r++)e.writeFixed64(i[r])}function bp(i,e){for(var r=0;r<i.length;r++)e.writeSFixed64(i[r])}function al(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+16777216*i[e+3]}function Ha(i,e,r){i[r]=e,i[r+1]=e>>>8,i[r+2]=e>>>16,i[r+3]=e>>>24}function ph(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+(i[e+3]<<24)}at.prototype={destroy:function(){this.buf=null},readFields:function(i,e,r){for(r=r||this.length;this.pos<r;){var a=this.readVarint(),o=a>>3,u=this.pos;this.type=7&a,i(o,e,this),this.pos===u&&this.skip(a)}return e},readMessage:function(i,e){return this.readFields(i,e,this.readVarint()+this.pos)},readFixed32:function(){var i=al(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=ph(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=al(this.buf,this.pos)+al(this.buf,this.pos+4)*tc;return this.pos+=8,i},readSFixed64:function(){var i=al(this.buf,this.pos)+ph(this.buf,this.pos+4)*tc;return this.pos+=8,i},readFloat:function(){var i=oh(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=oh(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(i){var e,r,a=this.buf;return e=127&(r=a[this.pos++]),r<128?e:(e|=(127&(r=a[this.pos++]))<<7,r<128?e:(e|=(127&(r=a[this.pos++]))<<14,r<128?e:(e|=(127&(r=a[this.pos++]))<<21,r<128?e:function(o,u,d){var f,_,x=d.buf;if(f=(112&(_=x[d.pos++]))>>4,_<128||(f|=(127&(_=x[d.pos++]))<<3,_<128)||(f|=(127&(_=x[d.pos++]))<<10,_<128)||(f|=(127&(_=x[d.pos++]))<<17,_<128)||(f|=(127&(_=x[d.pos++]))<<24,_<128)||(f|=(1&(_=x[d.pos++]))<<31,_<128))return Wa(o,f,u);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=a[this.pos]))<<28,i,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var i=this.readVarint();return i%2==1?(i+1)/-2:i/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var i=this.readVarint()+this.pos,e=this.pos;return this.pos=i,i-e>=12&&hh?function(r,a,o){return hh.decode(r.subarray(a,o))}(this.buf,e,i):function(r,a,o){for(var u="",d=a;d<o;){var f,_,x,b=r[d],T=null,A=b>239?4:b>223?3:b>191?2:1;if(d+A>o)break;A===1?b<128&&(T=b):A===2?(192&(f=r[d+1]))==128&&(T=(31&b)<<6|63&f)<=127&&(T=null):A===3?(_=r[d+2],(192&(f=r[d+1]))==128&&(192&_)==128&&((T=(15&b)<<12|(63&f)<<6|63&_)<=2047||T>=55296&&T<=57343)&&(T=null)):A===4&&(_=r[d+2],x=r[d+3],(192&(f=r[d+1]))==128&&(192&_)==128&&(192&x)==128&&((T=(15&b)<<18|(63&f)<<12|(63&_)<<6|63&x)<=65535||T>=1114112)&&(T=null)),T===null?(T=65533,A=1):T>65535&&(T-=65536,u+=String.fromCharCode(T>>>10&1023|55296),T=56320|1023&T),u+=String.fromCharCode(T),d+=A}return u}(this.buf,e,i)},readBytes:function(){var i=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,i);return this.pos=i,e},readPackedVarint:function(i,e){if(this.type!==at.Bytes)return i.push(this.readVarint(e));var r=ss(this);for(i=i||[];this.pos<r;)i.push(this.readVarint(e));return i},readPackedSVarint:function(i){if(this.type!==at.Bytes)return i.push(this.readSVarint());var e=ss(this);for(i=i||[];this.pos<e;)i.push(this.readSVarint());return i},readPackedBoolean:function(i){if(this.type!==at.Bytes)return i.push(this.readBoolean());var e=ss(this);for(i=i||[];this.pos<e;)i.push(this.readBoolean());return i},readPackedFloat:function(i){if(this.type!==at.Bytes)return i.push(this.readFloat());var e=ss(this);for(i=i||[];this.pos<e;)i.push(this.readFloat());return i},readPackedDouble:function(i){if(this.type!==at.Bytes)return i.push(this.readDouble());var e=ss(this);for(i=i||[];this.pos<e;)i.push(this.readDouble());return i},readPackedFixed32:function(i){if(this.type!==at.Bytes)return i.push(this.readFixed32());var e=ss(this);for(i=i||[];this.pos<e;)i.push(this.readFixed32());return i},readPackedSFixed32:function(i){if(this.type!==at.Bytes)return i.push(this.readSFixed32());var e=ss(this);for(i=i||[];this.pos<e;)i.push(this.readSFixed32());return i},readPackedFixed64:function(i){if(this.type!==at.Bytes)return i.push(this.readFixed64());var e=ss(this);for(i=i||[];this.pos<e;)i.push(this.readFixed64());return i},readPackedSFixed64:function(i){if(this.type!==at.Bytes)return i.push(this.readSFixed64());var e=ss(this);for(i=i||[];this.pos<e;)i.push(this.readSFixed64());return i},skip:function(i){var e=7&i;if(e===at.Varint)for(;this.buf[this.pos++]>127;);else if(e===at.Bytes)this.pos=this.readVarint()+this.pos;else if(e===at.Fixed32)this.pos+=4;else{if(e!==at.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(i,e){this.writeVarint(i<<3|e)},realloc:function(i){for(var e=this.length||16;e<this.pos+i;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(i){this.realloc(4),Ha(this.buf,i,this.pos),this.pos+=4},writeSFixed32:function(i){this.realloc(4),Ha(this.buf,i,this.pos),this.pos+=4},writeFixed64:function(i){this.realloc(8),Ha(this.buf,-1&i,this.pos),Ha(this.buf,Math.floor(i*ch),this.pos+4),this.pos+=8},writeSFixed64:function(i){this.realloc(8),Ha(this.buf,-1&i,this.pos),Ha(this.buf,Math.floor(i*ch),this.pos+4),this.pos+=8},writeVarint:function(i){(i=+i||0)>268435455||i<0?function(e,r){var a,o;if(e>=0?(a=e%4294967296|0,o=e/4294967296|0):(o=~(-e/4294967296),4294967295^(a=~(-e%4294967296))?a=a+1|0:(a=0,o=o+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),function(u,d,f){f.buf[f.pos++]=127&u|128,u>>>=7,f.buf[f.pos++]=127&u|128,u>>>=7,f.buf[f.pos++]=127&u|128,u>>>=7,f.buf[f.pos++]=127&u|128,f.buf[f.pos]=127&(u>>>=7)}(a,0,r),function(u,d){var f=(7&u)<<4;d.buf[d.pos++]|=f|((u>>>=3)?128:0),u&&(d.buf[d.pos++]=127&u|((u>>>=7)?128:0),u&&(d.buf[d.pos++]=127&u|((u>>>=7)?128:0),u&&(d.buf[d.pos++]=127&u|((u>>>=7)?128:0),u&&(d.buf[d.pos++]=127&u|((u>>>=7)?128:0),u&&(d.buf[d.pos++]=127&u)))))}(o,r)}(i,this):(this.realloc(4),this.buf[this.pos++]=127&i|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=i>>>7&127))))},writeSVarint:function(i){this.writeVarint(i<0?2*-i-1:2*i)},writeBoolean:function(i){this.writeVarint(!!i)},writeString:function(i){i=String(i),this.realloc(4*i.length),this.pos++;var e=this.pos;this.pos=function(a,o,u){for(var d,f,_=0;_<o.length;_++){if((d=o.charCodeAt(_))>55295&&d<57344){if(!f){d>56319||_+1===o.length?(a[u++]=239,a[u++]=191,a[u++]=189):f=d;continue}if(d<56320){a[u++]=239,a[u++]=191,a[u++]=189,f=d;continue}d=f-55296<<10|d-56320|65536,f=null}else f&&(a[u++]=239,a[u++]=191,a[u++]=189,f=null);d<128?a[u++]=d:(d<2048?a[u++]=d>>6|192:(d<65536?a[u++]=d>>12|224:(a[u++]=d>>18|240,a[u++]=d>>12&63|128),a[u++]=d>>6&63|128),a[u++]=63&d|128)}return u}(this.buf,i,this.pos);var r=this.pos-e;r>=128&&uh(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(i){this.realloc(4),lh(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),lh(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(i){var e=i.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=i[r]},writeRawMessage:function(i,e){this.pos++;var r=this.pos;i(e,this);var a=this.pos-r;a>=128&&uh(r,a,this),this.pos=r-1,this.writeVarint(a),this.pos+=a},writeMessage:function(i,e,r){this.writeTag(i,at.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(i,e){e.length&&this.writeMessage(i,dp,e)},writePackedSVarint:function(i,e){e.length&&this.writeMessage(i,fp,e)},writePackedBoolean:function(i,e){e.length&&this.writeMessage(i,_p,e)},writePackedFloat:function(i,e){e.length&&this.writeMessage(i,mp,e)},writePackedDouble:function(i,e){e.length&&this.writeMessage(i,gp,e)},writePackedFixed32:function(i,e){e.length&&this.writeMessage(i,yp,e)},writePackedSFixed32:function(i,e){e.length&&this.writeMessage(i,xp,e)},writePackedFixed64:function(i,e){e.length&&this.writeMessage(i,vp,e)},writePackedSFixed64:function(i,e){e.length&&this.writeMessage(i,bp,e)},writeBytesField:function(i,e){this.writeTag(i,at.Bytes),this.writeBytes(e)},writeFixed32Field:function(i,e){this.writeTag(i,at.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(i,e){this.writeTag(i,at.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(i,e){this.writeTag(i,at.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(i,e){this.writeTag(i,at.Fixed64),this.writeSFixed64(e)},writeVarintField:function(i,e){this.writeTag(i,at.Varint),this.writeVarint(e)},writeSVarintField:function(i,e){this.writeTag(i,at.Varint),this.writeSVarint(e)},writeStringField:function(i,e){this.writeTag(i,at.Bytes),this.writeString(e)},writeFloatField:function(i,e){this.writeTag(i,at.Fixed32),this.writeFloat(e)},writeDoubleField:function(i,e){this.writeTag(i,at.Fixed64),this.writeDouble(e)},writeBooleanField:function(i,e){this.writeVarintField(i,!!e)}};var ic=ie(nh);const rc=3;function wp(i,e,r){i===1&&r.readMessage(Sp,e)}function Sp(i,e,r){if(i===3){const{id:a,bitmap:o,width:u,height:d,left:f,top:_,advance:x}=r.readMessage(Tp,{});e.push({id:a,bitmap:new Wn({width:u+2*rc,height:d+2*rc},o),metrics:{width:u,height:d,left:f,top:_,advance:x}})}}function Tp(i,e,r){i===1?e.id=r.readVarint():i===2?e.bitmap=r.readBytes():i===3?e.width=r.readVarint():i===4?e.height=r.readVarint():i===5?e.left=r.readSVarint():i===6?e.top=r.readSVarint():i===7&&(e.advance=r.readVarint())}const dh=rc;function fh(i){let e=0,r=0;for(const d of i)e+=d.w*d.h,r=Math.max(r,d.w);i.sort((d,f)=>f.h-d.h);const a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}];let o=0,u=0;for(const d of i)for(let f=a.length-1;f>=0;f--){const _=a[f];if(!(d.w>_.w||d.h>_.h)){if(d.x=_.x,d.y=_.y,u=Math.max(u,d.y+d.h),o=Math.max(o,d.x+d.w),d.w===_.w&&d.h===_.h){const x=a.pop();f<a.length&&(a[f]=x)}else d.h===_.h?(_.x+=d.w,_.w-=d.w):d.w===_.w?(_.y+=d.h,_.h-=d.h):(a.push({x:_.x+d.w,y:_.y,w:_.w-d.w,h:d.h}),_.y+=d.h,_.h-=d.h);break}}return{w:o,h:u,fill:e/(o*u)||0}}const Mi=1;class sc{constructor(e,{pixelRatio:r,version:a,stretchX:o,stretchY:u,content:d}){this.paddedRect=e,this.pixelRatio=r,this.stretchX=o,this.stretchY=u,this.content=d,this.version=a}get tl(){return[this.paddedRect.x+Mi,this.paddedRect.y+Mi]}get br(){return[this.paddedRect.x+this.paddedRect.w-Mi,this.paddedRect.y+this.paddedRect.h-Mi]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2*Mi)/this.pixelRatio,(this.paddedRect.h-2*Mi)/this.pixelRatio]}}class mh{constructor(e,r){const a={},o={};this.haveRenderCallbacks=[];const u=[];this.addImages(e,a,u),this.addImages(r,o,u);const{w:d,h:f}=fh(u),_=new qi({width:d||1,height:f||1});for(const x in e){const b=e[x],T=a[x].paddedRect;qi.copy(b.data,_,{x:0,y:0},{x:T.x+Mi,y:T.y+Mi},b.data)}for(const x in r){const b=r[x],T=o[x].paddedRect,A=T.x+Mi,C=T.y+Mi,P=b.data.width,D=b.data.height;qi.copy(b.data,_,{x:0,y:0},{x:A,y:C},b.data),qi.copy(b.data,_,{x:0,y:D-1},{x:A,y:C-1},{width:P,height:1}),qi.copy(b.data,_,{x:0,y:0},{x:A,y:C+D},{width:P,height:1}),qi.copy(b.data,_,{x:P-1,y:0},{x:A-1,y:C},{width:1,height:D}),qi.copy(b.data,_,{x:0,y:0},{x:A+P,y:C},{width:1,height:D})}this.image=_,this.iconPositions=a,this.patternPositions=o}addImages(e,r,a){for(const o in e){const u=e[o],d={x:0,y:0,w:u.data.width+2*Mi,h:u.data.height+2*Mi};a.push(d),r[o]=new sc(d,u),u.hasRenderCallback&&this.haveRenderCallbacks.push(o)}}patchUpdatedImages(e,r){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const a in e.updatedImages)this.patchUpdatedImage(this.iconPositions[a],e.getImage(a),r),this.patchUpdatedImage(this.patternPositions[a],e.getImage(a),r)}patchUpdatedImage(e,r,a){if(!e||!r||e.version===r.version)return;e.version=r.version;const[o,u]=e.tl;a.update(r.data,void 0,{x:o,y:u})}}var zs;we("ImagePosition",sc),we("ImageAtlas",mh),c.ai=void 0,(zs=c.ai||(c.ai={}))[zs.none=0]="none",zs[zs.horizontal=1]="horizontal",zs[zs.vertical=2]="vertical",zs[zs.horizontalOnly=3]="horizontalOnly";const io=-17;class ro{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,r){const a=new ro;return a.scale=e||1,a.fontStack=r,a}static forImage(e){const r=new ro;return r.imageName=e,r}}class Ka{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,r){const a=new Ka;for(let o=0;o<e.sections.length;o++){const u=e.sections[o];u.image?a.addImageSection(u):a.addTextSection(u,r)}return a}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}getCharCode(e){return this.text.charCodeAt(e)}verticalizePunctuation(){this.text=function(e){let r="";for(let a=0;a<e.length;a++){const o=e.charCodeAt(a+1)||null,u=e.charCodeAt(a-1)||null;r+=o&&No(o)&&!to[e[a+1]]||u&&No(u)&&!to[e[a-1]]||!to[e[a]]?e[a]:to[e[a]]}return r}(this.text)}trim(){let e=0;for(let a=0;a<this.text.length&&ol[this.text.charCodeAt(a)];a++)e++;let r=this.text.length;for(let a=this.text.length-1;a>=0&&a>=e&&ol[this.text.charCodeAt(a)];a--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)}substring(e,r){const a=new Ka;return a.text=this.text.substring(e,r),a.sectionIndex=this.sectionIndex.slice(e,r),a.sections=this.sections,a}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}addTextSection(e,r){this.text+=e.text,this.sections.push(ro.forText(e.scale,e.fontStack||r));const a=this.sections.length-1;for(let o=0;o<e.text.length;++o)this.sectionIndex.push(a)}addImageSection(e){const r=e.image?e.image.name:"";if(r.length===0)return void ti("Can't add FormattedSection with an empty image.");const a=this.getNextImageSectionCharCode();a?(this.text+=String.fromCharCode(a),this.sections.push(ro.forImage(r)),this.sectionIndex.push(this.sections.length-1)):ti("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function nl(i,e,r,a,o,u,d,f,_,x,b,T,A,C,P,D){const V=Ka.fromFeature(i,o);let $;T===c.ai.vertical&&V.verticalizePunctuation();const{processBidirectionalText:H,processStyledBidirectionalText:q}=Ii;if(H&&V.sections.length===1){$=[];const oe=H(V.toString(),ac(V,x,u,e,a,C,P));for(const be of oe){const Ae=new Ka;Ae.text=be,Ae.sections=V.sections;for(let xe=0;xe<be.length;xe++)Ae.sectionIndex.push(0);$.push(Ae)}}else if(q){$=[];const oe=q(V.text,V.sectionIndex,ac(V,x,u,e,a,C,P));for(const be of oe){const Ae=new Ka;Ae.text=be[0],Ae.sectionIndex=be[1],Ae.sections=V.sections,$.push(Ae)}}else $=function(oe,be){const Ae=[],xe=oe.text;let ye=0;for(const de of be)Ae.push(oe.substring(ye,de)),ye=de;return ye<xe.length&&Ae.push(oe.substring(ye,xe.length)),Ae}(V,ac(V,x,u,e,a,C,P));const Y=[],Q={positionedLines:Y,text:V.toString(),top:b[1],bottom:b[1],left:b[0],right:b[0],writingMode:T,iconsInText:!1,verticalizable:!1};return function(oe,be,Ae,xe,ye,de,Se,me,ue,ke,Ee,$e){let pt=0,ft=io,Ft=0,Ui=0;const gi=me==="right"?1:me==="left"?0:.5;let Dt=0;for(const Ot of ye){Ot.trim();const Vt=Ot.getMaxScale(),ai=(Vt-1)*Rt,xi={positionedGlyphs:[],lineOffset:0};oe.positionedLines[Dt]=xi;const ni=xi.positionedGlyphs;let Ei=0;if(!Ot.length()){ft+=de,++Dt;continue}for(let Nt=0;Nt<Ot.length();Nt++){const Ge=Ot.getSection(Nt),oi=Ot.getSectionIndex(Nt),Qt=Ot.getCharCode(Nt);let Ut=0,or=null,vr=null,br=null,as=Rt;const lr=!(ue===c.ai.horizontal||!Ee&&!Cn(Qt)||Ee&&(ol[Qt]||(Xt=Qt,ve.Arabic(Xt)||ve["Arabic Supplement"](Xt)||ve["Arabic Extended-A"](Xt)||ve["Arabic Presentation Forms-A"](Xt)||ve["Arabic Presentation Forms-B"](Xt))));if(Ge.imageName){const Gi=xe[Ge.imageName];if(!Gi)continue;br=Ge.imageName,oe.iconsInText=oe.iconsInText||!0,vr=Gi.paddedRect;const Pi=Gi.displaySize;Ge.scale=Ge.scale*Rt/$e,or={width:Pi[0],height:Pi[1],left:Mi,top:-dh,advance:lr?Pi[1]:Pi[0]},Ut=ai+(Rt-Pi[1]*Ge.scale),as=or.advance;const ns=lr?Pi[0]*Ge.scale-Rt*Vt:Pi[1]*Ge.scale-Rt*Vt;ns>0&&ns>Ei&&(Ei=ns)}else{const Gi=Ae[Ge.fontStack],Pi=Gi&&Gi[Qt];if(Pi&&Pi.rect)vr=Pi.rect,or=Pi.metrics;else{const ns=be[Ge.fontStack],lo=ns&&ns[Qt];if(!lo)continue;or=lo.metrics}Ut=(Vt-Ge.scale)*Rt}lr?(oe.verticalizable=!0,ni.push({glyph:Qt,imageName:br,x:pt,y:ft+Ut,vertical:lr,scale:Ge.scale,fontStack:Ge.fontStack,sectionIndex:oi,metrics:or,rect:vr}),pt+=as*Ge.scale+ke):(ni.push({glyph:Qt,imageName:br,x:pt,y:ft+Ut,vertical:lr,scale:Ge.scale,fontStack:Ge.fontStack,sectionIndex:oi,metrics:or,rect:vr}),pt+=or.advance*Ge.scale+ke)}ni.length!==0&&(Ft=Math.max(pt-ke,Ft),Mp(ni,0,ni.length-1,gi,Ei)),pt=0;const Ci=de*Vt+Ei;xi.lineOffset=Math.max(Ei,ai),ft+=Ci,Ui=Math.max(Ci,Ui),++Dt}var Xt;const Jt=ft-io,{horizontalAlign:_i,verticalAlign:yi}=nc(Se);(function(Ot,Vt,ai,xi,ni,Ei,Ci,Nt,Ge){const oi=(Vt-ai)*ni;let Qt=0;Qt=Ei!==Ci?-Nt*xi-io:(-xi*Ge+.5)*Ci;for(const Ut of Ot)for(const or of Ut.positionedGlyphs)or.x+=oi,or.y+=Qt})(oe.positionedLines,gi,_i,yi,Ft,Ui,de,Jt,ye.length),oe.top+=-yi*Jt,oe.bottom=oe.top+Jt,oe.left+=-_i*Ft,oe.right=oe.left+Ft}(Q,e,r,a,$,d,f,_,T,x,A,D),!function(oe){for(const be of oe)if(be.positionedGlyphs.length!==0)return!1;return!0}(Y)&&Q}const ol={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Ip={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function gh(i,e,r,a,o,u){if(e.imageName){const d=a[e.imageName];return d?d.displaySize[0]*e.scale*Rt/u+o:0}{const d=r[e.fontStack],f=d&&d[i];return f?f.metrics.advance*e.scale+o:0}}function _h(i,e,r,a){const o=Math.pow(i-e,2);return a?i<e?o/2:2*o:o+Math.abs(r)*r}function Ap(i,e,r){let a=0;return i===10&&(a-=1e4),r&&(a+=150),i!==40&&i!==65288||(a+=50),e!==41&&e!==65289||(a+=50),a}function yh(i,e,r,a,o,u){let d=null,f=_h(e,r,o,u);for(const _ of a){const x=_h(e-_.x,r,o,u)+_.badness;x<=f&&(d=_,f=x)}return{index:i,x:e,priorBreak:d,badness:f}}function xh(i){return i?xh(i.priorBreak).concat(i.index):[]}function ac(i,e,r,a,o,u,d){if(u!=="point")return[];if(!i)return[];const f=[],_=function(A,C,P,D,V,$){let H=0;for(let q=0;q<A.length();q++){const Y=A.getSection(q);H+=gh(A.getCharCode(q),Y,D,V,C,$)}return H/Math.max(1,Math.ceil(H/P))}(i,e,r,a,o,d),x=i.text.indexOf("​")>=0;let b=0;for(let A=0;A<i.length();A++){const C=i.getSection(A),P=i.getCharCode(A);if(ol[P]||(b+=gh(P,C,a,o,e,d)),A<i.length()-1){const D=!((T=P)<11904||!(ve["Bopomofo Extended"](T)||ve.Bopomofo(T)||ve["CJK Compatibility Forms"](T)||ve["CJK Compatibility Ideographs"](T)||ve["CJK Compatibility"](T)||ve["CJK Radicals Supplement"](T)||ve["CJK Strokes"](T)||ve["CJK Symbols and Punctuation"](T)||ve["CJK Unified Ideographs Extension A"](T)||ve["CJK Unified Ideographs"](T)||ve["Enclosed CJK Letters and Months"](T)||ve["Halfwidth and Fullwidth Forms"](T)||ve.Hiragana(T)||ve["Ideographic Description Characters"](T)||ve["Kangxi Radicals"](T)||ve["Katakana Phonetic Extensions"](T)||ve.Katakana(T)||ve["Vertical Forms"](T)||ve["Yi Radicals"](T)||ve["Yi Syllables"](T)));(Ip[P]||D||C.imageName)&&f.push(yh(A+1,b,_,f,Ap(P,i.getCharCode(A+1),D&&x),!1))}}var T;return xh(yh(i.length(),b,_,f,0,!0))}function nc(i){let e=.5,r=.5;switch(i){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(i){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function Mp(i,e,r,a,o){if(!a&&!o)return;const u=i[r],d=(i[r].x+u.metrics.advance*u.scale)*a;for(let f=e;f<=r;f++)i[f].x-=d,i[f].y+=o}function Ep(i,e,r){const{horizontalAlign:a,verticalAlign:o}=nc(r),u=e[0]-i.displaySize[0]*a,d=e[1]-i.displaySize[1]*o;return{image:i,top:d,bottom:d+i.displaySize[1],left:u,right:u+i.displaySize[0]}}function vh(i,e,r,a,o,u){const d=i.image;let f;if(d.content){const V=d.content,$=d.pixelRatio||1;f=[V[0]/$,V[1]/$,d.displaySize[0]-V[2]/$,d.displaySize[1]-V[3]/$]}const _=e.left*u,x=e.right*u;let b,T,A,C;r==="width"||r==="both"?(C=o[0]+_-a[3],T=o[0]+x+a[1]):(C=o[0]+(_+x-d.displaySize[0])/2,T=C+d.displaySize[0]);const P=e.top*u,D=e.bottom*u;return r==="height"||r==="both"?(b=o[1]+P-a[0],A=o[1]+D+a[2]):(b=o[1]+(P+D-d.displaySize[1])/2,A=b+d.displaySize[1]),{image:d,top:b,right:T,bottom:A,left:C,collisionPadding:f}}const so=255,Or=128,Ds=so*Or;function bh(i,e){const{expression:r}=e;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new ht(i+1))};if(r.kind==="source")return{kind:"source"};{const{zoomStops:a,interpolationType:o}=r;let u=0;for(;u<a.length&&a[u]<=i;)u++;u=Math.max(0,u-1);let d=u;for(;d<a.length&&a[d]<i+1;)d++;d=Math.min(a.length-1,d);const f=a[u],_=a[d];return r.kind==="composite"?{kind:"composite",minZoom:f,maxZoom:_,interpolationType:o}:{kind:"camera",minZoom:f,maxZoom:_,minSize:r.evaluate(new ht(f)),maxSize:r.evaluate(new ht(_)),interpolationType:o}}}function oc(i,e,r){let a="never";const o=i.get(e);return o?a=o:i.get(r)&&(a="always"),a}const Cp=ks.VectorTileFeature.types,Pp=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function ll(i,e,r,a,o,u,d,f,_,x,b,T,A){const C=f?Math.min(Ds,Math.round(f[0])):0,P=f?Math.min(Ds,Math.round(f[1])):0;i.emplaceBack(e,r,Math.round(32*a),Math.round(32*o),u,d,(C<<1)+(_?1:0),P,16*x,16*b,256*T,256*A)}function lc(i,e,r){i.emplaceBack(e.x,e.y,r),i.emplaceBack(e.x,e.y,r),i.emplaceBack(e.x,e.y,r),i.emplaceBack(e.x,e.y,r)}function kp(i){for(const e of i.sections)if(Ll(e.text))return!0;return!1}class cc{constructor(e){this.layoutVertexArray=new je,this.indexArray=new Zt,this.programConfigurations=e,this.segments=new ut,this.dynamicLayoutVertexArray=new Ne,this.opacityVertexArray=new Ze,this.hasVisibleVertices=!1,this.placedSymbolArray=new G}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,r,a,o){this.isEmpty()||(a&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,lp.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,r),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,cp.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,Pp,!0),this.opacityVertexBuffer.itemSize=1),(a||o)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}we("SymbolBuffers",cc);class hc{constructor(e,r,a){this.layoutVertexArray=new e,this.layoutAttributes=r,this.indexArray=new a,this.segments=new ut,this.collisionVertexArray=new lt}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,hp.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}we("CollisionBuffers",hc);class Ya{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(d=>d.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=Ul([]),this.placementViewportMatrix=Ul([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=bh(this.zoom,r["text-size"]),this.iconSizeData=bh(this.zoom,r["icon-size"]);const a=this.layers[0].layout,o=a.get("symbol-sort-key"),u=a.get("symbol-z-order");this.canOverlap=oc(a,"text-overlap","text-allow-overlap")!=="never"||oc(a,"icon-overlap","icon-allow-overlap")!=="never"||a.get("text-ignore-placement")||a.get("icon-ignore-placement"),this.sortFeaturesByKey=u!=="viewport-y"&&!o.isConstant(),this.sortFeaturesByY=(u==="viewport-y"||u==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,a.get("symbol-placement")==="point"&&(this.writingModes=a.get("text-writing-mode").map(d=>c.ai[d])),this.stateDependentLayerIds=this.layers.filter(d=>d.isStateDependent()).map(d=>d.id),this.sourceID=e.sourceID}createArrays(){this.text=new cc(new xr(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new cc(new xr(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new X,this.lineVertexArray=new ee,this.symbolInstances=new U,this.textAnchorOffsets=new ne}calculateGlyphDependencies(e,r,a,o,u){for(let d=0;d<e.length;d++)if(r[e.charCodeAt(d)]=!0,(a||o)&&u){const f=to[e.charAt(d)];f&&(r[f.charCodeAt(0)]=!0)}}populate(e,r,a){const o=this.layers[0],u=o.layout,d=u.get("text-font"),f=u.get("text-field"),_=u.get("icon-image"),x=(f.value.kind!=="constant"||f.value.value instanceof Ht&&!f.value.value.isEmpty()||f.value.value.toString().length>0)&&(d.value.kind!=="constant"||d.value.value.length>0),b=_.value.kind!=="constant"||!!_.value.value||Object.keys(_.parameters).length>0,T=u.get("symbol-sort-key");if(this.features=[],!x&&!b)return;const A=r.iconDependencies,C=r.glyphDependencies,P=r.availableImages,D=new ht(this.zoom);for(const{feature:V,id:$,index:H,sourceLayerIndex:q}of e){const Y=o._featureFilter.needGeometry,Q=oa(V,Y);if(!o._featureFilter.filter(D,Q,a))continue;let oe,be;if(Y||(Q.geometry=na(V)),x){const xe=o.getValueAndResolveTokens("text-field",Q,a,P),ye=Ht.factory(xe);kp(ye)&&(this.hasRTLText=!0),(!this.hasRTLText||Bn()==="unavailable"||this.hasRTLText&&Ii.isParsed())&&(oe=pp(ye,o,Q))}if(b){const xe=o.getValueAndResolveTokens("icon-image",Q,a,P);be=xe instanceof qt?xe:qt.fromString(xe)}if(!oe&&!be)continue;const Ae=this.sortFeaturesByKey?T.evaluate(Q,{},a):void 0;if(this.features.push({id:$,text:oe,icon:be,index:H,sourceLayerIndex:q,geometry:Q.geometry,properties:V.properties,type:Cp[V.type],sortKey:Ae}),be&&(A[be.name]=!0),oe){const xe=d.evaluate(Q,{},a).join(","),ye=u.get("text-rotation-alignment")!=="viewport"&&u.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(c.ai.vertical)>=0;for(const de of oe.sections)if(de.image)A[de.image.name]=!0;else{const Se=Mn(oe.toString()),me=de.fontStack||xe,ue=C[me]=C[me]||{};this.calculateGlyphDependencies(de.text,ue,ye,this.allowVerticalPlacement,Se)}}}u.get("symbol-placement")==="line"&&(this.features=function(V){const $={},H={},q=[];let Y=0;function Q(xe){q.push(V[xe]),Y++}function oe(xe,ye,de){const Se=H[xe];return delete H[xe],H[ye]=Se,q[Se].geometry[0].pop(),q[Se].geometry[0]=q[Se].geometry[0].concat(de[0]),Se}function be(xe,ye,de){const Se=$[ye];return delete $[ye],$[xe]=Se,q[Se].geometry[0].shift(),q[Se].geometry[0]=de[0].concat(q[Se].geometry[0]),Se}function Ae(xe,ye,de){const Se=de?ye[0][ye[0].length-1]:ye[0][0];return`${xe}:${Se.x}:${Se.y}`}for(let xe=0;xe<V.length;xe++){const ye=V[xe],de=ye.geometry,Se=ye.text?ye.text.toString():null;if(!Se){Q(xe);continue}const me=Ae(Se,de),ue=Ae(Se,de,!0);if(me in H&&ue in $&&H[me]!==$[ue]){const ke=be(me,ue,de),Ee=oe(me,ue,q[ke].geometry);delete $[me],delete H[ue],H[Ae(Se,q[Ee].geometry,!0)]=Ee,q[ke].geometry=null}else me in H?oe(me,ue,de):ue in $?be(me,ue,de):(Q(xe),$[me]=Y-1,H[ue]=Y-1)}return q.filter(xe=>xe.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((V,$)=>V.sortKey-$.sortKey)}update(e,r,a){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,r,this.layers,a),this.icon.programConfigurations.updatePaintArrays(e,r,this.layers,a))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(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}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,r){const a=this.lineVertexArray.length;if(e.segment!==void 0){let o=e.dist(r[e.segment+1]),u=e.dist(r[e.segment]);const d={};for(let f=e.segment+1;f<r.length;f++)d[f]={x:r[f].x,y:r[f].y,tileUnitDistanceFromAnchor:o},f<r.length-1&&(o+=r[f+1].dist(r[f]));for(let f=e.segment||0;f>=0;f--)d[f]={x:r[f].x,y:r[f].y,tileUnitDistanceFromAnchor:u},f>0&&(u+=r[f-1].dist(r[f]));for(let f=0;f<r.length;f++){const _=d[f];this.lineVertexArray.emplaceBack(_.x,_.y,_.tileUnitDistanceFromAnchor)}}return{lineStartIndex:a,lineLength:this.lineVertexArray.length-a}}addSymbols(e,r,a,o,u,d,f,_,x,b,T,A){const C=e.indexArray,P=e.layoutVertexArray,D=e.segments.prepareSegment(4*r.length,P,C,this.canOverlap?d.sortKey:void 0),V=this.glyphOffsetArray.length,$=D.vertexLength,H=this.allowVerticalPlacement&&f===c.ai.vertical?Math.PI/2:0,q=d.text&&d.text.sections;for(let Y=0;Y<r.length;Y++){const{tl:Q,tr:oe,bl:be,br:Ae,tex:xe,pixelOffsetTL:ye,pixelOffsetBR:de,minFontScaleX:Se,minFontScaleY:me,glyphOffset:ue,isSDF:ke,sectionIndex:Ee}=r[Y],$e=D.vertexLength,pt=ue[1];ll(P,_.x,_.y,Q.x,pt+Q.y,xe.x,xe.y,a,ke,ye.x,ye.y,Se,me),ll(P,_.x,_.y,oe.x,pt+oe.y,xe.x+xe.w,xe.y,a,ke,de.x,ye.y,Se,me),ll(P,_.x,_.y,be.x,pt+be.y,xe.x,xe.y+xe.h,a,ke,ye.x,de.y,Se,me),ll(P,_.x,_.y,Ae.x,pt+Ae.y,xe.x+xe.w,xe.y+xe.h,a,ke,de.x,de.y,Se,me),lc(e.dynamicLayoutVertexArray,_,H),C.emplaceBack($e,$e+1,$e+2),C.emplaceBack($e+1,$e+2,$e+3),D.vertexLength+=4,D.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(ue[0]),Y!==r.length-1&&Ee===r[Y+1].sectionIndex||e.programConfigurations.populatePaintArrays(P.length,d,d.index,{},A,q&&q[Ee])}e.placedSymbolArray.emplaceBack(_.x,_.y,V,this.glyphOffsetArray.length-V,$,x,b,_.segment,a?a[0]:0,a?a[1]:0,o[0],o[1],f,0,!1,0,T)}_addCollisionDebugVertex(e,r,a,o,u,d){return r.emplaceBack(0,0),e.emplaceBack(a.x,a.y,o,u,Math.round(d.x),Math.round(d.y))}addCollisionDebugVertices(e,r,a,o,u,d,f){const _=u.segments.prepareSegment(4,u.layoutVertexArray,u.indexArray),x=_.vertexLength,b=u.layoutVertexArray,T=u.collisionVertexArray,A=f.anchorX,C=f.anchorY;this._addCollisionDebugVertex(b,T,d,A,C,new Be(e,r)),this._addCollisionDebugVertex(b,T,d,A,C,new Be(a,r)),this._addCollisionDebugVertex(b,T,d,A,C,new Be(a,o)),this._addCollisionDebugVertex(b,T,d,A,C,new Be(e,o)),_.vertexLength+=4;const P=u.indexArray;P.emplaceBack(x,x+1),P.emplaceBack(x+1,x+2),P.emplaceBack(x+2,x+3),P.emplaceBack(x+3,x),_.primitiveLength+=4}addDebugCollisionBoxes(e,r,a,o){for(let u=e;u<r;u++){const d=this.collisionBoxArray.get(u);this.addCollisionDebugVertices(d.x1,d.y1,d.x2,d.y2,o?this.textCollisionBox:this.iconCollisionBox,d.anchorPoint,a)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new hc(Tt,ah.members,Lt),this.iconCollisionBox=new hc(Tt,ah.members,Lt);for(let e=0;e<this.symbolInstances.length;e++){const r=this.symbolInstances.get(e);this.addDebugCollisionBoxes(r.textBoxStartIndex,r.textBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.iconBoxStartIndex,r.iconBoxEndIndex,r,!1),this.addDebugCollisionBoxes(r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex,r,!1)}}_deserializeCollisionBoxesForSymbol(e,r,a,o,u,d,f,_,x){const b={};for(let T=r;T<a;T++){const A=e.get(T);b.textBox={x1:A.x1,y1:A.y1,x2:A.x2,y2:A.y2,anchorPointX:A.anchorPointX,anchorPointY:A.anchorPointY},b.textFeatureIndex=A.featureIndex;break}for(let T=o;T<u;T++){const A=e.get(T);b.verticalTextBox={x1:A.x1,y1:A.y1,x2:A.x2,y2:A.y2,anchorPointX:A.anchorPointX,anchorPointY:A.anchorPointY},b.verticalTextFeatureIndex=A.featureIndex;break}for(let T=d;T<f;T++){const A=e.get(T);b.iconBox={x1:A.x1,y1:A.y1,x2:A.x2,y2:A.y2,anchorPointX:A.anchorPointX,anchorPointY:A.anchorPointY},b.iconFeatureIndex=A.featureIndex;break}for(let T=_;T<x;T++){const A=e.get(T);b.verticalIconBox={x1:A.x1,y1:A.y1,x2:A.x2,y2:A.y2,anchorPointX:A.anchorPointX,anchorPointY:A.anchorPointY},b.verticalIconFeatureIndex=A.featureIndex;break}return b}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let r=0;r<this.symbolInstances.length;r++){const a=this.symbolInstances.get(r);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,a.textBoxStartIndex,a.textBoxEndIndex,a.verticalTextBoxStartIndex,a.verticalTextBoxEndIndex,a.iconBoxStartIndex,a.iconBoxEndIndex,a.verticalIconBoxStartIndex,a.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,r){const a=e.placedSymbolArray.get(r),o=a.vertexStartIndex+4*a.numGlyphs;for(let u=a.vertexStartIndex;u<o;u+=4)e.indexArray.emplaceBack(u,u+1,u+2),e.indexArray.emplaceBack(u+1,u+2,u+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;const r=Math.sin(e),a=Math.cos(e),o=[],u=[],d=[];for(let f=0;f<this.symbolInstances.length;++f){d.push(f);const _=this.symbolInstances.get(f);o.push(0|Math.round(r*_.anchorX+a*_.anchorY)),u.push(_.featureIndex)}return d.sort((f,_)=>o[f]-o[_]||u[_]-u[f]),d}addToSortKeyRanges(e,r){const a=this.sortKeyRanges[this.sortKeyRanges.length-1];a&&a.sortKey===r?a.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:r,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){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(const r of this.symbolInstanceIndexes){const a=this.symbolInstances.get(r);this.featureSortOrder.push(a.featureIndex),[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((o,u,d)=>{o>=0&&d.indexOf(o)===u&&this.addIndicesForPlacedSymbol(this.text,o)}),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let wh,Sh;we("SymbolBucket",Ya,{omit:["layers","collisionBoxArray","features","compareText"]}),Ya.MAX_GLYPHS=65535,Ya.addDynamicAttributes=lc;var uc={get paint(){return Sh=Sh||new Mt({"icon-opacity":new De(re.paint_symbol["icon-opacity"]),"icon-color":new De(re.paint_symbol["icon-color"]),"icon-halo-color":new De(re.paint_symbol["icon-halo-color"]),"icon-halo-width":new De(re.paint_symbol["icon-halo-width"]),"icon-halo-blur":new De(re.paint_symbol["icon-halo-blur"]),"icon-translate":new Ce(re.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ce(re.paint_symbol["icon-translate-anchor"]),"text-opacity":new De(re.paint_symbol["text-opacity"]),"text-color":new De(re.paint_symbol["text-color"],{runtimeType:ii,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new De(re.paint_symbol["text-halo-color"]),"text-halo-width":new De(re.paint_symbol["text-halo-width"]),"text-halo-blur":new De(re.paint_symbol["text-halo-blur"]),"text-translate":new Ce(re.paint_symbol["text-translate"]),"text-translate-anchor":new Ce(re.paint_symbol["text-translate-anchor"])})},get layout(){return wh=wh||new Mt({"symbol-placement":new Ce(re.layout_symbol["symbol-placement"]),"symbol-spacing":new Ce(re.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ce(re.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new De(re.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ce(re.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ce(re.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Ce(re.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Ce(re.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ce(re.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ce(re.layout_symbol["icon-rotation-alignment"]),"icon-size":new De(re.layout_symbol["icon-size"]),"icon-text-fit":new Ce(re.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ce(re.layout_symbol["icon-text-fit-padding"]),"icon-image":new De(re.layout_symbol["icon-image"]),"icon-rotate":new De(re.layout_symbol["icon-rotate"]),"icon-padding":new De(re.layout_symbol["icon-padding"]),"icon-keep-upright":new Ce(re.layout_symbol["icon-keep-upright"]),"icon-offset":new De(re.layout_symbol["icon-offset"]),"icon-anchor":new De(re.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ce(re.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ce(re.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ce(re.layout_symbol["text-rotation-alignment"]),"text-field":new De(re.layout_symbol["text-field"]),"text-font":new De(re.layout_symbol["text-font"]),"text-size":new De(re.layout_symbol["text-size"]),"text-max-width":new De(re.layout_symbol["text-max-width"]),"text-line-height":new Ce(re.layout_symbol["text-line-height"]),"text-letter-spacing":new De(re.layout_symbol["text-letter-spacing"]),"text-justify":new De(re.layout_symbol["text-justify"]),"text-radial-offset":new De(re.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ce(re.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new De(re.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new De(re.layout_symbol["text-anchor"]),"text-max-angle":new Ce(re.layout_symbol["text-max-angle"]),"text-writing-mode":new Ce(re.layout_symbol["text-writing-mode"]),"text-rotate":new De(re.layout_symbol["text-rotate"]),"text-padding":new Ce(re.layout_symbol["text-padding"]),"text-keep-upright":new Ce(re.layout_symbol["text-keep-upright"]),"text-transform":new De(re.layout_symbol["text-transform"]),"text-offset":new De(re.layout_symbol["text-offset"]),"text-allow-overlap":new Ce(re.layout_symbol["text-allow-overlap"]),"text-overlap":new Ce(re.layout_symbol["text-overlap"]),"text-ignore-placement":new Ce(re.layout_symbol["text-ignore-placement"]),"text-optional":new Ce(re.layout_symbol["text-optional"])})}};class Th{constructor(e){if(e.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:pr,this.defaultValue=e}evaluate(e){if(e.formattedSection){const r=this.defaultValue.property.overrides;if(r&&r.hasOverride(e.formattedSection))return r.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}we("FormatSectionOverride",Th,{omit:["defaultValue"]});class cl extends Vi{constructor(e){super(e,uc)}recalculate(e,r){if(super.recalculate(e,r),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")==="map"?"map":"viewport"),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"){const a=this.layout.get("text-writing-mode");if(a){const o=[];for(const u of a)o.indexOf(u)<0&&o.push(u);this.layout._values["text-writing-mode"]=o}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,a,o){const u=this.layout.get(e).evaluate(r,{},a,o),d=this._unevaluatedLayout._values[e];return d.isDataDriven()||ka(d.value)||!u?u:function(f,_){return _.replace(/{([^{}]+)}/g,(x,b)=>f&&b in f?String(f[b]):"")}(r.properties,u)}createBucket(e){return new Ya(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const e of uc.paint.overridableProperties){if(!cl.hasPaintOverride(this.layout,e))continue;const r=this.paint.get(e),a=new Th(r),o=new bn(a,r.property.specification);let u=null;u=r.value.kind==="constant"||r.value.kind==="source"?new wn("source",o):new Da("composite",o,r.value.zoomStops),this.paint._values[e]=new ri(r.property,u,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,a){return!(!this.layout||r.isDataDriven()||a.isDataDriven())&&cl.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){const a=e.get("text-field"),o=uc.paint.properties[r];let u=!1;const d=f=>{for(const _ of f)if(o.overrides&&o.overrides.hasOverride(_))return void(u=!0)};if(a.value.kind==="constant"&&a.value.value instanceof Ht)d(a.value.value.sections);else if(a.value.kind==="source"){const f=x=>{u||(x instanceof Gr&&gt(x.value)===R?d(x.value.sections):x instanceof Pa?d(x.sections):x.eachChild(f))},_=a.value;_._styleExpression&&f(_._styleExpression.expression)}return u}}let Ih;var zp={get paint(){return Ih=Ih||new Mt({"background-color":new Ce(re.paint_background["background-color"]),"background-pattern":new Fn(re.paint_background["background-pattern"]),"background-opacity":new Ce(re.paint_background["background-opacity"])})}};class Dp extends Vi{constructor(e){super(e,zp)}}let Ah;var Lp={get paint(){return Ah=Ah||new Mt({"raster-opacity":new Ce(re.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ce(re.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ce(re.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ce(re.paint_raster["raster-brightness-max"]),"raster-saturation":new Ce(re.paint_raster["raster-saturation"]),"raster-contrast":new Ce(re.paint_raster["raster-contrast"]),"raster-resampling":new Ce(re.paint_raster["raster-resampling"]),"raster-fade-duration":new Ce(re.paint_raster["raster-fade-duration"])})}};class Bp extends Vi{constructor(e){super(e,Lp)}}class Rp extends Vi{constructor(e){super(e,{}),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class Fp{constructor(e){this._callback=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}}const pc=63710088e-1;class Ls{constructor(e,r){if(isNaN(e)||isNaN(r))throw new Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Ls(Vs(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const r=Math.PI/180,a=this.lat*r,o=e.lat*r,u=Math.sin(a)*Math.sin(o)+Math.cos(a)*Math.cos(o)*Math.cos((e.lng-this.lng)*r);return pc*Math.acos(Math.min(u,1))}static convert(e){if(e instanceof Ls)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Ls(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new Ls(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>]")}}const Mh=2*Math.PI*pc;function Eh(i){return Mh*Math.cos(i*Math.PI/180)}function Ch(i){return(180+i)/360}function Ph(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function kh(i,e){return i/Eh(e)}function zh(i){return 360*i-180}function dc(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90}class hl{constructor(e,r,a=0){this.x=+e,this.y=+r,this.z=+a}static fromLngLat(e,r=0){const a=Ls.convert(e);return new hl(Ch(a.lng),Ph(a.lat),kh(r,a.lat))}toLngLat(){return new Ls(zh(this.x),dc(this.y))}toAltitude(){return this.z*Eh(dc(this.y))}meterInMercatorCoordinateUnits(){return 1/Mh*(e=dc(this.y),1/Math.cos(e*Math.PI/180));var e}}function Dh(i,e,r){var a=2*Math.PI*6378137/256/Math.pow(2,r);return[i*a-2*Math.PI*6378137/2,e*a-2*Math.PI*6378137/2]}class fc{constructor(e,r,a){if(e<0||e>25||a<0||a>=Math.pow(2,e)||r<0||r>=Math.pow(2,e))throw new Error(`x=${r}, y=${a}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);this.z=e,this.x=r,this.y=a,this.key=ao(0,e,e,r,a)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r,a){const o=(d=this.y,f=this.z,_=Dh(256*(u=this.x),256*(d=Math.pow(2,f)-d-1),f),x=Dh(256*(u+1),256*(d+1),f),_[0]+","+_[1]+","+x[0]+","+x[1]);var u,d,f,_,x;const b=function(T,A,C){let P,D="";for(let V=T;V>0;V--)P=1<<V-1,D+=(A&P?1:0)+(C&P?2:0);return D}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(a==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,r>1?"@2x":"").replace(/{quadkey}/g,b).replace(/{bbox-epsg-3857}/g,o)}isChildOf(e){const r=this.z-e.z;return r>0&&e.x===this.x>>r&&e.y===this.y>>r}getTilePoint(e){const r=Math.pow(2,this.z);return new Be((e.x*r-this.x)*zt,(e.y*r-this.y)*zt)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Lh{constructor(e,r){this.wrap=e,this.canonical=r,this.key=ao(e,r.z,r.z,r.x,r.y)}}class Zi{constructor(e,r,a,o,u){if(e<a)throw new Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${a}`);this.overscaledZ=e,this.wrap=r,this.canonical=new fc(a,+o,+u),this.key=ao(r,e,a,o,u)}clone(){return new Zi(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const r=this.canonical.z-e;return e>this.canonical.z?new Zi(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Zi(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(e,r){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const a=this.canonical.z-e;return e>this.canonical.z?ao(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):ao(this.wrap*+r,e,e,this.canonical.x>>a,this.canonical.y>>a)}isChildOf(e){if(e.wrap!==this.wrap)return!1;const r=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new Zi(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const r=this.canonical.z+1,a=2*this.canonical.x,o=2*this.canonical.y;return[new Zi(r,this.wrap,r,a,o),new Zi(r,this.wrap,r,a+1,o),new Zi(r,this.wrap,r,a,o+1),new Zi(r,this.wrap,r,a+1,o+1)]}isLessThan(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))}wrapped(){return new Zi(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new Zi(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Lh(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new hl(e.x-this.wrap,e.y))}}function ao(i,e,r,a,o){(i*=2)<0&&(i=-1*i-1);const u=1<<r;return(u*u*i+u*o+a).toString(36)+r.toString(36)+e.toString(36)}we("CanonicalTileID",fc),we("OverscaledTileID",Zi,{omit:["posMatrix"]});class Bh{constructor(e,r,a,o=1,u=1,d=1,f=0){if(this.uid=e,r.height!==r.width)throw new RangeError("DEM tiles must be square");if(a&&!["mapbox","terrarium","custom"].includes(a))return void ti(`"${a}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=r.height;const _=this.dim=r.height-2;switch(this.data=new Uint32Array(r.data.buffer),a){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=o,this.greenFactor=u,this.blueFactor=d,this.baseShift=f;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let x=0;x<_;x++)this.data[this._idx(-1,x)]=this.data[this._idx(0,x)],this.data[this._idx(_,x)]=this.data[this._idx(_-1,x)],this.data[this._idx(x,-1)]=this.data[this._idx(x,0)],this.data[this._idx(x,_)]=this.data[this._idx(x,_-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(_,-1)]=this.data[this._idx(_-1,0)],this.data[this._idx(-1,_)]=this.data[this._idx(0,_-1)],this.data[this._idx(_,_)]=this.data[this._idx(_-1,_-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let x=0;x<_;x++)for(let b=0;b<_;b++){const T=this.get(x,b);T>this.max&&(this.max=T),T<this.min&&(this.min=T)}}get(e,r){const a=new Uint8Array(this.data.buffer),o=4*this._idx(e,r);return this.unpack(a[o],a[o+1],a[o+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,r){if(e<-1||e>=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(e+1)}unpack(e,r,a){return e*this.redFactor+r*this.greenFactor+a*this.blueFactor-this.baseShift}getPixels(){return new qi({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,r,a){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let o=r*this.dim,u=r*this.dim+this.dim,d=a*this.dim,f=a*this.dim+this.dim;switch(r){case-1:o=u-1;break;case 1:u=o+1}switch(a){case-1:d=f-1;break;case 1:f=d+1}const _=-r*this.dim,x=-a*this.dim;for(let b=d;b<f;b++)for(let T=o;T<u;T++)this.data[this._idx(T,b)]=e.data[this._idx(T+_,b+x)]}}we("DEMData",Bh);class Rh{constructor(e){this._stringToNumber={},this._numberToString=[];for(let r=0;r<e.length;r++){const a=e[r];this._stringToNumber[a]=r,this._numberToString[r]=a}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class Fh{constructor(e,r,a,o,u){this.type="Feature",this._vectorTileFeature=e,e._z=r,e._x=a,e._y=o,this.properties=e.properties,this.id=u}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={geometry:this.geometry};for(const r in this)r!=="_geometry"&&r!=="_vectorTileFeature"&&(e[r]=this[r]);return e}}class Oh{constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new As(zt,16,0),this.grid3D=new As(zt,16,0),this.featureIndexArray=new ce,this.promoteId=r}insert(e,r,a,o,u,d){const f=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(a,o,u);const _=d?this.grid3D:this.grid;for(let x=0;x<r.length;x++){const b=r[x],T=[1/0,1/0,-1/0,-1/0];for(let A=0;A<b.length;A++){const C=b[A];T[0]=Math.min(T[0],C.x),T[1]=Math.min(T[1],C.y),T[2]=Math.max(T[2],C.x),T[3]=Math.max(T[3],C.y)}T[0]<zt&&T[1]<zt&&T[2]>=0&&T[3]>=0&&_.insert(f,T[0],T[1],T[2],T[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new ks.VectorTile(new ic(this.rawTileData)).layers,this.sourceLayerCoder=new Rh(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,r,a,o){this.loadVTLayers();const u=e.params||{},d=zt/e.tileSize/e.scale,f=Tn(u.filter),_=e.queryGeometry,x=e.queryPadding*d,b=Nh(_),T=this.grid.query(b.minX-x,b.minY-x,b.maxX+x,b.maxY+x),A=Nh(e.cameraQueryGeometry),C=this.grid3D.query(A.minX-x,A.minY-x,A.maxX+x,A.maxY+x,(V,$,H,q)=>function(Y,Q,oe,be,Ae){for(const ye of Y)if(Q<=ye.x&&oe<=ye.y&&be>=ye.x&&Ae>=ye.y)return!0;const xe=[new Be(Q,oe),new Be(Q,Ae),new Be(be,Ae),new Be(be,oe)];if(Y.length>2){for(const ye of xe)if(qa(Y,ye))return!0}for(let ye=0;ye<Y.length-1;ye++)if(mu(Y[ye],Y[ye+1],xe))return!0;return!1}(e.cameraQueryGeometry,V-x,$-x,H+x,q+x));for(const V of C)T.push(V);T.sort(Op);const P={};let D;for(let V=0;V<T.length;V++){const $=T[V];if($===D)continue;D=$;const H=this.featureIndexArray.get($);let q=null;this.loadMatchingFeature(P,H.bucketIndex,H.sourceLayerIndex,H.featureIndex,f,u.layers,u.availableImages,r,a,o,(Y,Q,oe)=>(q||(q=na(Y)),Q.queryIntersectsFeature(_,Y,oe,q,this.z,e.transform,d,e.pixelPosMatrix)))}return P}loadMatchingFeature(e,r,a,o,u,d,f,_,x,b,T){const A=this.bucketLayerIDs[r];if(d&&!function(V,$){for(let H=0;H<V.length;H++)if($.indexOf(V[H])>=0)return!0;return!1}(d,A))return;const C=this.sourceLayerCoder.decode(a),P=this.vtLayers[C].feature(o);if(u.needGeometry){const V=oa(P,!0);if(!u.filter(new ht(this.tileID.overscaledZ),V,this.tileID.canonical))return}else if(!u.filter(new ht(this.tileID.overscaledZ),P))return;const D=this.getId(P,C);for(let V=0;V<A.length;V++){const $=A[V];if(d&&d.indexOf($)<0)continue;const H=_[$];if(!H)continue;let q={};D&&b&&(q=b.getState(H.sourceLayer||"_geojsonTileLayer",D));const Y=$t({},x[$]);Y.paint=Vh(Y.paint,H.paint,P,q,f),Y.layout=Vh(Y.layout,H.layout,P,q,f);const Q=!T||T(P,H,q);if(!Q)continue;const oe=new Fh(P,this.z,this.x,this.y,D);oe.layer=Y;let be=e[$];be===void 0&&(be=e[$]=[]),be.push({featureIndex:o,feature:oe,intersectionZ:Q})}}lookupSymbolFeatures(e,r,a,o,u,d,f,_){const x={};this.loadVTLayers();const b=Tn(u);for(const T of e)this.loadMatchingFeature(x,a,o,T,b,d,f,_,r);return x}hasLayer(e){for(const r of this.bucketLayerIDs)for(const a of r)if(e===a)return!0;return!1}getId(e,r){let a=e.id;return this.promoteId&&(a=e.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[r]],typeof a=="boolean"&&(a=Number(a))),a}}function Vh(i,e,r,a,o){return mt(i,(u,d)=>{const f=e instanceof $a?e.get(d):null;return f&&f.evaluate?f.evaluate(r,a,o):f})}function Nh(i){let e=1/0,r=1/0,a=-1/0,o=-1/0;for(const u of i)e=Math.min(e,u.x),r=Math.min(r,u.y),a=Math.max(a,u.x),o=Math.max(o,u.y);return{minX:e,minY:r,maxX:a,maxY:o}}function Op(i,e){return e-i}function Uh(i,e,r,a,o){const u=[];for(let d=0;d<i.length;d++){const f=i[d];let _;for(let x=0;x<f.length-1;x++){let b=f[x],T=f[x+1];b.x<e&&T.x<e||(b.x<e?b=new Be(e,b.y+(e-b.x)/(T.x-b.x)*(T.y-b.y))._round():T.x<e&&(T=new Be(e,b.y+(e-b.x)/(T.x-b.x)*(T.y-b.y))._round()),b.y<r&&T.y<r||(b.y<r?b=new Be(b.x+(r-b.y)/(T.y-b.y)*(T.x-b.x),r)._round():T.y<r&&(T=new Be(b.x+(r-b.y)/(T.y-b.y)*(T.x-b.x),r)._round()),b.x>=a&&T.x>=a||(b.x>=a?b=new Be(a,b.y+(a-b.x)/(T.x-b.x)*(T.y-b.y))._round():T.x>=a&&(T=new Be(a,b.y+(a-b.x)/(T.x-b.x)*(T.y-b.y))._round()),b.y>=o&&T.y>=o||(b.y>=o?b=new Be(b.x+(o-b.y)/(T.y-b.y)*(T.x-b.x),o)._round():T.y>=o&&(T=new Be(b.x+(o-b.y)/(T.y-b.y)*(T.x-b.x),o)._round()),_&&b.equals(_[_.length-1])||(_=[b],u.push(_)),_.push(T)))))}}return u}we("FeatureIndex",Oh,{omit:["rawTileData","sourceLayerCoder"]});class Bs extends Be{constructor(e,r,a,o){super(e,r),this.angle=a,o!==void 0&&(this.segment=o)}clone(){return new Bs(this.x,this.y,this.angle,this.segment)}}function $h(i,e,r,a,o){if(e.segment===void 0||r===0)return!0;let u=e,d=e.segment+1,f=0;for(;f>-r/2;){if(d--,d<0)return!1;f-=i[d].dist(u),u=i[d]}f+=i[d].dist(i[d+1]),d++;const _=[];let x=0;for(;f<r/2;){const b=i[d],T=i[d+1];if(!T)return!1;let A=i[d-1].angleTo(b)-b.angleTo(T);for(A=Math.abs((A+3*Math.PI)%(2*Math.PI)-Math.PI),_.push({distance:f,angleDelta:A}),x+=A;f-_[0].distance>a;)x-=_.shift().angleDelta;if(x>o)return!1;d++,f+=b.dist(T)}return!0}function jh(i){let e=0;for(let r=0;r<i.length-1;r++)e+=i[r].dist(i[r+1]);return e}function qh(i,e,r){return i?.6*e*r:0}function Zh(i,e){return Math.max(i?i.right-i.left:0,e?e.right-e.left:0)}function Vp(i,e,r,a,o,u){const d=qh(r,o,u),f=Zh(r,a)*u;let _=0;const x=jh(i)/2;for(let b=0;b<i.length-1;b++){const T=i[b],A=i[b+1],C=T.dist(A);if(_+C>x){const P=(x-_)/C,D=wi.number(T.x,A.x,P),V=wi.number(T.y,A.y,P),$=new Bs(D,V,A.angleTo(T),b);return $._round(),!d||$h(i,$,f,d,e)?$:void 0}_+=C}}function Np(i,e,r,a,o,u,d,f,_){const x=qh(a,u,d),b=Zh(a,o),T=b*d,A=i[0].x===0||i[0].x===_||i[0].y===0||i[0].y===_;return e-T<e/4&&(e=T+e/4),Gh(i,A?e/2*f%e:(b/2+2*u)*d*f%e,e,x,r,T,A,!1,_)}function Gh(i,e,r,a,o,u,d,f,_){const x=u/2,b=jh(i);let T=0,A=e-r,C=[];for(let P=0;P<i.length-1;P++){const D=i[P],V=i[P+1],$=D.dist(V),H=V.angleTo(D);for(;A+r<T+$;){A+=r;const q=(A-T)/$,Y=wi.number(D.x,V.x,q),Q=wi.number(D.y,V.y,q);if(Y>=0&&Y<_&&Q>=0&&Q<_&&A-x>=0&&A+x<=b){const oe=new Bs(Y,Q,H,P);oe._round(),a&&!$h(i,oe,u,a,o)||C.push(oe)}}T+=$}return f||C.length||d||(C=Gh(i,T/2,r,a,o,u,d,!0,_)),C}we("Anchor",Bs);const Ja=Mi;function Xh(i,e,r,a){const o=[],u=i.image,d=u.pixelRatio,f=u.paddedRect.w-2*Ja,_=u.paddedRect.h-2*Ja,x=i.right-i.left,b=i.bottom-i.top,T=u.stretchX||[[0,f]],A=u.stretchY||[[0,_]],C=(de,Se)=>de+Se[1]-Se[0],P=T.reduce(C,0),D=A.reduce(C,0),V=f-P,$=_-D;let H=0,q=P,Y=0,Q=D,oe=0,be=V,Ae=0,xe=$;if(u.content&&a){const de=u.content;H=ul(T,0,de[0]),Y=ul(A,0,de[1]),q=ul(T,de[0],de[2]),Q=ul(A,de[1],de[3]),oe=de[0]-H,Ae=de[1]-Y,be=de[2]-de[0]-q,xe=de[3]-de[1]-Q}const ye=(de,Se,me,ue)=>{const ke=pl(de.stretch-H,q,x,i.left),Ee=dl(de.fixed-oe,be,de.stretch,P),$e=pl(Se.stretch-Y,Q,b,i.top),pt=dl(Se.fixed-Ae,xe,Se.stretch,D),ft=pl(me.stretch-H,q,x,i.left),Ft=dl(me.fixed-oe,be,me.stretch,P),Ui=pl(ue.stretch-Y,Q,b,i.top),gi=dl(ue.fixed-Ae,xe,ue.stretch,D),Dt=new Be(ke,$e),Xt=new Be(ft,$e),Jt=new Be(ft,Ui),_i=new Be(ke,Ui),yi=new Be(Ee/d,pt/d),Ot=new Be(Ft/d,gi/d),Vt=e*Math.PI/180;if(Vt){const ni=Math.sin(Vt),Ei=Math.cos(Vt),Ci=[Ei,-ni,ni,Ei];Dt._matMult(Ci),Xt._matMult(Ci),_i._matMult(Ci),Jt._matMult(Ci)}const ai=de.stretch+de.fixed,xi=Se.stretch+Se.fixed;return{tl:Dt,tr:Xt,bl:_i,br:Jt,tex:{x:u.paddedRect.x+Ja+ai,y:u.paddedRect.y+Ja+xi,w:me.stretch+me.fixed-ai,h:ue.stretch+ue.fixed-xi},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:yi,pixelOffsetBR:Ot,minFontScaleX:be/d/x,minFontScaleY:xe/d/b,isSDF:r}};if(a&&(u.stretchX||u.stretchY)){const de=Wh(T,V,P),Se=Wh(A,$,D);for(let me=0;me<de.length-1;me++){const ue=de[me],ke=de[me+1];for(let Ee=0;Ee<Se.length-1;Ee++)o.push(ye(ue,Se[Ee],ke,Se[Ee+1]))}}else o.push(ye({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:f+1},{fixed:0,stretch:_+1}));return o}function ul(i,e,r){let a=0;for(const o of i)a+=Math.max(e,Math.min(r,o[1]))-Math.max(e,Math.min(r,o[0]));return a}function Wh(i,e,r){const a=[{fixed:-Ja,stretch:0}];for(const[o,u]of i){const d=a[a.length-1];a.push({fixed:o-d.stretch,stretch:d.stretch}),a.push({fixed:o-d.stretch,stretch:d.stretch+(u-o)})}return a.push({fixed:e+Ja,stretch:r}),a}function pl(i,e,r,a){return i/e*r+a}function dl(i,e,r,a){return i-e*r/a}class fl{constructor(e,r,a,o,u,d,f,_,x,b){if(this.boxStartIndex=e.length,x){let T=d.top,A=d.bottom;const C=d.collisionPadding;C&&(T-=C[1],A+=C[3]);let P=A-T;P>0&&(P=Math.max(10,P),this.circleDiameter=P)}else{let T=d.top*f-_[0],A=d.bottom*f+_[2],C=d.left*f-_[3],P=d.right*f+_[1];const D=d.collisionPadding;if(D&&(C-=D[0]*f,T-=D[1]*f,P+=D[2]*f,A+=D[3]*f),b){const V=new Be(C,T),$=new Be(P,T),H=new Be(C,A),q=new Be(P,A),Y=b*Math.PI/180;V._rotate(Y),$._rotate(Y),H._rotate(Y),q._rotate(Y),C=Math.min(V.x,$.x,H.x,q.x),P=Math.max(V.x,$.x,H.x,q.x),T=Math.min(V.y,$.y,H.y,q.y),A=Math.max(V.y,$.y,H.y,q.y)}e.emplaceBack(r.x,r.y,C,T,P,A,a,o,u)}this.boxEndIndex=e.length}}class Up{constructor(e=[],r=$p){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let a=(this.length>>1)-1;a>=0;a--)this._down(a)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],r=this.data.pop();return this.length--,this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:r,compare:a}=this,o=r[e];for(;e>0;){const u=e-1>>1,d=r[u];if(a(o,d)>=0)break;r[e]=d,e=u}r[e]=o}_down(e){const{data:r,compare:a}=this,o=this.length>>1,u=r[e];for(;e<o;){let d=1+(e<<1),f=r[d];const _=d+1;if(_<this.length&&a(r[_],f)<0&&(d=_,f=r[_]),a(f,u)>=0)break;r[e]=f,e=d}r[e]=u}}function $p(i,e){return i<e?-1:i>e?1:0}function jp(i,e=1,r=!1){let a=1/0,o=1/0,u=-1/0,d=-1/0;const f=i[0];for(let C=0;C<f.length;C++){const P=f[C];(!C||P.x<a)&&(a=P.x),(!C||P.y<o)&&(o=P.y),(!C||P.x>u)&&(u=P.x),(!C||P.y>d)&&(d=P.y)}const _=Math.min(u-a,d-o);let x=_/2;const b=new Up([],qp);if(_===0)return new Be(a,o);for(let C=a;C<u;C+=_)for(let P=o;P<d;P+=_)b.push(new Qa(C+x,P+x,x,i));let T=function(C){let P=0,D=0,V=0;const $=C[0];for(let H=0,q=$.length,Y=q-1;H<q;Y=H++){const Q=$[H],oe=$[Y],be=Q.x*oe.y-oe.x*Q.y;D+=(Q.x+oe.x)*be,V+=(Q.y+oe.y)*be,P+=3*be}return new Qa(D/P,V/P,0,C)}(i),A=b.length;for(;b.length;){const C=b.pop();(C.d>T.d||!T.d)&&(T=C,r&&console.log("found best %d after %d probes",Math.round(1e4*C.d)/1e4,A)),C.max-T.d<=e||(x=C.h/2,b.push(new Qa(C.p.x-x,C.p.y-x,x,i)),b.push(new Qa(C.p.x+x,C.p.y-x,x,i)),b.push(new Qa(C.p.x-x,C.p.y+x,x,i)),b.push(new Qa(C.p.x+x,C.p.y+x,x,i)),A+=4)}return r&&(console.log(`num probes: ${A}`),console.log(`best distance: ${T.d}`)),T.p}function qp(i,e){return e.max-i.max}function Qa(i,e,r,a){this.p=new Be(i,e),this.h=r,this.d=function(o,u){let d=!1,f=1/0;for(let _=0;_<u.length;_++){const x=u[_];for(let b=0,T=x.length,A=T-1;b<T;A=b++){const C=x[b],P=x[A];C.y>o.y!=P.y>o.y&&o.x<(P.x-C.x)*(o.y-C.y)/(P.y-C.y)+C.x&&(d=!d),f=Math.min(f,Pc(o,C,P))}}return(d?1:-1)*Math.sqrt(f)}(this.p,a),this.max=this.d+this.h*Math.SQRT2}var Yt;c.aq=void 0,(Yt=c.aq||(c.aq={}))[Yt.center=1]="center",Yt[Yt.left=2]="left",Yt[Yt.right=3]="right",Yt[Yt.top=4]="top",Yt[Yt.bottom=5]="bottom",Yt[Yt["top-left"]=6]="top-left",Yt[Yt["top-right"]=7]="top-right",Yt[Yt["bottom-left"]=8]="bottom-left",Yt[Yt["bottom-right"]=9]="bottom-right";const Rs=7,mc=Number.POSITIVE_INFINITY;function Hh(i,e){return e[1]!==mc?function(r,a,o){let u=0,d=0;switch(a=Math.abs(a),o=Math.abs(o),r){case"top-right":case"top-left":case"top":d=o-Rs;break;case"bottom-right":case"bottom-left":case"bottom":d=-o+Rs}switch(r){case"top-right":case"bottom-right":case"right":u=-a;break;case"top-left":case"bottom-left":case"left":u=a}return[u,d]}(i,e[0],e[1]):function(r,a){let o=0,u=0;a<0&&(a=0);const d=a/Math.SQRT2;switch(r){case"top-right":case"top-left":u=d-Rs;break;case"bottom-right":case"bottom-left":u=-d+Rs;break;case"bottom":u=-a+Rs;break;case"top":u=a-Rs}switch(r){case"top-right":case"bottom-right":o=-d;break;case"top-left":case"bottom-left":o=d;break;case"left":o=a;break;case"right":o=-a}return[o,u]}(i,e[0])}function Kh(i,e,r){var a;const o=i.layout,u=(a=o.get("text-variable-anchor-offset"))===null||a===void 0?void 0:a.evaluate(e,{},r);if(u){const f=u.values,_=[];for(let x=0;x<f.length;x+=2){const b=_[x]=f[x],T=f[x+1].map(A=>A*Rt);b.startsWith("top")?T[1]-=Rs:b.startsWith("bottom")&&(T[1]+=Rs),_[x+1]=T}return new Bi(_)}const d=o.get("text-variable-anchor");if(d){let f;f=i._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[o.get("text-radial-offset").evaluate(e,{},r)*Rt,mc]:o.get("text-offset").evaluate(e,{},r).map(x=>x*Rt);const _=[];for(const x of d)_.push(x,Hh(x,f));return new Bi(_)}return null}function gc(i){switch(i){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Zp(i,e,r,a,o,u,d,f,_,x,b){let T=u.textMaxSize.evaluate(e,{});T===void 0&&(T=d);const A=i.layers[0].layout,C=A.get("icon-offset").evaluate(e,{},b),P=Jh(r.horizontal),D=d/24,V=i.tilePixelRatio*D,$=i.tilePixelRatio*T/24,H=i.tilePixelRatio*f,q=i.tilePixelRatio*A.get("symbol-spacing"),Y=A.get("text-padding")*i.tilePixelRatio,Q=function(ue,ke,Ee,$e=1){const pt=ue.get("icon-padding").evaluate(ke,{},Ee),ft=pt&&pt.values;return[ft[0]*$e,ft[1]*$e,ft[2]*$e,ft[3]*$e]}(A,e,b,i.tilePixelRatio),oe=A.get("text-max-angle")/180*Math.PI,be=A.get("text-rotation-alignment")!=="viewport"&&A.get("symbol-placement")!=="point",Ae=A.get("icon-rotation-alignment")==="map"&&A.get("symbol-placement")!=="point",xe=A.get("symbol-placement"),ye=q/2,de=A.get("icon-text-fit");let Se;a&&de!=="none"&&(i.allowVerticalPlacement&&r.vertical&&(Se=vh(a,r.vertical,de,A.get("icon-text-fit-padding"),C,D)),P&&(a=vh(a,P,de,A.get("icon-text-fit-padding"),C,D)));const me=(ue,ke)=>{ke.x<0||ke.x>=zt||ke.y<0||ke.y>=zt||function(Ee,$e,pt,ft,Ft,Ui,gi,Dt,Xt,Jt,_i,yi,Ot,Vt,ai,xi,ni,Ei,Ci,Nt,Ge,oi,Qt,Ut,or){const vr=Ee.addToLineVertexArray($e,pt);let br,as,lr,Gi,Pi=0,ns=0,lo=0,iu=0,Tc=-1,Ic=-1;const os={};let ru=ts("");if(Ee.allowVerticalPlacement&&ft.vertical){const li=Dt.layout.get("text-rotate").evaluate(Ge,{},Ut)+90;lr=new fl(Xt,$e,Jt,_i,yi,ft.vertical,Ot,Vt,ai,li),gi&&(Gi=new fl(Xt,$e,Jt,_i,yi,gi,ni,Ei,ai,li))}if(Ft){const li=Dt.layout.get("icon-rotate").evaluate(Ge,{}),Xi=Dt.layout.get("icon-text-fit")!=="none",ca=Xh(Ft,li,Qt,Xi),Sr=gi?Xh(gi,li,Qt,Xi):void 0;as=new fl(Xt,$e,Jt,_i,yi,Ft,ni,Ei,!1,li),Pi=4*ca.length;const ha=Ee.iconSizeData;let Vr=null;ha.kind==="source"?(Vr=[Or*Dt.layout.get("icon-size").evaluate(Ge,{})],Vr[0]>Ds&&ti(`${Ee.layerIds[0]}: Value for "icon-size" is >= ${so}. Reduce your "icon-size".`)):ha.kind==="composite"&&(Vr=[Or*oi.compositeIconSizes[0].evaluate(Ge,{},Ut),Or*oi.compositeIconSizes[1].evaluate(Ge,{},Ut)],(Vr[0]>Ds||Vr[1]>Ds)&&ti(`${Ee.layerIds[0]}: Value for "icon-size" is >= ${so}. Reduce your "icon-size".`)),Ee.addSymbols(Ee.icon,ca,Vr,Nt,Ci,Ge,c.ai.none,$e,vr.lineStartIndex,vr.lineLength,-1,Ut),Tc=Ee.icon.placedSymbolArray.length-1,Sr&&(ns=4*Sr.length,Ee.addSymbols(Ee.icon,Sr,Vr,Nt,Ci,Ge,c.ai.vertical,$e,vr.lineStartIndex,vr.lineLength,-1,Ut),Ic=Ee.icon.placedSymbolArray.length-1)}const su=Object.keys(ft.horizontal);for(const li of su){const Xi=ft.horizontal[li];if(!br){ru=ts(Xi.text);const Sr=Dt.layout.get("text-rotate").evaluate(Ge,{},Ut);br=new fl(Xt,$e,Jt,_i,yi,Xi,Ot,Vt,ai,Sr)}const ca=Xi.positionedLines.length===1;if(lo+=Yh(Ee,$e,Xi,Ui,Dt,ai,Ge,xi,vr,ft.vertical?c.ai.horizontal:c.ai.horizontalOnly,ca?su:[li],os,Tc,oi,Ut),ca)break}ft.vertical&&(iu+=Yh(Ee,$e,ft.vertical,Ui,Dt,ai,Ge,xi,vr,c.ai.vertical,["vertical"],os,Ic,oi,Ut));const Wp=br?br.boxStartIndex:Ee.collisionBoxArray.length,Hp=br?br.boxEndIndex:Ee.collisionBoxArray.length,Kp=lr?lr.boxStartIndex:Ee.collisionBoxArray.length,Yp=lr?lr.boxEndIndex:Ee.collisionBoxArray.length,Jp=as?as.boxStartIndex:Ee.collisionBoxArray.length,Qp=as?as.boxEndIndex:Ee.collisionBoxArray.length,ed=Gi?Gi.boxStartIndex:Ee.collisionBoxArray.length,td=Gi?Gi.boxEndIndex:Ee.collisionBoxArray.length;let wr=-1;const gl=(li,Xi)=>li&&li.circleDiameter?Math.max(li.circleDiameter,Xi):Xi;wr=gl(br,wr),wr=gl(lr,wr),wr=gl(as,wr),wr=gl(Gi,wr);const au=wr>-1?1:0;au&&(wr*=or/Rt),Ee.glyphOffsetArray.length>=Ya.MAX_GLYPHS&&ti("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Ge.sortKey!==void 0&&Ee.addToSortKeyRanges(Ee.symbolInstances.length,Ge.sortKey);const id=Kh(Dt,Ge,Ut),[rd,sd]=function(li,Xi){const ca=li.length,Sr=Xi==null?void 0:Xi.values;if((Sr==null?void 0:Sr.length)>0)for(let ha=0;ha<Sr.length;ha+=2){const Vr=Sr[ha+1];li.emplaceBack(c.aq[Sr[ha]],Vr[0],Vr[1])}return[ca,li.length]}(Ee.textAnchorOffsets,id);Ee.symbolInstances.emplaceBack($e.x,$e.y,os.right>=0?os.right:-1,os.center>=0?os.center:-1,os.left>=0?os.left:-1,os.vertical||-1,Tc,Ic,ru,Wp,Hp,Kp,Yp,Jp,Qp,ed,td,Jt,lo,iu,Pi,ns,au,0,Ot,wr,rd,sd)}(i,ke,ue,r,a,o,Se,i.layers[0],i.collisionBoxArray,e.index,e.sourceLayerIndex,i.index,V,[Y,Y,Y,Y],be,_,H,Q,Ae,C,e,u,x,b,d)};if(xe==="line")for(const ue of Uh(e.geometry,0,0,zt,zt)){const ke=Np(ue,q,oe,r.vertical||P,a,24,$,i.overscaling,zt);for(const Ee of ke)P&&Gp(i,P.text,ye,Ee)||me(ue,Ee)}else if(xe==="line-center"){for(const ue of e.geometry)if(ue.length>1){const ke=Vp(ue,oe,r.vertical||P,a,24,$);ke&&me(ue,ke)}}else if(e.type==="Polygon")for(const ue of Wl(e.geometry,0)){const ke=jp(ue,16);me(ue[0],new Bs(ke.x,ke.y,0))}else if(e.type==="LineString")for(const ue of e.geometry)me(ue,new Bs(ue[0].x,ue[0].y,0));else if(e.type==="Point")for(const ue of e.geometry)for(const ke of ue)me([ke],new Bs(ke.x,ke.y,0))}function Yh(i,e,r,a,o,u,d,f,_,x,b,T,A,C,P){const D=function(H,q,Y,Q,oe,be,Ae,xe){const ye=Q.layout.get("text-rotate").evaluate(be,{})*Math.PI/180,de=[];for(const Se of q.positionedLines)for(const me of Se.positionedGlyphs){if(!me.rect)continue;const ue=me.rect||{};let ke=dh+1,Ee=!0,$e=1,pt=0;const ft=(oe||xe)&&me.vertical,Ft=me.metrics.advance*me.scale/2;if(xe&&q.verticalizable&&(pt=Se.lineOffset/2-(me.imageName?-(Rt-me.metrics.width*me.scale)/2:(me.scale-1)*Rt)),me.imageName){const Nt=Ae[me.imageName];Ee=Nt.sdf,$e=Nt.pixelRatio,ke=Mi/$e}const Ui=oe?[me.x+Ft,me.y]:[0,0];let gi=oe?[0,0]:[me.x+Ft+Y[0],me.y+Y[1]-pt],Dt=[0,0];ft&&(Dt=gi,gi=[0,0]);const Xt=me.metrics.isDoubleResolution?2:1,Jt=(me.metrics.left-ke)*me.scale-Ft+gi[0],_i=(-me.metrics.top-ke)*me.scale+gi[1],yi=Jt+ue.w/Xt*me.scale/$e,Ot=_i+ue.h/Xt*me.scale/$e,Vt=new Be(Jt,_i),ai=new Be(yi,_i),xi=new Be(Jt,Ot),ni=new Be(yi,Ot);if(ft){const Nt=new Be(-Ft,Ft-io),Ge=-Math.PI/2,oi=Rt/2-Ft,Qt=new Be(5-io-oi,-(me.imageName?oi:0)),Ut=new Be(...Dt);Vt._rotateAround(Ge,Nt)._add(Qt)._add(Ut),ai._rotateAround(Ge,Nt)._add(Qt)._add(Ut),xi._rotateAround(Ge,Nt)._add(Qt)._add(Ut),ni._rotateAround(Ge,Nt)._add(Qt)._add(Ut)}if(ye){const Nt=Math.sin(ye),Ge=Math.cos(ye),oi=[Ge,-Nt,Nt,Ge];Vt._matMult(oi),ai._matMult(oi),xi._matMult(oi),ni._matMult(oi)}const Ei=new Be(0,0),Ci=new Be(0,0);de.push({tl:Vt,tr:ai,bl:xi,br:ni,tex:ue,writingMode:q.writingMode,glyphOffset:Ui,sectionIndex:me.sectionIndex,isSDF:Ee,pixelOffsetTL:Ei,pixelOffsetBR:Ci,minFontScaleX:0,minFontScaleY:0})}return de}(0,r,f,o,u,d,a,i.allowVerticalPlacement),V=i.textSizeData;let $=null;V.kind==="source"?($=[Or*o.layout.get("text-size").evaluate(d,{})],$[0]>Ds&&ti(`${i.layerIds[0]}: Value for "text-size" is >= ${so}. Reduce your "text-size".`)):V.kind==="composite"&&($=[Or*C.compositeTextSizes[0].evaluate(d,{},P),Or*C.compositeTextSizes[1].evaluate(d,{},P)],($[0]>Ds||$[1]>Ds)&&ti(`${i.layerIds[0]}: Value for "text-size" is >= ${so}. Reduce your "text-size".`)),i.addSymbols(i.text,D,$,f,u,d,x,e,_.lineStartIndex,_.lineLength,A,P);for(const H of b)T[H]=i.text.placedSymbolArray.length-1;return 4*D.length}function Jh(i){for(const e in i)return i[e];return null}function Gp(i,e,r,a){const o=i.compareText;if(e in o){const u=o[e];for(let d=u.length-1;d>=0;d--)if(a.dist(u[d])<r)return!0}else o[e]=[];return o[e].push(a),!1}const Qh=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class _c{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[r,a]=new Uint8Array(e,0,2);if(r!==219)throw new Error("Data does not appear to be in a KDBush format.");const o=a>>4;if(o!==1)throw new Error(`Got v${o} data when expected v1.`);const u=Qh[15&a];if(!u)throw new Error("Unrecognized array type.");const[d]=new Uint16Array(e,2,1),[f]=new Uint32Array(e,4,1);return new _c(f,d,u,e)}constructor(e,r=64,a=Float64Array,o){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=a,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const u=Qh.indexOf(this.ArrayType),d=2*e*this.ArrayType.BYTES_PER_ELEMENT,f=e*this.IndexArrayType.BYTES_PER_ELEMENT,_=(8-f%8)%8;if(u<0)throw new Error(`Unexpected typed array class: ${a}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+f+_,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+d+f+_),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+f+_,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+u]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=e)}add(e,r){const a=this._pos>>1;return this.ids[a]=a,this.coords[this._pos++]=e,this.coords[this._pos++]=r,a}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return yc(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,a,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:u,coords:d,nodeSize:f}=this,_=[0,u.length-1,0],x=[];for(;_.length;){const b=_.pop()||0,T=_.pop()||0,A=_.pop()||0;if(T-A<=f){for(let V=A;V<=T;V++){const $=d[2*V],H=d[2*V+1];$>=e&&$<=a&&H>=r&&H<=o&&x.push(u[V])}continue}const C=A+T>>1,P=d[2*C],D=d[2*C+1];P>=e&&P<=a&&D>=r&&D<=o&&x.push(u[C]),(b===0?e<=P:r<=D)&&(_.push(A),_.push(C-1),_.push(1-b)),(b===0?a>=P:o>=D)&&(_.push(C+1),_.push(T),_.push(1-b))}return x}within(e,r,a){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:u,nodeSize:d}=this,f=[0,o.length-1,0],_=[],x=a*a;for(;f.length;){const b=f.pop()||0,T=f.pop()||0,A=f.pop()||0;if(T-A<=d){for(let V=A;V<=T;V++)tu(u[2*V],u[2*V+1],e,r)<=x&&_.push(o[V]);continue}const C=A+T>>1,P=u[2*C],D=u[2*C+1];tu(P,D,e,r)<=x&&_.push(o[C]),(b===0?e-a<=P:r-a<=D)&&(f.push(A),f.push(C-1),f.push(1-b)),(b===0?e+a>=P:r+a>=D)&&(f.push(C+1),f.push(T),f.push(1-b))}return _}}function yc(i,e,r,a,o,u){if(o-a<=r)return;const d=a+o>>1;eu(i,e,d,a,o,u),yc(i,e,r,a,d-1,1-u),yc(i,e,r,d+1,o,1-u)}function eu(i,e,r,a,o,u){for(;o>a;){if(o-a>600){const x=o-a+1,b=r-a+1,T=Math.log(x),A=.5*Math.exp(2*T/3),C=.5*Math.sqrt(T*A*(x-A)/x)*(b-x/2<0?-1:1);eu(i,e,r,Math.max(a,Math.floor(r-b*A/x+C)),Math.min(o,Math.floor(r+(x-b)*A/x+C)),u)}const d=e[2*r+u];let f=a,_=o;for(no(i,e,a,r),e[2*o+u]>d&&no(i,e,a,o);f<_;){for(no(i,e,f,_),f++,_--;e[2*f+u]<d;)f++;for(;e[2*_+u]>d;)_--}e[2*a+u]===d?no(i,e,a,_):(_++,no(i,e,_,o)),_<=r&&(a=_+1),r<=_&&(o=_-1)}}function no(i,e,r,a){xc(i,r,a),xc(e,2*r,2*a),xc(e,2*r+1,2*a+1)}function xc(i,e,r){const a=i[e];i[e]=i[r],i[r]=a}function tu(i,e,r,a){const o=i-r,u=e-a;return o*o+u*u}var vc;c.bh=void 0,(vc=c.bh||(c.bh={})).create="create",vc.load="load",vc.fullLoad="fullLoad";let ml=null,oo=[];const bc=1e3/60,wc="loadTime",Sc="fullLoadTime",Xp={mark(i){performance.mark(i)},frame(i){const e=i;ml!=null&&oo.push(e-ml),ml=e},clearMetrics(){ml=null,oo=[],performance.clearMeasures(wc),performance.clearMeasures(Sc);for(const i in c.bh)performance.clearMarks(c.bh[i])},getPerformanceMetrics(){performance.measure(wc,c.bh.create,c.bh.load),performance.measure(Sc,c.bh.create,c.bh.fullLoad);const i=performance.getEntriesByName(wc)[0].duration,e=performance.getEntriesByName(Sc)[0].duration,r=oo.length,a=1/(oo.reduce((u,d)=>u+d,0)/r/1e3),o=oo.filter(u=>u>bc).reduce((u,d)=>u+(d-bc)/bc,0);return{loadTime:i,fullLoadTime:e,fps:a,percentDroppedFrames:o/(r+o)*100,totalFrames:r}}};c.$=function(i,e,r){var a,o,u,d,f,_,x,b,T,A,C,P,D=r[0],V=r[1],$=r[2];return e===i?(i[12]=e[0]*D+e[4]*V+e[8]*$+e[12],i[13]=e[1]*D+e[5]*V+e[9]*$+e[13],i[14]=e[2]*D+e[6]*V+e[10]*$+e[14],i[15]=e[3]*D+e[7]*V+e[11]*$+e[15]):(o=e[1],u=e[2],d=e[3],f=e[4],_=e[5],x=e[6],b=e[7],T=e[8],A=e[9],C=e[10],P=e[11],i[0]=a=e[0],i[1]=o,i[2]=u,i[3]=d,i[4]=f,i[5]=_,i[6]=x,i[7]=b,i[8]=T,i[9]=A,i[10]=C,i[11]=P,i[12]=a*D+f*V+T*$+e[12],i[13]=o*D+_*V+A*$+e[13],i[14]=u*D+x*V+C*$+e[14],i[15]=d*D+b*V+P*$+e[15]),i},c.A=Za,c.B=wi,c.C=class{constructor(i,e,r){this.receive=a=>{const o=a.data,u=o.id;if(u&&(!o.targetMapId||this.mapId===o.targetMapId))if(o.type==="<cancel>"){delete this.tasks[u];const d=this.cancelCallbacks[u];delete this.cancelCallbacks[u],d&&d()}else ki()||o.mustQueue?(this.tasks[u]=o,this.taskQueue.push(u),this.invoker.trigger()):this.processTask(u,o)},this.process=()=>{if(!this.taskQueue.length)return;const a=this.taskQueue.shift(),o=this.tasks[a];delete this.tasks[a],this.taskQueue.length&&this.invoker.trigger(),o&&this.processTask(a,o)},this.target=i,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},this.invoker=new Fp(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=ki()?i:window}send(i,e,r,a,o=!1){const u=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[u]=r);const d=[],f={id:u,type:i,hasCallback:!!r,targetMapId:a,mustQueue:o,sourceMapId:this.mapId,data:Br(e,d)};return this.target.postMessage(f,{transfer:d}),{cancel:()=>{r&&delete this.callbacks[u],this.target.postMessage({id:u,type:"<cancel>",targetMapId:a,sourceMapId:this.mapId})}}}processTask(i,e){if(e.type==="<response>"){const r=this.callbacks[i];delete this.callbacks[i],r&&(e.error?r(Ms(e.error)):r(null,Ms(e.data)))}else{let r=!1;const a=[],o=e.hasCallback?(f,_)=>{r=!0,delete this.cancelCallbacks[i];const x={id:i,type:"<response>",sourceMapId:this.mapId,error:f?Br(f):null,data:Br(_,a)};this.target.postMessage(x,{transfer:a})}:f=>{r=!0};let u=null;const d=Ms(e.data);if(this.parent[e.type])u=this.parent[e.type](e.sourceMapId,d,o);else if("getWorkerSource"in this.parent){const f=e.type.split(".");u=this.parent.getWorkerSource(e.sourceMapId,f[0],d.source)[f[1]](d,o)}else o(new Error(`Could not find function ${e.type}`));!r&&u&&u.cancel&&(this.cancelCallbacks[i]=u.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},c.D=Ce,c.E=jr,c.F=function(i,e){const r={};for(let a=0;a<e.length;a++){const o=e[a];o in i&&(r[o]=i[o])}return r},c.G=Ch,c.H=Ph,c.I=sc,c.J=ua,c.K=Tr,c.L=Ls,c.M=Us,c.N=zt,c.O=Zi,c.P=Be,c.Q=xt,c.R=qi,c.S=ut,c.T=qo,c.U=hl,c.V=class extends Qr{},c.W=fc,c.X=function(i,e){const r=window.document.createElement("video");r.muted=!0,r.onloadstart=function(){e(null,r)};for(let a=0;a<i.length;a++){const o=window.document.createElement("source");hr(i[a])||(r.crossOrigin="Anonymous"),o.src=i[a],r.appendChild(o)}return{cancel:()=>{}}},c.Y=fe,c.Z=function(){var i=new Za(16);return Za!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i},c._=Wi,c.a=Ns,c.a$=class extends E{},c.a0=function(i,e,r){var a=r[0],o=r[1],u=r[2];return i[0]=e[0]*a,i[1]=e[1]*a,i[2]=e[2]*a,i[3]=e[3]*a,i[4]=e[4]*o,i[5]=e[5]*o,i[6]=e[6]*o,i[7]=e[7]*o,i[8]=e[8]*u,i[9]=e[9]*u,i[10]=e[10]*u,i[11]=e[11]*u,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},c.a1=Lc,c.a2=function(){return pa++},c.a3=F,c.a4=Ya,c.a5=function(){Ii.isLoading()||Ii.isLoaded()||Bn()!=="deferred"||jo()},c.a6=Tn,c.a7=oa,c.a8=ht,c.a9=Fh,c.aA=ta,c.aB=function(i){i=i.slice();const e=Object.create(null);for(let r=0;r<i.length;r++)e[i[r].id]=i[r];for(let r=0;r<i.length;r++)"ref"in i[r]&&(i[r]=Di(i[r],e[i[r].ref]));return i},c.aC=function(i){if(i.type==="custom")return new Rp(i);switch(i.type){case"background":return new Dp(i);case"circle":return new yu(i);case"fill":return new Ou(i);case"fill-extrusion":return new Qu(i);case"heatmap":return new vu(i);case"hillshade":return new wu(i);case"line":return new op(i);case"raster":return new Bp(i);case"symbol":return new cl(i)}},c.aD=$i,c.aE=function(i,e){if(!i)return[{command:Ye.setStyle,args:[e]}];let r=[];try{if(!nt(i.version,e.version))return[{command:Ye.setStyle,args:[e]}];nt(i.center,e.center)||r.push({command:Ye.setCenter,args:[e.center]}),nt(i.zoom,e.zoom)||r.push({command:Ye.setZoom,args:[e.zoom]}),nt(i.bearing,e.bearing)||r.push({command:Ye.setBearing,args:[e.bearing]}),nt(i.pitch,e.pitch)||r.push({command:Ye.setPitch,args:[e.pitch]}),nt(i.sprite,e.sprite)||r.push({command:Ye.setSprite,args:[e.sprite]}),nt(i.glyphs,e.glyphs)||r.push({command:Ye.setGlyphs,args:[e.glyphs]}),nt(i.transition,e.transition)||r.push({command:Ye.setTransition,args:[e.transition]}),nt(i.light,e.light)||r.push({command:Ye.setLight,args:[e.light]});const a={},o=[];(function(d,f,_,x){let b;for(b in f=f||{},d=d||{})Object.prototype.hasOwnProperty.call(d,b)&&(Object.prototype.hasOwnProperty.call(f,b)||ms(b,_,x));for(b in f)Object.prototype.hasOwnProperty.call(f,b)&&(Object.prototype.hasOwnProperty.call(d,b)?nt(d[b],f[b])||(d[b].type==="geojson"&&f[b].type==="geojson"&&fa(d,f,b)?_.push({command:Ye.setGeoJSONSourceData,args:[b,f[b].data]}):ur(b,f,_,x)):Ji(b,f,_))})(i.sources,e.sources,o,a);const u=[];i.layers&&i.layers.forEach(d=>{a[d.source]?r.push({command:Ye.removeLayer,args:[d.id]}):u.push(d)}),r=r.concat(o),function(d,f,_){f=f||[];const x=(d=d||[]).map(Pr),b=f.map(Pr),T=d.reduce(qr,{}),A=f.reduce(qr,{}),C=x.slice(),P=Object.create(null);let D,V,$,H,q,Y,Q;for(D=0,V=0;D<x.length;D++)$=x[D],Object.prototype.hasOwnProperty.call(A,$)?V++:(_.push({command:Ye.removeLayer,args:[$]}),C.splice(C.indexOf($,V),1));for(D=0,V=0;D<b.length;D++)$=b[b.length-1-D],C[C.length-1-D]!==$&&(Object.prototype.hasOwnProperty.call(T,$)?(_.push({command:Ye.removeLayer,args:[$]}),C.splice(C.lastIndexOf($,C.length-V),1)):V++,Y=C[C.length-D],_.push({command:Ye.addLayer,args:[A[$],Y]}),C.splice(C.length-D,0,$),P[$]=!0);for(D=0;D<b.length;D++)if($=b[D],H=T[$],q=A[$],!P[$]&&!nt(H,q))if(nt(H.source,q.source)&&nt(H["source-layer"],q["source-layer"])&&nt(H.type,q.type)){for(Q in gs(H.layout,q.layout,_,$,null,Ye.setLayoutProperty),gs(H.paint,q.paint,_,$,null,Ye.setPaintProperty),nt(H.filter,q.filter)||_.push({command:Ye.setFilter,args:[$,q.filter]}),nt(H.minzoom,q.minzoom)&&nt(H.maxzoom,q.maxzoom)||_.push({command:Ye.setLayerZoomRange,args:[$,q.minzoom,q.maxzoom]}),H)Object.prototype.hasOwnProperty.call(H,Q)&&Q!=="layout"&&Q!=="paint"&&Q!=="filter"&&Q!=="metadata"&&Q!=="minzoom"&&Q!=="maxzoom"&&(Q.indexOf("paint.")===0?gs(H[Q],q[Q],_,$,Q.slice(6),Ye.setPaintProperty):nt(H[Q],q[Q])||_.push({command:Ye.setLayerProperty,args:[$,Q,q[Q]]}));for(Q in q)Object.prototype.hasOwnProperty.call(q,Q)&&!Object.prototype.hasOwnProperty.call(H,Q)&&Q!=="layout"&&Q!=="paint"&&Q!=="filter"&&Q!=="metadata"&&Q!=="minzoom"&&Q!=="maxzoom"&&(Q.indexOf("paint.")===0?gs(H[Q],q[Q],_,$,Q.slice(6),Ye.setPaintProperty):nt(H[Q],q[Q])||_.push({command:Ye.setLayerProperty,args:[$,Q,q[Q]]}))}else _.push({command:Ye.removeLayer,args:[$]}),Y=C[C.lastIndexOf($)+1],_.push({command:Ye.addLayer,args:[q,Y]})}(u,e.layers,r)}catch(a){console.warn("Unable to compute style diff:",a),r=[{command:Ye.setStyle,args:[e]}]}return r},c.aF=function(i){const e=[],r=i.id;return r===void 0&&e.push({message:`layers.${r}: missing required property "id"`}),i.render===void 0&&e.push({message:`layers.${r}: missing required method "render"`}),i.renderingMode&&i.renderingMode!=="2d"&&i.renderingMode!=="3d"&&e.push({message:`layers.${r}: property "renderingMode" must be either "2d" or "3d"`}),e},c.aG=function i(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(let a=0;a<e.length;a++)if(!i(e[a],r[a]))return!1;return!0}if(typeof e=="object"&&e!==null&&r!==null){if(typeof r!="object"||Object.keys(e).length!==Object.keys(r).length)return!1;for(const a in e)if(!i(e[a],r[a]))return!1;return!0}return e===r},c.aH=mt,c.aI=us,c.aJ=ia,c.aK=function(i){return i({pluginStatus:di,pluginURL:Rr}),ia.on("pluginStateChange",i),i},c.aL=class extends is{constructor(i,e){super(i,e),this.current=0}set(i){this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},c.aM=ja,c.aN=class extends is{constructor(i,e){super(i,e),this.current=Rl}set(i){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let e=1;e<16;e++)if(i[e]!==this.current[e]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}},c.aO=Wo,c.aP=class extends is{constructor(i,e){super(i,e),this.current=[0,0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2]))}},c.aQ=class extends is{constructor(i,e){super(i,e),this.current=[0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1]))}},c.aR=Ho,c.aS=function(i,e,r,a,o,u,d){var f=1/(e-r),_=1/(a-o),x=1/(u-d);return i[0]=-2*f,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=-2*_,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=2*x,i[11]=0,i[12]=(e+r)*f,i[13]=(o+a)*_,i[14]=(d+u)*x,i[15]=1,i},c.aT=it,c.aU=_u,c.aV=class extends n{},c.aW=up,c.aX=class extends p{},c.aY=function(i){return i<=1?1:Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))},c.aZ=Vc,c.a_=pe,c.aa=function(i){const e={};if(i.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(r,a,o,u)=>{const d=o||u;return e[a]=!d||d.toLowerCase(),""}),e["max-age"]){const r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e},c.ab=function(i,e){const r=[];for(const a in i)a in e||r.push(a);return r},c.ac=function(i){if(Nr==null){const e=i.navigator?i.navigator.userAgent:null;Nr=!!i.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return Nr},c.ad=Ki,c.ae=function(i,e,r){var a=Math.sin(r),o=Math.cos(r),u=e[0],d=e[1],f=e[2],_=e[3],x=e[4],b=e[5],T=e[6],A=e[7];return e!==i&&(i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[0]=u*o+x*a,i[1]=d*o+b*a,i[2]=f*o+T*a,i[3]=_*o+A*a,i[4]=x*o-u*a,i[5]=b*o-d*a,i[6]=T*o-f*a,i[7]=A*o-_*a,i},c.af=function(i){var e=new Za(16);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],e},c.ag=Qo,c.ah=function(i,e){let r=0,a=0;if(i.kind==="constant")a=i.layoutSize;else if(i.kind!=="source"){const{interpolationType:o,minZoom:u,maxZoom:d}=i,f=o?Ki(Si.interpolationFactor(o,e,u,d),0,1):0;i.kind==="camera"?a=wi.number(i.minSize,i.maxSize,f):r=f}return{uSizeT:r,uSize:a}},c.aj=function(i,{uSize:e,uSizeT:r},{lowerSize:a,upperSize:o}){return i.kind==="source"?a/Or:i.kind==="composite"?wi.number(a/Or,o/Or,r):e},c.ak=lc,c.al=function(i,e,r,a){const o=e.y-i.y,u=e.x-i.x,d=a.y-r.y,f=a.x-r.x,_=d*u-f*o;if(_===0)return null;const x=(f*(i.y-r.y)-d*(i.x-r.x))/_;return new Be(i.x+x*u,i.y+x*o)},c.am=Uh,c.an=Ec,c.ao=Ul,c.ap=Rt,c.ar=oc,c.as=function(i,e){var r=e[0],a=e[1],o=e[2],u=e[3],d=e[4],f=e[5],_=e[6],x=e[7],b=e[8],T=e[9],A=e[10],C=e[11],P=e[12],D=e[13],V=e[14],$=e[15],H=r*f-a*d,q=r*_-o*d,Y=r*x-u*d,Q=a*_-o*f,oe=a*x-u*f,be=o*x-u*_,Ae=b*D-T*P,xe=b*V-A*P,ye=b*$-C*P,de=T*V-A*D,Se=T*$-C*D,me=A*$-C*V,ue=H*me-q*Se+Y*de+Q*ye-oe*xe+be*Ae;return ue?(i[0]=(f*me-_*Se+x*de)*(ue=1/ue),i[1]=(o*Se-a*me-u*de)*ue,i[2]=(D*be-V*oe+$*Q)*ue,i[3]=(A*oe-T*be-C*Q)*ue,i[4]=(_*ye-d*me-x*xe)*ue,i[5]=(r*me-o*ye+u*xe)*ue,i[6]=(V*Y-P*be-$*q)*ue,i[7]=(b*be-A*Y+C*q)*ue,i[8]=(d*Se-f*ye+x*Ae)*ue,i[9]=(a*ye-r*Se-u*Ae)*ue,i[10]=(P*oe-D*Y+$*H)*ue,i[11]=(T*Y-b*oe-C*H)*ue,i[12]=(f*xe-d*de-_*Ae)*ue,i[13]=(r*de-a*xe+o*Ae)*ue,i[14]=(D*q-P*Q-V*H)*ue,i[15]=(b*Q-T*q+A*H)*ue,i):null},c.at=gc,c.au=nc,c.av=_c,c.aw=function(){const i={},e=re.$version;for(const r in re.$root){const a=re.$root[r];if(a.required){let o=null;o=r==="version"?e:a.type==="array"?[]:{},o!=null&&(i[r]=o)}}return i},c.ax=Ye,c.ay=Vo,c.az=ji,c.b=function(i,e){const r=new Blob([new Uint8Array(i)],{type:"image/png"});createImageBitmap(r).then(a=>{e(null,a)}).catch(a=>{e(new Error(`Could not load image because of ${a.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})},c.b0=Zt,c.b1=function(i,e){var r=i[0],a=i[1],o=i[2],u=i[3],d=i[4],f=i[5],_=i[6],x=i[7],b=i[8],T=i[9],A=i[10],C=i[11],P=i[12],D=i[13],V=i[14],$=i[15],H=e[0],q=e[1],Y=e[2],Q=e[3],oe=e[4],be=e[5],Ae=e[6],xe=e[7],ye=e[8],de=e[9],Se=e[10],me=e[11],ue=e[12],ke=e[13],Ee=e[14],$e=e[15];return Math.abs(r-H)<=mi*Math.max(1,Math.abs(r),Math.abs(H))&&Math.abs(a-q)<=mi*Math.max(1,Math.abs(a),Math.abs(q))&&Math.abs(o-Y)<=mi*Math.max(1,Math.abs(o),Math.abs(Y))&&Math.abs(u-Q)<=mi*Math.max(1,Math.abs(u),Math.abs(Q))&&Math.abs(d-oe)<=mi*Math.max(1,Math.abs(d),Math.abs(oe))&&Math.abs(f-be)<=mi*Math.max(1,Math.abs(f),Math.abs(be))&&Math.abs(_-Ae)<=mi*Math.max(1,Math.abs(_),Math.abs(Ae))&&Math.abs(x-xe)<=mi*Math.max(1,Math.abs(x),Math.abs(xe))&&Math.abs(b-ye)<=mi*Math.max(1,Math.abs(b),Math.abs(ye))&&Math.abs(T-de)<=mi*Math.max(1,Math.abs(T),Math.abs(de))&&Math.abs(A-Se)<=mi*Math.max(1,Math.abs(A),Math.abs(Se))&&Math.abs(C-me)<=mi*Math.max(1,Math.abs(C),Math.abs(me))&&Math.abs(P-ue)<=mi*Math.max(1,Math.abs(P),Math.abs(ue))&&Math.abs(D-ke)<=mi*Math.max(1,Math.abs(D),Math.abs(ke))&&Math.abs(V-Ee)<=mi*Math.max(1,Math.abs(V),Math.abs(Ee))&&Math.abs($-$e)<=mi*Math.max(1,Math.abs($),Math.abs($e))},c.b2=function(i,e){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},c.b3=function(i,e,r){return i[0]=e[0]*r[0],i[1]=e[1]*r[1],i[2]=e[2]*r[2],i[3]=e[3]*r[3],i},c.b4=function(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]+i[3]*e[3]},c.b5=Vs,c.b6=Lh,c.b7=kh,c.b8=function(i,e,r,a,o){var u,d=1/Math.tan(e/2);return i[0]=d/r,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=d,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=-1,i[12]=0,i[13]=0,i[15]=0,o!=null&&o!==1/0?(i[10]=(o+a)*(u=1/(a-o)),i[14]=2*o*a*u):(i[10]=-1,i[14]=-2*a),i},c.b9=function(i,e,r){var a=Math.sin(r),o=Math.cos(r),u=e[4],d=e[5],f=e[6],_=e[7],x=e[8],b=e[9],T=e[10],A=e[11];return e!==i&&(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[4]=u*o+x*a,i[5]=d*o+b*a,i[6]=f*o+T*a,i[7]=_*o+A*a,i[8]=x*o-u*a,i[9]=b*o-d*a,i[10]=T*o-f*a,i[11]=A*o-_*a,i},c.bA=Hi,c.bB=nh,c.bC=za,c.bD=Ii,c.ba=Os,c.bb=hs,c.bc=function(i,e){return i[0]=e[0],i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=e[1],i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=e[2],i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},c.bd=class extends aa{},c.be=pc,c.bf=zh,c.bg=Xp,c.bi=Ar,c.bj=function(i,e,r=!1){if(di===Pn||di===kn||di===zn)throw new Error("setRTLTextPlugin cannot be called multiple times.");Rr=ps.resolveURL(i),di=Pn,Dn=e,Ln(),r||jo()},c.bk=Bn,c.bl=function(i,e){const r={};for(let o=0;o<i.length;o++){const u=e&&e[i[o].id]||Ra(i[o]);e&&(e[i[o].id]=u);let d=r[u];d||(d=r[u]=[]),d.push(i[o])}const a=[];for(const o in r)a.push(r[o]);return a},c.bm=we,c.bn=Rh,c.bo=Oh,c.bp=mh,c.bq=function(i){i.bucket.createArrays(),i.bucket.tilePixelRatio=zt/(512*i.bucket.overscaling),i.bucket.compareText={},i.bucket.iconsNeedLinear=!1;const e=i.bucket.layers[0],r=e.layout,a=e._unevaluatedLayout._values,o={layoutIconSize:a["icon-size"].possiblyEvaluate(new ht(i.bucket.zoom+1),i.canonical),layoutTextSize:a["text-size"].possiblyEvaluate(new ht(i.bucket.zoom+1),i.canonical),textMaxSize:a["text-size"].possiblyEvaluate(new ht(18))};if(i.bucket.textSizeData.kind==="composite"){const{minZoom:x,maxZoom:b}=i.bucket.textSizeData;o.compositeTextSizes=[a["text-size"].possiblyEvaluate(new ht(x),i.canonical),a["text-size"].possiblyEvaluate(new ht(b),i.canonical)]}if(i.bucket.iconSizeData.kind==="composite"){const{minZoom:x,maxZoom:b}=i.bucket.iconSizeData;o.compositeIconSizes=[a["icon-size"].possiblyEvaluate(new ht(x),i.canonical),a["icon-size"].possiblyEvaluate(new ht(b),i.canonical)]}const u=r.get("text-line-height")*Rt,d=r.get("text-rotation-alignment")!=="viewport"&&r.get("symbol-placement")!=="point",f=r.get("text-keep-upright"),_=r.get("text-size");for(const x of i.bucket.features){const b=r.get("text-font").evaluate(x,{},i.canonical).join(","),T=_.evaluate(x,{},i.canonical),A=o.layoutTextSize.evaluate(x,{},i.canonical),C=o.layoutIconSize.evaluate(x,{},i.canonical),P={horizontal:{},vertical:void 0},D=x.text;let V,$=[0,0];if(D){const Y=D.toString(),Q=r.get("text-letter-spacing").evaluate(x,{},i.canonical)*Rt,oe=En(Y)?Q:0,be=r.get("text-anchor").evaluate(x,{},i.canonical),Ae=Kh(e,x,i.canonical);if(!Ae){const me=r.get("text-radial-offset").evaluate(x,{},i.canonical);$=me?Hh(be,[me*Rt,mc]):r.get("text-offset").evaluate(x,{},i.canonical).map(ue=>ue*Rt)}let xe=d?"center":r.get("text-justify").evaluate(x,{},i.canonical);const ye=r.get("symbol-placement"),de=ye==="point"?r.get("text-max-width").evaluate(x,{},i.canonical)*Rt:0,Se=()=>{i.bucket.allowVerticalPlacement&&Mn(Y)&&(P.vertical=nl(D,i.glyphMap,i.glyphPositions,i.imagePositions,b,de,u,be,"left",oe,$,c.ai.vertical,!0,ye,A,T))};if(!d&&Ae){const me=new Set;if(xe==="auto")for(let ke=0;ke<Ae.values.length;ke+=2)me.add(gc(Ae.values[ke]));else me.add(xe);let ue=!1;for(const ke of me)if(!P.horizontal[ke])if(ue)P.horizontal[ke]=P.horizontal[0];else{const Ee=nl(D,i.glyphMap,i.glyphPositions,i.imagePositions,b,de,u,"center",ke,oe,$,c.ai.horizontal,!1,ye,A,T);Ee&&(P.horizontal[ke]=Ee,ue=Ee.positionedLines.length===1)}Se()}else{xe==="auto"&&(xe=gc(be));const me=nl(D,i.glyphMap,i.glyphPositions,i.imagePositions,b,de,u,be,xe,oe,$,c.ai.horizontal,!1,ye,A,T);me&&(P.horizontal[xe]=me),Se(),Mn(Y)&&d&&f&&(P.vertical=nl(D,i.glyphMap,i.glyphPositions,i.imagePositions,b,de,u,be,xe,oe,$,c.ai.vertical,!1,ye,A,T))}}let H=!1;if(x.icon&&x.icon.name){const Y=i.imageMap[x.icon.name];Y&&(V=Ep(i.imagePositions[x.icon.name],r.get("icon-offset").evaluate(x,{},i.canonical),r.get("icon-anchor").evaluate(x,{},i.canonical)),H=!!Y.sdf,i.bucket.sdfIcons===void 0?i.bucket.sdfIcons=H:i.bucket.sdfIcons!==H&&ti("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(Y.pixelRatio!==i.bucket.pixelRatio||r.get("icon-rotate").constantOr(1)!==0)&&(i.bucket.iconsNeedLinear=!0))}const q=Jh(P.horizontal)||P.vertical;i.bucket.iconsInText=!!q&&q.iconsInText,(q||V)&&Zp(i.bucket,x,P,V,i.imageMap,o,A,C,$,H,i.canonical)}i.showCollisionBoxes&&i.bucket.generateCollisionDebugBuffers()},c.br=ec,c.bs=Yl,c.bt=Ql,c.bu=class{constructor(i){this._marks={start:[i.url,"start"].join("#"),end:[i.url,"end"].join("#"),measure:i.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let i=performance.getEntriesByName(this._marks.measure);return i.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),i=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),i}},c.bv=ic,c.bw=ks,c.bx=function(i,e,r,a,o){return Wi(this,void 0,void 0,function*(){if(Tr())try{return yield Us(i,e,r,a,o)}catch{}return function(u,d,f,_,x){const b=u.width,T=u.height;Yi&&ct||(Yi=new OffscreenCanvas(b,T),ct=Yi.getContext("2d",{willReadFrequently:!0})),Yi.width=b,Yi.height=T,ct.drawImage(u,0,0,b,T);const A=ct.getImageData(d,f,_,x);return ct.clearRect(0,0,b,T),A.data}(i,e,r,a,o)})},c.by=Bh,c.bz=ie,c.c=ds,c.d=function(i,e){const r=new Image;r.onload=()=>{e(null,r),URL.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame(()=>{r.src=da})},r.onerror=()=>e(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."));const a=new Blob([new Uint8Array(i)],{type:"image/png"});r.src=i.byteLength?URL.createObjectURL(a):da},c.e=$t,c.f=function(i,e){return Mr($t(i,{type:"json"}),e)},c.g=zi,c.h=ps,c.i=ki,c.j=Cr,c.k=Er,c.l=js,c.m=Mr,c.n=function(i){return new ic(i).readFields(wp,[])},c.o=function(i,e,r){if(!i.length)return r(null,[]);let a=i.length;const o=new Array(i.length);let u=null;i.forEach((d,f)=>{e(d,(_,x)=>{_&&(u=_),o[f]=x,--a==0&&r(u,o)})})},c.p=fh,c.q=Wn,c.r=Mt,c.s=hr,c.t=zl,c.u=ve,c.v=re,c.w=ti,c.x=Va,c.y=_r,c.z=function([i,e,r]){return e+=90,e*=Math.PI/180,r*=Math.PI/180,{x:i*Math.cos(e)*Math.sin(r),y:i*Math.sin(e)*Math.sin(r),z:i*Math.cos(r)}}}),yl(["./shared"],function(c){class Wi{constructor(I){this.keyCache={},I&&this.replace(I)}replace(I){this._layerConfigs={},this._layers={},this.update(I,[])}update(I,M){for(const O of I){this._layerConfigs[O.id]=O;const N=this._layers[O.id]=c.aC(O);N._featureFilter=c.a6(N.filter),this.keyCache[O.id]&&delete this.keyCache[O.id]}for(const O of M)delete this.keyCache[O],delete this._layerConfigs[O],delete this._layers[O];this.familiesBySource={};const k=c.bl(Object.values(this._layerConfigs),this.keyCache);for(const O of k){const N=O.map(ae=>this._layers[ae.id]),K=N[0];if(K.visibility==="none")continue;const Z=K.source||"";let j=this.familiesBySource[Z];j||(j=this.familiesBySource[Z]={});const W=K.sourceLayer||"_geojsonTileLayer";let se=j[W];se||(se=j[W]=[]),se.push(N)}}}class ie{constructor(I){const M={},k=[];for(const Z in I){const j=I[Z],W=M[Z]={};for(const se in j){const ae=j[+se];if(!ae||ae.bitmap.width===0||ae.bitmap.height===0)continue;const le={x:0,y:0,w:ae.bitmap.width+2,h:ae.bitmap.height+2};k.push(le),W[se]={rect:le,metrics:ae.metrics}}}const{w:O,h:N}=c.p(k),K=new c.q({width:O||1,height:N||1});for(const Z in I){const j=I[Z];for(const W in j){const se=j[+W];if(!se||se.bitmap.width===0||se.bitmap.height===0)continue;const ae=M[Z][W].rect;c.q.copy(se.bitmap,K,{x:0,y:0},{x:ae.x+1,y:ae.y+1},se.bitmap)}}this.image=K,this.positions=M}}c.bm("GlyphAtlas",ie);class Hi{constructor(I){this.tileID=new c.O(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,this.inFlightDependencies=[],this.dependencySentinel=-1}parse(I,M,k,O,N){this.status="parsing",this.data=I,this.collisionBoxArray=new c.a3;const K=new c.bn(Object.keys(I.layers).sort()),Z=new c.bo(this.tileID,this.promoteId);Z.bucketLayerIDs=[];const j={},W={featureIndex:Z,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:k},se=M.familiesBySource[this.source];for(const Ke in se){const He=I.layers[Ke];if(!He)continue;He.version===1&&c.w(`Vector tile source "${this.source}" layer "${Ke}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Wt=K.encode(Ke),ot=[];for(let kt=0;kt<He.length;kt++){const jt=He.feature(kt),Li=Z.getId(jt,Ke);ot.push({feature:jt,id:Li,index:kt,sourceLayerIndex:Wt})}for(const kt of se[Ke]){const jt=kt[0];jt.source!==this.source&&c.w(`layer.source = ${jt.source} does not equal this.source = ${this.source}`),jt.minzoom&&this.zoom<Math.floor(jt.minzoom)||jt.maxzoom&&this.zoom>=jt.maxzoom||jt.visibility!=="none"&&(ci(kt,this.zoom,k),(j[jt.id]=jt.createBucket({index:Z.bucketLayerIDs.length,layers:kt,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Wt,sourceID:this.source})).populate(ot,W,this.tileID.canonical),Z.bucketLayerIDs.push(kt.map(Li=>Li.id)))}}let ae,le,Pe,Re;const Te=c.aH(W.glyphDependencies,Ke=>Object.keys(Ke).map(Number));this.inFlightDependencies.forEach(Ke=>Ke==null?void 0:Ke.cancel()),this.inFlightDependencies=[];const ze=++this.dependencySentinel;Object.keys(Te).length?this.inFlightDependencies.push(O.send("getGlyphs",{uid:this.uid,stacks:Te,source:this.source,tileID:this.tileID,type:"glyphs"},(Ke,He)=>{ze===this.dependencySentinel&&(ae||(ae=Ke,le=He,st.call(this)))})):le={};const Oe=Object.keys(W.iconDependencies);Oe.length?this.inFlightDependencies.push(O.send("getImages",{icons:Oe,source:this.source,tileID:this.tileID,type:"icons"},(Ke,He)=>{ze===this.dependencySentinel&&(ae||(ae=Ke,Pe=He,st.call(this)))})):Pe={};const tt=Object.keys(W.patternDependencies);function st(){if(ae)return N(ae);if(le&&Pe&&Re){const Ke=new ie(le),He=new c.bp(Pe,Re);for(const Wt in j){const ot=j[Wt];ot instanceof c.a4?(ci(ot.layers,this.zoom,k),c.bq({bucket:ot,glyphMap:le,glyphPositions:Ke.positions,imageMap:Pe,imagePositions:He.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):ot.hasPattern&&(ot instanceof c.br||ot instanceof c.bs||ot instanceof c.bt)&&(ci(ot.layers,this.zoom,k),ot.addFeatures(W,this.tileID.canonical,He.patternPositions))}this.status="done",N(null,{buckets:Object.values(j).filter(Wt=>!Wt.isEmpty()),featureIndex:Z,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Ke.image,imageAtlas:He,glyphMap:this.returnDependencies?le:null,iconMap:this.returnDependencies?Pe:null,glyphPositions:this.returnDependencies?Ke.positions:null})}}tt.length?this.inFlightDependencies.push(O.send("getImages",{icons:tt,source:this.source,tileID:this.tileID,type:"patterns"},(Ke,He)=>{ze===this.dependencySentinel&&(ae||(ae=Ke,Re=He,st.call(this)))})):Re={},st.call(this)}}function ci(R,I,M){const k=new c.a8(I);for(const O of R)O.recalculate(k,M)}function Be(R,I){const M=c.l(R.request,(k,O,N,K)=>{if(k)I(k);else if(O)try{const Z=new c.bw.VectorTile(new c.bv(O));I(null,{vectorTile:Z,rawData:O,cacheControl:N,expires:K})}catch(Z){const j=new Uint8Array(O);let W=`Unable to parse the tile at ${R.request.url}, `;W+=j[0]===31&&j[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${Z.messge}`,I(new Error(W))}});return()=>{M.cancel(),I()}}class ls{constructor(I,M,k,O){this.actor=I,this.layerIndex=M,this.availableImages=k,this.loadVectorData=O||Be,this.fetching={},this.loading={},this.loaded={}}loadTile(I,M){const k=I.uid;this.loading||(this.loading={});const O=!!(I&&I.request&&I.request.collectResourceTiming)&&new c.bu(I.request),N=this.loading[k]=new Hi(I);N.abort=this.loadVectorData(I,(K,Z)=>{if(delete this.loading[k],K||!Z)return N.status="done",this.loaded[k]=N,M(K);const j=Z.rawData,W={};Z.expires&&(W.expires=Z.expires),Z.cacheControl&&(W.cacheControl=Z.cacheControl);const se={};if(O){const ae=O.finish();ae&&(se.resourceTiming=JSON.parse(JSON.stringify(ae)))}N.vectorTile=Z.vectorTile,N.parse(Z.vectorTile,this.layerIndex,this.availableImages,this.actor,(ae,le)=>{if(delete this.fetching[k],ae||!le)return M(ae);M(null,c.e({rawTileData:j.slice(0)},le,W,se))}),this.loaded=this.loaded||{},this.loaded[k]=N,this.fetching[k]={rawTileData:j,cacheControl:W,resourceTiming:se}})}reloadTile(I,M){const k=this.loaded,O=I.uid;if(k&&k[O]){const N=k[O];N.showCollisionBoxes=I.showCollisionBoxes,N.status==="parsing"?N.parse(N.vectorTile,this.layerIndex,this.availableImages,this.actor,(K,Z)=>{if(K||!Z)return M(K,Z);let j;if(this.fetching[O]){const{rawTileData:W,cacheControl:se,resourceTiming:ae}=this.fetching[O];delete this.fetching[O],j=c.e({rawTileData:W.slice(0)},Z,se,ae)}else j=Z;M(null,j)}):N.status==="done"&&(N.vectorTile?N.parse(N.vectorTile,this.layerIndex,this.availableImages,this.actor,M):M())}}abortTile(I,M){const k=this.loading,O=I.uid;k&&k[O]&&k[O].abort&&(k[O].abort(),delete k[O]),M()}removeTile(I,M){const k=this.loaded,O=I.uid;k&&k[O]&&delete k[O],M()}}class Fs{constructor(){this.loaded={}}loadTile(I,M){return c._(this,void 0,void 0,function*(){const{uid:k,encoding:O,rawImageData:N,redFactor:K,greenFactor:Z,blueFactor:j,baseShift:W}=I,se=N.width+2,ae=N.height+2,le=c.a(N)?new c.R({width:se,height:ae},yield c.bx(N,-1,-1,se,ae)):N,Pe=new c.by(k,le,O,K,Z,j,W);this.loaded=this.loaded||{},this.loaded[k]=Pe,M(null,Pe)})}removeTile(I){const M=this.loaded,k=I.uid;M&&M[k]&&delete M[k]}}function cs(R,I){if(R.length!==0){ei(R[0],I);for(var M=1;M<R.length;M++)ei(R[M],!I)}}function ei(R,I){for(var M=0,k=0,O=0,N=R.length,K=N-1;O<N;K=O++){var Z=(R[O][0]-R[K][0])*(R[K][1]+R[O][1]),j=M+Z;k+=Math.abs(M)>=Math.abs(Z)?M-j+Z:Z-j+M,M=j}M+k>=0!=!!I&&R.reverse()}var Pt=c.bz(function R(I,M){var k,O=I&&I.type;if(O==="FeatureCollection")for(k=0;k<I.features.length;k++)R(I.features[k],M);else if(O==="GeometryCollection")for(k=0;k<I.geometries.length;k++)R(I.geometries[k],M);else if(O==="Feature")R(I.geometry,M);else if(O==="Polygon")cs(I.coordinates,M);else if(O==="MultiPolygon")for(k=0;k<I.coordinates.length;k++)cs(I.coordinates[k],M);return I});const ua=c.bw.VectorTileFeature.prototype.toGeoJSON;var Tr={exports:{}},Os=c.bA,hs=c.bw.VectorTileFeature,Ki=Vs;function Vs(R,I){this.options=I||{},this.features=R,this.length=R.length}function $t(R,I){this.id=typeof R.id=="number"?R.id:void 0,this.type=R.type,this.rawGeometry=R.type===1?[R.geometry]:R.geometry,this.properties=R.tags,this.extent=I||4096}Vs.prototype.feature=function(R){return new $t(this.features[R],this.options.extent)},$t.prototype.loadGeometry=function(){var R=this.rawGeometry;this.geometry=[];for(var I=0;I<R.length;I++){for(var M=R[I],k=[],O=0;O<M.length;O++)k.push(new Os(M[O][0],M[O][1]));this.geometry.push(k)}return this.geometry},$t.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var R=this.geometry,I=1/0,M=-1/0,k=1/0,O=-1/0,N=0;N<R.length;N++)for(var K=R[N],Z=0;Z<K.length;Z++){var j=K[Z];I=Math.min(I,j.x),M=Math.max(M,j.x),k=Math.min(k,j.y),O=Math.max(O,j.y)}return[I,k,M,O]},$t.prototype.toGeoJSON=hs.prototype.toGeoJSON;var pa=c.bB,mt=Ki;function us(R){var I=new pa;return function(M,k){for(var O in M.layers)k.writeMessage(3,$i,M.layers[O])}(R,I),I.finish()}function $i(R,I){var M;I.writeVarintField(15,R.version||1),I.writeStringField(1,R.name||""),I.writeVarintField(5,R.extent||4096);var k={keys:[],values:[],keycache:{},valuecache:{}};for(M=0;M<R.length;M++)k.feature=R.feature(M),I.writeMessage(2,Ir,k);var O=k.keys;for(M=0;M<O.length;M++)I.writeStringField(3,O[M]);var N=k.values;for(M=0;M<N.length;M++)I.writeMessage(4,Nr,N[M])}function Ir(R,I){var M=R.feature;M.id!==void 0&&I.writeVarintField(1,M.id),I.writeMessage(2,ti,R),I.writeVarintField(3,M.type),I.writeMessage(4,ki,M)}function ti(R,I){var M=R.feature,k=R.keys,O=R.values,N=R.keycache,K=R.valuecache;for(var Z in M.properties){var j=M.properties[Z],W=N[Z];if(j!==null){W===void 0&&(k.push(Z),N[Z]=W=k.length-1),I.writeVarint(W);var se=typeof j;se!=="string"&&se!=="boolean"&&se!=="number"&&(j=JSON.stringify(j));var ae=se+":"+j,le=K[ae];le===void 0&&(O.push(j),K[ae]=le=O.length-1),I.writeVarint(le)}}}function vi(R,I){return(I<<3)+(7&R)}function cr(R){return R<<1^R>>31}function ki(R,I){for(var M=R.loadGeometry(),k=R.type,O=0,N=0,K=M.length,Z=0;Z<K;Z++){var j=M[Z],W=1;k===1&&(W=j.length),I.writeVarint(vi(1,W));for(var se=k===3?j.length-1:j.length,ae=0;ae<se;ae++){ae===1&&k!==1&&I.writeVarint(vi(2,se-1));var le=j[ae].x-O,Pe=j[ae].y-N;I.writeVarint(cr(le)),I.writeVarint(cr(Pe)),O+=le,N+=Pe}k===3&&I.writeVarint(vi(7,1))}}function Nr(R,I){var M=typeof R;M==="string"?I.writeStringField(1,R):M==="boolean"?I.writeBooleanField(7,R):M==="number"&&(R%1!=0?I.writeDoubleField(3,R):R<0?I.writeSVarintField(6,R):I.writeVarintField(5,R))}Tr.exports=us,Tr.exports.fromVectorTileJs=us,Tr.exports.fromGeojsonVt=function(R,I){I=I||{};var M={};for(var k in R)M[k]=new mt(R[k].features,I),M[k].name=k,M[k].version=I.version,M[k].extent=I.extent;return us({layers:M})},Tr.exports.GeoJSONWrapper=mt;var Ns=c.bz(Tr.exports);const da={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:R=>R},Us=Math.fround||(Yi=new Float32Array(1),R=>(Yi[0]=+R,Yi[0]));var Yi;const ct=3,hi=5,Ur=6;class ps{constructor(I){this.options=Object.assign(Object.create(da),I),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(I){const{log:M,minZoom:k,maxZoom:O}=this.options;M&&console.time("total time");const N=`prepare ${I.length} points`;M&&console.time(N),this.points=I;const K=[];for(let j=0;j<I.length;j++){const W=I[j];if(!W.geometry)continue;const[se,ae]=W.geometry.coordinates,le=Us(ji(se)),Pe=Us(zi(ae));K.push(le,Pe,1/0,j,-1,1),this.options.reduce&&K.push(0)}let Z=this.trees[O+1]=this._createTree(K);M&&console.timeEnd(N);for(let j=O;j>=k;j--){const W=+Date.now();Z=this.trees[j]=this._createTree(this._cluster(Z,j)),M&&console.log("z%d: %d clusters in %dms",j,Z.numItems,+Date.now()-W)}return M&&console.timeEnd("total time"),this}getClusters(I,M){let k=((I[0]+180)%360+360)%360-180;const O=Math.max(-90,Math.min(90,I[1]));let N=I[2]===180?180:((I[2]+180)%360+360)%360-180;const K=Math.max(-90,Math.min(90,I[3]));if(I[2]-I[0]>=360)k=-180,N=180;else if(k>N){const ae=this.getClusters([k,O,180,K],M),le=this.getClusters([-180,O,N,K],M);return ae.concat(le)}const Z=this.trees[this._limitZoom(M)],j=Z.range(ji(k),zi(K),ji(N),zi(O)),W=Z.data,se=[];for(const ae of j){const le=this.stride*ae;se.push(W[le+hi]>1?ds(W,le,this.clusterProps):this.points[W[le+ct]])}return se}getChildren(I){const M=this._getOriginId(I),k=this._getOriginZoom(I),O="No cluster with the specified id.",N=this.trees[k];if(!N)throw new Error(O);const K=N.data;if(M*this.stride>=K.length)throw new Error(O);const Z=this.options.radius/(this.options.extent*Math.pow(2,k-1)),j=N.within(K[M*this.stride],K[M*this.stride+1],Z),W=[];for(const se of j){const ae=se*this.stride;K[ae+4]===I&&W.push(K[ae+hi]>1?ds(K,ae,this.clusterProps):this.points[K[ae+ct]])}if(W.length===0)throw new Error(O);return W}getLeaves(I,M,k){const O=[];return this._appendLeaves(O,I,M=M||10,k=k||0,0),O}getTile(I,M,k){const O=this.trees[this._limitZoom(I)],N=Math.pow(2,I),{extent:K,radius:Z}=this.options,j=Z/K,W=(k-j)/N,se=(k+1+j)/N,ae={features:[]};return this._addTileFeatures(O.range((M-j)/N,W,(M+1+j)/N,se),O.data,M,k,N,ae),M===0&&this._addTileFeatures(O.range(1-j/N,W,1,se),O.data,N,k,N,ae),M===N-1&&this._addTileFeatures(O.range(0,W,j/N,se),O.data,-1,k,N,ae),ae.features.length?ae:null}getClusterExpansionZoom(I){let M=this._getOriginZoom(I)-1;for(;M<=this.options.maxZoom;){const k=this.getChildren(I);if(M++,k.length!==1)break;I=k[0].properties.cluster_id}return M}_appendLeaves(I,M,k,O,N){const K=this.getChildren(M);for(const Z of K){const j=Z.properties;if(j&&j.cluster?N+j.point_count<=O?N+=j.point_count:N=this._appendLeaves(I,j.cluster_id,k,O,N):N<O?N++:I.push(Z),I.length===k)break}return N}_createTree(I){const M=new c.av(I.length/this.stride|0,this.options.nodeSize,Float32Array);for(let k=0;k<I.length;k+=this.stride)M.add(I[k],I[k+1]);return M.finish(),M.data=I,M}_addTileFeatures(I,M,k,O,N,K){for(const Z of I){const j=Z*this.stride,W=M[j+hi]>1;let se,ae,le;if(W)se=Ar(M,j,this.clusterProps),ae=M[j],le=M[j+1];else{const Te=this.points[M[j+ct]];se=Te.properties;const[ze,Oe]=Te.geometry.coordinates;ae=ji(ze),le=zi(Oe)}const Pe={type:1,geometry:[[Math.round(this.options.extent*(ae*N-k)),Math.round(this.options.extent*(le*N-O))]],tags:se};let Re;Re=W||this.options.generateId?M[j+ct]:this.points[M[j+ct]].id,Re!==void 0&&(Pe.id=Re),K.features.push(Pe)}}_limitZoom(I){return Math.max(this.options.minZoom,Math.min(Math.floor(+I),this.options.maxZoom+1))}_cluster(I,M){const{radius:k,extent:O,reduce:N,minPoints:K}=this.options,Z=k/(O*Math.pow(2,M)),j=I.data,W=[],se=this.stride;for(let ae=0;ae<j.length;ae+=se){if(j[ae+2]<=M)continue;j[ae+2]=M;const le=j[ae],Pe=j[ae+1],Re=I.within(j[ae],j[ae+1],Z),Te=j[ae+hi];let ze=Te;for(const Oe of Re){const tt=Oe*se;j[tt+2]>M&&(ze+=j[tt+hi])}if(ze>Te&&ze>=K){let Oe,tt=le*Te,st=Pe*Te,Ke=-1;const He=((ae/se|0)<<5)+(M+1)+this.points.length;for(const Wt of Re){const ot=Wt*se;if(j[ot+2]<=M)continue;j[ot+2]=M;const kt=j[ot+hi];tt+=j[ot]*kt,st+=j[ot+1]*kt,j[ot+4]=He,N&&(Oe||(Oe=this._map(j,ae,!0),Ke=this.clusterProps.length,this.clusterProps.push(Oe)),N(Oe,this._map(j,ot)))}j[ae+4]=He,W.push(tt/ze,st/ze,1/0,He,-1,ze),N&&W.push(Ke)}else{for(let Oe=0;Oe<se;Oe++)W.push(j[ae+Oe]);if(ze>1)for(const Oe of Re){const tt=Oe*se;if(!(j[tt+2]<=M)){j[tt+2]=M;for(let st=0;st<se;st++)W.push(j[tt+st])}}}}return W}_getOriginId(I){return I-this.points.length>>5}_getOriginZoom(I){return(I-this.points.length)%32}_map(I,M,k){if(I[M+hi]>1){const K=this.clusterProps[I[M+Ur]];return k?Object.assign({},K):K}const O=this.points[I[M+ct]].properties,N=this.options.map(O);return k&&N===O?Object.assign({},N):N}}function ds(R,I,M){return{type:"Feature",id:R[I+ct],properties:Ar(R,I,M),geometry:{type:"Point",coordinates:[(k=R[I],360*(k-.5)),$s(R[I+1])]}};var k}function Ar(R,I,M){const k=R[I+hi],O=k>=1e4?`${Math.round(k/1e3)}k`:k>=1e3?Math.round(k/100)/10+"k":k,N=R[I+Ur],K=N===-1?{}:Object.assign({},M[N]);return Object.assign(K,{cluster:!0,cluster_id:R[I+ct],point_count:k,point_count_abbreviated:O})}function ji(R){return R/360+.5}function zi(R){const I=Math.sin(R*Math.PI/180),M=.5-.25*Math.log((1+I)/(1-I))/Math.PI;return M<0?0:M>1?1:M}function $s(R){const I=(180-360*R)*Math.PI/180;return 360*Math.atan(Math.exp(I))/Math.PI-90}function Mr(R,I,M,k){for(var O,N=k,K=M-I>>1,Z=M-I,j=R[I],W=R[I+1],se=R[M],ae=R[M+1],le=I+3;le<M;le+=3){var Pe=js(R[le],R[le+1],j,W,se,ae);if(Pe>N)O=le,N=Pe;else if(Pe===N){var Re=Math.abs(le-K);Re<Z&&(O=le,Z=Re)}}N>k&&(O-I>3&&Mr(R,I,O,k),R[O+2]=N,M-O>3&&Mr(R,O,M,k))}function js(R,I,M,k,O,N){var K=O-M,Z=N-k;if(K!==0||Z!==0){var j=((R-M)*K+(I-k)*Z)/(K*K+Z*Z);j>1?(M=O,k=N):j>0&&(M+=K*j,k+=Z*j)}return(K=R-M)*K+(Z=I-k)*Z}function hr(R,I,M,k){var O={id:R===void 0?null:R,type:I,geometry:M,tags:k,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(N){var K=N.geometry,Z=N.type;if(Z==="Point"||Z==="MultiPoint"||Z==="LineString")fs(N,K);else if(Z==="Polygon"||Z==="MultiLineString")for(var j=0;j<K.length;j++)fs(N,K[j]);else if(Z==="MultiPolygon")for(j=0;j<K.length;j++)for(var W=0;W<K[j].length;W++)fs(N,K[j][W])}(O),O}function fs(R,I){for(var M=0;M<I.length;M+=3)R.minX=Math.min(R.minX,I[M]),R.minY=Math.min(R.minY,I[M+1]),R.maxX=Math.max(R.maxX,I[M]),R.maxY=Math.max(R.maxY,I[M+1])}function $r(R,I,M,k){if(I.geometry){var O=I.geometry.coordinates,N=I.geometry.type,K=Math.pow(M.tolerance/((1<<M.maxZoom)*M.extent),2),Z=[],j=I.id;if(M.promoteId?j=I.properties[M.promoteId]:M.generateId&&(j=k||0),N==="Point")Er(O,Z);else if(N==="MultiPoint")for(var W=0;W<O.length;W++)Er(O[W],Z);else if(N==="LineString")Cr(O,Z,K,!1);else if(N==="MultiLineString"){if(M.lineMetrics){for(W=0;W<O.length;W++)Cr(O[W],Z=[],K,!1),R.push(hr(j,"LineString",Z,I.properties));return}jr(O,Z,K,!1)}else if(N==="Polygon")jr(O,Z,K,!0);else{if(N!=="MultiPolygon"){if(N==="GeometryCollection"){for(W=0;W<I.geometry.geometries.length;W++)$r(R,{id:j,geometry:I.geometry.geometries[W],properties:I.properties},M,k);return}throw new Error("Input data is not a valid GeoJSON object.")}for(W=0;W<O.length;W++){var se=[];jr(O[W],se,K,!0),Z.push(se)}}R.push(hr(j,N,Z,I.properties))}}function Er(R,I){I.push(re(R[0])),I.push(ui(R[1])),I.push(0)}function Cr(R,I,M,k){for(var O,N,K=0,Z=0;Z<R.length;Z++){var j=re(R[Z][0]),W=ui(R[Z][1]);I.push(j),I.push(W),I.push(0),Z>0&&(K+=k?(O*W-j*N)/2:Math.sqrt(Math.pow(j-O,2)+Math.pow(W-N,2))),O=j,N=W}var se=I.length-3;I[2]=1,Mr(I,0,se,M),I[se+2]=1,I.size=Math.abs(K),I.start=0,I.end=I.size}function jr(R,I,M,k){for(var O=0;O<R.length;O++){var N=[];Cr(R[O],N,M,k),I.push(N)}}function re(R){return R/360+.5}function ui(R){var I=Math.sin(R*Math.PI/180),M=.5-.25*Math.log((1+I)/(1-I))/Math.PI;return M<0?0:M>1?1:M}function Di(R,I,M,k,O,N,K,Z){if(k/=I,N>=(M/=I)&&K<k)return R;if(K<M||N>=k)return null;for(var j=[],W=0;W<R.length;W++){var se=R[W],ae=se.geometry,le=se.type,Pe=O===0?se.minX:se.minY,Re=O===0?se.maxX:se.maxY;if(Pe>=M&&Re<k)j.push(se);else if(!(Re<M||Pe>=k)){var Te=[];if(le==="Point"||le==="MultiPoint")nt(ae,Te,M,k,O);else if(le==="LineString")Ye(ae,Te,M,k,O,!1,Z.lineMetrics);else if(le==="MultiLineString")ms(ae,Te,M,k,O,!1);else if(le==="Polygon")ms(ae,Te,M,k,O,!0);else if(le==="MultiPolygon")for(var ze=0;ze<ae.length;ze++){var Oe=[];ms(ae[ze],Oe,M,k,O,!0),Oe.length&&Te.push(Oe)}if(Te.length){if(Z.lineMetrics&&le==="LineString"){for(ze=0;ze<Te.length;ze++)j.push(hr(se.id,le,Te[ze],se.tags));continue}le!=="LineString"&&le!=="MultiLineString"||(Te.length===1?(le="LineString",Te=Te[0]):le="MultiLineString"),le!=="Point"&&le!=="MultiPoint"||(le=Te.length===3?"Point":"MultiPoint"),j.push(hr(se.id,le,Te,se.tags))}}}return j.length?j:null}function nt(R,I,M,k,O){for(var N=0;N<R.length;N+=3){var K=R[N+O];K>=M&&K<=k&&(I.push(R[N]),I.push(R[N+1]),I.push(R[N+2]))}}function Ye(R,I,M,k,O,N,K){for(var Z,j,W=Ji(R),se=O===0?fa:gs,ae=R.start,le=0;le<R.length-3;le+=3){var Pe=R[le],Re=R[le+1],Te=R[le+2],ze=R[le+3],Oe=R[le+4],tt=O===0?Pe:Re,st=O===0?ze:Oe,Ke=!1;K&&(Z=Math.sqrt(Math.pow(Pe-ze,2)+Math.pow(Re-Oe,2))),tt<M?st>M&&(j=se(W,Pe,Re,ze,Oe,M),K&&(W.start=ae+Z*j)):tt>k?st<k&&(j=se(W,Pe,Re,ze,Oe,k),K&&(W.start=ae+Z*j)):ur(W,Pe,Re,Te),st<M&&tt>=M&&(j=se(W,Pe,Re,ze,Oe,M),Ke=!0),st>k&&tt<=k&&(j=se(W,Pe,Re,ze,Oe,k),Ke=!0),!N&&Ke&&(K&&(W.end=ae+Z*j),I.push(W),W=Ji(R)),K&&(ae+=Z)}var He=R.length-3;Pe=R[He],Re=R[He+1],Te=R[He+2],(tt=O===0?Pe:Re)>=M&&tt<=k&&ur(W,Pe,Re,Te),He=W.length-3,N&&He>=3&&(W[He]!==W[0]||W[He+1]!==W[1])&&ur(W,W[0],W[1],W[2]),W.length&&I.push(W)}function Ji(R){var I=[];return I.size=R.size,I.start=R.start,I.end=R.end,I}function ms(R,I,M,k,O,N){for(var K=0;K<R.length;K++)Ye(R[K],I,M,k,O,N,!1)}function ur(R,I,M,k){R.push(I),R.push(M),R.push(k)}function fa(R,I,M,k,O,N){var K=(N-I)/(k-I);return R.push(N),R.push(M+(O-M)*K),R.push(1),K}function gs(R,I,M,k,O,N){var K=(N-M)/(O-M);return R.push(I+(k-I)*K),R.push(N),R.push(1),K}function Pr(R,I){for(var M=[],k=0;k<R.length;k++){var O,N=R[k],K=N.type;if(K==="Point"||K==="MultiPoint"||K==="LineString")O=qr(N.geometry,I);else if(K==="MultiLineString"||K==="Polygon"){O=[];for(var Z=0;Z<N.geometry.length;Z++)O.push(qr(N.geometry[Z],I))}else if(K==="MultiPolygon")for(O=[],Z=0;Z<N.geometry.length;Z++){for(var j=[],W=0;W<N.geometry[Z].length;W++)j.push(qr(N.geometry[Z][W],I));O.push(j)}M.push(hr(N.id,K,O,N.tags))}return M}function qr(R,I){var M=[];M.size=R.size,R.start!==void 0&&(M.start=R.start,M.end=R.end);for(var k=0;k<R.length;k+=3)M.push(R[k]+I,R[k+1],R[k+2]);return M}function fe(R,I){if(R.transformed)return R;var M,k,O,N=1<<R.z,K=R.x,Z=R.y;for(M=0;M<R.features.length;M++){var j=R.features[M],W=j.geometry,se=j.type;if(j.geometry=[],se===1)for(k=0;k<W.length;k+=2)j.geometry.push(Qi(W[k],W[k+1],I,N,K,Z));else for(k=0;k<W.length;k++){var ae=[];for(O=0;O<W[k].length;O+=2)ae.push(Qi(W[k][O],W[k][O+1],I,N,K,Z));j.geometry.push(ae)}}return R.transformed=!0,R}function Qi(R,I,M,k,O,N){return[Math.round(M*(R*k-O)),Math.round(M*(I*k-N))]}function vt(R,I,M,k,O){for(var N=I===O.maxZoom?0:O.tolerance/((1<<I)*O.extent),K={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:M,y:k,z:I,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},Z=0;Z<R.length;Z++){K.numFeatures++,Zr(K,R[Z],N,O);var j=R[Z].minX,W=R[Z].minY,se=R[Z].maxX,ae=R[Z].maxY;j<K.minX&&(K.minX=j),W<K.minY&&(K.minY=W),se>K.maxX&&(K.maxX=se),ae>K.maxY&&(K.maxY=ae)}return K}function Zr(R,I,M,k){var O=I.geometry,N=I.type,K=[];if(N==="Point"||N==="MultiPoint")for(var Z=0;Z<O.length;Z+=3)K.push(O[Z]),K.push(O[Z+1]),R.numPoints++,R.numSimplified++;else if(N==="LineString")pr(K,O,R,M,!1,!1);else if(N==="MultiLineString"||N==="Polygon")for(Z=0;Z<O.length;Z++)pr(K,O[Z],R,M,N==="Polygon",Z===0);else if(N==="MultiPolygon")for(var j=0;j<O.length;j++){var W=O[j];for(Z=0;Z<W.length;Z++)pr(K,W[Z],R,M,!0,Z===0)}if(K.length){var se=I.tags||null;if(N==="LineString"&&k.lineMetrics){for(var ae in se={},I.tags)se[ae]=I.tags[ae];se.mapbox_clip_start=O.start/O.size,se.mapbox_clip_end=O.end/O.size}var le={geometry:K,type:N==="Polygon"||N==="MultiPolygon"?3:N==="LineString"||N==="MultiLineString"?2:1,tags:se};I.id!==null&&(le.id=I.id),R.features.push(le)}}function pr(R,I,M,k,O,N){var K=k*k;if(k>0&&I.size<(O?K:k))M.numPoints+=I.length/3;else{for(var Z=[],j=0;j<I.length;j+=3)(k===0||I[j+2]>K)&&(M.numSimplified++,Z.push(I[j]),Z.push(I[j+1])),M.numPoints++;O&&function(W,se){for(var ae=0,le=0,Pe=W.length,Re=Pe-2;le<Pe;Re=le,le+=2)ae+=(W[le]-W[Re])*(W[le+1]+W[Re+1]);if(ae>0===se)for(le=0,Pe=W.length;le<Pe/2;le+=2){var Te=W[le],ze=W[le+1];W[le]=W[Pe-2-le],W[le+1]=W[Pe-1-le],W[Pe-2-le]=Te,W[Pe-1-le]=ze}}(Z,N),R.push(Z)}}function ge(R,I){var M=(I=this.options=function(O,N){for(var K in N)O[K]=N[K];return O}(Object.create(this.options),I)).debug;if(M&&console.time("preprocess data"),I.maxZoom<0||I.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(I.promoteId&&I.generateId)throw new Error("promoteId and generateId cannot be used together.");var k=function(O,N){var K=[];if(O.type==="FeatureCollection")for(var Z=0;Z<O.features.length;Z++)$r(K,O.features[Z],N,Z);else $r(K,O.type==="Feature"?O:{geometry:O},N);return K}(R,I);this.tiles={},this.tileCoords=[],M&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",I.indexMaxZoom,I.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),k=function(O,N){var K=N.buffer/N.extent,Z=O,j=Di(O,1,-1-K,K,0,-1,2,N),W=Di(O,1,1-K,2+K,0,-1,2,N);return(j||W)&&(Z=Di(O,1,-K,1+K,0,-1,2,N)||[],j&&(Z=Pr(j,1).concat(Z)),W&&(Z=Z.concat(Pr(W,-1)))),Z}(k,I),k.length&&this.splitTile(k,0,0,0),M&&(k.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 Ue(R,I,M){return 32*((1<<R)*M+I)+R}function Fe(R,I){return I?R.properties[I]:R.id}function ii(R,I){if(R==null)return!0;if(R.type==="Feature")return Fe(R,I)!=null;if(R.type==="FeatureCollection"){const M=new Set;for(const k of R.features){const O=Fe(k,I);if(O==null||M.has(O))return!1;M.add(O)}return!0}return!1}function er(R,I){const M=new Map;if(R!=null)if(R.type==="Feature")M.set(Fe(R,I),R);else for(const k of R.features)M.set(Fe(k,I),k);return M}ge.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},ge.prototype.splitTile=function(R,I,M,k,O,N,K){for(var Z=[R,I,M,k],j=this.options,W=j.debug;Z.length;){k=Z.pop(),M=Z.pop(),I=Z.pop(),R=Z.pop();var se=1<<I,ae=Ue(I,M,k),le=this.tiles[ae];if(!le&&(W>1&&console.time("creation"),le=this.tiles[ae]=vt(R,I,M,k,j),this.tileCoords.push({z:I,x:M,y:k}),W)){W>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",I,M,k,le.numFeatures,le.numPoints,le.numSimplified),console.timeEnd("creation"));var Pe="z"+I;this.stats[Pe]=(this.stats[Pe]||0)+1,this.total++}if(le.source=R,O){if(I===j.maxZoom||I===O)continue;var Re=1<<O-I;if(M!==Math.floor(N/Re)||k!==Math.floor(K/Re))continue}else if(I===j.indexMaxZoom||le.numPoints<=j.indexMaxPoints)continue;if(le.source=null,R.length!==0){W>1&&console.time("clipping");var Te,ze,Oe,tt,st,Ke,He=.5*j.buffer/j.extent,Wt=.5-He,ot=.5+He,kt=1+He;Te=ze=Oe=tt=null,st=Di(R,se,M-He,M+ot,0,le.minX,le.maxX,j),Ke=Di(R,se,M+Wt,M+kt,0,le.minX,le.maxX,j),R=null,st&&(Te=Di(st,se,k-He,k+ot,1,le.minY,le.maxY,j),ze=Di(st,se,k+Wt,k+kt,1,le.minY,le.maxY,j),st=null),Ke&&(Oe=Di(Ke,se,k-He,k+ot,1,le.minY,le.maxY,j),tt=Di(Ke,se,k+Wt,k+kt,1,le.minY,le.maxY,j),Ke=null),W>1&&console.timeEnd("clipping"),Z.push(Te||[],I+1,2*M,2*k),Z.push(ze||[],I+1,2*M,2*k+1),Z.push(Oe||[],I+1,2*M+1,2*k),Z.push(tt||[],I+1,2*M+1,2*k+1)}}},ge.prototype.getTile=function(R,I,M){var k=this.options,O=k.extent,N=k.debug;if(R<0||R>24)return null;var K=1<<R,Z=Ue(R,I=(I%K+K)%K,M);if(this.tiles[Z])return fe(this.tiles[Z],O);N>1&&console.log("drilling down to z%d-%d-%d",R,I,M);for(var j,W=R,se=I,ae=M;!j&&W>0;)W--,se=Math.floor(se/2),ae=Math.floor(ae/2),j=this.tiles[Ue(W,se,ae)];return j&&j.source?(N>1&&console.log("found parent tile z%d-%d-%d",W,se,ae),N>1&&console.time("drilling down"),this.splitTile(j.source,W,se,ae,R,I,M),N>1&&console.timeEnd("drilling down"),this.tiles[Z]?fe(this.tiles[Z],O):null):null};class Ve extends ls{constructor(I,M,k,O){super(I,M,k),this._dataUpdateable=new Map,this.loadGeoJSON=(N,K)=>{const{promoteId:Z}=N;if(N.request)return c.f(N.request,(j,W,se,ae)=>{this._dataUpdateable=ii(W,Z)?er(W,Z):void 0,K(j,W,se,ae)});if(typeof N.data=="string")try{const j=JSON.parse(N.data);this._dataUpdateable=ii(j,Z)?er(j,Z):void 0,K(null,j)}catch{K(new Error(`Input data given to '${N.source}' is not a valid GeoJSON object.`))}else N.dataDiff?this._dataUpdateable?(function(j,W,se){var ae,le,Pe,Re;if(W.removeAll&&j.clear(),W.remove)for(const Te of W.remove)j.delete(Te);if(W.add)for(const Te of W.add){const ze=Fe(Te,se);ze!=null&&j.set(ze,Te)}if(W.update)for(const Te of W.update){let ze=j.get(Te.id);if(ze==null)continue;const Oe=!Te.removeAllProperties&&(((ae=Te.removeProperties)===null||ae===void 0?void 0:ae.length)>0||((le=Te.addOrUpdateProperties)===null||le===void 0?void 0:le.length)>0);if((Te.newGeometry||Te.removeAllProperties||Oe)&&(ze=Object.assign({},ze),j.set(Te.id,ze),Oe&&(ze.properties=Object.assign({},ze.properties))),Te.newGeometry&&(ze.geometry=Te.newGeometry),Te.removeAllProperties)ze.properties={};else if(((Pe=Te.removeProperties)===null||Pe===void 0?void 0:Pe.length)>0)for(const tt of Te.removeProperties)Object.prototype.hasOwnProperty.call(ze.properties,tt)&&delete ze.properties[tt];if(((Re=Te.addOrUpdateProperties)===null||Re===void 0?void 0:Re.length)>0)for(const{key:tt,value:st}of Te.addOrUpdateProperties)ze.properties[tt]=st}}(this._dataUpdateable,N.dataDiff,Z),K(null,{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())})):K(new Error(`Cannot update existing geojson data in ${N.source}`)):K(new Error(`Input data given to '${N.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}},this.loadVectorData=this.loadGeoJSONTile,O&&(this.loadGeoJSON=O)}loadGeoJSONTile(I,M){const k=I.tileID.canonical;if(!this._geoJSONIndex)return M(null,null);const O=this._geoJSONIndex.getTile(k.z,k.x,k.y);if(!O)return M(null,null);const N=new class{constructor(Z){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=c.N,this.length=Z.length,this._features=Z}feature(Z){return new class{constructor(j){this._feature=j,this.extent=c.N,this.type=j.type,this.properties=j.tags,"id"in j&&!isNaN(j.id)&&(this.id=parseInt(j.id,10))}loadGeometry(){if(this._feature.type===1){const j=[];for(const W of this._feature.geometry)j.push([new c.P(W[0],W[1])]);return j}{const j=[];for(const W of this._feature.geometry){const se=[];for(const ae of W)se.push(new c.P(ae[0],ae[1]));j.push(se)}return j}}toGeoJSON(j,W,se){return ua.call(this,j,W,se)}}(this._features[Z])}}(O.features);let K=Ns(N);K.byteOffset===0&&K.byteLength===K.buffer.byteLength||(K=new Uint8Array(K)),M(null,{vectorTile:N,rawData:K.buffer})}loadData(I,M){var k;(k=this._pendingRequest)===null||k===void 0||k.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const O=!!(I&&I.request&&I.request.collectResourceTiming)&&new c.bu(I.request);this._pendingCallback=M,this._pendingRequest=this.loadGeoJSON(I,(N,K)=>{if(delete this._pendingCallback,delete this._pendingRequest,N||!K)return M(N);if(typeof K!="object")return M(new Error(`Input data given to '${I.source}' is not a valid GeoJSON object.`));{Pt(K,!0);try{if(I.filter){const j=c.bC(I.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(j.result==="error")throw new Error(j.value.map(se=>`${se.key}: ${se.message}`).join(", "));K={type:"FeatureCollection",features:K.features.filter(se=>j.value.evaluate({zoom:0},se))}}this._geoJSONIndex=I.cluster?new ps(function({superclusterOptions:j,clusterProperties:W}){if(!W||!j)return j;const se={},ae={},le={accumulated:null,zoom:0},Pe={properties:null},Re=Object.keys(W);for(const Te of Re){const[ze,Oe]=W[Te],tt=c.bC(Oe),st=c.bC(typeof ze=="string"?[ze,["accumulated"],["get",Te]]:ze);se[Te]=tt.value,ae[Te]=st.value}return j.map=Te=>{Pe.properties=Te;const ze={};for(const Oe of Re)ze[Oe]=se[Oe].evaluate(le,Pe);return ze},j.reduce=(Te,ze)=>{Pe.properties=ze;for(const Oe of Re)le.accumulated=Te[Oe],Te[Oe]=ae[Oe].evaluate(le,Pe)},j}(I)).load(K.features):function(j,W){return new ge(j,W)}(K,I.geojsonVtOptions)}catch(j){return M(j)}this.loaded={};const Z={};if(O){const j=O.finish();j&&(Z.resourceTiming={},Z.resourceTiming[I.source]=JSON.parse(JSON.stringify(j)))}M(null,Z)}})}reloadTile(I,M){const k=this.loaded;return k&&k[I.uid]?super.reloadTile(I,M):this.loadTile(I,M)}removeSource(I,M){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),M()}getClusterExpansionZoom(I,M){try{M(null,this._geoJSONIndex.getClusterExpansionZoom(I.clusterId))}catch(k){M(k)}}getClusterChildren(I,M){try{M(null,this._geoJSONIndex.getChildren(I.clusterId))}catch(k){M(k)}}getClusterLeaves(I,M){try{M(null,this._geoJSONIndex.getLeaves(I.clusterId,I.limit,I.offset))}catch(k){M(k)}}}class dr{constructor(I){this.self=I,this.actor=new c.C(I,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:ls,geojson:Ve},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(M,k)=>{if(this.workerSourceTypes[M])throw new Error(`Worker source with name "${M}" already registered.`);this.workerSourceTypes[M]=k},this.self.registerRTLTextPlugin=M=>{if(c.bD.isParsed())throw new Error("RTL text plugin already registered.");c.bD.applyArabicShaping=M.applyArabicShaping,c.bD.processBidirectionalText=M.processBidirectionalText,c.bD.processStyledBidirectionalText=M.processStyledBidirectionalText}}setReferrer(I,M){this.referrer=M}setImages(I,M,k){this.availableImages[I]=M;for(const O in this.workerSources[I]){const N=this.workerSources[I][O];for(const K in N)N[K].availableImages=M}k()}setLayers(I,M,k){this.getLayerIndex(I).replace(M),k()}updateLayers(I,M,k){this.getLayerIndex(I).update(M.layers,M.removedIds),k()}loadTile(I,M,k){this.getWorkerSource(I,M.type,M.source).loadTile(M,k)}loadDEMTile(I,M,k){this.getDEMWorkerSource(I,M.source).loadTile(M,k)}reloadTile(I,M,k){this.getWorkerSource(I,M.type,M.source).reloadTile(M,k)}abortTile(I,M,k){this.getWorkerSource(I,M.type,M.source).abortTile(M,k)}removeTile(I,M,k){this.getWorkerSource(I,M.type,M.source).removeTile(M,k)}removeDEMTile(I,M){this.getDEMWorkerSource(I,M.source).removeTile(M)}removeSource(I,M,k){if(!this.workerSources[I]||!this.workerSources[I][M.type]||!this.workerSources[I][M.type][M.source])return;const O=this.workerSources[I][M.type][M.source];delete this.workerSources[I][M.type][M.source],O.removeSource!==void 0?O.removeSource(M,k):k()}loadWorkerSource(I,M,k){try{this.self.importScripts(M.url),k()}catch(O){k(O.toString())}}syncRTLPluginState(I,M,k){try{c.bD.setState(M);const O=c.bD.getPluginURL();if(c.bD.isLoaded()&&!c.bD.isParsed()&&O!=null){this.self.importScripts(O);const N=c.bD.isParsed();k(N?void 0:new Error(`RTL Text Plugin failed to import scripts from ${O}`),N)}}catch(O){k(O.toString())}}getAvailableImages(I){let M=this.availableImages[I];return M||(M=[]),M}getLayerIndex(I){let M=this.layerIndexes[I];return M||(M=this.layerIndexes[I]=new Wi),M}getWorkerSource(I,M,k){return this.workerSources[I]||(this.workerSources[I]={}),this.workerSources[I][M]||(this.workerSources[I][M]={}),this.workerSources[I][M][k]||(this.workerSources[I][M][k]=new this.workerSourceTypes[M]({send:(O,N,K)=>{this.actor.send(O,N,K,I)}},this.getLayerIndex(I),this.getAvailableImages(I))),this.workerSources[I][M][k]}getDEMWorkerSource(I,M){return this.demWorkerSources[I]||(this.demWorkerSources[I]={}),this.demWorkerSources[I][M]||(this.demWorkerSources[I][M]=new Fs),this.demWorkerSources[I][M]}}return c.i()&&(self.worker=new dr(self)),dr}),yl(["./shared"],function(c){var Wi="3.6.2";class ie{static testProp(t){if(!ie.docStyle)return t[0];for(let s=0;s<t.length;s++)if(t[s]in ie.docStyle)return t[s];return t[0]}static create(t,s,n){const l=window.document.createElement(t);return s!==void 0&&(l.className=s),n&&n.appendChild(l),l}static createNS(t,s){return window.document.createElementNS(t,s)}static disableDrag(){ie.docStyle&&ie.selectProp&&(ie.userSelect=ie.docStyle[ie.selectProp],ie.docStyle[ie.selectProp]="none")}static enableDrag(){ie.docStyle&&ie.selectProp&&(ie.docStyle[ie.selectProp]=ie.userSelect)}static setTransform(t,s){t.style[ie.transformProp]=s}static addEventListener(t,s,n,l={}){t.addEventListener(s,n,"passive"in l?l:l.capture)}static removeEventListener(t,s,n,l={}){t.removeEventListener(s,n,"passive"in l?l:l.capture)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",ie.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",ie.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",ie.suppressClickInternal,!0)},0)}static mousePos(t,s){const n=t.getBoundingClientRect();return new c.P(s.clientX-n.left-t.clientLeft,s.clientY-n.top-t.clientTop)}static touchPos(t,s){const n=t.getBoundingClientRect(),l=[];for(let p=0;p<s.length;p++)l.push(new c.P(s[p].clientX-n.left-t.clientLeft,s[p].clientY-n.top-t.clientTop));return l}static mouseButton(t){return t.button}static remove(t){t.parentNode&&t.parentNode.removeChild(t)}}ie.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,ie.selectProp=ie.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),ie.transformProp=ie.testProp(["transform","WebkitTransform"]);const Hi={supported:!1,testSupport:function(h){!ls&&Be&&(Fs?cs(h):ci=h)}};let ci,Be,ls=!1,Fs=!1;function cs(h){const t=h.createTexture();h.bindTexture(h.TEXTURE_2D,t);try{if(h.texImage2D(h.TEXTURE_2D,0,h.RGBA,h.RGBA,h.UNSIGNED_BYTE,Be),h.isContextLost())return;Hi.supported=!0}catch{}h.deleteTexture(t),ls=!0}var ei,Pt;typeof document<"u"&&(Be=document.createElement("img"),Be.onload=function(){ci&&cs(ci),ci=null,Fs=!0},Be.onerror=function(){ls=!0,ci=null},Be.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(h){let t,s,n,l;h.resetRequestQueue=()=>{t=[],s=0,n=0,l={}},h.addThrottleControl=v=>{const w=n++;return l[w]=v,w},h.removeThrottleControl=v=>{delete l[v],g()},h.getImage=(v,w,S=!0)=>{Hi.supported&&(v.headers||(v.headers={}),v.headers.accept="image/webp,*/*");const E={requestParameters:v,supportImageRefresh:S,callback:w,cancelled:!1,completed:!1,cancel:()=>{E.completed||E.cancelled||(E.cancelled=!0,E.innerRequest&&(E.innerRequest.cancel(),s--),g())}};return t.push(E),g(),E};const p=v=>{const{requestParameters:w,supportImageRefresh:S,callback:E}=v;return c.e(w,{type:"image"}),(S!==!1||c.i()||c.g(w.url)||w.headers&&!Object.keys(w.headers).reduce((B,L)=>B&&L==="accept",!0)?c.m:y)(w,(B,L,F,z)=>{m(v,E,B,L,F,z)})},m=(v,w,S,E,B,L)=>{S?w(S):E instanceof HTMLImageElement||c.a(E)?w(null,E):E&&((F,z)=>{typeof createImageBitmap=="function"?c.b(F,z):c.d(F,z)})(E,(F,z)=>{F!=null?w(F):z!=null&&w(null,z,{cacheControl:B,expires:L})}),v.cancelled||(v.completed=!0,s--,g())},g=()=>{const v=(()=>{const w=Object.keys(l);let S=!1;if(w.length>0){for(const E of w)if(S=l[E](),S)break}return S})()?c.c.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:c.c.MAX_PARALLEL_IMAGE_REQUESTS;for(let w=s;w<v&&t.length>0;w++){const S=t.shift();if(S.cancelled){w--;continue}const E=p(S);s++,S.innerRequest=E}},y=(v,w)=>{const S=new Image,E=v.url;let B=!1;const L=v.credentials;return L&&L==="include"?S.crossOrigin="use-credentials":(L&&L==="same-origin"||!c.s(E))&&(S.crossOrigin="anonymous"),S.fetchPriority="high",S.onload=()=>{w(null,S),S.onerror=S.onload=null},S.onerror=()=>{B||w(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.")),S.onerror=S.onload=null},S.src=E,{cancel:()=>{B=!0,S.src=""}}}}(ei||(ei={})),ei.resetRequestQueue(),function(h){h.Glyphs="Glyphs",h.Image="Image",h.Source="Source",h.SpriteImage="SpriteImage",h.SpriteJSON="SpriteJSON",h.Style="Style",h.Tile="Tile",h.Unknown="Unknown"}(Pt||(Pt={}));class ua{constructor(t){this._transformRequestFn=t}transformRequest(t,s){return this._transformRequestFn&&this._transformRequestFn(t,s)||{url:t}}normalizeSpriteURL(t,s,n){const l=function(p){const m=p.match(Tr);if(!m)throw new Error(`Unable to parse URL "${p}"`);return{protocol:m[1],authority:m[2],path:m[3]||"/",params:m[4]?m[4].split("&"):[]}}(t);return l.path+=`${s}${n}`,function(p){const m=p.params.length?`?${p.params.join("&")}`:"";return`${p.protocol}://${p.authority}${p.path}${m}`}(l)}setTransformRequest(t){this._transformRequestFn=t}}const Tr=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Os(h){var t=new c.A(3);return t[0]=h[0],t[1]=h[1],t[2]=h[2],t}var hs,Ki=function(h,t,s){return h[0]=t[0]-s[0],h[1]=t[1]-s[1],h[2]=t[2]-s[2],h};hs=new c.A(3),c.A!=Float32Array&&(hs[0]=0,hs[1]=0,hs[2]=0);var Vs=function(h){var t=h[0],s=h[1];return t*t+s*s};function $t(h){const t=[];if(typeof h=="string")t.push({id:"default",url:h});else if(h&&h.length>0){const s=[];for(const{id:n,url:l}of h){const p=`${n}${l}`;s.indexOf(p)===-1&&(s.push(p),t.push({id:n,url:l}))}}return t}function pa(h,t,s,n,l){if(n)return void h(n);if(l!==Object.values(t).length||l!==Object.values(s).length)return;const p={};for(const m in t){p[m]={};const g=c.h.getImageCanvasContext(s[m]),y=t[m];for(const v in y){const{width:w,height:S,x:E,y:B,sdf:L,pixelRatio:F,stretchX:z,stretchY:G,content:J}=y[v];p[m][v]={data:null,pixelRatio:F,sdf:L,stretchX:z,stretchY:G,content:J,spriteData:{width:w,height:S,x:E,y:B,context:g}}}}h(null,p)}(function(){var h=new c.A(2);c.A!=Float32Array&&(h[0]=0,h[1]=0)})();class mt{constructor(t,s,n,l){this.context=t,this.format=n,this.texture=t.gl.createTexture(),this.update(s,l)}update(t,s,n){const{width:l,height:p}=t,m=!(this.size&&this.size[0]===l&&this.size[1]===p||n),{context:g}=this,{gl:y}=g;if(this.useMipmap=!!(s&&s.useMipmap),y.bindTexture(y.TEXTURE_2D,this.texture),g.pixelStoreUnpackFlipY.set(!1),g.pixelStoreUnpack.set(1),g.pixelStoreUnpackPremultiplyAlpha.set(this.format===y.RGBA&&(!s||s.premultiply!==!1)),m)this.size=[l,p],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||c.a(t)?y.texImage2D(y.TEXTURE_2D,0,this.format,this.format,y.UNSIGNED_BYTE,t):y.texImage2D(y.TEXTURE_2D,0,this.format,l,p,0,this.format,y.UNSIGNED_BYTE,t.data);else{const{x:v,y:w}=n||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||c.a(t)?y.texSubImage2D(y.TEXTURE_2D,0,v,w,y.RGBA,y.UNSIGNED_BYTE,t):y.texSubImage2D(y.TEXTURE_2D,0,v,w,l,p,y.RGBA,y.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&y.generateMipmap(y.TEXTURE_2D)}bind(t,s,n){const{context:l}=this,{gl:p}=l;p.bindTexture(p.TEXTURE_2D,this.texture),n!==p.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(n=p.LINEAR),t!==this.filter&&(p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,t),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,n||t),this.filter=t),s!==this.wrap&&(p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,s),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,s),this.wrap=s)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}function us(h){const{userImage:t}=h;return!!(t&&t.render&&t.render())&&(h.data.replace(new Uint8Array(t.data.buffer)),!0)}class $i extends c.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new c.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:s,callback:n}of this.requestors)this._notify(s,n);this.requestors=[]}}getImage(t){const s=this.images[t];if(s&&!s.data&&s.spriteData){const n=s.spriteData;s.data=new c.R({width:n.width,height:n.height},n.context.getImageData(n.x,n.y,n.width,n.height).data),s.spriteData=null}return s}addImage(t,s){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,s)&&(this.images[t]=s)}_validate(t,s){let n=!0;const l=s.data||s.spriteData;return this._validateStretch(s.stretchX,l&&l.width)||(this.fire(new c.j(new Error(`Image "${t}" has invalid "stretchX" value`))),n=!1),this._validateStretch(s.stretchY,l&&l.height)||(this.fire(new c.j(new Error(`Image "${t}" has invalid "stretchY" value`))),n=!1),this._validateContent(s.content,s)||(this.fire(new c.j(new Error(`Image "${t}" has invalid "content" value`))),n=!1),n}_validateStretch(t,s){if(!t)return!0;let n=0;for(const l of t){if(l[0]<n||l[1]<l[0]||s<l[1])return!1;n=l[1]}return!0}_validateContent(t,s){if(!t)return!0;if(t.length!==4)return!1;const n=s.spriteData,l=n&&n.width||s.data.width,p=n&&n.height||s.data.height;return!(t[0]<0||l<t[0]||t[1]<0||p<t[1]||t[2]<0||l<t[2]||t[3]<0||p<t[3]||t[2]<t[0]||t[3]<t[1])}updateImage(t,s,n=!0){const l=this.getImage(t);if(n&&(l.data.width!==s.data.width||l.data.height!==s.data.height))throw new Error(`size mismatch between old image (${l.data.width}x${l.data.height}) and new image (${s.data.width}x${s.data.height}).`);s.version=l.version+1,this.images[t]=s,this.updatedImages[t]=!0}removeImage(t){const s=this.images[t];delete this.images[t],delete this.patterns[t],s.userImage&&s.userImage.onRemove&&s.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(t,s){let n=!0;if(!this.isLoaded())for(const l of t)this.images[l]||(n=!1);this.isLoaded()||n?this._notify(t,s):this.requestors.push({ids:t,callback:s})}_notify(t,s){const n={};for(const l of t){let p=this.getImage(l);p||(this.fire(new c.k("styleimagemissing",{id:l})),p=this.getImage(l)),p?n[l]={data:p.data.clone(),pixelRatio:p.pixelRatio,sdf:p.sdf,version:p.version,stretchX:p.stretchX,stretchY:p.stretchY,content:p.content,hasRenderCallback:!!(p.userImage&&p.userImage.render)}:c.w(`Image "${l}" 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,n)}getPixelSize(){const{width:t,height:s}=this.atlasImage;return{width:t,height:s}}getPattern(t){const s=this.patterns[t],n=this.getImage(t);if(!n)return null;if(s&&s.position.version===n.version)return s.position;if(s)s.position.version=n.version;else{const l={w:n.data.width+2,h:n.data.height+2,x:0,y:0},p=new c.I(l,n);this.patterns[t]={bin:l,position:p}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){const s=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new mt(t,this.atlasImage,s.RGBA),this.atlasTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE)}_updatePatternAtlas(){const t=[];for(const p in this.patterns)t.push(this.patterns[p].bin);const{w:s,h:n}=c.p(t),l=this.atlasImage;l.resize({width:s||1,height:n||1});for(const p in this.patterns){const{bin:m}=this.patterns[p],g=m.x+1,y=m.y+1,v=this.getImage(p).data,w=v.width,S=v.height;c.R.copy(v,l,{x:0,y:0},{x:g,y},{width:w,height:S}),c.R.copy(v,l,{x:0,y:S-1},{x:g,y:y-1},{width:w,height:1}),c.R.copy(v,l,{x:0,y:0},{x:g,y:y+S},{width:w,height:1}),c.R.copy(v,l,{x:w-1,y:0},{x:g-1,y},{width:1,height:S}),c.R.copy(v,l,{x:0,y:0},{x:g+w,y},{width:1,height:S})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(const s of t){if(this.callbackDispatchedThisFrame[s])continue;this.callbackDispatchedThisFrame[s]=!0;const n=this.getImage(s);n||c.w(`Image with ID: "${s}" was not found`),us(n)&&this.updateImage(s,n)}}}const Ir=1e20;function ti(h,t,s,n,l,p,m,g,y){for(let v=t;v<t+n;v++)vi(h,s*p+v,p,l,m,g,y);for(let v=s;v<s+l;v++)vi(h,v*p+t,1,n,m,g,y)}function vi(h,t,s,n,l,p,m){p[0]=0,m[0]=-Ir,m[1]=Ir,l[0]=h[t];for(let g=1,y=0,v=0;g<n;g++){l[g]=h[t+g*s];const w=g*g;do{const S=p[y];v=(l[g]-l[S]+w-S*S)/(g-S)/2}while(v<=m[y]&&--y>-1);y++,p[y]=g,m[y]=v,m[y+1]=Ir}for(let g=0,y=0;g<n;g++){for(;m[y+1]<g;)y++;const v=p[y],w=g-v;h[t+g*s]=l[v]+w*w}}class cr{constructor(t,s){this.requestManager=t,this.localIdeographFontFamily=s,this.entries={}}setURL(t){this.url=t}getGlyphs(t,s){const n=[];for(const l in t)for(const p of t[l])n.push({stack:l,id:p});c.o(n,({stack:l,id:p},m)=>{let g=this.entries[l];g||(g=this.entries[l]={glyphs:{},requests:{},ranges:{}});let y=g.glyphs[p];if(y!==void 0)return void m(null,{stack:l,id:p,glyph:y});if(y=this._tinySDF(g,l,p),y)return g.glyphs[p]=y,void m(null,{stack:l,id:p,glyph:y});const v=Math.floor(p/256);if(256*v>65535)return void m(new Error("glyphs > 65535 not supported"));if(g.ranges[v])return void m(null,{stack:l,id:p,glyph:y});if(!this.url)return void m(new Error("glyphsUrl is not set"));let w=g.requests[v];w||(w=g.requests[v]=[],cr.loadGlyphRange(l,v,this.url,this.requestManager,(S,E)=>{if(E){for(const B in E)this._doesCharSupportLocalGlyph(+B)||(g.glyphs[+B]=E[+B]);g.ranges[v]=!0}for(const B of w)B(S,E);delete g.requests[v]})),w.push((S,E)=>{S?m(S):E&&m(null,{stack:l,id:p,glyph:E[p]||null})})},(l,p)=>{if(l)s(l);else if(p){const m={};for(const{stack:g,id:y,glyph:v}of p)(m[g]||(m[g]={}))[y]=v&&{id:v.id,bitmap:v.bitmap.clone(),metrics:v.metrics};s(null,m)}})}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&(c.u["CJK Unified Ideographs"](t)||c.u["Hangul Syllables"](t)||c.u.Hiragana(t)||c.u.Katakana(t))}_tinySDF(t,s,n){const l=this.localIdeographFontFamily;if(!l||!this._doesCharSupportLocalGlyph(n))return;let p=t.tinySDF;if(!p){let g="400";/bold/i.test(s)?g="900":/medium/i.test(s)?g="500":/light/i.test(s)&&(g="200"),p=t.tinySDF=new cr.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:l,fontWeight:g})}const m=p.draw(String.fromCharCode(n));return{id:n,bitmap:new c.q({width:m.width||60,height:m.height||60},m.data),metrics:{width:m.glyphWidth/2||24,height:m.glyphHeight/2||24,left:m.glyphLeft/2+.5||0,top:m.glyphTop/2-27.5||-8,advance:m.glyphAdvance/2||24,isDoubleResolution:!0}}}}cr.loadGlyphRange=function(h,t,s,n,l){const p=256*t,m=p+255,g=n.transformRequest(s.replace("{fontstack}",h).replace("{range}",`${p}-${m}`),Pt.Glyphs);c.l(g,(y,v)=>{if(y)l(y);else if(v){const w={};for(const S of c.n(v))w[S.id]=S;l(null,w)}})},cr.TinySDF=class{constructor({fontSize:h=24,buffer:t=3,radius:s=8,cutoff:n=.25,fontFamily:l="sans-serif",fontWeight:p="normal",fontStyle:m="normal"}={}){this.buffer=t,this.cutoff=n,this.radius=s;const g=this.size=h+4*t,y=this._createCanvas(g),v=this.ctx=y.getContext("2d",{willReadFrequently:!0});v.font=`${m} ${p} ${h}px ${l}`,v.textBaseline="alphabetic",v.textAlign="left",v.fillStyle="black",this.gridOuter=new Float64Array(g*g),this.gridInner=new Float64Array(g*g),this.f=new Float64Array(g),this.z=new Float64Array(g+1),this.v=new Uint16Array(g)}_createCanvas(h){const t=document.createElement("canvas");return t.width=t.height=h,t}draw(h){const{width:t,actualBoundingBoxAscent:s,actualBoundingBoxDescent:n,actualBoundingBoxLeft:l,actualBoundingBoxRight:p}=this.ctx.measureText(h),m=Math.ceil(s),g=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(p-l))),y=Math.min(this.size-this.buffer,m+Math.ceil(n)),v=g+2*this.buffer,w=y+2*this.buffer,S=Math.max(v*w,0),E=new Uint8ClampedArray(S),B={data:E,width:v,height:w,glyphWidth:g,glyphHeight:y,glyphTop:m,glyphLeft:0,glyphAdvance:t};if(g===0||y===0)return B;const{ctx:L,buffer:F,gridInner:z,gridOuter:G}=this;L.clearRect(F,F,g,y),L.fillText(h,F,F+m);const J=L.getImageData(F,F,g,y);G.fill(Ir,0,S),z.fill(0,0,S);for(let U=0;U<y;U++)for(let X=0;X<g;X++){const ee=J.data[4*(U*g+X)+3]/255;if(ee===0)continue;const te=(U+F)*v+X+F;if(ee===1)G[te]=0,z[te]=Ir;else{const ne=.5-ee;G[te]=ne>0?ne*ne:0,z[te]=ne<0?ne*ne:0}}ti(G,0,0,v,w,v,this.f,this.v,this.z),ti(z,F,F,g,y,v,this.f,this.v,this.z);for(let U=0;U<S;U++){const X=Math.sqrt(G[U])-Math.sqrt(z[U]);E[U]=Math.round(255-255*(X/this.radius+this.cutoff))}return B}};class ki{constructor(){this.specification=c.v.light.position}possiblyEvaluate(t,s){return c.z(t.expression.evaluate(s))}interpolate(t,s,n){return{x:c.B.number(t.x,s.x,n),y:c.B.number(t.y,s.y,n),z:c.B.number(t.z,s.z,n)}}}let Nr;class Ns extends c.E{constructor(t){super(),Nr=Nr||new c.r({anchor:new c.D(c.v.light.anchor),position:new ki,color:new c.D(c.v.light.color),intensity:new c.D(c.v.light.intensity)}),this._transitionable=new c.T(Nr),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,s={}){if(!this._validate(c.t,t,s))for(const n in t){const l=t[n];n.endsWith("-transition")?this._transitionable.setTransition(n.slice(0,-11),l):this._transitionable.setValue(n,l)}}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,s,n){return(!n||n.validate!==!1)&&c.x(this,t.call(c.y,c.e({value:s,style:{glyphs:!0,sprite:!0},styleSpec:c.v})))}}class da{constructor(t,s){this.width=t,this.height=s,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(t,s){const n=t.join(",")+String(s);return this.dashEntry[n]||(this.dashEntry[n]=this.addDash(t,s)),this.dashEntry[n]}getDashRanges(t,s,n){const l=[];let p=t.length%2==1?-t[t.length-1]*n:0,m=t[0]*n,g=!0;l.push({left:p,right:m,isDash:g,zeroLength:t[0]===0});let y=t[0];for(let v=1;v<t.length;v++){g=!g;const w=t[v];p=y*n,y+=w,m=y*n,l.push({left:p,right:m,isDash:g,zeroLength:w===0})}return l}addRoundDash(t,s,n){const l=s/2;for(let p=-n;p<=n;p++){const m=this.width*(this.nextRow+n+p);let g=0,y=t[g];for(let v=0;v<this.width;v++){v/y.right>1&&(y=t[++g]);const w=Math.abs(v-y.left),S=Math.abs(v-y.right),E=Math.min(w,S);let B;const L=p/n*(l+1);if(y.isDash){const F=l-Math.abs(L);B=Math.sqrt(E*E+F*F)}else B=l-Math.sqrt(E*E+L*L);this.data[m+v]=Math.max(0,Math.min(255,B+128))}}}addRegularDash(t){for(let g=t.length-1;g>=0;--g){const y=t[g],v=t[g+1];y.zeroLength?t.splice(g,1):v&&v.isDash===y.isDash&&(v.left=y.left,t.splice(g,1))}const s=t[0],n=t[t.length-1];s.isDash===n.isDash&&(s.left=n.left-this.width,n.right=s.right+this.width);const l=this.width*this.nextRow;let p=0,m=t[p];for(let g=0;g<this.width;g++){g/m.right>1&&(m=t[++p]);const y=Math.abs(g-m.left),v=Math.abs(g-m.right),w=Math.min(y,v);this.data[l+g]=Math.max(0,Math.min(255,(m.isDash?w:-w)+128))}}addDash(t,s){const n=s?7:0,l=2*n+1;if(this.nextRow+l>this.height)return c.w("LineAtlas out of space"),null;let p=0;for(let g=0;g<t.length;g++)p+=t[g];if(p!==0){const g=this.width/p,y=this.getDashRanges(t,this.width,g);s?this.addRoundDash(y,g,n):this.addRegularDash(y)}const m={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:p};return this.nextRow+=l,this.dirty=!0,m}bind(t){const s=t.gl;this.texture?(s.bindTexture(s.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,s.texSubImage2D(s.TEXTURE_2D,0,0,0,this.width,this.height,s.ALPHA,s.UNSIGNED_BYTE,this.data))):(this.texture=s.createTexture(),s.bindTexture(s.TEXTURE_2D,this.texture),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.REPEAT),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.REPEAT),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.LINEAR),s.texImage2D(s.TEXTURE_2D,0,s.ALPHA,this.width,this.height,0,s.ALPHA,s.UNSIGNED_BYTE,this.data))}}class Us{constructor(t,s,n){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=n;const l=this.workerPool.acquire(n);for(let p=0;p<l.length;p++){const m=new c.C(l[p],s,n);m.name=`Worker ${p}`,this.actors.push(m)}if(!this.actors.length)throw new Error("No actors found")}broadcast(t,s,n){c.o(this.actors,(l,p)=>{l.send(t,s,p)},n=n||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){this.actors.forEach(s=>{s.remove()}),this.actors=[],t&&this.workerPool.release(this.id)}}function Yi(h,t,s){const n=function(l,p){if(l)return s(l);if(p){const m=c.F(c.e(p,h),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);p.vector_layers&&(m.vectorLayers=p.vector_layers,m.vectorLayerIds=m.vectorLayers.map(g=>g.id)),s(null,m)}};return h.url?c.f(t.transformRequest(h.url,Pt.Source),n):c.h.frame(()=>n(null,h))}class ct{constructor(t,s){t&&(s?this.setSouthWest(t).setNorthEast(s):Array.isArray(t)&&(t.length===4?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof c.L?new c.L(t.lng,t.lat):c.L.convert(t),this}setSouthWest(t){return this._sw=t instanceof c.L?new c.L(t.lng,t.lat):c.L.convert(t),this}extend(t){const s=this._sw,n=this._ne;let l,p;if(t instanceof c.L)l=t,p=t;else{if(!(t instanceof ct))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(ct.convert(t)):this.extend(c.L.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(c.L.convert(t)):this;if(l=t._sw,p=t._ne,!l||!p)return this}return s||n?(s.lng=Math.min(l.lng,s.lng),s.lat=Math.min(l.lat,s.lat),n.lng=Math.max(p.lng,n.lng),n.lat=Math.max(p.lat,n.lat)):(this._sw=new c.L(l.lng,l.lat),this._ne=new c.L(p.lng,p.lat)),this}getCenter(){return new c.L((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new c.L(this.getWest(),this.getNorth())}getSouthEast(){return new c.L(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(t){const{lng:s,lat:n}=c.L.convert(t);let l=this._sw.lng<=s&&s<=this._ne.lng;return this._sw.lng>this._ne.lng&&(l=this._sw.lng>=s&&s>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&l}static convert(t){return t instanceof ct?t:t&&new ct(t)}static fromLngLat(t,s=0){const n=360*s/40075017,l=n/Math.cos(Math.PI/180*t.lat);return new ct(new c.L(t.lng-l,t.lat-n),new c.L(t.lng+l,t.lat+n))}}class hi{constructor(t,s,n){this.bounds=ct.convert(this.validateBounds(t)),this.minzoom=s||0,this.maxzoom=n||24}validateBounds(t){return Array.isArray(t)&&t.length===4?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){const s=Math.pow(2,t.z),n=Math.floor(c.G(this.bounds.getWest())*s),l=Math.floor(c.H(this.bounds.getNorth())*s),p=Math.ceil(c.G(this.bounds.getEast())*s),m=Math.ceil(c.H(this.bounds.getSouth())*s);return t.x>=n&&t.x<p&&t.y>=l&&t.y<m}}class Ur extends c.E{constructor(t,s,n,l){if(super(),this.load=()=>{this._loaded=!1,this.fire(new c.k("dataloading",{dataType:"source"})),this._tileJSONRequest=Yi(this._options,this.map._requestManager,(p,m)=>{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),p?this.fire(new c.j(p)):m&&(c.e(this,m),m.bounds&&(this.tileBounds=new hi(m.bounds,this.minzoom,this.maxzoom)),this.fire(new c.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new c.k("data",{dataType:"source",sourceDataType:"content"})))})},this.serialize=()=>c.e({},this._options),this.id=t,this.dispatcher=n,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,c.e(this,c.F(s,["url","scheme","tileSize","promoteId"])),this._options=c.e({type:"vector"},s),this._collectResourceTiming=s.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(l)}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}loadTile(t,s){const n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),l={request:this.map._requestManager.transformRequest(n,Pt.Tile),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function p(m,g){return delete t.request,t.aborted?s(null):m&&m.status!==404?s(m):(g&&g.resourceTiming&&(t.resourceTiming=g.resourceTiming),this.map._refreshExpiredTiles&&g&&t.setExpiryData(g),t.loadVectorData(g,this.map.painter),s(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}l.request.collectResourceTiming=this._collectResourceTiming,t.actor&&t.state!=="expired"?t.state==="loading"?t.reloadCallback=s:t.request=t.actor.send("reloadTile",l,p.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",l,p.bind(this)))}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)}unloadTile(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class ps extends c.E{constructor(t,s,n,l){super(),this.id=t,this.dispatcher=n,this.setEventedParent(l),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=c.e({type:"raster"},s),c.e(this,c.F(s,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new c.k("dataloading",{dataType:"source"})),this._tileJSONRequest=Yi(this._options,this.map._requestManager,(t,s)=>{this._tileJSONRequest=null,this._loaded=!0,t?this.fire(new c.j(t)):s&&(c.e(this,s),s.bounds&&(this.tileBounds=new hi(s.bounds,this.minzoom,this.maxzoom)),this.fire(new c.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new c.k("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}serialize(){return c.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t,s){const n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.request=ei.getImage(this.map._requestManager.transformRequest(n,Pt.Tile),(l,p,m)=>{if(delete t.request,t.aborted)t.state="unloaded",s(null);else if(l)t.state="errored",s(l);else if(p){this.map._refreshExpiredTiles&&m&&t.setExpiryData(m);const g=this.map.painter.context,y=g.gl;t.texture=this.map.painter.getTileTexture(p.width),t.texture?t.texture.update(p,{useMipmap:!0}):(t.texture=new mt(g,p,y.RGBA,{useMipmap:!0}),t.texture.bind(y.LINEAR,y.CLAMP_TO_EDGE,y.LINEAR_MIPMAP_NEAREST),g.extTextureFilterAnisotropic&&y.texParameterf(y.TEXTURE_2D,g.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,g.extTextureFilterAnisotropicMax)),t.state="loaded",s(null)}},this.map._refreshExpiredTiles)}abortTile(t,s){t.request&&(t.request.cancel(),delete t.request),s()}unloadTile(t,s){t.texture&&this.map.painter.saveTileTexture(t.texture),s()}hasTransition(){return!1}}class ds extends ps{constructor(t,s,n,l){super(t,s,n,l),this.type="raster-dem",this.maxzoom=22,this._options=c.e({type:"raster-dem"},s),this.encoding=s.encoding||"mapbox",this.redFactor=s.redFactor,this.greenFactor=s.greenFactor,this.blueFactor=s.blueFactor,this.baseShift=s.baseShift}loadTile(t,s){const n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),l=this.map._requestManager.transformRequest(n,Pt.Tile);function p(m,g){m&&(t.state="errored",s(m)),g&&(t.dem=g,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded",s(null))}t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.request=ei.getImage(l,(m,g,y)=>c._(this,void 0,void 0,function*(){if(delete t.request,t.aborted)t.state="unloaded",s(null);else if(m)t.state="errored",s(m);else if(g){this.map._refreshExpiredTiles&&t.setExpiryData(y);const v=c.a(g)&&c.J()?g:yield function(S){return c._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&c.K()){const E=S.width+2,B=S.height+2;try{return new c.R({width:E,height:B},yield c.M(S,-1,-1,E,B))}catch{}}return c.h.getImageData(S,1)})}(g),w={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:v,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};t.actor&&t.state!=="expired"||(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",w,p))}}),this.map._refreshExpiredTiles)}_getNeighboringTiles(t){const s=t.canonical,n=Math.pow(2,s.z),l=(s.x-1+n)%n,p=s.x===0?t.wrap-1:t.wrap,m=(s.x+1+n)%n,g=s.x+1===n?t.wrap+1:t.wrap,y={};return y[new c.O(t.overscaledZ,p,s.z,l,s.y).key]={backfilled:!1},y[new c.O(t.overscaledZ,g,s.z,m,s.y).key]={backfilled:!1},s.y>0&&(y[new c.O(t.overscaledZ,p,s.z,l,s.y-1).key]={backfilled:!1},y[new c.O(t.overscaledZ,t.wrap,s.z,s.x,s.y-1).key]={backfilled:!1},y[new c.O(t.overscaledZ,g,s.z,m,s.y-1).key]={backfilled:!1}),s.y+1<n&&(y[new c.O(t.overscaledZ,p,s.z,l,s.y+1).key]={backfilled:!1},y[new c.O(t.overscaledZ,t.wrap,s.z,s.x,s.y+1).key]={backfilled:!1},y[new c.O(t.overscaledZ,g,s.z,m,s.y+1).key]={backfilled:!1}),y}unloadTile(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id})}}class Ar extends c.E{constructor(t,s,n,l){super(),this.load=()=>{this._updateWorkerData()},this.serialize=()=>c.e({},this._options,{type:this.type,data:this._data}),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=n.getActor(),this.setEventedParent(l),this._data=s.data,this._options=c.e({},s),this._collectResourceTiming=s.collectResourceTiming,s.maxzoom!==void 0&&(this.maxzoom=s.maxzoom),s.type&&(this.type=s.type),s.attribution&&(this.attribution=s.attribution),this.promoteId=s.promoteId;const p=c.N/this.tileSize;this.workerOptions=c.e({source:this.id,cluster:s.cluster||!1,geojsonVtOptions:{buffer:(s.buffer!==void 0?s.buffer:128)*p,tolerance:(s.tolerance!==void 0?s.tolerance:.375)*p,extent:c.N,maxZoom:this.maxzoom,lineMetrics:s.lineMetrics||!1,generateId:s.generateId||!1},superclusterOptions:{maxZoom:s.clusterMaxZoom!==void 0?s.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,s.clusterMinPoints||2),extent:c.N,radius:(s.clusterRadius||50)*p,log:!1,generateId:s.generateId||!1},clusterProperties:s.clusterProperties,filter:s.filter},s.workerOptions),typeof this.promoteId=="string"&&(this.workerOptions.promoteId=this.promoteId)}onAdd(t){this.map=t,this.load()}setData(t){return this._data=t,this._updateWorkerData(),this}updateData(t){return this._updateWorkerData(t),this}setClusterOptions(t){return this.workerOptions.cluster=t.cluster,t&&(t.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=t.clusterRadius),t.clusterMaxZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=t.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(t,s){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},s),this}getClusterChildren(t,s){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},s),this}getClusterLeaves(t,s,n,l){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:s,offset:n},l),this}_updateWorkerData(t){const s=c.e({},this.workerOptions);t?s.dataDiff=t:typeof this._data=="string"?(s.request=this.map._requestManager.transformRequest(c.h.resolveURL(this._data),Pt.Source),s.request.collectResourceTiming=this._collectResourceTiming):s.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new c.k("dataloading",{dataType:"source"})),this.actor.send(`${this.type}.loadData`,s,(n,l)=>{if(this._pendingLoads--,this._removed||l&&l.abandoned)return void this.fire(new c.k("dataabort",{dataType:"source"}));let p=null;if(l&&l.resourceTiming&&l.resourceTiming[this.id]&&(p=l.resourceTiming[this.id].slice(0)),n)return void this.fire(new c.j(n));const m={dataType:"source"};this._collectResourceTiming&&p&&p.length>0&&c.e(m,{resourceTiming:p}),this.fire(new c.k("data",Object.assign(Object.assign({},m),{sourceDataType:"metadata"}))),this.fire(new c.k("data",Object.assign(Object.assign({},m),{sourceDataType:"content"})))})}loaded(){return this._pendingLoads===0}loadTile(t,s){const n=t.actor?"reloadTile":"loadTile";t.actor=this.actor;const l={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.request=this.actor.send(n,l,(p,m)=>(delete t.request,t.unloadVectorData(),t.aborted?s(null):p?s(p):(t.loadVectorData(m,this.map.painter,n==="reloadTile"),s(null))))}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0}unloadTile(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}hasTransition(){return!1}}var ji=c.Q([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class zi extends c.E{constructor(t,s,n,l){super(),this.load=(p,m)=>{this._loaded=!1,this.fire(new c.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=ei.getImage(this.map._requestManager.transformRequest(this.url,Pt.Image),(g,y)=>{this._request=null,this._loaded=!0,g?this.fire(new c.j(g)):y&&(this.image=y,p&&(this.coordinates=p),m&&m(),this._finishLoading())})},this.prepare=()=>{if(Object.keys(this.tiles).length===0||!this.image)return;const p=this.map.painter.context,m=p.gl;this.boundsBuffer||(this.boundsBuffer=p.createVertexBuffer(this._boundsArray,ji.members)),this.boundsSegments||(this.boundsSegments=c.S.simpleSegment(0,0,4,2)),this.texture||(this.texture=new mt(p,this.image,m.RGBA),this.texture.bind(m.LINEAR,m.CLAMP_TO_EDGE));let g=!1;for(const y in this.tiles){const v=this.tiles[y];v.state!=="loaded"&&(v.state="loaded",v.texture=this.texture,g=!0)}g&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"image",url:this.options.url,coordinates:this.coordinates}),this.id=t,this.dispatcher=n,this.coordinates=s.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(l),this.options=s}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.cancel(),this._request=null),this.options.url=t.url,this.load(t.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new c.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.cancel(),this._request=null)}setCoordinates(t){this.coordinates=t;const s=t.map(c.U.fromLngLat);this.tileID=function(l){let p=1/0,m=1/0,g=-1/0,y=-1/0;for(const E of l)p=Math.min(p,E.x),m=Math.min(m,E.y),g=Math.max(g,E.x),y=Math.max(y,E.y);const v=Math.max(g-p,y-m),w=Math.max(0,Math.floor(-Math.log(v)/Math.LN2)),S=Math.pow(2,w);return new c.W(w,Math.floor((p+g)/2*S),Math.floor((m+y)/2*S))}(s),this.minzoom=this.maxzoom=this.tileID.z;const n=s.map(l=>this.tileID.getTilePoint(l)._round());return this._boundsArray=new c.V,this._boundsArray.emplaceBack(n[0].x,n[0].y,0,0),this._boundsArray.emplaceBack(n[1].x,n[1].y,c.N,0),this._boundsArray.emplaceBack(n[3].x,n[3].y,0,c.N),this._boundsArray.emplaceBack(n[2].x,n[2].y,c.N,c.N),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new c.k("data",{dataType:"source",sourceDataType:"content"})),this}loadTile(t,s){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},s(null)):(t.state="errored",s(null))}hasTransition(){return!1}}class $s extends zi{constructor(t,s,n,l){super(t,s,n,l),this.load=()=>{this._loaded=!1;const p=this.options;this.urls=[];for(const m of p.urls)this.urls.push(this.map._requestManager.transformRequest(m,Pt.Source).url);c.X(this.urls,(m,g)=>{this._loaded=!0,m?this.fire(new c.j(m)):g&&(this.video=g,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})},this.prepare=()=>{if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const p=this.map.painter.context,m=p.gl;this.boundsBuffer||(this.boundsBuffer=p.createVertexBuffer(this._boundsArray,ji.members)),this.boundsSegments||(this.boundsSegments=c.S.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(m.LINEAR,m.CLAMP_TO_EDGE),m.texSubImage2D(m.TEXTURE_2D,0,0,0,m.RGBA,m.UNSIGNED_BYTE,this.video)):(this.texture=new mt(p,this.video,m.RGBA),this.texture.bind(m.LINEAR,m.CLAMP_TO_EDGE));let g=!1;for(const y in this.tiles){const v=this.tiles[y];v.state!=="loaded"&&(v.state="loaded",v.texture=this.texture,g=!0)}g&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"video",urls:this.urls,coordinates:this.coordinates}),this.roundZoom=!0,this.type="video",this.options=s}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const s=this.video.seekable;t<s.start(0)||t>s.end(0)?this.fire(new c.j(new c.Y(`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=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}hasTransition(){return this.video&&!this.video.paused}}class Mr extends zi{constructor(t,s,n,l){super(t,s,n,l),this.load=()=>{this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new c.j(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())},this.prepare=()=>{let p=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,p=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,p=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const m=this.map.painter.context,g=m.gl;this.boundsBuffer||(this.boundsBuffer=m.createVertexBuffer(this._boundsArray,ji.members)),this.boundsSegments||(this.boundsSegments=c.S.simpleSegment(0,0,4,2)),this.texture?(p||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new mt(m,this.canvas,g.RGBA,{premultiply:!0});let y=!1;for(const v in this.tiles){const w=this.tiles[v];w.state!=="loaded"&&(w.state="loaded",w.texture=this.texture,y=!0)}y&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"canvas",coordinates:this.coordinates}),s.coordinates?Array.isArray(s.coordinates)&&s.coordinates.length===4&&!s.coordinates.some(p=>!Array.isArray(p)||p.length!==2||p.some(m=>typeof m!="number"))||this.fire(new c.j(new c.Y(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new c.j(new c.Y(`sources.${t}`,null,'missing required property "coordinates"'))),s.animate&&typeof s.animate!="boolean"&&this.fire(new c.j(new c.Y(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),s.canvas?typeof s.canvas=="string"||s.canvas instanceof HTMLCanvasElement||this.fire(new c.j(new c.Y(`sources.${t}`,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 c.j(new c.Y(`sources.${t}`,null,'missing required property "canvas"'))),this.options=s,this.animate=s.animate===void 0||s.animate}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}const js={},hr=h=>{switch(h){case"geojson":return Ar;case"image":return zi;case"raster":return ps;case"raster-dem":return ds;case"vector":return Ur;case"video":return $s;case"canvas":return Mr}return js[h]};function fs(h,t){const s=c.Z();return c.$(s,s,[1,1,0]),c.a0(s,s,[.5*h.width,.5*h.height,1]),c.a1(s,s,h.calculatePosMatrix(t.toUnwrapped()))}function $r(h,t,s,n,l,p){const m=function(S,E,B){if(S)for(const L of S){const F=E[L];if(F&&F.source===B&&F.type==="fill-extrusion")return!0}else for(const L in E){const F=E[L];if(F.source===B&&F.type==="fill-extrusion")return!0}return!1}(l&&l.layers,t,h.id),g=p.maxPitchScaleFactor(),y=h.tilesIn(n,g,m);y.sort(Er);const v=[];for(const S of y)v.push({wrappedTileID:S.tileID.wrapped().key,queryResults:S.tile.queryRenderedFeatures(t,s,h._state,S.queryGeometry,S.cameraQueryGeometry,S.scale,l,p,g,fs(h.transform,S.tileID))});const w=function(S){const E={},B={};for(const L of S){const F=L.queryResults,z=L.wrappedTileID,G=B[z]=B[z]||{};for(const J in F){const U=F[J],X=G[J]=G[J]||{},ee=E[J]=E[J]||[];for(const te of U)X[te.featureIndex]||(X[te.featureIndex]=!0,ee.push(te))}}return E}(v);for(const S in w)w[S].forEach(E=>{const B=E.feature,L=h.getFeatureState(B.layer["source-layer"],B.id);B.source=B.layer.source,B.layer["source-layer"]&&(B.sourceLayer=B.layer["source-layer"]),B.state=L});return w}function Er(h,t){const s=h.tileID,n=t.tileID;return s.overscaledZ-n.overscaledZ||s.canonical.y-n.canonical.y||s.wrap-n.wrap||s.canonical.x-n.canonical.x}class Cr{constructor(t,s){this.timeAdded=0,this.fadeEndTime=0,this.tileID=t,this.uid=c.a2(),this.uses=0,this.tileSize=s,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(t){const s=t+this.timeAdded;s<this.fadeEndTime||(this.fadeEndTime=s)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(t){this.demTexture&&t.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(t,s,n){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(l,p){const m={};if(!p)return m;for(const g of l){const y=g.layerIds.map(v=>p.getLayer(v)).filter(Boolean);if(y.length!==0){g.layers=y,g.stateDependentLayerIds&&(g.stateDependentLayers=g.stateDependentLayerIds.map(v=>y.filter(w=>w.id===v)[0]));for(const v of y)m[v.id]=g}}return m}(t.buckets,s.style),this.hasSymbolBuckets=!1;for(const l in this.buckets){const p=this.buckets[l];if(p instanceof c.a4){if(this.hasSymbolBuckets=!0,!n)break;p.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const l in this.buckets){const p=this.buckets[l];if(p instanceof c.a4&&p.hasRTLText){this.hasRTLText=!0,c.a5();break}}this.queryPadding=0;for(const l in this.buckets){const p=this.buckets[l];this.queryPadding=Math.max(this.queryPadding,s.style.getLayer(l).queryRadius(p))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new c.a3}unloadVectorData(){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(const n in this.buckets){const l=this.buckets[n];l.uploadPending()&&l.upload(t)}const s=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new mt(t,this.imageAtlas.image,s.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new mt(t,this.glyphAtlasImage,s.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,s,n,l,p,m,g,y,v,w){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:l,cameraQueryGeometry:p,scale:m,tileSize:this.tileSize,pixelPosMatrix:w,transform:y,params:g,queryPadding:this.queryPadding*v},t,s,n):{}}querySourceFeatures(t,s){const n=this.latestFeatureIndex;if(!n||!n.rawTileData)return;const l=n.loadVTLayers(),p=s&&s.sourceLayer?s.sourceLayer:"",m=l._geojsonTileLayer||l[p];if(!m)return;const g=c.a6(s&&s.filter),{z:y,x:v,y:w}=this.tileID.canonical,S={z:y,x:v,y:w};for(let E=0;E<m.length;E++){const B=m.feature(E);if(g.needGeometry){const z=c.a7(B,!0);if(!g.filter(new c.a8(this.tileID.overscaledZ),z,this.tileID.canonical))continue}else if(!g.filter(new c.a8(this.tileID.overscaledZ),B))continue;const L=n.getId(B,p),F=new c.a9(B,y,v,w,L);F.tile=S,t.push(F)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){const s=this.expirationTime;if(t.cacheControl){const n=c.aa(t.cacheControl);n["max-age"]&&(this.expirationTime=Date.now()+1e3*n["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){const n=Date.now();let l=!1;if(this.expirationTime>n)l=!1;else if(s)if(this.expirationTime<s)l=!0;else{const p=this.expirationTime-s;p?this.expirationTime=n+Math.max(p,3e4):l=!0}else l=!0;l?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){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)}setFeatureState(t,s){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(t).length===0)return;const n=this.latestFeatureIndex.loadVTLayers();for(const l in this.buckets){if(!s.style.hasLayer(l))continue;const p=this.buckets[l],m=p.layers[0].sourceLayer||"_geojsonTileLayer",g=n[m],y=t[m];if(!g||!y||Object.keys(y).length===0)continue;p.update(y,g,this.imageAtlas&&this.imageAtlas.patternPositions||{});const v=s&&s.style&&s.style.getLayer(l);v&&(this.queryPadding=Math.max(this.queryPadding,v.queryRadius(p)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<c.h.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(t){this.symbolFadeHoldUntil=c.h.now()+t}setDependencies(t,s){const n={};for(const l of s)n[l]=!0;this.dependencies[t]=n}hasDependency(t,s){for(const n of t){const l=this.dependencies[n];if(l){for(const p of s)if(l[p])return!0}}return!1}}class jr{constructor(t,s){this.max=t,this.onRemove=s,this.reset()}reset(){for(const t in this.data)for(const s of this.data[t])s.timeout&&clearTimeout(s.timeout),this.onRemove(s.value);return this.data={},this.order=[],this}add(t,s,n){const l=t.wrapped().key;this.data[l]===void 0&&(this.data[l]=[]);const p={value:s,timeout:void 0};if(n!==void 0&&(p.timeout=setTimeout(()=>{this.remove(t,p)},n)),this.data[l].push(p),this.order.push(l),this.order.length>this.max){const m=this._getAndRemoveByKey(this.order[0]);m&&this.onRemove(m)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){const s=this.data[t].shift();return s.timeout&&clearTimeout(s.timeout),this.data[t].length===0&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),s.value}getByKey(t){const s=this.data[t];return s?s[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,s){if(!this.has(t))return this;const n=t.wrapped().key,l=s===void 0?0:this.data[n].indexOf(s),p=this.data[n][l];return this.data[n].splice(l,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}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const s=this._getAndRemoveByKey(this.order[0]);s&&this.onRemove(s)}return this}filter(t){const s=[];for(const n in this.data)for(const l of this.data[n])t(l.value)||s.push(l);for(const n of s)this.remove(n.value.tileID,n)}}class re{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,s,n){const l=String(s);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][l]=this.stateChanges[t][l]||{},c.e(this.stateChanges[t][l],n),this.deletedStates[t]===null){this.deletedStates[t]={};for(const p in this.state[t])p!==l&&(this.deletedStates[t][p]=null)}else if(this.deletedStates[t]&&this.deletedStates[t][l]===null){this.deletedStates[t][l]={};for(const p in this.state[t][l])n[p]||(this.deletedStates[t][l][p]=null)}else for(const p in n)this.deletedStates[t]&&this.deletedStates[t][l]&&this.deletedStates[t][l][p]===null&&delete this.deletedStates[t][l][p]}removeFeatureState(t,s,n){if(this.deletedStates[t]===null)return;const l=String(s);if(this.deletedStates[t]=this.deletedStates[t]||{},n&&s!==void 0)this.deletedStates[t][l]!==null&&(this.deletedStates[t][l]=this.deletedStates[t][l]||{},this.deletedStates[t][l][n]=null);else if(s!==void 0)if(this.stateChanges[t]&&this.stateChanges[t][l])for(n in this.deletedStates[t][l]={},this.stateChanges[t][l])this.deletedStates[t][l][n]=null;else this.deletedStates[t][l]=null;else this.deletedStates[t]=null}getState(t,s){const n=String(s),l=c.e({},(this.state[t]||{})[n],(this.stateChanges[t]||{})[n]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){const p=this.deletedStates[t][s];if(p===null)return{};for(const m in p)delete l[m]}return l}initializeTileState(t,s){t.setFeatureState(this.state,s)}coalesceChanges(t,s){const n={};for(const l in this.stateChanges){this.state[l]=this.state[l]||{};const p={};for(const m in this.stateChanges[l])this.state[l][m]||(this.state[l][m]={}),c.e(this.state[l][m],this.stateChanges[l][m]),p[m]=this.state[l][m];n[l]=p}for(const l in this.deletedStates){this.state[l]=this.state[l]||{};const p={};if(this.deletedStates[l]===null)for(const m in this.state[l])p[m]={},this.state[l][m]={};else for(const m in this.deletedStates[l]){if(this.deletedStates[l][m]===null)this.state[l][m]={};else for(const g of Object.keys(this.deletedStates[l][m]))delete this.state[l][m][g];p[m]=this.state[l][m]}n[l]=n[l]||{},c.e(n[l],p)}if(this.stateChanges={},this.deletedStates={},Object.keys(n).length!==0)for(const l in t)t[l].setFeatureState(n,s)}}class ui extends c.E{constructor(t,s,n){super(),this.id=t,this.dispatcher=n,this.on("data",l=>{l.dataType==="source"&&l.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&l.dataType==="source"&&l.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((l,p,m,g)=>{const y=new(hr(p.type))(l,p,m,g);if(y.id!==l)throw new Error(`Expected Source id to be ${l} instead of ${y.id}`);return y})(t,s,n,this),this._tiles={},this._cache=new jr(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new re,this._didEmitContent=!1,this._updated=!1}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const t in this._tiles){const s=this._tiles[t];if(s.state!=="loaded"&&s.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,s){return this._source.loadTile(t,s)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t,()=>{})}_abortTile(t){this._source.abortTile&&this._source.abortTile(t,()=>{}),this._source.fire(new c.k("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const s in this._tiles){const n=this._tiles[s];n.upload(t),n.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(t=>t.tileID).sort(Di).map(t=>t.key)}getRenderableIds(t){const s=[];for(const n in this._tiles)this._isIdRenderable(n,t)&&s.push(this._tiles[n]);return t?s.sort((n,l)=>{const p=n.tileID,m=l.tileID,g=new c.P(p.canonical.x,p.canonical.y)._rotate(this.transform.angle),y=new c.P(m.canonical.x,m.canonical.y)._rotate(this.transform.angle);return p.overscaledZ-m.overscaledZ||y.y-g.y||y.x-g.x}).map(n=>n.tileID.key):s.map(n=>n.tileID).sort(Di).map(n=>n.key)}hasRenderableParent(t){const s=this.findLoadedParent(t,0);return!!s&&this._isIdRenderable(s.tileID.key)}_isIdRenderable(t,s){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(s||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const t in this._tiles)this._tiles[t].state!=="errored"&&this._reloadTile(t,"reloading")}}_reloadTile(t,s){const n=this._tiles[t];n&&(n.state!=="loading"&&(n.state=s),this._loadTile(n,this._tileLoaded.bind(this,n,t,s)))}_tileLoaded(t,s,n,l){if(l)return t.state="errored",void(l.status!==404?this._source.fire(new c.j(l,{tile:t})):this.update(this.transform,this.terrain));t.timeAdded=c.h.now(),n==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(s,t),this.getSource().type==="raster-dem"&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new c.k("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){const s=this.getRenderableIds();for(let l=0;l<s.length;l++){const p=s[l];if(t.neighboringTiles&&t.neighboringTiles[p]){const m=this.getTileByID(p);n(t,m),n(m,t)}}function n(l,p){l.needsHillshadePrepare=!0,l.needsTerrainPrepare=!0;let m=p.tileID.canonical.x-l.tileID.canonical.x;const g=p.tileID.canonical.y-l.tileID.canonical.y,y=Math.pow(2,l.tileID.canonical.z),v=p.tileID.key;m===0&&g===0||Math.abs(g)>1||(Math.abs(m)>1&&(Math.abs(m+y)===1?m+=y:Math.abs(m-y)===1&&(m-=y)),p.dem&&l.dem&&(l.dem.backfillBorder(p.dem,m,g),l.neighboringTiles&&l.neighboringTiles[v]&&(l.neighboringTiles[v].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,s,n,l){for(const p in this._tiles){let m=this._tiles[p];if(l[p]||!m.hasData()||m.tileID.overscaledZ<=s||m.tileID.overscaledZ>n)continue;let g=m.tileID;for(;m&&m.tileID.overscaledZ>s+1;){const v=m.tileID.scaledTo(m.tileID.overscaledZ-1);m=this._tiles[v.key],m&&m.hasData()&&(g=v)}let y=g;for(;y.overscaledZ>s;)if(y=y.scaledTo(y.overscaledZ-1),t[y.key]){l[g.key]=g;break}}}findLoadedParent(t,s){if(t.key in this._loadedParentTiles){const n=this._loadedParentTiles[t.key];return n&&n.tileID.overscaledZ>=s?n:null}for(let n=t.overscaledZ-1;n>=s;n--){const l=t.scaledTo(n),p=this._getLoadedTile(l);if(p)return p}}_getLoadedTile(t){const s=this._tiles[t.key];return s&&s.hasData()?s:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){const s=Math.ceil(t.width/this._source.tileSize)+1,n=Math.ceil(t.height/this._source.tileSize)+1,l=Math.floor(s*n*(this._maxTileCacheZoomLevels===null?c.c.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),p=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,l):l;this._cache.setMaxSize(p)}handleWrapJump(t){const s=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);if(this._prevLng=t,s){const n={};for(const l in this._tiles){const p=this._tiles[l];p.tileID=p.tileID.unwrapTo(p.tileID.wrap+s),n[p.tileID.key]=p}this._tiles=n;for(const l in this._timers)clearTimeout(this._timers[l]),delete this._timers[l];for(const l in this._tiles)this._setTileReloadTimer(l,this._tiles[l])}}update(t,s){if(this.transform=t,this.terrain=s,!this._sourceLoaded||this._paused)return;let n;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?n=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(w=>new c.O(w.canonical.z,w.wrap,w.canonical.z,w.canonical.x,w.canonical.y)):(n=t.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:s}),this._source.hasTile&&(n=n.filter(w=>this._source.hasTile(w)))):n=[];const l=t.coveringZoomLevel(this._source),p=Math.max(l-ui.maxOverzooming,this._source.minzoom),m=Math.max(l+ui.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const w={};for(const S of n)if(S.canonical.z>this._source.minzoom){const E=S.scaledTo(S.canonical.z-1);w[E.key]=E;const B=S.scaledTo(Math.max(this._source.minzoom,Math.min(S.canonical.z,5)));w[B.key]=B}n=n.concat(Object.values(w))}const g=n.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,g&&this.fire(new c.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const y=this._updateRetainedTiles(n,l);if(nt(this._source.type)){const w={},S={},E=Object.keys(y),B=c.h.now();for(const L of E){const F=y[L],z=this._tiles[L];if(!z||z.fadeEndTime!==0&&z.fadeEndTime<=B)continue;const G=this.findLoadedParent(F,p);G&&(this._addTile(G.tileID),w[G.tileID.key]=G.tileID),S[L]=F}this._retainLoadedChildren(S,l,m,y);for(const L in w)y[L]||(this._coveredTiles[L]=!0,y[L]=w[L]);if(s){const L={},F={};for(const z of n)this._tiles[z.key].hasData()?L[z.key]=z:F[z.key]=z;for(const z in F){const G=F[z].children(this._source.maxzoom);this._tiles[G[0].key]&&this._tiles[G[1].key]&&this._tiles[G[2].key]&&this._tiles[G[3].key]&&(L[G[0].key]=y[G[0].key]=G[0],L[G[1].key]=y[G[1].key]=G[1],L[G[2].key]=y[G[2].key]=G[2],L[G[3].key]=y[G[3].key]=G[3],delete F[z])}for(const z in F){const G=this.findLoadedParent(F[z],this._source.minzoom);if(G){L[G.tileID.key]=y[G.tileID.key]=G.tileID;for(const J in L)L[J].isChildOf(G.tileID)&&delete L[J]}}for(const z in this._tiles)L[z]||(this._coveredTiles[z]=!0)}}for(const w in y)this._tiles[w].clearFadeHold();const v=c.ab(this._tiles,y);for(const w of v){const S=this._tiles[w];S.hasSymbolBuckets&&!S.holdingForFade()?S.setHoldDuration(this.map._fadeDuration):S.hasSymbolBuckets&&!S.symbolFadeFinished()||this._removeTile(w)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,s){const n={},l={},p=Math.max(s-ui.maxOverzooming,this._source.minzoom),m=Math.max(s+ui.maxUnderzooming,this._source.minzoom),g={};for(const y of t){const v=this._addTile(y);n[y.key]=y,v.hasData()||s<this._source.maxzoom&&(g[y.key]=y)}this._retainLoadedChildren(g,s,m,n);for(const y of t){let v=this._tiles[y.key];if(v.hasData())continue;if(s+1>this._source.maxzoom){const S=y.children(this._source.maxzoom)[0],E=this.getTile(S);if(E&&E.hasData()){n[S.key]=S;continue}}else{const S=y.children(this._source.maxzoom);if(n[S[0].key]&&n[S[1].key]&&n[S[2].key]&&n[S[3].key])continue}let w=v.wasRequested();for(let S=y.overscaledZ-1;S>=p;--S){const E=y.scaledTo(S);if(l[E.key])break;if(l[E.key]=!0,v=this.getTile(E),!v&&w&&(v=this._addTile(E)),v){const B=v.hasData();if((w||B)&&(n[E.key]=E),w=v.wasRequested(),B)break}}}return n}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const s=[];let n,l=this._tiles[t].tileID;for(;l.overscaledZ>0;){if(l.key in this._loadedParentTiles){n=this._loadedParentTiles[l.key];break}s.push(l.key);const p=l.scaledTo(l.overscaledZ-1);if(n=this._getLoadedTile(p),n)break;l=p}for(const p of s)this._loadedParentTiles[p]=n}}_addTile(t){let s=this._tiles[t.key];if(s)return s;s=this._cache.getAndRemove(t),s&&(this._setTileReloadTimer(t.key,s),s.tileID=t,this._state.initializeTileState(s,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,s)));const n=s;return s||(s=new Cr(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(s,this._tileLoaded.bind(this,s,t.key,s.state))),s.uses++,this._tiles[t.key]=s,n||this._source.fire(new c.k("dataloading",{tile:s,coord:s.tileID,dataType:"source"})),s}_setTileReloadTimer(t,s){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const n=s.getExpiryTimeout();n&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},n))}_removeTile(t){const s=this._tiles[t];s&&(s.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),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))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,s,n){const l=[],p=this.transform;if(!p)return l;const m=n?p.getCameraQueryGeometry(t):t,g=t.map(L=>p.pointCoordinate(L,this.terrain)),y=m.map(L=>p.pointCoordinate(L,this.terrain)),v=this.getIds();let w=1/0,S=1/0,E=-1/0,B=-1/0;for(const L of y)w=Math.min(w,L.x),S=Math.min(S,L.y),E=Math.max(E,L.x),B=Math.max(B,L.y);for(let L=0;L<v.length;L++){const F=this._tiles[v[L]];if(F.holdingForFade())continue;const z=F.tileID,G=Math.pow(2,p.zoom-F.tileID.overscaledZ),J=s*F.queryPadding*c.N/F.tileSize/G,U=[z.getTilePoint(new c.U(w,S)),z.getTilePoint(new c.U(E,B))];if(U[0].x-J<c.N&&U[0].y-J<c.N&&U[1].x+J>=0&&U[1].y+J>=0){const X=g.map(te=>z.getTilePoint(te)),ee=y.map(te=>z.getTilePoint(te));l.push({tile:F,tileID:z,queryGeometry:X,cameraQueryGeometry:ee,scale:G})}}return l}getVisibleCoordinates(t){const s=this.getRenderableIds(t).map(n=>this._tiles[n].tileID);for(const n of s)n.posMatrix=this.transform.calculatePosMatrix(n.toUnwrapped());return s}hasTransition(){if(this._source.hasTransition())return!0;if(nt(this._source.type)){const t=c.h.now();for(const s in this._tiles)if(this._tiles[s].fadeEndTime>=t)return!0}return!1}setFeatureState(t,s,n){this._state.updateState(t=t||"_geojsonTileLayer",s,n)}removeFeatureState(t,s,n){this._state.removeFeatureState(t=t||"_geojsonTileLayer",s,n)}getFeatureState(t,s){return this._state.getState(t=t||"_geojsonTileLayer",s)}setDependencies(t,s,n){const l=this._tiles[t];l&&l.setDependencies(s,n)}reloadTilesForDependencies(t,s){for(const n in this._tiles)this._tiles[n].hasDependency(t,s)&&this._reloadTile(n,"reloading");this._cache.filter(n=>!n.hasDependency(t,s))}}function Di(h,t){const s=Math.abs(2*h.wrap)-+(h.wrap<0),n=Math.abs(2*t.wrap)-+(t.wrap<0);return h.overscaledZ-t.overscaledZ||n-s||t.canonical.y-h.canonical.y||t.canonical.x-h.canonical.x}function nt(h){return h==="raster"||h==="image"||h==="video"}ui.maxOverzooming=10,ui.maxUnderzooming=3;const Ye="mapboxgl_preloaded_worker_pool";class Ji{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length<Ji.workerCount;)this.workers.push(new Worker(c.c.WORKER_URL));return this.active[t]=!0,this.workers.slice()}release(t){delete this.active[t],this.numActive()===0&&(this.workers.forEach(s=>{s.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Ye]}numActive(){return Object.keys(this.active).length}}const ms=Math.floor(c.h.hardwareConcurrency/2);let ur;function fa(){return ur||(ur=new Ji),ur}Ji.workerCount=c.ac(globalThis)?Math.max(Math.min(ms,3),1):1;class gs{constructor(t,s){this.reset(t,s)}reset(t,s){this.points=t||[],this._distances=[0];for(let 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(s||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(this.points.length===1)return this.points[0];t=c.ad(t,0,1);let s=1,n=this._distances[s];const l=t*this.paddedLength+this.padding;for(;n<l&&s<this._distances.length;)n=this._distances[++s];const p=s-1,m=this._distances[p],g=n-m,y=g>0?(l-m)/g:0;return this.points[p].mult(1-y).add(this.points[s].mult(y))}}function Pr(h,t){let s=!0;return h==="always"||h!=="never"&&t!=="never"||(s=!1),s}class qr{constructor(t,s,n){const l=this.boxCells=[],p=this.circleCells=[];this.xCellCount=Math.ceil(t/n),this.yCellCount=Math.ceil(s/n);for(let m=0;m<this.xCellCount*this.yCellCount;m++)l.push([]),p.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=s,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/s,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(t,s,n,l,p){this._forEachCell(s,n,l,p,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(s),this.bboxes.push(n),this.bboxes.push(l),this.bboxes.push(p)}insertCircle(t,s,n,l){this._forEachCell(s-l,n-l,s+l,n+l,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(s),this.circles.push(n),this.circles.push(l)}_insertBoxCell(t,s,n,l,p,m){this.boxCells[p].push(m)}_insertCircleCell(t,s,n,l,p,m){this.circleCells[p].push(m)}_query(t,s,n,l,p,m,g){if(n<0||t>this.width||l<0||s>this.height)return[];const y=[];if(t<=0&&s<=0&&this.width<=n&&this.height<=l){if(p)return[{key:null,x1:t,y1:s,x2:n,y2:l}];for(let v=0;v<this.boxKeys.length;v++)y.push({key:this.boxKeys[v],x1:this.bboxes[4*v],y1:this.bboxes[4*v+1],x2:this.bboxes[4*v+2],y2:this.bboxes[4*v+3]});for(let v=0;v<this.circleKeys.length;v++){const w=this.circles[3*v],S=this.circles[3*v+1],E=this.circles[3*v+2];y.push({key:this.circleKeys[v],x1:w-E,y1:S-E,x2:w+E,y2:S+E})}}else this._forEachCell(t,s,n,l,this._queryCell,y,{hitTest:p,overlapMode:m,seenUids:{box:{},circle:{}}},g);return y}query(t,s,n,l){return this._query(t,s,n,l,!1,null)}hitTest(t,s,n,l,p,m){return this._query(t,s,n,l,!0,p,m).length>0}hitTestCircle(t,s,n,l,p){const m=t-n,g=t+n,y=s-n,v=s+n;if(g<0||m>this.width||v<0||y>this.height)return!1;const w=[];return this._forEachCell(m,y,g,v,this._queryCellCircle,w,{hitTest:!0,overlapMode:l,circle:{x:t,y:s,radius:n},seenUids:{box:{},circle:{}}},p),w.length>0}_queryCell(t,s,n,l,p,m,g,y){const{seenUids:v,hitTest:w,overlapMode:S}=g,E=this.boxCells[p];if(E!==null){const L=this.bboxes;for(const F of E)if(!v.box[F]){v.box[F]=!0;const z=4*F,G=this.boxKeys[F];if(t<=L[z+2]&&s<=L[z+3]&&n>=L[z+0]&&l>=L[z+1]&&(!y||y(G))&&(!w||!Pr(S,G.overlapMode))&&(m.push({key:G,x1:L[z],y1:L[z+1],x2:L[z+2],y2:L[z+3]}),w))return!0}}const B=this.circleCells[p];if(B!==null){const L=this.circles;for(const F of B)if(!v.circle[F]){v.circle[F]=!0;const z=3*F,G=this.circleKeys[F];if(this._circleAndRectCollide(L[z],L[z+1],L[z+2],t,s,n,l)&&(!y||y(G))&&(!w||!Pr(S,G.overlapMode))){const J=L[z],U=L[z+1],X=L[z+2];if(m.push({key:G,x1:J-X,y1:U-X,x2:J+X,y2:U+X}),w)return!0}}}return!1}_queryCellCircle(t,s,n,l,p,m,g,y){const{circle:v,seenUids:w,overlapMode:S}=g,E=this.boxCells[p];if(E!==null){const L=this.bboxes;for(const F of E)if(!w.box[F]){w.box[F]=!0;const z=4*F,G=this.boxKeys[F];if(this._circleAndRectCollide(v.x,v.y,v.radius,L[z+0],L[z+1],L[z+2],L[z+3])&&(!y||y(G))&&!Pr(S,G.overlapMode))return m.push(!0),!0}}const B=this.circleCells[p];if(B!==null){const L=this.circles;for(const F of B)if(!w.circle[F]){w.circle[F]=!0;const z=3*F,G=this.circleKeys[F];if(this._circlesCollide(L[z],L[z+1],L[z+2],v.x,v.y,v.radius)&&(!y||y(G))&&!Pr(S,G.overlapMode))return m.push(!0),!0}}}_forEachCell(t,s,n,l,p,m,g,y){const v=this._convertToXCellCoord(t),w=this._convertToYCellCoord(s),S=this._convertToXCellCoord(n),E=this._convertToYCellCoord(l);for(let B=v;B<=S;B++)for(let L=w;L<=E;L++)if(p.call(this,t,s,n,l,this.xCellCount*L+B,m,g,y))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,s,n,l,p,m){const g=l-t,y=p-s,v=n+m;return v*v>g*g+y*y}_circleAndRectCollide(t,s,n,l,p,m,g){const y=(m-l)/2,v=Math.abs(t-(l+y));if(v>y+n)return!1;const w=(g-p)/2,S=Math.abs(s-(p+w));if(S>w+n)return!1;if(v<=y||S<=w)return!0;const E=v-y,B=S-w;return E*E+B*B<=n*n}}function fe(h,t,s,n,l){const p=c.Z();return t?(c.a0(p,p,[1/l,1/l,1]),s||c.ae(p,p,n.angle)):c.a1(p,n.labelPlaneMatrix,h),p}function Qi(h,t,s,n,l){if(t){const p=c.af(h);return c.a0(p,p,[l,l,1]),s||c.ae(p,p,-n.angle),p}return n.glCoordMatrix}function vt(h,t,s){let n;s?(n=[h.x,h.y,s(h.x,h.y),1],c.ag(n,n,t)):(n=[h.x,h.y,0,1],O(n,n,t));const l=n[3];return{point:new c.P(n[0]/l,n[1]/l),signedDistanceFromCamera:l}}function Zr(h,t){return .5+h/t*.5}function pr(h,t){const s=h[0]/h[3],n=h[1]/h[3];return s>=-t[0]&&s<=t[0]&&n>=-t[1]&&n<=t[1]}function ge(h,t,s,n,l,p,m,g,y,v){const w=n?h.textSizeData:h.iconSizeData,S=c.ah(w,s.transform.zoom),E=[256/s.width*2+1,256/s.height*2+1],B=n?h.text.dynamicLayoutVertexArray:h.icon.dynamicLayoutVertexArray;B.clear();const L=h.lineVertexArray,F=n?h.text.placedSymbolArray:h.icon.placedSymbolArray,z=s.transform.width/s.transform.height;let G=!1;for(let J=0;J<F.length;J++){const U=F.get(J);if(U.hidden||U.writingMode===c.ai.vertical&&!G){k(U.numGlyphs,B);continue}let X;if(G=!1,v?(X=[U.anchorX,U.anchorY,v(U.anchorX,U.anchorY),1],c.ag(X,X,t)):(X=[U.anchorX,U.anchorY,0,1],O(X,X,t)),!pr(X,E)){k(U.numGlyphs,B);continue}const ee=Zr(s.transform.cameraToCenterDistance,X[3]),te=c.aj(w,S,U),ne=m?te/ee:te*ee,he=new c.P(U.anchorX,U.anchorY),ce=vt(he,l,v).point,pe={projections:{},offsets:{}},Ie=ii(U,ne,!1,g,t,l,p,h.glyphOffsetArray,L,B,ce,he,pe,z,y,v);G=Ie.useVertical,(Ie.notEnoughRoom||G||Ie.needsFlipping&&ii(U,ne,!0,g,t,l,p,h.glyphOffsetArray,L,B,ce,he,pe,z,y,v).notEnoughRoom)&&k(U.numGlyphs,B)}n?h.text.dynamicLayoutVertexBuffer.updateData(B):h.icon.dynamicLayoutVertexBuffer.updateData(B)}function Ue(h,t,s,n,l,p,m,g,y,v,w,S,E){const B=g.glyphStartIndex+g.numGlyphs,L=g.lineStartIndex,F=g.lineStartIndex+g.lineLength,z=t.getoffsetX(g.glyphStartIndex),G=t.getoffsetX(B-1),J=I(h*z,s,n,l,p,m,g.segment,L,F,y,v,w,S,E);if(!J)return null;const U=I(h*G,s,n,l,p,m,g.segment,L,F,y,v,w,S,E);return U?{first:J,last:U}:null}function Fe(h,t,s,n){return h===c.ai.horizontal&&Math.abs(s.y-t.y)>Math.abs(s.x-t.x)*n?{useVertical:!0}:(h===c.ai.vertical?t.y<s.y:t.x>s.x)?{needsFlipping:!0}:null}function ii(h,t,s,n,l,p,m,g,y,v,w,S,E,B,L,F){const z=t/24,G=h.lineOffsetX*z,J=h.lineOffsetY*z;let U;if(h.numGlyphs>1){const X=h.glyphStartIndex+h.numGlyphs,ee=h.lineStartIndex,te=h.lineStartIndex+h.lineLength,ne=Ue(z,g,G,J,s,w,S,h,y,p,E,L,F);if(!ne)return{notEnoughRoom:!0};const he=vt(ne.first.point,m,F).point,ce=vt(ne.last.point,m,F).point;if(n&&!s){const pe=Fe(h.writingMode,he,ce,B);if(pe)return pe}U=[ne.first];for(let pe=h.glyphStartIndex+1;pe<X-1;pe++)U.push(I(z*g.getoffsetX(pe),G,J,s,w,S,h.segment,ee,te,y,p,E,L,F));U.push(ne.last)}else{if(n&&!s){const ee=vt(S,l,F).point,te=h.lineStartIndex+h.segment+1,ne=new c.P(y.getx(te),y.gety(te)),he=vt(ne,l,F),ce=he.signedDistanceFromCamera>0?he.point:er(S,ne,ee,1,l,F),pe=Fe(h.writingMode,ee,ce,B);if(pe)return pe}const X=I(z*g.getoffsetX(h.glyphStartIndex),G,J,s,w,S,h.segment,h.lineStartIndex,h.lineStartIndex+h.lineLength,y,p,E,L,F);if(!X)return{notEnoughRoom:!0};U=[X]}for(const X of U)c.ak(v,X.point,X.angle);return{}}function er(h,t,s,n,l,p){const m=vt(h.add(h.sub(t)._unit()),l,p).point,g=s.sub(m);return s.add(g._mult(n/g.mag()))}function Ve(h,t){const{projectionCache:s,lineVertexArray:n,labelPlaneMatrix:l,tileAnchorPoint:p,distanceFromAnchor:m,getElevation:g,previousVertex:y,direction:v,absOffsetX:w}=t;if(s.projections[h])return s.projections[h];const S=new c.P(n.getx(h),n.gety(h)),E=vt(S,l,g);if(E.signedDistanceFromCamera>0)return s.projections[h]=E.point,E.point;const B=h-v;return er(m===0?p:new c.P(n.getx(B),n.gety(B)),S,y,w-m+1,l,g)}function dr(h,t,s){return h._unit()._perp()._mult(t*s)}function R(h,t,s,n,l,p,m,g){const{projectionCache:y,direction:v}=g;if(y.offsets[h])return y.offsets[h];const w=s.add(t);if(h+v<n||h+v>=l)return y.offsets[h]=w,w;const S=Ve(h+v,g),E=dr(S.sub(s),m,v),B=s.add(E),L=S.add(E);return y.offsets[h]=c.al(p,w,B,L)||w,y.offsets[h]}function I(h,t,s,n,l,p,m,g,y,v,w,S,E,B){const L=n?h-t:h+t;let F=L>0?1:-1,z=0;n&&(F*=-1,z=Math.PI),F<0&&(z+=Math.PI);let G,J,U=F>0?g+m:g+m+1,X=l,ee=l,te=0,ne=0;const he=Math.abs(L),ce=[];let pe;for(;te+ne<=he;){if(U+=F,U<g||U>=y)return null;te+=ne,ee=X,J=G;const _e={projectionCache:S,lineVertexArray:v,labelPlaneMatrix:w,tileAnchorPoint:p,distanceFromAnchor:te,getElevation:B,previousVertex:ee,direction:F,absOffsetX:he};if(X=Ve(U,_e),s===0)ce.push(ee),pe=X.sub(ee);else{let Le;const Me=X.sub(ee);Le=Me.mag()===0?dr(Ve(U+F,_e).sub(X),s,F):dr(Me,s,F),J||(J=ee.add(Le)),G=R(U,Le,X,g,y,J,s,_e),ce.push(J),pe=G.sub(J)}ne=pe.mag()}const Ie=pe._mult((he-te)/ne)._add(J||ee),qe=z+Math.atan2(X.y-ee.y,X.x-ee.x);return ce.push(Ie),{point:Ie,angle:E?qe:0,path:ce}}const M=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function k(h,t){for(let s=0;s<h;s++){const n=t.length;t.resize(n+4),t.float32.set(M,3*n)}}function O(h,t,s){const n=t[0],l=t[1];return h[0]=s[0]*n+s[4]*l+s[12],h[1]=s[1]*n+s[5]*l+s[13],h[3]=s[3]*n+s[7]*l+s[15],h}const N=100;class K{constructor(t,s=new qr(t.width+200,t.height+200,25),n=new qr(t.width+200,t.height+200,25)){this.transform=t,this.grid=s,this.ignoredGrid=n,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+N,this.screenBottomBoundary=t.height+N,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(t,s,n,l,p,m){const g=this.projectAndGetPerspectiveRatio(l,t.anchorPointX,t.anchorPointY,m),y=n*g.perspectiveRatio,v=t.x1*y+g.point.x,w=t.y1*y+g.point.y,S=t.x2*y+g.point.x,E=t.y2*y+g.point.y;return!this.isInsideGrid(v,w,S,E)||s!=="always"&&this.grid.hitTest(v,w,S,E,s,p)||g.perspectiveRatio<this.perspectiveRatioCutoff?{box:[],offscreen:!1}:{box:[v,w,S,E],offscreen:this.isOffscreen(v,w,S,E)}}placeCollisionCircles(t,s,n,l,p,m,g,y,v,w,S,E,B,L){const F=[],z=new c.P(s.anchorX,s.anchorY),G=vt(z,m,L),J=Zr(this.transform.cameraToCenterDistance,G.signedDistanceFromCamera),U=(w?p/J:p*J)/c.ap,X=vt(z,g,L).point,ee=Ue(U,l,s.lineOffsetX*U,s.lineOffsetY*U,!1,X,z,s,n,g,{projections:{},offsets:{}},!1,L);let te=!1,ne=!1,he=!0;if(ee){const ce=.5*E*J+B,pe=new c.P(-100,-100),Ie=new c.P(this.screenRightBoundary,this.screenBottomBoundary),qe=new gs,_e=ee.first,Le=ee.last;let Me=[];for(let Ne=_e.path.length-1;Ne>=1;Ne--)Me.push(_e.path[Ne]);for(let Ne=1;Ne<Le.path.length;Ne++)Me.push(Le.path[Ne]);const rt=2.5*ce;if(y){const Ne=Me.map(Ze=>vt(Ze,y,L));Me=Ne.some(Ze=>Ze.signedDistanceFromCamera<=0)?[]:Ne.map(Ze=>Ze.point)}let je=[];if(Me.length>0){const Ne=Me[0].clone(),Ze=Me[0].clone();for(let Tt=1;Tt<Me.length;Tt++)Ne.x=Math.min(Ne.x,Me[Tt].x),Ne.y=Math.min(Ne.y,Me[Tt].y),Ze.x=Math.max(Ze.x,Me[Tt].x),Ze.y=Math.max(Ze.y,Me[Tt].y);je=Ne.x>=pe.x&&Ze.x<=Ie.x&&Ne.y>=pe.y&&Ze.y<=Ie.y?[Me]:Ze.x<pe.x||Ne.x>Ie.x||Ze.y<pe.y||Ne.y>Ie.y?[]:c.am([Me],pe.x,pe.y,Ie.x,Ie.y)}for(const Ne of je){qe.reset(Ne,.25*ce);let Ze=0;Ze=qe.length<=.5*ce?1:Math.ceil(qe.paddedLength/rt)+1;for(let Tt=0;Tt<Ze;Tt++){const lt=Tt/Math.max(Ze-1,1),Zt=qe.lerp(lt),Lt=Zt.x+N,Et=Zt.y+N;F.push(Lt,Et,ce,0);const Ai=Lt-ce,ut=Et-ce,ir=Lt+ce,rr=Et+ce;if(he=he&&this.isOffscreen(Ai,ut,ir,rr),ne=ne||this.isInsideGrid(Ai,ut,ir,rr),t!=="always"&&this.grid.hitTestCircle(Lt,Et,ce,t,S)&&(te=!0,!v))return{circles:[],offscreen:!1,collisionDetected:te}}}}return{circles:!v&&te||!ne||J<this.perspectiveRatioCutoff?[]:F,offscreen:he,collisionDetected:te}}queryRenderedSymbols(t){if(t.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const s=[];let n=1/0,l=1/0,p=-1/0,m=-1/0;for(const w of t){const S=new c.P(w.x+N,w.y+N);n=Math.min(n,S.x),l=Math.min(l,S.y),p=Math.max(p,S.x),m=Math.max(m,S.y),s.push(S)}const g=this.grid.query(n,l,p,m).concat(this.ignoredGrid.query(n,l,p,m)),y={},v={};for(const w of g){const S=w.key;if(y[S.bucketInstanceId]===void 0&&(y[S.bucketInstanceId]={}),y[S.bucketInstanceId][S.featureIndex])continue;const E=[new c.P(w.x1,w.y1),new c.P(w.x2,w.y1),new c.P(w.x2,w.y2),new c.P(w.x1,w.y2)];c.an(s,E)&&(y[S.bucketInstanceId][S.featureIndex]=!0,v[S.bucketInstanceId]===void 0&&(v[S.bucketInstanceId]=[]),v[S.bucketInstanceId].push(S.featureIndex))}return v}insertCollisionBox(t,s,n,l,p,m){(n?this.ignoredGrid:this.grid).insert({bucketInstanceId:l,featureIndex:p,collisionGroupID:m,overlapMode:s},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,s,n,l,p,m){const g=n?this.ignoredGrid:this.grid,y={bucketInstanceId:l,featureIndex:p,collisionGroupID:m,overlapMode:s};for(let v=0;v<t.length;v+=4)g.insertCircle(y,t[v],t[v+1],t[v+2])}projectAndGetPerspectiveRatio(t,s,n,l){let p;return l?(p=[s,n,l(s,n),1],c.ag(p,p,t)):(p=[s,n,0,1],O(p,p,t)),{point:new c.P((p[0]/p[3]+1)/2*this.transform.width+N,(-p[1]/p[3]+1)/2*this.transform.height+N),perspectiveRatio:.5+this.transform.cameraToCenterDistance/p[3]*.5}}isOffscreen(t,s,n,l){return n<N||t>=this.screenRightBoundary||l<N||s>this.screenBottomBoundary}isInsideGrid(t,s,n,l){return n>=0&&t<this.gridRightBoundary&&l>=0&&s<this.gridBottomBoundary}getViewportMatrix(){const t=c.ao([]);return c.$(t,t,[-100,-100,0]),t}}function Z(h,t,s){return t*(c.N/(h.tileSize*Math.pow(2,s-h.tileID.overscaledZ)))}class j{constructor(t,s,n,l){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?s:-s))):l&&n?1:0,this.placed=n}isHidden(){return this.opacity===0&&!this.placed}}class W{constructor(t,s,n,l,p){this.text=new j(t?t.text:null,s,n,p),this.icon=new j(t?t.icon:null,s,l,p)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class se{constructor(t,s,n){this.text=t,this.icon=s,this.skipFade=n}}class ae{constructor(){this.invProjMatrix=c.Z(),this.viewportMatrix=c.Z(),this.circles=[]}}class le{constructor(t,s,n,l,p){this.bucketInstanceId=t,this.featureIndex=s,this.sourceLayerIndex=n,this.bucketIndex=l,this.tileID=p}}class Pe{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){const s=++this.maxGroupID;this.collisionGroups[t]={ID:s,predicate:n=>n.collisionGroupID===s}}return this.collisionGroups[t]}}function Re(h,t,s,n,l){const{horizontalAlign:p,verticalAlign:m}=c.au(h);return new c.P(-(p-.5)*t+n[0]*l,-(m-.5)*s+n[1]*l)}function Te(h,t,s,n,l,p){const{x1:m,x2:g,y1:y,y2:v,anchorPointX:w,anchorPointY:S}=h,E=new c.P(t,s);return n&&E._rotate(l?p:-p),{x1:m+E.x,y1:y+E.y,x2:g+E.x,y2:v+E.y,anchorPointX:w,anchorPointY:S}}class ze{constructor(t,s,n,l,p){this.transform=t.clone(),this.terrain=s,this.collisionIndex=new K(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=n,this.retainedQueryData={},this.collisionGroups=new Pe(l),this.collisionCircleArrays={},this.prevPlacement=p,p&&(p.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,s,n,l){const p=n.getBucket(s),m=n.latestFeatureIndex;if(!p||!m||s.id!==p.layerIds[0])return;const g=n.collisionBoxArray,y=p.layers[0].layout,v=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),w=n.tileSize/c.N,S=this.transform.calculatePosMatrix(n.tileID.toUnwrapped()),E=y.get("text-pitch-alignment")==="map",B=y.get("text-rotation-alignment")==="map",L=Z(n,1,this.transform.zoom),F=fe(S,E,B,this.transform,L);let z=null;if(E){const J=Qi(S,E,B,this.transform,L);z=c.a1([],this.transform.labelPlaneMatrix,J)}this.retainedQueryData[p.bucketInstanceId]=new le(p.bucketInstanceId,m,p.sourceLayerIndex,p.index,n.tileID);const G={bucket:p,layout:y,posMatrix:S,textLabelPlaneMatrix:F,labelToScreenMatrix:z,scale:v,textPixelRatio:w,holdingForFade:n.holdingForFade(),collisionBoxArray:g,partiallyEvaluatedTextSize:c.ah(p.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(p.sourceID)};if(l)for(const J of p.sortKeyRanges){const{sortKey:U,symbolInstanceStart:X,symbolInstanceEnd:ee}=J;t.push({sortKey:U,symbolInstanceStart:X,symbolInstanceEnd:ee,parameters:G})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:p.symbolInstances.length,parameters:G})}attemptAnchorPlacement(t,s,n,l,p,m,g,y,v,w,S,E,B,L,F,z){const G=c.aq[t.textAnchor],J=[t.textOffset0,t.textOffset1],U=Re(G,n,l,J,p),X=this.collisionIndex.placeCollisionBox(Te(s,U.x,U.y,m,g,this.transform.angle),S,y,v,w.predicate,z);if((!F||this.collisionIndex.placeCollisionBox(Te(F,U.x,U.y,m,g,this.transform.angle),S,y,v,w.predicate,z).box.length!==0)&&X.box.length>0){let ee;if(this.prevPlacement&&this.prevPlacement.variableOffsets[E.crossTileID]&&this.prevPlacement.placements[E.crossTileID]&&this.prevPlacement.placements[E.crossTileID].text&&(ee=this.prevPlacement.variableOffsets[E.crossTileID].anchor),E.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[E.crossTileID]={textOffset:J,width:n,height:l,anchor:G,textBoxScale:p,prevAnchor:ee},this.markUsedJustification(B,G,E,L),B.allowVerticalPlacement&&(this.markUsedOrientation(B,L,E),this.placedOrientations[E.crossTileID]=L),{shift:U,placedGlyphBoxes:X}}}placeLayerBucketPart(t,s,n){const{bucket:l,layout:p,posMatrix:m,textLabelPlaneMatrix:g,labelToScreenMatrix:y,textPixelRatio:v,holdingForFade:w,collisionBoxArray:S,partiallyEvaluatedTextSize:E,collisionGroup:B}=t.parameters,L=p.get("text-optional"),F=p.get("icon-optional"),z=c.ar(p,"text-overlap","text-allow-overlap"),G=z==="always",J=c.ar(p,"icon-overlap","icon-allow-overlap"),U=J==="always",X=p.get("text-rotation-alignment")==="map",ee=p.get("text-pitch-alignment")==="map",te=p.get("icon-text-fit")!=="none",ne=p.get("symbol-z-order")==="viewport-y",he=G&&(U||!l.hasIconData()||F),ce=U&&(G||!l.hasTextData()||L);!l.collisionArrays&&S&&l.deserializeCollisionBoxes(S);const pe=this.retainedQueryData[l.bucketInstanceId].tileID,Ie=this.terrain?(_e,Le)=>this.terrain.getElevation(pe,_e,Le):null,qe=(_e,Le)=>{var Me,rt;if(s[_e.crossTileID])return;if(w)return void(this.placements[_e.crossTileID]=new se(!1,!1,!1));let je=!1,Ne=!1,Ze=!0,Tt=null,lt={box:null,offscreen:null},Zt={box:null,offscreen:null},Lt=null,Et=null,Ai=null,ut=0,ir=0,rr=0;Le.textFeatureIndex?ut=Le.textFeatureIndex:_e.useRuntimeCollisionCircles&&(ut=_e.featureIndex),Le.verticalTextFeatureIndex&&(ir=Le.verticalTextFeatureIndex);const Fr=Le.textBox;if(Fr){const Kt=It=>{let Bt=c.ai.horizontal;if(l.allowVerticalPlacement&&!It&&this.prevPlacement){const fi=this.prevPlacement.placedOrientations[_e.crossTileID];fi&&(this.placedOrientations[_e.crossTileID]=fi,Bt=fi,this.markUsedOrientation(l,Bt,_e))}return Bt},Gt=(It,Bt)=>{if(l.allowVerticalPlacement&&_e.numVerticalGlyphVertices>0&&Le.verticalTextBox){for(const fi of l.writingModes)if(fi===c.ai.vertical?(lt=Bt(),Zt=lt):lt=It(),lt&&lt.box&&lt.box.length)break}else lt=It()},si=_e.textAnchorOffsetStartIndex,ts=_e.textAnchorOffsetEndIndex;if(ts===si){const It=(Bt,fi)=>{const At=this.collisionIndex.placeCollisionBox(Bt,z,v,m,B.predicate,Ie);return At&&At.box&&At.box.length&&(this.markUsedOrientation(l,fi,_e),this.placedOrientations[_e.crossTileID]=fi),At};Gt(()=>It(Fr,c.ai.horizontal),()=>{const Bt=Le.verticalTextBox;return l.allowVerticalPlacement&&_e.numVerticalGlyphVertices>0&&Bt?It(Bt,c.ai.vertical):{box:null,offscreen:null}}),Kt(lt&&lt.box&&lt.box.length)}else{let It=c.aq[(rt=(Me=this.prevPlacement)===null||Me===void 0?void 0:Me.variableOffsets[_e.crossTileID])===null||rt===void 0?void 0:rt.anchor];const Bt=(At,is,ja)=>{const Wo=At.x2-At.x1,Ho=At.y2-At.y1,Rl=_e.textBoxScale,qn=te&&J==="never"?is:null;let sr={box:[],offscreen:!1},rs=z==="never"?1:2,ar="never";It&&rs++;for(let Ni=0;Ni<rs;Ni++){for(let nr=si;nr<ts;nr++){const Zn=l.textAnchorOffsets.get(nr);if(It&&Zn.textAnchor!==It)continue;const xr=this.attemptAnchorPlacement(Zn,At,Wo,Ho,Rl,X,ee,v,m,B,ar,_e,l,ja,qn,Ie);if(xr&&(sr=xr.placedGlyphBoxes,sr&&sr.box&&sr.box.length))return je=!0,Tt=xr.shift,sr}It?It=null:ar=z}return sr};Gt(()=>Bt(Fr,Le.iconBox,c.ai.horizontal),()=>{const At=Le.verticalTextBox;return l.allowVerticalPlacement&&!(lt&&lt.box&&lt.box.length)&&_e.numVerticalGlyphVertices>0&&At?Bt(At,Le.verticalIconBox,c.ai.vertical):{box:null,offscreen:null}}),lt&&(je=lt.box,Ze=lt.offscreen);const fi=Kt(lt&&lt.box);if(!je&&this.prevPlacement){const At=this.prevPlacement.variableOffsets[_e.crossTileID];At&&(this.variableOffsets[_e.crossTileID]=At,this.markUsedJustification(l,At.anchor,_e,fi))}}}if(Lt=lt,je=Lt&&Lt.box&&Lt.box.length>0,Ze=Lt&&Lt.offscreen,_e.useRuntimeCollisionCircles){const Kt=l.text.placedSymbolArray.get(_e.centerJustifiedTextSymbolIndex),Gt=c.aj(l.textSizeData,E,Kt),si=p.get("text-padding");Et=this.collisionIndex.placeCollisionCircles(z,Kt,l.lineVertexArray,l.glyphOffsetArray,Gt,m,g,y,n,ee,B.predicate,_e.collisionCircleDiameter,si,Ie),Et.circles.length&&Et.collisionDetected&&!n&&c.w("Collisions detected, but collision boxes are not shown"),je=G||Et.circles.length>0&&!Et.collisionDetected,Ze=Ze&&Et.offscreen}if(Le.iconFeatureIndex&&(rr=Le.iconFeatureIndex),Le.iconBox){const Kt=Gt=>{const si=te&&Tt?Te(Gt,Tt.x,Tt.y,X,ee,this.transform.angle):Gt;return this.collisionIndex.placeCollisionBox(si,J,v,m,B.predicate,Ie)};Zt&&Zt.box&&Zt.box.length&&Le.verticalIconBox?(Ai=Kt(Le.verticalIconBox),Ne=Ai.box.length>0):(Ai=Kt(Le.iconBox),Ne=Ai.box.length>0),Ze=Ze&&Ai.offscreen}const es=L||_e.numHorizontalGlyphVertices===0&&_e.numVerticalGlyphVertices===0,Ps=F||_e.numIconVertices===0;if(es||Ps?Ps?es||(Ne=Ne&&je):je=Ne&&je:Ne=je=Ne&&je,je&&Lt&&Lt.box&&this.collisionIndex.insertCollisionBox(Lt.box,z,p.get("text-ignore-placement"),l.bucketInstanceId,Zt&&Zt.box&&ir?ir:ut,B.ID),Ne&&Ai&&this.collisionIndex.insertCollisionBox(Ai.box,J,p.get("icon-ignore-placement"),l.bucketInstanceId,rr,B.ID),Et&&(je&&this.collisionIndex.insertCollisionCircles(Et.circles,z,p.get("text-ignore-placement"),l.bucketInstanceId,ut,B.ID),n)){const Kt=l.bucketInstanceId;let Gt=this.collisionCircleArrays[Kt];Gt===void 0&&(Gt=this.collisionCircleArrays[Kt]=new ae);for(let si=0;si<Et.circles.length;si+=4)Gt.circles.push(Et.circles[si+0]),Gt.circles.push(Et.circles[si+1]),Gt.circles.push(Et.circles[si+2]),Gt.circles.push(Et.collisionDetected?1:0)}if(_e.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(l.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[_e.crossTileID]=new se(je||he,Ne||ce,Ze||l.justReloaded),s[_e.crossTileID]=!0};if(ne){if(t.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const _e=l.getSortedSymbolIndexes(this.transform.angle);for(let Le=_e.length-1;Le>=0;--Le){const Me=_e[Le];qe(l.symbolInstances.get(Me),l.collisionArrays[Me])}}else for(let _e=t.symbolInstanceStart;_e<t.symbolInstanceEnd;_e++)qe(l.symbolInstances.get(_e),l.collisionArrays[_e]);if(n&&l.bucketInstanceId in this.collisionCircleArrays){const _e=this.collisionCircleArrays[l.bucketInstanceId];c.as(_e.invProjMatrix,m),_e.viewportMatrix=this.collisionIndex.getViewportMatrix()}l.justReloaded=!1}markUsedJustification(t,s,n,l){let p;p=l===c.ai.vertical?n.verticalPlacedTextSymbolIndex:{left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex}[c.at(s)];const m=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];for(const g of m)g>=0&&(t.text.placedSymbolArray.get(g).crossTileID=p>=0&&g!==p?0:n.crossTileID)}markUsedOrientation(t,s,n){const l=s===c.ai.horizontal||s===c.ai.horizontalOnly?s:0,p=s===c.ai.vertical?s:0,m=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];for(const g of m)t.text.placedSymbolArray.get(g).placedOrientation=l;n.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=p)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const s=this.prevPlacement;let n=!1;this.prevZoomAdjustment=s?s.zoomAdjustment(this.transform.zoom):0;const l=s?s.symbolFadeChange(t):1,p=s?s.opacities:{},m=s?s.variableOffsets:{},g=s?s.placedOrientations:{};for(const y in this.placements){const v=this.placements[y],w=p[y];w?(this.opacities[y]=new W(w,l,v.text,v.icon),n=n||v.text!==w.text.placed||v.icon!==w.icon.placed):(this.opacities[y]=new W(null,l,v.text,v.icon,v.skipFade),n=n||v.text||v.icon)}for(const y in p){const v=p[y];if(!this.opacities[y]){const w=new W(v,l,!1,!1);w.isHidden()||(this.opacities[y]=w,n=n||v.text.placed||v.icon.placed)}}for(const y in m)this.variableOffsets[y]||!this.opacities[y]||this.opacities[y].isHidden()||(this.variableOffsets[y]=m[y]);for(const y in g)this.placedOrientations[y]||!this.opacities[y]||this.opacities[y].isHidden()||(this.placedOrientations[y]=g[y]);if(s&&s.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");n?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=s?s.lastPlacementChangeTime:t)}updateLayerOpacities(t,s){const n={};for(const l of s){const p=l.getBucket(t);p&&l.latestFeatureIndex&&t.id===p.layerIds[0]&&this.updateBucketOpacities(p,n,l.collisionBoxArray)}}updateBucketOpacities(t,s,n){t.hasTextData()&&(t.text.opacityVertexArray.clear(),t.text.hasVisibleVertices=!1),t.hasIconData()&&(t.icon.opacityVertexArray.clear(),t.icon.hasVisibleVertices=!1),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const l=t.layers[0],p=l.layout,m=new W(null,0,!1,!1,!0),g=p.get("text-allow-overlap"),y=p.get("icon-allow-overlap"),v=l._unevaluatedLayout.hasValue("text-variable-anchor")||l._unevaluatedLayout.hasValue("text-variable-anchor-offset"),w=p.get("text-rotation-alignment")==="map",S=p.get("text-pitch-alignment")==="map",E=p.get("icon-text-fit")!=="none",B=new W(null,0,g&&(y||!t.hasIconData()||p.get("icon-optional")),y&&(g||!t.hasTextData()||p.get("text-optional")),!0);!t.collisionArrays&&n&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(n);const L=(F,z,G)=>{for(let J=0;J<z/4;J++)F.opacityVertexArray.emplaceBack(G);F.hasVisibleVertices=F.hasVisibleVertices||G!==Li};for(let F=0;F<t.symbolInstances.length;F++){const z=t.symbolInstances.get(F),{numHorizontalGlyphVertices:G,numVerticalGlyphVertices:J,crossTileID:U}=z;let X=this.opacities[U];s[U]?X=m:X||(X=B,this.opacities[U]=X),s[U]=!0;const ee=z.numIconVertices>0,te=this.placedOrientations[z.crossTileID],ne=te===c.ai.vertical,he=te===c.ai.horizontal||te===c.ai.horizontalOnly;if(G>0||J>0){const ce=jt(X.text);L(t.text,G,ne?Li:ce),L(t.text,J,he?Li:ce);const pe=X.text.isHidden();[z.rightJustifiedTextSymbolIndex,z.centerJustifiedTextSymbolIndex,z.leftJustifiedTextSymbolIndex].forEach(_e=>{_e>=0&&(t.text.placedSymbolArray.get(_e).hidden=pe||ne?1:0)}),z.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(z.verticalPlacedTextSymbolIndex).hidden=pe||he?1:0);const Ie=this.variableOffsets[z.crossTileID];Ie&&this.markUsedJustification(t,Ie.anchor,z,te);const qe=this.placedOrientations[z.crossTileID];qe&&(this.markUsedJustification(t,"left",z,qe),this.markUsedOrientation(t,qe,z))}if(ee){const ce=jt(X.icon),pe=!(E&&z.verticalPlacedIconSymbolIndex&&ne);z.placedIconSymbolIndex>=0&&(L(t.icon,z.numIconVertices,pe?ce:Li),t.icon.placedSymbolArray.get(z.placedIconSymbolIndex).hidden=X.icon.isHidden()),z.verticalPlacedIconSymbolIndex>=0&&(L(t.icon,z.numVerticalIconVertices,pe?Li:ce),t.icon.placedSymbolArray.get(z.verticalPlacedIconSymbolIndex).hidden=X.icon.isHidden())}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const ce=t.collisionArrays[F];if(ce){let pe=new c.P(0,0);if(ce.textBox||ce.verticalTextBox){let qe=!0;if(v){const _e=this.variableOffsets[U];_e?(pe=Re(_e.anchor,_e.width,_e.height,_e.textOffset,_e.textBoxScale),w&&pe._rotate(S?this.transform.angle:-this.transform.angle)):qe=!1}ce.textBox&&Oe(t.textCollisionBox.collisionVertexArray,X.text.placed,!qe||ne,pe.x,pe.y),ce.verticalTextBox&&Oe(t.textCollisionBox.collisionVertexArray,X.text.placed,!qe||he,pe.x,pe.y)}const Ie=!!(!he&&ce.verticalIconBox);ce.iconBox&&Oe(t.iconCollisionBox.collisionVertexArray,X.icon.placed,Ie,E?pe.x:0,E?pe.y:0),ce.verticalIconBox&&Oe(t.iconCollisionBox.collisionVertexArray,X.icon.placed,!Ie,E?pe.x:0,E?pe.y:0)}}}if(t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);if(t.bucketInstanceId in this.collisionCircleArrays){const F=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=F.invProjMatrix,t.placementViewportMatrix=F.viewportMatrix,t.collisionCircleArray=F.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(t){return this.fadeDuration===0?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(t,s){const n=this.zoomAtLastRecencyCheck===s?1-this.zoomAdjustment(s):1;return this.zoomAtLastRecencyCheck=s,this.commitTime+this.fadeDuration*n>t}setStale(){this.stale=!0}}function Oe(h,t,s,n,l){h.emplaceBack(t?1:0,s?1:0,n||0,l||0),h.emplaceBack(t?1:0,s?1:0,n||0,l||0),h.emplaceBack(t?1:0,s?1:0,n||0,l||0),h.emplaceBack(t?1:0,s?1:0,n||0,l||0)}const tt=Math.pow(2,25),st=Math.pow(2,24),Ke=Math.pow(2,17),He=Math.pow(2,16),Wt=Math.pow(2,9),ot=Math.pow(2,8),kt=Math.pow(2,1);function jt(h){if(h.opacity===0&&!h.placed)return 0;if(h.opacity===1&&h.placed)return 4294967295;const t=h.placed?1:0,s=Math.floor(127*h.opacity);return s*tt+t*st+s*Ke+t*He+s*Wt+t*ot+s*kt+t}const Li=0;class co{constructor(t){this._sortAcrossTiles=t.layout.get("symbol-z-order")!=="viewport-y"&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,s,n,l,p){const m=this._bucketParts;for(;this._currentTileIndex<t.length;)if(s.getBucketParts(m,l,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,p())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,m.sort((g,y)=>g.sortKey-y.sortKey));this._currentPartIndex<m.length;)if(s.placeLayerBucketPart(m[this._currentPartIndex],this._seenCrossTileIDs,n),this._currentPartIndex++,p())return!0;return!1}}class _s{constructor(t,s,n,l,p,m,g,y){this.placement=new ze(t,s,m,g,y),this._currentPlacementIndex=n.length-1,this._forceFullPlacement=l,this._showCollisionBoxes=p,this._done=!1}isDone(){return this._done}continuePlacement(t,s,n){const l=c.h.now(),p=()=>!this._forceFullPlacement&&c.h.now()-l>2;for(;this._currentPlacementIndex>=0;){const m=s[t[this._currentPlacementIndex]],g=this.placement.collisionIndex.transform.zoom;if(m.type==="symbol"&&(!m.minzoom||m.minzoom<=g)&&(!m.maxzoom||m.maxzoom>g)){if(this._inProgressLayer||(this._inProgressLayer=new co(m)),this._inProgressLayer.continuePlacement(n[m.source],this.placement,this._showCollisionBoxes,m,p))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const ys=512/c.N/2;class xl{constructor(t,s,n){this.tileID=t,this.bucketInstanceId=n,this._symbolsByKey={};const l=new Map;for(let p=0;p<s.length;p++){const m=s.get(p),g=m.key,y=l.get(g);y?y.push(m):l.set(g,[m])}for(const[p,m]of l){const g={positions:m.map(y=>({x:Math.floor(y.anchorX*ys),y:Math.floor(y.anchorY*ys)})),crossTileIDs:m.map(y=>y.crossTileID)};if(g.positions.length>128){const y=new c.av(g.positions.length,16,Uint16Array);for(const{x:v,y:w}of g.positions)y.add(v,w);y.finish(),delete g.positions,g.index=y}this._symbolsByKey[p]=g}}getScaledCoordinates(t,s){const{x:n,y:l,z:p}=this.tileID.canonical,{x:m,y:g,z:y}=s.canonical,v=ys/Math.pow(2,y-p),w=(g*c.N+t.anchorY)*v,S=l*c.N*ys;return{x:Math.floor((m*c.N+t.anchorX)*v-n*c.N*ys),y:Math.floor(w-S)}}findMatches(t,s,n){const l=this.tileID.canonical.z<s.canonical.z?1:Math.pow(2,this.tileID.canonical.z-s.canonical.z);for(let p=0;p<t.length;p++){const m=t.get(p);if(m.crossTileID)continue;const g=this._symbolsByKey[m.key];if(!g)continue;const y=this.getScaledCoordinates(m,s);if(g.index){const v=g.index.range(y.x-l,y.y-l,y.x+l,y.y+l).sort();for(const w of v){const S=g.crossTileIDs[w];if(!n[S]){n[S]=!0,m.crossTileID=S;break}}}else if(g.positions)for(let v=0;v<g.positions.length;v++){const w=g.positions[v],S=g.crossTileIDs[v];if(Math.abs(w.x-y.x)<=l&&Math.abs(w.y-y.y)<=l&&!n[S]){n[S]=!0,m.crossTileID=S;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:t})=>t)}}class it{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class rn{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const s=Math.round((t-this.lng)/360);if(s!==0)for(const n in this.indexes){const l=this.indexes[n],p={};for(const m in l){const g=l[m];g.tileID=g.tileID.unwrapTo(g.tileID.wrap+s),p[g.tileID.key]=g}this.indexes[n]=p}this.lng=t}addBucket(t,s,n){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===s.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let p=0;p<s.symbolInstances.length;p++)s.symbolInstances.get(p).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});const l=this.usedCrossTileIDs[t.overscaledZ];for(const p in this.indexes){const m=this.indexes[p];if(Number(p)>t.overscaledZ)for(const g in m){const y=m[g];y.tileID.isChildOf(t)&&y.findMatches(s.symbolInstances,t,l)}else{const g=m[t.scaledTo(Number(p)).key];g&&g.findMatches(s.symbolInstances,t,l)}}for(let p=0;p<s.symbolInstances.length;p++){const m=s.symbolInstances.get(p);m.crossTileID||(m.crossTileID=n.generate(),l[m.crossTileID]=!0)}return this.indexes[t.overscaledZ]===void 0&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new xl(t,s.symbolInstances,s.bucketInstanceId),!0}removeBucketCrossTileIDs(t,s){for(const n of s.getCrossTileIDsLists())for(const l of n)delete this.usedCrossTileIDs[t][l]}removeStaleBuckets(t){let s=!1;for(const n in this.indexes){const l=this.indexes[n];for(const p in l)t[l[p].bucketInstanceId]||(this.removeBucketCrossTileIDs(n,l[p]),delete l[p],s=!0)}return s}}class ma{constructor(){this.layerIndexes={},this.crossTileIDs=new it,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,s,n){let l=this.layerIndexes[t.id];l===void 0&&(l=this.layerIndexes[t.id]=new rn);let p=!1;const m={};l.handleWrapJump(n);for(const g of s){const y=g.getBucket(t);y&&t.id===y.layerIds[0]&&(y.bucketInstanceId||(y.bucketInstanceId=++this.maxBucketInstanceId),l.addBucket(g.tileID,y,this.crossTileIDs)&&(p=!0),m[y.bucketInstanceId]=!0)}return l.removeStaleBuckets(m)&&(p=!0),p}pruneUnusedLayers(t){const s={};t.forEach(n=>{s[n]=!0});for(const n in this.layerIndexes)s[n]||delete this.layerIndexes[n]}}const Ht=(h,t)=>c.x(h,t&&t.filter(s=>s.identifier!=="source.canvas")),bi=c.F(c.ax,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setGlyphs","setSprite"]),vl=c.F(c.ax,["setCenter","setZoom","setBearing","setPitch"]),Bi=c.aw();class qt extends c.E{constructor(t,s={}){super(),this.map=t,this.dispatcher=new Us(fa(),this,t._getMapId()),this.imageManager=new $i,this.imageManager.setEventedParent(this),this.glyphManager=new cr(t._requestManager,s.localIdeographFontFamily),this.lineAtlas=new da(256,512),this.crossTileSymbolIndex=new ma,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new c.ay,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",c.az());const n=this;this._rtlTextPluginCallback=qt.registerForPluginStateChange(l=>{n.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:l.pluginStatus,pluginURL:l.pluginURL},(p,m)=>{if(c.aA(p),m&&m.every(g=>g))for(const g in n.sourceCaches){const y=n.sourceCaches[g].getSource().type;y!=="vector"&&y!=="geojson"||n.sourceCaches[g].reload()}})}),this.on("data",l=>{if(l.dataType!=="source"||l.sourceDataType!=="metadata")return;const p=this.sourceCaches[l.sourceId];if(!p)return;const m=p.getSource();if(m&&m.vectorLayerIds)for(const g in this._layers){const y=this._layers[g];y.source===m.id&&this._validateLayer(y)}})}loadURL(t,s={},n){this.fire(new c.k("dataloading",{dataType:"style"})),s.validate=typeof s.validate!="boolean"||s.validate;const l=this.map._requestManager.transformRequest(t,Pt.Style);this._request=c.f(l,(p,m)=>{this._request=null,p?this.fire(new c.j(p)):m&&this._load(m,s,n)})}loadJSON(t,s={},n){this.fire(new c.k("dataloading",{dataType:"style"})),this._request=c.h.frame(()=>{this._request=null,s.validate=s.validate!==!1,this._load(t,s,n)})}loadEmpty(){this.fire(new c.k("dataloading",{dataType:"style"})),this._load(Bi,{validate:!1})}_load(t,s,n){var l;const p=s.transformStyle?s.transformStyle(n,t):t;if(!s.validate||!Ht(this,c.y(p))){this._loaded=!0,this.stylesheet=p;for(const m in p.sources)this.addSource(m,p.sources[m],{validate:!1});p.sprite?this._loadSprite(p.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(p.glyphs),this._createLayers(),this.light=new Ns(this.stylesheet.light),this.map.setTerrain((l=this.stylesheet.terrain)!==null&&l!==void 0?l:null),this.fire(new c.k("data",{dataType:"style"})),this.fire(new c.k("style.load"))}}_createLayers(){const t=c.aB(this.stylesheet.layers);this.dispatcher.broadcast("setLayers",t),this._order=t.map(s=>s.id),this._layers={},this._serializedLayers=null;for(const s of t){const n=c.aC(s);n.setEventedParent(this,{layer:{id:s.id}}),this._layers[s.id]=n}}_loadSprite(t,s=!1,n=void 0){this.imageManager.setLoaded(!1),this._spriteRequest=function(l,p,m,g){const y=$t(l),v=y.length,w=m>1?"@2x":"",S={},E={},B={};for(const{id:L,url:F}of y){const z=p.transformRequest(p.normalizeSpriteURL(F,w,".json"),Pt.SpriteJSON),G=`${L}_${z.url}`;S[G]=c.f(z,(X,ee)=>{delete S[G],E[L]=ee,pa(g,E,B,X,v)});const J=p.transformRequest(p.normalizeSpriteURL(F,w,".png"),Pt.SpriteImage),U=`${L}_${J.url}`;S[U]=ei.getImage(J,(X,ee)=>{delete S[U],B[L]=ee,pa(g,E,B,X,v)})}return{cancel(){for(const L of Object.values(S))L.cancel()}}}(t,this.map._requestManager,this.map.getPixelRatio(),(l,p)=>{if(this._spriteRequest=null,l)this.fire(new c.j(l));else if(p)for(const m in p){this._spritesImagesIds[m]=[];const g=this._spritesImagesIds[m]?this._spritesImagesIds[m].filter(y=>!(y in p)):[];for(const y of g)this.imageManager.removeImage(y),this._changedImages[y]=!0;for(const y in p[m]){const v=m==="default"?y:`${m}:${y}`;this._spritesImagesIds[m].push(v),v in this.imageManager.images?this.imageManager.updateImage(v,p[m][y],!1):this.imageManager.addImage(v,p[m][y]),s&&(this._changedImages[v]=!0)}}this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),s&&(this._changed=!0),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new c.k("data",{dataType:"style"})),n&&n(l)})}_unloadSprite(){for(const t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}_validateLayer(t){const s=this.sourceCaches[t.source];if(!s)return;const n=t.sourceLayer;if(!n)return;const l=s.getSource();(l.type==="geojson"||l.vectorLayerIds&&l.vectorLayerIds.indexOf(n)===-1)&&this.fire(new c.j(new Error(`Source layer "${n}" does not exist on source "${l.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t){const s=this._serializedAllLayers();if(!t||t.length===0)return Object.values(s);const n=[];for(const l of t)s[l]&&n.push(s[l]);return n}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};const s=Object.keys(this._layers);for(const n of s){const l=this._layers[n];l.type!=="custom"&&(t[n]=l.serialize())}return t}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(const t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;const s=this._changed;if(this._changed){const l=Object.keys(this._updatedLayers),p=Object.keys(this._removedLayers);(l.length||p.length)&&this._updateWorkerLayers(l,p);for(const m in this._updatedSources){const g=this._updatedSources[m];if(g==="reload")this._reloadSource(m);else{if(g!=="clear")throw new Error(`Invalid action ${g}`);this._clearSource(m)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const m in this._updatedPaintProps)this._layers[m].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}const n={};for(const l in this.sourceCaches){const p=this.sourceCaches[l];n[l]=p.used,p.used=!1}for(const l of this._order){const p=this._layers[l];p.recalculate(t,this._availableImages),!p.isHidden(t.zoom)&&p.source&&(this.sourceCaches[p.source].used=!0)}for(const l in n){const p=this.sourceCaches[l];n[l]!==p.used&&p.fire(new c.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:l}))}this.light.recalculate(t),this.z=t.zoom,s&&this.fire(new c.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const s in this.sourceCaches)this.sourceCaches[s].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,s){this.dispatcher.broadcast("updateLayers",{layers:this._serializeByIds(t),removedIds:s})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,s={}){this._checkLoaded();const n=this.serialize();if(t=s.transformStyle?s.transformStyle(n,t):t,Ht(this,c.y(t)))return!1;(t=c.aD(t)).layers=c.aB(t.layers);const l=c.aE(n,t).filter(m=>!(m.command in vl));if(l.length===0)return!1;const p=l.filter(m=>!(m.command in bi));if(p.length>0)throw new Error(`Unimplemented: ${p.map(m=>m.command).join(", ")}.`);for(const m of l)m.command!=="setTransition"&&this[m.command].apply(this,m.args);return this.stylesheet=t,this._serializedLayers=null,!0}addImage(t,s){if(this.getImage(t))return this.fire(new c.j(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,s),this._afterImageUpdated(t)}updateImage(t,s){this.imageManager.updateImage(t,s)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new c.j(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,s,n={}){if(this._checkLoaded(),this.sourceCaches[t]!==void 0)throw new Error(`Source "${t}" already exists.`);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(c.y.source,`sources.${t}`,s,null,n))return;this.map&&this.map._collectResourceTiming&&(s.collectResourceTiming=!0);const l=this.sourceCaches[t]=new ui(t,s,this.dispatcher);l.style=this,l.setEventedParent(this,()=>({isSourceLoaded:l.loaded(),source:l.serialize(),sourceId:t})),l.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error("There is no source with this ID");for(const n in this._layers)if(this._layers[n].source===t)return this.fire(new c.j(new Error(`Source "${t}" cannot be removed while layer "${n}" is using it.`)));const s=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],s.fire(new c.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),s.setEventedParent(null),s.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,s){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error(`There is no source with this ID=${t}`);const n=this.sourceCaches[t].getSource();if(n.type!=="geojson")throw new Error(`geojsonSource.type is ${n.type}, which is !== 'geojson`);n.setData(s),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,s,n={}){this._checkLoaded();const l=t.id;if(this.getLayer(l))return void this.fire(new c.j(new Error(`Layer "${l}" already exists on this map.`)));let p;if(t.type==="custom"){if(Ht(this,c.aF(t)))return;p=c.aC(t)}else{if("source"in t&&typeof t.source=="object"&&(this.addSource(l,t.source),t=c.aD(t),t=c.e(t,{source:l})),this._validate(c.y.layer,`layers.${l}`,t,{arrayIndex:-1},n))return;p=c.aC(t),this._validateLayer(p),p.setEventedParent(this,{layer:{id:l}})}const m=s?this._order.indexOf(s):this._order.length;if(s&&m===-1)this.fire(new c.j(new Error(`Cannot add layer "${l}" before non-existing layer "${s}".`)));else{if(this._order.splice(m,0,l),this._layerOrderChanged=!0,this._layers[l]=p,this._removedLayers[l]&&p.source&&p.type!=="custom"){const g=this._removedLayers[l];delete this._removedLayers[l],g.type!==p.type?this._updatedSources[p.source]="clear":(this._updatedSources[p.source]="reload",this.sourceCaches[p.source].pause())}this._updateLayer(p),p.onAdd&&p.onAdd(this.map)}}moveLayer(t,s){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new c.j(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===s)return;const n=this._order.indexOf(t);this._order.splice(n,1);const l=s?this._order.indexOf(s):this._order.length;s&&l===-1?this.fire(new c.j(new Error(`Cannot move layer "${t}" before non-existing layer "${s}".`))):(this._order.splice(l,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const s=this._layers[t];if(!s)return void this.fire(new c.j(new Error(`Cannot remove non-existing layer "${t}".`)));s.setEventedParent(null);const n=this._order.indexOf(t);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=s,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],s.onRemove&&s.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,s,n){this._checkLoaded();const l=this.getLayer(t);l?l.minzoom===s&&l.maxzoom===n||(s!=null&&(l.minzoom=s),n!=null&&(l.maxzoom=n),this._updateLayer(l)):this.fire(new c.j(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,s,n={}){this._checkLoaded();const l=this.getLayer(t);if(l){if(!c.aG(l.filter,s))return s==null?(l.filter=void 0,void this._updateLayer(l)):void(this._validate(c.y.filter,`layers.${l.id}.filter`,s,null,n)||(l.filter=c.aD(s),this._updateLayer(l)))}else this.fire(new c.j(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return c.aD(this.getLayer(t).filter)}setLayoutProperty(t,s,n,l={}){this._checkLoaded();const p=this.getLayer(t);p?c.aG(p.getLayoutProperty(s),n)||(p.setLayoutProperty(s,n,l),this._updateLayer(p)):this.fire(new c.j(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,s){const n=this.getLayer(t);if(n)return n.getLayoutProperty(s);this.fire(new c.j(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,s,n,l={}){this._checkLoaded();const p=this.getLayer(t);p?c.aG(p.getPaintProperty(s),n)||(p.setPaintProperty(s,n,l)&&this._updateLayer(p),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new c.j(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,s){return this.getLayer(t).getPaintProperty(s)}setFeatureState(t,s){this._checkLoaded();const n=t.source,l=t.sourceLayer,p=this.sourceCaches[n];if(p===void 0)return void this.fire(new c.j(new Error(`The source '${n}' does not exist in the map's style.`)));const m=p.getSource().type;m==="geojson"&&l?this.fire(new c.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):m!=="vector"||l?(t.id===void 0&&this.fire(new c.j(new Error("The feature id parameter must be provided."))),p.setFeatureState(l,t.id,s)):this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,s){this._checkLoaded();const n=t.source,l=this.sourceCaches[n];if(l===void 0)return void this.fire(new c.j(new Error(`The source '${n}' does not exist in the map's style.`)));const p=l.getSource().type,m=p==="vector"?t.sourceLayer:void 0;p!=="vector"||m?s&&typeof t.id!="string"&&typeof t.id!="number"?this.fire(new c.j(new Error("A feature id is required to remove its specific state property."))):l.removeFeatureState(m,t.id,s):this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const s=t.source,n=t.sourceLayer,l=this.sourceCaches[s];if(l!==void 0)return l.getSource().type!=="vector"||n?(t.id===void 0&&this.fire(new c.j(new Error("The feature id parameter must be provided."))),l.getFeatureState(n,t.id)):void this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new c.j(new Error(`The source '${s}' does not exist in the map's style.`)))}getTransition(){return c.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const t=c.aH(this.sourceCaches,p=>p.serialize()),s=this._serializeByIds(this._order),n=this.map.getTerrain()||void 0,l=this.stylesheet;return c.aI({version:l.version,name:l.name,metadata:l.metadata,light:l.light,center:l.center,zoom:l.zoom,bearing:l.bearing,pitch:l.pitch,sprite:l.sprite,glyphs:l.glyphs,transition:l.transition,sources:t,layers:s,terrain:n},p=>p!==void 0)}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&this.sourceCaches[t.source].getSource().type!=="raster"&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){const s=m=>this._layers[m].type==="fill-extrusion",n={},l=[];for(let m=this._order.length-1;m>=0;m--){const g=this._order[m];if(s(g)){n[g]=m;for(const y of t){const v=y[g];if(v)for(const w of v)l.push(w)}}}l.sort((m,g)=>g.intersectionZ-m.intersectionZ);const p=[];for(let m=this._order.length-1;m>=0;m--){const g=this._order[m];if(s(g))for(let y=l.length-1;y>=0;y--){const v=l[y].feature;if(n[v.layer.id]<m)break;p.push(v),l.pop()}else for(const y of t){const v=y[g];if(v)for(const w of v)p.push(w.feature)}}return p}queryRenderedFeatures(t,s,n){s&&s.filter&&this._validate(c.y.filter,"queryRenderedFeatures.filter",s.filter,null,s);const l={};if(s&&s.layers){if(!Array.isArray(s.layers))return this.fire(new c.j(new Error("parameters.layers must be an Array."))),[];for(const g of s.layers){const y=this._layers[g];if(!y)return this.fire(new c.j(new Error(`The layer '${g}' does not exist in the map's style and cannot be queried for features.`))),[];l[y.source]=!0}}const p=[];s.availableImages=this._availableImages;const m=this._serializedAllLayers();for(const g in this.sourceCaches)s.layers&&!l[g]||p.push($r(this.sourceCaches[g],this._layers,m,t,s,n));return this.placement&&p.push(function(g,y,v,w,S,E,B){const L={},F=E.queryRenderedSymbols(w),z=[];for(const G of Object.keys(F).map(Number))z.push(B[G]);z.sort(Er);for(const G of z){const J=G.featureIndex.lookupSymbolFeatures(F[G.bucketInstanceId],y,G.bucketIndex,G.sourceLayerIndex,S.filter,S.layers,S.availableImages,g);for(const U in J){const X=L[U]=L[U]||[],ee=J[U];ee.sort((te,ne)=>{const he=G.featureSortOrder;if(he){const ce=he.indexOf(te.featureIndex);return he.indexOf(ne.featureIndex)-ce}return ne.featureIndex-te.featureIndex});for(const te of ee)X.push(te)}}for(const G in L)L[G].forEach(J=>{const U=J.feature,X=v[g[G].source].getFeatureState(U.layer["source-layer"],U.id);U.source=U.layer.source,U.layer["source-layer"]&&(U.sourceLayer=U.layer["source-layer"]),U.state=X});return L}(this._layers,m,this.sourceCaches,t,s,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(p)}querySourceFeatures(t,s){s&&s.filter&&this._validate(c.y.filter,"querySourceFeatures.filter",s.filter,null,s);const n=this.sourceCaches[t];return n?function(l,p){const m=l.getRenderableIds().map(v=>l.getTileByID(v)),g=[],y={};for(let v=0;v<m.length;v++){const w=m[v],S=w.tileID.canonical.key;y[S]||(y[S]=!0,w.querySourceFeatures(g,p))}return g}(n,s):[]}addSourceType(t,s,n){return hr(t)?n(new Error(`A source type called "${t}" already exists.`)):(((l,p)=>{js[l]=p})(t,s),s.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:s.workerSourceURL},n):n(null,null))}getLight(){return this.light.getLight()}setLight(t,s={}){this._checkLoaded();const n=this.light.getLight();let l=!1;for(const m in t)if(!c.aG(t[m],n[m])){l=!0;break}if(!l)return;const p={now:c.h.now(),transition:c.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,s),this.light.updateTransitions(p)}_validate(t,s,n,l,p={}){return(!p||p.validate!==!1)&&Ht(this,t.call(c.y,c.e({key:s,style:this.serialize(),value:n,styleSpec:c.v},l)))}_remove(t=!0){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),c.aJ.off("pluginStateChange",this._rtlTextPluginCallback);for(const s in this._layers)this._layers[s].setEventedParent(null);for(const s in this.sourceCaches){const n=this.sourceCaches[s];n.setEventedParent(null),n.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove(t)}_clearSource(t){this.sourceCaches[t].clearTiles()}_reloadSource(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()}_updateSources(t){for(const s in this.sourceCaches)this.sourceCaches[s].update(t,this.map.terrain)}_generateCollisionBoxes(){for(const t in this.sourceCaches)this._reloadSource(t)}_updatePlacement(t,s,n,l,p=!1){let m=!1,g=!1;const y={};for(const v of this._order){const w=this._layers[v];if(w.type!=="symbol")continue;if(!y[w.source]){const E=this.sourceCaches[w.source];y[w.source]=E.getRenderableIds(!0).map(B=>E.getTileByID(B)).sort((B,L)=>L.tileID.overscaledZ-B.tileID.overscaledZ||(B.tileID.isLessThan(L.tileID)?-1:1))}const S=this.crossTileSymbolIndex.addLayer(w,y[w.source],t.center.lng);m=m||S}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((p=p||this._layerOrderChanged||n===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(c.h.now(),t.zoom))&&(this.pauseablePlacement=new _s(t,this.map.terrain,this._order,p,s,n,l,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,y),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(c.h.now()),g=!0),m&&this.pauseablePlacement.placement.setStale()),g||m)for(const v of this._order){const w=this._layers[v];w.type==="symbol"&&this.placement.updateLayerOpacities(w,y[w.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(c.h.now())}_releaseSymbolFadeTiles(){for(const t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,s,n){this.imageManager.getImages(s.icons,n),this._updateTilesForChangedImages();const l=this.sourceCaches[s.source];l&&l.setDependencies(s.tileID.key,s.type,s.icons)}getGlyphs(t,s,n){this.glyphManager.getGlyphs(s.stacks,n);const l=this.sourceCaches[s.source];l&&l.setDependencies(s.tileID.key,s.type,[""])}getResource(t,s,n){return c.m(s,n)}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,s={}){this._checkLoaded(),t&&this._validate(c.y.glyphs,"glyphs",t,null,s)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}addSprite(t,s,n={},l){this._checkLoaded();const p=[{id:t,url:s}],m=[...$t(this.stylesheet.sprite),...p];this._validate(c.y.sprite,"sprite",m,null,n)||(this.stylesheet.sprite=m,this._loadSprite(p,!0,l))}removeSprite(t){this._checkLoaded();const s=$t(this.stylesheet.sprite);if(s.find(n=>n.id===t)){if(this._spritesImagesIds[t])for(const n of this._spritesImagesIds[t])this.imageManager.removeImage(n),this._changedImages[n]=!0;s.splice(s.findIndex(n=>n.id===t),1),this.stylesheet.sprite=s.length>0?s:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}else this.fire(new c.j(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return $t(this.stylesheet.sprite)}setSprite(t,s={},n){this._checkLoaded(),t&&this._validate(c.y.sprite,"sprite",t,null,s)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,n):(this._unloadSprite(),n&&n(null)))}}qt.registerForPluginStateChange=c.aK;var ga=c.Q([{name:"a_pos",type:"Int16",components:2}]),xs="attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_depth;void main() {float extent=8192.0;float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/extent;gl_Position=u_matrix*vec4(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}";const gt={prelude:Je(`#ifdef GL_ES
3
3
  precision mediump float;
4
4
  #else