mapbox-gl 1.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.flowconfig +61 -0
- package/CHANGELOG.md +2485 -0
- package/LICENSE.txt +84 -0
- package/README.md +34 -0
- package/build/banner.js +4 -0
- package/build/check-bundle-size.js +140 -0
- package/build/diff-tarball.js +18 -0
- package/build/generate-access-token-script.js +11 -0
- package/build/generate-flow-typed-style-spec.js +188 -0
- package/build/generate-release-list.js +21 -0
- package/build/generate-struct-arrays.js +243 -0
- package/build/generate-style-code.js +159 -0
- package/build/mapbox-gl.js.flow +3 -0
- package/build/print-release-url.js +6 -0
- package/build/rollup_plugin_minify_style_spec.js +24 -0
- package/build/rollup_plugins.js +80 -0
- package/build/run-node +3 -0
- package/build/run-tap +8 -0
- package/build/test/build-tape.js +19 -0
- package/dist/mapbox-gl-csp-worker.js +2 -0
- package/dist/mapbox-gl-csp-worker.js.map +1 -0
- package/dist/mapbox-gl-csp.js +2 -0
- package/dist/mapbox-gl-csp.js.map +1 -0
- package/dist/mapbox-gl-dev.js +65889 -0
- package/dist/mapbox-gl-dev.js.flow +3 -0
- package/dist/mapbox-gl-unminified.js +42889 -0
- package/dist/mapbox-gl-unminified.js.map +1 -0
- package/dist/mapbox-gl.css +1 -0
- package/dist/mapbox-gl.js +42 -0
- package/dist/mapbox-gl.js.flow +3 -0
- package/dist/mapbox-gl.js.map +1 -0
- package/dist/style-spec/index.es.js +15032 -0
- package/dist/style-spec/index.es.js.map +1 -0
- package/dist/style-spec/index.js +15058 -0
- package/dist/style-spec/index.js.map +1 -0
- package/flow-typed/gl.js +5 -0
- package/flow-typed/jsdom.js +18 -0
- package/flow-typed/mapbox-gl-supported.js +9 -0
- package/flow-typed/mapbox-unitbezier.js +14 -0
- package/flow-typed/offscreen-canvas.js +9 -0
- package/flow-typed/pbf.js +25 -0
- package/flow-typed/point-geometry.js +44 -0
- package/flow-typed/potpack.js +12 -0
- package/flow-typed/sinon.js +28 -0
- package/flow-typed/vector-tile.js +41 -0
- package/package.json +173 -0
- package/src/css/mapbox-gl.css +812 -0
- package/src/css/svg/mapboxgl-ctrl-attrib.svg +3 -0
- package/src/css/svg/mapboxgl-ctrl-compass.svg +4 -0
- package/src/css/svg/mapboxgl-ctrl-fullscreen.svg +3 -0
- package/src/css/svg/mapboxgl-ctrl-geolocate.svg +5 -0
- package/src/css/svg/mapboxgl-ctrl-logo.svg +20 -0
- package/src/css/svg/mapboxgl-ctrl-shrink.svg +3 -0
- package/src/css/svg/mapboxgl-ctrl-zoom-in.svg +3 -0
- package/src/css/svg/mapboxgl-ctrl-zoom-out.svg +3 -0
- package/src/data/array_types.js +1135 -0
- package/src/data/bucket/circle_attributes.js +9 -0
- package/src/data/bucket/circle_bucket.js +201 -0
- package/src/data/bucket/fill_attributes.js +9 -0
- package/src/data/bucket/fill_bucket.js +229 -0
- package/src/data/bucket/fill_extrusion_attributes.js +10 -0
- package/src/data/bucket/fill_extrusion_bucket.js +283 -0
- package/src/data/bucket/heatmap_bucket.js +17 -0
- package/src/data/bucket/line_attributes.js +10 -0
- package/src/data/bucket/line_attributes_ext.js +10 -0
- package/src/data/bucket/line_bucket.js +594 -0
- package/src/data/bucket/pattern_attributes.js +12 -0
- package/src/data/bucket/pattern_bucket_features.js +60 -0
- package/src/data/bucket/symbol_attributes.js +117 -0
- package/src/data/bucket/symbol_bucket.js +937 -0
- package/src/data/bucket.js +123 -0
- package/src/data/dem_data.js +125 -0
- package/src/data/evaluation_feature.js +25 -0
- package/src/data/extent.js +18 -0
- package/src/data/feature_index.js +322 -0
- package/src/data/feature_position_map.js +131 -0
- package/src/data/index_array_type.js +16 -0
- package/src/data/load_geometry.js +46 -0
- package/src/data/pos_attributes.js +6 -0
- package/src/data/program_configuration.js +708 -0
- package/src/data/raster_bounds_attributes.js +7 -0
- package/src/data/segment.js +76 -0
- package/src/geo/edge_insets.js +102 -0
- package/src/geo/lng_lat.js +168 -0
- package/src/geo/lng_lat_bounds.js +276 -0
- package/src/geo/mercator_coordinate.js +150 -0
- package/src/geo/transform.js +834 -0
- package/src/gl/color_mode.js +34 -0
- package/src/gl/context.js +302 -0
- package/src/gl/cull_face_mode.js +26 -0
- package/src/gl/depth_mode.js +29 -0
- package/src/gl/framebuffer.js +44 -0
- package/src/gl/index_buffer.js +55 -0
- package/src/gl/stencil_mode.js +30 -0
- package/src/gl/types.js +84 -0
- package/src/gl/value.js +520 -0
- package/src/gl/vertex_buffer.js +119 -0
- package/src/index.js +230 -0
- package/src/render/draw_background.js +57 -0
- package/src/render/draw_circle.js +113 -0
- package/src/render/draw_collision_debug.js +172 -0
- package/src/render/draw_custom.js +49 -0
- package/src/render/draw_debug.js +127 -0
- package/src/render/draw_fill.js +124 -0
- package/src/render/draw_fill_extrusion.js +95 -0
- package/src/render/draw_heatmap.js +133 -0
- package/src/render/draw_hillshade.js +107 -0
- package/src/render/draw_line.js +125 -0
- package/src/render/draw_raster.js +125 -0
- package/src/render/draw_symbol.js +392 -0
- package/src/render/glyph_atlas.js +71 -0
- package/src/render/glyph_manager.js +182 -0
- package/src/render/image_atlas.js +149 -0
- package/src/render/image_manager.js +306 -0
- package/src/render/line_atlas.js +210 -0
- package/src/render/painter.js +654 -0
- package/src/render/program/background_program.js +103 -0
- package/src/render/program/circle_program.js +69 -0
- package/src/render/program/clipping_mask_program.js +20 -0
- package/src/render/program/collision_program.js +76 -0
- package/src/render/program/debug_program.js +35 -0
- package/src/render/program/fill_extrusion_program.js +122 -0
- package/src/render/program/fill_program.js +126 -0
- package/src/render/program/heatmap_program.js +83 -0
- package/src/render/program/hillshade_program.js +119 -0
- package/src/render/program/line_program.js +211 -0
- package/src/render/program/pattern.js +102 -0
- package/src/render/program/program_uniforms.js +42 -0
- package/src/render/program/raster_program.js +92 -0
- package/src/render/program/symbol_program.js +224 -0
- package/src/render/program.js +188 -0
- package/src/render/texture.js +122 -0
- package/src/render/uniform_binding.js +147 -0
- package/src/render/vertex_array_object.js +163 -0
- package/src/shaders/README.md +42 -0
- package/src/shaders/_prelude.fragment.glsl +17 -0
- package/src/shaders/_prelude.vertex.glsl +73 -0
- package/src/shaders/background.fragment.glsl +10 -0
- package/src/shaders/background.vertex.glsl +7 -0
- package/src/shaders/background_pattern.fragment.glsl +28 -0
- package/src/shaders/background_pattern.vertex.glsl +20 -0
- package/src/shaders/circle.fragment.glsl +39 -0
- package/src/shaders/circle.vertex.glsl +64 -0
- package/src/shaders/clipping_mask.fragment.glsl +3 -0
- package/src/shaders/clipping_mask.vertex.glsl +7 -0
- package/src/shaders/collision_box.fragment.glsl +21 -0
- package/src/shaders/collision_box.vertex.glsl +27 -0
- package/src/shaders/collision_circle.fragment.glsl +17 -0
- package/src/shaders/collision_circle.vertex.glsl +59 -0
- package/src/shaders/debug.fragment.glsl +9 -0
- package/src/shaders/debug.vertex.glsl +12 -0
- package/src/shaders/encode_attribute.js +17 -0
- package/src/shaders/fill.fragment.glsl +13 -0
- package/src/shaders/fill.vertex.glsl +13 -0
- package/src/shaders/fill_extrusion.fragment.glsl +9 -0
- package/src/shaders/fill_extrusion.vertex.glsl +66 -0
- package/src/shaders/fill_extrusion_pattern.fragment.glsl +45 -0
- package/src/shaders/fill_extrusion_pattern.vertex.glsl +79 -0
- package/src/shaders/fill_outline.fragment.glsl +17 -0
- package/src/shaders/fill_outline.vertex.glsl +17 -0
- package/src/shaders/fill_outline_pattern.fragment.glsl +43 -0
- package/src/shaders/fill_outline_pattern.vertex.glsl +44 -0
- package/src/shaders/fill_pattern.fragment.glsl +36 -0
- package/src/shaders/fill_pattern.vertex.glsl +39 -0
- package/src/shaders/heatmap.fragment.glsl +22 -0
- package/src/shaders/heatmap.vertex.glsl +54 -0
- package/src/shaders/heatmap_texture.fragment.glsl +14 -0
- package/src/shaders/heatmap_texture.vertex.glsl +11 -0
- package/src/shaders/hillshade.fragment.glsl +52 -0
- package/src/shaders/hillshade.vertex.glsl +11 -0
- package/src/shaders/hillshade_prepare.fragment.glsl +75 -0
- package/src/shaders/hillshade_prepare.vertex.glsl +15 -0
- package/src/shaders/index.js +20 -0
- package/src/shaders/line.fragment.glsl +30 -0
- package/src/shaders/line.vertex.glsl +85 -0
- package/src/shaders/line_gradient.fragment.glsl +34 -0
- package/src/shaders/line_gradient.vertex.glsl +88 -0
- package/src/shaders/line_pattern.fragment.glsl +74 -0
- package/src/shaders/line_pattern.vertex.glsl +99 -0
- package/src/shaders/line_sdf.fragment.glsl +45 -0
- package/src/shaders/line_sdf.vertex.glsl +98 -0
- package/src/shaders/raster.fragment.glsl +52 -0
- package/src/shaders/raster.vertex.glsl +21 -0
- package/src/shaders/shaders.js +185 -0
- package/src/shaders/symbol_icon.fragment.glsl +17 -0
- package/src/shaders/symbol_icon.vertex.glsl +94 -0
- package/src/shaders/symbol_sdf.fragment.glsl +52 -0
- package/src/shaders/symbol_sdf.vertex.glsl +115 -0
- package/src/shaders/symbol_text_and_icon.fragment.glsl +68 -0
- package/src/shaders/symbol_text_and_icon.vertex.glsl +116 -0
- package/src/source/canvas_source.js +238 -0
- package/src/source/geojson_source.js +370 -0
- package/src/source/geojson_worker_source.js +366 -0
- package/src/source/geojson_wrapper.js +94 -0
- package/src/source/image_source.js +307 -0
- package/src/source/load_tilejson.js +39 -0
- package/src/source/pixels_to_tile_units.js +21 -0
- package/src/source/query_features.js +208 -0
- package/src/source/raster_dem_tile_source.js +138 -0
- package/src/source/raster_dem_tile_worker_source.js +62 -0
- package/src/source/raster_tile_source.js +169 -0
- package/src/source/rtl_text_plugin.js +143 -0
- package/src/source/source.js +137 -0
- package/src/source/source_cache.js +953 -0
- package/src/source/source_state.js +159 -0
- package/src/source/tile.js +458 -0
- package/src/source/tile_bounds.js +38 -0
- package/src/source/tile_cache.js +212 -0
- package/src/source/tile_id.js +199 -0
- package/src/source/vector_tile_source.js +259 -0
- package/src/source/vector_tile_worker_source.js +216 -0
- package/src/source/video_source.js +203 -0
- package/src/source/worker.js +240 -0
- package/src/source/worker_source.js +107 -0
- package/src/source/worker_tile.js +224 -0
- package/src/style/create_style_layer.js +36 -0
- package/src/style/evaluation_parameters.js +62 -0
- package/src/style/format_section_override.js +56 -0
- package/src/style/light.js +130 -0
- package/src/style/load_glyph_range.js +38 -0
- package/src/style/load_sprite.js +67 -0
- package/src/style/parse_glyph_pbf.js +44 -0
- package/src/style/pauseable_placement.js +132 -0
- package/src/style/properties.js +753 -0
- package/src/style/query_utils.js +43 -0
- package/src/style/style.js +1374 -0
- package/src/style/style_glyph.js +17 -0
- package/src/style/style_image.js +137 -0
- package/src/style/style_layer/background_style_layer.js +21 -0
- package/src/style/style_layer/background_style_layer_properties.js +40 -0
- package/src/style/style_layer/circle_style_layer.js +98 -0
- package/src/style/style_layer/circle_style_layer_properties.js +63 -0
- package/src/style/style_layer/custom_style_layer.js +223 -0
- package/src/style/style_layer/fill_extrusion_style_layer.js +224 -0
- package/src/style/style_layer/fill_extrusion_style_layer_properties.js +50 -0
- package/src/style/style_layer/fill_style_layer.js +67 -0
- package/src/style/style_layer/fill_style_layer_properties.js +55 -0
- package/src/style/style_layer/heatmap_style_layer.js +73 -0
- package/src/style/style_layer/heatmap_style_layer_properties.js +44 -0
- package/src/style/style_layer/hillshade_style_layer.js +25 -0
- package/src/style/style_layer/hillshade_style_layer_properties.js +46 -0
- package/src/style/style_layer/layer_properties.js.ejs +69 -0
- package/src/style/style_layer/line_style_layer.js +150 -0
- package/src/style/style_layer/line_style_layer_properties.js +71 -0
- package/src/style/style_layer/raster_style_layer.js +21 -0
- package/src/style/style_layer/raster_style_layer_properties.js +50 -0
- package/src/style/style_layer/symbol_style_layer.js +190 -0
- package/src/style/style_layer/symbol_style_layer_properties.js +153 -0
- package/src/style/style_layer/typed_style_layer.js +17 -0
- package/src/style/style_layer.js +283 -0
- package/src/style/style_layer_index.js +80 -0
- package/src/style/validate_style.js +42 -0
- package/src/style/zoom_history.js +44 -0
- package/src/style-spec/.eslintrc +5 -0
- package/src/style-spec/CHANGELOG.md +468 -0
- package/src/style-spec/README.md +59 -0
- package/src/style-spec/bin/gl-style-composite +9 -0
- package/src/style-spec/bin/gl-style-format +22 -0
- package/src/style-spec/bin/gl-style-migrate +9 -0
- package/src/style-spec/bin/gl-style-validate +50 -0
- package/src/style-spec/composite.js +50 -0
- package/src/style-spec/declass.js +42 -0
- package/src/style-spec/deref.js +52 -0
- package/src/style-spec/diff.js +393 -0
- package/src/style-spec/dist/.gitkeep +0 -0
- package/src/style-spec/dist/index.es.js +15032 -0
- package/src/style-spec/dist/index.es.js.map +1 -0
- package/src/style-spec/dist/index.js +15058 -0
- package/src/style-spec/dist/index.js.map +1 -0
- package/src/style-spec/empty.js +29 -0
- package/src/style-spec/error/parsing_error.js +16 -0
- package/src/style-spec/error/validation_error.js +18 -0
- package/src/style-spec/expression/compound_expression.js +162 -0
- package/src/style-spec/expression/definitions/assertion.js +130 -0
- package/src/style-spec/expression/definitions/at.js +70 -0
- package/src/style-spec/expression/definitions/case.js +85 -0
- package/src/style-spec/expression/definitions/coalesce.js +93 -0
- package/src/style-spec/expression/definitions/coercion.js +133 -0
- package/src/style-spec/expression/definitions/collator.js +78 -0
- package/src/style-spec/expression/definitions/comparison.js +184 -0
- package/src/style-spec/expression/definitions/format.js +144 -0
- package/src/style-spec/expression/definitions/image.js +52 -0
- package/src/style-spec/expression/definitions/in.js +72 -0
- package/src/style-spec/expression/definitions/index.js +565 -0
- package/src/style-spec/expression/definitions/index_of.js +89 -0
- package/src/style-spec/expression/definitions/interpolate.js +267 -0
- package/src/style-spec/expression/definitions/length.js +61 -0
- package/src/style-spec/expression/definitions/let.js +72 -0
- package/src/style-spec/expression/definitions/literal.js +77 -0
- package/src/style-spec/expression/definitions/match.js +158 -0
- package/src/style-spec/expression/definitions/number_format.js +142 -0
- package/src/style-spec/expression/definitions/slice.js +86 -0
- package/src/style-spec/expression/definitions/step.js +120 -0
- package/src/style-spec/expression/definitions/var.js +46 -0
- package/src/style-spec/expression/definitions/within.js +342 -0
- package/src/style-spec/expression/evaluation_context.js +59 -0
- package/src/style-spec/expression/expression.js +27 -0
- package/src/style-spec/expression/index.js +392 -0
- package/src/style-spec/expression/is_constant.js +59 -0
- package/src/style-spec/expression/parsing_context.js +233 -0
- package/src/style-spec/expression/parsing_error.js +13 -0
- package/src/style-spec/expression/runtime_error.js +17 -0
- package/src/style-spec/expression/scope.js +36 -0
- package/src/style-spec/expression/stops.js +39 -0
- package/src/style-spec/expression/types/collator.js +61 -0
- package/src/style-spec/expression/types/formatted.js +73 -0
- package/src/style-spec/expression/types/resolved_image.js +29 -0
- package/src/style-spec/expression/types.js +126 -0
- package/src/style-spec/expression/values.js +123 -0
- package/src/style-spec/feature_filter/README.md +55 -0
- package/src/style-spec/feature_filter/convert.js +208 -0
- package/src/style-spec/feature_filter/index.js +175 -0
- package/src/style-spec/format.js +51 -0
- package/src/style-spec/function/convert.js +270 -0
- package/src/style-spec/function/index.js +262 -0
- package/src/style-spec/group_by_layout.js +75 -0
- package/src/style-spec/migrate/expressions.js +39 -0
- package/src/style-spec/migrate/v8.js +203 -0
- package/src/style-spec/migrate/v9.js +26 -0
- package/src/style-spec/migrate.js +36 -0
- package/src/style-spec/package.json +41 -0
- package/src/style-spec/read_style.js +14 -0
- package/src/style-spec/reference/latest.js +3 -0
- package/src/style-spec/reference/v8.json +5914 -0
- package/src/style-spec/rollup.config.js +65 -0
- package/src/style-spec/style-spec.js +124 -0
- package/src/style-spec/types.js +432 -0
- package/src/style-spec/util/color.js +95 -0
- package/src/style-spec/util/color_spaces.js +139 -0
- package/src/style-spec/util/deep_equal.js +28 -0
- package/src/style-spec/util/extend.js +10 -0
- package/src/style-spec/util/get_type.js +17 -0
- package/src/style-spec/util/interpolate.js +22 -0
- package/src/style-spec/util/properties.js +15 -0
- package/src/style-spec/util/ref_properties.js +2 -0
- package/src/style-spec/util/result.js +19 -0
- package/src/style-spec/util/unbundle_jsonlint.js +24 -0
- package/src/style-spec/validate/latest.js +11 -0
- package/src/style-spec/validate/validate.js +75 -0
- package/src/style-spec/validate/validate_array.js +52 -0
- package/src/style-spec/validate/validate_boolean.js +15 -0
- package/src/style-spec/validate/validate_color.js +20 -0
- package/src/style-spec/validate/validate_constants.js +13 -0
- package/src/style-spec/validate/validate_enum.js +21 -0
- package/src/style-spec/validate/validate_expression.js +43 -0
- package/src/style-spec/validate/validate_filter.js +117 -0
- package/src/style-spec/validate/validate_formatted.js +11 -0
- package/src/style-spec/validate/validate_function.js +207 -0
- package/src/style-spec/validate/validate_glyphs_url.js +21 -0
- package/src/style-spec/validate/validate_image.js +11 -0
- package/src/style-spec/validate/validate_layer.js +134 -0
- package/src/style-spec/validate/validate_layout_property.js +6 -0
- package/src/style-spec/validate/validate_light.js +47 -0
- package/src/style-spec/validate/validate_number.js +29 -0
- package/src/style-spec/validate/validate_object.js +61 -0
- package/src/style-spec/validate/validate_paint_property.js +6 -0
- package/src/style-spec/validate/validate_property.js +64 -0
- package/src/style-spec/validate/validate_source.js +111 -0
- package/src/style-spec/validate/validate_string.js +15 -0
- package/src/style-spec/validate_mapbox_api_supported.js +171 -0
- package/src/style-spec/validate_style.js +39 -0
- package/src/style-spec/validate_style.min.js +78 -0
- package/src/style-spec/visit.js +77 -0
- package/src/symbol/anchor.js +26 -0
- package/src/symbol/check_max_angle.js +81 -0
- package/src/symbol/clip_line.js +71 -0
- package/src/symbol/collision_feature.js +109 -0
- package/src/symbol/collision_index.js +373 -0
- package/src/symbol/cross_tile_symbol_index.js +301 -0
- package/src/symbol/get_anchors.js +167 -0
- package/src/symbol/grid_index.js +335 -0
- package/src/symbol/mergelines.js +82 -0
- package/src/symbol/one_em.js +4 -0
- package/src/symbol/opacity_state.js +27 -0
- package/src/symbol/path_interpolator.js +61 -0
- package/src/symbol/placement.js +1124 -0
- package/src/symbol/projection.js +451 -0
- package/src/symbol/quads.js +334 -0
- package/src/symbol/shaping.js +816 -0
- package/src/symbol/symbol_layout.js +796 -0
- package/src/symbol/symbol_size.js +113 -0
- package/src/symbol/transform_text.js +29 -0
- package/src/types/callback.js +17 -0
- package/src/types/cancelable.js +3 -0
- package/src/types/tilejson.js +17 -0
- package/src/types/transferable.js +3 -0
- package/src/types/window.js +172 -0
- package/src/ui/anchor.js +32 -0
- package/src/ui/camera.js +1277 -0
- package/src/ui/control/attribution_control.js +212 -0
- package/src/ui/control/fullscreen_control.js +147 -0
- package/src/ui/control/geolocate_control.js +707 -0
- package/src/ui/control/logo_control.js +92 -0
- package/src/ui/control/navigation_control.js +257 -0
- package/src/ui/control/scale_control.js +142 -0
- package/src/ui/default_locale.js +22 -0
- package/src/ui/events.js +1301 -0
- package/src/ui/handler/box_zoom.js +170 -0
- package/src/ui/handler/click_zoom.js +52 -0
- package/src/ui/handler/handler_util.js +12 -0
- package/src/ui/handler/keyboard.js +208 -0
- package/src/ui/handler/map_event.js +156 -0
- package/src/ui/handler/mouse.js +171 -0
- package/src/ui/handler/scroll_zoom.js +350 -0
- package/src/ui/handler/shim/dblclick_zoom.js +62 -0
- package/src/ui/handler/shim/drag_pan.js +88 -0
- package/src/ui/handler/shim/drag_rotate.js +67 -0
- package/src/ui/handler/shim/touch_zoom_rotate.js +108 -0
- package/src/ui/handler/tap_drag_zoom.js +103 -0
- package/src/ui/handler/tap_recognizer.js +133 -0
- package/src/ui/handler/tap_zoom.js +93 -0
- package/src/ui/handler/touch_pan.js +101 -0
- package/src/ui/handler/touch_zoom_rotate.js +305 -0
- package/src/ui/handler_inertia.js +158 -0
- package/src/ui/handler_manager.js +531 -0
- package/src/ui/hash.js +148 -0
- package/src/ui/map.js +2874 -0
- package/src/ui/marker.js +672 -0
- package/src/ui/popup.js +640 -0
- package/src/util/actor.js +212 -0
- package/src/util/ajax.js +388 -0
- package/src/util/browser/web_worker.js +10 -0
- package/src/util/browser/window.js +6 -0
- package/src/util/browser.js +70 -0
- package/src/util/classify_rings.js +52 -0
- package/src/util/color_ramp.js +61 -0
- package/src/util/config.js +30 -0
- package/src/util/debug.js +28 -0
- package/src/util/dictionary_coder.js +30 -0
- package/src/util/dispatcher.js +70 -0
- package/src/util/dom.js +142 -0
- package/src/util/evented.js +174 -0
- package/src/util/find_pole_of_inaccessibility.js +129 -0
- package/src/util/global_worker_pool.js +35 -0
- package/src/util/image.js +142 -0
- package/src/util/intersection_tests.js +208 -0
- package/src/util/is_char_in_unicode_block.js +311 -0
- package/src/util/mapbox.js +491 -0
- package/src/util/offscreen_canvas_supported.js +14 -0
- package/src/util/performance.js +112 -0
- package/src/util/primitives.js +145 -0
- package/src/util/resolve_tokens.js +16 -0
- package/src/util/script_detection.js +328 -0
- package/src/util/sku_token.js +42 -0
- package/src/util/smart_wrap.js +55 -0
- package/src/util/struct_array.js +243 -0
- package/src/util/struct_array.js.ejs +112 -0
- package/src/util/struct_array_layout.js.ejs +98 -0
- package/src/util/task_queue.js +68 -0
- package/src/util/throttle.js +27 -0
- package/src/util/throttled_invoker.js +46 -0
- package/src/util/tile_request_cache.js +172 -0
- package/src/util/util.js +524 -0
- package/src/util/vectortile_to_geojson.js +50 -0
- package/src/util/verticalize_punctuation.js +114 -0
- package/src/util/web_worker.js +91 -0
- package/src/util/web_worker_transfer.js +266 -0
- package/src/util/webp_supported.js +69 -0
- package/src/util/window.js +102 -0
- package/src/util/worker_pool.js +57 -0
|
@@ -0,0 +1,2 @@
|
|
|
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}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 i="undefined"!=typeof self?self:{},o=Math.pow(2,53)-1;function a(t,e,r){return Math.min(r,Math.max(e,t))}function s(t){var e=[];for(var r in t)e.push(t[r]);return e}function u(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 l(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function p(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 c(t,e){return-1!==t.indexOf(e,t.length-e.length)}function h(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function f(t){return Array.isArray(t)?t.map(f):"object"==typeof t&&t?h(t,f):t}var y={};function d(t){y[t]||("undefined"!=typeof console&&console.warn(t),y[t]=!0)}function m(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function v(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 g(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function x(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 b=null;function w(t){if(null==b){var e=t.navigator?t.navigator.userAgent:null;b=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return b}function _(t){try{var e=i[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var S=k;function k(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 I(t,e){return t(e={exports:{}},e.exports),e.exports}k.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)},k.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},k.prototype._insertCell=function(t,e,r,n,i,o){this.cells[i].push(o)},k.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},k.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}}},k.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}},k.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},k.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},k.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 A=I((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,z=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};function M(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}z.parse=function(t){if(t){if(t instanceof z)return t;if("string"==typeof t){var e=A(t);if(e)return new z(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},z.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+")"},z.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]},z.black=new z(0,0,0,1),z.white=new z(1,1,1,1),z.transparent=new z(0,0,0,0),z.red=new z(1,0,0,1);var P=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),C=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]}};C.prototype.concat=function(t){return new C(this,t)},C.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.")},C.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var B={kind:"null"},V={kind:"number"},T={kind:"string"},E={kind:"boolean"},D={kind:"color"},F={kind:"object"},O={kind:"value"},L={kind:"collator"},j={kind:"formatted"},q={kind:"resolvedImage"};function R(t,e){return{kind:"array",itemType:t,N:e}}function U(t){if("array"===t.kind){var e=U(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var N=[B,V,T,E,D,j,F,R(O),q];function Z(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Z(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=N;r<n.length;r+=1)if(!Z(n[r],e))return null}return"Expected "+U(t)+" but found "+U(e)+" instead."}function G(t,e){return e.some((function(e){return e.kind===t.kind}))}function X(t,e){return e.some((function(e){return"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t}))}var Y=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"})};Y.prototype.compare=function(t,e){return this.collator.compare(t,e)},Y.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var J=function(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i},K=function(t){this.sections=t};K.fromString=function(t){return new K([new J(t,null,null,null,null)])},K.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}))},K.factory=function(t){return t instanceof K?t:K.fromString(t)},K.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},K.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 H=function(t){this.name=t.name,this.available=t.available};function W(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 $(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 z)return!0;if(t instanceof Y)return!0;if(t instanceof K)return!0;if(t instanceof H)return!0;if(Array.isArray(t)){for(var e=0,r=t;e<r.length;e+=1)if(!$(r[e]))return!1;return!0}if("object"==typeof t){for(var n in t)if(!$(t[n]))return!1;return!0}return!1}function Q(t){if(null===t)return B;if("string"==typeof t)return T;if("boolean"==typeof t)return E;if("number"==typeof t)return V;if(t instanceof z)return D;if(t instanceof Y)return L;if(t instanceof K)return j;if(t instanceof H)return q;if(Array.isArray(t)){for(var e,r=t.length,n=0,i=t;n<i.length;n+=1){var o=Q(i[n]);if(e){if(e===o)continue;e=O;break}e=o}return R(e||O,r)}return F}function tt(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof z||t instanceof K||t instanceof H?t.toString():JSON.stringify(t)}H.prototype.toString=function(){return this.name},H.fromString=function(t){return t?new H({name:t,available:!1}):null},H.prototype.serialize=function(){return["image",this.name]};var et=function(t,e){this.type=t,this.value=e};et.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!$(t[1]))return e.error("invalid value");var r=t[1],n=Q(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 et(n,r)},et.prototype.evaluate=function(){return this.value},et.prototype.eachChild=function(){},et.prototype.outputDefined=function(){return!0},et.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof z?["rgba"].concat(this.value.toArray()):this.value instanceof K?this.value.serialize():this.value};var rt=function(t){this.name="ExpressionEvaluationError",this.message=t};rt.prototype.toJSON=function(){return this.message};var nt={string:T,number:V,boolean:E,object:F},it=function(t,e){this.type=t,this.args=e};it.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 nt)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=nt[s],n++}else o=O;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=R(o,a)}else r=nt[i];for(var u=[];n<t.length;n++){var l=e.parse(t[n],n,O);if(!l)return null;u.push(l)}return new it(r,u)},it.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!Z(this.type,Q(r)))return r;if(e===this.args.length-1)throw new rt("Expected value to be of type "+U(this.type)+", but found "+U(Q(r))+" instead.")}return null},it.prototype.eachChild=function(t){this.args.forEach(t)},it.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},it.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 ot=function(t){this.type=j,this.sections=t};ot.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,V)))return null;var u=null;if(a["text-font"]&&!(u=e.parse(a["text-font"],1,R(T))))return null;var l=null;if(a["text-color"]&&!(l=e.parse(a["text-color"],1,D)))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,O);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 ot(n)},ot.prototype.evaluate=function(t){return new K(this.sections.map((function(e){var r=e.content.evaluate(t);return Q(r)===q?new J("",r,null,null,null):new J(tt(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},ot.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)}},ot.prototype.outputDefined=function(){return!1},ot.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 at=function(t){this.type=q,this.input=t};at.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,T);return r?new at(r):e.error("No image name provided.")},at.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=H.fromString(e);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(e)>-1),r},at.prototype.eachChild=function(t){t(this.input)},at.prototype.outputDefined=function(){return!1},at.prototype.serialize=function(){return["image",this.input.serialize()]};var st={"to-boolean":E,"to-color":D,"to-number":V,"to-string":T},ut=function(t,e){this.type=t,this.args=e};ut.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=st[r],i=[],o=1;o<t.length;o++){var a=e.parse(t[o],o,O);if(!a)return null;i.push(a)}return new ut(n,i)},ut.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 z)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.":W(e[0],e[1],e[2],e[3])))return new z(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new rt(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 rt("Could not convert "+JSON.stringify(a)+" to number.")}return"formatted"===this.type.kind?K.fromString(tt(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?H.fromString(tt(this.args[0].evaluate(t))):tt(this.args[0].evaluate(t))},ut.prototype.eachChild=function(t){this.args.forEach(t)},ut.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},ut.prototype.serialize=function(){if("formatted"===this.type.kind)return new ot([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new at(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var lt=["Unknown","Point","LineString","Polygon"],pt=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};pt.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},pt.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?lt[this.feature.type]:this.feature.type:null},pt.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},pt.prototype.canonicalID=function(){return this.canonical},pt.prototype.properties=function(){return this.feature&&this.feature.properties||{}},pt.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=z.parse(t)),e};var ct=function(t,e,r,n){this.name=t,this.type=e,this._evaluate=r,this.args=n};ct.prototype.evaluate=function(t){return this._evaluate(t,this.args)},ct.prototype.eachChild=function(t){this.args.forEach(t)},ct.prototype.outputDefined=function(){return!1},ct.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},ct.parse=function(t,e){var r,n=t[0],i=ct.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 Tt(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 ct(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(U).join(", ")+")":"("+U(e.type)+"...)"})).join(" | "),k=[],I=1;I<t.length;I++){var A=e.parse(t[I],1+k.length);if(!A)return null;k.push(U(A.type))}e.error("Expected arguments of type "+S+", but found ("+k.join(", ")+") instead.")}return null},ct.register=function(t,e){for(var r in ct.definitions=e,e)t[r]=ct};var ht=function(t,e,r){this.type=L,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e};function ft(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 yt(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function dt(t,e){var r=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,i=Math.pow(2,e.z);return[Math.round(r*i*8192),Math.round(n*i*8192)]}function mt(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 vt(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;mt(t,h[f],h[f+1])&&(l=!l)}return l}function gt(t,e){for(var r=0;r<e.length;r++)if(vt(t,e[r]))return!0;return!1}function xt(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 bt(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]&&xt(s,u,l,p)&&xt(l,p,s,u))return!0;var s,u,l,p,c,h;return!1}function wt(t,e){for(var r=0;r<t.length;++r)if(!vt(t[r],e))return!1;for(var n=0;n<t.length-1;++n)if(bt(t[n],t[n+1],e))return!1;return!0}function _t(t,e){for(var r=0;r<e.length;r++)if(wt(t,e[r]))return!0;return!1}function St(t,e,r){for(var n=[],i=0;i<t.length;i++){for(var o=[],a=0;a<t[i].length;a++){var s=dt(t[i][a],r);ft(e,s),o.push(s)}n.push(o)}return n}function kt(t,e,r){for(var n=[],i=0;i<t.length;i++){var o=St(t[i],e,r);n.push(o)}return n}function It(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}ft(e,t)}function At(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]];It(h,e,r,i),a.push(h)}return a}function zt(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]];ft(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)It(g[v],e,r,o)}return s}ht.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,E);if(!n)return null;var i=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,E);if(!i)return null;var o=null;return r.locale&&!(o=e.parse(r.locale,1,T))?null:new ht(n,i,o)},ht.prototype.evaluate=function(t){return new Y(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},ht.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},ht.prototype.outputDefined=function(){return!1},ht.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 Mt=function(t,e){this.type=E,this.geojson=t,this.geometries=e};function Pt(t){if(t instanceof ct){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 Mt)return!1;var e=!0;return t.eachChild((function(t){e&&!Pt(t)&&(e=!1)})),e}function Ct(t){if(t instanceof ct&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!Ct(t)&&(e=!1)})),e}function Bt(t,e){if(t instanceof ct&&e.indexOf(t.name)>=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Bt(t,e)&&(r=!1)})),r}Mt.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if($(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 Mt(r,r.features[n].geometry)}else if("Feature"===r.type){var o=r.geometry.type;if("Polygon"===o||"MultiPolygon"===o)return new Mt(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new Mt(r,r)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Mt.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=St(e.coordinates,n,i),a=At(t.geometry(),r,n,i);if(!yt(r,n))return!1;for(var s=0,u=a;s<u.length;s+=1)if(!vt(u[s],o))return!1}if("MultiPolygon"===e.type){var l=kt(e.coordinates,n,i),p=At(t.geometry(),r,n,i);if(!yt(r,n))return!1;for(var c=0,h=p;c<h.length;c+=1)if(!gt(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=St(e.coordinates,n,i),a=zt(t.geometry(),r,n,i);if(!yt(r,n))return!1;for(var s=0,u=a;s<u.length;s+=1)if(!wt(u[s],o))return!1}if("MultiPolygon"===e.type){var l=kt(e.coordinates,n,i),p=zt(t.geometry(),r,n,i);if(!yt(r,n))return!1;for(var c=0,h=p;c<h.length;c+=1)if(!_t(h[c],l))return!1}return!0}(t,this.geometries)}return!1},Mt.prototype.eachChild=function(){},Mt.prototype.outputDefined=function(){return!0},Mt.prototype.serialize=function(){return["within",this.geojson]};var Vt=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};Vt.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 Vt(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)},Vt.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Vt.prototype.eachChild=function(){},Vt.prototype.outputDefined=function(){return!1},Vt.prototype.serialize=function(){return["var",this.name]};var Tt=function(t,e,r,n,i){void 0===e&&(e=[]),void 0===n&&(n=new C),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 Et(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 rt("Input is not a number.");o=a-1}return 0}Tt.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)},Tt.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new it(e,[t]):"coerce"===r?new ut(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 et)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof Vt)return t(e.boundExpression);if(e instanceof ct&&"error"===e.name)return!1;if(e instanceof ht)return!1;if(e instanceof Mt)return!1;var r=e instanceof ut||e instanceof it,n=!0;return e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof et})),!!n&&Pt(e)&&Bt(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var u=new pt;try{o=new et(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.")},Tt.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 Tt(this.registry,n,e||null,i,this.errors)},Tt.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 P(n,t))},Tt.prototype.checkSubtype=function(t,e){var r=Z(t,e);return r&&this.error(r),r};var Dt=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 Ft(t,e,r){return t*(1-r)+e*r}Dt.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,V);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 Dt(i,r,n)},Dt.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[Et(e,n)].evaluate(t)},Dt.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},Dt.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},Dt.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 Ot=Object.freeze({__proto__:null,number:Ft,color:function(t,e,r){return new z(Ft(t.r,e.r,r),Ft(t.g,e.g,r),Ft(t.b,e.b,r),Ft(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return Ft(t,e[n],r)}))}}),Lt=6/29*3*(6/29),jt=Math.PI/180,qt=180/Math.PI;function Rt(t){return t>.008856451679035631?Math.pow(t,1/3):t/Lt+4/29}function Ut(t){return t>6/29?t*t*t:Lt*(t-4/29)}function Nt(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Zt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Gt(t){var e=Zt(t.r),r=Zt(t.g),n=Zt(t.b),i=Rt((.4124564*e+.3575761*r+.1804375*n)/.95047),o=Rt((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-Rt((.0193339*e+.119192*r+.9503041*n)/1.08883)),alpha:t.a}}function Xt(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*Ut(e),r=.95047*Ut(r),n=1.08883*Ut(n),new z(Nt(3.2404542*r-1.5371385*e-.4985314*n),Nt(-.969266*r+1.8760108*e+.041556*n),Nt(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function Yt(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var Jt={forward:Gt,reverse:Xt,interpolate:function(t,e,r){return{l:Ft(t.l,e.l,r),a:Ft(t.a,e.a,r),b:Ft(t.b,e.b,r),alpha:Ft(t.alpha,e.alpha,r)}}},Kt={forward:function(t){var e=Gt(t),r=e.l,n=e.a,i=e.b,o=Math.atan2(i,n)*qt;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*jt,r=t.c;return Xt({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:Yt(t.h,e.h,r),c:Ft(t.c,e.c,r),l:Ft(t.l,e.l,r),alpha:Ft(t.alpha,e.alpha,r)}}},Ht=Object.freeze({__proto__:null,lab:Jt,hcl:Kt}),Wt=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 $t(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)}Wt.interpolationFactor=function(e,r,n,i){var o=0;if("exponential"===e.name)o=$t(r,e.base,n,i);else if("linear"===e.name)o=$t(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($t(r,1,n,i))}return o},Wt.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,V)))return null;var u=[],l=null;"interpolate-hcl"===r||"interpolate-lab"===r?l=D: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 Wt(l,r,n,i,u):e.error("Type "+U(l)+" is not interpolatable.")},Wt.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=Et(e,n),a=Wt.interpolationFactor(this.interpolation,n,e[o],e[o+1]),s=r[o].evaluate(t),u=r[o+1].evaluate(t);return"interpolate"===this.operator?Ot[this.type.kind.toLowerCase()](s,u,a):"interpolate-hcl"===this.operator?Kt.reverse(Kt.interpolate(Kt.forward(s),Kt.forward(u),a)):Jt.reverse(Jt.interpolate(Jt.forward(s),Jt.forward(u),a))},Wt.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},Wt.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},Wt.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 Qt=function(t,e){this.type=t,this.args=e};Qt.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 Z(n,t.type)}));return new Qt(u?O:r,i)},Qt.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 H&&!r.available&&(e||(e=r.name),r=null,n===this.args.length&&(r=e)),null===r);i+=1);return r},Qt.prototype.eachChild=function(t){this.args.forEach(t)},Qt.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},Qt.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var te=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};te.prototype.evaluate=function(t){return this.result.evaluate(t)},te.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1)t(r[e][1]);t(this.result)},te.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 te(r,a):null},te.prototype.outputDefined=function(){return this.result.outputDefined()},te.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 ee=function(t,e,r){this.type=t,this.index=e,this.input=r};ee.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,V),n=e.parse(t[2],2,R(e.expectedType||O));return r&&n?new ee(n.type.itemType,r,n):null},ee.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new rt("Array index out of bounds: "+e+" < 0.");if(e>=r.length)throw new rt("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new rt("Array index must be an integer, but found "+e+" instead.");return r[e]},ee.prototype.eachChild=function(t){t(this.index),t(this.input)},ee.prototype.outputDefined=function(){return!1},ee.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var re=function(t,e){this.type=E,this.needle=t,this.haystack=e};re.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,O),n=e.parse(t[2],2,O);return r&&n?G(r.type,[E,T,V,B,O])?new re(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+U(r.type)+" instead"):null},re.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!X(e,["boolean","string","number","null"]))throw new rt("Expected first argument to be of type boolean, string, number or null, but found "+U(Q(e))+" instead.");if(!X(r,["string","array"]))throw new rt("Expected second argument to be of type array or string, but found "+U(Q(r))+" instead.");return r.indexOf(e)>=0},re.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},re.prototype.outputDefined=function(){return!0},re.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var ne=function(t,e,r){this.type=V,this.needle=t,this.haystack=e,this.fromIndex=r};ne.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,O),n=e.parse(t[2],2,O);if(!r||!n)return null;if(!G(r.type,[E,T,V,B,O]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+U(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,V);return i?new ne(r,n,i):null}return new ne(r,n)},ne.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!X(e,["boolean","string","number","null"]))throw new rt("Expected first argument to be of type boolean, string, number or null, but found "+U(Q(e))+" instead.");if(!X(r,["string","array"]))throw new rt("Expected second argument to be of type array or string, but found "+U(Q(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},ne.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},ne.prototype.outputDefined=function(){return!1},ne.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var ie=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};ie.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,Q(h)))return null}else r=Q(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,O);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 ie(r,n,y,i,o,d):null},ie.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(Q(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},ie.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},ie.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},ie.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 oe=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r};oe.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,E);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 oe(r,n,s):null},oe.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)},oe.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)},oe.prototype.outputDefined=function(){return this.branches.every((function(t){return t[1].outputDefined()}))&&this.otherwise.outputDefined()},oe.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var ae=function(t,e,r,n){this.type=t,this.input=e,this.beginIndex=r,this.endIndex=n};function se(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 ue(t,e,r,n){return 0===n.compare(e,r)}function le(t,e,r){var n="=="!==t&&"!="!==t;return function(){function i(t,e,r){this.type=E,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,O);if(!o)return null;if(!se(r,o.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+U(o.type)+"'.");var a=e.parse(t[2],2,O);if(!a)return null;if(!se(r,a.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+U(a.type)+"'.");if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '"+U(o.type)+"' and '"+U(a.type)+"'.");n&&("value"===o.type.kind&&"value"!==a.type.kind?o=new it(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new it(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=Q(o),u=Q(a);if(s.kind!==u.kind||"string"!==s.kind&&"number"!==s.kind)throw new rt('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=Q(o),p=Q(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}()}ae.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,O),n=e.parse(t[2],2,V);if(!r||!n)return null;if(!G(r.type,[R(O),T,O]))return e.error("Expected first argument to be of type array or string, but found "+U(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,V);return i?new ae(r.type,r,n,i):null}return new ae(r.type,r,n)},ae.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!X(e,["string","array"]))throw new rt("Expected first argument to be of type array or string, but found "+U(Q(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},ae.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},ae.prototype.outputDefined=function(){return!1},ae.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var pe=le("==",(function(t,e,r){return e===r}),ue),ce=le("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!ue(0,e,r,n)})),he=le("<",(function(t,e,r){return e<r}),(function(t,e,r,n){return n.compare(e,r)<0})),fe=le(">",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),ye=le("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),de=le(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),me=function(t,e,r,n,i){this.type=T,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};me.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,V);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,T)))return null;var o=null;if(n.currency&&!(o=e.parse(n.currency,1,T)))return null;var a=null;if(n["min-fraction-digits"]&&!(a=e.parse(n["min-fraction-digits"],1,V)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,V))?null:new me(r,i,o,a,s)},me.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))},me.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)},me.prototype.outputDefined=function(){return!1},me.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 ve=function(t){this.type=V,this.input=t};ve.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 "+U(r.type)+" instead."):new ve(r):null},ve.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 rt("Expected value to be of type string or array, but found "+U(Q(e))+" instead.")},ve.prototype.eachChild=function(t){t(this.input)},ve.prototype.outputDefined=function(){return!1},ve.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var ge={"==":pe,"!=":ce,">":fe,"<":he,">=":de,"<=":ye,array:it,at:ee,boolean:it,case:oe,coalesce:Qt,collator:ht,format:ot,image:at,in:re,"index-of":ne,interpolate:Wt,"interpolate-hcl":Wt,"interpolate-lab":Wt,length:ve,let:te,literal:et,match:ie,number:it,"number-format":me,object:it,slice:ae,step:Dt,string:it,"to-boolean":ut,"to-color":ut,"to-number":ut,"to-string":ut,var:Vt,within:Mt};function xe(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=W(r,n,i,a);if(s)throw new rt(s);return new z(r/255*a,n/255*a,i/255*a,a)}function be(t,e){return t in e}function we(t,e){var r=e[t];return void 0===r?null:r}function _e(t){return{type:t}}function Se(t){return{result:"success",value:t}}function ke(t){return{result:"error",value:t}}function Ie(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Ae(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function ze(t){return!!t.expression&&t.expression.interpolated}function Me(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Pe(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Ce(t){return t}function Be(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Ve(t,e,r,n,i){return Be(typeof r===i?n[r]:void 0,t.default,e.default)}function Te(t,e,r){if("number"!==Me(r))return Be(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=Et(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function Ee(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==Me(r))return Be(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=Et(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=Ot[e.type]||Ce;if(t.colorSpace&&"rgb"!==t.colorSpace){var p=Ht[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 De(t,e,r){return"color"===e.type?r=z.parse(r):"formatted"===e.type?r=K.fromString(r.toString()):"resolvedImage"===e.type?r=H.fromString(r.toString()):Me(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Be(r,t.default,e.default)}ct.register(ge,{error:[{kind:"error"},[T],function(t,e){throw new rt(e[0].evaluate(t))}],typeof:[T,[O],function(t,e){return U(Q(e[0].evaluate(t)))}],"to-rgba":[R(V,4),[D],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[D,[V,V,V],xe],rgba:[D,[V,V,V,V],xe],has:{type:E,overloads:[[[T],function(t,e){return be(e[0].evaluate(t),t.properties())}],[[T,F],function(t,e){var r=e[1];return be(e[0].evaluate(t),r.evaluate(t))}]]},get:{type:O,overloads:[[[T],function(t,e){return we(e[0].evaluate(t),t.properties())}],[[T,F],function(t,e){var r=e[1];return we(e[0].evaluate(t),r.evaluate(t))}]]},"feature-state":[O,[T],function(t,e){return we(e[0].evaluate(t),t.featureState||{})}],properties:[F,[],function(t){return t.properties()}],"geometry-type":[T,[],function(t){return t.geometryType()}],id:[O,[],function(t){return t.id()}],zoom:[V,[],function(t){return t.globals.zoom}],"heatmap-density":[V,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[V,[],function(t){return t.globals.lineProgress||0}],accumulated:[O,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[V,_e(V),function(t,e){for(var r=0,n=0,i=e;n<i.length;n+=1)r+=i[n].evaluate(t);return r}],"*":[V,_e(V),function(t,e){for(var r=1,n=0,i=e;n<i.length;n+=1)r*=i[n].evaluate(t);return r}],"-":{type:V,overloads:[[[V,V],function(t,e){var r=e[1];return e[0].evaluate(t)-r.evaluate(t)}],[[V],function(t,e){return-e[0].evaluate(t)}]]},"/":[V,[V,V],function(t,e){var r=e[1];return e[0].evaluate(t)/r.evaluate(t)}],"%":[V,[V,V],function(t,e){var r=e[1];return e[0].evaluate(t)%r.evaluate(t)}],ln2:[V,[],function(){return Math.LN2}],pi:[V,[],function(){return Math.PI}],e:[V,[],function(){return Math.E}],"^":[V,[V,V],function(t,e){var r=e[1];return Math.pow(e[0].evaluate(t),r.evaluate(t))}],sqrt:[V,[V],function(t,e){return Math.sqrt(e[0].evaluate(t))}],log10:[V,[V],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN10}],ln:[V,[V],function(t,e){return Math.log(e[0].evaluate(t))}],log2:[V,[V],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN2}],sin:[V,[V],function(t,e){return Math.sin(e[0].evaluate(t))}],cos:[V,[V],function(t,e){return Math.cos(e[0].evaluate(t))}],tan:[V,[V],function(t,e){return Math.tan(e[0].evaluate(t))}],asin:[V,[V],function(t,e){return Math.asin(e[0].evaluate(t))}],acos:[V,[V],function(t,e){return Math.acos(e[0].evaluate(t))}],atan:[V,[V],function(t,e){return Math.atan(e[0].evaluate(t))}],min:[V,_e(V),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[V,_e(V),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[V,[V],function(t,e){return Math.abs(e[0].evaluate(t))}],round:[V,[V],function(t,e){var r=e[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[V,[V],function(t,e){return Math.floor(e[0].evaluate(t))}],ceil:[V,[V],function(t,e){return Math.ceil(e[0].evaluate(t))}],"filter-==":[E,[T,O],function(t,e){var r=e[0],n=e[1];return t.properties()[r.value]===n.value}],"filter-id-==":[E,[O],function(t,e){var r=e[0];return t.id()===r.value}],"filter-type-==":[E,[T],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[E,[T,O],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-<":[E,[O],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<i}],"filter->":[E,[T,O],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->":[E,[O],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[E,[T,O],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-<=":[E,[O],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[E,[T,O],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->=":[E,[O],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[E,[O],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[E,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[E,[R(T)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[E,[R(O)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[E,[T,R(O)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[E,[T,R(O)],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:E,overloads:[[[E,E],function(t,e){var r=e[1];return e[0].evaluate(t)&&r.evaluate(t)}],[_e(E),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:E,overloads:[[[E,E],function(t,e){var r=e[1];return e[0].evaluate(t)||r.evaluate(t)}],[_e(E),function(t,e){for(var r=0,n=e;r<n.length;r+=1)if(n[r].evaluate(t))return!0;return!1}]]},"!":[E,[E],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[E,[T],function(t,e){var r=t.globals&&t.globals.isSupportedScript;return!r||r(e[0].evaluate(t))}],upcase:[T,[T],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[T,[T],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[T,_e(O),function(t,e){return e.map((function(e){return tt(e.evaluate(t))})).join("")}],"resolved-locale":[T,[L],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var Fe=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new pt,this._defaultValue=e?function(t){return"color"===t.type&&Pe(t.default)?new z(0,0,0,0):"color"===t.type?z.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null};function Oe(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in ge}function Le(t,e){var r=new Tt(ge,[],e?function(t){var e={color:D,string:T,number:V,enum:T,boolean:E,formatted:j,resolvedImage:q};return"array"===t.type?R(e[t.value]||O,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?Se(new Fe(n,e)):ke(r.errors)}Fe.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)},Fe.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 rt("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 je=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Ct(e.expression)};je.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,o)},je.prototype.evaluate=function(t,e,r,n,i,o){return this._styleExpression.evaluate(t,e,r,n,i,o)};var qe=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Ct(e.expression),this.interpolationType=n};function Re(t,e){if("error"===(t=Le(t,e)).result)return t;var r=t.value.expression,n=Pt(r);if(!n&&!Ie(e))return ke([new P("","data expressions not supported")]);var i=Bt(r,["zoom"]);if(!i&&!Ae(e))return ke([new P("","zoom expressions not supported")]);var o=function t(e){var r=null;if(e instanceof te)r=t(e.result);else if(e instanceof Qt)for(var n=0,i=e.args;n<i.length&&!(r=t(i[n]));n+=1);else(e instanceof Dt||e instanceof Wt)&&e.input instanceof ct&&"zoom"===e.input.name&&(r=e);return r instanceof P||e.eachChild((function(e){var n=t(e);n instanceof P?r=n:!r&&n?r=new P("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&n&&r!==n&&(r=new P("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),r}(r);return o||i?o instanceof P?ke([o]):o instanceof Wt&&!ze(e)?ke([new P("",'"interpolate" expressions cannot be used with this property')]):Se(o?new qe(n?"camera":"composite",t.value,o.labels,o instanceof Wt?o.interpolation:void 0):new je(n?"constant":"source",t.value)):ke([new P("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" 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)},qe.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?Wt.interpolationFactor(this.interpolationType,t,e,r):0};var Ue=function(t,e){this._parameters=t,this._specification=e,M(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||(ze(r)?"exponential":"interval");if(a&&((e=M({},e)).stops&&(e.stops=e.stops.map((function(t){return[t[0],z.parse(t[1])]}))),e.default=z.parse(e.default?e.default:r.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!Ht[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===l)n=Ee;else if("interval"===l)n=Te;else if("categorical"===l){n=Ve,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=De}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:Wt.interpolationFactor.bind(void 0,_),zoomStops:g.map((function(t){return t[0]})),evaluate:function(t,n){var i=t.zoom;return Ee({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:Wt.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?Be(e.default,r.default):n(e,r,s,i,o)}}}(this._parameters,this._specification))};Ue.deserialize=function(t){return new Ue(t._parameters,t._specification)},Ue.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var Ne=i.ImageData,Ze=i.ImageBitmap,Ge={};function Xe(t,e,r){void 0===r&&(r={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),Ge[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}for(var Ye in Xe("Object",Object),S.serialize=function(t,e){var r=t.toArrayBuffer();return e&&e.push(r),{buffer:r}},S.deserialize=function(t){return new S(t.buffer)},Xe("Grid",S),Xe("Color",z),Xe("Error",Error),Xe("ResolvedImage",H),Xe("StylePropertyFunction",Ue),Xe("StyleExpression",Fe,{omit:["_evaluator"]}),Xe("ZoomDependentExpression",qe),Xe("ZoomConstantExpression",je),Xe("CompoundExpression",ct,{omit:["_evaluate"]}),ge)ge[Ye]._classRegistryKey||Xe("Expression_"+Ye,ge[Ye]);function Je(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function Ke(t){return Ze&&t instanceof Ze}function He(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(Je(t)||Ke(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var r=t;return e&&e.push(r.buffer),r}if(t instanceof Ne)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(He(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)&&!(Ge[s].omit.indexOf(l)>=0)){var p=t[l];u[l]=Ge[s].shallow.indexOf(l)>=0?p:He(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 We(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||Je(t)||Ke(t)||ArrayBuffer.isView(t)||t instanceof Ne)return t;if(Array.isArray(t))return t.map(We);if("object"==typeof t){var e=t.$name||"Object",r=Ge[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]=Ge[e].shallow.indexOf(a)>=0?s:We(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var $e=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()})};$e.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))},$e.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Qe=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 $e(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=g()?t:i};Qe.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=w(this.globalScope)?void 0:[];return this.target.postMessage({id:a,type:t,hasCallback:!!r,targetMapId:n,mustQueue:i,sourceMapId:this.mapId,data:He(e,s)},s),{cancel:function(){r&&delete o.callbacks[a],o.target.postMessage({id:a,type:"<cancel>",targetMapId:n,sourceMapId:o.mapId})}}},Qe.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 g()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},Qe.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)}},Qe.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(We(e.error)):n(null,We(e.data)))}else{var i=!1,o=w(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?He(e):null,data:He(n,o)},o)}:function(t){i=!0},s=null,u=We(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)}},Qe.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var tr={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},er=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function rr(t){var e=t.value;return e?[new er(t.key,e,"constants have been deprecated as of v8")]:[]}function nr(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function ir(t){if(Array.isArray(t))return t.map(ir);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var r in t)e[r]=ir(t[r]);return e}return nr(t)}function or(t){var e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=[],u=Me(r);if("object"!==u)return[new er(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=Cr;else if(i["*"])h=i["*"];else{if(!n["*"]){s.push(new er(e,r[l],'unknown property "'+l+'"'));continue}h=Cr}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 er(e,r,'missing required property "'+f+'"'));return s}function ar(t){var e=t.value,r=t.valueSpec,n=t.style,i=t.styleSpec,o=t.key,a=t.arrayElementValidator||Cr;if("array"!==Me(e))return[new er(o,e,"array expected, "+Me(e)+" found")];if(r.length&&e.length!==r.length)return[new er(o,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.length<r["min-length"])return[new er(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"===Me(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 sr(t){var e=t.key,r=t.value,n=t.valueSpec,i=Me(r);return"number"===i&&r!=r&&(i="NaN"),"number"!==i?[new er(e,r,"number expected, "+i+" found")]:"minimum"in n&&r<n.minimum?[new er(e,r,r+" is less than the minimum value "+n.minimum)]:"maximum"in n&&r>n.maximum?[new er(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function ur(t){var e,r,n,i=t.valueSpec,o=nr(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,l="array"===Me(t.value.stops)&&"array"===Me(t.value.stops[0])&&"object"===Me(t.value.stops[0][0]),p=or({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 er(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(ar({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:c})),"array"===Me(r)&&0===r.length&&e.push(new er(t.key,r,"array must have at least one stop")),e},default:function(t){return Cr({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&p.push(new er(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||p.push(new er(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!ze(t.valueSpec)&&p.push(new er(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!Ie(t.valueSpec)?p.push(new er(t.key,t.value,"property functions not supported")):s&&!Ae(t.valueSpec)&&p.push(new er(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!l||void 0!==t.value.property||p.push(new er(t.key,t.value,'"property" property is required')),p;function c(t){var e=[],o=t.value,s=t.key;if("array"!==Me(o))return[new er(s,o,"array expected, "+Me(o)+" found")];if(2!==o.length)return[new er(s,o,"array length 2 expected, length "+o.length+" found")];if(l){if("object"!==Me(o[0]))return[new er(s,o,"object expected, "+Me(o[0])+" found")];if(void 0===o[0].zoom)return[new er(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new er(s,o,"object stop key must have value")];if(n&&n>nr(o[0].zoom))return[new er(s,o[0].zoom,"stop zoom values must appear in ascending order")];nr(o[0].zoom)!==n&&(n=nr(o[0].zoom),r=void 0,a={}),e=e.concat(or({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:sr,value:h}}))}else e=e.concat(h({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return Oe(ir(o[1]))?e.concat([new er(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(Cr({key:s+"[1]",value:o[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function h(t,n){var s=Me(t.value),u=nr(t.value),l=null!==t.value?t.value:n;if(e){if(s!==e)return[new er(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 er(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 Ie(i)&&void 0===o&&(p+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new er(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 er(t.key,l,"stop domain values must appear in ascending order")]:(r=u,"categorical"===o&&u in a?[new er(t.key,l,"stop domain values must be unique")]:(a[u]=!0,[])):[new er(t.key,l,"integer expected, found "+u)]}}function lr(t){var e=("property"===t.expressionContext?Re:Le)(ir(t.value),t.valueSpec);if("error"===e.result)return e.value.map((function(e){return new er(""+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 er(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&&!Ct(r))return[new er(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!Ct(r))return[new er(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!Bt(r,["zoom","feature-state"]))return[new er(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!Pt(r))return[new er(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function pr(t){var e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(nr(r))&&i.push(new er(e,r,"expected one of ["+n.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(n.values).indexOf(nr(r))&&i.push(new er(e,r,"expected one of ["+Object.keys(n.values).join(", ")+"], "+JSON.stringify(r)+" found")),i}function cr(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(!cr(n)&&"boolean"!=typeof n)return!1}return!0;default:return!0}}var hr={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function fr(t){if(null==t)return{filter:function(){return!0},needGeometry:!1};cr(t)||(t=dr(t));var e=Le(t,hr);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:function t(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(var r=1;r<e.length;r++)if(t(e[r]))return!0;return!1}(t)}}function yr(t,e){return t<e?-1:t>e?1:0}function dr(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?mr(t[1],t[2],"=="):"!="===r?xr(mr(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?mr(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(dr))):"all"===r?["all"].concat(t.slice(1).map(dr)):"none"===r?["all"].concat(t.slice(1).map(dr).map(xr)):"in"===r?vr(t[1],t.slice(2)):"!in"===r?xr(vr(t[1],t.slice(2))):"has"===r?gr(t[1]):"!has"===r?xr(gr(t[1])):"within"!==r||t}function mr(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 vr(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(yr)]]:["filter-in-small",t,["literal",e]]}}function gr(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function xr(t){return["!",t]}function br(t){return cr(ir(t.value))?lr(M({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==Me(r))return[new er(n,r,"array expected, "+Me(r)+" found")];var i,o=e.styleSpec,a=[];if(r.length<1)return[new er(n,r,"filter array must have at least 1 element")];switch(a=a.concat(pr({key:n+"[0]",value:r[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),nr(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===nr(r[1])&&a.push(new er(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new er(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(i=Me(r[1]))&&a.push(new er(n+"[1]",r[1],"string expected, "+i+" found"));for(var s=2;s<r.length;s++)i=Me(r[s]),"$type"===nr(r[1])?a=a.concat(pr({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 er(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=Me(r[1]),2!==r.length?a.push(new er(n,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"string"!==i&&a.push(new er(n+"[1]",r[1],"string expected, "+i+" found"));break;case"within":i=Me(r[1]),2!==r.length?a.push(new er(n,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"object"!==i&&a.push(new er(n+"[1]",r[1],"object expected, "+i+" found"))}return a}(t)}function wr(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 Cr({key:r,value:o,valueSpec:i.transition,style:n,styleSpec:i});var l,p=t.valueSpec||s[a];if(!p)return[new er(r,o,'unknown property "'+a+'"')];if("string"===Me(o)&&Ie(p)&&!p.tokens&&(l=/^{([^}]+)}$/.exec(o)))return[new er(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 er(r,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&Pe(ir(o))&&"identity"===nr(o.type)&&c.push(new er(r,o,'"text-font" does not support identity functions'))),c.concat(Cr({key:t.key,value:o,valueSpec:p,style:n,styleSpec:i,expressionContext:"property",propertyType:e,propertyKey:a}))}function _r(t){return wr(t,"paint")}function Sr(t){return wr(t,"layout")}function kr(t){var e=[],r=t.value,n=t.key,i=t.style,o=t.styleSpec;r.type||r.ref||e.push(new er(n,r,'either "type" or "ref" is required'));var a,s=nr(r.type),u=nr(r.ref);if(r.id)for(var l=nr(r.id),p=0;p<t.arrayIndex;p++){var c=i.layers[p];nr(c.id)===l&&e.push(new er(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 er(n,r[t],'"'+t+'" is prohibited for ref layers'))})),i.layers.forEach((function(t){nr(t.id)===u&&(a=t)})),a?a.ref?e.push(new er(n,r.ref,"ref cannot reference another ref layer")):s=nr(a.type):e.push(new er(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&&nr(h.type);h?"vector"===f&&"raster"===s?e.push(new er(n,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===f&&"raster"!==s?e.push(new er(n,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==f||r["source-layer"]?"raster-dem"===f&&"hillshade"!==s?e.push(new er(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 er(n,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new er(n,r,'layer "'+r.id+'" must specify a "source-layer"')):e.push(new er(n,r.source,'source "'+r.source+'" not found'))}else e.push(new er(n,r,'missing required property "source"'));return e=e.concat(or({key:n,value:r,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Cr({key:n+".type",value:r.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"})},filter:br,layout:function(t){return or({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return Sr(M({layerType:s},t))}}})},paint:function(t){return or({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return _r(M({layerType:s},t))}}})}}}))}function Ir(t){var e=t.value,r=t.key,n=Me(e);return"string"!==n?[new er(r,e,"string expected, "+n+" found")]:[]}var Ar={promoteId:function(t){var e=t.key,r=t.value;if("string"===Me(r))return Ir({key:e,value:r});var n=[];for(var i in r)n.push.apply(n,Ir({key:e+"."+i,value:r[i]}));return n}};function zr(t){var e=t.value,r=t.key,n=t.styleSpec,i=t.style;if(!e.type)return[new er(r,e,'"type" is required')];var o,a=nr(e.type);switch(a){case"vector":case"raster":case"raster-dem":return or({key:r,value:e,valueSpec:n["source_"+a.replace("-","_")],style:t.style,styleSpec:n,objectElementValidators:Ar});case"geojson":if(o=or({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n,objectElementValidators:Ar}),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,lr({key:r+"."+s+".map",value:u[1],expressionContext:"cluster-map"})),o.push.apply(o,lr({key:r+"."+s+".reduce",value:p,expressionContext:"cluster-reduce"}))}return o;case"video":return or({key:r,value:e,valueSpec:n.source_video,style:i,styleSpec:n});case"image":return or({key:r,value:e,valueSpec:n.source_image,style:i,styleSpec:n});case"canvas":return[new er(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return pr({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,styleSpec:n})}}function Mr(t){var e=t.value,r=t.styleSpec,n=r.light,i=t.style,o=[],a=Me(e);if(void 0===e)return o;if("object"!==a)return o.concat([new er("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?Cr({key:s,value:e[s],valueSpec:r.transition,style:i,styleSpec:r}):n[s]?Cr({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r}):[new er(s,e[s],'unknown property "'+s+'"')])}return o}var Pr={"*":function(){return[]},array:ar,boolean:function(t){var e=t.value,r=t.key,n=Me(e);return"boolean"!==n?[new er(r,e,"boolean expected, "+n+" found")]:[]},number:sr,color:function(t){var e=t.key,r=t.value,n=Me(r);return"string"!==n?[new er(e,r,"color expected, "+n+" found")]:null===A(r)?[new er(e,r,'color expected, "'+r+'" found')]:[]},constants:rr,enum:pr,filter:br,function:ur,layer:kr,object:or,source:zr,light:Mr,string:Ir,formatted:function(t){return 0===Ir(t).length?[]:lr(t)},resolvedImage:function(t){return 0===Ir(t).length?[]:lr(t)}};function Cr(t){var e=t.value,r=t.valueSpec,n=t.styleSpec;return r.expression&&Pe(nr(e))?ur(t):r.expression&&Oe(ir(e))?lr(t):r.type&&Pr[r.type]?Pr[r.type](t):or(M({},t,{valueSpec:r.type?n[r.type]:r}))}function Br(t){var e=t.value,r=t.key,n=Ir(t);return n.length||(-1===e.indexOf("{fontstack}")&&n.push(new er(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new er(r,e,'"glyphs" url must include a "{range}" token'))),n}function Vr(t,e){void 0===e&&(e=tr);var r=[];return r=r.concat(Cr({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:Br,"*":function(){return[]}}})),t.constants&&(r=r.concat(rr({key:"constants",value:t.constants,style:t,styleSpec:e}))),Tr(r)}function Tr(t){return[].concat(t).sort((function(t,e){return t.line-e.line}))}function Er(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return Tr(t.apply(this,e))}}function Dr(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function Fr(t,e,r){if(r&&r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}Vr.source=Er(zr),Vr.light=Er(Mr),Vr.layer=Er(kr),Vr.filter=Er(br),Vr.paintProperty=Er(_r),Vr.layoutProperty=Er(Sr);var Or=function(t,e){void 0===e&&(e={}),u(this,e),this.type=t},Lr=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"error",u({error:e},r))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Or),jr=function(){};jr.prototype.on=function(t,e){return this._listeners=this._listeners||{},Dr(t,e,this._listeners),this},jr.prototype.off=function(t,e){return Fr(t,e,this._listeners),Fr(t,e,this._oneTimeListeners),this},jr.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},Dr(t,e,this._oneTimeListeners),this},jr.prototype.fire=function(t,e){"string"==typeof t&&(t=new Or(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,a=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];o<a.length;o+=1){var s=a[o];Fr(r,s,this._oneTimeListeners),s.call(this,t)}var l=this._eventedParent;l&&(u(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),l.fire(t))}else t instanceof Lr&&console.error(t.error);return this},jr.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)},jr.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var qr=Vr,Rr=qr.paintProperty,Ur=qr.layoutProperty,Nr=function(){this.first=!0};Nr.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 Zr=function(t){return t>=1536&&t<=1791},Gr=function(t){return t>=1872&&t<=1919},Xr=function(t){return t>=2208&&t<=2303},Yr=function(t){return t>=11904&&t<=12031},Jr=function(t){return t>=12032&&t<=12255},Kr=function(t){return t>=12272&&t<=12287},Hr=function(t){return t>=12288&&t<=12351},Wr=function(t){return t>=12352&&t<=12447},$r=function(t){return t>=12448&&t<=12543},Qr=function(t){return t>=12544&&t<=12591},tn=function(t){return t>=12704&&t<=12735},en=function(t){return t>=12736&&t<=12783},rn=function(t){return t>=12784&&t<=12799},nn=function(t){return t>=12800&&t<=13055},on=function(t){return t>=13056&&t<=13311},an=function(t){return t>=13312&&t<=19903},sn=function(t){return t>=19968&&t<=40959},un=function(t){return t>=40960&&t<=42127},ln=function(t){return t>=42128&&t<=42191},pn=function(t){return t>=63744&&t<=64255},cn=function(t){return t>=64336&&t<=65023},hn=function(t){return t>=65040&&t<=65055},fn=function(t){return t>=65072&&t<=65103},yn=function(t){return t>=65104&&t<=65135},dn=function(t){return t>=65136&&t<=65279},mn=function(t){return t>=65280&&t<=65519};function vn(t){for(var e=0,r=t;e<r.length;e+=1)if(gn(r[e].charCodeAt(0)))return!0;return!1}function gn(t){return!(746!==t&&747!==t&&(t<4352||!(tn(t)||Qr(t)||fn(t)&&!(t>=65097&&t<=65103)||pn(t)||on(t)||Yr(t)||en(t)||!(!Hr(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||an(t)||sn(t)||nn(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)||Wr(t)||Kr(t)||function(t){return t>=12688&&t<=12703}(t)||Jr(t)||rn(t)||$r(t)&&12540!==t||!(!mn(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)||!(!yn(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)||hn(t)||function(t){return t>=19904&&t<=19967}(t)||un(t)||ln(t))))}function xn(t){return!(gn(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)||Hr(t)||$r(t)||function(t){return t>=57344&&t<=63743}(t)||fn(t)||yn(t)||mn(t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function bn(t){return t>=1424&&t<=2303||cn(t)||dn(t)}function wn(t,e){return!(!e&&bn(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||function(t){return t>=6016&&t<=6143}(t))}function _n(t){for(var e=0,r=t;e<r.length;e+=1)if(bn(r[e].charCodeAt(0)))return!0;return!1}var Sn,kn,In={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},An=(i.performance&&i.performance.now?i.performance.now.bind(i.performance):Date.now.bind(Date),{supported:!1,testSupport:function(t){!zn&&kn&&(Mn?Pn(t):Sn=t)}}),zn=!1,Mn=!1;function Pn(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,kn),t.isContextLost())return;An.supported=!0}catch(t){}t.deleteTexture(e),zn=!0}i.document&&((kn=i.document.createElement("img")).onload=function(){Sn&&Pn(Sn),Sn=null,Mn=!0},kn.onerror=function(){zn=!0,Sn=null},kn.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var Cn=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Bn(t){return Cn.test(t)}var Vn=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Tn(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(i.atob(e[1]).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch(t){return null}}var En=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};En.prototype.getStorageKey=function(t){var e,r=Tn(In.ACCESS_TOKEN);return e=r&&r.u?i.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},En.prototype.fetchEventData=function(){var t=_("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var n=i.localStorage.getItem(e);n&&(this.eventData=JSON.parse(n));var o=i.localStorage.getItem(r);o&&(this.anonId=o)}catch(t){d("Unable to read from LocalStorage")}},En.prototype.saveEventData=function(){var t=_("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{i.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&i.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){d("Unable to write to LocalStorage")}},En.prototype.processRequests=function(t){},En.prototype.postEvent=function(t,e,r,n){var i=this;if(In.EVENTS_URL){var o=function(t){var e=t.match(Vn);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("&"):[]}}(In.EVENTS_URL);o.params.push("access_token="+(n||In.ACCESS_TOKEN||""));var a,s,l={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.2",skuId:"01",userId:this.anonId},p=e?u(l,e):l,c={url:(a=o,s=a.params.length?"?"+a.params.join("&"):"",a.protocol+"://"+a.authority+a.path+s),headers:{"Content-Type":"text/plain"},body:JSON.stringify([p])};this.pendingRequest=Gn(c,(function(t){i.pendingRequest=null,r(t),i.saveEventData(),i.processRequests(n)}))}},En.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var Dn,Fn,On=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,(In.EVENTS_URL&&n||In.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(),p(this.anonId)||(this.anonId=l()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}(En),Ln=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){In.EVENTS_URL&&In.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return function(t){return 0===t.indexOf("mapbox:")}(t)||Bn(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=Tn(In.ACCESS_TOKEN),n=r?r.u:In.ACCESS_TOKEN,i=n!==this.eventData.tokenU;p(this.anonId)||(this.anonId=l(),i=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var a=new Date(this.eventData.lastSuccess),s=new Date(o),u=(o-this.eventData.lastSuccess)/864e5;i=i||u>=1||u<-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}(En)),jn=(Ln.postTurnstileEvent.bind(Ln),new On);function qn(){i.caches&&!Dn&&(Dn=i.caches.open("mapbox-tiles"))}function Rn(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}jn.postMapLoadEvent.bind(jn),"function"==typeof Object.freeze&&Object.freeze({Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"});var Un=function(t){function e(e,r,n){401===r&&Bn(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),Nn=g()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===i.location.protocol?i.parent:i).location.href};var Zn=function(t,e){if(!(/^file:/.test(r=t.url)||/^file:/.test(Nn())&&!/^\w+:/.test(r))){if(i.fetch&&i.Request&&i.AbortController&&i.Request.prototype.hasOwnProperty("signal"))return function(t,e){var r,n=new i.AbortController,o=new i.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:Nn(),signal:n.signal}),a=!1,s=!1,u=(r=o.url).indexOf("sku=")>0&&Bn(r);"json"===t.type&&o.headers.set("Accept","application/json");var l=function(r,n,a){if(!s){if(r&&"SecurityError"!==r.message&&d(r),n&&a)return p(n);var l=Date.now();i.fetch(o).then((function(r){if(r.ok){var n=u?r.clone():null;return p(r,n,l)}return e(new Un(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},p=function(r,n,u){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){s||(n&&u&&function(t,e,r){if(qn(),Dn){var n={status:e.status,statusText:e.statusText,headers:new i.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var o=x(e.headers.get("Cache-Control")||"");o["no-store"]||(o["max-age"]&&n.headers.set("Expires",new Date(r+1e3*o["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===Fn)try{new Response(new ReadableStream),Fn=!0}catch(t){Fn=!1}Fn?e(t.body):t.blob().then(e)}(e,(function(e){var r=new i.Response(e,n);qn(),Dn&&Dn.then((function(e){return e.put(Rn(t.url),r)})).catch((function(t){return d(t.message)}))})))}}(o,n,u),a=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){s||e(new Error(t.message))}))};return u?function(t,e){if(qn(),!Dn)return e(null);var r=Rn(t.url);Dn.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=x(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)}(o,l):l(null,null),{cancel:function(){s=!0,a||n.abort()}}}(t,e);if(g()&&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 i.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 Un(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},Gn=function(t,e){return Zn(u(t,{method:"POST"}),e)},Xn="unavailable",Yn=null,Jn={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===Xn||null!=Jn.applyArabicShaping},isLoading:function(){return"loading"===Xn},setState:function(t){Xn=t.pluginStatus,Yn=t.pluginURL},isParsed:function(){return null!=Jn.applyArabicShaping&&null!=Jn.processBidirectionalText&&null!=Jn.processStyledBidirectionalText},getPluginURL:function(){return Yn}},Kn=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 Nr,this.transition={})};Kn.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;r<n.length;r+=1)if(!wn(n[r].charCodeAt(0),e))return!1;return!0}(t,Jn.isLoaded())},Kn.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Kn.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 Hn=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Pe(t))return new Ue(t,e);if(Oe(t)){var r=Re(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=z.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};Hn.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Hn.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var Wn=function(t){this.property=t,this.value=new Hn(t,void 0)};Wn.prototype.transitioned=function(t,e){return new Qn(this.property,this.value,e,u({},t.transition,this.transition),t.now)},Wn.prototype.untransitioned=function(){return new Qn(this.property,this.value,null,{},0)};var $n=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};$n.prototype.getValue=function(t){return f(this._values[t].value.value)},$n.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Wn(this._values[t].property)),this._values[t].value=new Hn(this._values[t].property,null===e?void 0:f(e))},$n.prototype.getTransition=function(t){return f(this._values[t].transition)},$n.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Wn(this._values[t].property)),this._values[t].transition=f(e)||void 0},$n.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},$n.prototype.transitioned=function(t,e){for(var r=new ti(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},$n.prototype.untransitioned=function(){for(var t=new ti(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 Qn=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)};Qn.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 ti=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};ti.prototype.possiblyEvaluate=function(t,e,r){for(var n=new ni(this._properties),i=0,o=Object.keys(this._values);i<o.length;i+=1){var a=o[i];n._values[a]=this._values[a].possiblyEvaluate(t,e,r)}return n},ti.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 ei=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};ei.prototype.getValue=function(t){return f(this._values[t].value)},ei.prototype.setValue=function(t,e){this._values[t]=new Hn(this._values[t].property,null===e?void 0:f(e))},ei.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},ei.prototype.possiblyEvaluate=function(t,e,r){for(var n=new ni(this._properties),i=0,o=Object.keys(this._values);i<o.length;i+=1){var a=o[i];n._values[a]=this._values[a].possiblyEvaluate(t,e,r)}return n};var ri=function(t,e,r){this.property=t,this.value=e,this.parameters=r};ri.prototype.isConstant=function(){return"constant"===this.value.kind},ri.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},ri.prototype.evaluate=function(t,e,r,n){return this.property.evaluate(this.value,this.parameters,t,e,r,n)};var ni=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};ni.prototype.get=function(t){return this._values[t]};var ii=function(t){this.specification=t};ii.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},ii.prototype.interpolate=function(t,e,r){var n=Ot[this.specification.type];return n?n(t,e,r):t};var oi=function(t,e){this.specification=t,this.overrides=e};oi.prototype.possiblyEvaluate=function(t,e,r,n){return new ri(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},r,n)}:t.expression,e)},oi.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 ri(this,{kind:"constant",value:void 0},t.parameters);var n=Ot[this.specification.type];return n?new ri(this,{kind:"constant",value:n(t.value.value,e.value.value,r)},t.parameters):t},oi.prototype.evaluate=function(t,e,r,n,i,o){return"constant"===t.kind?t.value:t.evaluate(e,r,n,i,o)};var ai=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 ri(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 ri(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 ri(this,{kind:"constant",value:s},e)}return new ri(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}(oi),si=function(t){this.specification=t};si.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 Kn(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Kn(Math.floor(e.zoom),e)),t.expression.evaluate(new Kn(Math.floor(e.zoom+1),e)),e)}},si.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},si.prototype.interpolate=function(t){return t};var ui=function(t){this.specification=t};ui.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},ui.prototype.interpolate=function(){return!1};var li=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 Hn(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new Wn(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};Xe("DataDrivenProperty",oi),Xe("DataConstantProperty",ii),Xe("CrossFadedDataDrivenProperty",ai),Xe("CrossFadedProperty",si),Xe("ColorRampProperty",ui);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 ei(r.layout)),r.paint)){for(var n in this._transitionablePaint=new $n(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(),this.paint=new ni(r.paint)}}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(Ur,"layers."+this.id+".layout."+t,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return c(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(Rr,"layers."+this.id+".paint."+t,t,e,r))return!1;if(c(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,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,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 Lr(new Error(i[n].message))),r=!0;return r}(this,t.call(qr,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:tr,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 ri&&Ie(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(jr),ci={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},hi=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},fi=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function yi(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=di(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:di(r,Math.max(n,e)),alignment:e}}function di(t,e){return Math.ceil(t/e)*e}fi.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},fi.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},fi.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},fi.prototype.clear=function(){this.length=0},fi.prototype.resize=function(t){this.reserve(t),this.length=t},fi.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)}},fi.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var mi=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}(fi);mi.prototype.bytesPerElement=4,Xe("StructArrayLayout2i4",mi);var vi=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}(fi);vi.prototype.bytesPerElement=8,Xe("StructArrayLayout4i8",vi);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}(fi);gi.prototype.bytesPerElement=12,Xe("StructArrayLayout2i4i12",gi);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)},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}(fi);xi.prototype.bytesPerElement=8,Xe("StructArrayLayout2i4ub8",xi);var bi=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}(fi);bi.prototype.bytesPerElement=8,Xe("StructArrayLayout2f8",bi);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,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=10*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.uint16[c+8]=l,this.uint16[c+9]=p,t},e}(fi);wi.prototype.bytesPerElement=20,Xe("StructArrayLayout10ui20",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.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}(fi);_i.prototype.bytesPerElement=24,Xe("StructArrayLayout4i4ui4i24",_i);var Si=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}(fi);Si.prototype.bytesPerElement=12,Xe("StructArrayLayout3f12",Si);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.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}(fi);ki.prototype.bytesPerElement=4,Xe("StructArrayLayout1ul4",ki);var Ii=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){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,n,i,o,a,s,u)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l){var p=10*t,c=5*t;return this.int16[p+0]=e,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.int16[p+4]=o,this.int16[p+5]=a,this.uint32[c+3]=s,this.uint16[p+8]=u,this.uint16[p+9]=l,t},e}(fi);Ii.prototype.bytesPerElement=20,Xe("StructArrayLayout6i1ul2ui20",Ii);var Ai=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}(fi);Ai.prototype.bytesPerElement=12,Xe("StructArrayLayout2i2i2i12",Ai);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),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i)},e.prototype.emplace=function(t,e,r,n,i,o){var a=4*t,s=8*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.int16[s+6]=i,this.int16[s+7]=o,t},e}(fi);zi.prototype.bytesPerElement=16,Xe("StructArrayLayout2f1f2i16",zi);var Mi=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}(fi);Mi.prototype.bytesPerElement=12,Xe("StructArrayLayout2ub2f12",Mi);var Pi=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}(fi);Pi.prototype.bytesPerElement=6,Xe("StructArrayLayout3ui6",Pi);var Ci=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}(fi);Ci.prototype.bytesPerElement=48,Xe("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Ci);var Bi=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,k,I,A,z){var M=this.length;return this.resize(M+1),this.emplace(M,t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m,v,g,x,b,w,_,S,k,I,A,z)},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,k,I,A,z,M){var P=34*t,C=17*t;return this.int16[P+0]=e,this.int16[P+1]=r,this.int16[P+2]=n,this.int16[P+3]=i,this.int16[P+4]=o,this.int16[P+5]=a,this.int16[P+6]=s,this.int16[P+7]=u,this.uint16[P+8]=l,this.uint16[P+9]=p,this.uint16[P+10]=c,this.uint16[P+11]=h,this.uint16[P+12]=f,this.uint16[P+13]=y,this.uint16[P+14]=d,this.uint16[P+15]=m,this.uint16[P+16]=v,this.uint16[P+17]=g,this.uint16[P+18]=x,this.uint16[P+19]=b,this.uint16[P+20]=w,this.uint16[P+21]=_,this.uint16[P+22]=S,this.uint32[C+12]=k,this.float32[C+13]=I,this.float32[C+14]=A,this.float32[C+15]=z,this.float32[C+16]=M,t},e}(fi);Bi.prototype.bytesPerElement=68,Xe("StructArrayLayout8i15ui1ul4f68",Bi);var Vi=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}(fi);Vi.prototype.bytesPerElement=4,Xe("StructArrayLayout1f4",Vi);var Ti=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}(fi);Ti.prototype.bytesPerElement=6,Xe("StructArrayLayout3i6",Ti);var Ei=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}(fi);Ei.prototype.bytesPerElement=8,Xe("StructArrayLayout1ul2ui8",Ei);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.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}(fi);Di.prototype.bytesPerElement=4,Xe("StructArrayLayout2ui4",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.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}(fi);Fi.prototype.bytesPerElement=2,Xe("StructArrayLayout1ui2",Fi);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.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}(fi);Oi.prototype.bytesPerElement=16,Xe("StructArrayLayout4f16",Oi);var Li=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},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.anchorPoint.get=function(){return new r(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,n),e}(hi);Li.prototype.size=20;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.get=function(t){return new Li(this,t)},e}(Ii);Xe("CollisionBoxArray",ji);var qi=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}(hi);qi.prototype.size=48;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.get=function(t){return new qi(this,t)},e}(Ci);Xe("PlacedSymbolArray",Ri);var Ui=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},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,r),e}(hi);Ui.prototype.size=68;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.get=function(t){return new Ui(this,t)},e}(Bi);Xe("SymbolInstanceArray",Ni);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.getoffsetX=function(t){return this.float32[1*t+0]},e}(Vi);Xe("GlyphOffsetArray",Zi);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.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}(Ti);Xe("SymbolLineVertexArray",Gi);var Xi=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}(hi);Xi.prototype.size=8;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.get=function(t){return new Xi(this,t)},e}(Ei);Xe("FeatureIndexArray",Yi);var Ji=yi([{name:"a_pos",components:2,type:"Int16"}],4).members,Ki=function(t){void 0===t&&(t=[]),this.segments=t};function Hi(t,e){return 256*(t=a(Math.floor(t),0,255))+a(Math.floor(e),0,255)}Ki.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>Ki.MAX_VERTEX_ARRAY_LENGTH&&d("Max vertices per segment is "+Ki.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>Ki.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},Ki.prototype.get=function(){return this.segments},Ki.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()}},Ki.simpleSegment=function(t,e,r,n){return new Ki([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])},Ki.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Xe("SegmentVector",Ki);var Wi=yi([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),$i=I((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}})),Qi=I((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}})),to=$i,eo=Qi;to.murmur3=$i,to.murmur2=eo;var ro=function(){this.ids=[],this.positions=[],this.indexed=!1};ro.prototype.add=function(t,e,r,n){this.ids.push(io(t)),this.positions.push(e,r,n)},ro.prototype.getPositions=function(t){for(var e=io(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},ro.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,i){for(;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;oo(e,a,s),oo(r,3*a,3*s),oo(r,3*a+1,3*s+1),oo(r,3*a+2,3*s+2)}s-n<i-s?(t(e,r,n,s),n=s+1):(t(e,r,s+1,i),i=s)}}(r,n,0,r.length-1),e&&e.push(r.buffer,n.buffer),{ids:r,positions:n}},ro.deserialize=function(t){var e=new ro;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e};var no=Math.pow(2,53)-1;function io(t){var e=+t;return!isNaN(e)&&e<=no?e:to(String(t))}function oo(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}Xe("FeaturePositionMap",ro);var ao=function(t,e){this.gl=t.gl,this.location=e},so=(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)),uo=(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)),lo=function(t){function e(e,r){t.call(this,e,r),this.current=z.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),po=new Float32Array(16);function co(t){return[Hi(255*t.r,255*t.g),Hi(255*t.b,255*t.a)]}!function(t){function e(e,r){t.call(this,e,r),this.current=po}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 ho=function(t,e,r){this.value=t,this.uniformNames=e.map((function(t){return"u_"+t})),this.type=r};ho.prototype.setUniform=function(t,e,r){t.set(r.constantOr(this.value))},ho.prototype.getBinding=function(t,e,r){return"color"===this.type?new lo(t,e):new so(t,e)};var fo=function(t,e){this.uniformNames=e.map((function(t){return"u_"+t})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};fo.prototype.setConstantPatternPositions=function(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr},fo.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)},fo.prototype.getBinding=function(t,e,r){return"u_pattern"===r.substr(0,9)?new uo(t,e):new so(t,e)};var yo=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};yo.prototype.populatePaintArray=function(t,e,r,n,i){var o=this.paintVertexArray.length,a=this.expression.evaluate(new Kn(0),e,{},n,[],i);this.paintVertexArray.resize(t),this._setPaintValue(o,t,a)},yo.prototype.updatePaintArray=function(t,e,r,n){var i=this.expression.evaluate({zoom:0},r,n);this._setPaintValue(t,e,i)},yo.prototype._setPaintValue=function(t,e,r){if("color"===this.type)for(var n=co(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))}},yo.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))},yo.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var mo=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};mo.prototype.populatePaintArray=function(t,e,r,n,i){var o=this.expression.evaluate(new Kn(this.zoom),e,{},n,[],i),a=this.expression.evaluate(new Kn(this.zoom+1),e,{},n,[],i),s=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(s,t,o,a)},mo.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)},mo.prototype._setPaintValue=function(t,e,r,n){if("color"===this.type)for(var i=co(r),o=co(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))}},mo.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))},mo.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},mo.prototype.setUniform=function(t,e){var r=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,n=a(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);t.set(n)},mo.prototype.getBinding=function(t,e,r){return new so(t,e)};var vo=function(t,e,r,n,i,o){this.expression=t,this.type=e,this.useIntegerZoom=r,this.zoom=n,this.layerId=o,this.zoomInPaintVertexArray=new i,this.zoomOutPaintVertexArray=new i};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,Wi.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,Wi.members,this.expression.isStateDependent))},vo.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var go=function(t,e,r){this.binders={},this._buffers=[];var n=[];for(var i in t.paint._values)if(r(i)){var o=t.paint.get(i);if(o instanceof ri&&Ie(o.property.specification)){var a=bo(i,t.type),s=o.value,u=o.property.specification.type,l=o.property.useIntegerZoom,p=o.property.specification["property-type"],c="cross-faded"===p||"cross-faded-data-driven"===p;if("constant"===s.kind)this.binders[i]=c?new fo(s.value,a):new ho(s.value,a,u),n.push("/u_"+i);else if("source"===s.kind||c){var h=wo(i,u,"source");this.binders[i]=c?new vo(s,u,l,e,h,t.id):new yo(s,a,u,h),n.push("/a_"+i)}else{var f=wo(i,u,"composite");this.binders[i]=new mo(s,a,u,l,e,f),n.push("/z_"+i)}}}this.cacheKey=n.sort().join("")};go.prototype.getMaxValue=function(t){var e=this.binders[t];return e instanceof yo||e instanceof mo?e.maxValue:0},go.prototype.populatePaintArrays=function(t,e,r,n,i){for(var o in this.binders){var a=this.binders[o];(a instanceof yo||a instanceof mo||a instanceof vo)&&a.populatePaintArray(t,e,r,n,i)}},go.prototype.setConstantPatternPositions=function(t,e){for(var r in this.binders){var n=this.binders[r];n instanceof fo&&n.setConstantPatternPositions(t,e)}},go.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 yo||h instanceof mo||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},go.prototype.defines=function(){var t=[];for(var e in this.binders){var r=this.binders[e];(r instanceof ho||r instanceof fo)&&t.push.apply(t,r.uniformNames.map((function(t){return"#define HAS_UNIFORM_"+t})))}return t},go.prototype.getBinderAttributes=function(){var t=[];for(var e in this.binders){var r=this.binders[e];if(r instanceof yo||r instanceof mo)for(var n=0;n<r.paintVertexAttributes.length;n++)t.push(r.paintVertexAttributes[n].name);else if(r instanceof vo)for(var i=0;i<Wi.members.length;i++)t.push(Wi.members[i].name)}return t},go.prototype.getBinderUniforms=function(){var t=[];for(var e in this.binders){var r=this.binders[e];if(r instanceof ho||r instanceof fo||r instanceof mo)for(var n=0,i=r.uniformNames;n<i.length;n+=1)t.push(i[n])}return t},go.prototype.getPaintVertexBuffers=function(){return this._buffers},go.prototype.getUniforms=function(t,e){var r=[];for(var n in this.binders){var i=this.binders[n];if(i instanceof ho||i instanceof fo||i instanceof mo)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},go.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)}},go.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 yo||r instanceof mo)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}},go.prototype.upload=function(t){for(var e in this.binders){var r=this.binders[e];(r instanceof yo||r instanceof mo||r instanceof vo)&&r.upload(t)}this.updatePaintBuffers()},go.prototype.destroy=function(){for(var t in this.binders){var e=this.binders[t];(e instanceof yo||e instanceof mo||e instanceof vo)&&e.destroy()}};var xo=function(t,e,r){void 0===r&&(r=function(){return!0}),this.programConfigurations={};for(var n=0,i=t;n<i.length;n+=1){var o=i[n];this.programConfigurations[o.id]=new go(o,e,r)}this.needsUpload=!1,this._featureMap=new ro,this._bufferOffset=0};function bo(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 wo(t,e,r){var n={color:{source:bi,composite:Oi},number:{source:Vi,composite:bi}},i=function(t){return{"line-pattern":{source:wi,composite:wi},"fill-pattern":{source:wi,composite:wi},"fill-extrusion-pattern":{source:wi,composite:wi}}[t]}(t);return i&&i[r]||n[e][r]}xo.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},xo.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}},xo.prototype.get=function(t){return this.programConfigurations[t]},xo.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},xo.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},Xe("ConstantBinder",ho),Xe("CrossFadedConstantBinder",fo),Xe("SourceExpressionBinder",yo),Xe("CrossFadedCompositeBinder",vo),Xe("CompositeExpressionBinder",mo),Xe("ProgramConfiguration",go,{omit:["_buffers"]}),Xe("ProgramConfigurationSet",xo);var _o=Math.pow(2,14)-1,So=-_o-1;function ko(t){for(var e=8192/t.extent,r=t.loadGeometry(),n=0;n<r.length;n++)for(var i=r[n],o=0;o<i.length;o++){var s=i[o],u=Math.round(s.x*e),l=Math.round(s.y*e);s.x=a(u,So,_o),s.y=a(l,So,_o),(u<s.x||u>s.x+1||l<s.y||l>s.y+1)&&d("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function Io(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?ko(t):[]}}function Ao(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var zo=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 mi,this.indexArray=new Pi,this.segments=new Ki,this.programConfigurations=new xo(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Mo(t,e){for(var r=0;r<t.length;r++)if(Oo(e,t[r]))return!0;for(var n=0;n<e.length;n++)if(Oo(t,e[n]))return!0;return!!Vo(t,e)}function Po(t,e,r){return!!Oo(t,e)||!!Eo(e,t,r)}function Co(t,e){if(1===t.length)return Fo(e,t[0]);for(var r=0;r<e.length;r++)for(var n=e[r],i=0;i<n.length;i++)if(Oo(t,n[i]))return!0;for(var o=0;o<t.length;o++)if(Fo(e,t[o]))return!0;for(var a=0;a<e.length;a++)if(Vo(t,e[a]))return!0;return!1}function Bo(t,e,r){if(t.length>1){if(Vo(t,e))return!0;for(var n=0;n<e.length;n++)if(Eo(e[n],t,r))return!0}for(var i=0;i<t.length;i++)if(Eo(t[i],e,r))return!0;return!1}function Vo(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(To(n,i,e[o],e[o+1]))return!0;return!1}function To(t,e,r,n){return m(t,r,n)!==m(e,r,n)&&m(t,e,r)!==m(t,e,n)}function Eo(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(Do(t,e[i-1],e[i])<n)return!0;return!1}function Do(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 Fo(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 Oo(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 Lo(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=m(t,e,r[0]);return o!==m(t,e,r[1])||o!==m(t,e,r[2])||o!==m(t,e,r[3])}function jo(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function qo(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ro(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}zo.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=Io(l,f);if(this.layers[0]._featureFilter.filter(new Kn(this.zoom),y,r)){var d=o?o.evaluate(y,{},r):void 0,m={id:p,properties:l.properties,type:l.type,sourceLayerIndex:h,index:c,geometry:f?y.geometry:ko(l),patterns:{},sortKey:d};i.push(m)}}o&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var v=0,g=i;v<g.length;v+=1){var x=g[v],b=x.geometry,w=x.index,_=x.sourceLayerIndex,S=t[w].feature;this.addFeature(x,b,w,r),e.featureIndex.insert(S,b,w,_,this.index)}},zo.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},zo.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},zo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},zo.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ji),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},zo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},zo.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;Ao(this.layoutVertexArray,l,p,-1,-1),Ao(this.layoutVertexArray,l,p,1,-1),Ao(this.layoutVertexArray,l,p,1,1),Ao(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)},Xe("CircleBucket",zo,{omit:["layers"]});var Uo=new li({"circle-sort-key":new oi(tr.layout_circle["circle-sort-key"])}),No={paint:new li({"circle-radius":new oi(tr.paint_circle["circle-radius"]),"circle-color":new oi(tr.paint_circle["circle-color"]),"circle-blur":new oi(tr.paint_circle["circle-blur"]),"circle-opacity":new oi(tr.paint_circle["circle-opacity"]),"circle-translate":new ii(tr.paint_circle["circle-translate"]),"circle-translate-anchor":new ii(tr.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new ii(tr.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new ii(tr.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new oi(tr.paint_circle["circle-stroke-width"]),"circle-stroke-color":new oi(tr.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new oi(tr.paint_circle["circle-stroke-opacity"])}),layout:Uo},Zo="undefined"!=typeof Float32Array?Float32Array:Array;function Go(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Xo(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)}),Yo=new Zo(4),Zo!=Float32Array&&(Yo[0]=0,Yo[1]=0,Yo[2]=0,Yo[3]=0);var Yo,Jo=function(t){function e(e){t.call(this,e,No)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new zo(t)},e.prototype.queryRadius=function(t){var e=t;return jo("circle-radius",this,e)+jo("circle-stroke-width",this,e)+qo(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a,s){for(var u=Ro(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 Ko(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:Ko(v,s),x=h,b=Xo([],[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]),Po(c,g,x))return!0}return!1},e}(pi);function Ko(t,e){var n=Xo([],[t.x,t.y,0,1],e);return new r(n[0]/n[3],n[1]/n[3])}var Ho=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(zo);function Wo(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 $o(t,e,r){var n=e.width,i=e.height;if(n!==t.width||i!==t.height){var o=Wo({},{width:n,height:i},r);Qo(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 Qo(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}Xe("HeatmapBucket",Ho,{omit:["layers"]});var ta=function(t,e){Wo(this,t,1,e)};ta.prototype.resize=function(t){$o(this,t,1)},ta.prototype.clone=function(){return new ta({width:this.width,height:this.height},new Uint8Array(this.data))},ta.copy=function(t,e,r,n,i){Qo(t,e,r,n,i,1)};var ea=function(t,e){Wo(this,t,4,e)};ea.prototype.resize=function(t){$o(this,t,4)},ea.prototype.replace=function(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t},ea.prototype.clone=function(){return new ea({width:this.width,height:this.height},new Uint8Array(this.data))},ea.copy=function(t,e,r,n,i){Qo(t,e,r,n,i,4)},Xe("AlphaImage",ta),Xe("RGBAImage",ea);var ra={paint:new li({"heatmap-radius":new oi(tr.paint_heatmap["heatmap-radius"]),"heatmap-weight":new oi(tr.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new ii(tr.paint_heatmap["heatmap-intensity"]),"heatmap-color":new ui(tr.paint_heatmap["heatmap-color"]),"heatmap-opacity":new ii(tr.paint_heatmap["heatmap-opacity"])})},na=function(t){function e(e){t.call(this,e,ra),this._updateColorRamp()}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new Ho(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},e.prototype._updateColorRamp=function(){this.colorRamp=function(t){var e={},r=t.resolution||256,n=t.clips?t.clips.length:1,i=t.image||new ea({width:r,height:n}),o=function(r,n,o){e[t.evaluationKey]=o;var a=t.expression.evaluate(e);i.data[r+n+0]=Math.floor(255*a.r/a.a),i.data[r+n+1]=Math.floor(255*a.g/a.a),i.data[r+n+2]=Math.floor(255*a.b/a.a),i.data[r+n+3]=Math.floor(255*a.a)};if(t.clips)for(var a=0,s=0;a<n;++a,s+=4*r)for(var u=0,l=0;u<r;u++,l+=4){var p=u/(r-1),c=t.clips[a];o(s,l,c.start*(1-p)+c.end*p)}else for(var h=0,f=0;h<r;h++,f+=4)o(0,f,h/(r-1));return i}({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),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),ia={paint:new li({"hillshade-illumination-direction":new ii(tr.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new ii(tr.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new ii(tr.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new ii(tr.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new ii(tr.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new ii(tr.paint_hillshade["hillshade-accent-color"])})},oa=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.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},e}(pi),aa=yi([{name:"a_pos",components:2,type:"Int16"}],4).members,sa=la,ua=la;function la(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=pa(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=pa(t,e[i]*n,i<o-1?e[i+1]*n:t.length,n,!1))===a.next&&(a.steiner=!0),s.push(wa(a));for(s.sort(va),i=0;i<s.length;i++)ga(s[i],r),r=ca(r,r.next);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))?1/l:0}return ha(h,f,r,n,i,l),f}function pa(t,e,r,n,i){var o,a;if(i===Ea(t,e,r,n)>0)for(o=e;o<r;o+=n)a=Ba(o,t[o],t[o+1],a);else for(o=r-n;o>=e;o-=n)a=Ba(o,t[o],t[o+1],a);return a&&Ia(a,a.next)&&(Va(a),a=a.next),a}function ca(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!Ia(n,n.next)&&0!==ka(n.prev,n,n.next))n=n.next;else{if(Va(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function ha(t,e,r,n,i,o,a){if(t){!a&&o&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=ba(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?ya(t,n,i,o):fa(t))e.push(s.i/r),e.push(t.i/r),e.push(u.i/r),Va(t),t=u.next,l=u.next;else if((t=u)===l){a?1===a?ha(t=da(ca(t),e,r),e,r,n,i,o,2):2===a&&ma(t,e,r,n,i,o):ha(ca(t),e,r,n,i,o,1);break}}}function fa(t){var e=t.prev,r=t,n=t.next;if(ka(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(_a(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&ka(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function ya(t,e,r,n){var i=t.prev,o=t,a=t.next;if(ka(i,o,a)>=0)return!1;for(var s=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,u=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,l=ba(i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,e,r,n),p=ba(s,u,e,r,n),c=t.prevZ,h=t.nextZ;c&&c.z>=l&&h&&h.z<=p;){if(c!==t.prev&&c!==t.next&&_a(i.x,i.y,o.x,o.y,a.x,a.y,c.x,c.y)&&ka(c.prev,c,c.next)>=0)return!1;if(c=c.prevZ,h!==t.prev&&h!==t.next&&_a(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&ka(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(;c&&c.z>=l;){if(c!==t.prev&&c!==t.next&&_a(i.x,i.y,o.x,o.y,a.x,a.y,c.x,c.y)&&ka(c.prev,c,c.next)>=0)return!1;c=c.prevZ}for(;h&&h.z<=p;){if(h!==t.prev&&h!==t.next&&_a(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&ka(h.prev,h,h.next)>=0)return!1;h=h.nextZ}return!0}function da(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!Ia(i,o)&&Aa(i,n,n.next,o)&&Pa(i,o)&&Pa(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),Va(n),Va(n.next),n=t=o),n=n.next}while(n!==t);return ca(n)}function ma(t,e,r,n,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Sa(a,s)){var u=Ca(a,s);return a=ca(a,a.next),u=ca(u,u.next),ha(a,e,r,n,i,o),void ha(u,e,r,n,i,o)}s=s.next}a=a.next}while(a!==t)}function va(t,e){return t.x-e.x}function ga(t,e){if(e=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){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!r)return null;if(i===a)return r;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&&_a(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),Pa(n,t)&&(u<h||u===h&&(n.x>r.x||n.x===r.x&&xa(r,n)))&&(r=n,h=u)),n=n.next}while(n!==l);return r}(t,e)){var r=Ca(e,t);ca(e,e.next),ca(r,r.next)}}function xa(t,e){return ka(t.prev,t,e.prev)<0&&ka(e.next,t,t.next)<0}function ba(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function wa(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 _a(t,e,r,n,i,o,a,s){return(i-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function Sa(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&&Aa(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Pa(t,e)&&Pa(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)&&(ka(t.prev,t,e.prev)||ka(t,e.prev,e))||Ia(t,e)&&ka(t.prev,t,t.next)>0&&ka(e.prev,e,e.next)>0)}function ka(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Ia(t,e){return t.x===e.x&&t.y===e.y}function Aa(t,e,r,n){var i=Ma(ka(t,e,r)),o=Ma(ka(t,e,n)),a=Ma(ka(r,n,t)),s=Ma(ka(r,n,e));return i!==o&&a!==s||!(0!==i||!za(t,r,e))||!(0!==o||!za(t,n,e))||!(0!==a||!za(r,t,n))||!(0!==s||!za(r,e,n))}function za(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 Ma(t){return t>0?1:t<0?-1:0}function Pa(t,e){return ka(t.prev,t,t.next)<0?ka(t,e,t.next)>=0&&ka(t,t.prev,e)>=0:ka(t,e,t.prev)<0||ka(t,t.next,e)<0}function Ca(t,e){var r=new Ta(t.i,t.x,t.y),n=new Ta(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 Ba(t,e,r,n){var i=new Ta(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 Va(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 Ta(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ea(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 Da(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(Fa(e,n,r),o(e[i],c)>0&&Fa(e,n,i);h<f;){for(Fa(e,h,f),h++,f--;o(e[h],c)<0;)h++;for(;o(e[f],c)>0;)f--}0===o(e[n],c)?Fa(e,n,f):Fa(e,++f,i),f<=r&&(n=f+1),r<=f&&(i=f-1)}}(t,e,r||0,n||t.length-1,i||Oa)}function Fa(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Oa(t,e){return t<e?-1:t>e?1:0}function La(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,o=[],a=0;a<r;a++){var s=v(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||(Da(o[u],e,1,o[u].length-1,ja),o[u]=o[u].slice(0,e));return o}function ja(t,e){return e.area-t.area}function qa(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 Ra(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}la.deviation=function(t,e,r,n){var i=e&&e.length,o=Math.abs(Ea(t,0,i?e[0]*r:t.length,r));if(i)for(var a=0,s=e.length;a<s;a++)o-=Math.abs(Ea(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)},la.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},sa.default=ua;var Ua=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 mi,this.indexArray=new Pi,this.indexArray2=new Di,this.programConfigurations=new xo(t.layers,t.zoom),this.segments=new Ki,this.segments2=new Ki,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Ua.prototype.populate=function(t,e,r){this.hasPattern=qa("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=Io(u,h);if(this.layers[0]._featureFilter.filter(new Kn(this.zoom),f,r)){var y=n?n.evaluate(f,{},r,e.availableImages):void 0,d={id:l,properties:u.properties,type:u.type,sourceLayerIndex:c,index:p,geometry:h?f.geometry:ko(u),patterns:{},sortKey:y};i.push(d)}}n&&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;if(this.hasPattern){var _=Ra("fill",this.layers,g,this.zoom,e);this.patternFeatures.push(_)}else this.addFeature(g,x,b,r,{});e.featureIndex.insert(t[b].feature,x,b,w,this.index)}},Ua.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Ua.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)}},Ua.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Ua.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Ua.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,aa),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},Ua.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},Ua.prototype.addFeature=function(t,e,r,n,i){for(var o=0,a=La(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=sa(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)},Xe("FillBucket",Ua,{omit:["layers","patternFeatures"]});var Na=new li({"fill-sort-key":new oi(tr.layout_fill["fill-sort-key"])}),Za={paint:new li({"fill-antialias":new ii(tr.paint_fill["fill-antialias"]),"fill-opacity":new oi(tr.paint_fill["fill-opacity"]),"fill-color":new oi(tr.paint_fill["fill-color"]),"fill-outline-color":new oi(tr.paint_fill["fill-outline-color"]),"fill-translate":new ii(tr.paint_fill["fill-translate"]),"fill-translate-anchor":new ii(tr.paint_fill["fill-translate-anchor"]),"fill-pattern":new ai(tr.paint_fill["fill-pattern"])}),layout:Na},Ga=function(t){function e(e){t.call(this,e,Za)}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 Ua(t)},e.prototype.queryRadius=function(){return qo(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a){return Co(Ro(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,a),n)},e.prototype.isTileClipped=function(){return!0},e}(pi),Xa=yi([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,Ya=Ja;function Ja(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(Ka,this,e)}function Ka(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 Ha(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}Ja.types=["Unknown","Point","LineString","Polygon"],Ja.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},Ja.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]},Ja.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=Ja.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=Ha(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 Wa=$a;function $a(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(Qa,this,e),this.length=this._features.length}function Qa(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 ts(t,e,r){if(3===t){var n=new Wa(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}$a.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 Ya(this._pbf,e,this.extent,this._keys,this._values)};var es={VectorTile:function(t,e){this.layers=t.readFields(ts,{},e)},VectorTileFeature:Ya,VectorTileLayer:Wa},rs=es.VectorTileFeature.types,ns=Math.pow(2,13);function is(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,2*Math.floor(n*ns)+a,i*ns*2,o*ns*2,Math.round(s))}var os=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 gi,this.indexArray=new Pi,this.programConfigurations=new xo(t.layers,t.zoom),this.segments=new Ki,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function as(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}os.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=qa("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=Io(a,p);if(this.layers[0]._featureFilter.filter(new Kn(this.zoom),c,r)){var h={id:s,sourceLayerIndex:l,index:u,geometry:p?c.geometry:ko(a),properties:a.properties,type:a.type,patterns:{}};this.hasPattern?this.features.push(Ra("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)}}},os.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)}},os.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},os.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},os.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},os.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Xa),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},os.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},os.prototype.addFeature=function(t,e,r,n,i){for(var o=0,a=La(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&&!((V=y).every((function(t){return t.x<0}))||V.every((function(t){return t.x>8192}))||V.every((function(t){return t.y<0}))||V.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(!as(v,g)){c.vertexLength+4>Ki.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),is(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,0,d),is(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,1,d),is(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,0,d+=b),is(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>Ki.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray)),"Polygon"===rs[t.type]){for(var _=[],S=[],k=c.vertexLength,I=0,A=s;I<A.length;I+=1){var z=A[I];if(0!==z.length){z!==s[0]&&S.push(_.length/2);for(var M=0;M<z.length;M++){var P=z[M];is(this.layoutVertexArray,P.x,P.y,0,0,1,1,0),_.push(P.x),_.push(P.y)}}}for(var C=sa(_,S),B=0;B<C.length;B+=3)this.indexArray.emplaceBack(k+C[B],k+C[B+2],k+C[B+1]);c.primitiveLength+=C.length/3,c.vertexLength+=u}}var V;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n)},Xe("FillExtrusionBucket",os,{omit:["layers","features"]});var ss={paint:new li({"fill-extrusion-opacity":new ii(tr["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new oi(tr["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new ii(tr["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new ii(tr["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ai(tr["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new oi(tr["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new oi(tr["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new ii(tr["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},us=function(t){function e(e){t.call(this,e,ss)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new os(t)},e.prototype.queryRadius=function(){return qo(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=Ro(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];Xo(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,k=i[0]*_+i[4]*S+i[12],I=i[1]*_+i[5]*S+i[13],A=i[2]*_+i[6]*S+i[14],z=i[3]*_+i[7]*S+i[15],M=A+l,P=z+p,C=k+c,B=I+h,V=A+f,T=z+y,E=new r((k+s)/P,(I+u)/P);E.z=M/P,v.push(E);var D=new r(C/T,B/T);D.z=V/T,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;Co(r,e)&&(n=ps(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];Mo(r,l)&&(n=Math.min(n,ps(r,l)))}return n!==1/0&&n}(f[0],f[1],h)},e}(pi);function ls(t,e){return t.x*e.x+t.y*e.y}function ps(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=ls(s,s),c=ls(s,u),h=ls(u,u),f=ls(l,s),y=ls(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 cs=yi([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,hs=yi([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,fs=es.VectorTileFeature.types,ys=Math.cos(Math.PI/180*37.5),ds=Math.pow(2,14)/.5,ms=function(t){var e=this;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.lineClipsArray=[],this.gradients={},this.layers.forEach((function(t){e.gradients[t.id]={}})),this.layoutVertexArray=new xi,this.layoutVertexArray2=new bi,this.indexArray=new Pi,this.programConfigurations=new xo(t.layers,t.zoom),this.segments=new Ki,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};ms.prototype.populate=function(t,e,r){this.hasPattern=qa("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=Io(u,h);if(this.layers[0]._featureFilter.filter(new Kn(this.zoom),f,r)){var y=n?n.evaluate(f,{},r):void 0,d={id:l,properties:u.properties,type:u.type,sourceLayerIndex:c,index:p,geometry:h?f.geometry:ko(u),patterns:{},sortKey:y};i.push(d)}}n&&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;if(this.hasPattern){var _=Ra("line",this.layers,g,this.zoom,e);this.patternFeatures.push(_)}else this.addFeature(g,x,b,r,{});e.featureIndex.insert(t[b].feature,x,b,w,this.index)}},ms.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},ms.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)}},ms.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},ms.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},ms.prototype.upload=function(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,hs)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,cs),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},ms.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},ms.prototype.lineFeatureClips=function(t){if(t.properties&&t.properties.hasOwnProperty("mapbox_clip_start")&&t.properties.hasOwnProperty("mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}},ms.prototype.addFeature=function(t,e,r,n,i){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");this.lineClips=this.lineFeatureClips(t);for(var 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)},ms.prototype.addLine=function(t,e,r,n,i,o){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var a=0;a<t.length-1;a++)this.totalDistance+=t[a].dist(t[a+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var s="Polygon"===fs[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<ys&&f&&y,k=d.x*m.y-d.y*m.x>0;if(S&&v>l){var I=p.dist(f);if(I>2*c){var A=p.sub(p.sub(f)._mult(c/I)._round());this.updateDistance(f,A),this.addCurrentVertex(A,d,0,0,h),f=A}}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*(k?-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),B=k?C:0,V=k?0:C;if(f&&this.addCurrentVertex(p,d,B,V,h),"fakeround"===M)for(var T=Math.round(180*_/Math.PI/20),E=1;E<T;E++){var D=E/T;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 O=m.sub(d)._mult(D)._add(d)._unit()._mult(k?-1:1);this.addHalfVertex(p,O.x,O.y,!1,k,0,h)}y&&this.addCurrentVertex(p,m,-B,-V,h)}else if("butt"===M)this.addCurrentVertex(p,g,0,0,h);else if("square"===M){var L=f?1:-1;this.addCurrentVertex(p,g,L,L,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 j=p.dist(y);if(j>2*c){var q=p.add(y.sub(p)._mult(c/j)._round());this.updateDistance(p,q),this.addCurrentVertex(q,m,0,0,h),p=q}}}}},ms.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>ds/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,o))},ms.prototype.addHalfVertex=function(t,e,r,n,i,o,a){var s=.5*(this.lineClips?this.scaledDistance*(ds-1):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),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);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},ms.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},ms.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Xe("LineBucket",ms,{omit:["layers","patternFeatures"]});var vs=new li({"line-cap":new ii(tr.layout_line["line-cap"]),"line-join":new oi(tr.layout_line["line-join"]),"line-miter-limit":new ii(tr.layout_line["line-miter-limit"]),"line-round-limit":new ii(tr.layout_line["line-round-limit"]),"line-sort-key":new oi(tr.layout_line["line-sort-key"])}),gs={paint:new li({"line-opacity":new oi(tr.paint_line["line-opacity"]),"line-color":new oi(tr.paint_line["line-color"]),"line-translate":new ii(tr.paint_line["line-translate"]),"line-translate-anchor":new ii(tr.paint_line["line-translate-anchor"]),"line-width":new oi(tr.paint_line["line-width"]),"line-gap-width":new oi(tr.paint_line["line-gap-width"]),"line-offset":new oi(tr.paint_line["line-offset"]),"line-blur":new oi(tr.paint_line["line-blur"]),"line-dasharray":new si(tr.paint_line["line-dasharray"]),"line-pattern":new ai(tr.paint_line["line-pattern"]),"line-gradient":new ui(tr.paint_line["line-gradient"])}),layout:vs},xs=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 Kn(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=u({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(oi))(gs.paint.properties["line-width"].specification);xs.useIntegerZoom=!0;var bs=function(t){function e(e){t.call(this,e,gs),this.gradientVersion=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Dt,this.gradientVersion=(this.gradientVersion+1)%o)},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=xs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new ms(t)},e.prototype.queryRadius=function(t){var e=t,r=ws(jo("line-width",this,e),jo("line-gap-width",this,e)),n=jo("line-offset",this,e);return r/2+Math.abs(n)+qo(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,i,o,a,s){var u=Ro(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),l=s/2*ws(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(Oo(t,i[o]))return!0;if(Bo(t,i,r))return!0}return!1}(u,i,l)},e.prototype.isTileClipped=function(){return!0},e}(pi);function ws(t,e){return e>0?e+2*t:t}var _s=yi([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Ss=yi([{name:"a_projected_pos",components:3,type:"Float32"}],4),ks=(yi([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),yi([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Is=(yi([{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"}]),yi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4));function As(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()),Jn.applyArabicShaping&&(t=Jn.applyArabicShaping(t)),t}(t.text,e,r)})),t}yi([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),yi([{name:"triangle",components:3,type:"Uint16"}]),yi([{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"}]),yi([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),yi([{type:"Float32",name:"offsetX"}]),yi([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var zs={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Ms=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)},Ps=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},Cs=Bs;function Bs(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Bs.Varint=0,Bs.Fixed64=1,Bs.Bytes=2,Bs.Fixed32=5;var Vs="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Ts(t){return t.type===Bs.Bytes?t.readVarint()+t.pos:t.pos+1}function Es(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Ds(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 Fs(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function Os(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function Ls(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function js(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function qs(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function Rs(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function Us(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function Ns(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function Zs(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function Gs(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Xs(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function Ys(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function Js(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}}Bs.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=Gs(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Ys(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Gs(this.buf,this.pos)+4294967296*Gs(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Gs(this.buf,this.pos)+4294967296*Ys(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Ms(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ms(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 Es(t,n,e);if(n|=(127&(i=o[r.pos++]))<<3,i<128)return Es(t,n,e);if(n|=(127&(i=o[r.pos++]))<<10,i<128)return Es(t,n,e);if(n|=(127&(i=o[r.pos++]))<<17,i<128)return Es(t,n,e);if(n|=(127&(i=o[r.pos++]))<<24,i<128)return Es(t,n,e);if(n|=(1&(i=o[r.pos++]))<<31,i<128)return Es(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&&Vs?function(t,e,r){return Vs.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!==Bs.Bytes)return t.push(this.readVarint(e));var r=Ts(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Bs.Bytes)return t.push(this.readSVarint());var e=Ts(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Bs.Bytes)return t.push(this.readBoolean());var e=Ts(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Bs.Bytes)return t.push(this.readFloat());var e=Ts(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Bs.Bytes)return t.push(this.readDouble());var e=Ts(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Bs.Bytes)return t.push(this.readFixed32());var e=Ts(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Bs.Bytes)return t.push(this.readSFixed32());var e=Ts(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Bs.Bytes)return t.push(this.readFixed64());var e=Ts(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Bs.Bytes)return t.push(this.readSFixed64());var e=Ts(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Bs.Varint)for(;this.buf[this.pos++]>127;);else if(e===Bs.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Bs.Fixed32)this.pos+=4;else{if(e!==Bs.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),Xs(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Xs(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Xs(this.buf,-1&t,this.pos),Xs(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Xs(this.buf,-1&t,this.pos),Xs(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&&Ds(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Ps(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Ps(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&&Ds(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Bs.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Fs,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Os,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,qs,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Ls,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,js,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Rs,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Us,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Ns,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Zs,e)},writeBytesField:function(t,e){this.writeTag(t,Bs.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Bs.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Bs.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Bs.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Bs.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Bs.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Bs.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Bs.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Bs.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Bs.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Ks=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},Hs={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Hs.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},Hs.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Hs.tlbr.get=function(){return this.tl.concat(this.br)},Hs.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Ks.prototype,Hs);var Ws=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var o=Js(i),a=new ea({width:o.w||1,height:o.h||1});for(var s in t){var u=t[s],l=r[s].paddedRect;ea.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;ea.copy(c.data,a,{x:0,y:0},{x:f,y:y},c.data),ea.copy(c.data,a,{x:0,y:m-1},{x:f,y:y-1},{width:d,height:1}),ea.copy(c.data,a,{x:0,y:0},{x:f,y:y+m},{width:d,height:1}),ea.copy(c.data,a,{x:d-1,y:0},{x:f-1,y:y},{width:1,height:m}),ea.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};Ws.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 Ks(o,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},Ws.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)},Ws.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]})}},Xe("ImagePosition",Ks),Xe("ImageAtlas",Ws);var $s={horizontal:1,vertical:2,horizontalOnly:3},Qs=function(){this.scale=1,this.fontStack="",this.imageName=null};Qs.forText=function(t,e){var r=new Qs;return r.scale=t||1,r.fontStack=e,r},Qs.forImage=function(t){var e=new Qs;return e.imageName=t,e};var tu=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function eu(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d){var m,v=tu.fromFeature(t,i);c===$s.vertical&&v.verticalizePunctuation();var g=Jn.processBidirectionalText,x=Jn.processStyledBidirectionalText;if(g&&1===v.sections.length){m=[];for(var b=0,w=g(v.toString(),uu(v,l,o,e,n,f,y));b<w.length;b+=1){var _=w[b],S=new tu;S.text=_,S.sections=v.sections;for(var k=0;k<_.length;k++)S.sectionIndex.push(0);m.push(S)}}else if(x){m=[];for(var I=0,A=x(v.text,v.sectionIndex,uu(v,l,o,e,n,f,y));I<A.length;I+=1){var z=A[I],M=new tu;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,uu(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 k=S.positionedGlyphs,I=0;if(b.length()){for(var A=0;A<b.length();A++){var z=b.getSection(A),M=b.getSectionIndex(A),P=b.getCharCode(A),C=0,B=null,V=null,T=null,E=24,D=!(u===$s.horizontal||!p&&!gn(P)||p&&(ru[P]||(Z=P,Zr(Z)||Gr(Z)||Xr(Z)||cn(Z)||dn(Z))));if(z.imageName){var F=n[z.imageName];if(!F)continue;T=z.imageName,t.iconsInText=t.iconsInText||!0,V=F.paddedRect;var O=F.displaySize;z.scale=24*z.scale/c,C=_+(24-O[1]*z.scale),E=(B={width:O[0],height:O[1],left:1,top:-3,advance:D?O[1]:O[0]}).advance;var L=D?O[0]*z.scale-24*w:O[1]*z.scale-24*w;L>0&&L>I&&(I=L)}else{var j=r[z.fontStack],q=j&&j[P];if(q&&q.rect)V=q.rect,B=q.metrics;else{var R=e[z.fontStack],U=R&&R[P];if(!U)continue;B=U.metrics}C=24*(w-z.scale)}D?(t.verticalizable=!0,k.push({glyph:P,imageName:T,x:h,y:f+C,vertical:D,scale:z.scale,fontStack:z.fontStack,sectionIndex:M,metrics:B,rect:V}),h+=E*z.scale+l):(k.push({glyph:P,imageName:T,x:h,y:f+C,vertical:D,scale:z.scale,fontStack:z.fontStack,sectionIndex:M,metrics:B,rect:V}),h+=B.advance*z.scale+l)}0!==k.length&&(y=Math.max(h-l,y),pu(k,0,k.length-1,m,I)),h=0;var N=o*w+I;S.lineOffset=Math.max(I,_),f+=N,d=Math.max(N,d),++v}else f+=o,++v}var Z,G=f- -17,X=lu(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,G,i.length),t.top+=-J*G,t.bottom=t.top+G,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}tu.fromFeature=function(t,e){for(var r=new tu,n=0;n<t.sections.length;n++){var i=t.sections[n];i.image?r.addImageSection(i):r.addTextSection(i,e)}return r},tu.prototype.length=function(){return this.text.length},tu.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},tu.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},tu.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},tu.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&&xn(n)&&!zs[t[r+1]]||i&&xn(i)&&!zs[t[r-1]]||!zs[t[r]]?t[r]:zs[t[r]]}return e}(this.text)},tu.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&ru[this.text.charCodeAt(e)];e++)t++;for(var r=this.text.length,n=this.text.length-1;n>=0&&n>=t&&ru[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},tu.prototype.substring=function(t,e){var r=new tu;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},tu.prototype.toString=function(){return this.text},tu.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},tu.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(Qs.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n<t.text.length;++n)this.sectionIndex.push(r)},tu.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(Qs.forImage(e)),this.sectionIndex.push(this.sections.length-1)):d("Reached maximum number of images 6401")}else d("Can't add FormattedSection with an empty image.")},tu.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var ru={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},nu={};function iu(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 ou(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 au(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 su(t,e,r,n,i,o){for(var a=null,s=ou(e,r,i,o),u=0,l=n;u<l.length;u+=1){var p=l[u],c=ou(e-p.x,r,i,o)+p.badness;c<=s&&(a=p,s=c)}return{index:t,x:e,priorBreak:a,badness:s}}function uu(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+=iu(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(ru[y]||(c+=iu(y,f,n,i,e,a)),h<t.length()-1){var d=!((s=y)<11904||!(tn(s)||Qr(s)||fn(s)||pn(s)||on(s)||Yr(s)||en(s)||Hr(s)||an(s)||sn(s)||nn(s)||mn(s)||Wr(s)||Kr(s)||Jr(s)||rn(s)||$r(s)||hn(s)||ln(s)||un(s)));(nu[y]||d||f.imageName)&&u.push(su(h+1,c,l,u,au(y,t.getCharCode(h+1),d&&p),!1))}}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(su(t.length(),c,l,u,0,!0))}function lu(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 pu(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 cu(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}}nu[10]=!0,nu[32]=!0,nu[38]=!0,nu[40]=!0,nu[41]=!0,nu[43]=!0,nu[45]=!0,nu[47]=!0,nu[173]=!0,nu[183]=!0,nu[8203]=!0,nu[8208]=!0,nu[8211]=!0,nu[8231]=!0;var hu=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 fu(t,e){var r=e.expression;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new Kn(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 Kn(s)),maxSize:r.evaluate(new Kn(u)),interpolationType:i}}function yu(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 du(t){for(var e=0,r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function mu(t,e,r){return t?.6*e*r:0}function vu(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function gu(t,e,r,n,i,o){for(var a=mu(r,i,o),s=vu(r,n)*o,u=0,l=du(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=Ft(c.x,h.x,y),m=Ft(c.y,h.y,y),v=new hu(d,m,h.angleTo(c),p);return v._round(),!a||yu(t,v,s,a,e)?v:void 0}u+=f}}function xu(t,e,r,n,i,o,a,s,u){var l=mu(n,o,a),p=vu(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=du(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=Ft(m.x,v.x,b),_=Ft(m.y,v.y,b);if(w>=0&&w<l&&_>=0&&_<l&&f-p>=0&&f+p<=c){var S=new hu(w,_,x,d);S._round(),i&&!yu(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 bu(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,k=v,I=0,A=g;if(a.content&&i){var z=a.content;x=wu(h,0,z[0]),w=wu(f,0,z[1]),b=wu(h,z[0],z[2]),_=wu(f,z[1],z[3]),S=z[0]-x,I=z[1]-w,k=z[2]-z[0]-b,A=z[3]-z[1]-_}var M=function(i,o,u,l){var h=Su(i.stretch-x,b,p,t.left),f=ku(i.fixed-S,k,i.stretch,d),y=Su(o.stretch-w,_,c,t.top),v=ku(o.fixed-I,A,o.stretch,m),g=Su(u.stretch-x,b,p,t.left),z=ku(u.fixed-S,k,u.stretch,d),M=Su(l.stretch-w,_,c,t.top),P=ku(l.fixed-I,A,l.stretch,m),C=new r(h,y),B=new r(g,y),V=new r(g,M),T=new r(h,M),E=new r(f/s,v/s),D=new r(z/s,P/s),F=e*Math.PI/180;if(F){var O=Math.sin(F),L=Math.cos(F),j=[L,-O,O,L];C._matMult(j),B._matMult(j),T._matMult(j),V._matMult(j)}var q=i.stretch+i.fixed,R=o.stretch+o.fixed;return{tl:C,tr:B,bl:T,br:V,tex:{x:a.paddedRect.x+1+q,y:a.paddedRect.y+1+R,w:u.stretch+u.fixed-q,h:l.stretch+l.fixed-R},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:E,pixelOffsetBR:D,minFontScaleX:k/s/p,minFontScaleY:A/s/c,isSDF:n}};if(i&&(a.stretchX||a.stretchY))for(var P=_u(h,v,d),C=_u(f,g,m),B=0;B<P.length-1;B++)for(var V=P[B],T=P[B+1],E=0;E<C.length-1;E++)o.push(M(V,C[E],T,C[E+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 wu(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 _u(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 Su(t,e,r,n){return t/e*r+n}function ku(t,e,r,n){return t-e*r/n}Xe("Anchor",hu);var Iu=function(t,e,n,i,o,a,s,u,l,p){if(this.boxStartIndex=t.length,l){var c=a.top,h=a.bottom,f=a.collisionPadding;f&&(c-=f[1],h+=f[3]);var y=h-c;y>0&&(y=Math.max(10,y),this.circleDiameter=y)}else{var d=a.top*s-u,m=a.bottom*s+u,v=a.left*s-u,g=a.right*s+u,x=a.collisionPadding;if(x&&(v-=x[0]*s,d-=x[1]*s,g+=x[2]*s,m+=x[3]*s),p){var b=new r(v,d),w=new r(g,d),_=new r(v,m),S=new r(g,m),k=p*Math.PI/180;b._rotate(k),w._rotate(k),_._rotate(k),S._rotate(k),v=Math.min(b.x,w.x,_.x,S.x),g=Math.max(b.x,w.x,_.x,S.x),d=Math.min(b.y,w.y,_.y,S.y),m=Math.max(b.y,w.y,_.y,S.y)}t.emplaceBack(e.x,e.y,v,d,g,m,n,i,o)}this.boxEndIndex=t.length},Au=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=zu),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 zu(t,e){return t<e?-1:t>e?1:0}function Mu(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 Au([],Pu);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 Cu(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 Cu(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 Cu(g.p.x-(h=g.h/2),g.p.y-h,h,t)),f.push(new Cu(g.p.x+h,g.p.y-h,h,t)),f.push(new Cu(g.p.x-h,g.p.y+h,h,t)),f.push(new Cu(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 Pu(t,e){return e.max-t.max}function Cu(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,Do(t,l,p))}return(r?1:-1)*Math.sqrt(n)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}Au.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},Au.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}},Au.prototype.peek=function(){return this.data[0]},Au.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},Au.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 Bu=Number.POSITIVE_INFINITY;function Vu(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 Kn(c.minZoom),s),l["text-size"].possiblyEvaluate(new Kn(h),s)]}if("composite"===t.iconSizeData.kind){var f=t.iconSizeData,y=f.maxZoom;p.compositeIconSizes=[l["icon-size"].possiblyEvaluate(new Kn(f.minZoom),s),l["icon-size"].possiblyEvaluate(new Kn(y),s)]}p.layoutTextSize=l["text-size"].possiblyEvaluate(new Kn(t.zoom+1),s),p.layoutIconSize=l["icon-size"].possiblyEvaluate(new Kn(t.zoom+1),s),p.textMaxSize=l["text-size"].possiblyEvaluate(new Kn(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),y=p.layoutTextSize.evaluate(c,{},s),b=p.layoutIconSize.evaluate(c,{},s),S={horizontal:{},vertical:void 0},k=c.text,I=[0,0];if(k){var A=k.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),Zr(n)||Gr(n)||Xr(n)||cn(n)||dn(n))return!1;var n;return!0}(A)?z:0,P=u.get("text-anchor").evaluate(c,{},s),C=u.get("text-variable-anchor");if(!C){var B=u.get("text-radial-offset").evaluate(c,{},s);B?(a=P,I=(l=[24*B,Bu])[1]!==Bu?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])):I=u.get("text-offset").evaluate(c,{},s).map((function(t){return 24*t}))}var V=v?"center":u.get("text-justify").evaluate(c,{},s),T=u.get("symbol-placement"),E="point"===T?24*u.get("text-max-width").evaluate(c,{},s):0,D=function(){t.allowVerticalPlacement&&vn(A)&&(S.vertical=eu(k,e,n,o,h,E,m,P,"left",M,I,$s.vertical,!0,T,y,f))};if(!v&&C){for(var F="auto"===V?C.map((function(t){return Tu(t)})):[V],O=!1,L=0;L<F.length;L++){var j=F[L];if(!S.horizontal[j])if(O)S.horizontal[j]=S.horizontal[0];else{var q=eu(k,e,n,o,h,E,m,"center",j,M,I,$s.horizontal,!1,T,y,f);q&&(S.horizontal[j]=q,O=1===q.positionedLines.length)}}D()}else{"auto"===V&&(V=Tu(P));var R=eu(k,e,n,o,h,E,m,P,V,M,I,$s.horizontal,!1,T,y,f);R&&(S.horizontal[V]=R),D(),vn(A)&&v&&g&&(S.vertical=eu(k,e,n,o,h,E,m,P,V,M,I,$s.vertical,!1,T,y,f))}}var U=void 0,N=!1;if(c.icon&&c.icon.name){var Z=i[c.icon.name];Z&&(U=function(t,e,r){var n=lu(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=Z.sdf,void 0===t.sdfIcons?t.sdfIcons=Z.sdf:t.sdfIcons!==Z.sdf&&d("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(Z.pixelRatio!==t.pixelRatio||0!==u.get("icon-rotate").constantOr(1))&&(t.iconsNeedLinear=!0))}var G=Du(S.horizontal)||S.vertical;t.iconsInText=!!G&&G.iconsInText,(G||U)&&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,y=t.layers[0].layout,m=y.get("icon-offset").evaluate(e,{},c),v=Du(n.horizontal),g=s/24,x=t.tilePixelRatio*g,b=t.tilePixelRatio*h/24,w=t.tilePixelRatio*u,_=t.tilePixelRatio*y.get("symbol-spacing"),S=y.get("text-padding")*t.tilePixelRatio,k=y.get("icon-padding")*t.tilePixelRatio,I=y.get("text-max-angle")/180*Math.PI,A="map"===y.get("text-rotation-alignment")&&"point"!==y.get("symbol-placement"),z="map"===y.get("icon-rotation-alignment")&&"point"!==y.get("symbol-placement"),M=y.get("symbol-placement"),P=_/2,C=y.get("icon-text-fit");i&&"none"!==C&&(t.allowVerticalPlacement&&n.vertical&&(f=cu(i,n.vertical,C,y.get("icon-text-fit-padding"),m,g)),v&&(i=cu(i,v,C,y.get("icon-text-fit-padding"),m,g)));var B=function(r,u){u.x<0||u.x>=8192||u.y<0||u.y>=8192||function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,m,v,g,x,b,w,_,S,k,I){var A,z,M,P,C,B=t.addToLineVertexArray(e,r),V=0,T=0,E=0,D=0,F=-1,O=-1,L={},j=to(""),q=0,R=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(q=(A=s.layout.get("text-offset").evaluate(w,{},k).map((function(t){return 24*t})))[0],R=A[1]):(q=24*s.layout.get("text-radial-offset").evaluate(w,{},k),R=Bu),t.allowVerticalPlacement&&n.vertical){var U=s.layout.get("text-rotate").evaluate(w,{},k)+90;P=new Iu(u,e,l,p,c,n.vertical,h,f,y,U),a&&(C=new Iu(u,e,l,p,c,a,v,g,y,U))}if(i){var N=s.layout.get("icon-rotate").evaluate(w,{}),Z="none"!==s.layout.get("icon-text-fit"),G=bu(i,N,S,Z),X=a?bu(a,N,S,Z):void 0;M=new Iu(u,e,l,p,c,i,v,g,!1,N),V=4*G.length;var Y=t.iconSizeData,J=null;"source"===Y.kind?(J=[128*s.layout.get("icon-size").evaluate(w,{})])[0]>32640&&d(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===Y.kind&&((J=[128*_.compositeIconSizes[0].evaluate(w,{},k),128*_.compositeIconSizes[1].evaluate(w,{},k)])[0]>32640||J[1]>32640)&&d(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,G,J,b,x,w,!1,e,B.lineStartIndex,B.lineLength,-1,k),F=t.icon.placedSymbolArray.length-1,X&&(T=4*X.length,t.addSymbols(t.icon,X,J,b,x,w,$s.vertical,e,B.lineStartIndex,B.lineLength,-1,k),O=t.icon.placedSymbolArray.length-1)}for(var K in n.horizontal){var H=n.horizontal[K];if(!z){j=to(H.text);var W=s.layout.get("text-rotate").evaluate(w,{},k);z=new Iu(u,e,l,p,c,H,h,f,y,W)}var $=1===H.positionedLines.length;if(E+=Eu(t,e,H,o,s,y,w,m,B,n.vertical?$s.horizontal:$s.horizontalOnly,$?Object.keys(n.horizontal):[K],L,F,_,k),$)break}n.vertical&&(D+=Eu(t,e,n.vertical,o,s,y,w,m,B,$s.vertical,["vertical"],L,O,_,k));var Q=z?z.boxStartIndex:t.collisionBoxArray.length,tt=z?z.boxEndIndex:t.collisionBoxArray.length,et=P?P.boxStartIndex:t.collisionBoxArray.length,rt=P?P.boxEndIndex:t.collisionBoxArray.length,nt=M?M.boxStartIndex:t.collisionBoxArray.length,it=M?M.boxEndIndex:t.collisionBoxArray.length,ot=C?C.boxStartIndex:t.collisionBoxArray.length,at=C?C.boxEndIndex:t.collisionBoxArray.length,st=-1,ut=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};st=ut(z,st),st=ut(P,st),st=ut(M,st);var lt=(st=ut(C,st))>-1?1:0;lt&&(st*=I/24),t.glyphOffsetArray.length>=Zu.MAX_GLYPHS&&d("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,F,O,j,Q,tt,et,rt,nt,it,ot,at,l,E,D,V,T,lt,0,h,q,R,st)}(t,u,r,n,i,o,f,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,x,S,A,l,w,k,z,m,e,a,p,c,s)};if("line"===M)for(var V=0,T=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);V<T.length;V+=1)for(var E=T[V],D=0,F=xu(E,_,I,n.vertical||v,i,24,b,t.overscaling,8192);D<F.length;D+=1){var O=F[D];v&&Fu(t,v.text,P,O)||B(E,O)}else if("line-center"===M)for(var L=0,j=e.geometry;L<j.length;L+=1){var q=j[L];if(q.length>1){var R=gu(q,I,n.vertical||v,i,24,b);R&&B(q,R)}}else if("Polygon"===e.type)for(var U=0,N=La(e.geometry,0);U<N.length;U+=1){var Z=N[U],G=Mu(Z,16);B(Z[0],new hu(G.x,G.y,0))}else if("LineString"===e.type)for(var X=0,Y=e.geometry;X<Y.length;X+=1){var J=Y[X];B(J,new hu(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];B([Q],new hu(Q.x,Q.y,0))}}(t,c,S,U,i,p,y,b,I,N,s)},w=0,_=t.features;w<_.length;w+=1)b();a&&t.generateCollisionDebugBuffers()}function Tu(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 Eu(t,e,n,i,o,a,s,u,l,p,c,h,f,y,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 k=s[m.imageName];x=k.sdf,g=1/(b=k.pixelRatio)}var I=o?[m.x+S,m.y]:[0,0],A=o?[0,0]:[m.x+S+n[0],m.y+n[1]-w],z=[0,0];_&&(z=A,A=[0,0]);var M=(m.metrics.left-g)*m.scale-S+A[0],P=(-m.metrics.top-g)*m.scale+A[1],C=M+v.w*m.scale/b,B=P+v.h*m.scale/b,V=new r(M,P),T=new r(C,P),E=new r(M,B),D=new r(C,B);if(_){var F=new r(-S,S- -17),O=-Math.PI/2,L=12-S,j=new r(22-L,-(m.imageName?L:0)),q=new(Function.prototype.bind.apply(r,[null].concat(z)));V._rotateAround(O,F)._add(j)._add(q),T._rotateAround(O,F)._add(j)._add(q),E._rotateAround(O,F)._add(j)._add(q),D._rotateAround(O,F)._add(j)._add(q)}if(l){var R=Math.sin(l),U=Math.cos(l),N=[U,-R,R,U];V._matMult(N),T._matMult(N),E._matMult(N),D._matMult(N)}var Z=new r(0,0),G=new r(0,0);p.push({tl:V,tr:T,bl:E,br:D,tex:v,writingMode:e.writingMode,glyphOffset:I,sectionIndex:m.sectionIndex,isSDF:x,pixelOffsetTL:Z,pixelOffsetBR:G,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&&d(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===g.kind&&((x=[128*y.compositeTextSizes[0].evaluate(s,{},m),128*y.compositeTextSizes[1].evaluate(s,{},m)])[0]>32640||x[1]>32640)&&d(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 Du(t){for(var e in t)return t[e];return null}function Fu(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 Ou=es.VectorTileFeature.types,Lu=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function ju(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 qu(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 Ru(t){for(var e=0,r=t.sections;e<r.length;e+=1)if(_n(r[e].text))return!0;return!1}var Uu=function(t){this.layoutVertexArray=new _i,this.indexArray=new Pi,this.programConfigurations=t,this.segments=new Ki,this.dynamicLayoutVertexArray=new Si,this.opacityVertexArray=new ki,this.placedSymbolArray=new Ri};Uu.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length},Uu.prototype.upload=function(t,e,r,n){this.isEmpty()||(r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,_s.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Ss.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,Lu,!0),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(t))},Uu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Xe("SymbolBuffers",Uu);var Nu=function(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new Ki,this.collisionVertexArray=new Mi};Nu.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,ks.members,!0)},Nu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Xe("CollisionBuffers",Nu);var Zu=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=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Go([]),this.placementViewportMatrix=Go([]);var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=fu(this.zoom,e["text-size"]),this.iconSizeData=fu(this.zoom,e["icon-size"]);var r=this.layers[0].layout,n=r.get("symbol-sort-key"),i=r.get("symbol-z-order");this.canOverlap=r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==i&&void 0!==n.constantOr(1),this.sortFeaturesByY=("viewport-y"===i||"auto"===i&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map((function(t){return $s[t]}))),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.sourceID=t.sourceID};Zu.prototype.createArrays=function(){this.text=new Uu(new xo(this.layers,this.zoom,(function(t){return/^text/.test(t)}))),this.icon=new Uu(new xo(this.layers,this.zoom,(function(t){return/^icon/.test(t)}))),this.glyphOffsetArray=new Zi,this.lineVertexArray=new Gi,this.symbolInstances=new Ni},Zu.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=zs[t.charAt(o)];a&&(e[a.charCodeAt(0)]=!0)}},Zu.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 K&&!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 Kn(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=Io(g,_);if(n._featureFilter.filter(y,S,r)){_||(S.geometry=ko(g));var k=void 0;if(u){var I=n.getValueAndResolveTokens("text-field",S,r,f),A=K.factory(I);Ru(A)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===Xn||this.hasRTLText&&Jn.isParsed())&&(k=As(A,n,S))}var z=void 0;if(l){var M=n.getValueAndResolveTokens("icon-image",S,r,f);z=M instanceof H?M:H.fromString(M)}if(k||z){var P=this.sortFeaturesByKey?p.evaluate(S,{},r):void 0;if(this.features.push({id:x,text:k,icon:z,index:b,sourceLayerIndex:w,geometry:S.geometry,properties:g.properties,type:Ou[g.type],sortKey:P}),z&&(c[z.name]=!0),k){var C=o.evaluate(S,{},r).join(","),B="map"===i.get("text-rotation-alignment")&&"point"!==i.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf($s.vertical)>=0;for(var V=0,T=k.sections;V<T.length;V+=1){var E=T[V];if(E.image)c[E.image.name]=!0;else{var D=vn(k.toString()),F=E.fontStack||C,O=h[F]=h[F]||{};this.calculateGlyphDependencies(E.text,O,B,this.allowVerticalPlacement,D)}}}}}}"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}))}},Zu.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))},Zu.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},Zu.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},Zu.prototype.upload=function(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.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},Zu.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},Zu.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},Zu.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}},Zu.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,this.canOverlap?o.sortKey:void 0),d=this.glyphOffsetArray.length,m=y.vertexLength,v=this.allowVerticalPlacement&&a===$s.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,k=b.br,I=b.tex,A=b.pixelOffsetTL,z=b.pixelOffsetBR,M=b.minFontScaleX,P=b.minFontScaleY,C=b.glyphOffset,B=b.isSDF,V=b.sectionIndex,T=y.vertexLength,E=C[1];ju(f,s.x,s.y,w.x,E+w.y,I.x,I.y,r,B,A.x,A.y,M,P),ju(f,s.x,s.y,_.x,E+_.y,I.x+I.w,I.y,r,B,z.x,A.y,M,P),ju(f,s.x,s.y,S.x,E+S.y,I.x,I.y+I.h,r,B,A.x,z.y,M,P),ju(f,s.x,s.y,k.x,E+k.y,I.x+I.w,I.y+I.h,r,B,z.x,z.y,M,P),qu(t.dynamicLayoutVertexArray,s,v),h.emplaceBack(T,T+1,T+2),h.emplaceBack(T+1,T+2,T+3),y.vertexLength+=4,y.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(C[0]),x!==e.length-1&&V===e[x+1].sectionIndex||t.programConfigurations.populatePaintArrays(f.length,o,o.index,{},c,g&&g[V])}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)},Zu.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))},Zu.prototype.addCollisionDebugVertices=function(t,e,n,i,o,a,s){var u=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),l=u.vertexLength,p=o.layoutVertexArray,c=o.collisionVertexArray,h=s.anchorX,f=s.anchorY;this._addCollisionDebugVertex(p,c,a,h,f,new r(t,e)),this._addCollisionDebugVertex(p,c,a,h,f,new r(n,e)),this._addCollisionDebugVertex(p,c,a,h,f,new r(n,i)),this._addCollisionDebugVertex(p,c,a,h,f,new r(t,i)),u.vertexLength+=4;var y=o.indexArray;y.emplaceBack(l,l+1),y.emplaceBack(l+1,l+2),y.emplaceBack(l+2,l+3),y.emplaceBack(l+3,l),u.primitiveLength+=4},Zu.prototype.addDebugCollisionBoxes=function(t,e,r,n){for(var i=t;i<e;i++){var o=this.collisionBoxArray.get(i);this.addCollisionDebugVertices(o.x1,o.y1,o.x2,o.y2,n?this.textCollisionBox:this.iconCollisionBox,o.anchorPoint,r)}},Zu.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Nu(Ai,Is.members,Di),this.iconCollisionBox=new Nu(Ai,Is.members,Di);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)}},Zu.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);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}for(var h=n;h<i;h++){var f=t.get(h);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);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);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},Zu.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))}},Zu.prototype.hasTextData=function(){return this.text.segments.get().length>0},Zu.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Zu.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Zu.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Zu.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Zu.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)},Zu.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},Zu.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})},Zu.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)}},Xe("SymbolBucket",Zu,{omit:["layers","collisionBoxArray","features","compareText"]}),Zu.MAX_GLYPHS=65535,Zu.addDynamicAttributes=qu;var Gu=new li({"symbol-placement":new ii(tr.layout_symbol["symbol-placement"]),"symbol-spacing":new ii(tr.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new ii(tr.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new oi(tr.layout_symbol["symbol-sort-key"]),"symbol-z-order":new ii(tr.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new ii(tr.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new ii(tr.layout_symbol["icon-ignore-placement"]),"icon-optional":new ii(tr.layout_symbol["icon-optional"]),"icon-rotation-alignment":new ii(tr.layout_symbol["icon-rotation-alignment"]),"icon-size":new oi(tr.layout_symbol["icon-size"]),"icon-text-fit":new ii(tr.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new ii(tr.layout_symbol["icon-text-fit-padding"]),"icon-image":new oi(tr.layout_symbol["icon-image"]),"icon-rotate":new oi(tr.layout_symbol["icon-rotate"]),"icon-padding":new ii(tr.layout_symbol["icon-padding"]),"icon-keep-upright":new ii(tr.layout_symbol["icon-keep-upright"]),"icon-offset":new oi(tr.layout_symbol["icon-offset"]),"icon-anchor":new oi(tr.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new ii(tr.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new ii(tr.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new ii(tr.layout_symbol["text-rotation-alignment"]),"text-field":new oi(tr.layout_symbol["text-field"]),"text-font":new oi(tr.layout_symbol["text-font"]),"text-size":new oi(tr.layout_symbol["text-size"]),"text-max-width":new oi(tr.layout_symbol["text-max-width"]),"text-line-height":new ii(tr.layout_symbol["text-line-height"]),"text-letter-spacing":new oi(tr.layout_symbol["text-letter-spacing"]),"text-justify":new oi(tr.layout_symbol["text-justify"]),"text-radial-offset":new oi(tr.layout_symbol["text-radial-offset"]),"text-variable-anchor":new ii(tr.layout_symbol["text-variable-anchor"]),"text-anchor":new oi(tr.layout_symbol["text-anchor"]),"text-max-angle":new ii(tr.layout_symbol["text-max-angle"]),"text-writing-mode":new ii(tr.layout_symbol["text-writing-mode"]),"text-rotate":new oi(tr.layout_symbol["text-rotate"]),"text-padding":new ii(tr.layout_symbol["text-padding"]),"text-keep-upright":new ii(tr.layout_symbol["text-keep-upright"]),"text-transform":new oi(tr.layout_symbol["text-transform"]),"text-offset":new oi(tr.layout_symbol["text-offset"]),"text-allow-overlap":new ii(tr.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new ii(tr.layout_symbol["text-ignore-placement"]),"text-optional":new ii(tr.layout_symbol["text-optional"])}),Xu={paint:new li({"icon-opacity":new oi(tr.paint_symbol["icon-opacity"]),"icon-color":new oi(tr.paint_symbol["icon-color"]),"icon-halo-color":new oi(tr.paint_symbol["icon-halo-color"]),"icon-halo-width":new oi(tr.paint_symbol["icon-halo-width"]),"icon-halo-blur":new oi(tr.paint_symbol["icon-halo-blur"]),"icon-translate":new ii(tr.paint_symbol["icon-translate"]),"icon-translate-anchor":new ii(tr.paint_symbol["icon-translate-anchor"]),"text-opacity":new oi(tr.paint_symbol["text-opacity"]),"text-color":new oi(tr.paint_symbol["text-color"],{runtimeType:D,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new oi(tr.paint_symbol["text-halo-color"]),"text-halo-width":new oi(tr.paint_symbol["text-halo-width"]),"text-halo-blur":new oi(tr.paint_symbol["text-halo-blur"]),"text-translate":new ii(tr.paint_symbol["text-translate"]),"text-translate-anchor":new ii(tr.paint_symbol["text-translate-anchor"])}),layout:Gu},Yu=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:B,this.defaultValue=t};Yu.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},Yu.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},Yu.prototype.outputDefined=function(){return!1},Yu.prototype.serialize=function(){return null},Xe("FormatSectionOverride",Yu,{omit:["defaultValue"]});var Ju=function(t){function e(e){t.call(this,e,Xu)}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()||Oe(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 Zu(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype._setPaintOverrides=function(){for(var t=0,r=Xu.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 Yu(o),s=new Fe(a,o.property.specification);i="constant"===o.value.kind||"source"===o.value.kind?new je("source",s):new qe("composite",s,o.value.zoomStops,o.value._interpolationType),this.paint._values[n]=new ri(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=Xu.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 K)o(r.value.value.sections);else if("source"===r.value.kind){var a=function(t){i||(t instanceof et&&Q(t.value)===j?o(t.value.sections):t instanceof ot?o(t.sections):t.eachChild(a))},s=r.value;s._styleExpression&&a(s._styleExpression.expression)}return i},e}(pi),Ku={paint:new li({"background-color":new ii(tr.paint_background["background-color"]),"background-pattern":new si(tr.paint_background["background-pattern"]),"background-opacity":new ii(tr.paint_background["background-opacity"])})},Hu=function(t){function e(e){t.call(this,e,Ku)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(pi),Wu={paint:new li({"raster-opacity":new ii(tr.paint_raster["raster-opacity"]),"raster-hue-rotate":new ii(tr.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new ii(tr.paint_raster["raster-brightness-min"]),"raster-brightness-max":new ii(tr.paint_raster["raster-brightness-max"]),"raster-saturation":new ii(tr.paint_raster["raster-saturation"]),"raster-contrast":new ii(tr.paint_raster["raster-contrast"]),"raster-resampling":new ii(tr.paint_raster["raster-resampling"]),"raster-fade-duration":new ii(tr.paint_raster["raster-fade-duration"])})},$u=function(t){function e(e){t.call(this,e,Wu)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(pi),Qu=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),tl={circle:Jo,heatmap:na,hillshade:oa,fill:Ga,"fill-extrusion":us,line:bs,symbol:Ju,background:Hu,raster:$u};function el(t){return"custom"===t.type?new Qu(t):new tl[t.type](t)}var rl=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function nl(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+=nl(i[n])+",";return r+"]"}for(var o=Object.keys(t).sort(),a="{",s=0;s<o.length;s++)a+=JSON.stringify(o[s])+":"+nl(t[o[s]])+",";return a+"}"}function il(t){for(var e="",r=0,n=rl;r<n.length;r+=1)e+="/"+nl(t[n[r]]);return e}var ol=function(t){this.keyCache={},t&&this.replace(t)};ol.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},ol.prototype.update=function(t,e){for(var r=this,n=0,i=t;n<i.length;n+=1){var o=i[n];this._layerConfigs[o.id]=o;var a=this._layers[o.id]=el(o);a._featureFilter=fr(a.filter),this.keyCache[o.id]&&delete this.keyCache[o.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]||il(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}(s(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 al=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}};al.prototype.encode=function(t){return this._stringToNumber[t]},al.prototype.decode=function(t){return this._numberToString[t]};var sl=function(t,e,r,n,i){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,this.id=i},ul={geometry:{configurable:!0}};function ll(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]}ul.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},ul.geometry.set=function(t){this._geometry=t},sl.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(sl.prototype,ul);var pl=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]))};pl.prototype.setNorthEast=function(t){return this._ne=t instanceof cl?new cl(t.lng,t.lat):cl.convert(t),this},pl.prototype.setSouthWest=function(t){return this._sw=t instanceof cl?new cl(t.lng,t.lat):cl.convert(t),this},pl.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof cl)e=t,r=t;else{if(!(t instanceof pl))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(pl.convert(t)):this.extend(cl.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 cl(e.lng,e.lat),this._ne=new cl(r.lng,r.lat)),this},pl.prototype.getCenter=function(){return new cl((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},pl.prototype.getSouthWest=function(){return this._sw},pl.prototype.getNorthEast=function(){return this._ne},pl.prototype.getNorthWest=function(){return new cl(this.getWest(),this.getNorth())},pl.prototype.getSouthEast=function(){return new cl(this.getEast(),this.getSouth())},pl.prototype.getWest=function(){return this._sw.lng},pl.prototype.getSouth=function(){return this._sw.lat},pl.prototype.getEast=function(){return this._ne.lng},pl.prototype.getNorth=function(){return this._ne.lat},pl.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},pl.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},pl.prototype.isEmpty=function(){return!(this._sw&&this._ne)},pl.prototype.contains=function(t){var e=cl.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},pl.convert=function(t){return!t||t instanceof pl?t:new pl(t)};var cl=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")};cl.prototype.wrap=function(){return new cl(-180==(t=((this.lng- -180)%360+360)%360-180)?180:t,this.lat);var t},cl.prototype.toArray=function(){return[this.lng,this.lat]},cl.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},cl.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))},cl.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 pl(new cl(this.lng-r,this.lat-e),new cl(this.lng+r,this.lat+e))},cl.convert=function(t){if(t instanceof cl)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new cl(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new cl(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 hl=2*Math.PI*6371008.8;function fl(t){return hl*Math.cos(t*Math.PI/180)}function yl(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var dl=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};dl.fromLngLat=function(t,e){void 0===e&&(e=0);var r=cl.convert(t);return new dl((180+r.lng)/360,(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r.lat*Math.PI/360)))/360,function(t,e){return t/fl(e)}(e,r.lat))},dl.prototype.toLngLat=function(){return new cl(360*this.x-180,yl(this.y))},dl.prototype.toAltitude=function(){return this.z*fl(yl(this.y))},dl.prototype.meterInMercatorCoordinateUnits=function(){return 1/hl*(t=yl(this.y),1/Math.cos(t*Math.PI/180));var t};var ml=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=xl(0,t,t,e,r)};ml.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},ml.prototype.url=function(t,e){var r,n,i,o,a,s=(n=this.y,i=this.z,o=ll(256*(r=this.x),256*(n=Math.pow(2,i)-n-1),i),a=ll(256*(r+1),256*(n+1),i),o[0]+","+o[1]+","+a[0]+","+a[1]),u=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);return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===e?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",u).replace("{bbox-epsg-3857}",s)},ml.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))},ml.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var vl=function(t,e){this.wrap=t,this.canonical=e,this.key=xl(t,e.z,e.z,e.x,e.y)},gl=function(t,e,r,n,i){this.overscaledZ=t,this.wrap=e,this.canonical=new ml(r,+n,+i),this.key=xl(e,t,r,n,i)};function xl(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)}gl.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},gl.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new gl(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new gl(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},gl.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?xl(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):xl(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},gl.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},gl.prototype.children=function(t){if(this.overscaledZ>=t)return[new gl(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 gl(e,this.wrap,e,r,n),new gl(e,this.wrap,e,r+1,n),new gl(e,this.wrap,e,r,n+1),new gl(e,this.wrap,e,r+1,n+1)]},gl.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))},gl.prototype.wrapped=function(){return new gl(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},gl.prototype.unwrapTo=function(t){return new gl(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},gl.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},gl.prototype.toUnwrapped=function(){return new vl(this.wrap,this.canonical)},gl.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},gl.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new dl(t.x-this.wrap,t.y))},Xe("CanonicalTileID",ml),Xe("OverscaledTileID",gl,{omit:["posMatrix"]});var bl=function(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new S(8192,16,0),this.grid3D=new S(8192,16,0),this.featureIndexArray=new Yi,this.promoteId=e};function wl(t,e,r,n,i){return h(t,(function(t,o){var a=e instanceof ni?e.get(o):null;return a&&a.evaluate?a.evaluate(r,n,i):a}))}function _l(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 Sl(t,e){return e-t}bl.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])}},bl.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new es.VectorTile(new Cs(this.rawTileData)).layers,this.sourceLayerCoder=new al(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},bl.prototype.query=function(t,e,n,i){var o=this;this.loadVTLayers();for(var a=t.params||{},s=8192/t.tileSize/t.scale,u=fr(a.filter),l=t.queryGeometry,p=t.queryPadding*s,c=_l(l),h=this.grid.query(c.minX-p,c.minY-p,c.maxX+p,c.maxY+p),f=_l(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(Oo(t,c[p]))return!0;for(var h=0;h<t.length-1;h++)if(Lo(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(Sl);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=ko(e)),r.queryIntersectsFeature(l,e,n,f,o.z,t.transform,s,t.pixelPosMatrix)}))}},b=0;b<h.length;b++)x(b);return g},bl.prototype.loadMatchingFeature=function(t,e,r,n,i,o,a,s,l,p,c){var h=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,h)){var f=this.sourceLayerCoder.decode(r),y=this.vtLayers[f].feature(n);if(i.needGeometry){var d=Io(y,!0);if(!i.filter(new Kn(this.tileID.overscaledZ),d,this.tileID.canonical))return}else if(!i.filter(new Kn(this.tileID.overscaledZ),y))return;for(var m=this.getId(y,f),v=0;v<h.length;v++){var g=h[v];if(!(o&&o.indexOf(g)<0)){var x=s[g];if(x){var b={};void 0!==m&&p&&(b=p.getState(x.sourceLayer||"_geojsonTileLayer",m));var w=u({},l[g]);w.paint=wl(w.paint,x.paint,y,b,a),w.layout=wl(w.layout,x.layout,y,b,a);var _=!c||c(y,x,b);if(_){var S=new sl(y,this.z,this.x,this.y,m);S.layer=w;var k=t[g];void 0===k&&(k=t[g]=[]),k.push({featureIndex:n,feature:S,intersectionZ:_})}}}}}},bl.prototype.lookupSymbolFeatures=function(t,e,r,n,i,o,a,s){var u={};this.loadVTLayers();for(var l=fr(i),p=0,c=t;p<c.length;p+=1)this.loadMatchingFeature(u,r,n,c[p],l,o,a,s,e);return u},bl.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},bl.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},Xe("FeatureIndex",bl,{omit:["rawTileData","sourceLayerCoder"]});var kl=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=Js(r),p=new ta({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;ta.copy(y.bitmap,p,{x:0,y:0},{x:d.x+1,y:d.y+1},y.bitmap)}}}this.image=p,this.positions=e};Xe("GlyphAtlas",kl);var Il=function(t){this.tileID=new gl(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 Al(t,e,r){for(var n=new Kn(e),i=0,o=t;i<o.length;i+=1)o[i].recalculate(n,r)}Il.prototype.parse=function(t,e,r,n,i){var o=this;this.status="parsing",this.data=t,this.collisionBoxArray=new ji;var a=new al(Object.keys(t.layers).sort()),u=new bl(this.tileID,this.promoteId);u.bucketLayerIDs=[];var l,p,c,f,y={},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&&d('Vector tile source "'+this.source+'" layer "'+g+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var b=a.encode(g),w=[],_=0;_<x.length;_++){var S=x.feature(_),k=u.getId(S,g);w.push({feature:S,id:k,index:_,sourceLayerIndex:b})}for(var I=0,A=v[g];I<A.length;I+=1){var z=A[I],M=z[0];M.minzoom&&this.zoom<Math.floor(M.minzoom)||M.maxzoom&&this.zoom>=M.maxzoom||"none"!==M.visibility&&(Al(z,this.zoom,r),(y[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=h(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,V.call(o))})):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,c=e,V.call(o))})):c={};var B=Object.keys(m.patternDependencies);function V(){if(l)return i(l);if(p&&c&&f){var t=new kl(p),e=new Ws(c,f);for(var n in y){var o=y[n];o instanceof Zu?(Al(o.layers,this.zoom,r),Vu(o,p,t.positions,c,e.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):o.hasPattern&&(o instanceof ms||o instanceof Ua||o instanceof os)&&(Al(o.layers,this.zoom,r),o.addFeatures(m,this.tileID.canonical,e.patternPositions))}this.status="done",i(null,{buckets:s(y).filter((function(t){return!t.isEmpty()})),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:e,glyphMap:this.returnDependencies?p:null,iconMap:this.returnDependencies?c:null,glyphPositions:this.returnDependencies?t.positions:null})}}B.length?n.send("getImages",{icons:B,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){l||(l=t,f=e,V.call(o))})):f={},V.call(this)};var zl=i.performance,Ml=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},zl.mark(this._marks.start)};function Pl(t,e){var r=function(t,e){return Zn(u(t,{type:"arrayBuffer"}),e)}(t.request,(function(t,r,n,i){t?e(t):r&&e(null,{vectorTile:new es.VectorTile(new Cs(r)),rawData:r,cacheControl:n,expires:i})}));return function(){r.cancel(),e()}}Ml.prototype.finish=function(){zl.mark(this._marks.end);var t=zl.getEntriesByName(this._marks.measure);return 0===t.length&&(zl.measure(this._marks.measure,this._marks.start,this._marks.end),t=zl.getEntriesByName(this._marks.measure),zl.clearMarks(this._marks.start),zl.clearMarks(this._marks.end),zl.clearMeasures(this._marks.measure)),t};var Cl=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||Pl,this.loading={},this.loaded={}};Cl.prototype.loadTile=function(t,e){var r=this,n=t.uid;this.loading||(this.loading={});var i=!!(t&&t.request&&t.request.collectResourceTiming)&&new Ml(t.request),o=this.loading[n]=new Il(t);o.abort=this.loadVectorData(t,(function(t,a){if(delete r.loading[n],t||!a)return o.status="done",r.loaded[n]=o,e(t);var s=a.rawData,l={};a.expires&&(l.expires=a.expires),a.cacheControl&&(l.cacheControl=a.cacheControl);var p={};if(i){var c=i.finish();c&&(p.resourceTiming=JSON.parse(JSON.stringify(c)))}o.vectorTile=a.vectorTile,o.parse(a.vectorTile,r.layerIndex,r.availableImages,r.actor,(function(t,r){if(t||!r)return e(t);e(null,u({rawTileData:s.slice(0)},r,l,p))})),r.loaded=r.loaded||{},r.loaded[n]=o}))},Cl.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())}},Cl.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()},Cl.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var Bl=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 d('"'+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)]};Bl.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])},Bl.prototype.getUnpackVector=function(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Bl.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)},Bl.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Bl.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Bl.prototype.getPixels=function(){return new ea({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Bl.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)]},Xe("DEMData",Bl);var Vl=i.ImageBitmap,Tl=function(){this.loaded={}};function El(t,e){if(0!==t.length){Dl(t[0],e);for(var r=1;r<t.length;r++)Dl(t[r],!e)}}function Dl(t,e){for(var r=0,n=0,i=t.length,o=i-1;n<i;o=n++)r+=(t[n][0]-t[o][0])*(t[o][1]+t[n][1]);r>=0!=!!e&&t.reverse()}Tl.prototype.loadTile=function(t,e){var r=t.uid,n=t.encoding,i=t.rawImageData,o=Vl&&i instanceof Vl?this.getImageData(i):i,a=new Bl(r,o,n);this.loaded=this.loaded||{},this.loaded[r]=a,e(null,a)},Tl.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 ea({width:e.width,height:e.height},e.data)},Tl.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var Fl=es.VectorTileFeature.prototype.toGeoJSON,Ol=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))};Ol.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},Ol.prototype.toGeoJSON=function(t,e,r){return Fl.call(this,t,e,r)};var Ll=function(t){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=8192,this.length=t.length,this._features=t};Ll.prototype.feature=function(t){return new Ol(this._features[t])};var jl=es.VectorTileFeature,ql=Rl;function Rl(t,e){this.options=e||{},this.features=t,this.length=t.length}function Ul(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}Rl.prototype.feature=function(t){return new Ul(this.features[t],this.options.extent)},Ul.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},Ul.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]},Ul.prototype.toGeoJSON=jl.prototype.toGeoJSON;var Nl=Gl,Zl=ql;function Gl(t){var e=new Cs;return function(t,e){for(var r in t.layers)e.writeMessage(3,Xl,t.layers[r])}(t,e),e.finish()}function Xl(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,Yl,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,$l,o[r])}function Yl(t,e){var r=t.feature;void 0!==r.id&&e.writeVarintField(1,r.id),e.writeMessage(2,Jl,t),e.writeVarintField(3,r.type),e.writeMessage(4,Wl,r)}function Jl(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=o[s];void 0===u&&(n.push(s),o[s]=u=n.length-1),e.writeVarint(u);var l=r.properties[s],p=typeof l;"string"!==p&&"boolean"!==p&&"number"!==p&&(l=JSON.stringify(l));var c=p+":"+l,h=a[c];void 0===h&&(i.push(l),a[c]=h=i.length-1),e.writeVarint(h)}}function Kl(t,e){return(e<<3)+(7&t)}function Hl(t){return t<<1^t>>31}function Wl(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(Kl(1,l));for(var p=3===n?u.length-1:u.length,c=0;c<p;c++){1===c&&1!==n&&e.writeVarint(Kl(2,p-1));var h=u[c].x-i,f=u[c].y-o;e.writeVarint(Hl(h)),e.writeVarint(Hl(f)),i+=h,o+=f}3===n&&e.writeVarint(Kl(7,1))}}function $l(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))}function Ql(t,e,r,n){tp(t,r,n),tp(e,2*r,2*n),tp(e,2*r+1,2*n+1)}function tp(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function ep(t,e,r,n){var i=t-r,o=e-n;return i*i+o*o}Nl.fromVectorTileJs=Gl,Nl.fromGeojsonVt=function(t,e){e=e||{};var r={};for(var n in t)r[n]=new ql(t[n].features,e),r[n].name=n,r[n].version=e.version,r[n].extent=e.extent;return Gl({layers:r})},Nl.GeoJSONWrapper=Zl;var rp=function(t){return t[0]},np=function(t){return t[1]},ip=function(t,e,r,n,i){void 0===e&&(e=rp),void 0===r&&(r=np),void 0===n&&(n=64),void 0===i&&(i=Float64Array),this.nodeSize=n,this.points=t;for(var o=t.length<65536?Uint16Array:Uint32Array,a=this.ids=new o(t.length),s=this.coords=new i(2*t.length),u=0;u<t.length;u++)a[u]=u,s[2*u]=e(t[u]),s[2*u+1]=r(t[u]);!function t(e,r,n,i,o,a){if(!(o-i<=n)){var s=i+o>>1;!function t(e,r,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=n-i+1,l=Math.log(s),p=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*p*(s-p)/s)*(u-s/2<0?-1:1);t(e,r,n,Math.max(i,Math.floor(n-u*p/s+c)),Math.min(o,Math.floor(n+(s-u)*p/s+c)),a)}var h=r[2*n+a],f=i,y=o;for(Ql(e,r,i,n),r[2*o+a]>h&&Ql(e,r,i,o);f<y;){for(Ql(e,r,f,y),f++,y--;r[2*f+a]<h;)f++;for(;r[2*y+a]>h;)y--}r[2*i+a]===h?Ql(e,r,i,y):Ql(e,r,++y,o),y<=n&&(i=y+1),n<=y&&(o=y-1)}}(e,r,s,i,o,a%2),t(e,r,n,i,s-1,a+1),t(e,r,n,s+1,o,a+1)}}(a,s,n,0,a.length-1,0)};ip.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)},ip.prototype.within=function(t,e,r){return function(t,e,r,n,i,o){for(var a=[0,t.length-1,0],s=[],u=i*i;a.length;){var l=a.pop(),p=a.pop(),c=a.pop();if(p-c<=o)for(var h=c;h<=p;h++)ep(e[2*h],e[2*h+1],r,n)<=u&&s.push(t[h]);else{var f=Math.floor((c+p)/2),y=e[2*f],d=e[2*f+1];ep(y,d,r,n)<=u&&s.push(t[f]);var m=(l+1)%2;(0===l?r-i<=y:n-i<=d)&&(a.push(c),a.push(f-1),a.push(m)),(0===l?r+i>=y:n+i>=d)&&(a.push(f+1),a.push(p),a.push(m))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var op={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},ap=function(t){this.options=fp(Object.create(op),t),this.trees=new Array(this.options.maxZoom+1)};function sp(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function up(t,e){var r=t.geometry.coordinates,n=r[1];return{x:cp(r[0]),y:hp(n),zoom:1/0,index:e,parentId:-1}}function lp(t){return{type:"Feature",id:t.id,properties:pp(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function pp(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return fp(fp({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function cp(t){return t/360+.5}function hp(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function fp(t,e){for(var r in e)t[r]=e[r];return t}function yp(t){return t.x}function dp(t){return t.y}function mp(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 vp(t,e,r,n){var i={id:void 0===t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)gp(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n<e.length;n++)gp(t,e[n]);else if("MultiPolygon"===r)for(n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++)gp(t,e[n][i])}(i),i}function gp(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 xp(t,e,r,n){if(e.geometry){var i=e.geometry.coordinates,o=e.geometry.type,a=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],u=e.id;if(r.promoteId?u=e.properties[r.promoteId]:r.generateId&&(u=n||0),"Point"===o)bp(i,s);else if("MultiPoint"===o)for(var l=0;l<i.length;l++)bp(i[l],s);else if("LineString"===o)wp(i,s,a,!1);else if("MultiLineString"===o){if(r.lineMetrics){for(l=0;l<i.length;l++)wp(i[l],s=[],a,!1),t.push(vp(u,"LineString",s,e.properties));return}_p(i,s,a,!1)}else if("Polygon"===o)_p(i,s,a,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(l=0;l<e.geometry.geometries.length;l++)xp(t,{id:u,geometry:e.geometry.geometries[l],properties:e.properties},r,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(l=0;l<i.length;l++){var p=[];_p(i[l],p,a,!0),s.push(p)}}t.push(vp(u,o,s,e.properties))}}function bp(t,e){e.push(Sp(t[0])),e.push(kp(t[1])),e.push(0)}function wp(t,e,r,n){for(var i,o,a=0,s=0;s<t.length;s++){var u=Sp(t[s][0]),l=kp(t[s][1]);e.push(u),e.push(l),e.push(0),s>0&&(a+=n?(i*l-u*o)/2:Math.sqrt(Math.pow(u-i,2)+Math.pow(l-o,2))),i=u,o=l}var p=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=mp(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,p,r),e[p+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function _p(t,e,r,n){for(var i=0;i<t.length;i++){var o=[];wp(t[i],o,r,n),e.push(o)}}function Sp(t){return t/360+.5}function kp(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function Ip(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;l<t.length;l++){var p=t[l],c=p.geometry,h=p.type,f=0===i?p.minX:p.minY,y=0===i?p.maxX:p.maxY;if(f>=r&&y<n)u.push(p);else if(!(y<r||f>=n)){var d=[];if("Point"===h||"MultiPoint"===h)Ap(c,d,r,n,i);else if("LineString"===h)zp(c,d,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===h)Pp(c,d,r,n,i,!1);else if("Polygon"===h)Pp(c,d,r,n,i,!0);else if("MultiPolygon"===h)for(var m=0;m<c.length;m++){var v=[];Pp(c[m],v,r,n,i,!0),v.length&&d.push(v)}if(d.length){if(s.lineMetrics&&"LineString"===h){for(m=0;m<d.length;m++)u.push(vp(p.id,h,d[m],p.tags));continue}"LineString"!==h&&"MultiLineString"!==h||(1===d.length?(h="LineString",d=d[0]):h="MultiLineString"),"Point"!==h&&"MultiPoint"!==h||(h=3===d.length?"Point":"MultiPoint"),u.push(vp(p.id,h,d,p.tags))}}}return u.length?u:null}function Ap(t,e,r,n,i){for(var o=0;o<t.length;o+=3){var a=t[o+i];a>=r&&a<=n&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function zp(t,e,r,n,i,o,a){for(var s,u,l=Mp(t),p=0===i?Bp:Vp,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)):Cp(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=Mp(t)),a&&(c+=s)}var w=t.length-3;f=t[w],y=t[w+1],d=t[w+2],(g=0===i?f:y)>=r&&g<=n&&Cp(l,f,y,d),w=l.length-3,o&&w>=3&&(l[w]!==l[0]||l[w+1]!==l[1])&&Cp(l,l[0],l[1],l[2]),l.length&&e.push(l)}function Mp(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function Pp(t,e,r,n,i,o){for(var a=0;a<t.length;a++)zp(t[a],e,r,n,i,o,!1)}function Cp(t,e,r,n){t.push(e),t.push(r),t.push(n)}function Bp(t,e,r,n,i,o){var a=(o-e)/(n-e);return t.push(o),t.push(r+(i-r)*a),t.push(1),a}function Vp(t,e,r,n,i,o){var a=(o-r)/(i-r);return t.push(e+(n-e)*a),t.push(o),t.push(1),a}function Tp(t,e){for(var r=[],n=0;n<t.length;n++){var i,o=t[n],a=o.type;if("Point"===a||"MultiPoint"===a||"LineString"===a)i=Ep(o.geometry,e);else if("MultiLineString"===a||"Polygon"===a){i=[];for(var s=0;s<o.geometry.length;s++)i.push(Ep(o.geometry[s],e))}else if("MultiPolygon"===a)for(i=[],s=0;s<o.geometry.length;s++){for(var u=[],l=0;l<o.geometry[s].length;l++)u.push(Ep(o.geometry[s][l],e));i.push(u)}r.push(vp(o.id,a,i,o.tags))}return r}function Ep(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 Dp(t,e){if(t.transformed)return t;var r,n,i,o=1<<t.z,a=t.x,s=t.y;for(r=0;r<t.features.length;r++){var u=t.features[r],l=u.geometry,p=u.type;if(u.geometry=[],1===p)for(n=0;n<l.length;n+=2)u.geometry.push(Fp(l[n],l[n+1],e,o,a,s));else for(n=0;n<l.length;n++){var c=[];for(i=0;i<l[n].length;i+=2)c.push(Fp(l[n][i],l[n][i+1],e,o,a,s));u.geometry.push(c)}}return t.transformed=!0,t}function Fp(t,e,r,n,i,o){return[Math.round(r*(t*n-i)),Math.round(r*(e*n-o))]}function Op(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:0,source:null,x:r,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<t.length;s++){a.numFeatures++,Lp(a,t[s],o,i);var u=t[s].minX,l=t[s].minY,p=t[s].maxX,c=t[s].maxY;u<a.minX&&(a.minX=u),l<a.minY&&(a.minY=l),p>a.maxX&&(a.maxX=p),c>a.maxY&&(a.maxY=c)}return a}function Lp(t,e,r,n){var i=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s<i.length;s+=3)a.push(i[s]),a.push(i[s+1]),t.numPoints++,t.numSimplified++;else if("LineString"===o)jp(a,i,t,r,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(s=0;s<i.length;s++)jp(a,i[s],t,r,"Polygon"===o,0===s);else if("MultiPolygon"===o)for(var u=0;u<i.length;u++){var l=i[u];for(s=0;s<l.length;s++)jp(a,l[s],t,r,!0,0===s)}if(a.length){var p=e.tags||null;if("LineString"===o&&n.lineMetrics){for(var c in p={},e.tags)p[c]=e.tags[c];p.mapbox_clip_start=i.start/i.size,p.mapbox_clip_end=i.end/i.size}var h={geometry:a,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:p};null!==e.id&&(h.id=e.id),t.features.push(h)}}function jp(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]),s.push(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(n=0,i=t.length;n<i/2;n+=2){var a=t[n],s=t[n+1];t[n]=t[i-2-n],t[n+1]=t[i-1-n],t[i-2-n]=a,t[i-1-n]=s}}(s,o),t.push(s)}}function qp(t,e){var r=(e=this.options=function(t,e){for(var r in e)t[r]=e[r];return t}(Object.create(this.options),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++)xp(r,t.features[n],e,n);else xp(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=Ip(t,1,-1-r,r,0,-1,2,e),o=Ip(t,1,1-r,2+r,0,-1,2,e);return(i||o)&&(n=Ip(t,1,-r,1+r,0,-1,2,e)||[],i&&(n=Tp(i,1).concat(n)),o&&(n=n.concat(Tp(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 Rp(t,e,r){return 32*((1<<t)*r+e)+t}function Up(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 Ll(n.features),o=Nl(i);0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{vectorTile:i,rawData:o.buffer})}ap.prototype.load=function(t){var e=this.options,r=e.log,n=e.minZoom,i=e.maxZoom,o=e.nodeSize;r&&console.time("total time");var a="prepare "+t.length+" points";r&&console.time(a),this.points=t;for(var s=[],u=0;u<t.length;u++)t[u].geometry&&s.push(up(t[u],u));this.trees[i+1]=new ip(s,yp,dp,o,Float32Array),r&&console.timeEnd(a);for(var l=i;l>=n;l--){var p=+Date.now();s=this._cluster(s,l),this.trees[l]=new ip(s,yp,dp,o,Float32Array),r&&console.log("z%d: %d clusters in %dms",l,s.length,+Date.now()-p)}return r&&console.timeEnd("total time"),this},ap.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var a=this.getClusters([r,n,180,o],e),s=this.getClusters([-180,n,i,o],e);return a.concat(s)}for(var u=this.trees[this._limitZoom(e)],l=[],p=0,c=u.range(cp(r),hp(o),cp(i),hp(n));p<c.length;p+=1){var h=u.points[c[p]];l.push(h.numPoints?lp(h):this.points[h.index])}return l},ap.prototype.getChildren=function(t){var e=this._getOriginId(t),r=this._getOriginZoom(t),n="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(n);var o=i.points[e];if(!o)throw new Error(n);for(var a=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=[],u=0,l=i.within(o.x,o.y,a);u<l.length;u+=1){var p=i.points[l[u]];p.parentId===t&&s.push(p.numPoints?lp(p):this.points[p.index])}if(0===s.length)throw new Error(n);return s},ap.prototype.getLeaves=function(t,e,r){var n=[];return this._appendLeaves(n,t,e=e||10,r=r||0,0),n},ap.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},ap.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},ap.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},ap.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?pp(u):this.points[u.index].properties},c=void 0;l?c=u.id:this.options.generateId?c=u.index:this.points[u.index].id&&(c=this.points[u.index].id),void 0!==c&&(p.id=c),o.features.push(p)}},ap.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(+t,this.options.maxZoom+1))},ap.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 u=t[s];if(!(u.zoom<=e)){u.zoom=e;for(var l=this.trees[e+1],p=l.within(u.x,u.y,a),c=u.numPoints||1,h=c,f=0,y=p;f<y.length;f+=1){var d=l.points[y[f]];d.zoom>e&&(h+=d.numPoints||1)}if(h>=o){for(var m=u.x*c,v=u.y*c,g=i&&c>1?this._map(u,!0):null,x=(s<<5)+(e+1)+this.points.length,b=0,w=p;b<w.length;b+=1){var _=l.points[w[b]];if(!(_.zoom<=e)){_.zoom=e;var S=_.numPoints||1;m+=_.x*S,v+=_.y*S,_.parentId=x,i&&(g||(g=this._map(u,!0)),i(g,this._map(_)))}}u.parentId=x,r.push(sp(m/h,v/h,x,h,g))}else if(r.push(u),h>1)for(var k=0,I=p;k<I.length;k+=1){var A=l.points[I[k]];A.zoom<=e||(A.zoom=e,r.push(A))}}}return r},ap.prototype._getOriginId=function(t){return t-this.points.length>>5},ap.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},ap.prototype._map=function(t,e){if(t.numPoints)return e?fp({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?fp({},n):n},qp.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},qp.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=Rp(e,r,n),h=this.tiles[c];if(!h&&(l>1&&console.time("creation"),h=this.tiles[c]=Op(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,i){if(e===u.maxZoom||e===i)continue;var y=1<<i-e;if(r!==Math.floor(o/y)||n!==Math.floor(a/y))continue}else if(e===u.indexMaxZoom||h.numPoints<=u.indexMaxPoints)continue;if(h.source=null,0!==t.length){l>1&&console.time("clipping");var d,m,v,g,x,b,w=.5*u.buffer/u.extent,_=.5-w,S=.5+w,k=1+w;d=m=v=g=null,x=Ip(t,p,r-w,r+S,0,h.minX,h.maxX,u),b=Ip(t,p,r+_,r+k,0,h.minX,h.maxX,u),t=null,x&&(d=Ip(x,p,n-w,n+S,1,h.minY,h.maxY,u),m=Ip(x,p,n+_,n+k,1,h.minY,h.maxY,u),x=null),b&&(v=Ip(b,p,n-w,n+S,1,h.minY,h.maxY,u),g=Ip(b,p,n+_,n+k,1,h.minY,h.maxY,u),b=null),l>1&&console.timeEnd("clipping"),s.push(d||[],e+1,2*r,2*n),s.push(m||[],e+1,2*r,2*n+1),s.push(v||[],e+1,2*r+1,2*n),s.push(g||[],e+1,2*r+1,2*n+1)}}},qp.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,o=n.debug;if(t<0||t>24)return null;var a=1<<t,s=Rp(t,e=(e%a+a)%a,r);if(this.tiles[s])return Dp(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--,p=Math.floor(p/2),c=Math.floor(c/2),u=this.tiles[Rp(l,p,c)];return u&&u.source?(o>1&&console.log("found parent tile z%d-%d-%d",l,p,c),o>1&&console.time("drilling down"),this.splitTile(u.source,l,p,c,t,e,r),o>1&&console.timeEnd("drilling down"),this.tiles[s]?Dp(this.tiles[s],i):null):null};var Np=function(t){function e(e,r,n,i){t.call(this,e,r,n,Up),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 Ml(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)El(e.coordinates,r);else if("MultiPolygon"===i)for(n=0;n<e.coordinates.length;n++)El(e.coordinates[n],r);return e}(o,!0);try{if(r.filter){var a=Le(r.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===a.result)throw new Error(a.value.map((function(t){return t.key+": "+t.message})).join(", "));var s=o.features.filter((function(t){return a.value.evaluate({zoom:0},t)}));o={type:"FeatureCollection",features:s}}t._geoJSONIndex=r.cluster?new ap(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=Le(c[1]),y=Le("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 qp(t,e)}(o,r.geojsonVtOptions)}catch(i){return e(i)}t.loaded={};var u={};if(n){var l=n.finish();l&&(u.resourceTiming={},u.resourceTiming[r.source]=JSON.parse(JSON.stringify(l)))}e(null,u)}))}},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)!function(t,e){Zn(u(t,{type:"json"}),e)}(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}(Cl),Zp=function(t){var e=this;this.self=t,this.actor=new Qe(t,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:Cl,geojson:Np},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(Jn.isParsed())throw new Error("RTL text plugin already registered.");Jn.applyArabicShaping=t.applyArabicShaping,Jn.processBidirectionalText=t.processBidirectionalText,Jn.processStyledBidirectionalText=t.processStyledBidirectionalText}};return Zp.prototype.setReferrer=function(t,e){this.referrer=e},Zp.prototype.setImages=function(t,e,r){for(var n in this.availableImages[t]=e,this.workerSources[t]){var i=this.workerSources[t][n];for(var o in i)i[o].availableImages=e}r()},Zp.prototype.setLayers=function(t,e,r){this.getLayerIndex(t).replace(e),r()},Zp.prototype.updateLayers=function(t,e,r){this.getLayerIndex(t).update(e.layers,e.removedIds),r()},Zp.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).loadTile(e,r)},Zp.prototype.loadDEMTile=function(t,e,r){this.getDEMWorkerSource(t,e.source).loadTile(e,r)},Zp.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).reloadTile(e,r)},Zp.prototype.abortTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).abortTile(e,r)},Zp.prototype.removeTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).removeTile(e,r)},Zp.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},Zp.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()}},Zp.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(t){r(t.toString())}},Zp.prototype.syncRTLPluginState=function(t,e,r){try{Jn.setState(e);var n=Jn.getPluginURL();if(Jn.isLoaded()&&!Jn.isParsed()&&null!=n){this.self.importScripts(n);var i=Jn.isParsed();r(i?void 0:new Error("RTL Text Plugin failed to import scripts from "+n),i)}}catch(t){r(t.toString())}},Zp.prototype.getAvailableImages=function(t){var e=this.availableImages[t];return e||(e=[]),e},Zp.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new ol),e},Zp.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]},Zp.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new Tl),this.demWorkerSources[t][e]},Zp.prototype.enforceCacheSizeLimit=function(t,e){!function(t){qn(),Dn&&Dn.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 Zp(self)),Zp}();
|
|
2
|
+
//# sourceMappingURL=mapbox-gl-csp-worker.js.map
|