@mapgis/mapbox-gl 16.0.0 → 16.2.0

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 (441) hide show
  1. package/dist/mapbox-gl.js +4 -4
  2. package/dist/mapbox-gl.js.map +1 -1
  3. package/package.json +4 -5
  4. package/.flowconfig +0 -61
  5. package/LICENSE.txt +0 -84
  6. package/README.md +0 -34
  7. package/build/banner.js +0 -4
  8. package/build/check-bundle-size.js +0 -140
  9. package/build/generate-access-token-script.js +0 -11
  10. package/build/generate-flow-typed-style-spec.js +0 -188
  11. package/build/generate-release-list.js +0 -21
  12. package/build/generate-struct-arrays.js +0 -237
  13. package/build/generate-style-code.js +0 -159
  14. package/build/mapbox-gl.js.flow +0 -3
  15. package/build/print-release-url.js +0 -6
  16. package/build/rollup_plugin_minify_style_spec.js +0 -20
  17. package/build/rollup_plugins.js +0 -80
  18. package/build/run-node +0 -3
  19. package/build/run-tap +0 -8
  20. package/build/test/build-tape.js +0 -19
  21. package/dist/mapbox-gl-csp-worker.js +0 -2
  22. package/dist/mapbox-gl-csp-worker.js.map +0 -1
  23. package/dist/mapbox-gl-csp.js +0 -2
  24. package/dist/mapbox-gl-csp.js.map +0 -1
  25. package/dist/mapbox-gl-dev.js +0 -68798
  26. package/dist/mapbox-gl-unminified.js +0 -45076
  27. package/dist/mapbox-gl-unminified.js.map +0 -1
  28. package/flow-typed/gl.js +0 -5
  29. package/flow-typed/jsdom.js +0 -18
  30. package/flow-typed/mapbox-gl-supported.js +0 -9
  31. package/flow-typed/mapbox-unitbezier.js +0 -14
  32. package/flow-typed/offscreen-canvas.js +0 -9
  33. package/flow-typed/pbf.js +0 -25
  34. package/flow-typed/point-geometry.js +0 -44
  35. package/flow-typed/potpack.js +0 -12
  36. package/flow-typed/sinon.js +0 -28
  37. package/flow-typed/vector-tile.js +0 -41
  38. package/src/css/mapbox-gl.css +0 -798
  39. package/src/css/svg/mapboxgl-ctrl-attrib.svg +0 -3
  40. package/src/css/svg/mapboxgl-ctrl-compass.svg +0 -4
  41. package/src/css/svg/mapboxgl-ctrl-fullscreen.svg +0 -3
  42. package/src/css/svg/mapboxgl-ctrl-geolocate.svg +0 -5
  43. package/src/css/svg/mapboxgl-ctrl-logo.svg +0 -20
  44. package/src/css/svg/mapboxgl-ctrl-shrink.svg +0 -3
  45. package/src/css/svg/mapboxgl-ctrl-zoom-in.svg +0 -3
  46. package/src/css/svg/mapboxgl-ctrl-zoom-out.svg +0 -3
  47. package/src/data/array_types.js +0 -1095
  48. package/src/data/bucket/circle_attributes.js +0 -9
  49. package/src/data/bucket/circle_bucket.js +0 -204
  50. package/src/data/bucket/fill_attributes.js +0 -9
  51. package/src/data/bucket/fill_bucket.js +0 -233
  52. package/src/data/bucket/fill_extrusion_attributes.js +0 -10
  53. package/src/data/bucket/fill_extrusion_bucket.js +0 -289
  54. package/src/data/bucket/heatmap_bucket.js +0 -17
  55. package/src/data/bucket/line_attributes.js +0 -10
  56. package/src/data/bucket/line_bucket.js +0 -556
  57. package/src/data/bucket/pattern_attributes.js +0 -10
  58. package/src/data/bucket/pattern_bucket_features.js +0 -60
  59. package/src/data/bucket/symbol_attributes.js +0 -117
  60. package/src/data/bucket/symbol_bucket.js +0 -972
  61. package/src/data/bucket.js +0 -123
  62. package/src/data/dem_data.js +0 -125
  63. package/src/data/extent.js +0 -18
  64. package/src/data/feature_index.js +0 -321
  65. package/src/data/feature_position_map.js +0 -125
  66. package/src/data/index_array_type.js +0 -16
  67. package/src/data/load_geometry.js +0 -48
  68. package/src/data/pos_attributes.js +0 -6
  69. package/src/data/program_configuration.js +0 -687
  70. package/src/data/raster_bounds_attributes.js +0 -7
  71. package/src/data/segment.js +0 -76
  72. package/src/geo/edge_insets.js +0 -102
  73. package/src/geo/lng_lat.js +0 -165
  74. package/src/geo/lng_lat_bounds.js +0 -267
  75. package/src/geo/mercator_coordinate.js +0 -153
  76. package/src/geo/transform.js +0 -864
  77. package/src/gl/color_mode.js +0 -34
  78. package/src/gl/context.js +0 -298
  79. package/src/gl/cull_face_mode.js +0 -26
  80. package/src/gl/depth_mode.js +0 -29
  81. package/src/gl/framebuffer.js +0 -44
  82. package/src/gl/index_buffer.js +0 -55
  83. package/src/gl/stencil_mode.js +0 -30
  84. package/src/gl/types.js +0 -84
  85. package/src/gl/value.js +0 -520
  86. package/src/gl/vertex_buffer.js +0 -119
  87. package/src/index.js +0 -201
  88. package/src/render/draw_background.js +0 -57
  89. package/src/render/draw_circle.js +0 -113
  90. package/src/render/draw_collision_debug.js +0 -49
  91. package/src/render/draw_custom.js +0 -49
  92. package/src/render/draw_debug.js +0 -127
  93. package/src/render/draw_fill.js +0 -126
  94. package/src/render/draw_fill_extrusion.js +0 -96
  95. package/src/render/draw_heatmap.js +0 -140
  96. package/src/render/draw_hillshade.js +0 -108
  97. package/src/render/draw_line.js +0 -98
  98. package/src/render/draw_raster.js +0 -125
  99. package/src/render/draw_symbol.js +0 -394
  100. package/src/render/glyph_atlas.js +0 -71
  101. package/src/render/glyph_manager.js +0 -182
  102. package/src/render/image_atlas.js +0 -149
  103. package/src/render/image_manager.js +0 -306
  104. package/src/render/line_atlas.js +0 -210
  105. package/src/render/painter.js +0 -653
  106. package/src/render/program/background_program.js +0 -103
  107. package/src/render/program/circle_program.js +0 -69
  108. package/src/render/program/clipping_mask_program.js +0 -20
  109. package/src/render/program/collision_program.js +0 -49
  110. package/src/render/program/debug_program.js +0 -35
  111. package/src/render/program/fill_extrusion_program.js +0 -122
  112. package/src/render/program/fill_program.js +0 -126
  113. package/src/render/program/heatmap_program.js +0 -83
  114. package/src/render/program/hillshade_program.js +0 -122
  115. package/src/render/program/line_program.js +0 -207
  116. package/src/render/program/pattern.js +0 -102
  117. package/src/render/program/program_uniforms.js +0 -42
  118. package/src/render/program/raster_program.js +0 -92
  119. package/src/render/program/symbol_program.js +0 -224
  120. package/src/render/program.js +0 -168
  121. package/src/render/texture.js +0 -122
  122. package/src/render/uniform_binding.js +0 -147
  123. package/src/render/vertex_array_object.js +0 -163
  124. package/src/shaders/README.md +0 -42
  125. package/src/shaders/_prelude.fragment.glsl +0 -17
  126. package/src/shaders/_prelude.vertex.glsl +0 -73
  127. package/src/shaders/background.fragment.glsl +0 -10
  128. package/src/shaders/background.vertex.glsl +0 -7
  129. package/src/shaders/background_pattern.fragment.glsl +0 -28
  130. package/src/shaders/background_pattern.vertex.glsl +0 -20
  131. package/src/shaders/circle.fragment.glsl +0 -39
  132. package/src/shaders/circle.vertex.glsl +0 -64
  133. package/src/shaders/clipping_mask.fragment.glsl +0 -3
  134. package/src/shaders/clipping_mask.vertex.glsl +0 -7
  135. package/src/shaders/collision_box.fragment.glsl +0 -21
  136. package/src/shaders/collision_box.vertex.glsl +0 -27
  137. package/src/shaders/collision_circle.fragment.glsl +0 -34
  138. package/src/shaders/collision_circle.vertex.glsl +0 -36
  139. package/src/shaders/debug.fragment.glsl +0 -9
  140. package/src/shaders/debug.vertex.glsl +0 -12
  141. package/src/shaders/encode_attribute.js +0 -17
  142. package/src/shaders/fill.fragment.glsl +0 -13
  143. package/src/shaders/fill.vertex.glsl +0 -13
  144. package/src/shaders/fill_extrusion.fragment.glsl +0 -9
  145. package/src/shaders/fill_extrusion.vertex.glsl +0 -66
  146. package/src/shaders/fill_extrusion_pattern.fragment.glsl +0 -45
  147. package/src/shaders/fill_extrusion_pattern.vertex.glsl +0 -79
  148. package/src/shaders/fill_outline.fragment.glsl +0 -17
  149. package/src/shaders/fill_outline.vertex.glsl +0 -17
  150. package/src/shaders/fill_outline_pattern.fragment.glsl +0 -43
  151. package/src/shaders/fill_outline_pattern.vertex.glsl +0 -44
  152. package/src/shaders/fill_pattern.fragment.glsl +0 -36
  153. package/src/shaders/fill_pattern.vertex.glsl +0 -39
  154. package/src/shaders/heatmap.fragment.glsl +0 -22
  155. package/src/shaders/heatmap.vertex.glsl +0 -54
  156. package/src/shaders/heatmap_texture.fragment.glsl +0 -14
  157. package/src/shaders/heatmap_texture.vertex.glsl +0 -11
  158. package/src/shaders/hillshade.fragment.glsl +0 -52
  159. package/src/shaders/hillshade.vertex.glsl +0 -11
  160. package/src/shaders/hillshade_prepare.fragment.glsl +0 -74
  161. package/src/shaders/hillshade_prepare.vertex.glsl +0 -15
  162. package/src/shaders/index.js +0 -20
  163. package/src/shaders/line.fragment.glsl +0 -30
  164. package/src/shaders/line.vertex.glsl +0 -85
  165. package/src/shaders/line_gradient.fragment.glsl +0 -34
  166. package/src/shaders/line_gradient.vertex.glsl +0 -87
  167. package/src/shaders/line_pattern.fragment.glsl +0 -74
  168. package/src/shaders/line_pattern.vertex.glsl +0 -99
  169. package/src/shaders/line_sdf.fragment.glsl +0 -45
  170. package/src/shaders/line_sdf.vertex.glsl +0 -98
  171. package/src/shaders/raster.fragment.glsl +0 -52
  172. package/src/shaders/raster.vertex.glsl +0 -21
  173. package/src/shaders/shaders.js +0 -180
  174. package/src/shaders/symbol_icon.fragment.glsl +0 -17
  175. package/src/shaders/symbol_icon.vertex.glsl +0 -94
  176. package/src/shaders/symbol_sdf.fragment.glsl +0 -52
  177. package/src/shaders/symbol_sdf.vertex.glsl +0 -115
  178. package/src/shaders/symbol_text_and_icon.fragment.glsl +0 -68
  179. package/src/shaders/symbol_text_and_icon.vertex.glsl +0 -116
  180. package/src/source/canvas_source.js +0 -238
  181. package/src/source/geojson_helper.js +0 -92
  182. package/src/source/geojson_source.js +0 -374
  183. package/src/source/geojson_worker_source.js +0 -357
  184. package/src/source/geojson_wrapper.js +0 -94
  185. package/src/source/image_source.js +0 -307
  186. package/src/source/load_tilejson.js +0 -39
  187. package/src/source/mbtiles_source.js +0 -115
  188. package/src/source/offline_database.js +0 -61
  189. package/src/source/offline_database_root.js +0 -62
  190. package/src/source/pixels_to_tile_units.js +0 -21
  191. package/src/source/query_features.js +0 -208
  192. package/src/source/raster_dem_tile_source.js +0 -138
  193. package/src/source/raster_dem_tile_worker_source.js +0 -62
  194. package/src/source/raster_tile_offline_source.js +0 -136
  195. package/src/source/raster_tile_source.js +0 -177
  196. package/src/source/rtl_text_plugin.js +0 -138
  197. package/src/source/source.js +0 -137
  198. package/src/source/source_cache.js +0 -957
  199. package/src/source/source_state.js +0 -159
  200. package/src/source/tile.js +0 -465
  201. package/src/source/tile_bounds.js +0 -38
  202. package/src/source/tile_cache.js +0 -212
  203. package/src/source/tile_id.js +0 -402
  204. package/src/source/vector_tile_source.js +0 -192
  205. package/src/source/vector_tile_worker_source.js +0 -216
  206. package/src/source/video_source.js +0 -203
  207. package/src/source/worker.js +0 -237
  208. package/src/source/worker_source.js +0 -106
  209. package/src/source/worker_tile.js +0 -224
  210. package/src/style/create_style_layer.js +0 -36
  211. package/src/style/evaluation_parameters.js +0 -62
  212. package/src/style/light.js +0 -130
  213. package/src/style/load_glyph_range.js +0 -38
  214. package/src/style/load_sprite.js +0 -67
  215. package/src/style/parse_glyph_pbf.js +0 -44
  216. package/src/style/pauseable_placement.js +0 -132
  217. package/src/style/properties.js +0 -753
  218. package/src/style/query_utils.js +0 -43
  219. package/src/style/style.js +0 -1361
  220. package/src/style/style_glyph.js +0 -17
  221. package/src/style/style_image.js +0 -137
  222. package/src/style/style_layer/background_style_layer.js +0 -21
  223. package/src/style/style_layer/background_style_layer_properties.js +0 -40
  224. package/src/style/style_layer/circle_style_layer.js +0 -98
  225. package/src/style/style_layer/circle_style_layer_properties.js +0 -63
  226. package/src/style/style_layer/custom_style_layer.js +0 -223
  227. package/src/style/style_layer/fill_extrusion_style_layer.js +0 -224
  228. package/src/style/style_layer/fill_extrusion_style_layer_properties.js +0 -50
  229. package/src/style/style_layer/fill_style_layer.js +0 -67
  230. package/src/style/style_layer/fill_style_layer_properties.js +0 -55
  231. package/src/style/style_layer/heatmap_style_layer.js +0 -69
  232. package/src/style/style_layer/heatmap_style_layer_properties.js +0 -44
  233. package/src/style/style_layer/hillshade_style_layer.js +0 -25
  234. package/src/style/style_layer/hillshade_style_layer_properties.js +0 -46
  235. package/src/style/style_layer/layer_properties.js.ejs +0 -69
  236. package/src/style/style_layer/line_style_layer.js +0 -151
  237. package/src/style/style_layer/line_style_layer_properties.js +0 -71
  238. package/src/style/style_layer/raster_style_layer.js +0 -21
  239. package/src/style/style_layer/raster_style_layer_properties.js +0 -50
  240. package/src/style/style_layer/symbol_style_layer.js +0 -190
  241. package/src/style/style_layer/symbol_style_layer_properties.js +0 -153
  242. package/src/style/style_layer/typed_style_layer.js +0 -17
  243. package/src/style/style_layer.js +0 -281
  244. package/src/style/style_layer_index.js +0 -80
  245. package/src/style/validate_style.js +0 -42
  246. package/src/style/zoom_history.js +0 -44
  247. package/src/style-spec/.eslintrc +0 -5
  248. package/src/style-spec/CHANGELOG.md +0 -438
  249. package/src/style-spec/README.md +0 -59
  250. package/src/style-spec/bin/gl-style-composite +0 -9
  251. package/src/style-spec/bin/gl-style-format +0 -22
  252. package/src/style-spec/bin/gl-style-migrate +0 -9
  253. package/src/style-spec/bin/gl-style-validate +0 -50
  254. package/src/style-spec/composite.js +0 -50
  255. package/src/style-spec/declass.js +0 -42
  256. package/src/style-spec/deref.js +0 -52
  257. package/src/style-spec/diff.js +0 -393
  258. package/src/style-spec/dist/.gitkeep +0 -0
  259. package/src/style-spec/empty.js +0 -29
  260. package/src/style-spec/error/parsing_error.js +0 -16
  261. package/src/style-spec/error/validation_error.js +0 -18
  262. package/src/style-spec/expression/compound_expression.js +0 -162
  263. package/src/style-spec/expression/definitions/assertion.js +0 -130
  264. package/src/style-spec/expression/definitions/at.js +0 -70
  265. package/src/style-spec/expression/definitions/case.js +0 -85
  266. package/src/style-spec/expression/definitions/coalesce.js +0 -93
  267. package/src/style-spec/expression/definitions/coercion.js +0 -133
  268. package/src/style-spec/expression/definitions/collator.js +0 -78
  269. package/src/style-spec/expression/definitions/comparison.js +0 -184
  270. package/src/style-spec/expression/definitions/format.js +0 -144
  271. package/src/style-spec/expression/definitions/format_section_override.js +0 -54
  272. package/src/style-spec/expression/definitions/image.js +0 -52
  273. package/src/style-spec/expression/definitions/in.js +0 -92
  274. package/src/style-spec/expression/definitions/index.js +0 -561
  275. package/src/style-spec/expression/definitions/interpolate.js +0 -267
  276. package/src/style-spec/expression/definitions/length.js +0 -61
  277. package/src/style-spec/expression/definitions/let.js +0 -72
  278. package/src/style-spec/expression/definitions/literal.js +0 -77
  279. package/src/style-spec/expression/definitions/match.js +0 -158
  280. package/src/style-spec/expression/definitions/number_format.js +0 -142
  281. package/src/style-spec/expression/definitions/step.js +0 -120
  282. package/src/style-spec/expression/definitions/var.js +0 -46
  283. package/src/style-spec/expression/definitions/within.js +0 -333
  284. package/src/style-spec/expression/evaluation_context.js +0 -59
  285. package/src/style-spec/expression/expression.js +0 -27
  286. package/src/style-spec/expression/index.js +0 -392
  287. package/src/style-spec/expression/is_constant.js +0 -59
  288. package/src/style-spec/expression/parsing_context.js +0 -233
  289. package/src/style-spec/expression/parsing_error.js +0 -13
  290. package/src/style-spec/expression/runtime_error.js +0 -17
  291. package/src/style-spec/expression/scope.js +0 -36
  292. package/src/style-spec/expression/stops.js +0 -39
  293. package/src/style-spec/expression/types/collator.js +0 -61
  294. package/src/style-spec/expression/types/formatted.js +0 -73
  295. package/src/style-spec/expression/types/resolved_image.js +0 -29
  296. package/src/style-spec/expression/types.js +0 -106
  297. package/src/style-spec/expression/values.js +0 -123
  298. package/src/style-spec/feature_filter/README.md +0 -55
  299. package/src/style-spec/feature_filter/convert.js +0 -208
  300. package/src/style-spec/feature_filter/index.js +0 -165
  301. package/src/style-spec/format.js +0 -51
  302. package/src/style-spec/function/convert.js +0 -254
  303. package/src/style-spec/function/index.js +0 -262
  304. package/src/style-spec/group_by_layout.js +0 -75
  305. package/src/style-spec/migrate/expressions.js +0 -39
  306. package/src/style-spec/migrate/v8.js +0 -203
  307. package/src/style-spec/migrate/v9.js +0 -26
  308. package/src/style-spec/migrate.js +0 -36
  309. package/src/style-spec/package.json +0 -41
  310. package/src/style-spec/read_style.js +0 -14
  311. package/src/style-spec/reference/latest.js +0 -3
  312. package/src/style-spec/reference/v8.json +0 -5808
  313. package/src/style-spec/rollup.config.js +0 -45
  314. package/src/style-spec/style-spec.js +0 -122
  315. package/src/style-spec/types.js +0 -438
  316. package/src/style-spec/util/color.js +0 -95
  317. package/src/style-spec/util/color_spaces.js +0 -139
  318. package/src/style-spec/util/deep_equal.js +0 -28
  319. package/src/style-spec/util/extend.js +0 -10
  320. package/src/style-spec/util/get_type.js +0 -17
  321. package/src/style-spec/util/interpolate.js +0 -22
  322. package/src/style-spec/util/properties.js +0 -15
  323. package/src/style-spec/util/ref_properties.js +0 -2
  324. package/src/style-spec/util/result.js +0 -19
  325. package/src/style-spec/util/unbundle_jsonlint.js +0 -24
  326. package/src/style-spec/validate/latest.js +0 -11
  327. package/src/style-spec/validate/validate.js +0 -75
  328. package/src/style-spec/validate/validate_array.js +0 -52
  329. package/src/style-spec/validate/validate_boolean.js +0 -15
  330. package/src/style-spec/validate/validate_color.js +0 -20
  331. package/src/style-spec/validate/validate_constants.js +0 -13
  332. package/src/style-spec/validate/validate_enum.js +0 -21
  333. package/src/style-spec/validate/validate_expression.js +0 -43
  334. package/src/style-spec/validate/validate_filter.js +0 -111
  335. package/src/style-spec/validate/validate_formatted.js +0 -11
  336. package/src/style-spec/validate/validate_function.js +0 -207
  337. package/src/style-spec/validate/validate_glyphs_url.js +0 -21
  338. package/src/style-spec/validate/validate_image.js +0 -11
  339. package/src/style-spec/validate/validate_layer.js +0 -134
  340. package/src/style-spec/validate/validate_layout_property.js +0 -6
  341. package/src/style-spec/validate/validate_light.js +0 -47
  342. package/src/style-spec/validate/validate_number.js +0 -29
  343. package/src/style-spec/validate/validate_object.js +0 -61
  344. package/src/style-spec/validate/validate_paint_property.js +0 -6
  345. package/src/style-spec/validate/validate_property.js +0 -64
  346. package/src/style-spec/validate/validate_source.js +0 -111
  347. package/src/style-spec/validate/validate_string.js +0 -15
  348. package/src/style-spec/validate_mapbox_api_supported.js +0 -171
  349. package/src/style-spec/validate_style.js +0 -39
  350. package/src/style-spec/validate_style.min.js +0 -78
  351. package/src/style-spec/visit.js +0 -77
  352. package/src/symbol/anchor.js +0 -26
  353. package/src/symbol/check_max_angle.js +0 -81
  354. package/src/symbol/clip_line.js +0 -71
  355. package/src/symbol/collision_feature.js +0 -217
  356. package/src/symbol/collision_index.js +0 -372
  357. package/src/symbol/cross_tile_symbol_index.js +0 -301
  358. package/src/symbol/get_anchors.js +0 -167
  359. package/src/symbol/grid_index.js +0 -335
  360. package/src/symbol/mergelines.js +0 -82
  361. package/src/symbol/one_em.js +0 -4
  362. package/src/symbol/opacity_state.js +0 -27
  363. package/src/symbol/placement.js +0 -1062
  364. package/src/symbol/projection.js +0 -450
  365. package/src/symbol/quads.js +0 -334
  366. package/src/symbol/shaping.js +0 -816
  367. package/src/symbol/symbol_layout.js +0 -772
  368. package/src/symbol/symbol_size.js +0 -113
  369. package/src/symbol/transform_text.js +0 -29
  370. package/src/types/callback.js +0 -17
  371. package/src/types/cancelable.js +0 -3
  372. package/src/types/tilejson.js +0 -17
  373. package/src/types/transferable.js +0 -3
  374. package/src/types/window.js +0 -172
  375. package/src/ui/anchor.js +0 -32
  376. package/src/ui/bind_handlers.js +0 -202
  377. package/src/ui/camera.js +0 -1152
  378. package/src/ui/control/attribution_control.js +0 -189
  379. package/src/ui/control/fps_control.js +0 -185
  380. package/src/ui/control/fullscreen_control.js +0 -147
  381. package/src/ui/control/geolocate_control.js +0 -594
  382. package/src/ui/control/logo_control.js +0 -92
  383. package/src/ui/control/navigation_control.js +0 -148
  384. package/src/ui/control/scale_control.js +0 -142
  385. package/src/ui/crs.js +0 -64
  386. package/src/ui/default_locale.js +0 -20
  387. package/src/ui/events.js +0 -806
  388. package/src/ui/handler/box_zoom.js +0 -175
  389. package/src/ui/handler/dblclick_zoom.js +0 -139
  390. package/src/ui/handler/drag_pan.js +0 -416
  391. package/src/ui/handler/drag_rotate.js +0 -378
  392. package/src/ui/handler/keyboard.js +0 -161
  393. package/src/ui/handler/scroll_zoom.js +0 -333
  394. package/src/ui/handler/touch_zoom_rotate.js +0 -293
  395. package/src/ui/hash.js +0 -147
  396. package/src/ui/map.js +0 -2883
  397. package/src/ui/marker.js +0 -607
  398. package/src/ui/offline_map.js +0 -91
  399. package/src/ui/popup.js +0 -530
  400. package/src/util/actor.js +0 -212
  401. package/src/util/ajax.js +0 -371
  402. package/src/util/browser/web_worker.js +0 -10
  403. package/src/util/browser/window.js +0 -5
  404. package/src/util/browser.js +0 -70
  405. package/src/util/classify_rings.js +0 -52
  406. package/src/util/color_ramp.js +0 -28
  407. package/src/util/config.js +0 -30
  408. package/src/util/debug.js +0 -12
  409. package/src/util/dictionary_coder.js +0 -30
  410. package/src/util/dispatcher.js +0 -70
  411. package/src/util/dom.js +0 -144
  412. package/src/util/evented.js +0 -174
  413. package/src/util/find_pole_of_inaccessibility.js +0 -129
  414. package/src/util/global_worker_pool.js +0 -17
  415. package/src/util/image.js +0 -142
  416. package/src/util/intersection_tests.js +0 -208
  417. package/src/util/is_char_in_unicode_block.js +0 -311
  418. package/src/util/mapbox.js +0 -486
  419. package/src/util/offscreen_canvas_supported.js +0 -14
  420. package/src/util/performance.js +0 -112
  421. package/src/util/primitives.js +0 -145
  422. package/src/util/resolve_tokens.js +0 -16
  423. package/src/util/script_detection.js +0 -328
  424. package/src/util/sku_token.js +0 -42
  425. package/src/util/smart_wrap.js +0 -55
  426. package/src/util/struct_array.js +0 -243
  427. package/src/util/struct_array.js.ejs +0 -112
  428. package/src/util/struct_array_layout.js.ejs +0 -98
  429. package/src/util/task_queue.js +0 -68
  430. package/src/util/throttle.js +0 -28
  431. package/src/util/throttled_invoker.js +0 -46
  432. package/src/util/tile_cover.js +0 -101
  433. package/src/util/tile_request_cache.js +0 -172
  434. package/src/util/util.js +0 -504
  435. package/src/util/vectortile_to_geojson.js +0 -54
  436. package/src/util/verticalize_punctuation.js +0 -114
  437. package/src/util/web_worker.js +0 -91
  438. package/src/util/web_worker_transfer.js +0 -266
  439. package/src/util/webp_supported.js +0 -69
  440. package/src/util/window.js +0 -102
  441. package/src/util/worker_pool.js +0 -47
@@ -1,2 +0,0 @@
1
- var mapboxgl=function(){"use strict";var t=e;function e(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n}e.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},e.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},e.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},e.prototype.solveCurveX=function(t,e){var r,n,i,o,a;for(void 0===e&&(e=1e-6),i=t,a=0;a<8;a++){if(o=this.sampleCurveX(i)-t,Math.abs(o)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=o/s}if((i=t)<(r=0))return r;if(i>(n=1))return n;for(;r<n;){if(o=this.sampleCurveX(i),Math.abs(o-t)<e)return i;t>o?r=i:n=i,i=.5*(n-r)+r}return i},e.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var r=n;function n(t,e){this.x=t,this.y=e}function i(t,e,r){return Math.min(r,Math.max(e,t))}function o(t){var e=[];for(var r in t)e.push(t[r]);return e}function a(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n<i.length;n+=1){var o=i[n];for(var a in o)t[a]=o[a]}return t}function s(t,e){for(var r={},n=0;n<e.length;n++){var i=e[n];i in t&&(r[i]=t[i])}return r}function u(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function l(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function p(t,e){return-1!==t.indexOf(e,t.length-e.length)}function c(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function h(t){return Array.isArray(t)?t.map(h):"object"==typeof t&&t?c(t,h):t}n.prototype={clone:function(){return new n(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},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(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=n,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-n*(this.y-e.y),this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t};var f={};function y(t){f[t]||("undefined"!=typeof console&&console.warn(t),f[t]=!0)}function d(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function m(t){for(var e=0,r=0,n=t.length,i=n-1,o=void 0,a=void 0;r<n;i=r++)e+=((a=t[i]).x-(o=t[r]).x)*(o.y+a.y);return e}function v(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function g(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,i){var o=n||i;return e[r]=!o||o.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var x=null;function b(t){if(null==x){var e=t.navigator?t.navigator.userAgent:null;x=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return x}function w(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var _=S;function S(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var i=new Int32Array(this.arrayBuffer);t=i[0],this.d=(e=i[1])+2*(r=i[2]);for(var o=0;o<this.d*this.d;o++){var a=i[3+o],s=i[3+o+1];n.push(a===s?null:i.subarray(a,s))}var u=i[3+n.length+1];this.keys=i.subarray(i[3+n.length],u),this.bboxes=i.subarray(u),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var l=0;l<this.d*this.d;l++)n.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var p=r/e*t;this.min=-p,this.max=t+p}function A(t,e){return t(e={exports:{}},e.exports),e.exports}S.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},S.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},S.prototype._insertCell=function(t,e,r,n,i,o){this.cells[i].push(o)},S.prototype.query=function(t,e,r,n,i){var o=this.min,a=this.max;if(t<=o&&e<=o&&a<=r&&a<=n&&!i)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(t,e,r,n,this._queryCell,s,{},i),s},S.prototype._queryCell=function(t,e,r,n,i,o,a,s){var u=this.cells[i];if(null!==u)for(var l=this.keys,p=this.bboxes,c=0;c<u.length;c++){var h=u[c];if(void 0===a[h]){var f=4*h;(s?s(p[f+0],p[f+1],p[f+2],p[f+3]):t<=p[f+2]&&e<=p[f+3]&&r>=p[f+0]&&n>=p[f+1])?(a[h]=!0,o.push(l[h])):a[h]=!1}}},S.prototype._forEachCell=function(t,e,r,n,i,o,a,s){for(var u=this._convertToCellCoord(t),l=this._convertToCellCoord(e),p=this._convertToCellCoord(r),c=this._convertToCellCoord(n),h=u;h<=p;h++)for(var f=l;f<=c;f++){var y=this.d*f+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(f),this._convertFromCellCoord(h+1),this._convertFromCellCoord(f+1)))&&i.call(this,t,e,r,n,y,o,a,s))return}},S.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},S.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},S.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,n=0;n<this.cells.length;n++)r+=this.cells[n].length;var i=new Int32Array(e+r+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;for(var o=e,a=0;a<t.length;a++){var s=t[a];i[3+a]=o,i.set(s,o),o+=s.length}return i[3+t.length]=o,i.set(this.keys,o),i[3+t.length+1]=o+=this.keys.length,i.set(this.bboxes,o),o+=this.bboxes.length,i.buffer};var k=A((function(t,e){var r={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function n(t){return(t=Math.round(t))<0?0:t>255?255:t}function i(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function a(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,s=t.replace(/ /g,"").toLowerCase();if(s in r)return r[s].slice();if("#"===s[0])return 4===s.length?(e=parseInt(s.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===s.length&&(e=parseInt(s.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=s.indexOf("("),l=s.indexOf(")");if(-1!==u&&l+1===s.length){var p=s.substr(0,u),c=s.substr(u+1,l-(u+1)).split(","),h=1;switch(p){case"rgba":if(4!==c.length)return null;h=o(c.pop());case"rgb":return 3!==c.length?null:[i(c[0]),i(c[1]),i(c[2]),h];case"hsla":if(4!==c.length)return null;h=o(c.pop());case"hsl":if(3!==c.length)return null;var f=(parseFloat(c[0])%360+360)%360/360,y=o(c[1]),d=o(c[2]),m=d<=.5?d*(y+1):d+y-d*y,v=2*d-m;return[n(255*a(v,m,f+1/3)),n(255*a(v,m,f)),n(255*a(v,m,f-1/3)),h];default:return null}}return null}}catch(t){}})).parseCSSColor,I=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};function z(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n<i.length;n+=1){var o=i[n];for(var a in o)t[a]=o[a]}return t}I.parse=function(t){if(t){if(t instanceof I)return t;if("string"==typeof t){var e=k(t);if(e)return new I(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},I.prototype.toString=function(){var t=this.toArray(),e=t[1],r=t[2],n=t[3];return"rgba("+Math.round(t[0])+","+Math.round(e)+","+Math.round(r)+","+n+")"},I.prototype.toArray=function(){var t=this.a;return 0===t?[0,0,0,0]:[255*this.r/t,255*this.g/t,255*this.b/t,t]},I.black=new I(0,0,0,1),I.white=new I(1,1,1,1),I.transparent=new I(0,0,0,0),I.red=new I(1,0,0,1);var M=function(t){function e(e,r){t.call(this,r),this.message=r,this.key=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Error),P=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var r=0,n=e;r<n.length;r+=1){var i=n[r];this.bindings[i[0]]=i[1]}};P.prototype.concat=function(t){return new P(this,t)},P.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},P.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var C={kind:"null"},T={kind:"number"},E={kind:"string"},B={kind:"boolean"},V={kind:"color"},D={kind:"object"},F={kind:"value"},L={kind:"collator"},O={kind:"formatted"},R={kind:"resolvedImage"};function U(t,e){return{kind:"array",itemType:t,N:e}}function j(t){if("array"===t.kind){var e=j(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var q=[C,T,E,B,V,O,D,U(F),R];function N(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!N(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=q;r<n.length;r+=1)if(!N(n[r],e))return null}return"Expected "+j(t)+" but found "+j(e)+" instead."}var G=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};G.prototype.compare=function(t,e){return this.collator.compare(t,e)},G.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Z=function(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i},X=function(t){this.sections=t};X.fromString=function(t){return new X([new Z(t,null,null,null,null)])},X.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},X.factory=function(t){return t instanceof X?t:X.fromString(t)},X.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},X.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];if(n.image)t.push(["image",n.image.name]);else{t.push(n.text);var i={};n.fontStack&&(i["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(i["font-scale"]=n.scale),n.textColor&&(i["text-color"]=["rgba"].concat(n.textColor.toArray())),t.push(i)}}return t};var Y=function(t){this.name=t.name,this.available=t.available};function J(t,e,r,n){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function K(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof I)return!0;if(t instanceof G)return!0;if(t instanceof X)return!0;if(t instanceof Y)return!0;if(Array.isArray(t)){for(var e=0,r=t;e<r.length;e+=1)if(!K(r[e]))return!1;return!0}if("object"==typeof t){for(var n in t)if(!K(t[n]))return!1;return!0}return!1}function H(t){if(null===t)return C;if("string"==typeof t)return E;if("boolean"==typeof t)return B;if("number"==typeof t)return T;if(t instanceof I)return V;if(t instanceof G)return L;if(t instanceof X)return O;if(t instanceof Y)return R;if(Array.isArray(t)){for(var e,r=t.length,n=0,i=t;n<i.length;n+=1){var o=H(i[n]);if(e){if(e===o)continue;e=F;break}e=o}return U(e||F,r)}return D}function W(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof I||t instanceof X||t instanceof Y?t.toString():JSON.stringify(t)}Y.prototype.toString=function(){return this.name},Y.fromString=function(t){return t?new Y({name:t,available:!1}):null},Y.prototype.serialize=function(){return["image",this.name]};var $=function(t,e){this.type=t,this.value=e};$.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!K(t[1]))return e.error("invalid value");var r=t[1],n=H(r),i=e.expectedType;return"array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new $(n,r)},$.prototype.evaluate=function(){return this.value},$.prototype.eachChild=function(){},$.prototype.outputDefined=function(){return!0},$.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof I?["rgba"].concat(this.value.toArray()):this.value instanceof X?this.value.serialize():this.value};var Q=function(t){this.name="ExpressionEvaluationError",this.message=t};Q.prototype.toJSON=function(){return this.message};var tt={string:E,number:T,boolean:B,object:D},et=function(t,e){this.type=t,this.args=e};et.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r,n=1,i=t[0];if("array"===i){var o,a;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in tt)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=tt[s],n++}else o=F;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],n++}r=U(o,a)}else r=tt[i];for(var u=[];n<t.length;n++){var l=e.parse(t[n],n,F);if(!l)return null;u.push(l)}return new et(r,u)},et.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!N(this.type,H(r)))return r;if(e===this.args.length-1)throw new Q("Expected value to be of type "+j(this.type)+", but found "+j(H(r))+" instead.")}return null},et.prototype.eachChild=function(t){this.args.forEach(t)},et.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},et.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var r=t.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){e.push(r.kind);var n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var rt=function(t){this.type=O,this.sections=t};rt.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,o=1;o<=t.length-1;++o){var a=t[o];if(i&&"object"==typeof a&&!Array.isArray(a)){i=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,T)))return null;var u=null;if(a["text-font"]&&!(u=e.parse(a["text-font"],1,U(E))))return null;var l=null;if(a["text-color"]&&!(l=e.parse(a["text-color"],1,V)))return null;var p=n[n.length-1];p.scale=s,p.font=u,p.textColor=l}else{var c=e.parse(t[o],1,F);if(!c)return null;var h=c.type.kind;if("string"!==h&&"value"!==h&&"null"!==h&&"resolvedImage"!==h)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:c,scale:null,font:null,textColor:null})}}return new rt(n)},rt.prototype.evaluate=function(t){return new X(this.sections.map((function(e){var r=e.content.evaluate(t);return H(r)===R?new Z("",r,null,null,null):new Z(W(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},rt.prototype.eachChild=function(t){for(var e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t(n.content),n.scale&&t(n.scale),n.font&&t(n.font),n.textColor&&t(n.textColor)}},rt.prototype.outputDefined=function(){return!1},rt.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t.push(n.content.serialize());var i={};n.scale&&(i["font-scale"]=n.scale.serialize()),n.font&&(i["text-font"]=n.font.serialize()),n.textColor&&(i["text-color"]=n.textColor.serialize()),t.push(i)}return t};var nt=function(t){this.type=R,this.input=t};nt.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,E);return r?new nt(r):e.error("No image name provided.")},nt.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=Y.fromString(e);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(e)>-1),r},nt.prototype.eachChild=function(t){t(this.input)},nt.prototype.outputDefined=function(){return!1},nt.prototype.serialize=function(){return["image",this.input.serialize()]};var it={"to-boolean":B,"to-color":V,"to-number":T,"to-string":E},ot=function(t,e){this.type=t,this.args=e};ot.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=it[r],i=[],o=1;o<t.length;o++){var a=e.parse(t[o],o,F);if(!a)return null;i.push(a)}return new ot(n,i)},ot.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,r,n=0,i=this.args;n<i.length;n+=1){if(r=null,(e=i[n].evaluate(t))instanceof I)return e;if("string"==typeof e){var o=t.parseColor(e);if(o)return o}else if(Array.isArray(e)&&!(r=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":J(e[0],e[1],e[2],e[3])))return new I(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new Q(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,u=this.args;s<u.length;s+=1){if(null===(a=u[s].evaluate(t)))return 0;var l=Number(a);if(!isNaN(l))return l}throw new Q("Could not convert "+JSON.stringify(a)+" to number.")}return"formatted"===this.type.kind?X.fromString(W(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?Y.fromString(W(this.args[0].evaluate(t))):W(this.args[0].evaluate(t))},ot.prototype.eachChild=function(t){this.args.forEach(t)},ot.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},ot.prototype.serialize=function(){if("formatted"===this.type.kind)return new rt([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new nt(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var at=["Unknown","Point","LineString","Polygon"],st=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};st.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},st.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?at[this.feature.type]:this.feature.type:null},st.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},st.prototype.canonicalID=function(){return this.canonical},st.prototype.properties=function(){return this.feature&&this.feature.properties||{}},st.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=I.parse(t)),e};var ut=function(t,e,r,n){this.name=t,this.type=e,this._evaluate=r,this.args=n};ut.prototype.evaluate=function(t){return this._evaluate(t,this.args)},ut.prototype.eachChild=function(t){this.args.forEach(t)},ut.prototype.outputDefined=function(){return!1},ut.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},ut.parse=function(t,e){var r,n=t[0],i=ut.definitions[n];if(!i)return e.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0);for(var o=Array.isArray(i)?i[0]:i.type,a=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=a.filter((function(e){var r=e[0];return!Array.isArray(r)||r.length===t.length-1})),u=null,l=0,p=s;l<p.length;l+=1){var c=p[l],h=c[0],f=c[1];u=new Ot(e.registry,e.path,null,e.scope);for(var y=[],d=!1,m=1;m<t.length;m++){var v=t[m],g=Array.isArray(h)?h[m-1]:h.type,x=u.parse(v,1+y.length,g);if(!x){d=!0;break}y.push(x)}if(!d)if(Array.isArray(h)&&h.length!==y.length)u.error("Expected "+h.length+" arguments, but found "+y.length+" instead.");else{for(var b=0;b<y.length;b++){var w=Array.isArray(h)?h[b]:h.type,_=y[b];u.concat(b+1).checkSubtype(w,_.type)}if(0===u.errors.length)return new ut(n,o,f,y)}}if(1===s.length)(r=e.errors).push.apply(r,u.errors);else{for(var S=(s.length?s:a).map((function(t){var e;return e=t[0],Array.isArray(e)?"("+e.map(j).join(", ")+")":"("+j(e.type)+"...)"})).join(" | "),A=[],k=1;k<t.length;k++){var I=e.parse(t[k],1+A.length);if(!I)return null;A.push(j(I.type))}e.error("Expected arguments of type "+S+", but found ("+A.join(", ")+") instead.")}return null},ut.register=function(t,e){for(var r in ut.definitions=e,e)t[r]=ut};var lt=function(t,e,r){this.type=L,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e};lt.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");var n=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,B);if(!n)return null;var i=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,B);if(!i)return null;var o=null;return r.locale&&!(o=e.parse(r.locale,1,E))?null:new lt(n,i,o)},lt.prototype.evaluate=function(t){return new G(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},lt.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},lt.prototype.outputDefined=function(){return!1},lt.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var pt=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};pt.prototype.setNorthEast=function(t){return this._ne=t instanceof ct?new ct(t.lng,t.lat):ct.convert(t),this},pt.prototype.setSouthWest=function(t){return this._sw=t instanceof ct?new ct(t.lng,t.lat):ct.convert(t),this},pt.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof ct)e=t,r=t;else{if(!(t instanceof pt))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(pt.convert(t)):this.extend(ct.convert(t)):this;if(r=t._ne,!(e=t._sw)||!r)return this}return n||i?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new ct(e.lng,e.lat),this._ne=new ct(r.lng,r.lat)),this},pt.prototype.getCenter=function(){return new ct((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},pt.prototype.getSouthWest=function(){return this._sw},pt.prototype.getNorthEast=function(){return this._ne},pt.prototype.getNorthWest=function(){return new ct(this.getWest(),this.getNorth())},pt.prototype.getSouthEast=function(){return new ct(this.getEast(),this.getSouth())},pt.prototype.getWest=function(){return this._sw.lng},pt.prototype.getSouth=function(){return this._sw.lat},pt.prototype.getEast=function(){return this._ne.lng},pt.prototype.getNorth=function(){return this._ne.lat},pt.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},pt.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},pt.prototype.isEmpty=function(){return!(this._sw&&this._ne)},pt.prototype.contains=function(t){var e=ct.convert(t),r=e.lng,n=e.lat,i=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&i},pt.convert=function(t){return!t||t instanceof pt?t:new pt(t)};var ct=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};ct.prototype.wrap=function(){return new ct(-180==(t=((this.lng- -180)%360+360)%360-180)?180:t,this.lat);var t},ct.prototype.toArray=function(){return[this.lng,this.lat]},ct.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},ct.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(i,1))},ct.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new pt(new ct(this.lng-r,this.lat-e),new ct(this.lng+r,this.lat+e))},ct.convert=function(t){if(t instanceof ct)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new ct(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new ct(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var ht=2*Math.PI*6371008.8;function ft(t){return ht*Math.cos(t*Math.PI/180)}function yt(t){return(180+t)/360}function dt(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function mt(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var vt=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};function gt(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function xt(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function bt(t,e){var r=vt.fromLngLat({lng:t[0],lat:t[1]},0),n=Math.pow(2,e.z);return[Math.round(r.x*n*8192),Math.round(r.y*n*8192)]}function wt(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function _t(t,e){for(var r,n,i,o,a,s,u,l=!1,p=0,c=e.length;p<c;p++)for(var h=e[p],f=0,y=h.length;f<y-1;f++){if((o=(r=t)[0]-(n=h[f])[0])*(u=r[1]-(i=h[f+1])[1])-(s=r[0]-i[0])*(a=r[1]-n[1])==0&&o*s<=0&&a*u<=0)return!1;wt(t,h[f],h[f+1])&&(l=!l)}return l}function St(t,e){for(var r=0;r<e.length;r++)if(_t(t,e[r]))return!0;return!1}function At(t,e,r,n){var i=n[0]-r[0],o=n[1]-r[1],a=(t[0]-r[0])*o-i*(t[1]-r[1]),s=(e[0]-r[0])*o-i*(e[1]-r[1]);return a>0&&s<0||a<0&&s>0}function kt(t,e,r){for(var n=0,i=r;n<i.length;n+=1)for(var o=i[n],a=0;a<o.length-1;++a)if(0!=(c=[(p=o[a+1])[0]-(l=o[a])[0],p[1]-l[1]])[0]*(h=[(u=e)[0]-(s=t)[0],u[1]-s[1]])[1]-c[1]*h[0]&&At(s,u,l,p)&&At(l,p,s,u))return!0;var s,u,l,p,c,h;return!1}function It(t,e){for(var r=0;r<t.length;++r)if(!_t(t[r],e))return!1;for(var n=0;n<t.length-1;++n)if(kt(t[n],t[n+1],e))return!1;return!0}function zt(t,e){for(var r=0;r<e.length;r++)if(It(t,e[r]))return!0;return!1}function Mt(t,e,r){for(var n=[],i=0;i<t.length;i++){for(var o=[],a=0;a<t[i].length;a++){var s=bt(t[i][a],r);gt(e,s),o.push(s)}n.push(o)}return n}function Pt(t,e,r){for(var n=[],i=0;i<t.length;i++){var o=Mt(t[i],e,r);n.push(o)}return n}function Ct(t,e,r,n){if(t[0]<r[0]||t[0]>r[2]){var i=.5*n,o=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===o&&(o=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=o}gt(e,t)}function Tt(t,e,r,n){for(var i=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],a=[],s=0,u=t;s<u.length;s+=1)for(var l=0,p=u[s];l<p.length;l+=1){var c=p[l],h=[c.x+o[0],c.y+o[1]];Ct(h,e,r,i),a.push(h)}return a}function Et(t,e,r,n){for(var i,o=8192*Math.pow(2,n.z),a=[8192*n.x,8192*n.y],s=[],u=0,l=t;u<l.length;u+=1){for(var p=[],c=0,h=l[u];c<h.length;c+=1){var f=h[c],y=[f.x+a[0],f.y+a[1]];gt(e,y),p.push(y)}s.push(p)}if(e[2]-e[0]<=o/2){(i=e)[0]=i[1]=1/0,i[2]=i[3]=-1/0;for(var d=0,m=s;d<m.length;d+=1)for(var v=0,g=m[d];v<g.length;v+=1)Ct(g[v],e,r,o)}return s}vt.fromLngLat=function(t,e){void 0===e&&(e=0);var r=ct.convert(t);return new vt(yt(r.lng),dt(r.lat),function(t,e){return t/ft(e)}(e,r.lat))},vt.prototype.toLngLat=function(){return new ct(360*this.x-180,mt(this.y))},vt.prototype.toAltitude=function(){return this.z*ft(mt(this.y))},vt.prototype.meterInMercatorCoordinateUnits=function(){return 1/ht*(t=mt(this.y),1/Math.cos(t*Math.PI/180));var t};var Bt=function(t,e){this.type=B,this.geojson=t,this.geometries=e};function Vt(t){if(t instanceof ut){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof Bt)return!1;var e=!0;return t.eachChild((function(t){e&&!Vt(t)&&(e=!1)})),e}function Dt(t){if(t instanceof ut&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!Dt(t)&&(e=!1)})),e}function Ft(t,e){if(t instanceof ut&&e.indexOf(t.name)>=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Ft(t,e)&&(r=!1)})),r}Bt.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(K(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;n<r.features.length;++n){var i=r.features[n].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new Bt(r,r.features[n].geometry)}else if("Feature"===r.type){var o=r.geometry.type;if("Polygon"===o||"MultiPolygon"===o)return new Bt(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new Bt(r,r)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Bt.prototype.evaluate=function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){var o=Mt(e.coordinates,n,i),a=Tt(t.geometry(),r,n,i);if(!xt(r,n))return!1;for(var s=0,u=a;s<u.length;s+=1)if(!_t(u[s],o))return!1}if("MultiPolygon"===e.type){var l=Pt(e.coordinates,n,i),p=Tt(t.geometry(),r,n,i);if(!xt(r,n))return!1;for(var c=0,h=p;c<h.length;c+=1)if(!St(h[c],l))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){var o=Mt(e.coordinates,n,i),a=Et(t.geometry(),r,n,i);if(!xt(r,n))return!1;for(var s=0,u=a;s<u.length;s+=1)if(!It(u[s],o))return!1}if("MultiPolygon"===e.type){var l=Pt(e.coordinates,n,i),p=Et(t.geometry(),r,n,i);if(!xt(r,n))return!1;for(var c=0,h=p;c<h.length;c+=1)if(!zt(h[c],l))return!1}return!0}(t,this.geometries)}return!1},Bt.prototype.eachChild=function(){},Bt.prototype.outputDefined=function(){return!0},Bt.prototype.serialize=function(){return["within",this.geojson]};var Lt=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};Lt.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var r=t[1];return e.scope.has(r)?new Lt(r,e.scope.get(r)):e.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},Lt.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Lt.prototype.eachChild=function(){},Lt.prototype.outputDefined=function(){return!1},Lt.prototype.serialize=function(){return["var",this.name]};var Ot=function(t,e,r,n,i){void 0===e&&(e=[]),void 0===n&&(n=new P),void 0===i&&(i=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=n,this.errors=i,this.expectedType=r};function Rt(t,e){for(var r,n=t.length-1,i=0,o=n,a=0;i<=o;)if((r=t[a=Math.floor((i+o)/2)])<=e){if(a===n||e<t[a+1])return a;i=a+1}else{if(!(r>e))throw new Q("Input is not a number.");o=a-1}return 0}Ot.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},Ot.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new et(e,[t]):"coerce"===r?new ot(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var o=i.parse(t,this);if(!o)return null;if(this.expectedType){var a=this.expectedType,s=o.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else o=r(o,a,e.typeAnnotation||"coerce");else o=r(o,a,e.typeAnnotation||"assert")}if(!(o instanceof $)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof Lt)return t(e.boundExpression);if(e instanceof ut&&"error"===e.name)return!1;if(e instanceof lt)return!1;if(e instanceof Bt)return!1;var r=e instanceof ot||e instanceof et,n=!0;return e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof $})),!!n&&Vt(e)&&Ft(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var u=new st;try{o=new $(o.type,o.evaluate(u))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},Ot.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new Ot(this.registry,n,e||null,i,this.errors)},Ot.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new M(n,t))},Ot.prototype.checkSubtype=function(t,e){var r=N(t,e);return r&&this.error(r),r};var Ut=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n<i.length;n+=1){var o=i[n],a=o[1];this.labels.push(o[0]),this.outputs.push(a)}};function jt(t,e,r){return t*(1-r)+e*r}Ut.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var r=e.parse(t[1],1,T);if(!r)return null;var n=[],i=null;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var o=1;o<t.length;o+=2){var a=1===o?-1/0:t[o],s=t[o+1],u=o,l=o+1;if("number"!=typeof a)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',u);if(n.length&&n[n.length-1][0]>=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var p=e.parse(s,l,i);if(!p)return null;i=i||p.type,n.push([a,p])}return new Ut(i,r,n)},Ut.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[Rt(e,n)].evaluate(t)},Ut.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},Ut.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},Ut.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var qt=Object.freeze({__proto__:null,number:jt,color:function(t,e,r){return new I(jt(t.r,e.r,r),jt(t.g,e.g,r),jt(t.b,e.b,r),jt(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return jt(t,e[n],r)}))}}),Nt=6/29*3*(6/29),Gt=Math.PI/180,Zt=180/Math.PI;function Xt(t){return t>.008856451679035631?Math.pow(t,1/3):t/Nt+4/29}function Yt(t){return t>6/29?t*t*t:Nt*(t-4/29)}function Jt(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Kt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ht(t){var e=Kt(t.r),r=Kt(t.g),n=Kt(t.b),i=Xt((.4124564*e+.3575761*r+.1804375*n)/.95047),o=Xt((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-Xt((.0193339*e+.119192*r+.9503041*n)/1.08883)),alpha:t.a}}function Wt(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Yt(e),r=.95047*Yt(r),n=1.08883*Yt(n),new I(Jt(3.2404542*r-1.5371385*e-.4985314*n),Jt(-.969266*r+1.8760108*e+.041556*n),Jt(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function $t(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var Qt={forward:Ht,reverse:Wt,interpolate:function(t,e,r){return{l:jt(t.l,e.l,r),a:jt(t.a,e.a,r),b:jt(t.b,e.b,r),alpha:jt(t.alpha,e.alpha,r)}}},te={forward:function(t){var e=Ht(t),r=e.l,n=e.a,i=e.b,o=Math.atan2(i,n)*Zt;return{h:o<0?o+360:o,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*Gt,r=t.c;return Wt({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:$t(t.h,e.h,r),c:jt(t.c,e.c,r),l:jt(t.l,e.l,r),alpha:jt(t.alpha,e.alpha,r)}}},ee=Object.freeze({__proto__:null,lab:Qt,hcl:te}),re=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var o=0,a=i;o<a.length;o+=1){var s=a[o],u=s[1];this.labels.push(s[0]),this.outputs.push(u)}};function ne(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}re.interpolationFactor=function(e,r,n,i){var o=0;if("exponential"===e.name)o=ne(r,e.base,n,i);else if("linear"===e.name)o=ne(r,1,n,i);else if("cubic-bezier"===e.name){var a=e.controlPoints;o=new t(a[0],a[1],a[2],a[3]).solve(ne(r,1,n,i))}return o},re.parse=function(t,e){var r=t[0],n=t[1],i=t[2],o=t.slice(3);if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){var a=n[1];if("number"!=typeof a)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:a}}else{if("cubic-bezier"!==n[0])return e.error("Unknown interpolation type "+String(n[0]),1,0);var s=n.slice(1);if(4!==s.length||s.some((function(t){return"number"!=typeof t||t<0||t>1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,T)))return null;var u=[],l=null;"interpolate-hcl"===r||"interpolate-lab"===r?l=V:e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var p=0;p<o.length;p+=2){var c=o[p],h=o[p+1],f=p+3,y=p+4;if("number"!=typeof c)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(u.length&&u[u.length-1][0]>=c)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var d=e.parse(h,y,l);if(!d)return null;l=l||d.type,u.push([c,d])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new re(l,r,n,i,u):e.error("Type "+j(l)+" is not interpolatable.")},re.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var o=Rt(e,n),a=re.interpolationFactor(this.interpolation,n,e[o],e[o+1]),s=r[o].evaluate(t),u=r[o+1].evaluate(t);return"interpolate"===this.operator?qt[this.type.kind.toLowerCase()](s,u,a):"interpolate-hcl"===this.operator?te.reverse(te.interpolate(te.forward(s),te.forward(u),a)):Qt.reverse(Qt.interpolate(Qt.forward(s),Qt.forward(u),a))},re.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},re.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},re.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],r=0;r<this.labels.length;r++)e.push(this.labels[r],this.outputs[r].serialize());return e};var ie=function(t,e){this.type=t,this.args=e};ie.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var r=null,n=e.expectedType;n&&"value"!==n.kind&&(r=n);for(var i=[],o=0,a=t.slice(1);o<a.length;o+=1){var s=e.parse(a[o],1+i.length,r,void 0,{typeAnnotation:"omit"});if(!s)return null;r=r||s.type,i.push(s)}var u=n&&i.some((function(t){return N(n,t.type)}));return new ie(u?F:r,i)},ie.prototype.evaluate=function(t){for(var e,r=null,n=0,i=0,o=this.args;i<o.length&&(n++,(r=o[i].evaluate(t))&&r instanceof Y&&!r.available&&(e||(e=r.name),r=null,n===this.args.length&&(r=e)),null===r);i+=1);return r},ie.prototype.eachChild=function(t){this.args.forEach(t)},ie.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},ie.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var oe=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};oe.prototype.evaluate=function(t){return this.result.evaluate(t)},oe.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1)t(r[e][1]);t(this.result)},oe.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var r=[],n=1;n<t.length-1;n+=2){var i=t[n];if("string"!=typeof i)return e.error("Expected string, but found "+typeof i+" instead.",n);if(/[^a-zA-Z0-9_]/.test(i))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);var o=e.parse(t[n+1],n+1);if(!o)return null;r.push([i,o])}var a=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return a?new oe(r,a):null},oe.prototype.outputDefined=function(){return this.result.outputDefined()},oe.prototype.serialize=function(){for(var t=["let"],e=0,r=this.bindings;e<r.length;e+=1){var n=r[e];t.push(n[0],n[1].serialize())}return t.push(this.result.serialize()),t};var ae=function(t,e,r){this.type=t,this.index=e,this.input=r};ae.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,T),n=e.parse(t[2],2,U(e.expectedType||F));return r&&n?new ae(n.type.itemType,r,n):null},ae.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new Q("Array index out of bounds: "+e+" < 0.");if(e>=r.length)throw new Q("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new Q("Array index must be an integer, but found "+e+" instead.");return r[e]},ae.prototype.eachChild=function(t){t(this.index),t(this.input)},ae.prototype.outputDefined=function(){return!1},ae.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var se=function(t,e){this.type=B,this.needle=t,this.haystack=e};se.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r,n=e.parse(t[1],1,F),i=e.parse(t[2],2,F);return n&&i?"boolean"!==(r=n.type).kind&&"string"!==r.kind&&"number"!==r.kind&&"null"!==r.kind&&"value"!==r.kind?e.error("Expected first argument to be of type boolean, string, number or null, but found "+j(n.type)+" instead"):new se(n,i):null},se.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(null==e||!r)return!1;if(!function(t){return"boolean"==typeof t||"string"==typeof t||"number"==typeof t}(e))throw new Q("Expected first argument to be of type boolean, string or number, but found "+j(H(e))+" instead.");if(!function(t){return Array.isArray(t)||"string"==typeof t}(r))throw new Q("Expected second argument to be of type array or string, but found "+j(H(r))+" instead.");return r.indexOf(e)>=0},se.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},se.prototype.outputDefined=function(){return!0},se.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var ue=function(t,e,r,n,i,o){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=o};ue.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},o=[],a=2;a<t.length-1;a+=2){var s=t[a],u=t[a+1];Array.isArray(s)||(s=[s]);var l=e.concat(a);if(0===s.length)return l.error("Expected at least one branch label.");for(var p=0,c=s;p<c.length;p+=1){var h=c[p];if("number"!=typeof h&&"string"!=typeof h)return l.error("Branch labels must be numbers or strings.");if("number"==typeof h&&Math.abs(h)>Number.MAX_SAFE_INTEGER)return l.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof h&&Math.floor(h)!==h)return l.error("Numeric branch labels must be integer values.");if(r){if(l.checkSubtype(r,H(h)))return null}else r=H(h);if(void 0!==i[String(h)])return l.error("Branch labels must be unique.");i[String(h)]=o.length}var f=e.parse(u,a,n);if(!f)return null;n=n||f.type,o.push(f)}var y=e.parse(t[1],1,F);if(!y)return null;var d=e.parse(t[t.length-1],t.length-1,n);return d?"value"!==y.type.kind&&e.concat(1).checkSubtype(r,y.type)?null:new ue(r,n,y,i,o,d):null},ue.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(H(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},ue.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},ue.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},ue.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,o=Object.keys(this.cases).sort();i<o.length;i+=1){var a=o[i];void 0===(c=n[this.cases[a]])?(n[this.cases[a]]=r.length,r.push([this.cases[a],[a]])):r[c][1].push(a)}for(var s=function(e){return"number"===t.inputType.kind?Number(e):e},u=0,l=r;u<l.length;u+=1){var p=l[u],c=p[0],h=p[1];e.push(1===h.length?s(h[0]):h.map(s)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var le=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r};function pe(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function ce(t,e,r,n){return 0===n.compare(e,r)}function he(t,e,r){var n="=="!==t&&"!="!==t;return function(){function i(t,e,r){this.type=B,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return i.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var r=t[0],o=e.parse(t[1],1,F);if(!o)return null;if(!pe(r,o.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+j(o.type)+"'.");var a=e.parse(t[2],2,F);if(!a)return null;if(!pe(r,a.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+j(a.type)+"'.");if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '"+j(o.type)+"' and '"+j(a.type)+"'.");n&&("value"===o.type.kind&&"value"!==a.type.kind?o=new et(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new et(o.type,[a])));var s=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,L)))return null}return new i(o,a,s)},i.prototype.evaluate=function(i){var o=this.lhs.evaluate(i),a=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){var s=H(o),u=H(a);if(s.kind!==u.kind||"string"!==s.kind&&"number"!==s.kind)throw new Q('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+u.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var l=H(o),p=H(a);if("string"!==l.kind||"string"!==p.kind)return e(i,o,a)}return this.collator?r(i,o,a,this.collator.evaluate(i)):e(i,o,a)},i.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},i.prototype.outputDefined=function(){return!0},i.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},i}()}le.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var n=[],i=1;i<t.length-1;i+=2){var o=e.parse(t[i],i,B);if(!o)return null;var a=e.parse(t[i+1],i+1,r);if(!a)return null;n.push([o,a]),r=r||a.type}var s=e.parse(t[t.length-1],t.length-1,r);return s?new le(r,n,s):null},le.prototype.evaluate=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[1];if(n[0].evaluate(t))return i.evaluate(t)}return this.otherwise.evaluate(t)},le.prototype.eachChild=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[1];t(n[0]),t(i)}t(this.otherwise)},le.prototype.outputDefined=function(){return this.branches.every((function(t){return t[1].outputDefined()}))&&this.otherwise.outputDefined()},le.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var fe=he("==",(function(t,e,r){return e===r}),ce),ye=he("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!ce(0,e,r,n)})),de=he("<",(function(t,e,r){return e<r}),(function(t,e,r,n){return n.compare(e,r)<0})),me=he(">",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),ve=he("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),ge=he(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),xe=function(t,e,r,n,i){this.type=E,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};xe.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,T);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,E)))return null;var o=null;if(n.currency&&!(o=e.parse(n.currency,1,E)))return null;var a=null;if(n["min-fraction-digits"]&&!(a=e.parse(n["min-fraction-digits"],1,T)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,T))?null:new xe(r,i,o,a,s)},xe.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},xe.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},xe.prototype.outputDefined=function(){return!1},xe.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var be=function(t){this.type=T,this.input=t};be.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+j(r.type)+" instead."):new be(r):null},be.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new Q("Expected value to be of type string or array, but found "+j(H(e))+" instead.")},be.prototype.eachChild=function(t){t(this.input)},be.prototype.outputDefined=function(){return!1},be.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var we={"==":fe,"!=":ye,">":me,"<":de,">=":ge,"<=":ve,array:et,at:ae,boolean:et,case:le,coalesce:ie,collator:lt,format:rt,image:nt,in:se,interpolate:re,"interpolate-hcl":re,"interpolate-lab":re,length:be,let:oe,literal:$,match:ue,number:et,"number-format":xe,object:et,step:Ut,string:et,"to-boolean":ot,"to-color":ot,"to-number":ot,"to-string":ot,var:Lt,within:Bt};function _e(t,e){var r=e[0],n=e[1],i=e[2],o=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var a=o?o.evaluate(t):1,s=J(r,n,i,a);if(s)throw new Q(s);return new I(r/255*a,n/255*a,i/255*a,a)}function Se(t,e){return t in e}function Ae(t,e){var r=e[t];return void 0===r?null:r}function ke(t){return{type:t}}function Ie(t){return{result:"success",value:t}}function ze(t){return{result:"error",value:t}}function Me(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Pe(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Ce(t){return!!t.expression&&t.expression.interpolated}function Te(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Ee(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Be(t){return t}function Ve(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function De(t,e,r,n,i){return Ve(typeof r===i?n[r]:void 0,t.default,e.default)}function Fe(t,e,r){if("number"!==Te(r))return Ve(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var i=Rt(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function Le(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==Te(r))return Ve(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var o=Rt(t.stops.map((function(t){return t[0]})),r),a=function(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],l=qt[e.type]||Be;if(t.colorSpace&&"rgb"!==t.colorSpace){var p=ee[t.colorSpace];l=function(t,e){return p.reverse(p.interpolate(p.forward(t),p.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=u.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return l(r,n,a)}}:l(s,u,a)}function Oe(t,e,r){return"color"===e.type?r=I.parse(r):"formatted"===e.type?r=X.fromString(r.toString()):"resolvedImage"===e.type?r=Y.fromString(r.toString()):Te(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Ve(r,t.default,e.default)}ut.register(we,{error:[{kind:"error"},[E],function(t,e){throw new Q(e[0].evaluate(t))}],typeof:[E,[F],function(t,e){return j(H(e[0].evaluate(t)))}],"to-rgba":[U(T,4),[V],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[V,[T,T,T],_e],rgba:[V,[T,T,T,T],_e],has:{type:B,overloads:[[[E],function(t,e){return Se(e[0].evaluate(t),t.properties())}],[[E,D],function(t,e){var r=e[1];return Se(e[0].evaluate(t),r.evaluate(t))}]]},get:{type:F,overloads:[[[E],function(t,e){return Ae(e[0].evaluate(t),t.properties())}],[[E,D],function(t,e){var r=e[1];return Ae(e[0].evaluate(t),r.evaluate(t))}]]},"feature-state":[F,[E],function(t,e){return Ae(e[0].evaluate(t),t.featureState||{})}],properties:[D,[],function(t){return t.properties()}],"geometry-type":[E,[],function(t){return t.geometryType()}],id:[F,[],function(t){return t.id()}],zoom:[T,[],function(t){return t.globals.zoom}],"heatmap-density":[T,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[T,[],function(t){return t.globals.lineProgress||0}],accumulated:[F,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[T,ke(T),function(t,e){for(var r=0,n=0,i=e;n<i.length;n+=1)r+=i[n].evaluate(t);return r}],"*":[T,ke(T),function(t,e){for(var r=1,n=0,i=e;n<i.length;n+=1)r*=i[n].evaluate(t);return r}],"-":{type:T,overloads:[[[T,T],function(t,e){var r=e[1];return e[0].evaluate(t)-r.evaluate(t)}],[[T],function(t,e){return-e[0].evaluate(t)}]]},"/":[T,[T,T],function(t,e){var r=e[1];return e[0].evaluate(t)/r.evaluate(t)}],"%":[T,[T,T],function(t,e){var r=e[1];return e[0].evaluate(t)%r.evaluate(t)}],ln2:[T,[],function(){return Math.LN2}],pi:[T,[],function(){return Math.PI}],e:[T,[],function(){return Math.E}],"^":[T,[T,T],function(t,e){var r=e[1];return Math.pow(e[0].evaluate(t),r.evaluate(t))}],sqrt:[T,[T],function(t,e){return Math.sqrt(e[0].evaluate(t))}],log10:[T,[T],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN10}],ln:[T,[T],function(t,e){return Math.log(e[0].evaluate(t))}],log2:[T,[T],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN2}],sin:[T,[T],function(t,e){return Math.sin(e[0].evaluate(t))}],cos:[T,[T],function(t,e){return Math.cos(e[0].evaluate(t))}],tan:[T,[T],function(t,e){return Math.tan(e[0].evaluate(t))}],asin:[T,[T],function(t,e){return Math.asin(e[0].evaluate(t))}],acos:[T,[T],function(t,e){return Math.acos(e[0].evaluate(t))}],atan:[T,[T],function(t,e){return Math.atan(e[0].evaluate(t))}],min:[T,ke(T),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[T,ke(T),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[T,[T],function(t,e){return Math.abs(e[0].evaluate(t))}],round:[T,[T],function(t,e){var r=e[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[T,[T],function(t,e){return Math.floor(e[0].evaluate(t))}],ceil:[T,[T],function(t,e){return Math.ceil(e[0].evaluate(t))}],"filter-==":[B,[E,F],function(t,e){var r=e[0],n=e[1];return t.properties()[r.value]===n.value}],"filter-id-==":[B,[F],function(t,e){var r=e[0];return t.id()===r.value}],"filter-type-==":[B,[E],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[B,[E,F],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i<o}],"filter-id-<":[B,[F],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<i}],"filter->":[B,[E,F],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>o}],"filter-id->":[B,[F],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[B,[E,F],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i<=o}],"filter-id-<=":[B,[F],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[B,[E,F],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>=o}],"filter-id->=":[B,[F],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[B,[F],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[B,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[B,[U(E)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[B,[U(F)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[B,[E,U(F)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[B,[E,U(F)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:B,overloads:[[[B,B],function(t,e){var r=e[1];return e[0].evaluate(t)&&r.evaluate(t)}],[ke(B),function(t,e){for(var r=0,n=e;r<n.length;r+=1)if(!n[r].evaluate(t))return!1;return!0}]]},any:{type:B,overloads:[[[B,B],function(t,e){var r=e[1];return e[0].evaluate(t)||r.evaluate(t)}],[ke(B),function(t,e){for(var r=0,n=e;r<n.length;r+=1)if(n[r].evaluate(t))return!0;return!1}]]},"!":[B,[B],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[B,[E],function(t,e){var r=t.globals&&t.globals.isSupportedScript;return!r||r(e[0].evaluate(t))}],upcase:[E,[E],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[E,[E],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[E,ke(F),function(t,e){return e.map((function(e){return W(e.evaluate(t))})).join("")}],"resolved-locale":[E,[L],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var Re=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new st,this._defaultValue=e?function(t){return"color"===t.type&&Ee(t.default)?new I(0,0,0,0):"color"===t.type?I.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null};function Ue(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in we}function je(t,e){var r=new Ot(we,[],e?function(t){var e={color:V,string:E,number:T,enum:E,boolean:B,formatted:O,resolvedImage:R};return"array"===t.type?U(e[t.value]||F,t.length):e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Ie(new Re(n,e)):ze(r.errors)}Re.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)},Re.prototype.evaluate=function(t,e,r,n,i,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o||null;try{var a=this.expression.evaluate(this._evaluator);if(null==a||"number"==typeof a&&a!=a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new Q("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var qe=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Dt(e.expression)};qe.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,o)},qe.prototype.evaluate=function(t,e,r,n,i,o){return this._styleExpression.evaluate(t,e,r,n,i,o)};var Ne=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Dt(e.expression),this.interpolationType=n};function Ge(t,e){if("error"===(t=je(t,e)).result)return t;var r=t.value.expression,n=Vt(r);if(!n&&!Me(e))return ze([new M("","data expressions not supported")]);var i=Ft(r,["zoom"]);if(!i&&!Pe(e))return ze([new M("","zoom expressions not supported")]);var o=function t(e){var r=null;if(e instanceof oe)r=t(e.result);else if(e instanceof ie)for(var n=0,i=e.args;n<i.length&&!(r=t(i[n]));n+=1);else(e instanceof Ut||e instanceof re)&&e.input instanceof ut&&"zoom"===e.input.name&&(r=e);return r instanceof M||e.eachChild((function(e){var n=t(e);n instanceof M?r=n:!r&&n?r=new M("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&n&&r!==n&&(r=new M("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),r}(r);return o||i?o instanceof M?ze([o]):o instanceof re&&!Ce(e)?ze([new M("",'"interpolate" expressions cannot be used with this property')]):Ie(o?new Ne(n?"camera":"composite",t.value,o.labels,o instanceof re?o.interpolation:void 0):new qe(n?"constant":"source",t.value)):ze([new M("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Ne.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,o)},Ne.prototype.evaluate=function(t,e,r,n,i,o){return this._styleExpression.evaluate(t,e,r,n,i,o)},Ne.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?re.interpolationFactor(this.interpolationType,t,e,r):0};var Ze=function(t,e){this._parameters=t,this._specification=e,z(this,function t(e,r){var n,i,o,a="color"===r.type,s=e.stops&&"object"==typeof e.stops[0][0],u=s||!(s||void 0!==e.property),l=e.type||(Ce(r)?"exponential":"interval");if(a&&((e=z({},e)).stops&&(e.stops=e.stops.map((function(t){return[t[0],I.parse(t[1])]}))),e.default=I.parse(e.default?e.default:r.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!ee[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===l)n=Le;else if("interval"===l)n=Fe;else if("categorical"===l){n=De,i=Object.create(null);for(var p=0,c=e.stops;p<c.length;p+=1){var h=c[p];i[h[0]]=h[1]}o=typeof e.stops[0][0]}else{if("identity"!==l)throw new Error('Unknown function type "'+l+'"');n=Oe}if(s){for(var f={},y=[],d=0;d<e.stops.length;d++){var m=e.stops[d],v=m[0].zoom;void 0===f[v]&&(f[v]={zoom:v,type:e.type,property:e.property,default:e.default,stops:[]},y.push(v)),f[v].stops.push([m[0].value,m[1]])}for(var g=[],x=0,b=y;x<b.length;x+=1){var w=b[x];g.push([f[w].zoom,t(f[w],r)])}var _={name:"linear"};return{kind:"composite",interpolationType:_,interpolationFactor:re.interpolationFactor.bind(void 0,_),zoomStops:g.map((function(t){return t[0]})),evaluate:function(t,n){var i=t.zoom;return Le({stops:g,base:e.base},r,i).evaluate(i,n)}}}if(u){var S="exponential"===l?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:S,interpolationFactor:re.interpolationFactor.bind(void 0,S),zoomStops:e.stops.map((function(t){return t[0]})),evaluate:function(t){return n(e,r,t.zoom,i,o)}}}return{kind:"source",evaluate:function(t,a){var s=a&&a.properties?a.properties[e.property]:void 0;return void 0===s?Ve(e.default,r.default):n(e,r,s,i,o)}}}(this._parameters,this._specification))};Ze.deserialize=function(t){return new Ze(t._parameters,t._specification)},Ze.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var Xe=self.ImageData,Ye=self.ImageBitmap,Je={};function Ke(t,e,r){void 0===r&&(r={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),Je[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}for(var He in Ke("Object",Object),_.serialize=function(t,e){var r=t.toArrayBuffer();return e&&e.push(r),{buffer:r}},_.deserialize=function(t){return new _(t.buffer)},Ke("Grid",_),Ke("Color",I),Ke("Error",Error),Ke("ResolvedImage",Y),Ke("StylePropertyFunction",Ze),Ke("StyleExpression",Re,{omit:["_evaluator"]}),Ke("ZoomDependentExpression",Ne),Ke("ZoomConstantExpression",qe),Ke("CompoundExpression",ut,{omit:["_evaluate"]}),we)we[He]._classRegistryKey||Ke("Expression_"+He,we[He]);function We(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function $e(t){return Ye&&t instanceof Ye}function Qe(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(We(t)||$e(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var r=t;return e&&e.push(r.buffer),r}if(t instanceof Xe)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var n=[],i=0,o=t;i<o.length;i+=1)n.push(Qe(o[i],e));return n}if("object"==typeof t){var a=t.constructor,s=a._classRegistryKey;if(!s)throw new Error("can't serialize object of unregistered class");var u=a.serialize?a.serialize(t,e):{};if(!a.serialize){for(var l in t)if(t.hasOwnProperty(l)&&!(Je[s].omit.indexOf(l)>=0)){var p=t[l];u[l]=Je[s].shallow.indexOf(l)>=0?p:Qe(p,e)}t instanceof Error&&(u.message=t.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==s&&(u.$name=s),u}throw new Error("can't serialize object of type "+typeof t)}function tr(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||We(t)||$e(t)||ArrayBuffer.isView(t)||t instanceof Xe)return t;if(Array.isArray(t))return t.map(tr);if("object"==typeof t){var e=t.$name||"Object",r=Je[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),i=0,o=Object.keys(t);i<o.length;i+=1){var a=o[i];if("$name"!==a){var s=t[a];n[a]=Je[e].shallow.indexOf(a)>=0?s:tr(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var er=function(t){var e=this;this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback()})};er.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){t._triggered=!1,t._callback()}),0))},er.prototype.remove=function(){delete this._channel,this._callback=function(){}};var rr=function(t,e,r){var n;this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},n=this,["receive","process"].forEach((function(t){n[t]&&(n[t]=n[t].bind(n))})),this.invoker=new er(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=v()?t:self};rr.prototype.send=function(t,e,r,n,i){var o=this;void 0===i&&(i=!1);var a=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[a]=r);var s=b(this.globalScope)?void 0:[];return this.target.postMessage({id:a,type:t,hasCallback:!!r,targetMapId:n,mustQueue:i,sourceMapId:this.mapId,data:Qe(e,s)},s),{cancel:function(){r&&delete o.callbacks[a],o.target.postMessage({id:a,type:"<cancel>",targetMapId:n,sourceMapId:o.mapId})}}},rr.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else v()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},rr.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},rr.prototype.processTask=function(t,e){var r=this;if("<response>"===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(tr(e.error)):n(null,tr(e.data)))}else{var i=!1,o=b(this.globalScope)?void 0:[],a=e.hasCallback?function(e,n){i=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"<response>",sourceMapId:r.mapId,error:e?Qe(e):null,data:Qe(n,o)},o)}:function(t){i=!0},s=null,u=tr(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,u,a);else if(this.parent.getWorkerSource){var l=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,l[0],u.source)[l[1]](u,a)}else a(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},rr.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var nr={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},"*":{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"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["宋体","宋体"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},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},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#1890ff",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",default:"#ffffff",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:"#4F4F4F",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"}}},ir=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function or(t){var e=t.value;return e?[new ir(t.key,e,"constants have been deprecated as of v8")]:[]}function ar(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function sr(t){if(Array.isArray(t))return t.map(sr);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var r in t)e[r]=sr(t[r]);return e}return ar(t)}function ur(t){var e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=[],u=Te(r);if("object"!==u)return[new ir(e,r,"object expected, "+u+" found")];for(var l in r){var p=l.split(".")[0],c=n[p]||n["*"],h=void 0;if(i[p])h=i[p];else if(n[p])h=Br;else if(i["*"])h=i["*"];else{if(!n["*"]){s.push(new ir(e,r[l],'unknown property "'+l+'"'));continue}h=Br}s=s.concat(h({key:(e?e+".":e)+l,value:r[l],valueSpec:c,style:o,styleSpec:a,object:r,objectKey:l},r))}for(var f in n)i[f]||n[f].required&&void 0===n[f].default&&void 0===r[f]&&s.push(new ir(e,r,'missing required property "'+f+'"'));return s}function lr(t){var e=t.value,r=t.valueSpec,n=t.style,i=t.styleSpec,o=t.key,a=t.arrayElementValidator||Br;if("array"!==Te(e))return[new ir(o,e,"array expected, "+Te(e)+" found")];if(r.length&&e.length!==r.length)return[new ir(o,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.length<r["min-length"])return[new ir(o,e,"array length at least "+r["min-length"]+" expected, length "+e.length+" found")];var s={type:r.value,values:r.values};i.$version<7&&(s.function=r.function),"object"===Te(r.value)&&(s=r.value);for(var u=[],l=0;l<e.length;l++)u=u.concat(a({array:e,arrayIndex:l,value:e[l],valueSpec:s,style:n,styleSpec:i,key:o+"["+l+"]"}));return u}function pr(t){var e=t.key,r=t.value,n=t.valueSpec,i=Te(r);return"number"===i&&r!=r&&(i="NaN"),"number"!==i?[new ir(e,r,"number expected, "+i+" found")]:"minimum"in n&&r<n.minimum?[new ir(e,r,r+" is less than the minimum value "+n.minimum)]:"maximum"in n&&r>n.maximum?[new ir(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function cr(t){var e,r,n,i=t.valueSpec,o=ar(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,l="array"===Te(t.value.stops)&&"array"===Te(t.value.stops[0])&&"object"===Te(t.value.stops[0][0]),p=ur({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new ir(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(lr({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:c})),"array"===Te(r)&&0===r.length&&e.push(new ir(t.key,r,"array must have at least one stop")),e},default:function(t){return Br({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&p.push(new ir(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||p.push(new ir(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!Ce(t.valueSpec)&&p.push(new ir(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!Me(t.valueSpec)?p.push(new ir(t.key,t.value,"property functions not supported")):s&&!Pe(t.valueSpec)&&p.push(new ir(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!l||void 0!==t.value.property||p.push(new ir(t.key,t.value,'"property" property is required')),p;function c(t){var e=[],o=t.value,s=t.key;if("array"!==Te(o))return[new ir(s,o,"array expected, "+Te(o)+" found")];if(2!==o.length)return[new ir(s,o,"array length 2 expected, length "+o.length+" found")];if(l){if("object"!==Te(o[0]))return[new ir(s,o,"object expected, "+Te(o[0])+" found")];if(void 0===o[0].zoom)return[new ir(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new ir(s,o,"object stop key must have value")];if(n&&n>ar(o[0].zoom))return[new ir(s,o[0].zoom,"stop zoom values must appear in ascending order")];ar(o[0].zoom)!==n&&(n=ar(o[0].zoom),r=void 0,a={}),e=e.concat(ur({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:pr,value:h}}))}else e=e.concat(h({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return Ue(sr(o[1]))?e.concat([new ir(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(Br({key:s+"[1]",value:o[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function h(t,n){var s=Te(t.value),u=ar(t.value),l=null!==t.value?t.value:n;if(e){if(s!==e)return[new ir(t.key,l,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new ir(t.key,l,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var p="number expected, "+s+" found";return Me(i)&&void 0===o&&(p+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ir(t.key,l,p)]}return"categorical"!==o||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"number"===s&&void 0!==r&&u<r?[new ir(t.key,l,"stop domain values must appear in ascending order")]:(r=u,"categorical"===o&&u in a?[new ir(t.key,l,"stop domain values must be unique")]:(a[u]=!0,[])):[new ir(t.key,l,"integer expected, found "+u)]}}function hr(t){var e=("property"===t.expressionContext?Ge:je)(sr(t.value),t.valueSpec);if("error"===e.result)return e.value.map((function(e){return new ir(""+t.key+e.key,t.value,e.message)}));var r=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!r.outputDefined())return[new ir(t.key,t.value,'Invalid data expression for "'+t.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===t.expressionContext&&"layout"===t.propertyType&&!Dt(r))return[new ir(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!Dt(r))return[new ir(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!Ft(r,["zoom","feature-state"]))return[new ir(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!Vt(r))return[new ir(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function fr(t){var e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(ar(r))&&i.push(new ir(e,r,"expected one of ["+n.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(n.values).indexOf(ar(r))&&i.push(new ir(e,r,"expected one of ["+Object.keys(n.values).join(", ")+"], "+JSON.stringify(r)+" found")),i}function yr(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);e<r.length;e+=1){var n=r[e];if(!yr(n)&&"boolean"!=typeof n)return!1}return!0;default:return!0}}var dr={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function mr(t){if(null==t)return{filter:function(){return!0},needGeometry:!1};yr(t)||(t=gr(t));var e=je(t,dr);if("error"===e.result)throw new Error(e.value.map((function(t){return t.key+": "+t.message})).join(", "));return{filter:function(t,r,n){return e.value.evaluate(t,r,{},n)},needGeometry:Array.isArray(t)&&0!==t.length&&"within"===t[0]}}function vr(t,e){return t<e?-1:t>e?1:0}function gr(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?xr(t[1],t[2],"=="):"!="===r?_r(xr(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?xr(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(gr))):"all"===r?["all"].concat(t.slice(1).map(gr)):"none"===r?["all"].concat(t.slice(1).map(gr).map(_r)):"in"===r?br(t[1],t.slice(2)):"!in"===r?_r(br(t[1],t.slice(2))):"has"===r?wr(t[1]):"!has"!==r||_r(wr(t[1]))}function xr(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function br(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(vr)]]:["filter-in-small",t,["literal",e]]}}function wr(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function _r(t){return["!",t]}function Sr(t){return yr(sr(t.value))?hr(z({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==Te(r))return[new ir(n,r,"array expected, "+Te(r)+" found")];var i,o=e.styleSpec,a=[];if(r.length<1)return[new ir(n,r,"filter array must have at least 1 element")];switch(a=a.concat(fr({key:n+"[0]",value:r[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),ar(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===ar(r[1])&&a.push(new ir(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new ir(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(i=Te(r[1]))&&a.push(new ir(n+"[1]",r[1],"string expected, "+i+" found"));for(var s=2;s<r.length;s++)i=Te(r[s]),"$type"===ar(r[1])?a=a.concat(fr({key:n+"["+s+"]",value:r[s],valueSpec:o.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==i&&"number"!==i&&"boolean"!==i&&a.push(new ir(n+"["+s+"]",r[s],"string, number, or boolean expected, "+i+" found"));break;case"any":case"all":case"none":for(var u=1;u<r.length;u++)a=a.concat(t({key:n+"["+u+"]",value:r[u],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":i=Te(r[1]),2!==r.length?a.push(new ir(n,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"string"!==i&&a.push(new ir(n+"[1]",r[1],"string expected, "+i+" found"))}return a}(t)}function Ar(t,e){var r=t.key,n=t.style,i=t.styleSpec,o=t.value,a=t.objectKey,s=i[e+"_"+t.layerType];if(!s)return[];var u=a.match(/^(.*)-transition$/);if("paint"===e&&u&&s[u[1]]&&s[u[1]].transition)return Br({key:r,value:o,valueSpec:i.transition,style:n,styleSpec:i});var l,p=t.valueSpec||s[a];if(!p)return[new ir(r,o,'unknown property "'+a+'"')];if("string"===Te(o)&&Me(p)&&!p.tokens&&(l=/^{([^}]+)}$/.exec(o)))return[new ir(r,o,'"'+a+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(l[1])+" }`.")];var c=[];return"symbol"===t.layerType&&("text-field"===a&&n&&!n.glyphs&&c.push(new ir(r,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&Ee(sr(o))&&"identity"===ar(o.type)&&c.push(new ir(r,o,'"text-font" does not support identity functions'))),c.concat(Br({key:t.key,value:o,valueSpec:p,style:n,styleSpec:i,expressionContext:"property",propertyType:e,propertyKey:a}))}function kr(t){return Ar(t,"paint")}function Ir(t){return Ar(t,"layout")}function zr(t){var e=[],r=t.value,n=t.key,i=t.style,o=t.styleSpec;r.type||r.ref||e.push(new ir(n,r,'either "type" or "ref" is required'));var a,s=ar(r.type),u=ar(r.ref);if(r.id)for(var l=ar(r.id),p=0;p<t.arrayIndex;p++){var c=i.layers[p];ar(c.id)===l&&e.push(new ir(n,r.id,'duplicate layer id "'+r.id+'", previously used at line '+c.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach((function(t){t in r&&e.push(new ir(n,r[t],'"'+t+'" is prohibited for ref layers'))})),i.layers.forEach((function(t){ar(t.id)===u&&(a=t)})),a?a.ref?e.push(new ir(n,r.ref,"ref cannot reference another ref layer")):s=ar(a.type):e.push(new ir(n,r.ref,'ref layer "'+u+'" not found'));else if("background"!==s)if(r.source){var h=i.sources&&i.sources[r.source],f=h&&ar(h.type);h?"vector"===f&&"raster"===s?e.push(new ir(n,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===f&&"raster"!==s?e.push(new ir(n,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==f||r["source-layer"]?"raster-dem"===f&&"hillshade"!==s?e.push(new ir(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!r.paint||!r.paint["line-gradient"]||"geojson"===f&&h.lineMetrics||e.push(new ir(n,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new ir(n,r,'layer "'+r.id+'" must specify a "source-layer"')):e.push(new ir(n,r.source,'source "'+r.source+'" not found'))}else e.push(new ir(n,r,'missing required property "source"'));return e=e.concat(ur({key:n,value:r,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Br({key:n+".type",value:r.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"})},filter:Sr,layout:function(t){return ur({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return Ir(z({layerType:s},t))}}})},paint:function(t){return ur({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return kr(z({layerType:s},t))}}})}}}))}function Mr(t){var e=t.value,r=t.key,n=Te(e);return"string"!==n?[new ir(r,e,"string expected, "+n+" found")]:[]}var Pr={promoteId:function(t){var e=t.key,r=t.value;if("string"===Te(r))return Mr({key:e,value:r});var n=[];for(var i in r)n.push.apply(n,Mr({key:e+"."+i,value:r[i]}));return n}};function Cr(t){var e=t.value,r=t.key,n=t.styleSpec,i=t.style;if(!e.type)return[new ir(r,e,'"type" is required')];var o,a=ar(e.type);switch(a){case"vector":case"raster":case"raster-dem":return ur({key:r,value:e,valueSpec:n["source_"+a.replace("-","_")],style:t.style,styleSpec:n,objectElementValidators:Pr});case"geojson":if(o=ur({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n,objectElementValidators:Pr}),e.cluster)for(var s in e.clusterProperties){var u=e.clusterProperties[s],l=u[0],p="string"==typeof l?[l,["accumulated"],["get",s]]:l;o.push.apply(o,hr({key:r+"."+s+".map",value:u[1],expressionContext:"cluster-map"})),o.push.apply(o,hr({key:r+"."+s+".reduce",value:p,expressionContext:"cluster-reduce"}))}return o;case"video":return ur({key:r,value:e,valueSpec:n.source_video,style:i,styleSpec:n});case"image":return ur({key:r,value:e,valueSpec:n.source_image,style:i,styleSpec:n});case"canvas":return[new ir(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return fr({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,styleSpec:n})}}function Tr(t){var e=t.value,r=t.styleSpec,n=r.light,i=t.style,o=[],a=Te(e);if(void 0===e)return o;if("object"!==a)return o.concat([new ir("light",e,"object expected, "+a+" found")]);for(var s in e){var u=s.match(/^(.*)-transition$/);o=o.concat(u&&n[u[1]]&&n[u[1]].transition?Br({key:s,value:e[s],valueSpec:r.transition,style:i,styleSpec:r}):n[s]?Br({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r}):[new ir(s,e[s],'unknown property "'+s+'"')])}return o}var Er={"*":function(){return[]},array:lr,boolean:function(t){var e=t.value,r=t.key,n=Te(e);return"boolean"!==n?[new ir(r,e,"boolean expected, "+n+" found")]:[]},number:pr,color:function(t){var e=t.key,r=t.value,n=Te(r);return"string"!==n?[new ir(e,r,"color expected, "+n+" found")]:null===k(r)?[new ir(e,r,'color expected, "'+r+'" found')]:[]},constants:or,enum:fr,filter:Sr,function:cr,layer:zr,object:ur,source:Cr,light:Tr,string:Mr,formatted:function(t){return 0===Mr(t).length?[]:hr(t)},resolvedImage:function(t){return 0===Mr(t).length?[]:hr(t)}};function Br(t){var e=t.value,r=t.valueSpec,n=t.styleSpec;return r.expression&&Ee(ar(e))?cr(t):r.expression&&Ue(sr(e))?hr(t):r.type&&Er[r.type]?Er[r.type](t):ur(z({},t,{valueSpec:r.type?n[r.type]:r}))}function Vr(t){var e=t.value,r=t.key,n=Mr(t);return n.length||(-1===e.indexOf("{fontstack}")&&n.push(new ir(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new ir(r,e,'"glyphs" url must include a "{range}" token'))),n}function Dr(t,e){void 0===e&&(e=nr);var r=[];return r=r.concat(Br({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:Vr,"*":function(){return[]}}})),t.constants&&(r=r.concat(or({key:"constants",value:t.constants,style:t,styleSpec:e}))),Fr(r)}function Fr(t){return[].concat(t).sort((function(t,e){return t.line-e.line}))}function Lr(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return Fr(t.apply(this,e))}}function Or(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function Rr(t,e,r){if(r&&r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}Dr.source=Lr(Cr),Dr.light=Lr(Tr),Dr.layer=Lr(zr),Dr.filter=Lr(Sr),Dr.paintProperty=Lr(kr),Dr.layoutProperty=Lr(Ir);var Ur=function(t,e){void 0===e&&(e={}),a(this,e),this.type=t},jr=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"error",a({error:e},r))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Ur),qr=function(){};qr.prototype.on=function(t,e){return this._listeners=this._listeners||{},Or(t,e,this._listeners),this},qr.prototype.off=function(t,e){return Rr(t,e,this._listeners),Rr(t,e,this._oneTimeListeners),this},qr.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},Or(t,e,this._oneTimeListeners),this},qr.prototype.fire=function(t,e){"string"==typeof t&&(t=new Ur(t,e||{}));var r=t.type;if(this.listens(r)){t.target=this;for(var n=0,i=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];n<i.length;n+=1)i[n].call(this,t);for(var o=0,s=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];o<s.length;o+=1){var u=s[o];Rr(r,u,this._oneTimeListeners),u.call(this,t)}var l=this._eventedParent;l&&(a(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),l.fire(t))}else t instanceof jr&&console.error(t.error);return this},qr.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},qr.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Nr=Dr,Gr=Nr.paintProperty,Zr=Nr.layoutProperty,Xr=function(){this.first=!0};Xr.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=r,!0))};var Yr=function(t){return t>=1536&&t<=1791},Jr=function(t){return t>=1872&&t<=1919},Kr=function(t){return t>=2208&&t<=2303},Hr=function(t){return t>=11904&&t<=12031},Wr=function(t){return t>=12032&&t<=12255},$r=function(t){return t>=12272&&t<=12287},Qr=function(t){return t>=12288&&t<=12351},tn=function(t){return t>=12352&&t<=12447},en=function(t){return t>=12448&&t<=12543},rn=function(t){return t>=12544&&t<=12591},nn=function(t){return t>=12704&&t<=12735},on=function(t){return t>=12736&&t<=12783},an=function(t){return t>=12784&&t<=12799},sn=function(t){return t>=12800&&t<=13055},un=function(t){return t>=13056&&t<=13311},ln=function(t){return t>=13312&&t<=19903},pn=function(t){return t>=19968&&t<=40959},cn=function(t){return t>=40960&&t<=42127},hn=function(t){return t>=42128&&t<=42191},fn=function(t){return t>=63744&&t<=64255},yn=function(t){return t>=64336&&t<=65023},dn=function(t){return t>=65040&&t<=65055},mn=function(t){return t>=65072&&t<=65103},vn=function(t){return t>=65104&&t<=65135},gn=function(t){return t>=65136&&t<=65279},xn=function(t){return t>=65280&&t<=65519};function bn(t){for(var e=0,r=t;e<r.length;e+=1)if(wn(r[e].charCodeAt(0)))return!0;return!1}function wn(t){return!(746!==t&&747!==t&&(t<4352||!(nn(t)||rn(t)||mn(t)&&!(t>=65097&&t<=65103)||fn(t)||un(t)||Hr(t)||on(t)||!(!Qr(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||ln(t)||pn(t)||sn(t)||function(t){return t>=12592&&t<=12687}(t)||function(t){return t>=43360&&t<=43391}(t)||function(t){return t>=55216&&t<=55295}(t)||function(t){return t>=4352&&t<=4607}(t)||function(t){return t>=44032&&t<=55215}(t)||tn(t)||$r(t)||function(t){return t>=12688&&t<=12703}(t)||Wr(t)||an(t)||en(t)&&12540!==t||!(!xn(t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!vn(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||function(t){return t>=5120&&t<=5759}(t)||function(t){return t>=6320&&t<=6399}(t)||dn(t)||function(t){return t>=19904&&t<=19967}(t)||cn(t)||hn(t))))}function _n(t){return!(wn(t)||function(t){return!!(function(t){return t>=128&&t<=255}(t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||function(t){return t>=8192&&t<=8303}(t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||function(t){return t>=8448&&t<=8527}(t)||function(t){return t>=8528&&t<=8591}(t)||function(t){return t>=8960&&t<=9215}(t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||function(t){return t>=9216&&t<=9279}(t)&&9251!==t||function(t){return t>=9280&&t<=9311}(t)||function(t){return t>=9312&&t<=9471}(t)||function(t){return t>=9632&&t<=9727}(t)||function(t){return t>=9728&&t<=9983}(t)&&!(t>=9754&&t<=9759)||function(t){return t>=11008&&t<=11263}(t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Qr(t)||en(t)||function(t){return t>=57344&&t<=63743}(t)||mn(t)||vn(t)||xn(t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Sn(t){return t>=1424&&t<=2303||yn(t)||gn(t)}function An(t,e){return!(!e&&Sn(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||function(t){return t>=6016&&t<=6143}(t))}function kn(t){for(var e=0,r=t;e<r.length;e+=1)if(Sn(r[e].charCodeAt(0)))return!0;return!1}var In,zn,Mn,Pn,Cn={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Tn=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),En=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,Bn=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,Vn={now:Tn,frame:function(t){var e=En(t);return{cancel:function(){return Bn(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=self.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return In||(In=self.document.createElement("a")),In.href=t,In.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},get prefersReducedMotion(){return!!self.matchMedia&&(null==zn&&(zn=self.matchMedia("(prefers-reduced-motion: reduce)")),zn.matches)}},Dn={supported:!1,testSupport:function(t){!Fn&&Pn&&(Ln?On(t):Mn=t)}},Fn=!1,Ln=!1;function On(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,Pn),t.isContextLost())return;Dn.supported=!0}catch(t){}t.deleteTexture(e),Fn=!0}self.document&&((Pn=self.document.createElement("img")).onload=function(){Mn&&On(Mn),Mn=null,Ln=!0},Pn.onerror=function(){Fn=!0,Mn=null},Pn.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var Rn=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Un(t){return Rn.test(t)}var jn=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function qn(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(self.atob(e[1]).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch(t){return null}}var Nn=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};Nn.prototype.getStorageKey=function(t){var e,r=qn(Cn.ACCESS_TOKEN);return e=r&&r.u?self.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))}))):"",t?"mapbox.eventData."+t+":"+e:"mapbox.eventData:"+e},Nn.prototype.fetchEventData=function(){var t=w("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var n=self.localStorage.getItem(e);n&&(this.eventData=JSON.parse(n));var i=self.localStorage.getItem(r);i&&(this.anonId=i)}catch(t){y("Unable to read from LocalStorage")}},Nn.prototype.saveEventData=function(){var t=w("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{self.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&self.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){y("Unable to write to LocalStorage")}},Nn.prototype.processRequests=function(t){},Nn.prototype.postEvent=function(t,e,r,n){var i=this;if(Cn.EVENTS_URL){var o=function(t){var e=t.match(jn);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}(Cn.EVENTS_URL);o.params.push("access_token="+(n||Cn.ACCESS_TOKEN||""));var s,u,l={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"16.0.0",skuId:"01",userId:this.anonId},p=e?a(l,e):l,c={url:(s=o,u=s.params.length?"?"+s.params.join("&"):"",s.protocol+"://"+s.authority+s.path+u),headers:{"Content-Type":"text/plain"},body:JSON.stringify([p])};this.pendingRequest=li(c,(function(t){i.pendingRequest=null,r(t),i.saveEventData(),i.processRequests(n)}))}},Nn.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var Gn,Zn,Xn=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(Cn.EVENTS_URL&&n||Cn.ACCESS_TOKEN)&&this.queueRequest({id:e,timestamp:Date.now()},n)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),l(this.anonId)||(this.anonId=u()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}(Nn),Yn=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postTurnstileEvent=function(t,e){Cn.EVENTS_URL&&Cn.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return function(t){return 0===t.indexOf("mapbox:")}(t)||Un(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=qn(Cn.ACCESS_TOKEN),n=r?r.u:Cn.ACCESS_TOKEN,i=n!==this.eventData.tokenU;l(this.anonId)||(this.anonId=u(),i=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var a=new Date(this.eventData.lastSuccess),s=new Date(o),p=(o-this.eventData.lastSuccess)/864e5;i=i||p>=1||p<-1||a.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(o,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=o,e.eventData.tokenU=n)}),t)}},e}(Nn)),Jn=Yn.postTurnstileEvent.bind(Yn),Kn=new Xn,Hn=Kn.postMapLoadEvent.bind(Kn);function Wn(){self.caches&&!Gn&&(Gn=self.caches.open("mapbox-tiles"))}function $n(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var Qn,ti=1/0,ei={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(ei);var ri=function(t){function e(e,r,n){401===r&&Un(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),ni=v()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===self.location.protocol?self.parent:self).location.href};var ii,oi,ai=function(t,e){if(!(/^file:/.test(r=t.url)||/^file:/.test(ni())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return function(t,e){var r,n=new self.AbortController,i=new self.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:ni(),signal:n.signal}),o=!1,a=!1,s=(r=i.url).indexOf("sku=")>0&&Un(r);"json"===t.type&&i.headers.set("Accept","application/json");var u=function(r,n,o){if(!a){if(r&&"SecurityError"!==r.message&&y(r),n&&o)return l(n);var u=Date.now();self.fetch(i).then((function(r){if(r.ok){var n=s?r.clone():null;return l(r,n,u)}return e(new ri(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},l=function(r,n,s){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){a||(n&&s&&function(t,e,r){if(Wn(),Gn){var n={status:e.status,statusText:e.statusText,headers:new self.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var i=g(e.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===Zn)try{new Response(new ReadableStream),Zn=!0}catch(t){Zn=!1}Zn?e(t.body):t.blob().then(e)}(e,(function(e){var r=new self.Response(e,n);Wn(),Gn&&Gn.then((function(e){return e.put($n(t.url),r)})).catch((function(t){return y(t.message)}))})))}}(i,n,s),o=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){a||e(new Error(t.message))}))};return s?function(t,e){if(Wn(),!Gn)return e(null);var r=$n(t.url);Gn.then((function(t){t.match(r).then((function(n){var i=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),r=g(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),i&&t.put(r,n.clone()),e(null,n,i)})).catch(e)})).catch(e)}(i,u):u(null,null),{cancel:function(){a=!0,o||n.abort()}}}(t,e);if(v()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(t,e){var r=new self.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new ri(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},si=function(t,e){return ai(a(t,{type:"json"}),e)},ui=function(t,e){return ai(a(t,{type:"arrayBuffer"}),e)},li=function(t,e){return ai(a(t,{method:"POST"}),e)};ii=[],oi=0;var pi=function(t,e){if(Dn.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),oi>=Cn.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return ii.push(r),r}oi++;var n=!1,i=function(){if(!n)for(n=!0,oi--;ii.length&&oi<Cn.MAX_PARALLEL_IMAGE_REQUESTS;){var t=ii.shift();t.cancelled||(t.cancel=pi(t.requestParameters,t.callback).cancel)}},o=ui(t,(function(t,r,n,o){i(),t?e(t):r&&(null==Qn&&(Qn=self.OffscreenCanvas&&new self.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),Qn?function(t,e){var r=new self.Blob([new Uint8Array(t)],{type:"image/png"});self.createImageBitmap(r).then((function(t){e(null,t)})).catch((function(t){e(new Error("Could not load image because of "+t.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}))}(r,e):function(t,e,r,n){var i=new self.Image,o=self.URL;i.onload=function(){e(null,i),o.revokeObjectURL(i.src)},i.onerror=function(){return 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."))};var a=new self.Blob([new Uint8Array(t)],{type:"image/png"});i.cacheControl=r,i.expires=n,i.src=t.byteLength?o.createObjectURL(a):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}(r,e,n,o))}));return{cancel:function(){o.cancel(),i()}}},ci="unavailable",hi=null,fi={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===ci||null!=fi.applyArabicShaping},isLoading:function(){return"loading"===ci},setState:function(t){ci=t.pluginStatus,hi=t.pluginURL},isParsed:function(){return null!=fi.applyArabicShaping&&null!=fi.processBidirectionalText&&null!=fi.processStyledBidirectionalText},getPluginURL:function(){return hi}},yi=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Xr,this.transition={})};yi.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;r<n.length;r+=1)if(!An(n[r].charCodeAt(0),e))return!1;return!0}(t,fi.isLoaded())},yi.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},yi.prototype.getCrossfadeParameters=function(){var t=this.zoom,e=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var di=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Ee(t))return new Ze(t,e);if(Ue(t)){var r=Ge(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=I.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};di.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},di.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var mi=function(t){this.property=t,this.value=new di(t,void 0)};mi.prototype.transitioned=function(t,e){return new gi(this.property,this.value,e,a({},t.transition,this.transition),t.now)},mi.prototype.untransitioned=function(){return new gi(this.property,this.value,null,{},0)};var vi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};vi.prototype.getValue=function(t){return h(this._values[t].value.value)},vi.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new mi(this._values[t].property)),this._values[t].value=new di(this._values[t].property,null===e?void 0:h(e))},vi.prototype.getTransition=function(t){return h(this._values[t].transition)},vi.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new mi(this._values[t].property)),this._values[t].transition=h(e)||void 0},vi.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],i=this.getValue(n);void 0!==i&&(t[n]=i);var o=this.getTransition(n);void 0!==o&&(t[n+"-transition"]=o)}return t},vi.prototype.transitioned=function(t,e){for(var r=new xi(this._properties),n=0,i=Object.keys(this._values);n<i.length;n+=1){var o=i[n];r._values[o]=this._values[o].transitioned(t,e._values[o])}return r},vi.prototype.untransitioned=function(){for(var t=new xi(this._properties),e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e];t._values[n]=this._values[n].untransitioned()}return t};var gi=function(t,e,r,n,i){this.property=t,this.value=e,this.begin=i+n.delay||0,this.end=this.begin+n.duration||0,t.specification.transition&&(n.delay||n.duration)&&(this.prior=r)};gi.prototype.possiblyEvaluate=function(t,e,r){var n=t.now||0,i=this.value.possiblyEvaluate(t,e,r),o=this.prior;if(o){if(n>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n<this.begin)return o.possiblyEvaluate(t,e,r);var a=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(t,e,r),i,function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(a))}return i};var xi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};xi.prototype.possiblyEvaluate=function(t,e){for(var r=new _i(this._properties),n=0,i=Object.keys(this._values);n<i.length;n+=1){var o=i[n];r._values[o]=this._values[o].possiblyEvaluate(t,e)}return r},xi.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1)if(this._values[e[t]].prior)return!0;return!1};var bi=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};bi.prototype.getValue=function(t){return h(this._values[t].value)},bi.prototype.setValue=function(t,e){this._values[t]=new di(this._values[t].property,null===e?void 0:h(e))},bi.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],i=this.getValue(n);void 0!==i&&(t[n]=i)}return t},bi.prototype.possiblyEvaluate=function(t,e){for(var r=new _i(this._properties),n=0,i=Object.keys(this._values);n<i.length;n+=1){var o=i[n];r._values[o]=this._values[o].possiblyEvaluate(t,e)}return r};var wi=function(t,e,r){this.property=t,this.value=e,this.parameters=r};wi.prototype.isConstant=function(){return"constant"===this.value.kind},wi.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},wi.prototype.evaluate=function(t,e,r,n){return this.property.evaluate(this.value,this.parameters,t,e,r,n)};var _i=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};_i.prototype.get=function(t){return this._values[t]};var Si=function(t){this.specification=t};Si.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},Si.prototype.interpolate=function(t,e,r){var n=qt[this.specification.type];return n?n(t,e,r):t};var Ai=function(t,e){this.specification=t,this.overrides=e};Ai.prototype.possiblyEvaluate=function(t,e,r,n){return new wi(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},r,n)}:t.expression,e)},Ai.prototype.interpolate=function(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new wi(this,{kind:"constant",value:void 0},t.parameters);var n=qt[this.specification.type];return n?new wi(this,{kind:"constant",value:n(t.value.value,e.value.value,r)},t.parameters):t},Ai.prototype.evaluate=function(t,e,r,n,i,o){return"constant"===t.kind?t.value:t.evaluate(e,r,n,i,o)};var ki=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0===t.value)return new wi(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n),o="resolvedImage"===t.property.specification.type&&"string"!=typeof i?i.name:i,a=this._calculate(o,o,o,e);return new wi(this,{kind:"constant",value:a},e)}if("camera"===t.expression.kind){var s=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new wi(this,{kind:"constant",value:s},e)}return new wi(this,t.expression,e)},e.prototype.evaluate=function(t,e,r,n,i,o){if("source"===t.kind){var a=t.evaluate(e,r,n,i,o);return this._calculate(a,a,a,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,n),t.evaluate({zoom:Math.floor(e.zoom)},r,n),t.evaluate({zoom:Math.floor(e.zoom)+1},r,n),e):t.value},e.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(Ai),Ii=function(t){this.specification=t};Ii.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new yi(Math.floor(e.zoom-1),e)),t.expression.evaluate(new yi(Math.floor(e.zoom),e)),t.expression.evaluate(new yi(Math.floor(e.zoom+1),e)),e)}},Ii.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},Ii.prototype.interpolate=function(t){return t};var zi=function(t){this.specification=t};zi.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},zi.prototype.interpolate=function(){return!1};var Mi=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new di(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new mi(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};Ke("DataDrivenProperty",Ai),Ke("DataConstantProperty",Si),Ke("CrossFadedDataDrivenProperty",ki),Ke("CrossFadedProperty",Ii),Ke("ColorRampProperty",zi);var Pi=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(this.metadata=(e=e).metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new bi(r.layout)),r.paint)){for(var n in this._transitionablePaint=new vi(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned()}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){void 0===r&&(r={}),null!=e&&this._validate(Zr,"layers."+this.id+".layout."+t,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return p(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e&&this._validate(Gr,"layers."+this.id+".paint."+t,t,e,r))return!1;if(p(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var n=this._transitionablePaint._values[t],i="cross-faded-data-driven"===n.property.specification["property-type"],o=n.value.isDataDriven(),a=n.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var s=this._transitionablePaint._values[t].value;return s.isDataDriven()||o||i||this._handleOverridablePaintPropertyUpdate(t,a,s)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,e)},e.prototype.serialize=function(){var t={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&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),function(t,e,r){var n={};for(var i in t)e.call(this,t[i],i,t)&&(n[i]=t[i]);return n}(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&function(t,e){var r=!1;if(e&&e.length)for(var n=0,i=e;n<i.length;n+=1)t.fire(new jr(new Error(i[n].message))),r=!0;return r}(this,t.call(Nr,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:nr,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof wi&&Me(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(qr),Ci={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ti=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Ei=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Bi(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var i=Ci[t.type].BYTES_PER_ELEMENT,o=r=Vi(r,Math.max(e,i)),a=t.components||1;return n=Math.max(n,i),r+=i*a,{name:t.name,type:t.type,components:a,offset:o}})),size:Vi(r,Math.max(n,e)),alignment:e}}function Vi(t,e){return Math.ceil(t/e)*e}Ei.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Ei.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},Ei.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Ei.prototype.clear=function(){this.length=0},Ei.prototype.resize=function(t){this.reserve(t),this.length=t},Ei.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},Ei.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(Ei);Di.prototype.bytesPerElement=4,Ke("StructArrayLayout2i4",Di);var Fi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=4*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=n,this.int16[o+3]=i,t},e}(Ei);Fi.prototype.bytesPerElement=8,Ke("StructArrayLayout4i8",Fi);var Li=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(Ei);Li.prototype.bytesPerElement=12,Ke("StructArrayLayout2i4i12",Li);var Oi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=4*t,u=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[u+4]=n,this.uint8[u+5]=i,this.uint8[u+6]=o,this.uint8[u+7]=a,t},e}(Ei);Oi.prototype.bytesPerElement=8,Ke("StructArrayLayout2i4ub8",Oi);var Ri=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,l){var p=this.length;return this.resize(p+1),this.emplace(p,t,e,r,n,i,o,a,s,u,l)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,p){var c=9*t,h=18*t;return this.uint16[c+0]=e,this.uint16[c+1]=r,this.uint16[c+2]=n,this.uint16[c+3]=i,this.uint16[c+4]=o,this.uint16[c+5]=a,this.uint16[c+6]=s,this.uint16[c+7]=u,this.uint8[h+16]=l,this.uint8[h+17]=p,t},e}(Ei);Ri.prototype.bytesPerElement=18,Ke("StructArrayLayout8ui2ub18",Ri);var Ui=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,l,p,c){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,n,i,o,a,s,u,l,p,c)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,p,c,h){var f=12*t;return this.int16[f+0]=e,this.int16[f+1]=r,this.int16[f+2]=n,this.int16[f+3]=i,this.uint16[f+4]=o,this.uint16[f+5]=a,this.uint16[f+6]=s,this.uint16[f+7]=u,this.int16[f+8]=l,this.int16[f+9]=p,this.int16[f+10]=c,this.int16[f+11]=h,t},e}(Ei);Ui.prototype.bytesPerElement=24,Ke("StructArrayLayout4i4ui4i24",Ui);var ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t},e}(Ei);ji.prototype.bytesPerElement=12,Ke("StructArrayLayout3f12",ji);var qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint32[1*t+0]=e,t},e}(Ei);qi.prototype.bytesPerElement=4,Ke("StructArrayLayout1ul4",qi);var Ni=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,l,p){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,o,a,s,u,l,p)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,p,c){var h=12*t,f=6*t;return this.int16[h+0]=e,this.int16[h+1]=r,this.int16[h+2]=n,this.int16[h+3]=i,this.int16[h+4]=o,this.int16[h+5]=a,this.uint32[f+3]=s,this.uint16[h+8]=u,this.uint16[h+9]=l,this.int16[h+10]=p,this.int16[h+11]=c,t},e}(Ei);Ni.prototype.bytesPerElement=24,Ke("StructArrayLayout6i1ul2ui2i24",Ni);var Gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(Ei);Gi.prototype.bytesPerElement=12,Ke("StructArrayLayout2i2i2i12",Gi);var Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=12*t,a=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[a+1]=n,this.float32[a+2]=i,t},e}(Ei);Zi.prototype.bytesPerElement=12,Ke("StructArrayLayout2ub2f12",Zi);var Xi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m){var v=this.length;return this.resize(v+1),this.emplace(v,t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m,v){var g=24*t,x=12*t,b=48*t;return this.int16[g+0]=e,this.int16[g+1]=r,this.uint16[g+2]=n,this.uint16[g+3]=i,this.uint32[x+2]=o,this.uint32[x+3]=a,this.uint32[x+4]=s,this.uint16[g+10]=u,this.uint16[g+11]=l,this.uint16[g+12]=p,this.float32[x+7]=c,this.float32[x+8]=h,this.uint8[b+36]=f,this.uint8[b+37]=y,this.uint8[b+38]=d,this.uint32[x+10]=m,this.int16[g+22]=v,t},e}(Ei);Xi.prototype.bytesPerElement=48,Ke("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Xi);var Yi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m,v,g,x,b,w,_,S,A,k){var I=this.length;return this.resize(I+1),this.emplace(I,t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m,v,g,x,b,w,_,S,A,k)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m,v,g,x,b,w,_,S,A,k,I){var z=30*t,M=15*t;return this.int16[z+0]=e,this.int16[z+1]=r,this.int16[z+2]=n,this.int16[z+3]=i,this.int16[z+4]=o,this.int16[z+5]=a,this.int16[z+6]=s,this.int16[z+7]=u,this.uint16[z+8]=l,this.uint16[z+9]=p,this.uint16[z+10]=c,this.uint16[z+11]=h,this.uint16[z+12]=f,this.uint16[z+13]=y,this.uint16[z+14]=d,this.uint16[z+15]=m,this.uint16[z+16]=v,this.uint16[z+17]=g,this.uint16[z+18]=x,this.uint16[z+19]=b,this.uint16[z+20]=w,this.uint16[z+21]=_,this.uint32[M+11]=S,this.float32[M+12]=A,this.float32[M+13]=k,this.float32[M+14]=I,t},e}(Ei);Yi.prototype.bytesPerElement=60,Ke("StructArrayLayout8i14ui1ul3f60",Yi);var Ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.float32[1*t+0]=e,t},e}(Ei);Ji.prototype.bytesPerElement=4,Ke("StructArrayLayout1f4",Ji);var Ki=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t},e}(Ei);Ki.prototype.bytesPerElement=6,Ke("StructArrayLayout3i6",Ki);var Hi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=4*t;return this.uint32[2*t+0]=e,this.uint16[i+2]=r,this.uint16[i+3]=n,t},e}(Ei);Hi.prototype.bytesPerElement=8,Ke("StructArrayLayout1ul2ui8",Hi);var Wi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t},e}(Ei);Wi.prototype.bytesPerElement=6,Ke("StructArrayLayout3ui6",Wi);var $i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(Ei);$i.prototype.bytesPerElement=4,Ke("StructArrayLayout2ui4",$i);var Qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint16[1*t+0]=e,t},e}(Ei);Qi.prototype.bytesPerElement=2,Ke("StructArrayLayout1ui2",Qi);var to=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(Ei);to.prototype.bytesPerElement=8,Ke("StructArrayLayout2f8",to);var eo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=4*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.float32[o+3]=i,t},e}(Ei);eo.prototype.bytesPerElement=16,Ke("StructArrayLayout4f16",eo);var ro=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},radius:{configurable:!0},signedDistanceFromAnchor:{configurable:!0},anchorPoint:{configurable:!0}};return n.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},n.x1.get=function(){return this._structArray.int16[this._pos2+2]},n.y1.get=function(){return this._structArray.int16[this._pos2+3]},n.x2.get=function(){return this._structArray.int16[this._pos2+4]},n.y2.get=function(){return this._structArray.int16[this._pos2+5]},n.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},n.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},n.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},n.radius.get=function(){return this._structArray.int16[this._pos2+10]},n.signedDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+11]},n.anchorPoint.get=function(){return new r(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,n),e}(Ti);ro.prototype.size=24;var no=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new ro(this,t)},e}(Ni);Ke("CollisionBoxArray",no);var io=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(Ti);io.prototype.size=48;var oo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new io(this,t)},e}(Xi);Ke("PlacedSymbolArray",oo);var ao=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+11]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+11]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+12]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+14]},Object.defineProperties(e.prototype,r),e}(Ti);ao.prototype.size=60;var so=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new ao(this,t)},e}(Yi);Ke("SymbolInstanceArray",so);var uo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Ji);Ke("GlyphOffsetArray",uo);var lo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(Ki);Ke("SymbolLineVertexArray",lo);var po=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(Ti);po.prototype.size=8;var co=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new po(this,t)},e}(Hi);Ke("FeatureIndexArray",co);var ho=Bi([{name:"a_pos",components:2,type:"Int16"}],4).members,fo=function(t){void 0===t&&(t=[]),this.segments=t};function yo(t,e){return 256*(t=i(Math.floor(t),0,255))+i(Math.floor(e),0,255)}fo.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>fo.MAX_VERTEX_ARRAY_LENGTH&&y("Max vertices per segment is "+fo.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>fo.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},fo.prototype.get=function(){return this.segments},fo.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var r=e[t];for(var n in r.vaos)r.vaos[n].destroy()}},fo.simpleSegment=function(t,e,r,n){return new fo([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])},fo.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ke("SegmentVector",fo);var mo=A((function(t){t.exports=function(t,e){var r,n,i,o,a,s,u,l;for(n=t.length-(r=3&t.length),i=e,a=3432918353,s=461845907,l=0;l<n;)u=255&t.charCodeAt(l)|(255&t.charCodeAt(++l))<<8|(255&t.charCodeAt(++l))<<16|(255&t.charCodeAt(++l))<<24,++l,i=27492+(65535&(o=5*(65535&(i=(i^=u=(65535&(u=(u=(65535&u)*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(u=0,r){case 3:u^=(255&t.charCodeAt(l+2))<<16;case 2:u^=(255&t.charCodeAt(l+1))<<8;case 1:i^=u=(65535&(u=(u=(65535&(u^=255&t.charCodeAt(l)))*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}})),vo=A((function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,o=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:i^=(255&t.charCodeAt(o+2))<<16;case 2:i^=(255&t.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),go=mo,xo=vo;go.murmur3=mo,go.murmur2=xo;var bo=function(){this.ids=[],this.positions=[],this.indexed=!1};bo.prototype.add=function(t,e,r,n){this.ids.push(_o(t)),this.positions.push(e,r,n)},bo.prototype.getPositions=function(t){for(var e=_o(t),r=0,n=this.ids.length-1;r<n;){var i=r+n>>1;this.ids[i]>=e?n=i:r=i+1}for(var o=[];this.ids[r]===e;)o.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return o},bo.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,i){if(!(n>=i)){for(var o=e[n+i>>1],a=n-1,s=i+1;;){do{a++}while(e[a]<o);do{s--}while(e[s]>o);if(a>=s)break;So(e,a,s),So(r,3*a,3*s),So(r,3*a+1,3*s+1),So(r,3*a+2,3*s+2)}t(e,r,n,s),t(e,r,s+1,i)}}(r,n,0,r.length-1),e&&e.push(r.buffer,n.buffer),{ids:r,positions:n}},bo.deserialize=function(t){var e=new bo;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e};var wo=Math.pow(2,53)-1;function _o(t){var e=+t;return!isNaN(e)&&e<=wo?e:go(String(t))}function So(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}Ke("FeaturePositionMap",bo);var Ao=function(t,e){this.gl=t.gl,this.location=e},ko=(function(t){function e(e,r){t.call(this,e,r),this.current=0}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))}}(Ao),function(t){function e(e,r){t.call(this,e,r),this.current=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))},e}(Ao)),Io=(function(t){function e(e,r){t.call(this,e,r),this.current=[0,0]}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))}}(Ao),function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0]}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))}}(Ao),function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))},e}(Ao)),zo=function(t){function e(e,r){t.call(this,e,r),this.current=I.transparent}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))},e}(Ao),Mo=new Float32Array(16);function Po(t){return[yo(255*t.r,255*t.g),yo(255*t.b,255*t.a)]}!function(t){function e(e,r){t.call(this,e,r),this.current=Mo}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(var e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}}}(Ao);var Co=function(t,e,r){this.value=t,this.uniformNames=e.map((function(t){return"u_"+t})),this.type=r};Co.prototype.setUniform=function(t,e,r){t.set(r.constantOr(this.value))},Co.prototype.getBinding=function(t,e,r){return"color"===this.type?new zo(t,e):new ko(t,e)};var To=function(t,e){this.uniformNames=e.map((function(t){return"u_"+t})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};To.prototype.setConstantPatternPositions=function(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr},To.prototype.setUniform=function(t,e,r,n){var i="u_pattern_to"===n?this.patternTo:"u_pattern_from"===n?this.patternFrom:"u_pixel_ratio_to"===n?this.pixelRatioTo:"u_pixel_ratio_from"===n?this.pixelRatioFrom:null;i&&t.set(i)},To.prototype.getBinding=function(t,e,r){return"u_pattern"===r.substr(0,9)?new Io(t,e):new ko(t,e)};var Eo=function(t,e,r,n){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?2:1,offset:0}})),this.paintVertexArray=new n};Eo.prototype.populatePaintArray=function(t,e,r,n,i){var o=this.paintVertexArray.length,a=this.expression.evaluate(new yi(0),e,{},n,[],i);this.paintVertexArray.resize(t),this._setPaintValue(o,t,a)},Eo.prototype.updatePaintArray=function(t,e,r,n){var i=this.expression.evaluate({zoom:0},r,n);this._setPaintValue(t,e,i)},Eo.prototype._setPaintValue=function(t,e,r){if("color"===this.type)for(var n=Po(r),i=t;i<e;i++)this.paintVertexArray.emplace(i,n[0],n[1]);else{for(var o=t;o<e;o++)this.paintVertexArray.emplace(o,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}},Eo.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Eo.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var Bo=function(t,e,r,n,i,o){this.expression=t,this.uniformNames=e.map((function(t){return"u_"+t+"_t"})),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?4:2,offset:0}})),this.paintVertexArray=new o};Bo.prototype.populatePaintArray=function(t,e,r,n,i){var o=this.expression.evaluate(new yi(this.zoom),e,{},n,[],i),a=this.expression.evaluate(new yi(this.zoom+1),e,{},n,[],i),s=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(s,t,o,a)},Bo.prototype.updatePaintArray=function(t,e,r,n){var i=this.expression.evaluate({zoom:this.zoom},r,n),o=this.expression.evaluate({zoom:this.zoom+1},r,n);this._setPaintValue(t,e,i,o)},Bo.prototype._setPaintValue=function(t,e,r,n){if("color"===this.type)for(var i=Po(r),o=Po(n),a=t;a<e;a++)this.paintVertexArray.emplace(a,i[0],i[1],o[0],o[1]);else{for(var s=t;s<e;s++)this.paintVertexArray.emplace(s,r,n);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(n))}},Bo.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Bo.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Bo.prototype.setUniform=function(t,e){var r=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,n=i(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);t.set(n)},Bo.prototype.getBinding=function(t,e,r){return new ko(t,e)};var Vo=function(t,e,r,n,i,o,a){this.expression=t,this.type=r,this.useIntegerZoom=n,this.zoom=i,this.layerId=a,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Uint16",components:4,offset:0}})),this.zoomInPaintVertexArray=new o,this.zoomOutPaintVertexArray=new o};Vo.prototype.populatePaintArray=function(t,e,r){var n=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(n,t,e.patterns&&e.patterns[this.layerId],r)},Vo.prototype.updatePaintArray=function(t,e,r,n,i){this._setPaintValues(t,e,r.patterns&&r.patterns[this.layerId],i)},Vo.prototype._setPaintValues=function(t,e,r,n){if(n&&r){var i=n[r.min],o=n[r.mid],a=n[r.max];if(i&&o&&a)for(var s=t;s<e;s++)this.zoomInPaintVertexArray.emplace(s,o.tl[0],o.tl[1],o.br[0],o.br[1],i.tl[0],i.tl[1],i.br[0],i.br[1],o.pixelRatio,i.pixelRatio),this.zoomOutPaintVertexArray.emplace(s,o.tl[0],o.tl[1],o.br[0],o.br[1],a.tl[0],a.tl[1],a.br[0],a.br[1],o.pixelRatio,a.pixelRatio)}},Vo.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Vo.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var Do=function(t,e,r,n){this.binders={},this.layoutAttributes=n,this._buffers=[];var i=[];for(var o in t.paint._values)if(r(o)){var a=t.paint.get(o);if(a instanceof wi&&Me(a.property.specification)){var s=Lo(o,t.type),u=a.value,l=a.property.specification.type,p=a.property.useIntegerZoom,c=a.property.specification["property-type"],h="cross-faded"===c||"cross-faded-data-driven"===c;if("constant"===u.kind)this.binders[o]=h?new To(u.value,s):new Co(u.value,s,l),i.push("/u_"+o);else if("source"===u.kind||h){var f=Oo(o,l,"source");this.binders[o]=h?new Vo(u,s,l,p,e,f,t.id):new Eo(u,s,l,f),i.push("/a_"+o)}else{var y=Oo(o,l,"composite");this.binders[o]=new Bo(u,s,l,p,e,y),i.push("/z_"+o)}}}this.cacheKey=i.sort().join("")};Do.prototype.getMaxValue=function(t){var e=this.binders[t];return e instanceof Eo||e instanceof Bo?e.maxValue:0},Do.prototype.populatePaintArrays=function(t,e,r,n,i){for(var o in this.binders){var a=this.binders[o];(a instanceof Eo||a instanceof Bo||a instanceof Vo)&&a.populatePaintArray(t,e,r,n,i)}},Do.prototype.setConstantPatternPositions=function(t,e){for(var r in this.binders){var n=this.binders[r];n instanceof To&&n.setConstantPatternPositions(t,e)}},Do.prototype.updatePaintArrays=function(t,e,r,n,i){var o=!1;for(var a in t)for(var s=0,u=e.getPositions(a);s<u.length;s+=1){var l=u[s],p=r.feature(l.index);for(var c in this.binders){var h=this.binders[c];if((h instanceof Eo||h instanceof Bo||h instanceof Vo)&&!0===h.expression.isStateDependent){var f=n.paint.get(c);h.expression=f.value,h.updatePaintArray(l.start,l.end,p,t[a],i),o=!0}}}return o},Do.prototype.defines=function(){var t=[];for(var e in this.binders){var r=this.binders[e];(r instanceof Co||r instanceof To)&&t.push.apply(t,r.uniformNames.map((function(t){return"#define HAS_UNIFORM_"+t})))}return t},Do.prototype.getPaintVertexBuffers=function(){return this._buffers},Do.prototype.getUniforms=function(t,e){var r=[];for(var n in this.binders){var i=this.binders[n];if(i instanceof Co||i instanceof To||i instanceof Bo)for(var o=0,a=i.uniformNames;o<a.length;o+=1){var s=a[o];if(e[s]){var u=i.getBinding(t,e[s],s);r.push({name:s,property:n,binding:u})}}}return r},Do.prototype.setUniforms=function(t,e,r,n){for(var i=0,o=e;i<o.length;i+=1){var a=o[i],s=a.name,u=a.property;this.binders[u].setUniform(a.binding,n,r.get(u),s)}},Do.prototype.updatePaintBuffers=function(t){for(var e in this._buffers=[],this.binders){var r=this.binders[e];if(t&&r instanceof Vo){var n=2===t.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;n&&this._buffers.push(n)}else(r instanceof Eo||r instanceof Bo)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}},Do.prototype.upload=function(t){for(var e in this.binders){var r=this.binders[e];(r instanceof Eo||r instanceof Bo||r instanceof Vo)&&r.upload(t)}this.updatePaintBuffers()},Do.prototype.destroy=function(){for(var t in this.binders){var e=this.binders[t];(e instanceof Eo||e instanceof Bo||e instanceof Vo)&&e.destroy()}};var Fo=function(t,e,r,n){void 0===n&&(n=function(){return!0}),this.programConfigurations={};for(var i=0,o=e;i<o.length;i+=1){var a=o[i];this.programConfigurations[a.id]=new Do(a,r,n,t)}this.needsUpload=!1,this._featureMap=new bo,this._bufferOffset=0};function Lo(t,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"]}[t]||[t.replace(e+"-","").replace(/-/g,"_")]}function Oo(t,e,r){var n={color:{source:to,composite:eo},number:{source:Ji,composite:to}},i=function(t){return{"line-pattern":{source:Ri,composite:Ri},"fill-pattern":{source:Ri,composite:Ri},"fill-extrusion-pattern":{source:Ri,composite:Ri}}[t]}(t);return i&&i[r]||n[e][r]}Fo.prototype.populatePaintArrays=function(t,e,r,n,i,o){for(var a in this.programConfigurations)this.programConfigurations[a].populatePaintArrays(t,e,n,i,o);void 0!==e.id&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0},Fo.prototype.updatePaintArrays=function(t,e,r,n){for(var i=0,o=r;i<o.length;i+=1){var a=o[i];this.needsUpload=this.programConfigurations[a.id].updatePaintArrays(t,this._featureMap,e,a,n)||this.needsUpload}},Fo.prototype.get=function(t){return this.programConfigurations[t]},Fo.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},Fo.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},Ke("ConstantBinder",Co),Ke("CrossFadedConstantBinder",To),Ke("SourceExpressionBinder",Eo),Ke("CrossFadedCompositeBinder",Vo),Ke("CompositeExpressionBinder",Bo),Ke("ProgramConfiguration",Do,{omit:["_buffers"]}),Ke("ProgramConfigurationSet",Fo);var Ro={min:-1*Math.pow(2,14),max:Math.pow(2,14)-1};function Uo(t){for(var e=8192/t.extent,r=t.loadGeometry(),n=0;n<r.length;n++)for(var o=r[n],a=0;a<o.length;a++){var s=o[a];s.x=Math.round(s.x*e),s.y=Math.round(s.y*e),(s.x<Ro.min||s.x>Ro.max||s.y<Ro.min||s.y>Ro.max)&&(y("Geometry exceeds allowed extent, reduce your vector tile buffer size"),s.x=i(s.x,Ro.min,Ro.max),s.y=i(s.y,Ro.min,Ro.max))}return r}function jo(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var qo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Di,this.indexArray=new Wi,this.segments=new fo,this.programConfigurations=new Fo(ho,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function No(t,e){for(var r=0;r<t.length;r++)if($o(e,t[r]))return!0;for(var n=0;n<e.length;n++)if($o(t,e[n]))return!0;return!!Yo(t,e)}function Go(t,e,r){return!!$o(t,e)||!!Ko(e,t,r)}function Zo(t,e){if(1===t.length)return Wo(e,t[0]);for(var r=0;r<e.length;r++)for(var n=e[r],i=0;i<n.length;i++)if($o(t,n[i]))return!0;for(var o=0;o<t.length;o++)if(Wo(e,t[o]))return!0;for(var a=0;a<e.length;a++)if(Yo(t,e[a]))return!0;return!1}function Xo(t,e,r){if(t.length>1){if(Yo(t,e))return!0;for(var n=0;n<e.length;n++)if(Ko(e[n],t,r))return!0}for(var i=0;i<t.length;i++)if(Ko(t[i],e,r))return!0;return!1}function Yo(t,e){if(0===t.length||0===e.length)return!1;for(var r=0;r<t.length-1;r++)for(var n=t[r],i=t[r+1],o=0;o<e.length-1;o++)if(Jo(n,i,e[o],e[o+1]))return!0;return!1}function Jo(t,e,r,n){return d(t,r,n)!==d(e,r,n)&&d(t,e,r)!==d(t,e,n)}function Ko(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])<n;for(var i=1;i<e.length;i++)if(Ho(t,e[i-1],e[i])<n)return!0;return!1}function Ho(t,e,r){var n=e.distSqr(r);if(0===n)return t.distSqr(e);var i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return t.distSqr(i<0?e:i>1?r:r.sub(e)._mult(i)._add(e))}function Wo(t,e){for(var r,n,i,o=!1,a=0;a<t.length;a++)for(var s=0,u=(r=t[a]).length-1;s<r.length;u=s++)(n=r[s]).y>e.y!=(i=r[u]).y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(o=!o);return o}function $o(t,e){for(var r=!1,n=0,i=t.length-1;n<t.length;i=n++){var o=t[n],a=t[i];o.y>e.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}function Qo(t,e,r){var n=r[0],i=r[2];if(t.x<n.x&&e.x<n.x||t.x>i.x&&e.x>i.x||t.y<n.y&&e.y<n.y||t.y>i.y&&e.y>i.y)return!1;var o=d(t,e,r[0]);return o!==d(t,e,r[1])||o!==d(t,e,r[2])||o!==d(t,e,r[3])}function ta(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function ea(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ra(t,e,n,i,o){if(!e[0]&&!e[1])return t;var a=r.convert(e)._mult(o);"viewport"===n&&a._rotate(-i);for(var s=[],u=0;u<t.length;u++)s.push(t[u].sub(a));return s}qo.prototype.populate=function(t,e,r){var n=this.layers[0],i=[],o=null;"circle"===n.type&&(o=n.layout.get("circle-sort-key"));for(var a=0,s=t;a<s.length;a+=1){var u=s[a],l=u.feature,p=u.id,c=u.index,h=u.sourceLayerIndex,f=this.layers[0]._featureFilter.needGeometry,y={type:l.type,id:p,properties:l.properties,geometry:f?Uo(l):[]};if(this.layers[0]._featureFilter.filter(new yi(this.zoom),y,r)){f||(y.geometry=Uo(l));var d=o?o.evaluate(y,{},r):void 0;i.push({id:p,properties:l.properties,type:l.type,sourceLayerIndex:h,index:c,geometry:y.geometry,patterns:{},sortKey:d})}}o&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var m=0,v=i;m<v.length;m+=1){var g=v[m],x=g.geometry,b=g.index,w=g.sourceLayerIndex,_=t[b].feature;this.addFeature(g,x,b,r),e.featureIndex.insert(_,x,b,w,this.index)}},qo.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},qo.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},qo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},qo.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ho),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},qo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},qo.prototype.addFeature=function(t,e,r,n){for(var i=0,o=e;i<o.length;i+=1)for(var a=0,s=o[i];a<s.length;a+=1){var u=s[a],l=u.x,p=u.y;if(!(l<0||l>=8192||p<0||p>=8192)){var c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),h=c.vertexLength;jo(this.layoutVertexArray,l,p,-1,-1),jo(this.layoutVertexArray,l,p,1,-1),jo(this.layoutVertexArray,l,p,1,1),jo(this.layoutVertexArray,l,p,-1,1),this.indexArray.emplaceBack(h,h+1,h+2),this.indexArray.emplaceBack(h,h+3,h+2),c.vertexLength+=4,c.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)},Ke("CircleBucket",qo,{omit:["layers"]});var na=new Mi({"circle-sort-key":new Ai(nr.layout_circle["circle-sort-key"])}),ia={paint:new Mi({"circle-radius":new Ai(nr.paint_circle["circle-radius"]),"circle-color":new Ai(nr.paint_circle["circle-color"]),"circle-blur":new Ai(nr.paint_circle["circle-blur"]),"circle-opacity":new Ai(nr.paint_circle["circle-opacity"]),"circle-translate":new Si(nr.paint_circle["circle-translate"]),"circle-translate-anchor":new Si(nr.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Si(nr.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Si(nr.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ai(nr.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ai(nr.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ai(nr.paint_circle["circle-stroke-opacity"])}),layout:na},oa="undefined"!=typeof Float32Array?Float32Array:Array;function aa(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)}),sa=new oa(4),oa!=Float32Array&&(sa[0]=0,sa[1]=0,sa[2]=0,sa[3]=0);var sa,ua=function(t){function e(e){t.call(this,e,ia)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new qo(t)},e.prototype.queryRadius=function(t){var e=t;return ta("circle-radius",this,e)+ta("circle-stroke-width",this,e)+ea(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a,s){for(var u=ra(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),l=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),p="map"===this.paint.get("circle-pitch-alignment"),c=p?u:function(t,e){return t.map((function(t){return la(t,e)}))}(u,s),h=p?l*a:l,f=0,y=n;f<y.length;f+=1)for(var d=0,m=y[f];d<m.length;d+=1){var v=m[d],g=p?v:la(v,s),x=h,b=aa([],[v.x,v.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?x*=b[3]/o.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(x*=o.cameraToCenterDistance/b[3]),Go(c,g,x))return!0}return!1},e}(Pi);function la(t,e){var n=aa([],[t.x,t.y,0,1],e);return new r(n[0]/n[3],n[1]/n[3])}var pa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(qo);function ca(t,e,r,n){var i=e.width,o=e.height;if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==i*o*r)throw new RangeError("mismatched image size")}else n=new Uint8Array(i*o*r);return t.width=i,t.height=o,t.data=n,t}function ha(t,e,r){var n=e.width,i=e.height;if(n!==t.width||i!==t.height){var o=ca({},{width:n,height:i},r);fa(t,o,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,i)},r),t.width=n,t.height=i,t.data=o.data}}function fa(t,e,r,n,i,o){if(0===i.width||0===i.height)return e;if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,u=0;u<i.height;u++)for(var l=((r.y+u)*t.width+r.x)*o,p=((n.y+u)*e.width+n.x)*o,c=0;c<i.width*o;c++)s[p+c]=a[l+c];return e}Ke("HeatmapBucket",pa,{omit:["layers"]});var ya=function(t,e){ca(this,t,1,e)};ya.prototype.resize=function(t){ha(this,t,1)},ya.prototype.clone=function(){return new ya({width:this.width,height:this.height},new Uint8Array(this.data))},ya.copy=function(t,e,r,n,i){fa(t,e,r,n,i,1)};var da=function(t,e){ca(this,t,4,e)};da.prototype.resize=function(t){ha(this,t,4)},da.prototype.replace=function(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t},da.prototype.clone=function(){return new da({width:this.width,height:this.height},new Uint8Array(this.data))},da.copy=function(t,e,r,n,i){fa(t,e,r,n,i,4)},Ke("AlphaImage",ya),Ke("RGBAImage",da);var ma={paint:new Mi({"heatmap-radius":new Ai(nr.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ai(nr.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Si(nr.paint_heatmap["heatmap-intensity"]),"heatmap-color":new zi(nr.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Si(nr.paint_heatmap["heatmap-opacity"])})};function va(t,e){for(var r=new Uint8Array(1024),n={},i=0,o=0;i<256;i++,o+=4){n[e]=i/255;var a=t.evaluate(n);r[o+0]=Math.floor(255*a.r/a.a),r[o+1]=Math.floor(255*a.g/a.a),r[o+2]=Math.floor(255*a.b/a.a),r[o+3]=Math.floor(255*a.a)}return new da({width:256,height:1},r)}var ga=function(t){function e(e){t.call(this,e,ma),this._updateColorRamp()}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new pa(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},e.prototype._updateColorRamp=function(){this.colorRamp=va(this._transitionablePaint._values["heatmap-color"].value.expression,"heatmapDensity"),this.colorRampTexture=null},e.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},e}(Pi),xa={paint:new Mi({"hillshade-illumination-direction":new Si(nr.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Si(nr.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Si(nr.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Si(nr.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Si(nr.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Si(nr.paint_hillshade["hillshade-accent-color"])})},ba=function(t){function e(e){t.call(this,e,xa)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},e}(Pi),wa=Bi([{name:"a_pos",components:2,type:"Int16"}],4).members,_a=Aa,Sa=Aa;function Aa(t,e,r){r=r||2;var n,i,o,a,s,u,l,p=e&&e.length,c=p?e[0]*r:t.length,h=ka(t,0,c,r,!0),f=[];if(!h||h.next===h.prev)return f;if(p&&(h=function(t,e,r,n){var i,o,a,s=[];for(i=0,o=e.length;i<o;i++)(a=ka(t,e[i]*n,i<o-1?e[i+1]*n:t.length,n,!1))===a.next&&(a.steiner=!0),s.push(Fa(a));for(s.sort(Ea),i=0;i<s.length;i++)r=Ba(s[i],r);return r}(t,e,h,r)),t.length>80*r){n=o=t[0],i=a=t[1];for(var y=r;y<c;y+=r)(s=t[y])<n&&(n=s),(u=t[y+1])<i&&(i=u),s>o&&(o=s),u>a&&(a=u);l=0!==(l=Math.max(o-n,a-i))?32767/l:0}return za(h,f,r,n,i,l,0),f}function ka(t,e,r,n,i){var o,a;if(i===Ka(t,e,r,n)>0)for(o=e;o<r;o+=n)a=Xa(o,t[o],t[o+1],a);else for(o=r-n;o>=e;o-=n)a=Xa(o,t[o],t[o+1],a);return a&&Ua(a,a.next)&&(Ya(a),a=a.next),a}function Ia(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!Ua(n,n.next)&&0!==Ra(n.prev,n,n.next))n=n.next;else{if(Ya(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function za(t,e,r,n,i,o,a){if(t){!a&&o&&function(t,e,r,n){var i=t;do{0===i.z&&(i.z=Da(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,o,a,s,u,l=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,n=r,s=0,e=0;e<l&&(s++,n=n.nextZ);e++);for(u=l;s>0||u>0&&n;)0!==s&&(0===u||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,l*=2}while(a>1)}(i)}(t,n,i,o);for(var s,u,l=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?Pa(t,n,i,o):Ma(t))e.push(s.i/r|0),e.push(t.i/r|0),e.push(u.i/r|0),Ya(t),t=u.next,l=u.next;else if((t=u)===l){a?1===a?za(t=Ca(Ia(t),e,r),e,r,n,i,o,2):2===a&&Ta(t,e,r,n,i,o):za(Ia(t),e,r,n,i,o,1);break}}}function Ma(t){var e=t.prev,r=t,n=t.next;if(Ra(e,r,n)>=0)return!1;for(var i=e.x,o=r.x,a=n.x,s=e.y,u=r.y,l=n.y,p=i<o?i<a?i:a:o<a?o:a,c=s<u?s<l?s:l:u<l?u:l,h=i>o?i>a?i:a:o>a?o:a,f=s>u?s>l?s:l:u>l?u:l,y=n.next;y!==e;){if(y.x>=p&&y.x<=h&&y.y>=c&&y.y<=f&&La(i,s,o,u,a,l,y.x,y.y)&&Ra(y.prev,y,y.next)>=0)return!1;y=y.next}return!0}function Pa(t,e,r,n){var i=t.prev,o=t,a=t.next;if(Ra(i,o,a)>=0)return!1;for(var s=i.x,u=o.x,l=a.x,p=i.y,c=o.y,h=a.y,f=s<u?s<l?s:l:u<l?u:l,y=p<c?p<h?p:h:c<h?c:h,d=s>u?s>l?s:l:u>l?u:l,m=p>c?p>h?p:h:c>h?c:h,v=Da(f,y,e,r,n),g=Da(d,m,e,r,n),x=t.prevZ,b=t.nextZ;x&&x.z>=v&&b&&b.z<=g;){if(x.x>=f&&x.x<=d&&x.y>=y&&x.y<=m&&x!==i&&x!==a&&La(s,p,u,c,l,h,x.x,x.y)&&Ra(x.prev,x,x.next)>=0)return!1;if(x=x.prevZ,b.x>=f&&b.x<=d&&b.y>=y&&b.y<=m&&b!==i&&b!==a&&La(s,p,u,c,l,h,b.x,b.y)&&Ra(b.prev,b,b.next)>=0)return!1;b=b.nextZ}for(;x&&x.z>=v;){if(x.x>=f&&x.x<=d&&x.y>=y&&x.y<=m&&x!==i&&x!==a&&La(s,p,u,c,l,h,x.x,x.y)&&Ra(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;b&&b.z<=g;){if(b.x>=f&&b.x<=d&&b.y>=y&&b.y<=m&&b!==i&&b!==a&&La(s,p,u,c,l,h,b.x,b.y)&&Ra(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Ca(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!Ua(i,o)&&ja(i,n,n.next,o)&&Ga(i,o)&&Ga(o,i)&&(e.push(i.i/r|0),e.push(n.i/r|0),e.push(o.i/r|0),Ya(n),Ya(n.next),n=t=o),n=n.next}while(n!==t);return Ia(n)}function Ta(t,e,r,n,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Oa(a,s)){var u=Za(a,s);return a=Ia(a,a.next),u=Ia(u,u.next),za(a,e,r,n,i,o,0),void za(u,e,r,n,i,o,0)}s=s.next}a=a.next}while(a!==t)}function Ea(t,e){return t.x-e.x}function Ba(t,e){var r=function(t,e){var r,n=e,i=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a&&(a=s,r=n.x<n.next.x?n:n.next,s===i))return r}n=n.next}while(n!==e);if(!r)return null;var u,l=r,p=r.x,c=r.y,h=1/0;n=r;do{i>=n.x&&n.x>=p&&i!==n.x&&La(o<c?i:a,o,p,c,o<c?a:i,o,n.x,n.y)&&(u=Math.abs(o-n.y)/(i-n.x),Ga(n,t)&&(u<h||u===h&&(n.x>r.x||n.x===r.x&&Va(r,n)))&&(r=n,h=u)),n=n.next}while(n!==l);return r}(t,e);if(!r)return e;var n=Za(r,t);return Ia(n,n.next),Ia(r,r.next)}function Va(t,e){return Ra(t.prev,t,e.prev)<0&&Ra(e.next,t,t.next)<0}function Da(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Fa(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function La(t,e,r,n,i,o,a,s){return(i-a)*(e-s)>=(t-a)*(o-s)&&(t-a)*(n-s)>=(r-a)*(e-s)&&(r-a)*(o-s)>=(i-a)*(n-s)}function Oa(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&ja(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Ga(t,e)&&Ga(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(Ra(t.prev,t,e.prev)||Ra(t,e.prev,e))||Ua(t,e)&&Ra(t.prev,t,t.next)>0&&Ra(e.prev,e,e.next)>0)}function Ra(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Ua(t,e){return t.x===e.x&&t.y===e.y}function ja(t,e,r,n){var i=Na(Ra(t,e,r)),o=Na(Ra(t,e,n)),a=Na(Ra(r,n,t)),s=Na(Ra(r,n,e));return i!==o&&a!==s||!(0!==i||!qa(t,r,e))||!(0!==o||!qa(t,n,e))||!(0!==a||!qa(r,t,n))||!(0!==s||!qa(r,e,n))}function qa(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Na(t){return t>0?1:t<0?-1:0}function Ga(t,e){return Ra(t.prev,t,t.next)<0?Ra(t,e,t.next)>=0&&Ra(t,t.prev,e)>=0:Ra(t,e,t.prev)<0||Ra(t,t.next,e)<0}function Za(t,e){var r=new Ja(t.i,t.x,t.y),n=new Ja(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Xa(t,e,r,n){var i=new Ja(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Ya(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ja(t,e,r){this.i=t,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 Ka(t,e,r,n){for(var i=0,o=e,a=r-n;o<r;o+=n)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}function Ha(t,e,r,n,i){!function t(e,r,n,i,o){for(;i>n;){if(i-n>600){var a=i-n+1,s=r-n+1,u=Math.log(a),l=.5*Math.exp(2*u/3),p=.5*Math.sqrt(u*l*(a-l)/a)*(s-a/2<0?-1:1);t(e,r,Math.max(n,Math.floor(r-s*l/a+p)),Math.min(i,Math.floor(r+(a-s)*l/a+p)),o)}var c=e[r],h=n,f=i;for(Wa(e,n,r),o(e[i],c)>0&&Wa(e,n,i);h<f;){for(Wa(e,h,f),h++,f--;o(e[h],c)<0;)h++;for(;o(e[f],c)>0;)f--}0===o(e[n],c)?Wa(e,n,f):Wa(e,++f,i),f<=r&&(n=f+1),r<=f&&(i=f-1)}}(t,e,r||0,n||t.length-1,i||$a)}function Wa(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function $a(t,e){return t<e?-1:t>e?1:0}function Qa(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,o=[],a=0;a<r;a++){var s=m(t[a]);0!==s&&(t[a].area=Math.abs(s),void 0===i&&(i=s<0),i===s<0?(n&&o.push(n),n=[t[a]]):n.push(t[a]))}if(n&&o.push(n),e>1)for(var u=0;u<o.length;u++)o[u].length<=e||(Ha(o[u],e,1,o[u].length-1,ts),o[u]=o[u].slice(0,e));return o}function ts(t,e){return e.area-t.area}function es(t,e,r){for(var n=r.patternDependencies,i=!1,o=0,a=e;o<a.length;o+=1){var s=a[o].paint.get(t+"-pattern");s.isConstant()||(i=!0);var u=s.constantOr(null);u&&(i=!0,n[u.to]=!0,n[u.from]=!0)}return i}function rs(t,e,r,n,i){for(var o=i.patternDependencies,a=0,s=e;a<s.length;a+=1){var u=s[a],l=u.paint.get(t+"-pattern").value;if("constant"!==l.kind){var p=l.evaluate({zoom:n-1},r,{},i.availableImages),c=l.evaluate({zoom:n},r,{},i.availableImages),h=l.evaluate({zoom:n+1},r,{},i.availableImages);c=c&&c.name?c.name:c,h=h&&h.name?h.name:h,o[p=p&&p.name?p.name:p]=!0,o[c]=!0,o[h]=!0,r.patterns[u.id]={min:p,mid:c,max:h}}}return r}Aa.deviation=function(t,e,r,n){var i=e&&e.length,o=Math.abs(Ka(t,0,i?e[0]*r:t.length,r));if(i)for(var a=0,s=e.length;a<s;a++)o-=Math.abs(Ka(t,e[a]*r,a<s-1?e[a+1]*r:t.length,r));var u=0;for(a=0;a<n.length;a+=3){var l=n[a]*r,p=n[a+1]*r,c=n[a+2]*r;u+=Math.abs((t[l]-t[c])*(t[p+1]-t[l+1])-(t[l]-t[p])*(t[c+1]-t[l+1]))}return 0===o&&0===u?0:Math.abs((u-o)/o)},Aa.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var a=0;a<e;a++)r.vertices.push(t[i][o][a]);i>0&&r.holes.push(n+=t[i-1].length)}return r},_a.default=Sa;var ns=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Di,this.indexArray=new Wi,this.indexArray2=new $i,this.programConfigurations=new Fo(wa,t.layers,t.zoom),this.segments=new fo,this.segments2=new fo,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};ns.prototype.populate=function(t,e,r){this.hasPattern=es("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],o=0,a=t;o<a.length;o+=1){var s=a[o],u=s.feature,l=s.id,p=s.index,c=s.sourceLayerIndex,h=this.layers[0]._featureFilter.needGeometry,f={type:u.type,id:l,properties:u.properties,geometry:h?Uo(u):[]};if(this.layers[0]._featureFilter.filter(new yi(this.zoom),f,r)){h||(f.geometry=Uo(u));var y=n?n.evaluate(f,{},r,e.availableImages):void 0;i.push({id:l,properties:u.properties,type:u.type,sourceLayerIndex:c,index:p,geometry:f.geometry,patterns:{},sortKey:y})}}n&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var d=0,m=i;d<m.length;d+=1){var v=m[d],g=v.geometry,x=v.index,b=v.sourceLayerIndex;if(this.hasPattern){var w=rs("fill",this.layers,v,this.zoom,e);this.patternFeatures.push(w)}else this.addFeature(v,g,x,r,{});e.featureIndex.insert(t[x].feature,g,x,b,this.index)}},ns.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},ns.prototype.addFeatures=function(t,e,r){for(var n=0,i=this.patternFeatures;n<i.length;n+=1){var o=i[n];this.addFeature(o,o.geometry,o.index,e,r)}},ns.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},ns.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},ns.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,wa),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},ns.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},ns.prototype.addFeature=function(t,e,r,n,i){for(var o=0,a=Qa(e,500);o<a.length;o+=1){for(var s=a[o],u=0,l=0,p=s;l<p.length;l+=1)u+=p[l].length;for(var c=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray),h=c.vertexLength,f=[],y=[],d=0,m=s;d<m.length;d+=1){var v=m[d];if(0!==v.length){v!==s[0]&&y.push(f.length/2);var g=this.segments2.prepareSegment(v.length,this.layoutVertexArray,this.indexArray2),x=g.vertexLength;this.layoutVertexArray.emplaceBack(v[0].x,v[0].y),this.indexArray2.emplaceBack(x+v.length-1,x),f.push(v[0].x),f.push(v[0].y);for(var b=1;b<v.length;b++)this.layoutVertexArray.emplaceBack(v[b].x,v[b].y),this.indexArray2.emplaceBack(x+b-1,x+b),f.push(v[b].x),f.push(v[b].y);g.vertexLength+=v.length,g.primitiveLength+=v.length}}for(var w=_a(f,y),_=0;_<w.length;_+=3)this.indexArray.emplaceBack(h+w[_],h+w[_+1],h+w[_+2]);c.vertexLength+=u,c.primitiveLength+=w.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n)},Ke("FillBucket",ns,{omit:["layers","patternFeatures"]});var is=new Mi({"fill-sort-key":new Ai(nr.layout_fill["fill-sort-key"])}),os={paint:new Mi({"fill-antialias":new Si(nr.paint_fill["fill-antialias"]),"fill-opacity":new Ai(nr.paint_fill["fill-opacity"]),"fill-color":new Ai(nr.paint_fill["fill-color"]),"fill-outline-color":new Ai(nr.paint_fill["fill-outline-color"]),"fill-translate":new Si(nr.paint_fill["fill-translate"]),"fill-translate-anchor":new Si(nr.paint_fill["fill-translate-anchor"]),"fill-pattern":new ki(nr.paint_fill["fill-pattern"])}),layout:is},as=function(t){function e(e){t.call(this,e,os)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r);var n=this.paint._values["fill-outline-color"];"constant"===n.value.kind&&void 0===n.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},e.prototype.createBucket=function(t){return new ns(t)},e.prototype.queryRadius=function(){return ea(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a){return Zo(ra(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,a),n)},e.prototype.isTileClipped=function(){return!0},e}(Pi),ss=Bi([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,us=ls;function ls(t,e,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=i,t.readFields(ps,this,e)}function ps(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function cs(t){for(var e,r,n=0,i=0,o=t.length,a=o-1;i<o;a=i++)n+=((r=t[a]).x-(e=t[i]).x)*(e.y+r.y);return n}ls.types=["Unknown","Point","LineString","Polygon"],ls.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,n=t.readVarint()+t.pos,i=1,o=0,a=0,s=0,u=[];t.pos<n;){if(o<=0){var l=t.readVarint();i=7&l,o=l>>3}if(o--,1===i||2===i)a+=t.readSVarint(),s+=t.readSVarint(),1===i&&(e&&u.push(e),e=[]),e.push(new r(a,s));else{if(7!==i)throw new Error("unknown command "+i);e&&e.push(e[0].clone())}}return e&&u.push(e),u},ls.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=1/0,s=-1/0,u=1/0,l=-1/0;t.pos<e;){if(n<=0){var p=t.readVarint();r=7&p,n=p>>3}if(n--,1===r||2===r)(i+=t.readSVarint())<a&&(a=i),i>s&&(s=i),(o+=t.readSVarint())<u&&(u=o),o>l&&(l=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,u,s,l]},ls.prototype.toGeoJSON=function(t,e,r){var n,i,o=this.extent*Math.pow(2,r),a=this.extent*t,s=this.extent*e,u=this.loadGeometry(),l=ls.types[this.type];function p(t){for(var e=0;e<t.length;e++){var r=t[e];t[e]=[360*(r.x+a)/o-180,360/Math.PI*Math.atan(Math.exp((180-360*(r.y+s)/o)*Math.PI/180))-90]}}switch(this.type){case 1:var c=[];for(n=0;n<u.length;n++)c[n]=u[n][0];p(u=c);break;case 2:for(n=0;n<u.length;n++)p(u[n]);break;case 3:for(u=function(t){var e=t.length;if(e<=1)return[t];for(var r,n,i=[],o=0;o<e;o++){var a=cs(t[o]);0!==a&&(void 0===n&&(n=a<0),n===a<0?(r&&i.push(r),r=[t[o]]):r.push(t[o]))}return r&&i.push(r),i}(u),n=0;n<u.length;n++)for(i=0;i<u[n].length;i++)p(u[n][i])}1===u.length?u=u[0]:l="Multi"+l;var h={type:"Feature",geometry:{type:l,coordinates:u},properties:this.properties};return"id"in this&&(h.id=this.id),h};var hs=fs;function fs(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(ys,this,e),this.length=this._features.length}function ys(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}function ds(t,e,r){if(3===t){var n=new hs(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}fs.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new us(this._pbf,e,this.extent,this._keys,this._values)};var ms={VectorTile:function(t,e){this.layers=t.readFields(ds,{},e)},VectorTileFeature:us,VectorTileLayer:hs},vs=ms.VectorTileFeature.types,gs=Math.pow(2,13);function xs(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,2*Math.floor(n*gs)+a,i*gs*2,o*gs*2,Math.round(s))}var bs=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Li,this.indexArray=new Wi,this.programConfigurations=new Fo(ss,t.layers,t.zoom),this.segments=new fo,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function ws(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}bs.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=es("fill-extrusion",this.layers,e);for(var n=0,i=t;n<i.length;n+=1){var o=i[n],a=o.feature,s=o.id,u=o.index,l=o.sourceLayerIndex,p=this.layers[0]._featureFilter.needGeometry,c={type:a.type,id:s,properties:a.properties,geometry:p?Uo(a):[]};if(this.layers[0]._featureFilter.filter(new yi(this.zoom),c,r)){var h={id:s,sourceLayerIndex:l,index:u,geometry:p?c.geometry:Uo(a),properties:a.properties,type:a.type,patterns:{}};void 0!==a.id&&(h.id=a.id),this.hasPattern?this.features.push(rs("fill-extrusion",this.layers,h,this.zoom,e)):this.addFeature(h,h.geometry,u,r,{}),e.featureIndex.insert(a,h.geometry,u,l,this.index,!0)}}},bs.prototype.addFeatures=function(t,e,r){for(var n=0,i=this.features;n<i.length;n+=1){var o=i[n];this.addFeature(o,o.geometry,o.index,e,r)}},bs.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},bs.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},bs.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},bs.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ss),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},bs.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},bs.prototype.addFeature=function(t,e,r,n,i){for(var o=0,a=Qa(e,500);o<a.length;o+=1){for(var s=a[o],u=0,l=0,p=s;l<p.length;l+=1)u+=p[l].length;for(var c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),h=0,f=s;h<f.length;h+=1){var y=f[h];if(0!==y.length&&!((E=y).every((function(t){return t.x<0}))||E.every((function(t){return t.x>8192}))||E.every((function(t){return t.y<0}))||E.every((function(t){return t.y>8192}))))for(var d=0,m=0;m<y.length;m++){var v=y[m];if(m>=1){var g=y[m-1];if(!ws(v,g)){c.vertexLength+4>fo.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var x=v.sub(g)._perp()._unit(),b=g.dist(v);d+b>32768&&(d=0),xs(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,0,d),xs(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,1,d),xs(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,0,d+=b),xs(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,1,d);var w=c.vertexLength;this.indexArray.emplaceBack(w,w+2,w+1),this.indexArray.emplaceBack(w+1,w+2,w+3),c.vertexLength+=4,c.primitiveLength+=2}}}}if(c.vertexLength+u>fo.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray)),"Polygon"===vs[t.type]){for(var _=[],S=[],A=c.vertexLength,k=0,I=s;k<I.length;k+=1){var z=I[k];if(0!==z.length){z!==s[0]&&S.push(_.length/2);for(var M=0;M<z.length;M++){var P=z[M];xs(this.layoutVertexArray,P.x,P.y,0,0,1,1,0),_.push(P.x),_.push(P.y)}}}for(var C=_a(_,S),T=0;T<C.length;T+=3)this.indexArray.emplaceBack(A+C[T],A+C[T+2],A+C[T+1]);c.primitiveLength+=C.length/3,c.vertexLength+=u}}var E;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n)},Ke("FillExtrusionBucket",bs,{omit:["layers","features"]});var _s={paint:new Mi({"fill-extrusion-opacity":new Si(nr["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ai(nr["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Si(nr["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Si(nr["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ki(nr["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ai(nr["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ai(nr["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Si(nr["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},Ss=function(t){function e(e){t.call(this,e,_s)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new bs(t)},e.prototype.queryRadius=function(){return ea(this.paint.get("fill-extrusion-translate"))},e.prototype.is3D=function(){return!0},e.prototype.queryIntersectsFeature=function(t,e,n,i,o,a,s,u){var l=ra(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,s),p=this.paint.get("fill-extrusion-height").evaluate(e,n),c=this.paint.get("fill-extrusion-base").evaluate(e,n),h=function(t,e,n,i){for(var o=[],a=0,s=t;a<s.length;a+=1){var u=s[a],l=[u.x,u.y,0,1];aa(l,l,e),o.push(new r(l[0]/l[3],l[1]/l[3]))}return o}(l,u),f=function(t,e,n,i){for(var o=[],a=[],s=i[8]*e,u=i[9]*e,l=i[10]*e,p=i[11]*e,c=i[8]*n,h=i[9]*n,f=i[10]*n,y=i[11]*n,d=0,m=t;d<m.length;d+=1){for(var v=[],g=[],x=0,b=m[d];x<b.length;x+=1){var w=b[x],_=w.x,S=w.y,A=i[0]*_+i[4]*S+i[12],k=i[1]*_+i[5]*S+i[13],I=i[2]*_+i[6]*S+i[14],z=i[3]*_+i[7]*S+i[15],M=I+l,P=z+p,C=A+c,T=k+h,E=I+f,B=z+y,V=new r((A+s)/P,(k+u)/P);V.z=M/P,v.push(V);var D=new r(C/B,T/B);D.z=E/B,g.push(D)}o.push(v),a.push(g)}return[o,a]}(i,c,p,u);return function(t,e,r){var n=1/0;Zo(r,e)&&(n=ks(r,e[0]));for(var i=0;i<e.length;i++)for(var o=e[i],a=t[i],s=0;s<o.length-1;s++){var u=o[s],l=[u,o[s+1],a[s+1],a[s],u];No(r,l)&&(n=Math.min(n,ks(r,l)))}return n!==1/0&&n}(f[0],f[1],h)},e}(Pi);function As(t,e){return t.x*e.x+t.y*e.y}function ks(t,e){if(1===t.length){for(var r,n=0,i=e[n++];!r||i.equals(r);)if(!(r=e[n++]))return 1/0;for(;n<e.length;n++){var o=e[n],a=t[0],s=r.sub(i),u=o.sub(i),l=a.sub(i),p=As(s,s),c=As(s,u),h=As(u,u),f=As(l,s),y=As(l,u),d=p*h-c*c,m=(h*f-c*y)/d,v=(p*y-c*f)/d,g=i.z*(1-m-v)+r.z*m+o.z*v;if(isFinite(g))return g}return 1/0}for(var x=1/0,b=0,w=e;b<w.length;b+=1)x=Math.min(x,w[b].z);return x}var Is=Bi([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,zs=ms.VectorTileFeature.types,Ms=Math.cos(Math.PI/180*37.5),Ps=Math.pow(2,14)/.5,Cs=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Oi,this.indexArray=new Wi,this.programConfigurations=new Fo(Is,t.layers,t.zoom),this.segments=new fo,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Cs.prototype.populate=function(t,e,r){this.hasPattern=es("line",this.layers,e);for(var n=this.layers[0].layout.get("line-sort-key"),i=[],o=0,a=t;o<a.length;o+=1){var s=a[o],u=s.feature,l=s.id,p=s.index,c=s.sourceLayerIndex,h=this.layers[0]._featureFilter.needGeometry,f={type:u.type,id:l,properties:u.properties,geometry:h?Uo(u):[]};if(this.layers[0]._featureFilter.filter(new yi(this.zoom),f,r)){h||(f.geometry=Uo(u));var y=n?n.evaluate(f,{},r):void 0;i.push({id:l,properties:u.properties,type:u.type,sourceLayerIndex:c,index:p,geometry:f.geometry,patterns:{},sortKey:y})}}n&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var d=0,m=i;d<m.length;d+=1){var v=m[d],g=v.geometry,x=v.index,b=v.sourceLayerIndex;if(this.hasPattern){var w=rs("line",this.layers,v,this.zoom,e);this.patternFeatures.push(w)}else this.addFeature(v,g,x,r,{});e.featureIndex.insert(t[x].feature,g,x,b,this.index)}},Cs.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Cs.prototype.addFeatures=function(t,e,r){for(var n=0,i=this.patternFeatures;n<i.length;n+=1){var o=i[n];this.addFeature(o,o.geometry,o.index,e,r)}},Cs.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Cs.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Cs.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Is),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Cs.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Cs.prototype.addFeature=function(t,e,r,n,i){for(var o=this.layers[0].layout,a=o.get("line-join").evaluate(t,{}),s=o.get("line-cap"),u=o.get("line-miter-limit"),l=o.get("line-round-limit"),p=0,c=e;p<c.length;p+=1)this.addLine(c[p],t,a,s,u,l);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n)},Cs.prototype.addLine=function(t,e,r,n,i,o){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end")){this.clipStart=+e.properties.mapbox_clip_start,this.clipEnd=+e.properties.mapbox_clip_end;for(var a=0;a<t.length-1;a++)this.totalDistance+=t[a].dist(t[a+1]);this.updateScaledDistance()}for(var s="Polygon"===zs[e.type],u=t.length;u>=2&&t[u-1].equals(t[u-2]);)u--;for(var l=0;l<u-1&&t[l].equals(t[l+1]);)l++;if(!(u<(s?3:2))){"bevel"===r&&(i=1.05);var p,c=this.overscaling<=16?122880/(512*this.overscaling):0,h=this.segments.prepareSegment(10*u,this.layoutVertexArray,this.indexArray),f=void 0,y=void 0,d=void 0,m=void 0;this.e1=this.e2=-1,s&&(m=t[l].sub(p=t[u-2])._unit()._perp());for(var v=l;v<u;v++)if(!(y=v===u-1?s?t[l+1]:void 0:t[v+1])||!t[v].equals(y)){m&&(d=m),p&&(f=p),p=t[v],m=y?y.sub(p)._unit()._perp():d;var g=(d=d||m).add(m);0===g.x&&0===g.y||g._unit();var x=d.x*m.x+d.y*m.y,b=g.x*m.x+g.y*m.y,w=0!==b?1/b:1/0,_=2*Math.sqrt(2-2*b),S=b<Ms&&f&&y,A=d.x*m.y-d.y*m.x>0;if(S&&v>l){var k=p.dist(f);if(k>2*c){var I=p.sub(p.sub(f)._mult(c/k)._round());this.updateDistance(f,I),this.addCurrentVertex(I,d,0,0,h),f=I}}var z=f&&y,M=z?r:s?"butt":n;if(z&&"round"===M&&(w<o?M="miter":w<=2&&(M="fakeround")),"miter"===M&&w>i&&(M="bevel"),"bevel"===M&&(w>2&&(M="flipbevel"),w<i&&(M="miter")),f&&this.updateDistance(f,p),"miter"===M)g._mult(w),this.addCurrentVertex(p,g,0,0,h);else if("flipbevel"===M){if(w>100)g=m.mult(-1);else{var P=w*d.add(m).mag()/d.sub(m).mag();g._perp()._mult(P*(A?-1:1))}this.addCurrentVertex(p,g,0,0,h),this.addCurrentVertex(p,g.mult(-1),0,0,h)}else if("bevel"===M||"fakeround"===M){var C=-Math.sqrt(w*w-1),T=A?C:0,E=A?0:C;if(f&&this.addCurrentVertex(p,d,T,E,h),"fakeround"===M)for(var B=Math.round(180*_/Math.PI/20),V=1;V<B;V++){var D=V/B;if(.5!==D){var F=D-.5;D+=D*F*(D-1)*((1.0904+x*(x*(3.55645-1.43519*x)-3.2452))*F*F+(.848013+x*(.215638*x-1.06021)))}var L=m.sub(d)._mult(D)._add(d)._unit()._mult(A?-1:1);this.addHalfVertex(p,L.x,L.y,!1,A,0,h)}y&&this.addCurrentVertex(p,m,-T,-E,h)}else if("butt"===M)this.addCurrentVertex(p,g,0,0,h);else if("square"===M){var O=f?1:-1;this.addCurrentVertex(p,g,O,O,h)}else"round"===M&&(f&&(this.addCurrentVertex(p,d,0,0,h),this.addCurrentVertex(p,d,1,1,h,!0)),y&&(this.addCurrentVertex(p,m,-1,-1,h,!0),this.addCurrentVertex(p,m,0,0,h)));if(S&&v<u-1){var R=p.dist(y);if(R>2*c){var U=p.add(y.sub(p)._mult(c/R)._round());this.updateDistance(p,U),this.addCurrentVertex(U,m,0,0,h),p=U}}}}},Cs.prototype.addCurrentVertex=function(t,e,r,n,i,o){void 0===o&&(o=!1);var a=e.y*n-e.x,s=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,o,!1,r,i),this.addHalfVertex(t,a,s,o,!0,-n,i),this.distance>Ps/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,o))},Cs.prototype.addHalfVertex=function(t,e,r,n,i,o,a){var s=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((t.x<<1)+(n?1:0),(t.y<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===o?0:o<0?-1:1)|(63&s)<<2,s>>6);var u=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),a.primitiveLength++),i?this.e2=u:this.e1=u},Cs.prototype.updateScaledDistance=function(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(Ps-1):this.distance},Cs.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Ke("LineBucket",Cs,{omit:["layers","patternFeatures"]});var Ts=new Mi({"line-cap":new Si(nr.layout_line["line-cap"]),"line-join":new Ai(nr.layout_line["line-join"]),"line-miter-limit":new Si(nr.layout_line["line-miter-limit"]),"line-round-limit":new Si(nr.layout_line["line-round-limit"]),"line-sort-key":new Ai(nr.layout_line["line-sort-key"])}),Es={paint:new Mi({"line-opacity":new Ai(nr.paint_line["line-opacity"]),"line-color":new Ai(nr.paint_line["line-color"]),"line-translate":new Si(nr.paint_line["line-translate"]),"line-translate-anchor":new Si(nr.paint_line["line-translate-anchor"]),"line-width":new Ai(nr.paint_line["line-width"]),"line-gap-width":new Ai(nr.paint_line["line-gap-width"]),"line-offset":new Ai(nr.paint_line["line-offset"]),"line-blur":new Ai(nr.paint_line["line-blur"]),"line-dasharray":new Ii(nr.paint_line["line-dasharray"]),"line-pattern":new ki(nr.paint_line["line-pattern"]),"line-gradient":new zi(nr.paint_line["line-gradient"])}),layout:Ts},Bs=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new yi(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=a({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(Ai))(Es.paint.properties["line-width"].specification);Bs.useIntegerZoom=!0;var Vs=function(t){function e(e){t.call(this,e,Es)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient()},e.prototype._updateGradient=function(){this.gradient=va(this._transitionablePaint._values["line-gradient"].value.expression,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=Bs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Cs(t)},e.prototype.queryRadius=function(t){var e=t,r=Ds(ta("line-width",this,e),ta("line-gap-width",this,e)),n=ta("line-offset",this,e);return r/2+Math.abs(n)+ea(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,i,o,a,s){var u=ra(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),l=s/2*Ds(this.paint.get("line-width").evaluate(e,n),this.paint.get("line-gap-width").evaluate(e,n)),p=this.paint.get("line-offset").evaluate(e,n);return p&&(i=function(t,e){for(var n=[],i=new r(0,0),o=0;o<t.length;o++){for(var a=t[o],s=[],u=0;u<a.length;u++){var l=a[u],p=a[u+1],c=0===u?i:l.sub(a[u-1])._unit()._perp(),h=u===a.length-1?i:p.sub(l)._unit()._perp(),f=c._add(h)._unit();f._mult(1/(f.x*h.x+f.y*h.y)),s.push(f._mult(e)._add(l))}n.push(s)}return n}(i,p*s)),function(t,e,r){for(var n=0;n<e.length;n++){var i=e[n];if(t.length>=3)for(var o=0;o<i.length;o++)if($o(t,i[o]))return!0;if(Xo(t,i,r))return!0}return!1}(u,i,l)},e.prototype.isTileClipped=function(){return!0},e}(Pi);function Ds(t,e){return e>0?e+2*t:t}var Fs=Bi([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Ls=Bi([{name:"a_projected_pos",components:3,type:"Float32"}],4),Os=(Bi([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Bi([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Rs=(Bi([{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"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]),Bi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Us=Bi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);function js(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),fi.applyArabicShaping&&(t=fi.applyArabicShaping(t)),t}(t.text,e,r)})),t}Bi([{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"}]),Bi([{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:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"}]),Bi([{type:"Float32",name:"offsetX"}]),Bi([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var qs={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Ns=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,l=u>>1,p=-7,c=r?i-1:0,h=r?-1:1,f=t[e+c];for(c+=h,o=f&(1<<-p)-1,f>>=-p,p+=s;p>0;o=256*o+t[e+c],c+=h,p-=8);for(a=o&(1<<-p)-1,o>>=-p,p+=n;p>0;a=256*a+t[e+c],c+=h,p-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=l}return(f?-1:1)*a*Math.pow(2,o-n)},Gs=function(t,e,r,n,i,o){var a,s,u,l=8*o-i-1,p=(1<<l)-1,c=p>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,y=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+c>=1?h/u:h*Math.pow(2,1-c))*u>=2&&(a++,u/=2),a+c>=p?(s=0,a=p):a+c>=1?(s=(e*u-1)*Math.pow(2,i),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=y,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;t[r+f]=255&a,f+=y,a/=256,l-=8);t[r+f-y]|=128*d},Zs=Xs;function Xs(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Xs.Varint=0,Xs.Fixed64=1,Xs.Bytes=2,Xs.Fixed32=5;var Ys="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Js(t){return t.type===Xs.Bytes?t.readVarint()+t.pos:t.pos+1}function Ks(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Hs(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function Ws(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function $s(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function Qs(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function tu(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function eu(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function ru(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function nu(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function iu(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function ou(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function au(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function su(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function uu(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function lu(t){for(var e=0,r=0,n=0,i=t;n<i.length;n+=1){var o=i[n];e+=o.w*o.h,r=Math.max(r,o.w)}t.sort((function(t,e){return e.h-t.h}));for(var a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],s=0,u=0,l=0,p=t;l<p.length;l+=1)for(var c=p[l],h=a.length-1;h>=0;h--){var f=a[h];if(!(c.w>f.w||c.h>f.h)){if(c.x=f.x,c.y=f.y,u=Math.max(u,c.y+c.h),s=Math.max(s,c.x+c.w),c.w===f.w&&c.h===f.h){var y=a.pop();h<a.length&&(a[h]=y)}else c.h===f.h?(f.x+=c.w,f.w-=c.w):c.w===f.w?(f.y+=c.h,f.h-=c.h):(a.push({x:f.x+c.w,y:f.y,w:f.w-c.w,h:c.h}),f.y+=c.h,f.h-=c.h);break}}return{w:s,h:u,fill:e/(s*u)||0}}Xs.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=au(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=uu(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=au(this.buf,this.pos)+4294967296*au(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=au(this.buf,this.pos)+4294967296*uu(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Ns(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ns(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,o=r.buf;if(n=(112&(i=o[r.pos++]))>>4,i<128)return Ks(t,n,e);if(n|=(127&(i=o[r.pos++]))<<3,i<128)return Ks(t,n,e);if(n|=(127&(i=o[r.pos++]))<<10,i<128)return Ks(t,n,e);if(n|=(127&(i=o[r.pos++]))<<17,i<128)return Ks(t,n,e);if(n|=(127&(i=o[r.pos++]))<<24,i<128)return Ks(t,n,e);if(n|=(1&(i=o[r.pos++]))<<31,i<128)return Ks(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Ys?function(t,e,r){return Ys.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var n="",i=e;i<r;){var o,a,s,u=t[i],l=null,p=u>239?4:u>223?3:u>191?2:1;if(i+p>r)break;1===p?u<128&&(l=u):2===p?128==(192&(o=t[i+1]))&&(l=(31&u)<<6|63&o)<=127&&(l=null):3===p?(a=t[i+2],128==(192&(o=t[i+1]))&&128==(192&a)&&((l=(15&u)<<12|(63&o)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===p&&(a=t[i+2],s=t[i+3],128==(192&(o=t[i+1]))&&128==(192&a)&&128==(192&s)&&((l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,p=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),i+=p}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Xs.Bytes)return t.push(this.readVarint(e));var r=Js(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Xs.Bytes)return t.push(this.readSVarint());var e=Js(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Xs.Bytes)return t.push(this.readBoolean());var e=Js(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Xs.Bytes)return t.push(this.readFloat());var e=Js(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Xs.Bytes)return t.push(this.readDouble());var e=Js(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Xs.Bytes)return t.push(this.readFixed32());var e=Js(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Xs.Bytes)return t.push(this.readSFixed32());var e=Js(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Xs.Bytes)return t.push(this.readFixed64());var e=Js(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Xs.Bytes)return t.push(this.readSFixed64());var e=Js(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Xs.Varint)for(;this.buf[this.pos++]>127;);else if(e===Xs.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Xs.Fixed32)this.pos+=4;else{if(e!==Xs.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)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(t){this.realloc(4),su(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),su(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),su(this.buf,-1&t,this.pos),su(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),su(this.buf,-1&t,this.pos),su(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,r.buf[r.pos]=127&(t>>>=7)}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,o=0;o<e.length;o++){if((n=e.charCodeAt(o))>55295&&n<57344){if(!i){n>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&Hs(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Gs(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Gs(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&Hs(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Xs.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Ws,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,$s,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,eu,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Qs,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,tu,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,ru,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,nu,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,iu,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,ou,e)},writeBytesField:function(t,e){this.writeTag(t,Xs.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Xs.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Xs.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Xs.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Xs.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Xs.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Xs.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Xs.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Xs.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Xs.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var pu=function(t,e){var r=e.pixelRatio,n=e.version,i=e.stretchX,o=e.stretchY,a=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=i,this.stretchY=o,this.content=a,this.version=n},cu={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};cu.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},cu.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},cu.tlbr.get=function(){return this.tl.concat(this.br)},cu.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(pu.prototype,cu);var hu=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var o=lu(i),a=new da({width:o.w||1,height:o.h||1});for(var s in t){var u=t[s],l=r[s].paddedRect;da.copy(u.data,a,{x:0,y:0},{x:l.x+1,y:l.y+1},u.data)}for(var p in e){var c=e[p],h=n[p].paddedRect,f=h.x+1,y=h.y+1,d=c.data.width,m=c.data.height;da.copy(c.data,a,{x:0,y:0},{x:f,y:y},c.data),da.copy(c.data,a,{x:0,y:m-1},{x:f,y:y-1},{width:d,height:1}),da.copy(c.data,a,{x:0,y:0},{x:f,y:y+m},{width:d,height:1}),da.copy(c.data,a,{x:d-1,y:0},{x:f-1,y:y},{width:1,height:m}),da.copy(c.data,a,{x:0,y:0},{x:f+d,y:y},{width:1,height:m})}this.image=a,this.iconPositions=r,this.patternPositions=n};hu.prototype.addImages=function(t,e,r){for(var n in t){var i=t[n],o={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(o),e[n]=new pu(o,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},hu.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)},hu.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var n=t.tl;r.update(e.data,void 0,{x:n[0],y:n[1]})}},Ke("ImagePosition",pu),Ke("ImageAtlas",hu);var fu={horizontal:1,vertical:2,horizontalOnly:3},yu=function(){this.scale=1,this.fontStack="",this.imageName=null};yu.forText=function(t,e){var r=new yu;return r.scale=t||1,r.fontStack=e,r},yu.forImage=function(t){var e=new yu;return e.imageName=t,e};var du=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function mu(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d){var m,v=du.fromFeature(t,i);c===fu.vertical&&v.verticalizePunctuation();var g=fi.processBidirectionalText,x=fi.processStyledBidirectionalText;if(g&&1===v.sections.length){m=[];for(var b=0,w=g(v.toString(),Su(v,l,o,e,n,f,y));b<w.length;b+=1){var _=w[b],S=new du;S.text=_,S.sections=v.sections;for(var A=0;A<_.length;A++)S.sectionIndex.push(0);m.push(S)}}else if(x){m=[];for(var k=0,I=x(v.text,v.sectionIndex,Su(v,l,o,e,n,f,y));k<I.length;k+=1){var z=I[k],M=new du;M.text=z[0],M.sectionIndex=z[1],M.sections=v.sections,m.push(M)}}else m=function(t,e){for(var r=[],n=t.text,i=0,o=0,a=e;o<a.length;o+=1){var s=a[o];r.push(t.substring(i,s)),i=s}return i<n.length&&r.push(t.substring(i,n.length)),r}(v,Su(v,l,o,e,n,f,y));var P=[],C={positionedLines:P,text:v.toString(),top:p[1],bottom:p[1],left:p[0],right:p[0],writingMode:c,iconsInText:!1,verticalizable:!1};return function(t,e,r,n,i,o,a,s,u,l,p,c){for(var h=0,f=-17,y=0,d=0,m="right"===s?1:"left"===s?0:.5,v=0,g=0,x=i;g<x.length;g+=1){var b=x[g];b.trim();var w=b.getMaxScale(),_=24*(w-1),S={positionedGlyphs:[],lineOffset:0};t.positionedLines[v]=S;var A=S.positionedGlyphs,k=0;if(b.length()){for(var I=0;I<b.length();I++){var z=b.getSection(I),M=b.getSectionIndex(I),P=b.getCharCode(I),C=0,T=null,E=null,B=null,V=24,D=!(u===fu.horizontal||!p&&!wn(P)||p&&(vu[P]||(G=P,Yr(G)||Jr(G)||Kr(G)||yn(G)||gn(G))));if(z.imageName){var F=n[z.imageName];if(!F)continue;B=z.imageName,t.iconsInText=t.iconsInText||!0,E=F.paddedRect;var L=F.displaySize;z.scale=24*z.scale/c,C=_+(24-L[1]*z.scale),V=(T={width:L[0],height:L[1],left:1,top:-3,advance:D?L[1]:L[0]}).advance;var O=D?L[0]*z.scale-24*w:L[1]*z.scale-24*w;O>0&&O>k&&(k=O)}else{var R=r[z.fontStack],U=R&&R[P];if(U&&U.rect)E=U.rect,T=U.metrics;else{var j=e[z.fontStack],q=j&&j[P];if(!q)continue;T=q.metrics}C=24*(w-z.scale)}D?(t.verticalizable=!0,A.push({glyph:P,imageName:B,x:h,y:f+C,vertical:D,scale:z.scale,fontStack:z.fontStack,sectionIndex:M,metrics:T,rect:E}),h+=V*z.scale+l):(A.push({glyph:P,imageName:B,x:h,y:f+C,vertical:D,scale:z.scale,fontStack:z.fontStack,sectionIndex:M,metrics:T,rect:E}),h+=T.advance*z.scale+l)}0!==A.length&&(y=Math.max(h-l,y),ku(A,0,A.length-1,m,k)),h=0;var N=o*w+k;S.lineOffset=Math.max(k,_),f+=N,d=Math.max(N,d),++v}else f+=o,++v}var G,Z=f- -17,X=Au(a),Y=X.horizontalAlign,J=X.verticalAlign;(function(t,e,r,n,i,o,a,s,u){var l,p=(e-r)*i;l=o!==a?-s*n- -17:(-n*u+.5)*a;for(var c=0,h=t;c<h.length;c+=1)for(var f=0,y=h[c].positionedGlyphs;f<y.length;f+=1){var d=y[f];d.x+=p,d.y+=l}})(t.positionedLines,m,Y,J,y,d,o,Z,i.length),t.top+=-J*Z,t.bottom=t.top+Z,t.left+=-Y*y,t.right=t.left+y}(C,e,r,n,m,a,s,u,c,l,h,d),!function(t){for(var e=0,r=t;e<r.length;e+=1)if(0!==r[e].positionedGlyphs.length)return!1;return!0}(P)&&C}du.fromFeature=function(t,e){for(var r=new du,n=0;n<t.sections.length;n++){var i=t.sections[n];i.image?r.addImageSection(i):r.addTextSection(i,e)}return r},du.prototype.length=function(){return this.text.length},du.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},du.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},du.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},du.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",r=0;r<t.length;r++){var n=t.charCodeAt(r+1)||null,i=t.charCodeAt(r-1)||null;e+=n&&_n(n)&&!qs[t[r+1]]||i&&_n(i)&&!qs[t[r-1]]||!qs[t[r]]?t[r]:qs[t[r]]}return e}(this.text)},du.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&vu[this.text.charCodeAt(e)];e++)t++;for(var r=this.text.length,n=this.text.length-1;n>=0&&n>=t&&vu[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},du.prototype.substring=function(t,e){var r=new du;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},du.prototype.toString=function(){return this.text},du.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},du.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(yu.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n<t.text.length;++n)this.sectionIndex.push(r)},du.prototype.addImageSection=function(t){var e=t.image?t.image.name:"";if(0!==e.length){var r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(yu.forImage(e)),this.sectionIndex.push(this.sections.length-1)):y("Reached maximum number of images 6401")}else y("Can't add FormattedSection with an empty image.")},du.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var vu={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},gu={};function xu(t,e,r,n,i,o){if(e.imageName){var a=n[e.imageName];return a?a.displaySize[0]*e.scale*24/o+i:0}var s=r[e.fontStack],u=s&&s[t];return u?u.metrics.advance*e.scale+i:0}function bu(t,e,r,n){var i=Math.pow(t-e,2);return n?t<e?i/2:2*i:i+Math.abs(r)*r}function wu(t,e,r){var n=0;return 10===t&&(n-=1e4),r&&(n+=150),40!==t&&65288!==t||(n+=50),41!==e&&65289!==e||(n+=50),n}function _u(t,e,r,n,i,o){for(var a=null,s=bu(e,r,i,o),u=0,l=n;u<l.length;u+=1){var p=l[u],c=bu(e-p.x,r,i,o)+p.badness;c<=s&&(a=p,s=c)}return{index:t,x:e,priorBreak:a,badness:s}}function Su(t,e,r,n,i,o,a){if("point"!==o)return[];if(!t)return[];for(var s,u=[],l=function(t,e,r,n,i,o){for(var a=0,s=0;s<t.length();s++){var u=t.getSection(s);a+=xu(t.getCharCode(s),u,n,i,e,o)}return a/Math.max(1,Math.ceil(a/r))}(t,e,r,n,i,a),p=t.text.indexOf("​")>=0,c=0,h=0;h<t.length();h++){var f=t.getSection(h),y=t.getCharCode(h);if(vu[y]||(c+=xu(y,f,n,i,e,a)),h<t.length()-1){var d=!((s=y)<11904||!(nn(s)||rn(s)||mn(s)||fn(s)||un(s)||Hr(s)||on(s)||Qr(s)||ln(s)||pn(s)||sn(s)||xn(s)||tn(s)||$r(s)||Wr(s)||an(s)||en(s)||dn(s)||hn(s)||cn(s)));(gu[y]||d||f.imageName)&&u.push(_u(h+1,c,l,u,wu(y,t.getCharCode(h+1),d&&p),!1))}}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(_u(t.length(),c,l,u,0,!0))}function Au(t){var e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){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 ku(t,e,r,n,i){if(n||i)for(var o=t[r],a=(t[r].x+o.metrics.advance*o.scale)*n,s=e;s<=r;s++)t[s].x-=a,t[s].y+=i}function Iu(t,e,r,n,i,o){var a,s=t.image;if(s.content){var u=s.content,l=s.pixelRatio||1;a=[u[0]/l,u[1]/l,s.displaySize[0]-u[2]/l,s.displaySize[1]-u[3]/l]}var p,c,h,f,y=e.left*o,d=e.right*o;"width"===r||"both"===r?(f=i[0]+y-n[3],c=i[0]+d+n[1]):c=(f=i[0]+(y+d-s.displaySize[0])/2)+s.displaySize[0];var m=e.top*o,v=e.bottom*o;return"height"===r||"both"===r?(p=i[1]+m-n[0],h=i[1]+v+n[2]):h=(p=i[1]+(m+v-s.displaySize[1])/2)+s.displaySize[1],{image:s,top:p,right:c,bottom:h,left:f,collisionPadding:a}}gu[10]=!0,gu[32]=!0,gu[38]=!0,gu[40]=!0,gu[41]=!0,gu[43]=!0,gu[45]=!0,gu[47]=!0,gu[173]=!0,gu[183]=!0,gu[8203]=!0,gu[8208]=!0,gu[8211]=!0,gu[8231]=!0;var zu=function(t){function e(e,r,n,i){t.call(this,e,r),this.angle=n,void 0!==i&&(this.segment=i)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(r);function Mu(t,e){var r=e.expression;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new yi(t+1))};if("source"===r.kind)return{kind:"source"};for(var n=r.zoomStops,i=r.interpolationType,o=0;o<n.length&&n[o]<=t;)o++;for(var a=o=Math.max(0,o-1);a<n.length&&n[a]<t+1;)a++;a=Math.min(n.length-1,a);var s=n[o],u=n[a];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:u,interpolationType:i}:{kind:"camera",minZoom:s,maxZoom:u,minSize:r.evaluate(new yi(s)),maxSize:r.evaluate(new yi(u)),interpolationType:i}}function Pu(t,e,r,n,i){if(void 0===e.segment)return!0;for(var o=e,a=e.segment+1,s=0;s>-r/2;){if(--a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var u=[],l=0;s<r/2;){var p=t[a],c=t[a+1];if(!c)return!1;var h=t[a-1].angleTo(p)-p.angleTo(c);for(h=Math.abs((h+3*Math.PI)%(2*Math.PI)-Math.PI),u.push({distance:s,angleDelta:h}),l+=h;s-u[0].distance>n;)l-=u.shift().angleDelta;if(l>i)return!1;a++,s+=p.dist(c)}return!0}function Cu(t){for(var e=0,r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function Tu(t,e,r){return t?.6*e*r:0}function Eu(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Bu(t,e,r,n,i,o){for(var a=Tu(r,i,o),s=Eu(r,n)*o,u=0,l=Cu(t)/2,p=0;p<t.length-1;p++){var c=t[p],h=t[p+1],f=c.dist(h);if(u+f>l){var y=(l-u)/f,d=jt(c.x,h.x,y),m=jt(c.y,h.y,y),v=new zu(d,m,h.angleTo(c),p);return v._round(),!a||Pu(t,v,s,a,e)?v:void 0}u+=f}}function Vu(t,e,r,n,i,o,a,s,u){var l=Tu(n,o,a),p=Eu(n,i),c=p*a,h=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;return e-c<e/4&&(e=c+e/4),function t(e,r,n,i,o,a,s,u,l){for(var p=a/2,c=Cu(e),h=0,f=r-n,y=[],d=0;d<e.length-1;d++){for(var m=e[d],v=e[d+1],g=m.dist(v),x=v.angleTo(m);f+n<h+g;){var b=((f+=n)-h)/g,w=jt(m.x,v.x,b),_=jt(m.y,v.y,b);if(w>=0&&w<l&&_>=0&&_<l&&f-p>=0&&f+p<=c){var S=new zu(w,_,x,d);S._round(),i&&!Pu(e,S,a,i,o)||y.push(S)}}h+=g}return u||y.length||s||(y=t(e,h/2,n,i,o,a,s,!0,l)),y}(t,h?e/2*s%e:(p/2+2*o)*a*s%e,e,l,r,c,h,!1,u)}function Du(t,e,n,i){var o=[],a=t.image,s=a.pixelRatio,u=a.paddedRect.w-2,l=a.paddedRect.h-2,p=t.right-t.left,c=t.bottom-t.top,h=a.stretchX||[[0,u]],f=a.stretchY||[[0,l]],y=function(t,e){return t+e[1]-e[0]},d=h.reduce(y,0),m=f.reduce(y,0),v=u-d,g=l-m,x=0,b=d,w=0,_=m,S=0,A=v,k=0,I=g;if(a.content&&i){var z=a.content;x=Fu(h,0,z[0]),w=Fu(f,0,z[1]),b=Fu(h,z[0],z[2]),_=Fu(f,z[1],z[3]),S=z[0]-x,k=z[1]-w,A=z[2]-z[0]-b,I=z[3]-z[1]-_}var M=function(i,o,u,l){var h=Ou(i.stretch-x,b,p,t.left),f=Ru(i.fixed-S,A,i.stretch,d),y=Ou(o.stretch-w,_,c,t.top),v=Ru(o.fixed-k,I,o.stretch,m),g=Ou(u.stretch-x,b,p,t.left),z=Ru(u.fixed-S,A,u.stretch,d),M=Ou(l.stretch-w,_,c,t.top),P=Ru(l.fixed-k,I,l.stretch,m),C=new r(h,y),T=new r(g,y),E=new r(g,M),B=new r(h,M),V=new r(f/s,v/s),D=new r(z/s,P/s),F=e*Math.PI/180;if(F){var L=Math.sin(F),O=Math.cos(F),R=[O,-L,L,O];C._matMult(R),T._matMult(R),B._matMult(R),E._matMult(R)}var U=i.stretch+i.fixed,j=o.stretch+o.fixed;return{tl:C,tr:T,bl:B,br:E,tex:{x:a.paddedRect.x+1+U,y:a.paddedRect.y+1+j,w:u.stretch+u.fixed-U,h:l.stretch+l.fixed-j},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:V,pixelOffsetBR:D,minFontScaleX:A/s/p,minFontScaleY:I/s/c,isSDF:n}};if(i&&(a.stretchX||a.stretchY))for(var P=Lu(h,v,d),C=Lu(f,g,m),T=0;T<P.length-1;T++)for(var E=P[T],B=P[T+1],V=0;V<C.length-1;V++)o.push(M(E,C[V],B,C[V+1]));else o.push(M({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:u+1},{fixed:0,stretch:l+1}));return o}function Fu(t,e,r){for(var n=0,i=0,o=t;i<o.length;i+=1){var a=o[i];n+=Math.max(e,Math.min(r,a[1]))-Math.max(e,Math.min(r,a[0]))}return n}function Lu(t,e,r){for(var n=[{fixed:-1,stretch:0}],i=0,o=t;i<o.length;i+=1){var a=o[i],s=a[0],u=a[1],l=n[n.length-1];n.push({fixed:s-l.stretch,stretch:l.stretch}),n.push({fixed:s-l.stretch,stretch:l.stretch+(u-s)})}return n.push({fixed:e+1,stretch:r}),n}function Ou(t,e,r,n){return t/e*r+n}function Ru(t,e,r,n){return t-e*r/n}Ke("Anchor",zu);var Uu=function(t,e,n,i,o,a,s,u,l,p,c,h){var f=s.top*u-l,y=s.bottom*u+l,d=s.left*u-l,m=s.right*u+l,v=s.collisionPadding;if(v&&(d-=v[0]*u,f-=v[1]*u,m+=v[2]*u,y+=v[3]*u),this.boxStartIndex=t.length,p){var g=y-f,x=m-d;g>0&&(g=Math.max(10*u,g),this._addLineCollisionCircles(t,e,n,n.segment,x,g,i,o,a,c))}else{if(h){var b=new r(d,f),w=new r(m,f),_=new r(d,y),S=new r(m,y),A=h*Math.PI/180;b._rotate(A),w._rotate(A),_._rotate(A),S._rotate(A),d=Math.min(b.x,w.x,_.x,S.x),m=Math.max(b.x,w.x,_.x,S.x),f=Math.min(b.y,w.y,_.y,S.y),y=Math.max(b.y,w.y,_.y,S.y)}t.emplaceBack(n.x,n.y,d,f,m,y,i,o,a,0,0)}this.boxEndIndex=t.length};Uu.prototype._addLineCollisionCircles=function(t,e,r,n,i,o,a,s,u,l){var p=o/2,c=Math.floor(i/p)||1,h=1+.4*Math.log(l)/Math.LN2,f=Math.floor(c*h/2),y=-o/2,d=r,m=n+1,v=y,g=-i/2,x=g-i/4;do{if(--m<0){if(v>g)return;m=0;break}v-=e[m].dist(d),d=e[m]}while(v>x);for(var b=e[m].dist(e[m+1]),w=-f;w<c+f;w++){var _=w*p,S=g+_;if(_<0&&(S+=_),_>i&&(S+=_-i),!(S<v)){for(;v+b<S;){if(v+=b,1+ ++m>=e.length)return;b=e[m].dist(e[m+1])}var A=S-v,k=e[m],I=e[m+1].sub(k)._unit()._mult(A)._add(k)._round(),z=Math.abs(S-y)<p?0:.8*(S-y);t.emplaceBack(I.x,I.y,-o/2,-o/2,o/2,o/2,a,s,u,o/2,z)}}};var ju=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=qu),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function qu(t,e){return t<e?-1:t>e?1:0}function Nu(t,e,n){void 0===e&&(e=1),void 0===n&&(n=!1);for(var i=1/0,o=1/0,a=-1/0,s=-1/0,u=t[0],l=0;l<u.length;l++){var p=u[l];(!l||p.x<i)&&(i=p.x),(!l||p.y<o)&&(o=p.y),(!l||p.x>a)&&(a=p.x),(!l||p.y>s)&&(s=p.y)}var c=Math.min(a-i,s-o),h=c/2,f=new ju([],Gu);if(0===c)return new r(i,o);for(var y=i;y<a;y+=c)for(var d=o;d<s;d+=c)f.push(new Zu(y+h,d+h,h,t));for(var m=function(t){for(var e=0,r=0,n=0,i=t[0],o=0,a=i.length,s=a-1;o<a;s=o++){var u=i[o],l=i[s],p=u.x*l.y-l.x*u.y;r+=(u.x+l.x)*p,n+=(u.y+l.y)*p,e+=3*p}return new Zu(r/e,n/e,0,t)}(t),v=f.length;f.length;){var g=f.pop();(g.d>m.d||!m.d)&&(m=g,n&&console.log("found best %d after %d probes",Math.round(1e4*g.d)/1e4,v)),g.max-m.d<=e||(f.push(new Zu(g.p.x-(h=g.h/2),g.p.y-h,h,t)),f.push(new Zu(g.p.x+h,g.p.y-h,h,t)),f.push(new Zu(g.p.x-h,g.p.y+h,h,t)),f.push(new Zu(g.p.x+h,g.p.y+h,h,t)),v+=4)}return n&&(console.log("num probes: "+v),console.log("best distance: "+m.d)),m.p}function Gu(t,e){return e.max-t.max}function Zu(t,e,n,i){this.p=new r(t,e),this.h=n,this.d=function(t,e){for(var r=!1,n=1/0,i=0;i<e.length;i++)for(var o=e[i],a=0,s=o.length,u=s-1;a<s;u=a++){var l=o[a],p=o[u];l.y>t.y!=p.y>t.y&&t.x<(p.x-l.x)*(t.y-l.y)/(p.y-l.y)+l.x&&(r=!r),n=Math.min(n,Ho(t,l,p))}return(r?1:-1)*Math.sqrt(n)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}ju.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},ju.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},ju.prototype.peek=function(){return this.data[0]},ju.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,o=e[i];if(r(n,o)>=0)break;e[t]=o,t=i}e[t]=n},ju.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t<n;){var o=1+(t<<1),a=e[o],s=o+1;if(s<this.length&&r(e[s],a)<0&&(o=s,a=e[s]),r(a,i)>=0)break;e[t]=a,t=o}e[t]=i};var Xu=Number.POSITIVE_INFINITY;function Yu(t,e,n,i,o,a,s){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var u=t.layers[0].layout,l=t.layers[0]._unevaluatedLayout._values,p={};if("composite"===t.textSizeData.kind){var c=t.textSizeData,h=c.maxZoom;p.compositeTextSizes=[l["text-size"].possiblyEvaluate(new yi(c.minZoom),s),l["text-size"].possiblyEvaluate(new yi(h),s)]}if("composite"===t.iconSizeData.kind){var f=t.iconSizeData,d=f.maxZoom;p.compositeIconSizes=[l["icon-size"].possiblyEvaluate(new yi(f.minZoom),s),l["icon-size"].possiblyEvaluate(new yi(d),s)]}p.layoutTextSize=l["text-size"].possiblyEvaluate(new yi(t.zoom+1),s),p.layoutIconSize=l["icon-size"].possiblyEvaluate(new yi(t.zoom+1),s),p.textMaxSize=l["text-size"].possiblyEvaluate(new yi(18));for(var m=24*u.get("text-line-height"),v="map"===u.get("text-rotation-alignment")&&"point"!==u.get("symbol-placement"),g=u.get("text-keep-upright"),x=u.get("text-size"),b=function(){var a,l,c=_[w],h=u.get("text-font").evaluate(c,{},s).join(","),f=x.evaluate(c,{},s),d=p.layoutTextSize.evaluate(c,{},s),b=p.layoutIconSize.evaluate(c,{},s),S={horizontal:{},vertical:void 0},A=c.text,k=[0,0];if(A){var I=A.toString(),z=24*u.get("text-letter-spacing").evaluate(c,{},s),M=function(t){for(var e=0,r=t;e<r.length;e+=1)if(n=r[e].charCodeAt(0),Yr(n)||Jr(n)||Kr(n)||yn(n)||gn(n))return!1;var n;return!0}(I)?z:0,P=u.get("text-anchor").evaluate(c,{},s),C=u.get("text-variable-anchor");if(!C){var T=u.get("text-radial-offset").evaluate(c,{},s);T?(a=P,k=(l=[24*T,Xu])[1]!==Xu?function(t,e,r){var n=0,i=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,i]}(a,l[0],l[1]):function(t,e){var r=0,n=0;e<0&&(e=0);var i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e}return[r,n]}(a,l[0])):k=u.get("text-offset").evaluate(c,{},s).map((function(t){return 24*t}))}var E=v?"center":u.get("text-justify").evaluate(c,{},s),B=u.get("symbol-placement"),V="point"===B?24*u.get("text-max-width").evaluate(c,{},s):0,D=function(){t.allowVerticalPlacement&&bn(I)&&(S.vertical=mu(A,e,n,o,h,V,m,P,"left",M,k,fu.vertical,!0,B,d,f))};if(!v&&C){for(var F="auto"===E?C.map((function(t){return Ju(t)})):[E],L=!1,O=0;O<F.length;O++){var R=F[O];if(!S.horizontal[R])if(L)S.horizontal[R]=S.horizontal[0];else{var U=mu(A,e,n,o,h,V,m,"center",R,M,k,fu.horizontal,!1,B,d,f);U&&(S.horizontal[R]=U,L=1===U.positionedLines.length)}}D()}else{"auto"===E&&(E=Ju(P));var j=mu(A,e,n,o,h,V,m,P,E,M,k,fu.horizontal,!1,B,d,f);j&&(S.horizontal[E]=j),D(),bn(I)&&v&&g&&(S.vertical=mu(A,e,n,o,h,V,m,P,E,M,k,fu.vertical,!1,B,d,f))}}var q=void 0,N=!1;if(c.icon&&c.icon.name){var G=i[c.icon.name];G&&(q=function(t,e,r){var n=Au(r),i=e[0]-t.displaySize[0]*n.horizontalAlign,o=e[1]-t.displaySize[1]*n.verticalAlign;return{image:t,top:o,bottom:o+t.displaySize[1],left:i,right:i+t.displaySize[0]}}(o[c.icon.name],u.get("icon-offset").evaluate(c,{},s),u.get("icon-anchor").evaluate(c,{},s)),N=G.sdf,void 0===t.sdfIcons?t.sdfIcons=G.sdf:t.sdfIcons!==G.sdf&&y("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(G.pixelRatio!==t.pixelRatio||0!==u.get("icon-rotate").constantOr(1))&&(t.iconsNeedLinear=!0))}var Z=Hu(S.horizontal)||S.vertical;t.iconsInText=!!Z&&Z.iconsInText,(Z||q)&&function(t,e,n,i,o,a,s,u,l,p,c){var h=a.textMaxSize.evaluate(e,{});void 0===h&&(h=s);var f,d=t.layers[0].layout,m=d.get("icon-offset").evaluate(e,{},c),v=Hu(n.horizontal),g=s/24,x=t.tilePixelRatio*g,b=t.tilePixelRatio*h/24,w=t.tilePixelRatio*u,_=t.tilePixelRatio*d.get("symbol-spacing"),S=d.get("text-padding")*t.tilePixelRatio,A=d.get("icon-padding")*t.tilePixelRatio,k=d.get("text-max-angle")/180*Math.PI,I="map"===d.get("text-rotation-alignment")&&"point"!==d.get("symbol-placement"),z="map"===d.get("icon-rotation-alignment")&&"point"!==d.get("symbol-placement"),M=d.get("symbol-placement"),P=_/2,C=d.get("icon-text-fit");i&&"none"!==C&&(t.allowVerticalPlacement&&n.vertical&&(f=Iu(i,n.vertical,C,d.get("icon-text-fit-padding"),m,g)),v&&(i=Iu(i,v,C,d.get("icon-text-fit-padding"),m,g)));var T=function(r,s){s.x<0||s.x>=8192||s.y<0||s.y>=8192||function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,d,m,v,g,x,b,w,_,S,A){var k,I,z,M,P,C=t.addToLineVertexArray(e,r),T=0,E=0,B=0,V=0,D=-1,F=-1,L={},O=go(""),R=0,U=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(R=(k=s.layout.get("text-offset").evaluate(w,{},A).map((function(t){return 24*t})))[0],U=k[1]):(R=24*s.layout.get("text-radial-offset").evaluate(w,{},A),U=Xu),t.allowVerticalPlacement&&n.vertical){var j=s.layout.get("text-rotate").evaluate(w,{},A)+90;M=new Uu(u,r,e,l,p,c,n.vertical,h,f,d,t.overscaling,j),a&&(P=new Uu(u,r,e,l,p,c,a,v,g,d,t.overscaling,j))}if(i){var q=s.layout.get("icon-rotate").evaluate(w,{}),N="none"!==s.layout.get("icon-text-fit"),G=Du(i,q,S,N),Z=a?Du(a,q,S,N):void 0;z=new Uu(u,r,e,l,p,c,i,v,g,!1,t.overscaling,q),T=4*G.length;var X=t.iconSizeData,Y=null;"source"===X.kind?(Y=[128*s.layout.get("icon-size").evaluate(w,{})])[0]>32640&&y(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===X.kind&&((Y=[128*_.compositeIconSizes[0].evaluate(w,{},A),128*_.compositeIconSizes[1].evaluate(w,{},A)])[0]>32640||Y[1]>32640)&&y(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,G,Y,b,x,w,!1,e,C.lineStartIndex,C.lineLength,-1,A),D=t.icon.placedSymbolArray.length-1,Z&&(E=4*Z.length,t.addSymbols(t.icon,Z,Y,b,x,w,fu.vertical,e,C.lineStartIndex,C.lineLength,-1,A),F=t.icon.placedSymbolArray.length-1)}for(var J in n.horizontal){var K=n.horizontal[J];if(!I){O=go(K.text);var H=s.layout.get("text-rotate").evaluate(w,{},A);I=new Uu(u,r,e,l,p,c,K,h,f,d,t.overscaling,H)}var W=1===K.positionedLines.length;if(B+=Ku(t,e,K,o,s,d,w,m,C,n.vertical?fu.horizontal:fu.horizontalOnly,W?Object.keys(n.horizontal):[J],L,D,_,A),W)break}n.vertical&&(V+=Ku(t,e,n.vertical,o,s,d,w,m,C,fu.vertical,["vertical"],L,F,_,A));var $=I?I.boxStartIndex:t.collisionBoxArray.length,Q=I?I.boxEndIndex:t.collisionBoxArray.length,tt=M?M.boxStartIndex:t.collisionBoxArray.length,et=M?M.boxEndIndex:t.collisionBoxArray.length,rt=z?z.boxStartIndex:t.collisionBoxArray.length,nt=z?z.boxEndIndex:t.collisionBoxArray.length,it=P?P.boxStartIndex:t.collisionBoxArray.length,ot=P?P.boxEndIndex:t.collisionBoxArray.length;t.glyphOffsetArray.length>=ol.MAX_GLYPHS&&y("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==w.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,w.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,L.right>=0?L.right:-1,L.center>=0?L.center:-1,L.left>=0?L.left:-1,L.vertical||-1,D,F,O,$,Q,tt,et,rt,nt,it,ot,l,B,V,T,E,0,h,R,U)}(t,s,r,n,i,o,f,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,x,S,I,l,w,A,z,m,e,a,p,c)};if("line"===M)for(var E=0,B=function(t,e,n,i,o){for(var a=[],s=0;s<t.length;s++)for(var u=t[s],l=void 0,p=0;p<u.length-1;p++){var c=u[p],h=u[p+1];c.x<0&&h.x<0||(c.x<0?c=new r(0,c.y+(0-c.x)/(h.x-c.x)*(h.y-c.y))._round():h.x<0&&(h=new r(0,c.y+(0-c.x)/(h.x-c.x)*(h.y-c.y))._round()),c.y<0&&h.y<0||(c.y<0?c=new r(c.x+(0-c.y)/(h.y-c.y)*(h.x-c.x),0)._round():h.y<0&&(h=new r(c.x+(0-c.y)/(h.y-c.y)*(h.x-c.x),0)._round()),c.x>=i&&h.x>=i||(c.x>=i?c=new r(i,c.y+(i-c.x)/(h.x-c.x)*(h.y-c.y))._round():h.x>=i&&(h=new r(i,c.y+(i-c.x)/(h.x-c.x)*(h.y-c.y))._round()),c.y>=o&&h.y>=o||(c.y>=o?c=new r(c.x+(o-c.y)/(h.y-c.y)*(h.x-c.x),o)._round():h.y>=o&&(h=new r(c.x+(o-c.y)/(h.y-c.y)*(h.x-c.x),o)._round()),l&&c.equals(l[l.length-1])||a.push(l=[c]),l.push(h)))))}return a}(e.geometry,0,0,8192,8192);E<B.length;E+=1)for(var V=B[E],D=0,F=Vu(V,_,k,n.vertical||v,i,24,b,t.overscaling,8192);D<F.length;D+=1){var L=F[D];v&&Wu(t,v.text,P,L)||T(V,L)}else if("line-center"===M)for(var O=0,R=e.geometry;O<R.length;O+=1){var U=R[O];if(U.length>1){var j=Bu(U,k,n.vertical||v,i,24,b);j&&T(U,j)}}else if("Polygon"===e.type)for(var q=0,N=Qa(e.geometry,0);q<N.length;q+=1){var G=N[q],Z=Nu(G,16);T(G[0],new zu(Z.x,Z.y,0))}else if("LineString"===e.type)for(var X=0,Y=e.geometry;X<Y.length;X+=1){var J=Y[X];T(J,new zu(J[0].x,J[0].y,0))}else if("Point"===e.type)for(var K=0,H=e.geometry;K<H.length;K+=1)for(var W=0,$=H[K];W<$.length;W+=1){var Q=$[W];T([Q],new zu(Q.x,Q.y,0))}}(t,c,S,q,i,p,d,b,k,N,s)},w=0,_=t.features;w<_.length;w+=1)b();a&&t.generateCollisionDebugBuffers()}function Ju(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Ku(t,e,n,i,o,a,s,u,l,p,c,h,f,d,m){var v=function(t,e,n,i,o,a,s,u){for(var l=i.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,p=[],c=0,h=e.positionedLines;c<h.length;c+=1)for(var f=h[c],y=0,d=f.positionedGlyphs;y<d.length;y+=1){var m=d[y];if(m.rect){var v=m.rect||{},g=4,x=!0,b=1,w=0,_=(o||u)&&m.vertical,S=m.metrics.advance*m.scale/2;if(u&&e.verticalizable&&(w=f.lineOffset/2-(m.imageName?-(24-m.metrics.width*m.scale)/2:24*(m.scale-1))),m.imageName){var A=s[m.imageName];x=A.sdf,g=1/(b=A.pixelRatio)}var k=o?[m.x+S,m.y]:[0,0],I=o?[0,0]:[m.x+S+n[0],m.y+n[1]-w],z=[0,0];_&&(z=I,I=[0,0]);var M=(m.metrics.left-g)*m.scale-S+I[0],P=(-m.metrics.top-g)*m.scale+I[1],C=M+v.w*m.scale/b,T=P+v.h*m.scale/b,E=new r(M,P),B=new r(C,P),V=new r(M,T),D=new r(C,T);if(_){var F=new r(-S,S- -17),L=-Math.PI/2,O=12-S,R=new r(22-O,-(m.imageName?O:0)),U=new(Function.prototype.bind.apply(r,[null].concat(z)));E._rotateAround(L,F)._add(R)._add(U),B._rotateAround(L,F)._add(R)._add(U),V._rotateAround(L,F)._add(R)._add(U),D._rotateAround(L,F)._add(R)._add(U)}if(l){var j=Math.sin(l),q=Math.cos(l),N=[q,-j,j,q];E._matMult(N),B._matMult(N),V._matMult(N),D._matMult(N)}var G=new r(0,0),Z=new r(0,0);p.push({tl:E,tr:B,bl:V,br:D,tex:v,writingMode:e.writingMode,glyphOffset:k,sectionIndex:m.sectionIndex,isSDF:x,pixelOffsetTL:G,pixelOffsetBR:Z,minFontScaleX:0,minFontScaleY:0})}}return p}(0,n,u,o,a,s,i,t.allowVerticalPlacement),g=t.textSizeData,x=null;"source"===g.kind?(x=[128*o.layout.get("text-size").evaluate(s,{})])[0]>32640&&y(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===g.kind&&((x=[128*d.compositeTextSizes[0].evaluate(s,{},m),128*d.compositeTextSizes[1].evaluate(s,{},m)])[0]>32640||x[1]>32640)&&y(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,v,x,u,a,s,p,e,l.lineStartIndex,l.lineLength,f,m);for(var b=0,w=c;b<w.length;b+=1)h[w[b]]=t.text.placedSymbolArray.length-1;return 4*v.length}function Hu(t){for(var e in t)return t[e];return null}function Wu(t,e,r,n){var i=t.compareText;if(e in i){for(var o=i[e],a=o.length-1;a>=0;a--)if(n.dist(o[a])<r)return!0}else i[e]=[];return i[e].push(n),!1}var $u=ms.VectorTileFeature.types,Qu=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function tl(t,e,r,n,i,o,a,s,u,l,p,c,h){var f=s?Math.min(32640,Math.round(s[0])):0,y=s?Math.min(32640,Math.round(s[1])):0;t.emplaceBack(e,r,Math.round(32*n),Math.round(32*i),o,a,(f<<1)+(u?1:0),y,16*l,16*p,256*c,256*h)}function el(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}function rl(t){for(var e=0,r=t.sections;e<r.length;e+=1)if(kn(r[e].text))return!0;return!1}var nl=function(t){this.layoutVertexArray=new Ui,this.indexArray=new Wi,this.programConfigurations=t,this.segments=new fo,this.dynamicLayoutVertexArray=new ji,this.opacityVertexArray=new qi,this.placedSymbolArray=new oo};nl.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length},nl.prototype.upload=function(t,e,r,n){this.isEmpty()||(r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Fs.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Ls.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,Qu,!0),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(t))},nl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Ke("SymbolBuffers",nl);var il=function(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new fo,this.collisionVertexArray=new Zi};il.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,Os.members,!0)},il.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Ke("CollisionBuffers",il);var ol=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[];var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Mu(this.zoom,e["text-size"]),this.iconSizeData=Mu(this.zoom,e["icon-size"]);var r=this.layers[0].layout,n=r.get("symbol-sort-key"),i=r.get("symbol-z-order");this.sortFeaturesByKey="viewport-y"!==i&&void 0!==n.constantOr(1),this.sortFeaturesByY=("viewport-y"===i||"auto"===i&&!this.sortFeaturesByKey)&&(r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement")),"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map((function(t){return fu[t]}))),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.sourceID=t.sourceID};ol.prototype.createArrays=function(){this.text=new nl(new Fo(Fs.members,this.layers,this.zoom,(function(t){return/^text/.test(t)}))),this.icon=new nl(new Fo(Fs.members,this.layers,this.zoom,(function(t){return/^icon/.test(t)}))),this.glyphOffsetArray=new uo,this.lineVertexArray=new lo,this.symbolInstances=new so},ol.prototype.calculateGlyphDependencies=function(t,e,r,n,i){for(var o=0;o<t.length;o++)if(e[t.charCodeAt(o)]=!0,(r||n)&&i){var a=qs[t.charAt(o)];a&&(e[a.charCodeAt(0)]=!0)}},ol.prototype.populate=function(t,e,r){var n=this.layers[0],i=n.layout,o=i.get("text-font"),a=i.get("text-field"),s=i.get("icon-image"),u=("constant"!==a.value.kind||a.value.value instanceof X&&!a.value.value.isEmpty()||a.value.value.toString().length>0)&&("constant"!==o.value.kind||o.value.value.length>0),l="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,p=i.get("symbol-sort-key");if(this.features=[],u||l){for(var c=e.iconDependencies,h=e.glyphDependencies,f=e.availableImages,y=new yi(this.zoom),d=0,m=t;d<m.length;d+=1){var v=m[d],g=v.feature,x=v.id,b=v.index,w=v.sourceLayerIndex,_=n._featureFilter.needGeometry,S={type:g.type,id:x,properties:g.properties,geometry:_?Uo(g):[]};if(n._featureFilter.filter(y,S,r)){_||(S.geometry=Uo(g));var A=void 0;if(u){var k=n.getValueAndResolveTokens("text-field",S,r,f),I=X.factory(k);rl(I)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===ci||this.hasRTLText&&fi.isParsed())&&(A=js(I,n,S))}var z=void 0;if(l){var M=n.getValueAndResolveTokens("icon-image",S,r,f);z=M instanceof Y?M:Y.fromString(M)}if(A||z){var P=this.sortFeaturesByKey?p.evaluate(S,{},r):void 0,C={id:x,text:A,icon:z,index:b,sourceLayerIndex:w,geometry:Uo(g),properties:g.properties,type:$u[g.type],sortKey:P};if(this.features.push(C),z&&(c[z.name]=!0),A){var T=o.evaluate(S,{},r).join(","),E="map"===i.get("text-rotation-alignment")&&"point"!==i.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(fu.vertical)>=0;for(var B=0,V=A.sections;B<V.length;B+=1){var D=V[B];if(D.image)c[D.image.name]=!0;else{var F=bn(A.toString()),L=D.fontStack||T,O=h[L]=h[L]||{};this.calculateGlyphDependencies(D.text,O,E,this.allowVerticalPlacement,F)}}}}}}"line"===i.get("symbol-placement")&&(this.features=function(t){var e={},r={},n=[],i=0;function o(e){n.push(t[e]),i++}function a(t,e,i){var o=r[t];return delete r[t],r[e]=o,n[o].geometry[0].pop(),n[o].geometry[0]=n[o].geometry[0].concat(i[0]),o}function s(t,r,i){var o=e[r];return delete e[r],e[t]=o,n[o].geometry[0].shift(),n[o].geometry[0]=i[0].concat(n[o].geometry[0]),o}function u(t,e,r){var n=r?e[0][e[0].length-1]:e[0][0];return t+":"+n.x+":"+n.y}for(var l=0;l<t.length;l++){var p=t[l],c=p.geometry,h=p.text?p.text.toString():null;if(h){var f=u(h,c),y=u(h,c,!0);if(f in r&&y in e&&r[f]!==e[y]){var d=s(f,y,c),m=a(f,y,n[d].geometry);delete e[f],delete r[y],r[u(h,n[m].geometry,!0)]=m,n[d].geometry=null}else f in r?a(f,y,c):y in e?s(f,y,c):(o(l),e[f]=i-1,r[y]=i-1)}else o(l)}return n.filter((function(t){return t.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(t,e){return t.sortKey-e.sortKey}))}},ol.prototype.update=function(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,r),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,r))},ol.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},ol.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},ol.prototype.upload=function(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t),this.textCollisionCircle.upload(t),this.iconCollisionCircle.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},ol.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy(),this.textCollisionCircle.destroy(),this.iconCollisionCircle.destroy()},ol.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},ol.prototype.addToLineVertexArray=function(t,e){var r=this.lineVertexArray.length;if(void 0!==t.segment){for(var n=t.dist(e[t.segment+1]),i=t.dist(e[t.segment]),o={},a=t.segment+1;a<e.length;a++)o[a]={x:e[a].x,y:e[a].y,tileUnitDistanceFromAnchor:n},a<e.length-1&&(n+=e[a+1].dist(e[a]));for(var s=t.segment||0;s>=0;s--)o[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var u=0;u<e.length;u++){var l=o[u];this.lineVertexArray.emplaceBack(l.x,l.y,l.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},ol.prototype.addSymbols=function(t,e,r,n,i,o,a,s,u,l,p,c){for(var h=t.indexArray,f=t.layoutVertexArray,y=t.segments.prepareSegment(4*e.length,f,h,o.sortKey),d=this.glyphOffsetArray.length,m=y.vertexLength,v=this.allowVerticalPlacement&&a===fu.vertical?Math.PI/2:0,g=o.text&&o.text.sections,x=0;x<e.length;x++){var b=e[x],w=b.tl,_=b.tr,S=b.bl,A=b.br,k=b.tex,I=b.pixelOffsetTL,z=b.pixelOffsetBR,M=b.minFontScaleX,P=b.minFontScaleY,C=b.glyphOffset,T=b.isSDF,E=b.sectionIndex,B=y.vertexLength,V=C[1];tl(f,s.x,s.y,w.x,V+w.y,k.x,k.y,r,T,I.x,I.y,M,P),tl(f,s.x,s.y,_.x,V+_.y,k.x+k.w,k.y,r,T,z.x,I.y,M,P),tl(f,s.x,s.y,S.x,V+S.y,k.x,k.y+k.h,r,T,I.x,z.y,M,P),tl(f,s.x,s.y,A.x,V+A.y,k.x+k.w,k.y+k.h,r,T,z.x,z.y,M,P),el(t.dynamicLayoutVertexArray,s,v),h.emplaceBack(B,B+1,B+2),h.emplaceBack(B+1,B+2,B+3),y.vertexLength+=4,y.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(C[0]),x!==e.length-1&&E===e[x+1].sectionIndex||t.programConfigurations.populatePaintArrays(f.length,o,o.index,{},c,g&&g[E])}t.placedSymbolArray.emplaceBack(s.x,s.y,d,this.glyphOffsetArray.length-d,m,u,l,s.segment,r?r[0]:0,r?r[1]:0,n[0],n[1],a,0,!1,0,p)},ol.prototype._addCollisionDebugVertex=function(t,e,r,n,i,o){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,n,i,Math.round(o.x),Math.round(o.y))},ol.prototype.addCollisionDebugVertices=function(t,e,n,i,o,a,s,u){var l=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),p=l.vertexLength,c=o.layoutVertexArray,h=o.collisionVertexArray,f=s.anchorX,y=s.anchorY;if(this._addCollisionDebugVertex(c,h,a,f,y,new r(t,e)),this._addCollisionDebugVertex(c,h,a,f,y,new r(n,e)),this._addCollisionDebugVertex(c,h,a,f,y,new r(n,i)),this._addCollisionDebugVertex(c,h,a,f,y,new r(t,i)),l.vertexLength+=4,u){var d=o.indexArray;d.emplaceBack(p,p+1,p+2),d.emplaceBack(p,p+2,p+3),l.primitiveLength+=2}else{var m=o.indexArray;m.emplaceBack(p,p+1),m.emplaceBack(p+1,p+2),m.emplaceBack(p+2,p+3),m.emplaceBack(p+3,p),l.primitiveLength+=4}},ol.prototype.addDebugCollisionBoxes=function(t,e,r,n){for(var i=t;i<e;i++){var o=this.collisionBoxArray.get(i),a=o.radius>0;this.addCollisionDebugVertices(o.x1,o.y1,o.x2,o.y2,a?n?this.textCollisionCircle:this.iconCollisionCircle:n?this.textCollisionBox:this.iconCollisionBox,o.anchorPoint,r,a)}},ol.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new il(Gi,Rs.members,$i),this.iconCollisionBox=new il(Gi,Rs.members,$i),this.textCollisionCircle=new il(Gi,Us.members,Wi),this.iconCollisionCircle=new il(Gi,Us.members,Wi);for(var t=0;t<this.symbolInstances.length;t++){var e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1)}},ol.prototype._deserializeCollisionBoxesForSymbol=function(t,e,r,n,i,o,a,s,u){for(var l={},p=e;p<r;p++){var c=t.get(p);if(0===c.radius){l.textBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},l.textFeatureIndex=c.featureIndex;break}l.textCircles||(l.textCircles=[],l.textFeatureIndex=c.featureIndex),l.textCircles.push(c.anchorPointX,c.anchorPointY,c.radius,c.signedDistanceFromAnchor,1)}for(var h=n;h<i;h++){var f=t.get(h);if(0===f.radius){l.verticalTextBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},l.verticalTextFeatureIndex=f.featureIndex;break}}for(var y=o;y<a;y++){var d=t.get(y);if(0===d.radius){l.iconBox={x1:d.x1,y1:d.y1,x2:d.x2,y2:d.y2,anchorPointX:d.anchorPointX,anchorPointY:d.anchorPointY},l.iconFeatureIndex=d.featureIndex;break}}for(var m=s;m<u;m++){var v=t.get(m);if(0===v.radius){l.verticalIconBox={x1:v.x1,y1:v.y1,x2:v.x2,y2:v.y2,anchorPointX:v.anchorPointX,anchorPointY:v.anchorPointY},l.verticalIconFeatureIndex=v.featureIndex;break}}return l},ol.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}},ol.prototype.hasTextData=function(){return this.text.segments.get().length>0},ol.prototype.hasIconData=function(){return this.icon.segments.get().length>0},ol.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox&&this.textCollisionCircle&&this.iconCollisionCircle},ol.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},ol.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},ol.prototype.hasTextCollisionCircleData=function(){return this.hasDebugData()&&this.textCollisionCircle.segments.get().length>0},ol.prototype.hasIconCollisionCircleData=function(){return this.hasDebugData()&&this.iconCollisionCircle.segments.get().length>0},ol.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i<n;i+=4)t.indexArray.emplaceBack(i,i+1,i+2),t.indexArray.emplaceBack(i+1,i+2,i+3)},ol.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var e=Math.sin(t),r=Math.cos(t),n=[],i=[],o=[],a=0;a<this.symbolInstances.length;++a){o.push(a);var s=this.symbolInstances.get(a);n.push(0|Math.round(e*s.anchorX+r*s.anchorY)),i.push(s.featureIndex)}return o.sort((function(t,e){return n[t]-n[e]||i[e]-i[t]})),o},ol.prototype.addToSortKeyRanges=function(t,e){var r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})},ol.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r<n.length;r+=1){var i=this.symbolInstances.get(n[r]);this.featureSortOrder.push(i.featureIndex),[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex].forEach((function(t,r,n){t>=0&&n.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t)})),i.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,i.verticalPlacedTextSymbolIndex),i.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.placedIconSymbolIndex),i.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Ke("SymbolBucket",ol,{omit:["layers","collisionBoxArray","features","compareText"]}),ol.MAX_GLYPHS=65535,ol.addDynamicAttributes=el;var al=new Mi({"symbol-placement":new Si(nr.layout_symbol["symbol-placement"]),"symbol-spacing":new Si(nr.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Si(nr.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ai(nr.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Si(nr.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Si(nr.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Si(nr.layout_symbol["icon-ignore-placement"]),"icon-optional":new Si(nr.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Si(nr.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ai(nr.layout_symbol["icon-size"]),"icon-text-fit":new Si(nr.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Si(nr.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ai(nr.layout_symbol["icon-image"]),"icon-rotate":new Ai(nr.layout_symbol["icon-rotate"]),"icon-padding":new Si(nr.layout_symbol["icon-padding"]),"icon-keep-upright":new Si(nr.layout_symbol["icon-keep-upright"]),"icon-offset":new Ai(nr.layout_symbol["icon-offset"]),"icon-anchor":new Ai(nr.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Si(nr.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Si(nr.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Si(nr.layout_symbol["text-rotation-alignment"]),"text-field":new Ai(nr.layout_symbol["text-field"]),"text-font":new Ai(nr.layout_symbol["text-font"]),"text-size":new Ai(nr.layout_symbol["text-size"]),"text-max-width":new Ai(nr.layout_symbol["text-max-width"]),"text-line-height":new Si(nr.layout_symbol["text-line-height"]),"text-letter-spacing":new Ai(nr.layout_symbol["text-letter-spacing"]),"text-justify":new Ai(nr.layout_symbol["text-justify"]),"text-radial-offset":new Ai(nr.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Si(nr.layout_symbol["text-variable-anchor"]),"text-anchor":new Ai(nr.layout_symbol["text-anchor"]),"text-max-angle":new Si(nr.layout_symbol["text-max-angle"]),"text-writing-mode":new Si(nr.layout_symbol["text-writing-mode"]),"text-rotate":new Ai(nr.layout_symbol["text-rotate"]),"text-padding":new Si(nr.layout_symbol["text-padding"]),"text-keep-upright":new Si(nr.layout_symbol["text-keep-upright"]),"text-transform":new Ai(nr.layout_symbol["text-transform"]),"text-offset":new Ai(nr.layout_symbol["text-offset"]),"text-allow-overlap":new Si(nr.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Si(nr.layout_symbol["text-ignore-placement"]),"text-optional":new Si(nr.layout_symbol["text-optional"])}),sl={paint:new Mi({"icon-opacity":new Ai(nr.paint_symbol["icon-opacity"]),"icon-color":new Ai(nr.paint_symbol["icon-color"]),"icon-halo-color":new Ai(nr.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ai(nr.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ai(nr.paint_symbol["icon-halo-blur"]),"icon-translate":new Si(nr.paint_symbol["icon-translate"]),"icon-translate-anchor":new Si(nr.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ai(nr.paint_symbol["text-opacity"]),"text-color":new Ai(nr.paint_symbol["text-color"],{runtimeType:V,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new Ai(nr.paint_symbol["text-halo-color"]),"text-halo-width":new Ai(nr.paint_symbol["text-halo-width"]),"text-halo-blur":new Ai(nr.paint_symbol["text-halo-blur"]),"text-translate":new Si(nr.paint_symbol["text-translate"]),"text-translate-anchor":new Si(nr.paint_symbol["text-translate-anchor"])}),layout:al},ul=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:C,this.defaultValue=t};ul.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},ul.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},ul.prototype.outputDefined=function(){return!1},ul.prototype.serialize=function(){return null},Ke("FormatSectionOverride",ul,{omit:["defaultValue"]});var ll=function(t){function e(e){t.call(this,e,sl)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],o=0,a=n;o<a.length;o+=1){var s=a[o];i.indexOf(s)<0&&i.push(s)}this.layout._values["text-writing-mode"]=i}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},e.prototype.getValueAndResolveTokens=function(t,e,r,n){var i=this.layout.get(t).evaluate(e,{},r,n),o=this._unevaluatedLayout._values[t];return o.isDataDriven()||Ue(o.value)||!i?i:function(t,e){return e.replace(/{([^{}]+)}/g,(function(e,r){return r in t?String(t[r]):""}))}(e.properties,i)},e.prototype.createBucket=function(t){return new ol(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype._setPaintOverrides=function(){for(var t=0,r=sl.paint.overridableProperties;t<r.length;t+=1){var n=r[t];if(e.hasPaintOverride(this.layout,n)){var i,o=this.paint.get(n),a=new ul(o),s=new Re(a,o.property.specification);i="constant"===o.value.kind||"source"===o.value.kind?new qe("source",s):new Ne("composite",s,o.value.zoomStops,o.value._interpolationType),this.paint._values[n]=new wi(o.property,i,o.parameters)}}},e.prototype._handleOverridablePaintPropertyUpdate=function(t,r,n){return!(!this.layout||r.isDataDriven()||n.isDataDriven())&&e.hasPaintOverride(this.layout,t)},e.hasPaintOverride=function(t,e){var r=t.get("text-field"),n=sl.paint.properties[e],i=!1,o=function(t){for(var e=0,r=t;e<r.length;e+=1)if(n.overrides&&n.overrides.hasOverride(r[e]))return void(i=!0)};if("constant"===r.value.kind&&r.value.value instanceof X)o(r.value.value.sections);else if("source"===r.value.kind){var a=function(t){i||(t instanceof $&&H(t.value)===O?o(t.value.sections):t instanceof rt?o(t.sections):t.eachChild(a))},s=r.value;s._styleExpression&&a(s._styleExpression.expression)}return i},e}(Pi),pl={paint:new Mi({"background-color":new Si(nr.paint_background["background-color"]),"background-pattern":new Ii(nr.paint_background["background-pattern"]),"background-opacity":new Si(nr.paint_background["background-opacity"])})},cl=function(t){function e(e){t.call(this,e,pl)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Pi),hl={paint:new Mi({"raster-opacity":new Si(nr.paint_raster["raster-opacity"]),"raster-hue-rotate":new Si(nr.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Si(nr.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Si(nr.paint_raster["raster-brightness-max"]),"raster-saturation":new Si(nr.paint_raster["raster-saturation"]),"raster-contrast":new Si(nr.paint_raster["raster-contrast"]),"raster-resampling":new Si(nr.paint_raster["raster-resampling"]),"raster-fade-duration":new Si(nr.paint_raster["raster-fade-duration"])})},fl=function(t){function e(e){t.call(this,e,hl)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Pi),yl=function(t){function e(e){t.call(this,e,{}),this.implementation=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.is3D=function(){return"3d"===this.implementation.renderingMode},e.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender},e.prototype.recalculate=function(){},e.prototype.updateTransitions=function(){},e.prototype.hasTransition=function(){},e.prototype.serialize=function(){},e.prototype.onAdd=function(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},e.prototype.onRemove=function(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},e}(Pi),dl={circle:ua,heatmap:ga,hillshade:ba,fill:as,"fill-extrusion":Ss,line:Vs,symbol:ll,background:cl,raster:fl};function ml(t){return"custom"===t.type?new yl(t):new dl[t.type](t)}var vl=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function gl(t){var e=typeof t;if("number"===e||"boolean"===e||"string"===e||null==t)return JSON.stringify(t);if(Array.isArray(t)){for(var r="[",n=0,i=t;n<i.length;n+=1)r+=gl(i[n])+",";return r+"]"}for(var o=Object.keys(t).sort(),a="{",s=0;s<o.length;s++)a+=JSON.stringify(o[s])+":"+gl(t[o[s]])+",";return a+"}"}function xl(t){for(var e="",r=0,n=vl;r<n.length;r+=1)e+="/"+gl(t[n[r]]);return e}var bl=function(t){this.keyCache={},t&&this.replace(t)};bl.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},bl.prototype.update=function(t,e){for(var r=this,n=0,i=t;n<i.length;n+=1){var a=i[n];this._layerConfigs[a.id]=a;var s=this._layers[a.id]=ml(a);s._featureFilter=mr(s.filter),this.keyCache[a.id]&&delete this.keyCache[a.id]}for(var u=0,l=e;u<l.length;u+=1){var p=l[u];delete this.keyCache[p],delete this._layerConfigs[p],delete this._layers[p]}this.familiesBySource={};for(var c=0,h=function(t,e){for(var r={},n=0;n<t.length;n++){var i=e&&e[t[n].id]||xl(t[n]);e&&(e[t[n].id]=i);var o=r[i];o||(o=r[i]=[]),o.push(t[n])}var a=[];for(var s in r)a.push(r[s]);return a}(o(this._layerConfigs),this.keyCache);c<h.length;c+=1){var f=h[c].map((function(t){return r._layers[t.id]})),y=f[0];if("none"!==y.visibility){var d=y.source||"",m=this.familiesBySource[d];m||(m=this.familiesBySource[d]={});var v=y.sourceLayer||"_geojsonTileLayer",g=m[v];g||(g=m[v]=[]),g.push(f)}}};var wl=function(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r}};wl.prototype.encode=function(t){return this._stringToNumber[t]},wl.prototype.decode=function(t){return this._numberToString[t]};var _l=function(t,e,r,n,i,o){this.epsg=o||"EPSG:3857",this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,this.id=i},Sl={geometry:{configurable:!0}};function Al(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}Sl.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z,this.epsg).geometry),this._geometry},Sl.geometry.set=function(t){this._geometry=t},_l.prototype.toJSON=function(){var t={geometry:this.geometry};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t},Object.defineProperties(_l.prototype,Sl);var kl=function t(e,r,n){this.epsgCode=e,this.extent=r,this.unit=n||"degree",t.set(this)};kl.prototype.getExtent=function(){if(!this._rectifyExtent){var t=this.extent[2]-this.extent[0],e=this.extent[3]-this.extent[1];if(t===e)this._rectifyExtent=[this.extent[0],this.extent[1],this.extent[2],this.extent[3]];else{var r=Math.max(t,e);this._rectifyExtent=[this.extent[0],this.extent[3]-r,this.extent[0]+r,this.extent[3]]}}return this._rectifyExtent},kl.prototype.getOrigin=function(){return[this.extent[0],this.extent[3]]},kl.prototype.getEpsgCode=function(){return this.epsgCode},kl.prototype.getUnit=function(){return this.unit},kl.get=function(t){for(var e in kl)if(kl.hasOwnProperty(e)&&kl[e].getEpsgCode&&kl[e].getEpsgCode()===t)return kl[e];return null},kl.set=function(t){var e=t.getEpsgCode().replace(":","").toUpperCase();kl[e]=t},kl.EPSG4326=new kl("EPSG:4326",[-180,-90,180,90]),kl.EPSG4214=new kl("EPSG:4214",[-180,-90,180,90]),kl.EPSG4490=new kl("EPSG:4490",[-180,-90,180,90]),kl.EPSG4610=new kl("EPSG:4610",[-180,-90,180,90]),kl.EPSG3857=new kl("EPSG:3857",[-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892]);var Il=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Pl(0,t,t,e,r),this.z_replace=void 0,this.x_replace=void 0,this.y_replace=void 0};Il.prototype.offsetZ=function(t){t&&(this.z+=t)},Il.prototype.replaceX=function(t){this.x_replace=t},Il.prototype.replaceY=function(t){this.y_replace=t},Il.prototype.replaceZ=function(t){this.z_replace=t},Il.prototype.format=function(t,e){var r=t.length;if(r>=e)t=t.substring(r-e,r);else{for(var n="",i=0;i<e;i++)n+="0";t=n.substring(0,n.length-r)+t}return t},Il.prototype.replaceRule=function(t,e){var r=t.fixlength,n=t.prefix,i=t.postfix,o=e;switch(t.type){case"hex":o=e.toString(16).toUpperCase();break;case"dec":o=e.toString(10).toUpperCase();break;case"oct":o=e.toString(8).toUpperCase();break;case"bin":o=e.toString(2).toUpperCase()}return r&&(o=this.format(o,r)),n&&(o=n+o),i&&(o+=i),o},Il.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Il.prototype.url=function(t,e){var r=this.x_replace,n=this.y_replace,i=this.z_replace,o=t[(this.x+this.y)%t.length],a=o.indexOf("reversebbox=true")>=0,s=this.getTileBBox(this.x,this.y,this.z);if(a){var u=s.split(",");s=u[1]+","+u[0]+","+u[3]+","+u[2],console.warn("reverse",s)}var l=function(t,e,r){for(var n,i="",o=t;o>0;o--)i+=(e&(n=1<<o-1)?1:0)+(r&n?2:0);return i}(this.z,this.x,this.y),p=this.z,c=this.x,h=this.y;return(r||n||i)&&(i&&(p=this.replaceRule(i,this.z)),r&&(c=this.replaceRule(r,this.x)),n&&(h=this.replaceRule(n,this.y))),o.replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(p)).replace("{x}",String(c)).replace("{y}",String("tms"===e?Math.pow(2,this.z)-this.y-1:h)).replace("{quadkey}",l).replace("{bbox}",s)},Il.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);return new r(8192*(t.x*e-this.x),8192*(t.y*e-this.y))},Il.prototype.getTileBBox=function(t,e,r){return function(t,e,r){var n=Al(256*t,256*(e=Math.pow(2,r)-e-1),r),i=Al(256*(t+1),256*(e+1),r);return n[0]+","+n[1]+","+i[0]+","+i[1]}(t,e,r)},Il.prototype.getCRS=function(){return kl.EPSG3857},Il.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var zl=function(t,e){this.wrap=t,this.canonical=e,this.key=Pl(t,e.z,e.z,e.x,e.y)},Ml=function(t,e,r,n,i){this.overscaledZ=t,this.wrap=e,this.canonical=new Il(r,+n,+i),this.key=Pl(e,t,r,n,i)};function Pl(t,e,r,n,i){(t*=2)<0&&(t=-1*t-1);var o=1<<r;return(o*o*t+o*i+n).toString(36)+r.toString(36)+e.toString(36)}Ml.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},Ml.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new Ml(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Ml(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Ml.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?Pl(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Pl(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},Ml.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e},Ml.prototype.children=function(t){if(this.overscaledZ>=t)return[new Ml(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new Ml(e,this.wrap,e,r,n),new Ml(e,this.wrap,e,r+1,n),new Ml(e,this.wrap,e,r,n+1),new Ml(e,this.wrap,e,r+1,n+1)]},Ml.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},Ml.prototype.wrapped=function(){return new Ml(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Ml.prototype.unwrapTo=function(t){return new Ml(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},Ml.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Ml.prototype.toUnwrapped=function(){return new zl(this.wrap,this.canonical)},Ml.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Ml.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new vt(t.x-this.wrap,t.y))},Ke("CanonicalTileID",Il),Ke("OverscaledTileID",Ml,{omit:["posMatrix"]});var Cl=self.HTMLImageElement,Tl=self.HTMLCanvasElement,El=self.HTMLVideoElement,Bl=self.ImageData,Vl=self.ImageBitmap,Dl=function(t,e,r,n){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this.update(e,n)};Dl.prototype.update=function(t,e,r){var n=t.width,i=t.height,o=!(this.size&&this.size[0]===n&&this.size[1]===i||r),a=this.context,s=a.gl;if(this.useMipmap=Boolean(e&&e.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),a.pixelStoreUnpackFlipY.set(!1),a.pixelStoreUnpack.set(1),a.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!e||!1!==e.premultiply)),o)this.size=[n,i],t instanceof Cl||t instanceof Tl||t instanceof El||t instanceof Bl||Vl&&t instanceof Vl?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,t):s.texImage2D(s.TEXTURE_2D,0,this.format,n,i,0,this.format,s.UNSIGNED_BYTE,t.data);else{var u=r||{x:0,y:0},l=u.x,p=u.y;t instanceof Cl||t instanceof Tl||t instanceof El||t instanceof Bl||Vl&&t instanceof Vl?s.texSubImage2D(s.TEXTURE_2D,0,l,p,s.RGBA,s.UNSIGNED_BYTE,t):s.texSubImage2D(s.TEXTURE_2D,0,l,p,n,i,s.RGBA,s.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D)},Dl.prototype.bind=function(t,e,r){var n=this.context.gl;n.bindTexture(n.TEXTURE_2D,this.texture),r!==n.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=n.LINEAR),t!==this.filter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,r||t),this.filter=t),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e)},Dl.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},Dl.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var Fl=function(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new _(8192,16,0),this.grid3D=new _(8192,16,0),this.featureIndexArray=new co,this.promoteId=e};function Ll(t,e,r,n,i){return c(t,(function(t,o){var a=e instanceof _i?e.get(o):null;return a&&a.evaluate?a.evaluate(r,n,i):a}))}function Ol(t){for(var e=1/0,r=1/0,n=-1/0,i=-1/0,o=0,a=t;o<a.length;o+=1){var s=a[o];e=Math.min(e,s.x),r=Math.min(r,s.y),n=Math.max(n,s.x),i=Math.max(i,s.y)}return{minX:e,minY:r,maxX:n,maxY:i}}function Rl(t,e){return e-t}Fl.prototype.insert=function(t,e,r,n,i,o){var a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);for(var s=o?this.grid3D:this.grid,u=0;u<e.length;u++){for(var l=e[u],p=[1/0,1/0,-1/0,-1/0],c=0;c<l.length;c++){var h=l[c];p[0]=Math.min(p[0],h.x),p[1]=Math.min(p[1],h.y),p[2]=Math.max(p[2],h.x),p[3]=Math.max(p[3],h.y)}p[0]<8192&&p[1]<8192&&p[2]>=0&&p[3]>=0&&s.insert(a,p[0],p[1],p[2],p[3])}},Fl.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new ms.VectorTile(new Zs(this.rawTileData)).layers,this.sourceLayerCoder=new wl(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Fl.prototype.query=function(t,e,n,i){var o=this;this.loadVTLayers();for(var a=t.params||{},s=8192/t.tileSize/t.scale,u=mr(a.filter),l=t.queryGeometry,p=t.queryPadding*s,c=Ol(l),h=this.grid.query(c.minX-p,c.minY-p,c.maxX+p,c.maxY+p),f=Ol(t.cameraQueryGeometry),y=this.grid3D.query(f.minX-p,f.minY-p,f.maxX+p,f.maxY+p,(function(e,n,i,o){return function(t,e,n,i,o){for(var a=0,s=t;a<s.length;a+=1){var u=s[a];if(e<=u.x&&n<=u.y&&i>=u.x&&o>=u.y)return!0}var l=[new r(e,n),new r(e,o),new r(i,o),new r(i,n)];if(t.length>2)for(var p=0,c=l;p<c.length;p+=1)if($o(t,c[p]))return!0;for(var h=0;h<t.length-1;h++)if(Qo(t[h],t[h+1],l))return!0;return!1}(t.cameraQueryGeometry,e-p,n-p,i+p,o+p)})),d=0,m=y;d<m.length;d+=1)h.push(m[d]);h.sort(Rl);for(var v,g={},x=function(r){var p=h[r];if(p!==v){v=p;var c=o.featureIndexArray.get(p),f=null;o.loadMatchingFeature(g,c.bucketIndex,c.sourceLayerIndex,c.featureIndex,u,a.layers,a.availableImages,e,n,i,(function(e,r,n){return f||(f=Uo(e)),r.queryIntersectsFeature(l,e,n,f,o.z,t.transform,s,t.pixelPosMatrix)}))}},b=0;b<h.length;b++)x(b);return g},Fl.prototype.loadMatchingFeature=function(t,e,r,n,i,o,a,s,u,l,p){var c=this.bucketLayerIDs[e];if(!o||function(t,e){for(var r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return!0;return!1}(o,c)){var h=this.sourceLayerCoder.decode(r),f=this.vtLayers[h].feature(n);if(i.filter(new yi(this.tileID.overscaledZ),f))for(var y=this.getId(f,h),d=new Il(0,0,0),m=0;m<c.length;m++){var v=c[m];if(!(o&&o.indexOf(v)<0)){var g=s[v];if(g){var x={};void 0!==y&&l&&(x=l.getState(g.sourceLayer||"_geojsonTileLayer",y));var b=u[v];b.paint=Ll(b.paint,g.paint,f,x,a),b.layout=Ll(b.layout,g.layout,f,x,a);var w=!p||p(f,g,x);if(w){var _=new _l(f,this.z,this.x,this.y,y,d.getCRS().getEpsgCode());_.layer=b;var S=t[v];void 0===S&&(S=t[v]=[]),S.push({featureIndex:n,feature:_,intersectionZ:w})}}}}}},Fl.prototype.lookupSymbolFeatures=function(t,e,r,n,i,o,a,s){var u={};this.loadVTLayers();for(var l=mr(i),p=0,c=t;p<c.length;p+=1)this.loadMatchingFeature(u,r,n,c[p],l,o,a,s,e);return u},Fl.prototype.hasLayer=function(t){for(var e=0,r=this.bucketLayerIDs;e<r.length;e+=1)for(var n=0,i=r[e];n<i.length;n+=1)if(t===i[n])return!0;return!1},Fl.prototype.getId=function(t,e){var r=t.id;return this.promoteId&&"boolean"==typeof(r=t.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[e]])&&(r=Number(r)),r},Ke("FeatureIndex",Fl,{omit:["rawTileData","sourceLayerCoder"]});var Ul=function(t){var e={},r=[];for(var n in t){var i=t[n],o=e[n]={};for(var a in i){var s=i[+a];if(s&&0!==s.bitmap.width&&0!==s.bitmap.height){var u={x:0,y:0,w:s.bitmap.width+2,h:s.bitmap.height+2};r.push(u),o[a]={rect:u,metrics:s.metrics}}}}var l=lu(r),p=new ya({width:l.w||1,height:l.h||1});for(var c in t){var h=t[c];for(var f in h){var y=h[+f];if(y&&0!==y.bitmap.width&&0!==y.bitmap.height){var d=e[c][f].rect;ya.copy(y.bitmap,p,{x:0,y:0},{x:d.x+1,y:d.y+1},y.bitmap)}}}this.image=p,this.positions=e};Ke("GlyphAtlas",Ul);var jl=function(t){this.tileID=new Ml(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId};function ql(t,e,r){for(var n=new yi(e),i=0,o=t;i<o.length;i+=1)o[i].recalculate(n,r)}jl.prototype.parse=function(t,e,r,n,i){var a=this;this.status="parsing",this.data=t,this.collisionBoxArray=new no;var s=new wl(Object.keys(t.layers).sort()),u=new Fl(this.tileID,this.promoteId);u.bucketLayerIDs=[];var l,p,h,f,d={},m={featureIndex:u,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:r},v=e.familiesBySource[this.source];for(var g in v){var x=t.layers[g];if(x){1===x.version&&y('Vector tile source "'+this.source+'" layer "'+g+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var b=s.encode(g),w=[],_=0;_<x.length;_++){var S=x.feature(_),A=u.getId(S,g);w.push({feature:S,id:A,index:_,sourceLayerIndex:b})}for(var k=0,I=v[g];k<I.length;k+=1){var z=I[k],M=z[0];M.minzoom&&this.zoom<Math.floor(M.minzoom)||M.maxzoom&&this.zoom>=M.maxzoom||"none"!==M.visibility&&(ql(z,this.zoom,r),(d[M.id]=M.createBucket({index:u.bucketLayerIDs.length,layers:z,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:b,sourceID:this.source})).populate(w,m,this.tileID.canonical),u.bucketLayerIDs.push(z.map((function(t){return t.id}))))}}}var P=c(m.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(P).length?n.send("getGlyphs",{uid:this.uid,stacks:P},(function(t,e){l||(l=t,p=e,E.call(a))})):p={};var C=Object.keys(m.iconDependencies);C.length?n.send("getImages",{icons:C,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){l||(l=t,h=e,E.call(a))})):h={};var T=Object.keys(m.patternDependencies);function E(){if(l)return i(l);if(p&&h&&f){var t=new Ul(p),e=new hu(h,f);for(var n in d){var a=d[n];a instanceof ol?(ql(a.layers,this.zoom,r),Yu(a,p,t.positions,h,e.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):a.hasPattern&&(a instanceof Cs||a instanceof ns||a instanceof bs)&&(ql(a.layers,this.zoom,r),a.addFeatures(m,this.tileID.canonical,e.patternPositions))}this.status="done",i(null,{buckets:o(d).filter((function(t){return!t.isEmpty()})),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:e,glyphMap:this.returnDependencies?p:null,iconMap:this.returnDependencies?h:null,glyphPositions:this.returnDependencies?t.positions:null})}}T.length?n.send("getImages",{icons:T,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){l||(l=t,f=e,E.call(a))})):f={},E.call(this)};var Nl=self.performance,Gl=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},Nl.mark(this._marks.start)};function Zl(t,e){var r=ui(t.request,(function(t,r,n,i){t?e(t):r&&e(null,{vectorTile:new ms.VectorTile(new Zs(r)),rawData:r,cacheControl:n,expires:i})}));return function(){r.cancel(),e()}}Gl.prototype.finish=function(){Nl.mark(this._marks.end);var t=Nl.getEntriesByName(this._marks.measure);return 0===t.length&&(Nl.measure(this._marks.measure,this._marks.start,this._marks.end),t=Nl.getEntriesByName(this._marks.measure),Nl.clearMarks(this._marks.start),Nl.clearMarks(this._marks.end),Nl.clearMeasures(this._marks.measure)),t};var Xl=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||Zl,this.loading={},this.loaded={}};Xl.prototype.loadTile=function(t,e){var r=this,n=t.uid;this.loading||(this.loading={});var i=!!(t&&t.request&&t.request.collectResourceTiming)&&new Gl(t.request),o=this.loading[n]=new jl(t);o.abort=this.loadVectorData(t,(function(t,s){if(delete r.loading[n],t||!s)return o.status="done",r.loaded[n]=o,e(t);var u=s.rawData,l={};s.expires&&(l.expires=s.expires),s.cacheControl&&(l.cacheControl=s.cacheControl);var p={};if(i){var c=i.finish();c&&(p.resourceTiming=JSON.parse(JSON.stringify(c)))}o.vectorTile=s.vectorTile,o.parse(s.vectorTile,r.layerIndex,r.availableImages,r.actor,(function(t,r){if(t||!r)return e(t);e(null,a({rawTileData:u.slice(0)},r,l,p))})),r.loaded=r.loaded||{},r.loaded[n]=o}))},Xl.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,i=t.uid,o=this;if(n&&n[i]){var a=n[i];a.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var i=a.reloadCallback;i&&(delete a.reloadCallback,a.parse(a.vectorTile,o.layerIndex,r.availableImages,o.actor,i)),e(t,n)};"parsing"===a.status?a.reloadCallback=s:"done"===a.status&&(a.vectorTile?a.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},Xl.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},Xl.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var Yl=function(t,e,r){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return y('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=e.height;var n=this.dim=e.height-2;this.data=new Uint32Array(e.data.buffer),this.encoding=r||"mapbox";for(var i=0;i<n;i++)this.data[this._idx(-1,i)]=this.data[this._idx(0,i)],this.data[this._idx(n,i)]=this.data[this._idx(n-1,i)],this.data[this._idx(i,-1)]=this.data[this._idx(i,0)],this.data[this._idx(i,n)]=this.data[this._idx(i,n-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(n,-1)]=this.data[this._idx(n-1,0)],this.data[this._idx(-1,n)]=this.data[this._idx(0,n-1)],this.data[this._idx(n,n)]=this.data[this._idx(n-1,n-1)]};Yl.prototype.get=function(t,e){var r=new Uint8Array(this.data.buffer),n=4*this._idx(t,e);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(r[n],r[n+1],r[n+2])},Yl.prototype.getUnpackVector=function(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Yl.prototype._idx=function(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},Yl.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Yl.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Yl.prototype.getPixels=function(){return new da({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Yl.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,i=e*this.dim+this.dim,o=r*this.dim,a=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:o=a-1;break;case 1:a=o+1}for(var s=-e*this.dim,u=-r*this.dim,l=o;l<a;l++)for(var p=n;p<i;p++)this.data[this._idx(p,l)]=t.data[this._idx(p+s,l+u)]},Ke("DEMData",Yl);var Jl=self.ImageBitmap,Kl=function(){this.loaded={}};Kl.prototype.loadTile=function(t,e){var r=t.uid,n=t.encoding,i=t.rawImageData,o=Jl&&i instanceof Jl?this.getImageData(i):i,a=new Yl(r,o,n);this.loaded=this.loaded||{},this.loaded[r]=a,e(null,a)},Kl.prototype.getImageData=function(t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(t.width,t.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=t.width,this.offscreenCanvas.height=t.height,this.offscreenCanvasContext.drawImage(t,0,0,t.width,t.height);var e=this.offscreenCanvasContext.getImageData(-1,-1,t.width+2,t.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new da({width:e.width,height:e.height},e.data)},Kl.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var Hl=function(t,e,r){this.bounds=pt.convert(this.validateBounds(t)),this.minzoom=e||0,this.maxzoom=r||24};Hl.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},Hl.prototype.contains=function(t){var e=Math.pow(2,t.z),r=Math.floor(yt(this.bounds.getWest())*e),n=Math.floor(dt(this.bounds.getNorth())*e),i=Math.ceil(yt(this.bounds.getEast())*e),o=Math.ceil(dt(this.bounds.getSouth())*e);return t.x>=r&&t.x<i&&t.y>=n&&t.y<o};var Wl=function(t){function e(e,r,n,i){t.call(this),this.id=e,this.dispatcher=n,this.setEventedParent(i),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=a({type:"raster"},r),a(this,s(r,["url","scheme","tileSize"]))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.load=function(){var t,e,r,n,i=this;this._loaded=!1,this.fire(new Ur("dataloading",{dataType:"source"})),this._tileJSONRequest=(e=this.map._requestManager,r=function(t,e){i._tileJSONRequest=null,i._loaded=!0,t?i.fire(new jr(t)):e&&(a(i,e),e.bounds&&(i.tileBounds=new Hl(e.bounds,i.minzoom,i.maxzoom)),Jn(e.tiles),Hn(e.tiles,i.map._getMapId(),i.map._requestManager._skuToken),i.fire(new Ur("data",{dataType:"source",sourceDataType:"metadata"})),i.fire(new Ur("data",{dataType:"source",sourceDataType:"content"})))},n=function(n,i){if(n)return r(n);if(i){var o=s(a(i,t),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);i.vector_layers&&(o.vectorLayers=i.vector_layers,o.vectorLayerIds=o.vectorLayers.map((function(t){return t.id}))),o.tiles=e.canonicalizeTileset(o,t.url),r(null,o)}},(t=this._options).url?si(e.transformRequest(e.normalizeSourceURL(t.url),ei.Source),n):Vn.frame((function(){return n(null,t)})))},e.prototype.loaded=function(){return this._loaded},e.prototype.onAdd=function(t){this.map=t,this.load()},e.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},e.prototype.serialize=function(){return a({},this._options)},e.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},e.prototype.loadTile=function(t,e){var r=this,n=this._options.tileUrlReplace;n&&n.length>=3&&(t.tileID.canonical.replaceX(n[0]),t.tileID.canonical.replaceY(n[1]),t.tileID.canonical.replaceZ(n[2])),t.tileID.canonical.offsetZ(this._options.mapgisOffset);var i=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);t.tileID.canonical.offsetZ(0-this._options.mapgisOffset),t.request=pi(this.map._requestManager.transformRequest(i,ei.Tile),(function(n,i){if(delete t.request,t.aborted)t.state="unloaded",e(null);else if(n)t.state="errored",e(n);else if(i){r.map._refreshExpiredTiles&&t.setExpiryData(i),delete i.cacheControl,delete i.expires;var o=r.map.painter.context,a=o.gl;t.texture=r.map.painter.getTileTexture(i.width),t.texture?t.texture.update(i,{useMipmap:!0}):(t.texture=new Dl(o,i,a.RGBA,{useMipmap:!0}),t.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),o.extTextureFilterAnisotropic&&a.texParameterf(a.TEXTURE_2D,o.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,o.extTextureFilterAnisotropicMax)),t.state="loaded",++ti>50&&(r.dispatcher.getActor().send("enforceCacheSizeLimit",500),ti=0),e(null)}}))},e.prototype.abortTile=function(t,e){t.request&&(t.request.cancel(),delete t.request),e()},e.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e()},e.prototype.hasTransition=function(){return!1},e}(qr),$l=function(){};$l.openDatabase=function(t){var e=t.split("/").slice(-1)[0],r=this;return console.log("openDatabase",self),"sqlitePlugin"in self?"device"in self?new Promise((function(t,e){"Android"===device.platform?resolveLocalFileSystemURL(cordova.file.applicationStorageDirectory,(function(e){e.getDirectory("databases",{create:!0},(function(e){t(e)}))}),e):"iOS"===device.platform?resolveLocalFileSystemURL(cordova.file.documentsDirectory,t,e):e("Platform not supported")})).then((function(n){return new Promise((function(t,r){n.getFile(e,{},t,r)})).catch((function(){return r.copyDatabaseFile(t,e,n)}))})).then((function(){var t={name:e};return"iOS"===device.platform?t.iosDatabaseLocation="Documents":t.location="default",sqlitePlugin.openDatabase(t)})):Promise.reject(new Error("cordova-plugin-device not available. Please install the plugin and make sure this code is run after onDeviceReady event")):Promise.reject(new Error("cordova-sqlite-ext plugin not available. Please install the plugin and make sure this code is run after onDeviceReady event"))},$l.copyDatabaseFile=function(t,e,r){return console.log("Copying database to application storage directory"),new Promise((function(e,r){var n=cordova.file.externalRootDirectory+"/"+t;resolveLocalFileSystemURL(n,e,r)})).then((function(t){return new Promise((function(n,i){t.copyTo(r,e,n,i)})).then((function(){console.log("Database copied")}))}))};var Ql=function(t){function e(e,r,n,i){t.call(this,e,r,n,i),this.id=e,this.dispatcher=n,this.setEventedParent(i),this.type="rasteroffline",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this.imageFormat="png",this._loaded=!1,this._options=a({},r),a(this,s(r,["scheme","tileSize","imageFormat"])),this._transparentPngUrl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=",this.db=this.openDatabase(r.path)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.openDatabase=function(t){return $l.openDatabase(t)},e.prototype.copyDatabaseFile=function(t,e,r){return $l.copyDatabaseFile(t,e,r)},e.prototype.loadTile=function(t,e){t.request=this._getImage(t.tileID.canonical,function(r,n){if(delete t.request,t.aborted)t.state="unloaded",e(null);else if(r)t.state="errored",e(r);else if(n){this.map._refreshExpiredTiles&&t.setExpiryData(n),delete n.cacheControl,delete n.expires;var i=this.map.painter.context,o=i.gl;t.texture=this.map.painter.getTileTexture(n.width),t.texture?t.texture.update(n,{useMipmap:!0}):(t.texture=new Dl(i,n,o.RGBA,{useMipmap:!0}),t.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),i.extTextureFilterAnisotropic&&o.texParameterf(o.TEXTURE_2D,i.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,i.extTextureFilterAnisotropicMax)),t.state="loaded",e(null)}}.bind(this))},e.prototype._getBlob=function(t,e){var r=this,n=Math.pow(2,t.z)-1-t.y,i=[t.z,t.x,n],o="data:image/"+this.imageFormat+";base64,";this.db.then((function(t){t.transaction((function(t){t.executeSql("SELECT BASE64(tile_data) AS base64_tile_data FROM tiles WHERE zoom_level = ? AND tile_column = ? AND tile_row = ?",i,(function(t,n){n.rows.length?e(void 0,{data:o+n.rows.item(0).base64_tile_data,cacheControl:null,expires:null}):(console.error("tile "+i.join(",")+" not found"),e(void 0,{data:r._transparentPngUrl,cacheControl:null,expires:null}))}))}),(function(t){e(t)}))})).catch((function(t){e(t)}))},e.prototype._getImage=function(t,e){return this._getBlob(t,(function(t,r){if(t)return e(t);var n=new window.Image,i=window.URL||window.webkitURL;n.onload=function(){e(null,n),i.revokeObjectURL(n.src)},n.cacheControl=r.cacheControl,n.expires=r.expires,n.src=r.data}))},e}(Wl);function tp(t,e){if(0!==t.length){ep(t[0],e);for(var r=1;r<t.length;r++)ep(t[r],!e)}}function ep(t,e){for(var r=0,n=0,i=0,o=t.length,a=o-1;i<o;a=i++){var s=(t[i][0]-t[a][0])*(t[a][1]+t[i][1]),u=r+s;n+=Math.abs(r)>=Math.abs(s)?r-u+s:s-u+r,r=u}r+n>=0!=!!e&&t.reverse()}var rp=ms.VectorTileFeature.prototype.toGeoJSON,np=function(t){this._feature=t,this.extent=8192,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))};np.prototype.loadGeometry=function(){if(1===this._feature.type){for(var t=[],e=0,n=this._feature.geometry;e<n.length;e+=1){var i=n[e];t.push([new r(i[0],i[1])])}return t}for(var o=[],a=0,s=this._feature.geometry;a<s.length;a+=1){for(var u=[],l=0,p=s[a];l<p.length;l+=1){var c=p[l];u.push(new r(c[0],c[1]))}o.push(u)}return o},np.prototype.toGeoJSON=function(t,e,r,n){return rp.call(this,t,e,r,n)};var ip=function(t){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=8192,this.length=t.length,this._features=t};ip.prototype.feature=function(t){return new np(this._features[t])};var op=ms.VectorTileFeature,ap=sp;function sp(t,e){this.options=e||{},this.features=t,this.length=t.length}function up(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}sp.prototype.feature=function(t){return new up(this.features[t],this.options.extent)},up.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var n=t[e],i=[],o=0;o<n.length;o++)i.push(new r(n[o][0],n[o][1]));this.geometry.push(i)}return this.geometry},up.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-1/0,n=1/0,i=-1/0,o=0;o<t.length;o++)for(var a=t[o],s=0;s<a.length;s++){var u=a[s];e=Math.min(e,u.x),r=Math.max(r,u.x),n=Math.min(n,u.y),i=Math.max(i,u.y)}return[e,n,r,i]},up.prototype.toGeoJSON=op.prototype.toGeoJSON;var lp=cp,pp=ap;function cp(t){var e=new Zs;return function(t,e){for(var r in t.layers)e.writeMessage(3,hp,t.layers[r])}(t,e),e.finish()}function hp(t,e){var r;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var n={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<t.length;r++)n.feature=t.feature(r),e.writeMessage(2,fp,n);var i=n.keys;for(r=0;r<i.length;r++)e.writeStringField(3,i[r]);var o=n.values;for(r=0;r<o.length;r++)e.writeMessage(4,gp,o[r])}function fp(t,e){var r=t.feature;void 0!==r.id&&e.writeVarintField(1,r.id),e.writeMessage(2,yp,t),e.writeVarintField(3,r.type),e.writeMessage(4,vp,r)}function yp(t,e){var r=t.feature,n=t.keys,i=t.values,o=t.keycache,a=t.valuecache;for(var s in r.properties){var u=r.properties[s],l=o[s];if(null!==u){void 0===l&&(n.push(s),o[s]=l=n.length-1),e.writeVarint(l);var p=typeof u;"string"!==p&&"boolean"!==p&&"number"!==p&&(u=JSON.stringify(u));var c=p+":"+u,h=a[c];void 0===h&&(i.push(u),a[c]=h=i.length-1),e.writeVarint(h)}}}function dp(t,e){return(e<<3)+(7&t)}function mp(t){return t<<1^t>>31}function vp(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,o=0,a=r.length,s=0;s<a;s++){var u=r[s],l=1;1===n&&(l=u.length),e.writeVarint(dp(1,l));for(var p=3===n?u.length-1:u.length,c=0;c<p;c++){1===c&&1!==n&&e.writeVarint(dp(2,p-1));var h=u[c].x-i,f=u[c].y-o;e.writeVarint(mp(h)),e.writeVarint(mp(f)),i+=h,o+=f}3===n&&e.writeVarint(dp(7,1))}}function gp(t,e){var r=typeof t;"string"===r?e.writeStringField(1,t):"boolean"===r?e.writeBooleanField(7,t):"number"===r&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}lp.fromVectorTileJs=cp,lp.fromGeojsonVt=function(t,e){e=e||{};var r={};for(var n in t)r[n]=new ap(t[n].features,e),r[n].name=n,r[n].version=e.version,r[n].extent=e.extent;return cp({layers:r})},lp.GeoJSONWrapper=pp;var xp=A((function(t,e){t.exports=function(){function t(t,r,n,i){e(t,n,i),e(r,2*n,2*i),e(r,2*n+1,2*i+1)}function e(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function r(t,e,r,n){var i=t-r,o=e-n;return i*i+o*o}var n=function(t){return t[0]},i=function(t){return t[1]},o=function(e,r,o,a,s){void 0===r&&(r=n),void 0===o&&(o=i),void 0===a&&(a=64),void 0===s&&(s=Float64Array),this.nodeSize=a,this.points=e;for(var u=e.length<65536?Uint16Array:Uint32Array,l=this.ids=new u(e.length),p=this.coords=new s(2*e.length),c=0;c<e.length;c++)l[c]=c,p[2*c]=r(e[c]),p[2*c+1]=o(e[c]);!function e(r,n,i,o,a,s){if(!(a-o<=i)){var u=o+a>>1;!function e(r,n,i,o,a,s){for(;a>o;){if(a-o>600){var u=a-o+1,l=i-o+1,p=Math.log(u),c=.5*Math.exp(2*p/3),h=.5*Math.sqrt(p*c*(u-c)/u)*(l-u/2<0?-1:1);e(r,n,i,Math.max(o,Math.floor(i-l*c/u+h)),Math.min(a,Math.floor(i+(u-l)*c/u+h)),s)}var f=n[2*i+s],y=o,d=a;for(t(r,n,o,i),n[2*a+s]>f&&t(r,n,o,a);y<d;){for(t(r,n,y,d),y++,d--;n[2*y+s]<f;)y++;for(;n[2*d+s]>f;)d--}n[2*o+s]===f?t(r,n,o,d):t(r,n,++d,a),d<=i&&(o=d+1),i<=d&&(a=d-1)}}(r,n,u,o,a,s%2),e(r,n,i,o,u-1,s+1),e(r,n,i,u+1,a,s+1)}}(l,p,a,0,l.length-1,0)};o.prototype.range=function(t,e,r,n){return function(t,e,r,n,i,o,a){for(var s,u,l=[0,t.length-1,0],p=[];l.length;){var c=l.pop(),h=l.pop(),f=l.pop();if(h-f<=a)for(var y=f;y<=h;y++)u=e[2*y+1],(s=e[2*y])>=r&&s<=i&&u>=n&&u<=o&&p.push(t[y]);else{var d=Math.floor((f+h)/2);u=e[2*d+1],(s=e[2*d])>=r&&s<=i&&u>=n&&u<=o&&p.push(t[d]);var m=(c+1)%2;(0===c?r<=s:n<=u)&&(l.push(f),l.push(d-1),l.push(m)),(0===c?i>=s:o>=u)&&(l.push(d+1),l.push(h),l.push(m))}}return p}(this.ids,this.coords,t,e,r,n,this.nodeSize)},o.prototype.within=function(t,e,n){return function(t,e,n,i,o,a){for(var s=[0,t.length-1,0],u=[],l=o*o;s.length;){var p=s.pop(),c=s.pop(),h=s.pop();if(c-h<=a)for(var f=h;f<=c;f++)r(e[2*f],e[2*f+1],n,i)<=l&&u.push(t[f]);else{var y=Math.floor((h+c)/2),d=e[2*y],m=e[2*y+1];r(d,m,n,i)<=l&&u.push(t[y]);var v=(p+1)%2;(0===p?n-o<=d:i-o<=m)&&(s.push(h),s.push(y-1),s.push(v)),(0===p?n+o>=d:i+o>=m)&&(s.push(y+1),s.push(c),s.push(v))}}return u}(this.ids,this.coords,t,e,n,this.nodeSize)};var a={crs:"EPSG:3857",minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},s=function(t){this.options=d(Object.create(a),t),this.trees=new Array(this.options.maxZoom+1)};function u(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function l(t,e,r){var n=t.geometry.coordinates,i=n[1];return{x:h(n[0]),y:f(i,r),zoom:1/0,index:e,parentId:-1}}function p(t,e){return{type:"Feature",id:t.id,properties:c(t),geometry:{type:"Point",coordinates:[(r=t.x,360*(r-.5)),y(t.y,e)]}};var r}function c(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return d(d({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function h(t,e){return t/360+.5}function f(t,e){var r;if(e&&"EPSG:3857"!==e)r=(90-t)/360;else{var n=Math.sin(t*Math.PI/180);r=.5-.25*Math.log((1+n)/(1-n))/Math.PI}return r<0?0:r>1?1:r}function y(t,e){if(e&&"EPSG:3857"!==e)return 90-360*t;var r=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(r))/Math.PI-90}function d(t,e){for(var r in e)t[r]=e[r];return t}function m(t){return t.x}function v(t){return t.y}return s.prototype.load=function(t){var e=this.options,r=e.log,n=e.minZoom,i=e.maxZoom,a=e.nodeSize,s=e.crs;r&&console.time("total time");var u="prepare "+t.length+" points";r&&console.time(u),this.points=t;for(var p=[],c=0;c<t.length;c++)t[c].geometry&&p.push(l(t[c],c,s));this.trees[i+1]=new o(p,m,v,a,Float32Array),r&&console.timeEnd(u);for(var h=i;h>=n;h--){var f=+Date.now();p=this._cluster(p,h),this.trees[h]=new o(p,m,v,a,Float32Array),r&&console.log("z%d: %d clusters in %dms",h,p.length,+Date.now()-f)}return r&&console.timeEnd("total time"),this},s.prototype.getClusters=function(t,e){var r=this.crs,n=((t[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,t[1])),o=180===t[2]?180:((t[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)n=-180,o=180;else if(n>o){var s=this.getClusters([n,i,180,a],e),u=this.getClusters([-180,i,o,a],e);return s.concat(u)}for(var l=this.trees[this._limitZoom(e)],c=[],y=0,d=l.range(h(n),f(a,r),h(o),f(i,r));y<d.length;y+=1){var m=l.points[d[y]];c.push(m.numPoints?p(m,r):this.points[m.index])}return c},s.prototype.getChildren=function(t){var e=this.crs,r=this._getOriginId(t),n=this._getOriginZoom(t),i="No cluster with the specified id.",o=this.trees[n];if(!o)throw new Error(i);var a=o.points[r];if(!a)throw new Error(i);for(var s=this.options.radius/(this.options.extent*Math.pow(2,n-1)),u=[],l=0,c=o.within(a.x,a.y,s);l<c.length;l+=1){var h=o.points[c[l]];h.parentId===t&&u.push(h.numPoints?p(h,e):this.points[h.index])}if(0===u.length)throw new Error(i);return u},s.prototype.getLeaves=function(t,e,r){var n=[];return this._appendLeaves(n,t,e=e||10,r=r||0,0),n},s.prototype.getTile=function(t,e,r){var n=this.trees[this._limitZoom(t)],i=Math.pow(2,t),o=this.options,a=o.radius/o.extent,s=(r-a)/i,u=(r+1+a)/i,l={features:[]};return this._addTileFeatures(n.range((e-a)/i,s,(e+1+a)/i,u),n.points,e,r,i,l),0===e&&this._addTileFeatures(n.range(1-a/i,s,1,u),n.points,i,r,i,l),e===i-1&&this._addTileFeatures(n.range(0,s,a/i,u),n.points,-1,r,i,l),l.features.length?l:null},s.prototype.getClusterExpansionZoom=function(t){for(var e=this._getOriginZoom(t)-1;e<=this.options.maxZoom;){var r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e},s.prototype._appendLeaves=function(t,e,r,n,i){for(var o=0,a=this.getChildren(e);o<a.length;o+=1){var s=a[o],u=s.properties;if(u&&u.cluster?i+u.point_count<=n?i+=u.point_count:i=this._appendLeaves(t,u.cluster_id,r,n,i):i<n?i++:t.push(s),t.length===r)break}return i},s.prototype._addTileFeatures=function(t,e,r,n,i,o){for(var a=0,s=t;a<s.length;a+=1){var u=e[s[a]],l=u.numPoints,p={type:1,geometry:[[Math.round(this.options.extent*(u.x*i-r)),Math.round(this.options.extent*(u.y*i-n))]],tags:l?c(u):this.points[u.index].properties},h=void 0;l?h=u.id:this.options.generateId?h=u.index:this.points[u.index].id&&(h=this.points[u.index].id),void 0!==h&&(p.id=h),o.features.push(p)}},s.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(+t,this.options.maxZoom+1))},s.prototype._cluster=function(t,e){for(var r=[],n=this.options,i=n.reduce,o=n.minPoints,a=n.radius/(n.extent*Math.pow(2,e)),s=0;s<t.length;s++){var l=t[s];if(!(l.zoom<=e)){l.zoom=e;for(var p=this.trees[e+1],c=p.within(l.x,l.y,a),h=l.numPoints||1,f=h,y=0,d=c;y<d.length;y+=1){var m=p.points[d[y]];m.zoom>e&&(f+=m.numPoints||1)}if(f>=o){for(var v=l.x*h,g=l.y*h,x=i&&h>1?this._map(l,!0):null,b=(s<<5)+(e+1)+this.points.length,w=0,_=c;w<_.length;w+=1){var S=p.points[_[w]];if(!(S.zoom<=e)){S.zoom=e;var A=S.numPoints||1;v+=S.x*A,g+=S.y*A,S.parentId=b,i&&(x||(x=this._map(l,!0)),i(x,this._map(S)))}}l.parentId=b,r.push(u(v/f,g/f,b,f,x))}else if(r.push(l),f>1)for(var k=0,I=c;k<I.length;k+=1){var z=p.points[I[k]];z.zoom<=e||(z.zoom=e,r.push(z))}}}return r},s.prototype._getOriginId=function(t){return t-this.points.length>>5},s.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},s.prototype._map=function(t,e){if(t.numPoints)return e?d({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?d({},n):n},s}()}));function bp(t,e,r,n,i,o){var a=i-r,s=o-n;if(0!==a||0!==s){var u=((t-r)*a+(e-n)*s)/(a*a+s*s);u>1?(r=i,n=o):u>0&&(r+=a*u,n+=s*u)}return(a=t-r)*a+(s=e-n)*s}function wp(t,e,r,n){var i={id:null==t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if("Point"===e||"MultiPoint"===e||"LineString"===e)_p(i,r);else if("Polygon"===e)_p(i,r[0]);else if("MultiLineString"===e)for(var o=0,a=r;o<a.length;o+=1)_p(i,a[o]);else if("MultiPolygon"===e)for(var s=0,u=r;s<u.length;s+=1)_p(i,u[s][0]);return i}function _p(t,e){for(var r=0;r<e.length;r+=3)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}function Sp(t,e,r,n){if(e.geometry){var i=r.crs,o=e.geometry.coordinates,a=e.geometry.type,s=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),u=[],l=e.id;if(r.promoteId?l=e.properties[r.promoteId]:r.generateId&&(l=n||0),"Point"===a)Ap(o,u,i);else if("MultiPoint"===a)for(var p=0,c=o;p<c.length;p+=1)Ap(c[p],u,i);else if("LineString"===a)kp(o,u,s,!1,i);else if("MultiLineString"===a){if(r.lineMetrics){for(var h=0,f=o;h<f.length;h+=1)kp(f[h],u=[],s,!1,i),t.push(wp(l,"LineString",u,e.properties));return}Ip(o,u,s,!1,i)}else if("Polygon"===a)Ip(o,u,s,!0,i);else{if("MultiPolygon"!==a){if("GeometryCollection"===a){for(var y=0,d=e.geometry.geometries;y<d.length;y+=1)Sp(t,{id:l,geometry:d[y],properties:e.properties},r,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(var m=0,v=o;m<v.length;m+=1){var g=[];Ip(v[m],g,s,!0,i),u.push(g)}}t.push(wp(l,a,u,e.properties))}}function Ap(t,e,r){e.push(zp(t[0]),Mp(t[1],r),0)}function kp(t,e,r,n,i){for(var o,a,s=0,u=0;u<t.length;u++){var l=zp(t[u][0]),p=Mp(t[u][1],i);e.push(l,p,0),u>0&&(s+=n?(o*p-l*a)/2:Math.sqrt(Math.pow(l-o,2)+Math.pow(p-a,2))),o=l,a=p}var c=e.length-3;e[2]=1,function t(e,r,n,i){for(var o,a=i,s=n-r>>1,u=n-r,l=e[r],p=e[r+1],c=e[n],h=e[n+1],f=r+3;f<n;f+=3){var y=bp(e[f],e[f+1],l,p,c,h);if(y>a)o=f,a=y;else if(y===a){var d=Math.abs(f-s);d<u&&(o=f,u=d)}}a>i&&(o-r>3&&t(e,r,o,i),e[o+2]=a,n-o>3&&t(e,o,n,i))}(e,0,c,r),e[c+2]=1,e.size=Math.abs(s),e.start=0,e.end=e.size}function Ip(t,e,r,n,i){for(var o=0;o<t.length;o++){var a=[];kp(t[o],a,r,n,i),e.push(a)}}function zp(t,e){return t/360+.5}function Mp(t,e){var r;if(e&&"EPSG:3857"!==e)r=(90-t)/360;else{var n=Math.sin(t*Math.PI/180);r=.5-.25*Math.log((1+n)/(1-n))/Math.PI}return r<0?0:r>1?1:r}function Pp(t,e,r,n,i,o,a,s){if(n/=e,o>=(r/=e)&&a<n)return t;if(a<r||o>=n)return null;for(var u=[],l=0,p=t;l<p.length;l+=1){var c=p[l],h=c.geometry,f=c.type,y=0===i?c.minX:c.minY,d=0===i?c.maxX:c.maxY;if(y>=r&&d<n)u.push(c);else if(!(d<r||y>=n)){var m=[];if("Point"===f||"MultiPoint"===f)Cp(h,m,r,n,i);else if("LineString"===f)Tp(h,m,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===f)Bp(h,m,r,n,i,!1);else if("Polygon"===f)Bp(h,m,r,n,i,!0);else if("MultiPolygon"===f)for(var v=0,g=h;v<g.length;v+=1){var x=[];Bp(g[v],x,r,n,i,!0),x.length&&m.push(x)}if(m.length){if(s.lineMetrics&&"LineString"===f){for(var b=0,w=m;b<w.length;b+=1)u.push(wp(c.id,f,w[b],c.tags));continue}"LineString"!==f&&"MultiLineString"!==f||(1===m.length?(f="LineString",m=m[0]):f="MultiLineString"),"Point"!==f&&"MultiPoint"!==f||(f=3===m.length?"Point":"MultiPoint"),u.push(wp(c.id,f,m,c.tags))}}}return u.length?u:null}function Cp(t,e,r,n,i){for(var o=0;o<t.length;o+=3){var a=t[o+i];a>=r&&a<=n&&Vp(e,t[o],t[o+1],t[o+2])}}function Tp(t,e,r,n,i,o,a){for(var s,u,l=Ep(t),p=0===i?Dp:Fp,c=t.start,h=0;h<t.length-3;h+=3){var f=t[h],y=t[h+1],d=t[h+2],m=t[h+3],v=t[h+4],g=0===i?f:y,x=0===i?m:v,b=!1;a&&(s=Math.sqrt(Math.pow(f-m,2)+Math.pow(y-v,2))),g<r?x>r&&(u=p(l,f,y,m,v,r),a&&(l.start=c+s*u)):g>n?x<n&&(u=p(l,f,y,m,v,n),a&&(l.start=c+s*u)):Vp(l,f,y,d),x<r&&g>=r&&(u=p(l,f,y,m,v,r),b=!0),x>n&&g<=n&&(u=p(l,f,y,m,v,n),b=!0),!o&&b&&(a&&(l.end=c+s*u),e.push(l),l=Ep(t)),a&&(c+=s)}var w=t.length-3,_=t[w],S=t[w+1],A=0===i?_:S;A>=r&&A<=n&&Vp(l,_,S,t[w+2]),w=l.length-3,o&&w>=3&&(l[w]!==l[0]||l[w+1]!==l[1])&&Vp(l,l[0],l[1],l[2]),l.length&&e.push(l)}function Ep(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function Bp(t,e,r,n,i,o){for(var a=0,s=t;a<s.length;a+=1)Tp(s[a],e,r,n,i,o,!1)}function Vp(t,e,r,n){t.push(e,r,n)}function Dp(t,e,r,n,i,o){var a=(o-e)/(n-e);return Vp(t,o,r+(i-r)*a,1),a}function Fp(t,e,r,n,i,o){var a=(o-r)/(i-r);return Vp(t,e+(n-e)*a,o,1),a}function Lp(t,e){for(var r=[],n=0;n<t.length;n++){var i=t[n],o=i.type,a=void 0;if("Point"===o||"MultiPoint"===o||"LineString"===o)a=Op(i.geometry,e);else if("MultiLineString"===o||"Polygon"===o){a=[];for(var s=0,u=i.geometry;s<u.length;s+=1)a.push(Op(u[s],e))}else if("MultiPolygon"===o){a=[];for(var l=0,p=i.geometry;l<p.length;l+=1){for(var c=[],h=0,f=p[l];h<f.length;h+=1)c.push(Op(f[h],e));a.push(c)}}r.push(wp(i.id,o,a,i.tags))}return r}function Op(t,e){var r=[];r.size=t.size,void 0!==t.start&&(r.start=t.start,r.end=t.end);for(var n=0;n<t.length;n+=3)r.push(t[n]+e,t[n+1],t[n+2]);return r}function Rp(t,e){if(t.transformed)return t;for(var r=1<<t.z,n=t.x,i=t.y,o=0,a=t.features;o<a.length;o+=1){var s=a[o],u=s.geometry,l=s.type;if(s.geometry=[],1===l)for(var p=0;p<u.length;p+=2)s.geometry.push(Up(u[p],u[p+1],e,r,n,i));else for(var c=0;c<u.length;c++){for(var h=[],f=0;f<u[c].length;f+=2)h.push(Up(u[c][f],u[c][f+1],e,r,n,i));s.geometry.push(h)}}return t.transformed=!0,t}function Up(t,e,r,n,i,o){return[Math.round(r*(t*n-i)),Math.round(r*(e*n-o))]}function jp(t,e,r,n,i){for(var o=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:t.length,source:null,x:r,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0,u=t;s<u.length;s+=1)qp(a,u[s],o,i);return a}function qp(t,e,r,n){var i=e.geometry,o=e.type,a=[];if(t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),"Point"===o||"MultiPoint"===o)for(var s=0;s<i.length;s+=3)a.push(i[s],i[s+1]),t.numPoints++,t.numSimplified++;else if("LineString"===o)Np(a,i,t,r,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(var u=0;u<i.length;u++)Np(a,i[u],t,r,"Polygon"===o,0===u);else if("MultiPolygon"===o)for(var l=0;l<i.length;l++)for(var p=i[l],c=0;c<p.length;c++)Np(a,p[c],t,r,!0,0===c);if(a.length){var h=e.tags||null;if("LineString"===o&&n.lineMetrics){for(var f in h={},e.tags)h[f]=e.tags[f];h.mapbox_clip_start=i.start/i.size,h.mapbox_clip_end=i.end/i.size}var y={geometry:a,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:h};null!==e.id&&(y.id=e.id),t.features.push(y)}}function Np(t,e,r,n,i,o){var a=n*n;if(n>0&&e.size<(i?a:n))r.numPoints+=e.length/3;else{for(var s=[],u=0;u<e.length;u+=3)(0===n||e[u+2]>a)&&(r.numSimplified++,s.push(e[u],e[u+1])),r.numPoints++;i&&function(t,e){for(var r=0,n=0,i=t.length,o=i-2;n<i;o=n,n+=2)r+=(t[n]-t[o])*(t[n+1]+t[o+1]);if(r>0===e)for(var a=0,s=t.length;a<s/2;a+=2){var u=t[a],l=t[a+1];t[a]=t[s-2-a],t[a+1]=t[s-1-a],t[s-2-a]=u,t[s-1-a]=l}}(s,o),t.push(s)}}var Gp={crs:"EPSG:3857",maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Zp=function(t,e){var r=(e=this.options=function(t,e){for(var r in e)t[r]=e[r];return t}(Object.create(Gp),e)).debug;if(r&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)Sp(r,t.features[n],e,n);else Sp(r,"Feature"===t.type?t:{geometry:t},e);return r}(t,e);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(n=function(t,e){var r=e.buffer/e.extent,n=t,i=Pp(t,1,-1-r,r,0,-1,2,e),o=Pp(t,1,1-r,2+r,0,-1,2,e);return(i||o)&&(n=Pp(t,1,-r,1+r,0,-1,2,e)||[],i&&(n=Lp(i,1).concat(n)),o&&(n=n.concat(Lp(o,-1)))),n}(n,e)).length&&this.splitTile(n,0,0,0),r&&(n.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 Xp(t,e,r){return 32*((1<<t)*r+e)+t}function Yp(t,e){var r=t.tileID.canonical;if(!this._geoJSONIndex)return e(null,null);var n=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!n)return e(null,null);var i=new ip(n.features),o=lp(i);0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{vectorTile:i,rawData:o.buffer})}Zp.prototype.splitTile=function(t,e,r,n,i,o,a){for(var s=[t,e,r,n],u=this.options,l=u.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var p=1<<e,c=Xp(e,r,n),h=this.tiles[c];if(!h&&(l>1&&console.time("creation"),h=this.tiles[c]=jp(t,e,r,n,u),this.tileCoords.push({z:e,x:r,y:n}),l)){l>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,h.numFeatures,h.numPoints,h.numSimplified),console.timeEnd("creation"));var f="z"+e;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(h.source=t,null==i){if(e===u.indexMaxZoom||h.numPoints<=u.indexMaxPoints)continue}else{if(e===u.maxZoom||e===i)continue;if(null!=i){var y=i-e;if(r!==o>>y||n!==a>>y)continue}}if(h.source=null,0!==t.length){l>1&&console.time("clipping");var d=.5*u.buffer/u.extent,m=.5-d,v=.5+d,g=1+d,x=null,b=null,w=null,_=null,S=Pp(t,p,r-d,r+v,0,h.minX,h.maxX,u),A=Pp(t,p,r+m,r+g,0,h.minX,h.maxX,u);t=null,S&&(x=Pp(S,p,n-d,n+v,1,h.minY,h.maxY,u),b=Pp(S,p,n+m,n+g,1,h.minY,h.maxY,u),S=null),A&&(w=Pp(A,p,n-d,n+v,1,h.minY,h.maxY,u),_=Pp(A,p,n+m,n+g,1,h.minY,h.maxY,u),A=null),l>1&&console.timeEnd("clipping"),s.push(x||[],e+1,2*r,2*n),s.push(b||[],e+1,2*r,2*n+1),s.push(w||[],e+1,2*r+1,2*n),s.push(_||[],e+1,2*r+1,2*n+1)}}},Zp.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,o=n.debug;if((t=+t)<0||t>24)return null;var a=1<<t,s=Xp(t,e=(e=+e)+a&a-1,r=+r);if(this.tiles[s])return Rp(this.tiles[s],i);o>1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var u,l=t,p=e,c=r;!u&&l>0;)l--,u=this.tiles[Xp(l,p>>=1,c>>=1)];return u&&u.source?(o>1&&(console.log("found parent tile z%d-%d-%d",l,p,c),console.time("drilling down")),this.splitTile(u.source,l,p,c,t,e,r),o>1&&console.timeEnd("drilling down"),this.tiles[s]?Rp(this.tiles[s],i):null):null};var Jp=function(t){function e(e,r,n,i){t.call(this,e,r,n,Yp),i&&(this.loadGeoJSON=i)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},e.prototype._loadData=function(){var t=this;if(this._pendingCallback&&this._pendingLoadDataParams){var e=this._pendingCallback,r=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var n=!!(r&&r.request&&r.request.collectResourceTiming)&&new Gl(r.request);this.loadGeoJSON(r,(function(i,o){if(i||!o)return e(i);if("object"!=typeof o)return e(new Error("Input data given to '"+r.source+"' is not a valid GeoJSON object."));!function t(e,r){var n,i=e&&e.type;if("FeatureCollection"===i)for(n=0;n<e.features.length;n++)t(e.features[n],r);else if("GeometryCollection"===i)for(n=0;n<e.geometries.length;n++)t(e.geometries[n],r);else if("Feature"===i)t(e.geometry,r);else if("Polygon"===i)tp(e.coordinates,r);else if("MultiPolygon"===i)for(n=0;n<e.coordinates.length;n++)tp(e.coordinates[n],r);return e}(o,!0);try{t._geoJSONIndex=r.cluster?new xp(function(t){var e=t.superclusterOptions,r=t.clusterProperties;if(!r||!e)return e;for(var n={},i={},o={accumulated:null,zoom:0},a={properties:null},s=Object.keys(r),u=0,l=s;u<l.length;u+=1){var p=l[u],c=r[p],h=c[0],f=je(c[1]),y=je("string"==typeof h?[h,["accumulated"],["get",p]]:h);n[p]=f.value,i[p]=y.value}return e.map=function(t){a.properties=t;for(var e={},r=0,i=s;r<i.length;r+=1){var u=i[r];e[u]=n[u].evaluate(o,a)}return e},e.reduce=function(t,e){a.properties=e;for(var r=0,n=s;r<n.length;r+=1){var u=n[r];o.accumulated=t[u],t[u]=i[u].evaluate(o,a)}},e}(r)).load(o.features):function(t,e){return new Zp(t,e)}(o,r.geojsonVtOptions)}catch(i){return e(i)}t.loaded={};var a={};if(n){var s=n.finish();s&&(a.resourceTiming={},a.resourceTiming[r.source]=JSON.parse(JSON.stringify(s)))}e(null,a)}))}},e.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},e.prototype.reloadTile=function(e,r){var n=this.loaded;return n&&n[e.uid]?t.prototype.reloadTile.call(this,e,r):this.loadTile(e,r)},e.prototype.loadGeoJSON=function(t,e){if(t.request)si(t.request,e);else{if("string"!=typeof t.data)return e(new Error("Input data given to '"+t.source+"' is not a valid GeoJSON object."));try{return e(null,JSON.parse(t.data))}catch(r){return e(new Error("Input data given to '"+t.source+"' is not a valid GeoJSON object."))}}},e.prototype.removeSource=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),e()},e.prototype.getClusterExpansionZoom=function(t,e){try{e(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId))}catch(t){e(t)}},e.prototype.getClusterChildren=function(t,e){try{e(null,this._geoJSONIndex.getChildren(t.clusterId))}catch(t){e(t)}},e.prototype.getClusterLeaves=function(t,e){try{e(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset))}catch(t){e(t)}},e}(Xl),Kp=function(t){var e=this;this.self=t,this.actor=new rr(t,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:Xl,mbtiles:Xl,geojson:Jp,rasteroffline:Ql},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,r){if(e.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');e.workerSourceTypes[t]=r},this.self.registerRTLTextPlugin=function(t){if(fi.isParsed())throw new Error("RTL text plugin already registered.");fi.applyArabicShaping=t.applyArabicShaping,fi.processBidirectionalText=t.processBidirectionalText,fi.processStyledBidirectionalText=t.processStyledBidirectionalText}};return Kp.prototype.setReferrer=function(t,e){this.referrer=e},Kp.prototype.setImages=function(t,e,r){this.availableImages[t]=e,r()},Kp.prototype.setLayers=function(t,e,r){this.getLayerIndex(t).replace(e),r()},Kp.prototype.updateLayers=function(t,e,r){this.getLayerIndex(t).update(e.layers,e.removedIds),r()},Kp.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).loadTile(e,r)},Kp.prototype.loadDEMTile=function(t,e,r){this.getDEMWorkerSource(t,e.source).loadTile(e,r)},Kp.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).reloadTile(e,r)},Kp.prototype.abortTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).abortTile(e,r)},Kp.prototype.removeTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).removeTile(e,r)},Kp.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},Kp.prototype.removeSource=function(t,e,r){if(this.workerSources[t]&&this.workerSources[t][e.type]&&this.workerSources[t][e.type][e.source]){var n=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==n.removeSource?n.removeSource(e,r):r()}},Kp.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(t){r(t.toString())}},Kp.prototype.syncRTLPluginState=function(t,e,r){try{fi.setState(e);var n=fi.getPluginURL();if(fi.isLoaded()&&!fi.isParsed()&&null!=n){this.self.importScripts(n);var i=fi.isParsed();r(i?void 0:new Error("RTL Text Plugin failed to import scripts from "+n),i)}}catch(t){r(t.toString())}},Kp.prototype.getAvailableImages=function(t){var e=this.availableImages[t];return e||(e=[]),e},Kp.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new bl),e},Kp.prototype.getWorkerSource=function(t,e,r){var n=this;return this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),this.workerSources[t][e][r]||(this.workerSources[t][e][r]=new this.workerSourceTypes[e]({send:function(e,r,i){n.actor.send(e,r,i,t)}},this.getLayerIndex(t),this.getAvailableImages(t))),this.workerSources[t][e][r]},Kp.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new Kl),this.demWorkerSources[t][e]},Kp.prototype.enforceCacheSizeLimit=function(t,e){!function(t){Wn(),Gn&&Gn.then((function(e){e.keys().then((function(r){for(var n=0;n<r.length-t;n++)e.delete(r[n])}))}))}(e)},"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new Kp(self)),Kp}();
2
- //# sourceMappingURL=mapbox-gl-csp-worker.js.map