HOME


Mini Shell 1.0
DIR:/usr/local/cwpsrv/var/services/pma/js/vendor/openlayers/
Upload File :
Current File : //usr/local/cwpsrv/var/services/pma/js/vendor/openlayers/OpenLayers.js
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ol=e():t.ol=e()}(window,(function(){return function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=24)}([function(t,e,r){"use strict";(function(t,i){r.d(e,"a",(function(){return J})),r.d(e,"b",(function(){return _r})),r.d(e,"c",(function(){return Zr})),r.d(e,"d",(function(){return ur})),r.d(e,"e",(function(){return Kr})),r.d(e,"f",(function(){return n}));var n={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},center:{type:"array",value:"number",doc:"Default map center in longitude and latitude.  The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level.  The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number",default:0,period:360,units:"degrees",doc:'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).',example:29},pitch:{type:"number",default:0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:50},light:{type:"light",doc:"The global light source.",example:{anchor:"viewport",color:"white",intensity:.4}},sources:{required:!0,type:"sources",doc:"Data source specifications.",example:{"mapbox-streets":{type:"vector",url:"mapbox://mapbox.mapbox-streets-v6"}}},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.",example:{duration:300,delay:0}},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{doc:"A vector tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`. If specified as a string for a vector tile source, the same property is used across all its source layers."},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster:{type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered)."},clusterProperties:{type:"*",doc:'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`."}},source_video:{type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:"A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions."},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},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:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{doc:"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0",macos:"0.10.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first.  When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"},"data-driven styling":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{doc:"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},source:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},default:"auto",doc:"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0",macos:"0.12.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"stretchable icons":{js:"1.6.0",android:"9.2.0",ios:"5.8.0",macos:"0.15.0"}},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",doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",doc:"Name of image in sprite to use for drawing an image background.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,doc:"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",doc:"The maximum line width for text wrapping.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{doc:"The text is aligned towards the anchor position."},left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,doc:"Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},requires:["text-field",{"symbol-placement":["point"]}],doc:"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{doc:"If a text's language supports horizontal writing mode, symbols with point placement would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols with point placement would be laid out vertically."}},doc:"The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. The order of elements in an array define priority order for the placement of an orientation variant.",requires:["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{js:"1.3.0",android:"8.3.0",ios:"5.3.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},filter_operator:{type:"enum",values:{"==":{doc:'`["==", key, value]` equality: `feature[key] = value`'},"!=":{doc:'`["!=", key, value]` inequality: `feature[key] ≠ value`'},">":{doc:'`[">", key, value]` greater than: `feature[key] > value`'},">=":{doc:'`[">=", key, value]` greater than or equal: `feature[key] ≥ value`'},"<":{doc:'`["<", key, value]` less than: `feature[key] < value`'},"<=":{doc:'`["<=", key, value]` less than or equal: `feature[key] ≤ value`'},in:{doc:'`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`'},"!in":{doc:'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`'},all:{doc:'`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`'},any:{doc:'`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`'},none:{doc:'`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`'},has:{doc:'`["has", key]` `feature[key]` exists'},"!has":{doc:'`["!has", key]` `feature[key]` does not exist'},within:{doc:'`["within", object]` feature geometry is within object geometry'}},doc:"The filter operator."},geometry_type:{type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:"A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\n* In categorical functions, when the feature value does not match any of the stop domain values.\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\nIf no default is provided, the style property's default is used in these circumstances."}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2,doc:"Zoom level and value pair."},expression:{type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},expression_name:{doc:"",type:"enum",values:{let:{doc:'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},var:{doc:'References variable bound using "let".',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},literal:{doc:"Provides a literal array or object value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length).  If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},at:{doc:"Retrieves an item from an array.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},in:{doc:"Determines whether an item exists in an array or a substring exists in a string.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.6.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"index-of":{doc:"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},slice:{doc:"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},case:{doc:"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},match:{doc:'Selects the output whose label value matches the input value, or the fallback value if no match is found. The input can be any expression (e.g. `["get", "building_type"]`). Each label must be either:\n - a single literal value; or\n - an array of literal values, whose values must be all strings or all numbers (e.g. `[100, 101]` or `["c", "b"]`). The input matches if any of the values in the array matches, similar to the `"in"` operator.\nEach label must be unique. If the input type does not match the type of the labels, the result will be the fallback value.',group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first non-null value is obtained, and returns that value.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},step:{doc:'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},interpolate:{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array<number>`, or `color`.\n\nInterpolation types:\n- `["linear"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"interpolate-hcl":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},"interpolate-lab":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pi:{doc:"Returns the mathematical constant pi.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},e:{doc:"Returns the mathematical constant e.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},object:{doc:"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},collator:{doc:"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",group:"Types","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},format:{doc:'Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\n- `"text-font"`: Overrides the font stack specified by the root layout property.\n- `"text-color"`: Overrides the color specified by the root paint property.\n- `"font-scale"`: Applies a scaling factor on `text-size` as specified by the root layout property.',group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-font":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"font-scale":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-color":{js:"1.3.0",android:"7.3.0",ios:"4.10.0",macos:"0.14.0"},image:{js:"1.6.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},image:{doc:"Returns an `image` type for use in `icon-image`, `*-pattern` entries and as a section in the `format` expression. If set, the `image` argument will check that the requested image exists in the style and will return either the resolved image name or `null`, depending on whether or not the image is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `image` argument.",group:"Types","sdk-support":{"basic functionality":{js:"1.4.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},"number-format":{doc:"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",group:"Types","sdk-support":{"basic functionality":{js:"0.54.0"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a boolean, the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a color, it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-number":{doc:'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-rgba":{doc:"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},get:{doc:"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns null if the requested property is missing.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},has:{doc:"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},length:{doc:"Gets the length of an array or string.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},properties:{doc:'Gets the feature properties object.  Note that in some cases, it may be more efficient to use ["get", "property_name"] directly.',group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"feature-state":{doc:"Retrieves a property value from the current feature's state. Returns null if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.46.0"}}},"geometry-type":{doc:"Gets the feature's geometry type: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},id:{doc:"Gets the feature's id, if it has one.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},zoom:{doc:'Gets the current zoom level.  Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',group:"Zoom","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"heatmap-density":{doc:"Gets the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"line-progress":{doc:"Gets the progress along a gradient line. Can only be used in the `line-gradient` property.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.6.0",macos:"0.12.0"}}},accumulated:{doc:"Gets the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.53.0"}}},"+":{doc:"Returns the sum of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"*":{doc:"Returns the product of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sqrt:{doc:"Returns the square root of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ln:{doc:"Returns the natural logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sin:{doc:"Returns the sine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},cos:{doc:"Returns the cosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},tan:{doc:"Returns the tangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},asin:{doc:"Returns the arcsine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},acos:{doc:"Returns the arccosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},atan:{doc:"Returns the arctangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},min:{doc:"Returns the minimum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},max:{doc:"Returns the maximum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},round:{doc:'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},abs:{doc:"Returns the absolute value of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ceil:{doc:"Returns the smallest integer that is greater than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},floor:{doc:"Returns the largest integer that is less than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},distance:{doc:"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.",group:"Math","sdk-support":{"basic functionality":{android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}}},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},within:{doc:"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line's endpoint is on the boundary.",group:"Decision","sdk-support":{"basic functionality":{js:"1.9.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"is-supported-script":{doc:"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.6.0"}}},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},concat:{doc:"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"resolved-locale":{doc:"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.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,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.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,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,doc:"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",transition:!1,"sdk-support":{"basic functionality":{js:"0.50.0",ios:"4.7.0",macos:"0.13.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,doc:"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",doc:'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0",macos:"0.11.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle's stroke.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.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"],doc:'Defines the color of each pixel based on its density value in a heatmap.  Should be an expression that uses `["heatmap-density"]` as input.',transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,doc:"The color of the icon. This can only be used with sdf icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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,doc:"The color of the icon's halo. Icon halos can only be used with SDF icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter",values:{linear:{doc:"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},nearest:{doc:"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},default:"linear","sdk-support":{"basic functionality":{js:"0.47.0",android:"6.3.0",ios:"4.2.0",macos:"0.9.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}},"property-type":{"data-driven":{type:"property-type",doc:"Property is interpolable and can be represented using a property expression."},"cross-faded":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."},"cross-faded-data-driven":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It can be represented using a property expression."},"color-ramp":{type:"property-type",doc:"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{type:"property-type",doc:"Property is interpolable but cannot be represented using a property expression."},constant:{type:"property-type",doc:"Property is constant across all zoom levels and property values."}},promoteId:{"*":{type:"string",doc:"A name of a feature property to use as ID for feature state."}}};var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{};function s(t,e){return t(e={exports:{}},e.exports),e.exports}var a=s((function(t,e){!function(r){var i=e&&!e.nodeType&&e,n=t&&!t.nodeType&&t,s="object"==typeof o&&o;s.global!==s&&s.window!==s&&s.self!==s||(r=s);var a,l,u=2147483647,h=/^xn--/,c=/[^\x20-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,g=String.fromCharCode;function y(t){throw RangeError(d[t])}function m(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function _(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+m((t=t.replace(p,".")).split("."),e).join(".")}function v(t){for(var e,r,i=[],n=0,o=t.length;n<o;)(e=t.charCodeAt(n++))>=55296&&e<=56319&&n<o?56320==(64512&(r=t.charCodeAt(n++)))?i.push(((1023&e)<<10)+(1023&r)+65536):(i.push(e),n--):i.push(e);return i}function x(t){return m(t,(function(t){var e="";return t>65535&&(e+=g((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=g(t)})).join("")}function w(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function b(t,e,r){var i=0;for(t=r?f(t/700):t>>1,t+=f(t/e);t>455;i+=36)t=f(t/35);return f(i+36*t/(t+38))}function S(t){var e,r,i,n,o,s,a,l,h,c,p,d=[],g=t.length,m=0,_=128,v=72;for((r=t.lastIndexOf("-"))<0&&(r=0),i=0;i<r;++i)t.charCodeAt(i)>=128&&y("not-basic"),d.push(t.charCodeAt(i));for(n=r>0?r+1:0;n<g;){for(o=m,s=1,a=36;n>=g&&y("invalid-input"),((l=(p=t.charCodeAt(n++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:36)>=36||l>f((u-m)/s))&&y("overflow"),m+=l*s,!(l<(h=a<=v?1:a>=v+26?26:a-v));a+=36)s>f(u/(c=36-h))&&y("overflow"),s*=c;v=b(m-o,e=d.length+1,0==o),f(m/e)>u-_&&y("overflow"),_+=f(m/e),m%=e,d.splice(m++,0,_)}return x(d)}function T(t){var e,r,i,n,o,s,a,l,h,c,p,d,m,_,x,S=[];for(d=(t=v(t)).length,e=128,r=0,o=72,s=0;s<d;++s)(p=t[s])<128&&S.push(g(p));for(i=n=S.length,n&&S.push("-");i<d;){for(a=u,s=0;s<d;++s)(p=t[s])>=e&&p<a&&(a=p);for(a-e>f((u-r)/(m=i+1))&&y("overflow"),r+=(a-e)*m,e=a,s=0;s<d;++s)if((p=t[s])<e&&++r>u&&y("overflow"),p==e){for(l=r,h=36;!(l<(c=h<=o?1:h>=o+26?26:h-o));h+=36)x=l-c,_=36-c,S.push(g(w(c+x%_,0))),l=f(x/_);S.push(g(w(l,0))),o=b(r,m,i==n),r=0,++i}++r,++e}return S.join("")}if(a={version:"1.3.2",ucs2:{decode:v,encode:x},decode:S,encode:T,toASCII:function(t){return _(t,(function(t){return c.test(t)?"xn--"+T(t):t}))},toUnicode:function(t){return _(t,(function(t){return h.test(t)?S(t.slice(4).toLowerCase()):t}))}},i&&n)if(t.exports==i)n.exports=a;else for(l in a)a.hasOwnProperty(l)&&(i[l]=a[l]);else r.punycode=a}(o)})),l=function(t){return"string"==typeof t},u=function(t){return"object"==typeof t&&null!==t},h=function(t){return null===t},c=function(t){return null==t};function p(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var d=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var l=0;l<a;++l){var u,h,c,d,f=t[l].replace(o,"%20"),g=f.indexOf(r);g>=0?(u=f.substr(0,g),h=f.substr(g+1)):(u=f,h=""),c=decodeURIComponent(u),d=decodeURIComponent(h),p(n,c)?Array.isArray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},f=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},g=function(t,e,r,i){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(i){var n=encodeURIComponent(f(i))+r;return Array.isArray(t[i])?t[i].map((function(t){return n+encodeURIComponent(f(t))})).join(e):n+encodeURIComponent(f(t[i]))})).join(e):i?encodeURIComponent(f(i))+r+encodeURIComponent(f(t)):""},y=s((function(t,e){e.decode=e.parse=d,e.encode=e.stringify=g}));y.decode,y.parse,y.encode,y.stringify;function m(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var _=/^([a-z0-9.+-]+:)/i,v=/:[0-9]*$/,x=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,w=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),b=["'"].concat(w),S=["%","/","?",";","#"].concat(b),T=["/","?","#"],C=/^[+a-z0-9A-Z_-]{0,63}$/,E=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,R={javascript:!0,"javascript:":!0},P={javascript:!0,"javascript:":!0},I={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function O(t,e,r){if(t&&u(t)&&t instanceof m)return t;var i=new m;return i.parse(t,e,r),i}m.prototype.parse=function(t,e,r){if(!l(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i<t.indexOf("#")?"?":"#",o=t.split(n);o[0]=o[0].replace(/\\/g,"/");var s=t=o.join(n);if(s=s.trim(),!r&&1===t.split("#").length){var u=x.exec(s);if(u)return this.path=s,this.href=s,this.pathname=u[1],u[2]?(this.search=u[2],this.query=e?y.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var h=_.exec(s);if(h){var c=(h=h[0]).toLowerCase();this.protocol=c,s=s.substr(h.length)}if(r||h||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var p="//"===s.substr(0,2);!p||h&&P[h]||(s=s.substr(2),this.slashes=!0)}if(!P[h]&&(p||h&&!I[h])){for(var d,f,g=-1,m=0;m<T.length;m++){-1!==(v=s.indexOf(T[m]))&&(-1===g||v<g)&&(g=v)}-1!==(f=-1===g?s.lastIndexOf("@"):s.lastIndexOf("@",g))&&(d=s.slice(0,f),s=s.slice(f+1),this.auth=decodeURIComponent(d)),g=-1;for(m=0;m<S.length;m++){var v;-1!==(v=s.indexOf(S[m]))&&(-1===g||v<g)&&(g=v)}-1===g&&(g=s.length),this.host=s.slice(0,g),s=s.slice(g),this.parseHost(),this.hostname=this.hostname||"";var w="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!w)for(var O=this.hostname.split(/\./),L=(m=0,O.length);m<L;m++){var M=O[m];if(M&&!M.match(C)){for(var F="",A=0,k=M.length;A<k;A++)M.charCodeAt(A)>127?F+="x":F+=M[A];if(!F.match(C)){var N=O.slice(0,m),j=O.slice(m+1),D=M.match(E);D&&(N.push(D[1]),j.unshift(D[2])),j.length&&(s="/"+j.join(".")+s),this.hostname=N.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),w||(this.hostname=a.toASCII(this.hostname));var G=this.port?":"+this.port:"",z=this.hostname||"";this.host=z+G,this.href+=this.host,w&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!R[c])for(m=0,L=b.length;m<L;m++){var B=b[m];if(-1!==s.indexOf(B)){var U=encodeURIComponent(B);U===B&&(U=escape(B)),s=s.split(B).join(U)}}var Y=s.indexOf("#");-1!==Y&&(this.hash=s.substr(Y),s=s.slice(0,Y));var W=s.indexOf("?");if(-1!==W?(this.search=s.substr(W),this.query=s.substr(W+1),e&&(this.query=y.parse(this.query)),s=s.slice(0,W)):e&&(this.search="",this.query={}),s&&(this.pathname=s),I[c]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){G=this.pathname||"";var V=this.search||"";this.path=G+V}return this.href=this.format(),this},m.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",i=this.hash||"",n=!1,o="";this.host?n=t+this.host:this.hostname&&(n=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&u(this.query)&&Object.keys(this.query).length&&(o=y.stringify(this.query));var s=this.search||o&&"?"+o||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||I[e])&&!1!==n?(n="//"+(n||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):n||(n=""),i&&"#"!==i.charAt(0)&&(i="#"+i),s&&"?"!==s.charAt(0)&&(s="?"+s),e+n+(r=r.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(s=s.replace("#","%23"))+i},m.prototype.resolve=function(t){return this.resolveObject(O(t,!1,!0)).format()},m.prototype.resolveObject=function(t){if(l(t)){var e=new m;e.parse(t,!1,!0),t=e}for(var r=new m,i=Object.keys(this),n=0;n<i.length;n++){var o=i[n];r[o]=this[o]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),a=0;a<s.length;a++){var u=s[a];"protocol"!==u&&(r[u]=t[u])}return I[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!I[t.protocol]){for(var p=Object.keys(t),d=0;d<p.length;d++){var f=p[d];r[f]=t[f]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||P[t.protocol])r.pathname=t.pathname;else{for(var g=(t.pathname||"").split("/");g.length&&!(t.host=g.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==g[0]&&g.unshift(""),g.length<2&&g.unshift(""),r.pathname=g.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var y=r.pathname||"",_=r.search||"";r.path=y+_}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var v=r.pathname&&"/"===r.pathname.charAt(0),x=t.host||t.pathname&&"/"===t.pathname.charAt(0),w=x||v||r.host&&t.pathname,b=w,S=r.pathname&&r.pathname.split("/")||[],T=(g=t.pathname&&t.pathname.split("/")||[],r.protocol&&!I[r.protocol]);if(T&&(r.hostname="",r.port=null,r.host&&(""===S[0]?S[0]=r.host:S.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===g[0]?g[0]=t.host:g.unshift(t.host)),t.host=null),w=w&&(""===g[0]||""===S[0])),x)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,S=g;else if(g.length)S||(S=[]),S.pop(),S=S.concat(g),r.search=t.search,r.query=t.query;else if(!c(t.search)){if(T)r.hostname=r.host=S.shift(),(L=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=L.shift(),r.host=r.hostname=L.shift());return r.search=t.search,r.query=t.query,h(r.pathname)&&h(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!S.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var C=S.slice(-1)[0],E=(r.host||t.host||S.length>1)&&("."===C||".."===C)||""===C,R=0,O=S.length;O>=0;O--)"."===(C=S[O])?S.splice(O,1):".."===C?(S.splice(O,1),R++):R&&(S.splice(O,1),R--);if(!w&&!b)for(;R--;R)S.unshift("..");!w||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),E&&"/"!==S.join("/").substr(-1)&&S.push("");var L,M=""===S[0]||S[0]&&"/"===S[0].charAt(0);T&&(r.hostname=r.host=M?"":S.length?S.shift():"",(L=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=L.shift(),r.host=r.hostname=L.shift()));return(w=w||r.host&&S.length)&&!M&&S.unshift(""),S.length?r.pathname=S.join("/"):(r.pathname=null,r.path=null),h(r.pathname)&&h(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},m.prototype.parseHost=function(){var t=this.host,e=v.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};function L(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var i=0,n=e;i<n.length;i+=1){var o=n[i];for(var s in o)t[s]=o[s]}return t}var M=function(t){function e(e,r){t.call(this,r),this.message=r,this.key=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),F=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var r=0,i=e;r<i.length;r+=1){var n=i[r],o=n[0],s=n[1];this.bindings[o]=s}};F.prototype.concat=function(t){return new F(this,t)},F.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.")},F.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var A={kind:"null"},k={kind:"number"},N={kind:"string"},j={kind:"boolean"},D={kind:"color"},G={kind:"object"},z={kind:"value"},B={kind:"collator"},U={kind:"formatted"},Y={kind:"resolvedImage"};function W(t,e){return{kind:"array",itemType:t,N:e}}function V(t){if("array"===t.kind){var e=V(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var X=[A,k,N,j,D,U,G,W(z),Y];function q(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!q(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,i=X;r<i.length;r+=1){if(!q(i[r],e))return null}}return"Expected "+V(t)+" but found "+V(e)+" instead."}function Z(t,e){return e.some((function(e){return e.kind===t.kind}))}function K(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 H=s((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 i(t){return(t=Math.round(t))<0?0:t>255?255:t}function n(t){return t<0?0:t>1?1:t}function o(t){return"%"===t[t.length-1]?i(parseFloat(t)/100*255):i(parseInt(t))}function s(t){return"%"===t[t.length-1]?n(parseFloat(t)/100):n(parseFloat(t))}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,n=t.replace(/ /g,"").toLowerCase();if(n in r)return r[n].slice();if("#"===n[0])return 4===n.length?(e=parseInt(n.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===n.length&&(e=parseInt(n.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=n.indexOf("("),u=n.indexOf(")");if(-1!==l&&u+1===n.length){var h=n.substr(0,l),c=n.substr(l+1,u-(l+1)).split(","),p=1;switch(h){case"rgba":if(4!==c.length)return null;p=s(c.pop());case"rgb":return 3!==c.length?null:[o(c[0]),o(c[1]),o(c[2]),p];case"hsla":if(4!==c.length)return null;p=s(c.pop());case"hsl":if(3!==c.length)return null;var d=(parseFloat(c[0])%360+360)%360/360,f=s(c[1]),g=s(c[2]),y=g<=.5?g*(f+1):g+f-g*f,m=2*g-y;return[i(255*a(m,y,d+1/3)),i(255*a(m,y,d)),i(255*a(m,y,d-1/3)),p];default:return null}}return null}}catch(t){}})).parseCSSColor,J=function(t,e,r,i){void 0===i&&(i=1),this.r=t,this.g=e,this.b=r,this.a=i};J.parse=function(t){if(t){if(t instanceof J)return t;if("string"==typeof t){var e=H(t);if(e)return new J(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},J.prototype.toString=function(){var t=this.toArray(),e=t[0],r=t[1],i=t[2],n=t[3];return"rgba("+Math.round(e)+","+Math.round(r)+","+Math.round(i)+","+n+")"},J.prototype.toArray=function(){var t=this.r,e=this.g,r=this.b,i=this.a;return 0===i?[0,0,0,0]:[255*t/i,255*e/i,255*r/i,i]},J.black=new J(0,0,0,1),J.white=new J(1,1,1,1),J.transparent=new J(0,0,0,0),J.red=new J(1,0,0,1);var $=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"})};$.prototype.compare=function(t,e){return this.collator.compare(t,e)},$.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Q=function(t,e,r,i,n){this.text=t,this.image=e,this.scale=r,this.fontStack=i,this.textColor=n},tt=function(t){this.sections=t};tt.fromString=function(t){return new tt([new Q(t,null,null,null,null)])},tt.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}))},tt.factory=function(t){return t instanceof tt?t:tt.fromString(t)},tt.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},tt.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var i=r[e];if(i.image)t.push(["image",i.image.name]);else{t.push(i.text);var n={};i.fontStack&&(n["text-font"]=["literal",i.fontStack.split(",")]),i.scale&&(n["font-scale"]=i.scale),i.textColor&&(n["text-color"]=["rgba"].concat(i.textColor.toArray())),t.push(n)}}return t};var et=function(t){this.name=t.name,this.available=t.available};function rt(t,e,r,i){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:"Invalid rgba value ["+[t,e,r,i].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof i?[t,e,r,i]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function it(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 J)return!0;if(t instanceof $)return!0;if(t instanceof tt)return!0;if(t instanceof et)return!0;if(Array.isArray(t)){for(var e=0,r=t;e<r.length;e+=1){if(!it(r[e]))return!1}return!0}if("object"==typeof t){for(var i in t)if(!it(t[i]))return!1;return!0}return!1}function nt(t){if(null===t)return A;if("string"==typeof t)return N;if("boolean"==typeof t)return j;if("number"==typeof t)return k;if(t instanceof J)return D;if(t instanceof $)return B;if(t instanceof tt)return U;if(t instanceof et)return Y;if(Array.isArray(t)){for(var e,r=t.length,i=0,n=t;i<n.length;i+=1){var o=nt(n[i]);if(e){if(e===o)continue;e=z;break}e=o}return W(e||z,r)}return G}function ot(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof J||t instanceof tt||t instanceof et?t.toString():JSON.stringify(t)}et.prototype.toString=function(){return this.name},et.fromString=function(t){return t?new et({name:t,available:!1}):null},et.prototype.serialize=function(){return["image",this.name]};var st=function(t,e){this.type=t,this.value=e};st.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!it(t[1]))return e.error("invalid value");var r=t[1],i=nt(r),n=e.expectedType;return"array"!==i.kind||0!==i.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(i=n),new st(i,r)},st.prototype.evaluate=function(){return this.value},st.prototype.eachChild=function(){},st.prototype.outputDefined=function(){return!0},st.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof J?["rgba"].concat(this.value.toArray()):this.value instanceof tt?this.value.serialize():this.value};var at=function(t){this.name="ExpressionEvaluationError",this.message=t};at.prototype.toJSON=function(){return this.message};var lt={string:N,number:k,boolean:j,object:G},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,i=1,n=t[0];if("array"===n){var o,s;if(t.length>2){var a=t[1];if("string"!=typeof a||!(a in lt)||"object"===a)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=lt[a],i++}else o=z;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);s=t[2],i++}r=W(o,s)}else r=lt[n];for(var l=[];i<t.length;i++){var u=e.parse(t[i],i,z);if(!u)return null;l.push(u)}return new ut(r,l)},ut.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!q(this.type,nt(r)))return r;if(e===this.args.length-1)throw new at("Expected value to be of type "+V(this.type)+", but found "+V(nt(r))+" instead.")}return null},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(){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 i=t.N;("number"==typeof i||this.args.length>1)&&e.push(i)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var ht=function(t){this.type=U,this.sections=t};ht.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 i=[],n=!1,o=1;o<=t.length-1;++o){var s=t[o];if(n&&"object"==typeof s&&!Array.isArray(s)){n=!1;var a=null;if(s["font-scale"]&&!(a=e.parse(s["font-scale"],1,k)))return null;var l=null;if(s["text-font"]&&!(l=e.parse(s["text-font"],1,W(N))))return null;var u=null;if(s["text-color"]&&!(u=e.parse(s["text-color"],1,D)))return null;var h=i[i.length-1];h.scale=a,h.font=l,h.textColor=u}else{var c=e.parse(t[o],1,z);if(!c)return null;var p=c.type.kind;if("string"!==p&&"value"!==p&&"null"!==p&&"resolvedImage"!==p)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,i.push({content:c,scale:null,font:null,textColor:null})}}return new ht(i)},ht.prototype.evaluate=function(t){return new tt(this.sections.map((function(e){var r=e.content.evaluate(t);return nt(r)===Y?new Q("",r,null,null,null):new Q(ot(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},ht.prototype.eachChild=function(t){for(var e=0,r=this.sections;e<r.length;e+=1){var i=r[e];t(i.content),i.scale&&t(i.scale),i.font&&t(i.font),i.textColor&&t(i.textColor)}},ht.prototype.outputDefined=function(){return!1},ht.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var i=r[e];t.push(i.content.serialize());var n={};i.scale&&(n["font-scale"]=i.scale.serialize()),i.font&&(n["text-font"]=i.font.serialize()),i.textColor&&(n["text-color"]=i.textColor.serialize()),t.push(n)}return t};var ct=function(t){this.type=Y,this.input=t};ct.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,N);return r?new ct(r):e.error("No image name provided.")},ct.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=et.fromString(e);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(e)>-1),r},ct.prototype.eachChild=function(t){t(this.input)},ct.prototype.outputDefined=function(){return!1},ct.prototype.serialize=function(){return["image",this.input.serialize()]};var pt={"to-boolean":j,"to-color":D,"to-number":k,"to-string":N},dt=function(t,e){this.type=t,this.args=e};dt.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 i=pt[r],n=[],o=1;o<t.length;o++){var s=e.parse(t[o],o,z);if(!s)return null;n.push(s)}return new dt(i,n)},dt.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,i=0,n=this.args;i<n.length;i+=1){if(r=null,(e=n[i].evaluate(t))instanceof J)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.":rt(e[0],e[1],e[2],e[3])))return new J(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new at(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var s=null,a=0,l=this.args;a<l.length;a+=1){if(null===(s=l[a].evaluate(t)))return 0;var u=Number(s);if(!isNaN(u))return u}throw new at("Could not convert "+JSON.stringify(s)+" to number.")}return"formatted"===this.type.kind?tt.fromString(ot(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?et.fromString(ot(this.args[0].evaluate(t))):ot(this.args[0].evaluate(t))},dt.prototype.eachChild=function(t){this.args.forEach(t)},dt.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},dt.prototype.serialize=function(){if("formatted"===this.type.kind)return new ht([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new ct(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var ft=["Unknown","Point","LineString","Polygon"],gt=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};gt.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},gt.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?ft[this.feature.type]:this.feature.type:null},gt.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},gt.prototype.canonicalID=function(){return this.canonical},gt.prototype.properties=function(){return this.feature&&this.feature.properties||{}},gt.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=J.parse(t)),e};var yt=function(t,e,r,i){this.name=t,this.type=e,this._evaluate=r,this.args=i};yt.prototype.evaluate=function(t){return this._evaluate(t,this.args)},yt.prototype.eachChild=function(t){this.args.forEach(t)},yt.prototype.outputDefined=function(){return!1},yt.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},yt.parse=function(t,e){var r,i=t[0],n=yt.definitions[i];if(!n)return e.error('Unknown expression "'+i+'". If you wanted a literal array, use ["literal", [...]].',0);for(var o=Array.isArray(n)?n[0]:n.type,s=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,a=s.filter((function(e){var r=e[0];return!Array.isArray(r)||r.length===t.length-1})),l=null,u=0,h=a;u<h.length;u+=1){var c=h[u],p=c[0],d=c[1];l=new Dt(e.registry,e.path,null,e.scope);for(var f=[],g=!1,y=1;y<t.length;y++){var m=t[y],_=Array.isArray(p)?p[y-1]:p.type,v=l.parse(m,1+f.length,_);if(!v){g=!0;break}f.push(v)}if(!g)if(Array.isArray(p)&&p.length!==f.length)l.error("Expected "+p.length+" arguments, but found "+f.length+" instead.");else{for(var x=0;x<f.length;x++){var w=Array.isArray(p)?p[x]:p.type,b=f[x];l.concat(x+1).checkSubtype(w,b.type)}if(0===l.errors.length)return new yt(i,o,d,f)}}if(1===a.length)(r=e.errors).push.apply(r,l.errors);else{for(var S=(a.length?a:s).map((function(t){var e,r=t[0];return e=r,Array.isArray(e)?"("+e.map(V).join(", ")+")":"("+V(e.type)+"...)"})).join(" | "),T=[],C=1;C<t.length;C++){var E=e.parse(t[C],1+T.length);if(!E)return null;T.push(V(E.type))}e.error("Expected arguments of type "+S+", but found ("+T.join(", ")+") instead.")}return null},yt.register=function(t,e){for(var r in yt.definitions=e,e)t[r]=yt};var mt=function(t,e,r){this.type=B,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e};mt.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 i=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,j);if(!i)return null;var n=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,j);if(!n)return null;var o=null;return r.locale&&!(o=e.parse(r.locale,1,N))?null:new mt(i,n,o)},mt.prototype.evaluate=function(t){return new $(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},mt.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},mt.prototype.outputDefined=function(){return!1},mt.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]};function _t(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 vt(t,e){return!(t[0]<=e[0])&&(!(t[2]>=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function xt(t,e){var r,i=(180+t[0])/360,n=(r=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360),o=Math.pow(2,e.z);return[Math.round(i*o*8192),Math.round(n*o*8192)]}function wt(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function bt(t,e){for(var r,i,n,o,s,a,l,u=!1,h=0,c=e.length;h<c;h++)for(var p=e[h],d=0,f=p.length;d<f-1;d++){if(r=t,i=p[d],n=p[d+1],o=void 0,s=void 0,a=void 0,l=void 0,o=r[0]-i[0],s=r[1]-i[1],a=r[0]-n[0],l=r[1]-n[1],o*l-a*s==0&&o*a<=0&&s*l<=0)return!1;wt(t,p[d],p[d+1])&&(u=!u)}return u}function St(t,e){for(var r=0;r<e.length;r++)if(bt(t,e[r]))return!0;return!1}function Tt(t,e,r,i){var n=t[0]-r[0],o=t[1]-r[1],s=e[0]-r[0],a=e[1]-r[1],l=i[0]-r[0],u=i[1]-r[1],h=n*u-l*o,c=s*u-l*a;return h>0&&c<0||h<0&&c>0}function Ct(t,e,r){for(var i=0,n=r;i<n.length;i+=1)for(var o=n[i],s=0;s<o.length-1;++s)if(a=t,l=e,u=o[s],h=o[s+1],c=void 0,p=void 0,d=void 0,f=void 0,d=[l[0]-a[0],l[1]-a[1]],f=[h[0]-u[0],h[1]-u[1]],0!=(c=f)[0]*(p=d)[1]-c[1]*p[0]&&Tt(a,l,u,h)&&Tt(u,h,a,l))return!0;var a,l,u,h,c,p,d,f;return!1}function Et(t,e){for(var r=0;r<t.length;++r)if(!bt(t[r],e))return!1;for(var i=0;i<t.length-1;++i)if(Ct(t[i],t[i+1],e))return!1;return!0}function Rt(t,e){for(var r=0;r<e.length;r++)if(Et(t,e[r]))return!0;return!1}function Pt(t,e,r){for(var i=[],n=0;n<t.length;n++){for(var o=[],s=0;s<t[n].length;s++){var a=xt(t[n][s],r);_t(e,a),o.push(a)}i.push(o)}return i}function It(t,e,r){for(var i=[],n=0;n<t.length;n++){var o=Pt(t[n],e,r);i.push(o)}return i}function Ot(t,e,r,i){if(t[0]<r[0]||t[0]>r[2]){var n=.5*i,o=t[0]-r[0]>n?-i:r[0]-t[0]>n?i:0;0===o&&(o=t[0]-r[2]>n?-i:r[2]-t[0]>n?i:0),t[0]+=o}_t(e,t)}function Lt(t,e,r,i){for(var n=8192*Math.pow(2,i.z),o=[8192*i.x,8192*i.y],s=[],a=0,l=t;a<l.length;a+=1)for(var u=0,h=l[a];u<h.length;u+=1){var c=h[u],p=[c.x+o[0],c.y+o[1]];Ot(p,e,r,n),s.push(p)}return s}function Mt(t,e,r,i){for(var n,o=8192*Math.pow(2,i.z),s=[8192*i.x,8192*i.y],a=[],l=0,u=t;l<u.length;l+=1){for(var h=[],c=0,p=u[l];c<p.length;c+=1){var d=p[c],f=[d.x+s[0],d.y+s[1]];_t(e,f),h.push(f)}a.push(h)}if(e[2]-e[0]<=o/2){(n=e)[0]=n[1]=1/0,n[2]=n[3]=-1/0;for(var g=0,y=a;g<y.length;g+=1)for(var m=0,_=y[g];m<_.length;m+=1){Ot(_[m],e,r,o)}}return a}var Ft=function(t,e){this.type=j,this.geojson=t,this.geometries=e};function At(t){if(t instanceof yt){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 Ft)return!1;var e=!0;return t.eachChild((function(t){e&&!At(t)&&(e=!1)})),e}function kt(t){if(t instanceof yt&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!kt(t)&&(e=!1)})),e}function Nt(t,e){if(t instanceof yt&&e.indexOf(t.name)>=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Nt(t,e)&&(r=!1)})),r}Ft.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(it(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var i=0;i<r.features.length;++i){var n=r.features[i].geometry.type;if("Polygon"===n||"MultiPolygon"===n)return new Ft(r,r.features[i].geometry)}else if("Feature"===r.type){var o=r.geometry.type;if("Polygon"===o||"MultiPolygon"===o)return new Ft(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new Ft(r,r)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Ft.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],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){var o=Pt(e.coordinates,i,n),s=Lt(t.geometry(),r,i,n);if(!vt(r,i))return!1;for(var a=0,l=s;a<l.length;a+=1){if(!bt(l[a],o))return!1}}if("MultiPolygon"===e.type){var u=It(e.coordinates,i,n),h=Lt(t.geometry(),r,i,n);if(!vt(r,i))return!1;for(var c=0,p=h;c<p.length;c+=1){if(!St(p[c],u))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],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){var o=Pt(e.coordinates,i,n),s=Mt(t.geometry(),r,i,n);if(!vt(r,i))return!1;for(var a=0,l=s;a<l.length;a+=1){if(!Et(l[a],o))return!1}}if("MultiPolygon"===e.type){var u=It(e.coordinates,i,n),h=Mt(t.geometry(),r,i,n);if(!vt(r,i))return!1;for(var c=0,p=h;c<p.length;c+=1){if(!Rt(p[c],u))return!1}}return!0}(t,this.geometries)}return!1},Ft.prototype.eachChild=function(){},Ft.prototype.outputDefined=function(){return!0},Ft.prototype.serialize=function(){return["within",this.geojson]};var jt=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};jt.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 jt(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)},jt.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},jt.prototype.eachChild=function(){},jt.prototype.outputDefined=function(){return!1},jt.prototype.serialize=function(){return["var",this.name]};var Dt=function(t,e,r,i,n){void 0===e&&(e=[]),void 0===i&&(i=new F),void 0===n&&(n=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=i,this.errors=n,this.expectedType=r};function Gt(t,e){for(var r,i,n=t.length-1,o=0,s=n,a=0;o<=s;)if(r=t[a=Math.floor((o+s)/2)],i=t[a+1],r<=e){if(a===n||e<i)return a;o=a+1}else{if(!(r>e))throw new at("Input is not a number.");s=a-1}return 0}Dt.prototype.parse=function(t,e,r,i,n){return void 0===n&&(n={}),e?this.concat(e,r,i)._parse(t,n):this._parse(t,n)},Dt.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new ut(e,[t]):"coerce"===r?new dt(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 i=t[0];if("string"!=typeof i)return this.error("Expression name must be a string, but found "+typeof i+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var n=this.registry[i];if(n){var o=n.parse(t,this);if(!o)return null;if(this.expectedType){var s=this.expectedType,a=o.type;if("string"!==s.kind&&"number"!==s.kind&&"boolean"!==s.kind&&"object"!==s.kind&&"array"!==s.kind||"value"!==a.kind)if("color"!==s.kind&&"formatted"!==s.kind&&"resolvedImage"!==s.kind||"value"!==a.kind&&"string"!==a.kind){if(this.checkSubtype(s,a))return null}else o=r(o,s,e.typeAnnotation||"coerce");else o=r(o,s,e.typeAnnotation||"assert")}if(!(o instanceof st)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof jt)return t(e.boundExpression);if(e instanceof yt&&"error"===e.name)return!1;if(e instanceof mt)return!1;if(e instanceof Ft)return!1;var r=e instanceof dt||e instanceof ut,i=!0;if(e.eachChild((function(e){i=r?i&&t(e):i&&e instanceof st})),!i)return!1;return At(e)&&Nt(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var l=new gt;try{o=new st(o.type,o.evaluate(l))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+i+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},Dt.prototype.concat=function(t,e,r){var i="number"==typeof t?this.path.concat(t):this.path,n=r?this.scope.concat(r):this.scope;return new Dt(this.registry,i,e||null,n,this.errors)},Dt.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var i=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new M(i,t))},Dt.prototype.checkSubtype=function(t,e){var r=q(t,e);return r&&this.error(r),r};var zt=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var i=0,n=r;i<n.length;i+=1){var o=n[i],s=o[0],a=o[1];this.labels.push(s),this.outputs.push(a)}};zt.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,k);if(!r)return null;var i=[],n=null;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var o=1;o<t.length;o+=2){var s=1===o?-1/0:t[o],a=t[o+1],l=o,u=o+1;if("number"!=typeof s)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(i.length&&i[i.length-1][0]>=s)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var h=e.parse(a,u,n);if(!h)return null;n=n||h.type,i.push([s,h])}return new zt(n,r,i)},zt.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);var n=e.length;return i>=e[n-1]?r[n-1].evaluate(t):r[Gt(e,i)].evaluate(t)},zt.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1){t(r[e])}},zt.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},zt.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 Bt=Ut;function Ut(t,e,r,i){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*(i-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=i,this.p2x=r,this.p2y=i}function Yt(t,e,r){return t*(1-r)+e*r}Ut.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},Ut.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},Ut.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},Ut.prototype.solveCurveX=function(t,e){var r,i,n,o,s;for(void 0===e&&(e=1e-6),n=t,s=0;s<8;s++){if(o=this.sampleCurveX(n)-t,Math.abs(o)<e)return n;var a=this.sampleCurveDerivativeX(n);if(Math.abs(a)<1e-6)break;n-=o/a}if((n=t)<(r=0))return r;if(n>(i=1))return i;for(;r<i;){if(o=this.sampleCurveX(n),Math.abs(o-t)<e)return n;t>o?r=n:i=n,n=.5*(i-r)+r}return n},Ut.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var Wt=Object.freeze({__proto__:null,number:Yt,color:function(t,e,r){return new J(Yt(t.r,e.r,r),Yt(t.g,e.g,r),Yt(t.b,e.b,r),Yt(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,i){return Yt(t,e[i],r)}))}}),Vt=6/29,Xt=3*Vt*Vt,qt=Math.PI/180,Zt=180/Math.PI;function Kt(t){return t>.008856451679035631?Math.pow(t,1/3):t/Xt+4/29}function Ht(t){return t>Vt?t*t*t:Xt*(t-4/29)}function Jt(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function $t(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Qt(t){var e=$t(t.r),r=$t(t.g),i=$t(t.b),n=Kt((.4124564*e+.3575761*r+.1804375*i)/.95047),o=Kt((.2126729*e+.7151522*r+.072175*i)/1);return{l:116*o-16,a:500*(n-o),b:200*(o-Kt((.0193339*e+.119192*r+.9503041*i)/1.08883)),alpha:t.a}}function te(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,i=isNaN(t.b)?e:e-t.b/200;return e=1*Ht(e),r=.95047*Ht(r),i=1.08883*Ht(i),new J(Jt(3.2404542*r-1.5371385*e-.4985314*i),Jt(-.969266*r+1.8760108*e+.041556*i),Jt(.0556434*r-.2040259*e+1.0572252*i),t.alpha)}function ee(t,e,r){var i=e-t;return t+r*(i>180||i<-180?i-360*Math.round(i/360):i)}var re={forward:Qt,reverse:te,interpolate:function(t,e,r){return{l:Yt(t.l,e.l,r),a:Yt(t.a,e.a,r),b:Yt(t.b,e.b,r),alpha:Yt(t.alpha,e.alpha,r)}}},ie={forward:function(t){var e=Qt(t),r=e.l,i=e.a,n=e.b,o=Math.atan2(n,i)*Zt;return{h:o<0?o+360:o,c:Math.sqrt(i*i+n*n),l:r,alpha:t.a}},reverse:function(t){var e=t.h*qt,r=t.c;return te({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:ee(t.h,e.h,r),c:Yt(t.c,e.c,r),l:Yt(t.l,e.l,r),alpha:Yt(t.alpha,e.alpha,r)}}},ne=Object.freeze({__proto__:null,lab:re,hcl:ie}),oe=function(t,e,r,i,n){this.type=t,this.operator=e,this.interpolation=r,this.input=i,this.labels=[],this.outputs=[];for(var o=0,s=n;o<s.length;o+=1){var a=s[o],l=a[0],u=a[1];this.labels.push(l),this.outputs.push(u)}};function se(t,e,r,i){var n=i-r,o=t-r;return 0===n?0:1===e?o/n:(Math.pow(e,o)-1)/(Math.pow(e,n)-1)}oe.interpolationFactor=function(t,e,r,i){var n=0;if("exponential"===t.name)n=se(e,t.base,r,i);else if("linear"===t.name)n=se(e,1,r,i);else if("cubic-bezier"===t.name){var o=t.controlPoints;n=new Bt(o[0],o[1],o[2],o[3]).solve(se(e,1,r,i))}return n},oe.parse=function(t,e){var r=t[0],i=t[1],n=t[2],o=t.slice(3);if(!Array.isArray(i)||0===i.length)return e.error("Expected an interpolation type expression.",1);if("linear"===i[0])i={name:"linear"};else if("exponential"===i[0]){var s=i[1];if("number"!=typeof s)return e.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:s}}else{if("cubic-bezier"!==i[0])return e.error("Unknown interpolation type "+String(i[0]),1,0);var a=i.slice(1);if(4!==a.length||a.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);i={name:"cubic-bezier",controlPoints:a}}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(!(n=e.parse(n,2,k)))return null;var l=[],u=null;"interpolate-hcl"===r||"interpolate-lab"===r?u=D:e.expectedType&&"value"!==e.expectedType.kind&&(u=e.expectedType);for(var h=0;h<o.length;h+=2){var c=o[h],p=o[h+1],d=h+3,f=h+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.',d);if(l.length&&l[l.length-1][0]>=c)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',d);var g=e.parse(p,f,u);if(!g)return null;u=u||g.type,l.push([c,g])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new oe(u,r,i,n,l):e.error("Type "+V(u)+" is not interpolatable.")},oe.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);var n=e.length;if(i>=e[n-1])return r[n-1].evaluate(t);var o=Gt(e,i),s=e[o],a=e[o+1],l=oe.interpolationFactor(this.interpolation,i,s,a),u=r[o].evaluate(t),h=r[o+1].evaluate(t);return"interpolate"===this.operator?Wt[this.type.kind.toLowerCase()](u,h,l):"interpolate-hcl"===this.operator?ie.reverse(ie.interpolate(ie.forward(u),ie.forward(h),l)):re.reverse(re.interpolate(re.forward(u),re.forward(h),l))},oe.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1){t(r[e])}},oe.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},oe.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 ae=function(t,e){this.type=t,this.args=e};ae.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var r=null,i=e.expectedType;i&&"value"!==i.kind&&(r=i);for(var n=[],o=0,s=t.slice(1);o<s.length;o+=1){var a=s[o],l=e.parse(a,1+n.length,r,void 0,{typeAnnotation:"omit"});if(!l)return null;r=r||l.type,n.push(l)}var u=i&&n.some((function(t){return q(i,t.type)}));return new ae(u?z:r,n)},ae.prototype.evaluate=function(t){for(var e,r=null,i=0,n=0,o=this.args;n<o.length;n+=1){if(i++,(r=o[n].evaluate(t))&&r instanceof et&&!r.available&&(e||(e=r.name),r=null,i===this.args.length&&(r=e)),null!==r)break}return r},ae.prototype.eachChild=function(t){this.args.forEach(t)},ae.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},ae.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var le=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};le.prototype.evaluate=function(t){return this.result.evaluate(t)},le.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1){t(r[e][1])}t(this.result)},le.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=[],i=1;i<t.length-1;i+=2){var n=t[i];if("string"!=typeof n)return e.error("Expected string, but found "+typeof n+" instead.",i);if(/[^a-zA-Z0-9_]/.test(n))return e.error("Variable names must contain only alphanumeric characters or '_'.",i);var o=e.parse(t[i+1],i+1);if(!o)return null;r.push([n,o])}var s=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return s?new le(r,s):null},le.prototype.outputDefined=function(){return this.result.outputDefined()},le.prototype.serialize=function(){for(var t=["let"],e=0,r=this.bindings;e<r.length;e+=1){var i=r[e],n=i[0],o=i[1];t.push(n,o.serialize())}return t.push(this.result.serialize()),t};var ue=function(t,e,r){this.type=t,this.index=e,this.input=r};ue.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,k),i=e.parse(t[2],2,W(e.expectedType||z));if(!r||!i)return null;var n=i.type;return new ue(n.itemType,r,i)},ue.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new at("Array index out of bounds: "+e+" < 0.");if(e>=r.length)throw new at("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new at("Array index must be an integer, but found "+e+" instead.");return r[e]},ue.prototype.eachChild=function(t){t(this.index),t(this.input)},ue.prototype.outputDefined=function(){return!1},ue.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var he=function(t,e){this.type=j,this.needle=t,this.haystack=e};he.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,z),i=e.parse(t[2],2,z);return r&&i?Z(r.type,[j,N,k,A,z])?new he(r,i):e.error("Expected first argument to be of type boolean, string, number or null, but found "+V(r.type)+" instead"):null},he.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!K(e,["boolean","string","number","null"]))throw new at("Expected first argument to be of type boolean, string, number or null, but found "+V(nt(e))+" instead.");if(!K(r,["string","array"]))throw new at("Expected second argument to be of type array or string, but found "+V(nt(r))+" instead.");return r.indexOf(e)>=0},he.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},he.prototype.outputDefined=function(){return!0},he.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var ce=function(t,e,r){this.type=k,this.needle=t,this.haystack=e,this.fromIndex=r};ce.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,z),i=e.parse(t[2],2,z);if(!r||!i)return null;if(!Z(r.type,[j,N,k,A,z]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+V(r.type)+" instead");if(4===t.length){var n=e.parse(t[3],3,k);return n?new ce(r,i,n):null}return new ce(r,i)},ce.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!K(e,["boolean","string","number","null"]))throw new at("Expected first argument to be of type boolean, string, number or null, but found "+V(nt(e))+" instead.");if(!K(r,["string","array"]))throw new at("Expected second argument to be of type array or string, but found "+V(nt(r))+" instead.");if(this.fromIndex){var i=this.fromIndex.evaluate(t);return r.indexOf(e,i)}return r.indexOf(e)},ce.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},ce.prototype.outputDefined=function(){return!1},ce.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 pe=function(t,e,r,i,n,o){this.inputType=t,this.type=e,this.input=r,this.cases=i,this.outputs=n,this.otherwise=o};pe.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,i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var n={},o=[],s=2;s<t.length-1;s+=2){var a=t[s],l=t[s+1];Array.isArray(a)||(a=[a]);var u=e.concat(s);if(0===a.length)return u.error("Expected at least one branch label.");for(var h=0,c=a;h<c.length;h+=1){var p=c[h];if("number"!=typeof p&&"string"!=typeof p)return u.error("Branch labels must be numbers or strings.");if("number"==typeof p&&Math.abs(p)>Number.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof p&&Math.floor(p)!==p)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,nt(p)))return null}else r=nt(p);if(void 0!==n[String(p)])return u.error("Branch labels must be unique.");n[String(p)]=o.length}var d=e.parse(l,s,i);if(!d)return null;i=i||d.type,o.push(d)}var f=e.parse(t[1],1,z);if(!f)return null;var g=e.parse(t[t.length-1],t.length-1,i);return g?"value"!==f.type.kind&&e.concat(1).checkSubtype(r,f.type)?null:new pe(r,i,f,n,o,g):null},pe.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(nt(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},pe.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},pe.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},pe.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],i={},n=0,o=Object.keys(this.cases).sort();n<o.length;n+=1){var s=o[n];void 0===(c=i[this.cases[s]])?(i[this.cases[s]]=r.length,r.push([this.cases[s],[s]])):r[c][1].push(s)}for(var a=function(e){return"number"===t.inputType.kind?Number(e):e},l=0,u=r;l<u.length;l+=1){var h=u[l],c=h[0],p=h[1];1===p.length?e.push(a(p[0])):e.push(p.map(a)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var de=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r};de.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 i=[],n=1;n<t.length-1;n+=2){var o=e.parse(t[n],n,j);if(!o)return null;var s=e.parse(t[n+1],n+1,r);if(!s)return null;i.push([o,s]),r=r||s.type}var a=e.parse(t[t.length-1],t.length-1,r);return a?new de(r,i,a):null},de.prototype.evaluate=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var i=r[e],n=i[0],o=i[1];if(n.evaluate(t))return o.evaluate(t)}return this.otherwise.evaluate(t)},de.prototype.eachChild=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var i=r[e],n=i[0],o=i[1];t(n),t(o)}t(this.otherwise)},de.prototype.outputDefined=function(){return this.branches.every((function(t){t[0];return t[1].outputDefined()}))&&this.otherwise.outputDefined()},de.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var fe=function(t,e,r,i){this.type=t,this.input=e,this.beginIndex=r,this.endIndex=i};function ge(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 ye(t,e,r,i){return 0===i.compare(e,r)}function me(t,e,r){var i="=="!==t&&"!="!==t;return function(){function n(t,e,r){this.type=j,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return n.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,z);if(!o)return null;if(!ge(r,o.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+V(o.type)+"'.");var s=e.parse(t[2],2,z);if(!s)return null;if(!ge(r,s.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+V(s.type)+"'.");if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error("Cannot compare types '"+V(o.type)+"' and '"+V(s.type)+"'.");i&&("value"===o.type.kind&&"value"!==s.type.kind?o=new ut(s.type,[o]):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new ut(o.type,[s])));var a=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(a=e.parse(t[3],3,B)))return null}return new n(o,s,a)},n.prototype.evaluate=function(n){var o=this.lhs.evaluate(n),s=this.rhs.evaluate(n);if(i&&this.hasUntypedArgument){var a=nt(o),l=nt(s);if(a.kind!==l.kind||"string"!==a.kind&&"number"!==a.kind)throw new at('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+a.kind+", "+l.kind+") instead.")}if(this.collator&&!i&&this.hasUntypedArgument){var u=nt(o),h=nt(s);if("string"!==u.kind||"string"!==h.kind)return e(n,o,s)}return this.collator?r(n,o,s,this.collator.evaluate(n)):e(n,o,s)},n.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},n.prototype.outputDefined=function(){return!0},n.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},n}()}fe.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,z),i=e.parse(t[2],2,k);if(!r||!i)return null;if(!Z(r.type,[W(z),N,z]))return e.error("Expected first argument to be of type array or string, but found "+V(r.type)+" instead");if(4===t.length){var n=e.parse(t[3],3,k);return n?new fe(r.type,r,i,n):null}return new fe(r.type,r,i)},fe.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!K(e,["string","array"]))throw new at("Expected first argument to be of type array or string, but found "+V(nt(e))+" instead.");if(this.endIndex){var i=this.endIndex.evaluate(t);return e.slice(r,i)}return e.slice(r)},fe.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},fe.prototype.outputDefined=function(){return!1},fe.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 _e=me("==",(function(t,e,r){return e===r}),ye),ve=me("!=",(function(t,e,r){return e!==r}),(function(t,e,r,i){return!ye(0,e,r,i)})),xe=me("<",(function(t,e,r){return e<r}),(function(t,e,r,i){return i.compare(e,r)<0})),we=me(">",(function(t,e,r){return e>r}),(function(t,e,r,i){return i.compare(e,r)>0})),be=me("<=",(function(t,e,r){return e<=r}),(function(t,e,r,i){return i.compare(e,r)<=0})),Se=me(">=",(function(t,e,r){return e>=r}),(function(t,e,r,i){return i.compare(e,r)>=0})),Te=function(t,e,r,i,n){this.type=N,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=i,this.maxFractionDigits=n};Te.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,k);if(!r)return null;var i=t[2];if("object"!=typeof i||Array.isArray(i))return e.error("NumberFormat options argument must be an object.");var n=null;if(i.locale&&!(n=e.parse(i.locale,1,N)))return null;var o=null;if(i.currency&&!(o=e.parse(i.currency,1,N)))return null;var s=null;if(i["min-fraction-digits"]&&!(s=e.parse(i["min-fraction-digits"],1,k)))return null;var a=null;return i["max-fraction-digits"]&&!(a=e.parse(i["max-fraction-digits"],1,k))?null:new Te(r,n,o,s,a)},Te.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))},Te.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)},Te.prototype.outputDefined=function(){return!1},Te.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 Ce=function(t){this.type=k,this.input=t};Ce.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 "+V(r.type)+" instead."):new Ce(r):null},Ce.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 at("Expected value to be of type string or array, but found "+V(nt(e))+" instead.")},Ce.prototype.eachChild=function(t){t(this.input)},Ce.prototype.outputDefined=function(){return!1},Ce.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Ee={"==":_e,"!=":ve,">":we,"<":xe,">=":Se,"<=":be,array:ut,at:ue,boolean:ut,case:de,coalesce:ae,collator:mt,format:ht,image:ct,in:he,"index-of":ce,interpolate:oe,"interpolate-hcl":oe,"interpolate-lab":oe,length:Ce,let:le,literal:st,match:pe,number:ut,"number-format":Te,object:ut,slice:fe,step:zt,string:ut,"to-boolean":dt,"to-color":dt,"to-number":dt,"to-string":dt,var:jt,within:Ft};function Re(t,e){var r=e[0],i=e[1],n=e[2],o=e[3];r=r.evaluate(t),i=i.evaluate(t),n=n.evaluate(t);var s=o?o.evaluate(t):1,a=rt(r,i,n,s);if(a)throw new at(a);return new J(r/255*s,i/255*s,n/255*s,s)}function Pe(t,e){return t in e}function Ie(t,e){var r=e[t];return void 0===r?null:r}function Oe(t){return{type:t}}function Le(t){return{result:"success",value:t}}function Me(t){return{result:"error",value:t}}function Fe(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 ke(t){return!!t.expression&&t.expression.interpolated}function Ne(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function je(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function De(t){return t}function Ge(t,e){var r,i,n,o="color"===e.type,s=t.stops&&"object"==typeof t.stops[0][0],a=s||void 0!==t.property,l=s||!a,u=t.type||(ke(e)?"exponential":"interval");if(o&&((t=L({},t)).stops&&(t.stops=t.stops.map((function(t){return[t[0],J.parse(t[1])]}))),t.default?t.default=J.parse(t.default):t.default=J.parse(e.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!ne[t.colorSpace])throw new Error("Unknown color space: "+t.colorSpace);if("exponential"===u)r=Ye;else if("interval"===u)r=Ue;else if("categorical"===u){r=Be,i=Object.create(null);for(var h=0,c=t.stops;h<c.length;h+=1){var p=c[h];i[p[0]]=p[1]}n=typeof t.stops[0][0]}else{if("identity"!==u)throw new Error('Unknown function type "'+u+'"');r=We}if(s){for(var d={},f=[],g=0;g<t.stops.length;g++){var y=t.stops[g],m=y[0].zoom;void 0===d[m]&&(d[m]={zoom:m,type:t.type,property:t.property,default:t.default,stops:[]},f.push(m)),d[m].stops.push([y[0].value,y[1]])}for(var _=[],v=0,x=f;v<x.length;v+=1){var w=x[v];_.push([d[w].zoom,Ge(d[w],e)])}var b={name:"linear"};return{kind:"composite",interpolationType:b,interpolationFactor:oe.interpolationFactor.bind(void 0,b),zoomStops:_.map((function(t){return t[0]})),evaluate:function(r,i){var n=r.zoom;return Ye({stops:_,base:t.base},e,n).evaluate(n,i)}}}if(l){var S="exponential"===u?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:S,interpolationFactor:oe.interpolationFactor.bind(void 0,S),zoomStops:t.stops.map((function(t){return t[0]})),evaluate:function(o){var s=o.zoom;return r(t,e,s,i,n)}}}return{kind:"source",evaluate:function(o,s){var a=s&&s.properties?s.properties[t.property]:void 0;return void 0===a?ze(t.default,e.default):r(t,e,a,i,n)}}}function ze(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Be(t,e,r,i,n){return ze(typeof r===n?i[r]:void 0,t.default,e.default)}function Ue(t,e,r){if("number"!==Ne(r))return ze(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 n=Gt(t.stops.map((function(t){return t[0]})),r);return t.stops[n][1]}function Ye(t,e,r){var i=void 0!==t.base?t.base:1;if("number"!==Ne(r))return ze(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 o=Gt(t.stops.map((function(t){return t[0]})),r),s=function(t,e,r,i){var n=i-r,o=t-r;return 0===n?0:1===e?o/n:(Math.pow(e,o)-1)/(Math.pow(e,n)-1)}(r,i,t.stops[o][0],t.stops[o+1][0]),a=t.stops[o][1],l=t.stops[o+1][1],u=Wt[e.type]||De;if(t.colorSpace&&"rgb"!==t.colorSpace){var h=ne[t.colorSpace];u=function(t,e){return h.reverse(h.interpolate(h.forward(t),h.forward(e),s))}}return"function"==typeof a.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=a.evaluate.apply(void 0,t),i=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==i)return u(r,i,s)}}:u(a,l,s)}function We(t,e,r){return"color"===e.type?r=J.parse(r):"formatted"===e.type?r=tt.fromString(r.toString()):"resolvedImage"===e.type?r=et.fromString(r.toString()):Ne(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),ze(r,t.default,e.default)}yt.register(Ee,{error:[{kind:"error"},[N],function(t,e){var r=e[0];throw new at(r.evaluate(t))}],typeof:[N,[z],function(t,e){return V(nt(e[0].evaluate(t)))}],"to-rgba":[W(k,4),[D],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[D,[k,k,k],Re],rgba:[D,[k,k,k,k],Re],has:{type:j,overloads:[[[N],function(t,e){return Pe(e[0].evaluate(t),t.properties())}],[[N,G],function(t,e){var r=e[0],i=e[1];return Pe(r.evaluate(t),i.evaluate(t))}]]},get:{type:z,overloads:[[[N],function(t,e){return Ie(e[0].evaluate(t),t.properties())}],[[N,G],function(t,e){var r=e[0],i=e[1];return Ie(r.evaluate(t),i.evaluate(t))}]]},"feature-state":[z,[N],function(t,e){return Ie(e[0].evaluate(t),t.featureState||{})}],properties:[G,[],function(t){return t.properties()}],"geometry-type":[N,[],function(t){return t.geometryType()}],id:[z,[],function(t){return t.id()}],zoom:[k,[],function(t){return t.globals.zoom}],"heatmap-density":[k,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[k,[],function(t){return t.globals.lineProgress||0}],accumulated:[z,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[k,Oe(k),function(t,e){for(var r=0,i=0,n=e;i<n.length;i+=1){r+=n[i].evaluate(t)}return r}],"*":[k,Oe(k),function(t,e){for(var r=1,i=0,n=e;i<n.length;i+=1){r*=n[i].evaluate(t)}return r}],"-":{type:k,overloads:[[[k,k],function(t,e){var r=e[0],i=e[1];return r.evaluate(t)-i.evaluate(t)}],[[k],function(t,e){return-e[0].evaluate(t)}]]},"/":[k,[k,k],function(t,e){var r=e[0],i=e[1];return r.evaluate(t)/i.evaluate(t)}],"%":[k,[k,k],function(t,e){var r=e[0],i=e[1];return r.evaluate(t)%i.evaluate(t)}],ln2:[k,[],function(){return Math.LN2}],pi:[k,[],function(){return Math.PI}],e:[k,[],function(){return Math.E}],"^":[k,[k,k],function(t,e){var r=e[0],i=e[1];return Math.pow(r.evaluate(t),i.evaluate(t))}],sqrt:[k,[k],function(t,e){var r=e[0];return Math.sqrt(r.evaluate(t))}],log10:[k,[k],function(t,e){var r=e[0];return Math.log(r.evaluate(t))/Math.LN10}],ln:[k,[k],function(t,e){var r=e[0];return Math.log(r.evaluate(t))}],log2:[k,[k],function(t,e){var r=e[0];return Math.log(r.evaluate(t))/Math.LN2}],sin:[k,[k],function(t,e){var r=e[0];return Math.sin(r.evaluate(t))}],cos:[k,[k],function(t,e){var r=e[0];return Math.cos(r.evaluate(t))}],tan:[k,[k],function(t,e){var r=e[0];return Math.tan(r.evaluate(t))}],asin:[k,[k],function(t,e){var r=e[0];return Math.asin(r.evaluate(t))}],acos:[k,[k],function(t,e){var r=e[0];return Math.acos(r.evaluate(t))}],atan:[k,[k],function(t,e){var r=e[0];return Math.atan(r.evaluate(t))}],min:[k,Oe(k),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[k,Oe(k),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[k,[k],function(t,e){var r=e[0];return Math.abs(r.evaluate(t))}],round:[k,[k],function(t,e){var r=e[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[k,[k],function(t,e){var r=e[0];return Math.floor(r.evaluate(t))}],ceil:[k,[k],function(t,e){var r=e[0];return Math.ceil(r.evaluate(t))}],"filter-==":[j,[N,z],function(t,e){var r=e[0],i=e[1];return t.properties()[r.value]===i.value}],"filter-id-==":[j,[z],function(t,e){var r=e[0];return t.id()===r.value}],"filter-type-==":[j,[N],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[j,[N,z],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],o=i.value;return typeof n==typeof o&&n<o}],"filter-id-<":[j,[z],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i<n}],"filter->":[j,[N,z],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],o=i.value;return typeof n==typeof o&&n>o}],"filter-id->":[j,[z],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i>n}],"filter-<=":[j,[N,z],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],o=i.value;return typeof n==typeof o&&n<=o}],"filter-id-<=":[j,[z],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i<=n}],"filter->=":[j,[N,z],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],o=i.value;return typeof n==typeof o&&n>=o}],"filter-id->=":[j,[z],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i>=n}],"filter-has":[j,[z],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[j,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[j,[W(N)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[j,[W(z)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[j,[N,W(z)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[j,[N,W(z)],function(t,e){var r=e[0],i=e[1];return function(t,e,r,i){for(;r<=i;){var n=r+i>>1;if(e[n]===t)return!0;e[n]>t?i=n-1:r=n+1}return!1}(t.properties()[r.value],i.value,0,i.value.length-1)}],all:{type:j,overloads:[[[j,j],function(t,e){var r=e[0],i=e[1];return r.evaluate(t)&&i.evaluate(t)}],[Oe(j),function(t,e){for(var r=0,i=e;r<i.length;r+=1){if(!i[r].evaluate(t))return!1}return!0}]]},any:{type:j,overloads:[[[j,j],function(t,e){var r=e[0],i=e[1];return r.evaluate(t)||i.evaluate(t)}],[Oe(j),function(t,e){for(var r=0,i=e;r<i.length;r+=1){if(i[r].evaluate(t))return!0}return!1}]]},"!":[j,[j],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[j,[N],function(t,e){var r=e[0],i=t.globals&&t.globals.isSupportedScript;return!i||i(r.evaluate(t))}],upcase:[N,[N],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[N,[N],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[N,Oe(z),function(t,e){return e.map((function(e){return ot(e.evaluate(t))})).join("")}],"resolved-locale":[N,[B],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var Ve=function(t,e){var r;this.expression=t,this._warningHistory={},this._evaluator=new gt,this._defaultValue=e?"color"===(r=e).type&&je(r.default)?new J(0,0,0,0):"color"===r.type?J.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=e&&"enum"===e.type?e.values:null};function Xe(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Ee}function qe(t,e){var r=new Dt(Ee,[],e?function(t){var e={color:D,string:N,number:k,enum:N,boolean:j,formatted:U,resolvedImage:Y};if("array"===t.type)return W(e[t.value]||z,t.length);return e[t.type]}(e):void 0),i=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return i?Le(new Ve(i,e)):Me(r.errors)}Ve.prototype.evaluateWithoutErrorHandling=function(t,e,r,i,n,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)},Ve.prototype.evaluate=function(t,e,r,i,n,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o||null;try{var s=this.expression.evaluate(this._evaluator);if(null==s||"number"==typeof s&&s!=s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new at("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(s)+" instead.");return s}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Ze=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!kt(e.expression)};Ze.prototype.evaluateWithoutErrorHandling=function(t,e,r,i,n,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,o)},Ze.prototype.evaluate=function(t,e,r,i,n,o){return this._styleExpression.evaluate(t,e,r,i,n,o)};var Ke=function(t,e,r,i){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!kt(e.expression),this.interpolationType=i};function He(t,e){if("error"===(t=qe(t,e)).result)return t;var r=t.value.expression,i=At(r);if(!i&&!Fe(e))return Me([new M("","data expressions not supported")]);var n=Nt(r,["zoom"]);if(!n&&!Ae(e))return Me([new M("","zoom expressions not supported")]);var o=function t(e){var r=null;if(e instanceof le)r=t(e.result);else if(e instanceof ae)for(var i=0,n=e.args;i<n.length;i+=1){var o=n[i];if(r=t(o))break}else(e instanceof zt||e instanceof oe)&&e.input instanceof yt&&"zoom"===e.input.name&&(r=e);if(r instanceof M)return r;return e.eachChild((function(e){var i=t(e);i instanceof M?r=i:!r&&i?r=new M("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&i&&r!==i&&(r=new M("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),r}(r);if(!o&&!n)return Me([new M("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof M)return Me([o]);if(o instanceof oe&&!ke(e))return Me([new M("",'"interpolate" expressions cannot be used with this property')]);if(!o)return Le(new Ze(i?"constant":"source",t.value));var s=o instanceof oe?o.interpolation:void 0;return Le(new Ke(i?"camera":"composite",t.value,o.labels,s))}Ke.prototype.evaluateWithoutErrorHandling=function(t,e,r,i,n,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,o)},Ke.prototype.evaluate=function(t,e,r,i,n,o){return this._styleExpression.evaluate(t,e,r,i,n,o)},Ke.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?oe.interpolationFactor(this.interpolationType,t,e,r):0};var Je=function(t,e){this._parameters=t,this._specification=e,L(this,Ge(this._parameters,this._specification))};function $e(t){return"object"==typeof t?["literal",t]:t}function Qe(t,e){var r=t.stops;if(!r)return function(t,e){var r=["get",t.property];if(void 0===t.default)return"string"===e.type?["string",r]:r;if("enum"===e.type)return["match",r,Object.keys(e.values),r,t.default];var i=["color"===e.type?"to-color":e.type,r,$e(t.default)];return"array"===e.type&&i.splice(1,0,e.value,e.length||null),i}(t,e);var i=r&&"object"==typeof r[0][0],n=i||void 0!==t.property,o=i||!n;return r=r.map((function(t){return!n&&e.tokens&&"string"==typeof t[1]?[t[0],sr(t[1])]:[t[0],$e(t[1])]})),i?function(t,e,r){for(var i={},n={},o=[],s=0;s<r.length;s++){var a=r[s],l=a[0].zoom;void 0===i[l]&&(i[l]={zoom:l,type:t.type,property:t.property,default:t.default},n[l]=[],o.push(l)),n[l].push([a[0].value,a[1]])}if("exponential"===or({},e)){for(var u=[tr(t),["linear"],["zoom"]],h=0,c=o;h<c.length;h+=1){var p=c[h],d=rr(i[p],e,n[p]);nr(u,p,d,!1)}return u}for(var f=["step",["zoom"]],g=0,y=o;g<y.length;g+=1){var m=y[g],_=rr(i[m],e,n[m]);nr(f,m,_,!0)}return ir(f),f}(t,e,r):o?function(t,e,r,i){void 0===i&&(i=["zoom"]);var n,o=or(t,e),s=!1;if("interval"===o)n=["step",i],s=!0;else{if("exponential"!==o)throw new Error('Unknown zoom function type "'+o+'"');var a=void 0!==t.base?t.base:1;n=[tr(t),1===a?["linear"]:["exponential",a],i]}for(var l=0,u=r;l<u.length;l+=1){var h=u[l];nr(n,h[0],h[1],s)}return ir(n),n}(t,e,r):rr(t,e,r)}function tr(t){switch(t.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function er(t,e){return void 0!==t?t:void 0!==e?e:void 0}function rr(t,e,r){var i=or(t,e),n=["get",t.property];if("categorical"===i&&"boolean"==typeof r[0][0]){for(var o=["case"],s=0,a=r;s<a.length;s+=1){var l=a[s];o.push(["==",n,l[0]],l[1])}return o.push($e(er(t.default,e.default))),o}if("categorical"===i){for(var u=["match",n],h=0,c=r;h<c.length;h+=1){var p=c[h];nr(u,p[0],p[1],!1)}return u.push($e(er(t.default,e.default))),u}if("interval"===i){for(var d=["step",["number",n]],f=0,g=r;f<g.length;f+=1){var y=g[f];nr(d,y[0],y[1],!0)}return ir(d),void 0===t.default?d:["case",["==",["typeof",n],"number"],d,$e(t.default)]}if("exponential"===i){for(var m=void 0!==t.base?t.base:1,_=[tr(t),1===m?["linear"]:["exponential",m],["number",n]],v=0,x=r;v<x.length;v+=1){var w=x[v];nr(_,w[0],w[1],!1)}return void 0===t.default?_:["case",["==",["typeof",n],"number"],_,$e(t.default)]}throw new Error("Unknown property function type "+i)}function ir(t){"step"===t[0]&&3===t.length&&(t.push(0),t.push(t[3]))}function nr(t,e,r,i){t.length>3&&e===t[t.length-2]||(i&&2===t.length||t.push(e),t.push(r))}function or(t,e){return t.type?t.type:e.expression.interpolated?"exponential":"interval"}function sr(t){for(var e=["concat"],r=/{([^{}]+)}/g,i=0,n=r.exec(t);null!==n;n=r.exec(t)){var o=t.slice(i,r.lastIndex-n[0].length);i=r.lastIndex,o.length>0&&e.push(o),e.push(["get",n[1]])}if(1===e.length)return t;if(i<t.length)e.push(t.slice(i));else if(2===e.length)return["to-string",e[1]];return e}function ar(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 i=r[e];if(!ar(i)&&"boolean"!=typeof i)return!1}return!0;default:return!0}}Je.deserialize=function(t){return new Je(t._parameters,t._specification)},Je.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var lr={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function ur(t){if(null==t)return{filter:function(){return!0},needGeometry:!1};ar(t)||(t=cr(t));var e=qe(t,lr);if("error"===e.result)throw new Error(e.value.map((function(t){return t.key+": "+t.message})).join(", "));return{filter:function(t,r,i){return e.value.evaluate(t,r,{},i)},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 hr(t,e){return t<e?-1:t>e?1:0}function cr(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?pr(t[1],t[2],"=="):"!="===r?gr(pr(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?pr(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(cr))):"all"===r?["all"].concat(t.slice(1).map(cr)):"none"===r?["all"].concat(t.slice(1).map(cr).map(gr)):"in"===r?dr(t[1],t.slice(2)):"!in"===r?gr(dr(t[1],t.slice(2))):"has"===r?fr(t[1]):"!has"===r?gr(fr(t[1])):"within"!==r||t}function pr(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 dr(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(hr)]]:["filter-in-small",t,["literal",e]]}}function fr(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function gr(t){return["!",t]}var yr=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function mr(t,e){var r={};for(var i in t)"ref"!==i&&(r[i]=t[i]);return yr.forEach((function(t){t in e&&(r[t]=e[t])})),r}function _r(t){t=t.slice();for(var e=Object.create(null),r=0;r<t.length;r++)e[t[r].id]=t[r];for(var i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=mr(t[i],e[t[i].ref]));return t}var vr=function(t,e,r,i){this.message=(t?t+": ":"")+r,i&&(this.identifier=i),null!=e&&e.__line__&&(this.line=e.__line__)},xr=function(t){this.error=t,this.message=t.message;var e=t.message.match(/line (\d+)/);this.line=e?parseInt(e[1],10):0};function wr(t){var e=t.key,r=t.value;return r?[new vr(e,r,"constants have been deprecated as of v8")]:[]}function br(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Sr(t){if(Array.isArray(t))return t.map(Sr);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var r in t)e[r]=Sr(t[r]);return e}return br(t)}function Tr(t){var e=t.key,r=t.value,i=t.valueSpec||{},n=t.objectElementValidators||{},o=t.style,s=t.styleSpec,a=[],l=Ne(r);if("object"!==l)return[new vr(e,r,"object expected, "+l+" found")];for(var u in r){var h=u.split(".")[0],c=i[h]||i["*"],p=void 0;if(n[h])p=n[h];else if(i[h])p=zr;else if(n["*"])p=n["*"];else{if(!i["*"]){a.push(new vr(e,r[u],'unknown property "'+u+'"'));continue}p=zr}a=a.concat(p({key:(e?e+".":e)+u,value:r[u],valueSpec:c,style:o,styleSpec:s,object:r,objectKey:u},r))}for(var d in i)n[d]||i[d].required&&void 0===i[d].default&&void 0===r[d]&&a.push(new vr(e,r,'missing required property "'+d+'"'));return a}function Cr(t){var e=t.value,r=t.valueSpec,i=t.style,n=t.styleSpec,o=t.key,s=t.arrayElementValidator||zr;if("array"!==Ne(e))return[new vr(o,e,"array expected, "+Ne(e)+" found")];if(r.length&&e.length!==r.length)return[new vr(o,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.length<r["min-length"])return[new vr(o,e,"array length at least "+r["min-length"]+" expected, length "+e.length+" found")];var a={type:r.value,values:r.values};n.$version<7&&(a.function=r.function),"object"===Ne(r.value)&&(a=r.value);for(var l=[],u=0;u<e.length;u++)l=l.concat(s({array:e,arrayIndex:u,value:e[u],valueSpec:a,style:i,styleSpec:n,key:o+"["+u+"]"}));return l}function Er(t){var e=t.key,r=t.value,i=t.valueSpec,n=Ne(r);return"number"===n&&r!=r&&(n="NaN"),"number"!==n?[new vr(e,r,"number expected, "+n+" found")]:"minimum"in i&&r<i.minimum?[new vr(e,r,r+" is less than the minimum value "+i.minimum)]:"maximum"in i&&r>i.maximum?[new vr(e,r,r+" is greater than the maximum value "+i.maximum)]:[]}function Rr(t){var e,r,i,n=t.valueSpec,o=br(t.value.type),s={},a="categorical"!==o&&void 0===t.value.property,l=!a,u="array"===Ne(t.value.stops)&&"array"===Ne(t.value.stops[0])&&"object"===Ne(t.value.stops[0][0]),h=Tr({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 vr(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;e=e.concat(Cr({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:c})),"array"===Ne(r)&&0===r.length&&e.push(new vr(t.key,r,"array must have at least one stop"));return e},default:function(t){return zr({key:t.key,value:t.value,valueSpec:n,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&a&&h.push(new vr(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||h.push(new vr(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!ke(t.valueSpec)&&h.push(new vr(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!Fe(t.valueSpec)?h.push(new vr(t.key,t.value,"property functions not supported")):a&&!Ae(t.valueSpec)&&h.push(new vr(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!u||void 0!==t.value.property||h.push(new vr(t.key,t.value,'"property" property is required')),h;function c(t){var e=[],o=t.value,a=t.key;if("array"!==Ne(o))return[new vr(a,o,"array expected, "+Ne(o)+" found")];if(2!==o.length)return[new vr(a,o,"array length 2 expected, length "+o.length+" found")];if(u){if("object"!==Ne(o[0]))return[new vr(a,o,"object expected, "+Ne(o[0])+" found")];if(void 0===o[0].zoom)return[new vr(a,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new vr(a,o,"object stop key must have value")];if(i&&i>br(o[0].zoom))return[new vr(a,o[0].zoom,"stop zoom values must appear in ascending order")];br(o[0].zoom)!==i&&(i=br(o[0].zoom),r=void 0,s={}),e=e.concat(Tr({key:a+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Er,value:p}}))}else e=e.concat(p({key:a+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return Xe(Sr(o[1]))?e.concat([new vr(a+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(zr({key:a+"[1]",value:o[1],valueSpec:n,style:t.style,styleSpec:t.styleSpec}))}function p(t,i){var a=Ne(t.value),l=br(t.value),u=null!==t.value?t.value:i;if(e){if(a!==e)return[new vr(t.key,u,a+" stop domain type must match previous stop domain type "+e)]}else e=a;if("number"!==a&&"string"!==a&&"boolean"!==a)return[new vr(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==a&&"categorical"!==o){var h="number expected, "+a+" found";return Fe(n)&&void 0===o&&(h+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new vr(t.key,u,h)]}return"categorical"!==o||"number"!==a||isFinite(l)&&Math.floor(l)===l?"categorical"!==o&&"number"===a&&void 0!==r&&l<r?[new vr(t.key,u,"stop domain values must appear in ascending order")]:(r=l,"categorical"===o&&l in s?[new vr(t.key,u,"stop domain values must be unique")]:(s[l]=!0,[])):[new vr(t.key,u,"integer expected, found "+l)]}}function Pr(t){var e=("property"===t.expressionContext?He:qe)(Sr(t.value),t.valueSpec);if("error"===e.result)return e.value.map((function(e){return new vr(""+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 vr(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&&!kt(r))return[new vr(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!kt(r))return[new vr(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!Nt(r,["zoom","feature-state"]))return[new vr(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!At(r))return[new vr(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Ir(t){var e=t.key,r=t.value,i=t.valueSpec,n=[];return Array.isArray(i.values)?-1===i.values.indexOf(br(r))&&n.push(new vr(e,r,"expected one of ["+i.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(i.values).indexOf(br(r))&&n.push(new vr(e,r,"expected one of ["+Object.keys(i.values).join(", ")+"], "+JSON.stringify(r)+" found")),n}function Or(t){return ar(Sr(t.value))?Pr(L({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,i=e.key;if("array"!==Ne(r))return[new vr(i,r,"array expected, "+Ne(r)+" found")];var n,o=e.styleSpec,s=[];if(r.length<1)return[new vr(i,r,"filter array must have at least 1 element")];switch(s=s.concat(Ir({key:i+"[0]",value:r[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),br(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===br(r[1])&&s.push(new vr(i,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&s.push(new vr(i,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(n=Ne(r[1]))&&s.push(new vr(i+"[1]",r[1],"string expected, "+n+" found"));for(var a=2;a<r.length;a++)n=Ne(r[a]),"$type"===br(r[1])?s=s.concat(Ir({key:i+"["+a+"]",value:r[a],valueSpec:o.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==n&&"number"!==n&&"boolean"!==n&&s.push(new vr(i+"["+a+"]",r[a],"string, number, or boolean expected, "+n+" found"));break;case"any":case"all":case"none":for(var l=1;l<r.length;l++)s=s.concat(t({key:i+"["+l+"]",value:r[l],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":n=Ne(r[1]),2!==r.length?s.push(new vr(i,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"string"!==n&&s.push(new vr(i+"[1]",r[1],"string expected, "+n+" found"));break;case"within":n=Ne(r[1]),2!==r.length?s.push(new vr(i,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"object"!==n&&s.push(new vr(i+"[1]",r[1],"object expected, "+n+" found"))}return s}(t)}function Lr(t,e){var r=t.key,i=t.style,n=t.styleSpec,o=t.value,s=t.objectKey,a=n[e+"_"+t.layerType];if(!a)return[];var l=s.match(/^(.*)-transition$/);if("paint"===e&&l&&a[l[1]]&&a[l[1]].transition)return zr({key:r,value:o,valueSpec:n.transition,style:i,styleSpec:n});var u,h=t.valueSpec||a[s];if(!h)return[new vr(r,o,'unknown property "'+s+'"')];if("string"===Ne(o)&&Fe(h)&&!h.tokens&&(u=/^{([^}]+)}$/.exec(o)))return[new vr(r,o,'"'+s+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(u[1])+" }`.")];var c=[];return"symbol"===t.layerType&&("text-field"===s&&i&&!i.glyphs&&c.push(new vr(r,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===s&&je(Sr(o))&&"identity"===br(o.type)&&c.push(new vr(r,o,'"text-font" does not support identity functions'))),c.concat(zr({key:t.key,value:o,valueSpec:h,style:i,styleSpec:n,expressionContext:"property",propertyType:e,propertyKey:s}))}function Mr(t){return Lr(t,"paint")}function Fr(t){return Lr(t,"layout")}function Ar(t){var e=[],r=t.value,i=t.key,n=t.style,o=t.styleSpec;r.type||r.ref||e.push(new vr(i,r,'either "type" or "ref" is required'));var s,a=br(r.type),l=br(r.ref);if(r.id)for(var u=br(r.id),h=0;h<t.arrayIndex;h++){var c=n.layers[h];br(c.id)===u&&e.push(new vr(i,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 vr(i,r[t],'"'+t+'" is prohibited for ref layers'))})),n.layers.forEach((function(t){br(t.id)===l&&(s=t)})),s?s.ref?e.push(new vr(i,r.ref,"ref cannot reference another ref layer")):a=br(s.type):e.push(new vr(i,r.ref,'ref layer "'+l+'" not found'));else if("background"!==a)if(r.source){var p=n.sources&&n.sources[r.source],d=p&&br(p.type);p?"vector"===d&&"raster"===a?e.push(new vr(i,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===d&&"raster"!==a?e.push(new vr(i,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==d||r["source-layer"]?"raster-dem"===d&&"hillshade"!==a?e.push(new vr(i,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==a||!r.paint||!r.paint["line-gradient"]||"geojson"===d&&p.lineMetrics||e.push(new vr(i,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new vr(i,r,'layer "'+r.id+'" must specify a "source-layer"')):e.push(new vr(i,r.source,'source "'+r.source+'" not found'))}else e.push(new vr(i,r,'missing required property "source"'));return e=e.concat(Tr({key:i,value:r,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return zr({key:i+".type",value:r.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"})},filter:Or,layout:function(t){return Tr({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return Fr(L({layerType:a},t))}}})},paint:function(t){return Tr({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return Mr(L({layerType:a},t))}}})}}}))}function kr(t){var e=t.value,r=t.key,i=Ne(e);return"string"!==i?[new vr(r,e,"string expected, "+i+" found")]:[]}var Nr={promoteId:function(t){var e=t.key,r=t.value;if("string"===Ne(r))return kr({key:e,value:r});var i=[];for(var n in r)i.push.apply(i,kr({key:e+"."+n,value:r[n]}));return i}};function jr(t){var e=t.value,r=t.key,i=t.styleSpec,n=t.style;if(!e.type)return[new vr(r,e,'"type" is required')];var o,s=br(e.type);switch(s){case"vector":case"raster":case"raster-dem":return o=Tr({key:r,value:e,valueSpec:i["source_"+s.replace("-","_")],style:t.style,styleSpec:i,objectElementValidators:Nr});case"geojson":if(o=Tr({key:r,value:e,valueSpec:i.source_geojson,style:n,styleSpec:i,objectElementValidators:Nr}),e.cluster)for(var a in e.clusterProperties){var l=e.clusterProperties[a],u=l[0],h=l[1],c="string"==typeof u?[u,["accumulated"],["get",a]]:u;o.push.apply(o,Pr({key:r+"."+a+".map",value:h,expressionContext:"cluster-map"})),o.push.apply(o,Pr({key:r+"."+a+".reduce",value:c,expressionContext:"cluster-reduce"}))}return o;case"video":return Tr({key:r,value:e,valueSpec:i.source_video,style:n,styleSpec:i});case"image":return Tr({key:r,value:e,valueSpec:i.source_image,style:n,styleSpec:i});case"canvas":return[new vr(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Ir({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:n,styleSpec:i})}}function Dr(t){var e=t.value,r=t.styleSpec,i=r.light,n=t.style,o=[],s=Ne(e);if(void 0===e)return o;if("object"!==s)return o=o.concat([new vr("light",e,"object expected, "+s+" found")]);for(var a in e){var l=a.match(/^(.*)-transition$/);o=l&&i[l[1]]&&i[l[1]].transition?o.concat(zr({key:a,value:e[a],valueSpec:r.transition,style:n,styleSpec:r})):i[a]?o.concat(zr({key:a,value:e[a],valueSpec:i[a],style:n,styleSpec:r})):o.concat([new vr(a,e[a],'unknown property "'+a+'"')])}return o}var Gr={"*":function(){return[]},array:Cr,boolean:function(t){var e=t.value,r=t.key,i=Ne(e);return"boolean"!==i?[new vr(r,e,"boolean expected, "+i+" found")]:[]},number:Er,color:function(t){var e=t.key,r=t.value,i=Ne(r);return"string"!==i?[new vr(e,r,"color expected, "+i+" found")]:null===H(r)?[new vr(e,r,'color expected, "'+r+'" found')]:[]},constants:wr,enum:Ir,filter:Or,function:Rr,layer:Ar,object:Tr,source:jr,light:Dr,string:kr,formatted:function(t){return 0===kr(t).length?[]:Pr(t)},resolvedImage:function(t){return 0===kr(t).length?[]:Pr(t)}};function zr(t){var e=t.value,r=t.valueSpec,i=t.styleSpec;return r.expression&&je(br(e))?Rr(t):r.expression&&Xe(Sr(e))?Pr(t):r.type&&Gr[r.type]?Gr[r.type](t):Tr(L({},t,{valueSpec:r.type?i[r.type]:r}))}function Br(t){var e=t.value,r=t.key,i=kr(t);return i.length||(-1===e.indexOf("{fontstack}")&&i.push(new vr(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&i.push(new vr(r,e,'"glyphs" url must include a "{range}" token'))),i}function Ur(t,e){void 0===e&&(e=n);var r=[];return r=r.concat(zr({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:Br,"*":function(){return[]}}})),t.constants&&(r=r.concat(wr({key:"constants",value:t.constants,style:t,styleSpec:e}))),Yr(r)}function Yr(t){return[].concat(t).sort((function(t,e){return t.line-e.line}))}function Wr(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return Yr(t.apply(this,e))}}Ur.source=Wr(jr),Ur.light=Wr(Dr),Ur.layer=Wr(Ar),Ur.filter=Wr(Or),Ur.paintProperty=Wr(Mr),Ur.layoutProperty=Wr(Fr);var Vr=s((function(t,e){var r=function(){var t=function(t,e,r,i){for(r=r||{},i=t.length;i--;r[t[i]]=e);return r},e=[1,12],r=[1,13],i=[1,9],n=[1,10],o=[1,11],s=[1,14],a=[1,15],l=[14,18,22,24],u=[18,22],h=[22,24],c={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(t,e,r,i,n,o,s){var a=o.length-1;switch(n){case 1:this.$=new String(t.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b")),this.$.__line__=this._$.first_line;break;case 2:this.$=new Number(t),this.$.__line__=this._$.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.__line__=this._$.first_line;break;case 5:this.$=new Boolean(!1),this.$.__line__=this._$.first_line;break;case 6:return this.$=o[a-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=o[a-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[o[a-2],o[a]];break;case 16:this.$={},this.$[o[a][0]]=o[a][1];break;case 17:this.$=o[a-2],o[a-2][o[a][0]]=o[a][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[o[a]];break;case 21:this.$=o[a-2],o[a-2].push(o[a])}},table:[{3:5,4:e,5:6,6:r,7:3,8:i,9:4,10:n,11:o,12:1,13:2,15:7,16:8,17:s,23:a},{1:[3]},{14:[1,16]},t(l,[2,7]),t(l,[2,8]),t(l,[2,9]),t(l,[2,10]),t(l,[2,11]),t(l,[2,12]),t(l,[2,3]),t(l,[2,4]),t(l,[2,5]),t([14,18,21,22,24],[2,1]),t(l,[2,2]),{3:20,4:e,18:[1,17],19:18,20:19},{3:5,4:e,5:6,6:r,7:3,8:i,9:4,10:n,11:o,13:23,15:7,16:8,17:s,23:a,24:[1,21],25:22},{1:[2,6]},t(l,[2,13]),{18:[1,24],22:[1,25]},t(u,[2,16]),{21:[1,26]},t(l,[2,18]),{22:[1,28],24:[1,27]},t(h,[2,20]),t(l,[2,14]),{3:20,4:e,20:29},{3:5,4:e,5:6,6:r,7:3,8:i,9:4,10:n,11:o,13:30,15:7,16:8,17:s,23:a},t(l,[2,19]),{3:5,4:e,5:6,6:r,7:3,8:i,9:4,10:n,11:o,13:31,15:7,16:8,17:s,23:a},t(u,[2,17]),t(u,[2,15]),t(h,[2,21])],defaultActions:{16:[2,6]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){var e=this,r=[0],i=[null],n=[],o=this.table,s="",a=0,l=0,u=2,h=1,c=n.slice.call(arguments,1),p=Object.create(this.lexer),d={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(d.yy[f]=this.yy[f]);p.setInput(t,d.yy),d.yy.lexer=p,d.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var g=p.yylloc;n.push(g);var y=p.options&&p.options.ranges;function m(){var t;return"number"!=typeof(t=p.lex()||h)&&(t=e.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,v,x,w,b,S,T,C,E={};;){if(v=r[r.length-1],this.defaultActions[v]?x=this.defaultActions[v]:(null==_&&(_=m()),x=o[v]&&o[v][_]),void 0===x||!x.length||!x[0]){var R="";for(b in C=[],o[v])this.terminals_[b]&&b>u&&C.push("'"+this.terminals_[b]+"'");R=p.showPosition?"Parse error on line "+(a+1)+":\n"+p.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(a+1)+": Unexpected "+(_==h?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(R,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:g,expected:C})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+_);switch(x[0]){case 1:r.push(_),i.push(p.yytext),n.push(p.yylloc),r.push(x[1]),_=null,l=p.yyleng,s=p.yytext,a=p.yylineno,g=p.yylloc;break;case 2:if(S=this.productions_[x[1]][1],E.$=i[i.length-S],E._$={first_line:n[n.length-(S||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(S||1)].first_column,last_column:n[n.length-1].last_column},y&&(E._$.range=[n[n.length-(S||1)].range[0],n[n.length-1].range[1]]),void 0!==(w=this.performAction.apply(E,[s,l,a,d.yy,x[1],i,n].concat(c))))return w;S&&(r=r.slice(0,-1*S*2),i=i.slice(0,-1*S),n=n.slice(0,-1*S)),r.push(this.productions_[x[1]][0]),i.push(E.$),n.push(E._$),T=o[r[r.length-2]][r[r.length-1]],r.push(T);break;case 3:return!0}}return!0}},p={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===i.length?this.yylloc.first_column:0)+i[i.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var r,i,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var o in n)this[o]=n[o];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,r,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),o=0;o<n.length;o++)if((r=this._input.match(this.rules[n[o]]))&&(!e||r[0].length>e[0].length)){if(e=r,i=o,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,n[o])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,r,i){switch(r){case 0:break;case 1:return 6;case 2:return e.yytext=e.yytext.substr(1,e.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};function d(){this.yy={}}return c.lexer=p,d.prototype=c,c.Parser=d,new d}();e.parser=r,e.Parser=r.Parser,e.parse=function(){return r.parse.apply(r,arguments)}}));Vr.parser,Vr.Parser,Vr.parse;function Xr(t){if(t instanceof String||"string"==typeof t||t instanceof i)try{return Vr.parse(t.toString())}catch(t){throw new xr(t)}return t}function qr(t,e){void 0===e&&(e=n);var r=t;try{r=Xr(r)}catch(t){return[t]}return Ur(r,e)}var Zr={StyleExpression:Ve,isExpression:Xe,isExpressionFilter:ar,createExpression:qe,createPropertyExpression:He,normalizePropertyExpression:function(t,e){if(je(t))return new Je(t,e);if(Xe(t)){var r=He(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var i=t;return"string"==typeof t&&"color"===e.type&&(i=J.parse(t)),{kind:"constant",evaluate:function(){return i}}},ZoomConstantExpression:Ze,ZoomDependentExpression:Ke,StylePropertyFunction:Je},Kr={convertFunction:Qe,createFunction:Ge,isFunction:je};qr.parsed=qr,qr.latest=qr}).call(this,r(5),r(21).Buffer)},function(t,e,r){t.exports=function(){"use strict";function t(t,i,n,o,s){!function t(r,i,n,o,s){for(;o>n;){if(o-n>600){var a=o-n+1,l=i-n+1,u=Math.log(a),h=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*h*(a-h)/a)*(l-a/2<0?-1:1),p=Math.max(n,Math.floor(i-l*h/a+c)),d=Math.min(o,Math.floor(i+(a-l)*h/a+c));t(r,i,p,d,s)}var f=r[i],g=n,y=o;for(e(r,n,i),s(r[o],f)>0&&e(r,n,o);g<y;){for(e(r,g,y),g++,y--;s(r[g],f)<0;)g++;for(;s(r[y],f)>0;)y--}0===s(r[n],f)?e(r,n,y):(y++,e(r,y,o)),y<=i&&(n=y+1),i<=y&&(o=y-1)}}(t,i,n||0,o||t.length-1,s||r)}function e(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function r(t,e){return t<e?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function n(t,e,r){if(!r)return e.indexOf(t);for(var i=0;i<e.length;i++)if(r(t,e[i]))return i;return-1}function o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,r,i,n){n||(n=f(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(var o=e;o<r;o++){var s=t.children[o];a(n,t.leaf?i(s):s)}return n}function a(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function c(t){return t.maxX-t.minX+(t.maxY-t.minY)}function p(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function d(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function f(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,r,i,n,o){for(var s=[r,i];s.length;)if(!((i=s.pop())-(r=s.pop())<=n)){var a=r+Math.ceil((i-r)/n/2)*n;t(e,a,r,i,o),s.push(r,a,a,i)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,r=[];if(!d(t,e))return r;for(var i=this.toBBox,n=[];e;){for(var o=0;o<e.children.length;o++){var s=e.children[o],a=e.leaf?i(s):s;d(t,a)&&(e.leaf?r.push(s):p(t,a)?this._all(s,r):n.push(s))}e=n.pop()}return r},i.prototype.collides=function(t){var e=this.data;if(!d(t,e))return!1;for(var r=[];e;){for(var i=0;i<e.children.length;i++){var n=e.children[i],o=e.leaf?this.toBBox(n):n;if(d(t,o)){if(e.leaf||p(t,o))return!0;r.push(n)}}e=r.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var r=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var i=this.data;this.data=r,r=i}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=f([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var r,i,o,s=this.data,a=this.toBBox(t),l=[],u=[];s||l.length;){if(s||(s=l.pop(),i=l[l.length-1],r=u.pop(),o=!0),s.leaf){var h=n(t,s.children,e);if(-1!==h)return s.children.splice(h,1),l.push(s),this._condense(l),this}o||s.leaf||!p(s,a)?i?(r++,s=i.children[r],o=!1):s=null:(l.push(s),u.push(r),r=0,i=s,s=s.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var r=[];t;)t.leaf?e.push.apply(e,t.children):r.push.apply(r,t.children),t=r.pop();return e},i.prototype._build=function(t,e,r,i){var n,s=r-e+1,a=this._maxEntries;if(s<=a)return o(n=f(t.slice(e,r+1)),this.toBBox),n;i||(i=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,i-1))),(n=f([])).leaf=!1,n.height=i;var l=Math.ceil(s/a),u=l*Math.ceil(Math.sqrt(a));g(t,e,r,u,this.compareMinX);for(var h=e;h<=r;h+=u){var c=Math.min(h+u-1,r);g(t,h,c,l,this.compareMinY);for(var p=h;p<=c;p+=l){var d=Math.min(p+l-1,c);n.children.push(this._build(t,p,d,i-1))}}return o(n,this.toBBox),n},i.prototype._chooseSubtree=function(t,e,r,i){for(;i.push(e),!e.leaf&&i.length-1!==r;){for(var n=1/0,o=1/0,s=void 0,a=0;a<e.children.length;a++){var l=e.children[a],u=h(l),c=(p=t,d=l,(Math.max(d.maxX,p.maxX)-Math.min(d.minX,p.minX))*(Math.max(d.maxY,p.maxY)-Math.min(d.minY,p.minY))-u);c<o?(o=c,n=u<n?u:n,s=l):c===o&&u<n&&(n=u,s=l)}e=s||e.children[0]}var p,d;return e},i.prototype._insert=function(t,e,r){var i=r?t:this.toBBox(t),n=[],o=this._chooseSubtree(i,this.data,e,n);for(o.children.push(t),a(o,i);e>=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(i,n,e)},i.prototype._split=function(t,e){var r=t[e],i=r.children.length,n=this._minEntries;this._chooseSplitAxis(r,n,i);var s=this._chooseSplitIndex(r,n,i),a=f(r.children.splice(s,r.children.length-s));a.height=r.height,a.leaf=r.leaf,o(r,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(r,a)},i.prototype._splitRoot=function(t,e){this.data=f([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,r){for(var i,n,o,a,l,u,c,p=1/0,d=1/0,f=e;f<=r-e;f++){var g=s(t,0,f,this.toBBox),y=s(t,f,r,this.toBBox),m=(n=g,o=y,a=void 0,l=void 0,u=void 0,c=void 0,a=Math.max(n.minX,o.minX),l=Math.max(n.minY,o.minY),u=Math.min(n.maxX,o.maxX),c=Math.min(n.maxY,o.maxY),Math.max(0,u-a)*Math.max(0,c-l)),_=h(g)+h(y);m<p?(p=m,i=f,d=_<d?_:d):m===p&&_<d&&(d=_,i=f)}return i||r-e},i.prototype._chooseSplitAxis=function(t,e,r){var i=t.leaf?this.compareMinX:l,n=t.leaf?this.compareMinY:u;this._allDistMargin(t,e,r,i)<this._allDistMargin(t,e,r,n)&&t.children.sort(i)},i.prototype._allDistMargin=function(t,e,r,i){t.children.sort(i);for(var n=this.toBBox,o=s(t,0,e,n),l=s(t,r-e,r,n),u=c(o)+c(l),h=e;h<r-e;h++){var p=t.children[h];a(o,t.leaf?n(p):p),u+=c(o)}for(var d=r-e-1;d>=e;d--){var f=t.children[d];a(l,t.leaf?n(f):f),u+=c(l)}return u},i.prototype._adjustParentBBoxes=function(t,e,r){for(var i=r;i>=0;i--)a(e[i],t)},i.prototype._condense=function(t){for(var e=t.length-1,r=void 0;e>=0;e--)0===t[e].children.length?e>0?(r=t[e-1].children).splice(r.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},i}()},function(t,e,r){"use strict";t.exports=n;var i=r(4);function n(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}n.Varint=0,n.Fixed64=1,n.Bytes=2,n.Fixed32=5;var o="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function s(t){return t.type===n.Bytes?t.readVarint()+t.pos:t.pos+1}function a(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function l(t,e,r){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(i);for(var n=r.pos-1;n>=t;n--)r.buf[n+i]=r.buf[n]}function u(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function h(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function c(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function p(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function d(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function f(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function g(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function y(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function m(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function _(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function v(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function x(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}n.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var i=this.readVarint(),n=i>>3,o=this.pos;this.type=7&i,t(n,e,this),this.pos===o&&this.skip(i)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=_(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=x(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=_(this.buf,this.pos)+4294967296*_(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=_(this.buf,this.pos)+4294967296*x(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=i.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=i.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,i=this.buf;return e=127&(r=i[this.pos++]),r<128?e:(e|=(127&(r=i[this.pos++]))<<7,r<128?e:(e|=(127&(r=i[this.pos++]))<<14,r<128?e:(e|=(127&(r=i[this.pos++]))<<21,r<128?e:function(t,e,r){var i,n,o=r.buf;if(n=o[r.pos++],i=(112&n)>>4,n<128)return a(t,i,e);if(n=o[r.pos++],i|=(127&n)<<3,n<128)return a(t,i,e);if(n=o[r.pos++],i|=(127&n)<<10,n<128)return a(t,i,e);if(n=o[r.pos++],i|=(127&n)<<17,n<128)return a(t,i,e);if(n=o[r.pos++],i|=(127&n)<<24,n<128)return a(t,i,e);if(n=o[r.pos++],i|=(1&n)<<31,n<128)return a(t,i,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=i[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&&o?function(t,e,r){return o.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){var i="",n=e;for(;n<r;){var o,s,a,l=t[n],u=null,h=l>239?4:l>223?3:l>191?2:1;if(n+h>r)break;1===h?l<128&&(u=l):2===h?128==(192&(o=t[n+1]))&&(u=(31&l)<<6|63&o)<=127&&(u=null):3===h?(o=t[n+1],s=t[n+2],128==(192&o)&&128==(192&s)&&((u=(15&l)<<12|(63&o)<<6|63&s)<=2047||u>=55296&&u<=57343)&&(u=null)):4===h&&(o=t[n+1],s=t[n+2],a=t[n+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&((u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,h=1):u>65535&&(u-=65536,i+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),i+=String.fromCharCode(u),n+=h}return i}(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!==n.Bytes)return t.push(this.readVarint(e));var r=s(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==n.Bytes)return t.push(this.readSVarint());var e=s(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==n.Bytes)return t.push(this.readBoolean());var e=s(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==n.Bytes)return t.push(this.readFloat());var e=s(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==n.Bytes)return t.push(this.readDouble());var e=s(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==n.Bytes)return t.push(this.readFixed32());var e=s(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==n.Bytes)return t.push(this.readSFixed32());var e=s(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==n.Bytes)return t.push(this.readFixed64());var e=s(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==n.Bytes)return t.push(this.readSFixed64());var e=s(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===n.Varint)for(;this.buf[this.pos++]>127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.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),v(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),v(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),v(this.buf,-1&t,this.pos),v(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),v(this.buf,-1&t,this.pos),v(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,i;t>=0?(r=t%4294967296|0,i=t/4294967296|0):(i=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,i=i+1|0));if(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,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;if(e.buf[e.pos++]|=r|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(i,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 i,n,o=0;o<e.length;o++){if((i=e.charCodeAt(o))>55295&&i<57344){if(!n){i>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):n=i;continue}if(i<56320){t[r++]=239,t[r++]=191,t[r++]=189,n=i;continue}i=n-55296<<10|i-56320|65536,n=null}else n&&(t[r++]=239,t[r++]=191,t[r++]=189,n=null);i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:(i<65536?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=63&i|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&l(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),i.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),i.write(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 i=this.pos-r;i>=128&&l(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,u,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,h,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,c,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,g,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,y,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,m,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},function(t,e){var r={thin:100,hairline:100,"ultra-light":100,"extra-light":100,light:200,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,heavy:800,black:800,"extra-bold":800,"ultra-black":900,"extra-black":900,"ultra-bold":900,"heavy-black":900,fat:900,poster:900},i=/(italic|oblique)$/i,n={};t.exports=function(t,e,o){var s=n[t];if(!s){Array.isArray(t)||(t=[t]);for(var a=400,l="normal",u=[],h=0,c=t.length;h<c;++h){var p=t[h].split(" "),d=p[p.length-1].toLowerCase();for(var f in"normal"==d||"italic"==d||"oblique"==d?(l=d,p.pop(),d=p[p.length-1].toLowerCase()):i.test(d)&&(d=d.replace(i,""),l=p[p.length-1].replace(d,"")),r)if(d==f||d==f.replace("-","")||d==f.replace("-"," ")){a=r[f],p.pop();break}"number"==typeof d&&(a=d);var g=p.join(" ").replace("Klokantech Noto Sans","Noto Sans");-1!==g.indexOf(" ")&&(g='"'+g+'"'),u.push(g)}s=n[t]=[l,a,u]}return s[0]+" "+s[1]+" "+e+"px"+(o?"/"+o:"")+" "+s[2]}},function(t,e){e.read=function(t,e,r,i,n){var o,s,a=8*n-i-1,l=(1<<a)-1,u=l>>1,h=-7,c=r?n-1:0,p=r?-1:1,d=t[e+c];for(c+=p,o=d&(1<<-h)-1,d>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=p,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=i;h>0;s=256*s+t[e+c],c+=p,h-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,i),o-=u}return(d?-1:1)*s*Math.pow(2,o-i)},e.write=function(t,e,r,i,n,o){var s,a,l,u=8*o-n-1,h=(1<<u)-1,c=h>>1,p=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,f=i?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+c>=1?p/l:p*Math.pow(2,1-c))*l>=2&&(s++,l/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*l-1)*Math.pow(2,n),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,n),s=0));n>=8;t[r+d]=255&a,d+=f,a/=256,n-=8);for(s=s<<n|a,u+=n;u>0;t[r+d]=255&s,d+=f,s/=256,u-=8);t[r+d-f]|=128*g}},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){(function(){var e;t.exports={icon:"icons/google.svg",name:"google",title:"Google Fonts",link:"google.com/fonts",getNames:function(){return e},getLink:function(t){return"https://fonts.google.com/specimen/"+t.replace(/( )/g,"+")},normalizeName:function(t){return t}},e=["ABeeZee","Abel","Abril Fatface","Aclonica","Acme","Actor","Adamina","Advent Pro","Aguafina Script","Akronim","Aladin","Aldrich","Alef","Alegreya","Alegreya SC","Alegreya Sans","Alegreya Sans SC","Alex Brush","Alfa Slab One","Alice","Alike","Alike Angular","Allan","Allerta","Allerta Stencil","Allura","Almendra","Almendra Display","Almendra SC","Amarante","Amaranth","Amatic SC","Amethysta","Amiri","Amita","Anaheim","Andada","Andika","Angkor","Annie Use Your Telescope","Anonymous Pro","Antic","Antic Didone","Antic Slab","Anton","Arapey","Arbutus","Arbutus Slab","Architects Daughter","Archivo Black","Archivo Narrow","Arimo","Arizonia","Armata","Artifika","Arvo","Arya","Asap","Asar","Asset","Astloch","Asul","Atomic Age","Aubrey","Audiowide","Autour One","Average","Average Sans","Averia Gruesa Libre","Averia Libre","Averia Sans Libre","Averia Serif Libre","Bad Script","Balthazar","Bangers","Basic","Battambang","Baumans","Bayon","Belgrano","Belleza","BenchNine","Bentham","Berkshire Swash","Bevan","Bigelow Rules","Bigshot One","Bilbo","Bilbo Swash Caps","Biryani","Bitter","Black Ops One","Bokor","Bonbon","Boogaloo","Bowlby One","Bowlby One SC","Brawler","Bree Serif","Bubblegum Sans","Bubbler One","Buda","Buenard","Butcherman","Butterfly Kids","Cabin","Cabin Condensed","Cabin Sketch","Caesar Dressing","Cagliostro","Calligraffitti","Cambay","Cambo","Candal","Cantarell","Cantata One","Cantora One","Capriola","Cardo","Carme","Carrois Gothic","Carrois Gothic SC","Carter One","Catamaran","Caudex","Caveat","Caveat Brush","Cedarville Cursive","Ceviche One","Changa One","Chango","Chau Philomene One","Chela One","Chelsea Market","Chenla","Cherry Cream Soda","Cherry Swash","Chewy","Chicle","Chivo","Chonburi","Cinzel","Cinzel Decorative","Clicker Script","Coda","Coda Caption","Codystar","Combo","Comfortaa","Coming Soon","Concert One","Condiment","Content","Contrail One","Convergence","Cookie","Copse","Corben","Courgette","Cousine","Coustard","Covered By Your Grace","Crafty Girls","Creepster","Crete Round","Crimson Text","Croissant One","Crushed","Cuprum","Cutive","Cutive Mono","Damion","Dancing Script","Dangrek","Dawning of a New Day","Days One","Dekko","Delius","Delius Swash Caps","Delius Unicase","Della Respira","Denk One","Devonshire","Dhurjati","Didact Gothic","Diplomata","Diplomata SC","Domine","Donegal One","Doppio One","Dorsa","Dosis","Dr Sugiyama","Droid Sans","Droid Sans Mono","Droid Serif","Duru Sans","Dynalight","EB Garamond","Eagle Lake","Eater","Economica","Eczar","Ek Mukta","Electrolize","Elsie","Elsie Swash Caps","Emblema One","Emilys Candy","Engagement","Englebert","Enriqueta","Erica One","Esteban","Euphoria Script","Ewert","Exo","Exo 2","Expletus Sans","Fanwood Text","Fascinate","Fascinate Inline","Faster One","Fasthand","Fauna One","Federant","Federo","Felipa","Fenix","Finger Paint","Fira Mono","Fira Sans","Fjalla One","Fjord One","Flamenco","Flavors","Fondamento","Fontdiner Swanky","Forum","Francois One","Freckle Face","Fredericka the Great","Fredoka One","Freehand","Fresca","Frijole","Fruktur","Fugaz One","GFS Didot","GFS Neohellenic","Gabriela","Gafata","Galdeano","Galindo","Gentium Basic","Gentium Book Basic","Geo","Geostar","Geostar Fill","Germania One","Gidugu","Gilda Display","Give You Glory","Glass Antiqua","Glegoo","Gloria Hallelujah","Goblin One","Gochi Hand","Gorditas","Goudy Bookletter 1911","Graduate","Grand Hotel","Gravitas One","Great Vibes","Griffy","Gruppo","Gudea","Gurajada","Habibi","Halant","Hammersmith One","Hanalei","Hanalei Fill","Handlee","Hanuman","Happy Monkey","Headland One","Henny Penny","Herr Von Muellerhoff","Hind","Hind Siliguri","Hind Vadodara","Holtwood One SC","Homemade Apple","Homenaje","IM Fell DW Pica","IM Fell DW Pica SC","IM Fell Double Pica","IM Fell Double Pica SC","IM Fell English","IM Fell English SC","IM Fell French Canon","IM Fell French Canon SC","IM Fell Great Primer","IM Fell Great Primer SC","Iceberg","Iceland","Imprima","Inconsolata","Inder","Indie Flower","Inika","Inknut Antiqua","Irish Grover","Istok Web","Italiana","Italianno","Itim","Jacques Francois","Jacques Francois Shadow","Jaldi","Jim Nightshade","Jockey One","Jolly Lodger","Josefin Sans","Josefin Slab","Joti One","Judson","Julee","Julius Sans One","Junge","Jura","Just Another Hand","Just Me Again Down Here","Kadwa","Kalam","Kameron","Kantumruy","Karla","Karma","Kaushan Script","Kavoon","Kdam Thmor","Keania One","Kelly Slab","Kenia","Khand","Khmer","Khula","Kite One","Knewave","Kotta One","Koulen","Kranky","Kreon","Kristi","Krona One","Kurale","La Belle Aurore","Laila","Lakki Reddy","Lancelot","Lateef","Lato","League Script","Leckerli One","Ledger","Lekton","Lemon","Libre Baskerville","Life Savers","Lilita One","Lily Script One","Limelight","Linden Hill","Lobster","Lobster Two","Londrina Outline","Londrina Shadow","Londrina Sketch","Londrina Solid","Lora","Love Ya Like A Sister","Loved by the King","Lovers Quarrel","Luckiest Guy","Lusitana","Lustria","Macondo","Macondo Swash Caps","Magra","Maiden Orange","Mako","Mallanna","Mandali","Marcellus","Marcellus SC","Marck Script","Margarine","Marko One","Marmelad","Martel","Martel Sans","Marvel","Mate","Mate SC","Maven Pro","McLaren","Meddon","MedievalSharp","Medula One","Megrim","Meie Script","Merienda","Merienda One","Merriweather","Merriweather Sans","Metal","Metal Mania","Metamorphous","Metrophobic","Michroma","Milonga","Miltonian","Miltonian Tattoo","Miniver","Miss Fajardose","Modak","Modern Antiqua","Molengo","Molle","Monda","Monofett","Monoton","Monsieur La Doulaise","Montaga","Montez","Montserrat","Montserrat Alternates","Montserrat Subrayada","Moul","Moulpali","Mountains of Christmas","Mouse Memoirs","Mr Bedfort","Mr Dafoe","Mr De Haviland","Mrs Saint Delafield","Mrs Sheppards","Muli","Mystery Quest","NTR","Neucha","Neuton","New Rocker","News Cycle","Niconne","Nixie One","Nobile","Nokora","Norican","Nosifer","Nothing You Could Do","Noticia Text","Noto Sans","Noto Serif","Nova Cut","Nova Flat","Nova Mono","Nova Oval","Nova Round","Nova Script","Nova Slim","Nova Square","Numans","Nunito","Odor Mean Chey","Offside","Old Standard TT","Oldenburg","Oleo Script","Oleo Script Swash Caps","Open Sans","Open Sans Condensed","Oranienbaum","Orbitron","Oregano","Orienta","Original Surfer","Oswald","Over the Rainbow","Overlock","Overlock SC","Ovo","Oxygen","Oxygen Mono","PT Mono","PT Sans","PT Sans Caption","PT Sans Narrow","PT Serif","PT Serif Caption","Pacifico","Palanquin","Palanquin Dark","Paprika","Parisienne","Passero One","Passion One","Pathway Gothic One","Patrick Hand","Patrick Hand SC","Patua One","Paytone One","Peddana","Peralta","Permanent Marker","Petit Formal Script","Petrona","Philosopher","Piedra","Pinyon Script","Pirata One","Plaster","Play","Playball","Playfair Display","Playfair Display SC","Podkova","Poiret One","Poller One","Poly","Pompiere","Pontano Sans","Poppins","Port Lligat Sans","Port Lligat Slab","Pragati Narrow","Prata","Preahvihear","Press Start 2P","Princess Sofia","Prociono","Prosto One","Puritan","Purple Purse","Quando","Quantico","Quattrocento","Quattrocento Sans","Questrial","Quicksand","Quintessential","Qwigley","Racing Sans One","Radley","Rajdhani","Raleway","Raleway Dots","Ramabhadra","Ramaraja","Rambla","Rammetto One","Ranchers","Rancho","Ranga","Rationale","Ravi Prakash","Redressed","Reenie Beanie","Revalia","Rhodium Libre","Ribeye","Ribeye Marrow","Righteous","Risque","Roboto","Roboto Condensed","Roboto Mono","Roboto Slab","Rochester","Rock Salt","Rokkitt","Romanesco","Ropa Sans","Rosario","Rosarivo","Rouge Script","Rozha One","Rubik","Rubik Mono One","Rubik One","Ruda","Rufina","Ruge Boogie","Ruluko","Rum Raisin","Ruslan Display","Russo One","Ruthie","Rye","Sacramento","Sahitya","Sail","Salsa","Sanchez","Sancreek","Sansita One","Sarala","Sarina","Sarpanch","Satisfy","Scada","Scheherazade","Schoolbell","Seaweed Script","Sevillana","Seymour One","Shadows Into Light","Shadows Into Light Two","Shanti","Share","Share Tech","Share Tech Mono","Shojumaru","Short Stack","Siemreap","Sigmar One","Signika","Signika Negative","Simonetta","Sintony","Sirin Stencil","Six Caps","Skranji","Slabo 13px","Slabo 27px","Slackey","Smokum","Smythe","Sniglet","Snippet","Snowburst One","Sofadi One","Sofia","Sonsie One","Sorts Mill Goudy","Source Code Pro","Source Sans Pro","Source Serif Pro","Special Elite","Spicy Rice","Spinnaker","Spirax","Squada One","Sree Krushnadevaraya","Stalemate","Stalinist One","Stardos Stencil","Stint Ultra Condensed","Stint Ultra Expanded","Stoke","Strait","Sue Ellen Francisco","Sumana","Sunshiney","Supermercado One","Sura","Suranna","Suravaram","Suwannaphum","Swanky and Moo Moo","Syncopate","Tangerine","Taprom","Tauri","Teko","Telex","Tenali Ramakrishna","Tenor Sans","Text Me One","The Girl Next Door","Tienne","Tillana","Timmana","Tinos","Titan One","Titillium Web","Trade Winds","Trocchi","Trochut","Trykker","Tulpen One","Ubuntu","Ubuntu Condensed","Ubuntu Mono","Ultra","Uncial Antiqua","Underdog","Unica One","UnifrakturCook","UnifrakturMaguntia","Unkempt","Unlock","Unna","VT323","Vampiro One","Varela","Varela Round","Vast Shadow","Vesper Libre","Vibur","Vidaloka","Viga","Voces","Volkhov","Vollkorn","Voltaire","Waiting for the Sunrise","Wallpoet","Walter Turncoat","Warnes","Wellfleet","Wendy One","Wire One","Work Sans","Yanone Kaffeesatz","Yantramanav","Yellowtail","Yeseva One","Yesteryear","Zeyada"]}).call(this)},,,,,,,,,,,,,,,function(t,e,r){"use strict";(function(t){
/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <http://feross.org>
 * @license  MIT
 */
var i=r(22),n=r(4),o=r(23);function s(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=l.prototype:(null===t&&(t=new l(e)),t.length=e),t}function l(t,e,r){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return u(this,t,e,r)}function u(t,e,r,i){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,i){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(i||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,r):new Uint8Array(e,r,i);l.TYPED_ARRAY_SUPPORT?(t=e).__proto__=l.prototype:t=p(t,e);return t}(t,e,r,i):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!l.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var i=0|f(e,r),n=(t=a(t,i)).write(e,r);n!==i&&(t=t.slice(0,n));return t}(t,e,r):function(t,e){if(l.isBuffer(e)){var r=0|d(e.length);return 0===(t=a(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(i=e.length)!=i?a(t,0):p(t,e);if("Buffer"===e.type&&o(e.data))return p(t,e.data)}var i;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function c(t,e){if(h(e),t=a(t,e<0?0:0|d(e)),!l.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function p(t,e){var r=e.length<0?0:0|d(e.length);t=a(t,r);for(var i=0;i<r;i+=1)t[i]=255&e[i];return t}function d(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function f(t,e){if(l.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return B(t).length;default:if(i)return z(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return E(this,e,r);case"ascii":return R(this,e,r);case"latin1":case"binary":return P(this,e,r);case"base64":return C(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function y(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function m(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=l.from(e,i)),l.isBuffer(e))return 0===e.length?-1:_(t,e,r,i,n);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):_(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function _(t,e,r,i,n){var o,s=1,a=t.length,l=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s=2,a/=2,l/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(n){var h=-1;for(o=r;o<a;o++)if(u(t,o)===u(e,-1===h?0:o-h)){if(-1===h&&(h=o),o-h+1===l)return h*s}else-1!==h&&(o-=o-h),h=-1}else for(r+l>a&&(r=a-l),o=r;o>=0;o--){for(var c=!0,p=0;p<l;p++)if(u(t,o+p)!==u(e,p)){c=!1;break}if(c)return o}return-1}function v(t,e,r,i){r=Number(r)||0;var n=t.length-r;i?(i=Number(i))>n&&(i=n):i=n;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var s=0;s<i;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[r+s]=a}return s}function x(t,e,r,i){return U(z(e,t.length-r),t,r,i)}function w(t,e,r,i){return U(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,i)}function b(t,e,r,i){return w(t,e,r,i)}function S(t,e,r,i){return U(B(e),t,r,i)}function T(t,e,r,i){return U(function(t,e){for(var r,i,n,o=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),i=r>>8,n=r%256,o.push(n),o.push(i);return o}(e,t.length-r),t,r,i)}function C(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function E(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n<r;){var o,s,a,l,u=t[n],h=null,c=u>239?4:u>223?3:u>191?2:1;if(n+c<=r)switch(c){case 1:u<128&&(h=u);break;case 2:128==(192&(o=t[n+1]))&&(l=(31&u)<<6|63&o)>127&&(h=l);break;case 3:o=t[n+1],s=t[n+2],128==(192&o)&&128==(192&s)&&(l=(15&u)<<12|(63&o)<<6|63&s)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:o=t[n+1],s=t[n+2],a=t[n+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(l=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&l<1114112&&(h=l)}null===h?(h=65533,c=1):h>65535&&(h-=65536,i.push(h>>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",i=0;for(;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=4096));return r}(i)}e.Buffer=l,e.SlowBuffer=function(t){+t!=t&&(t=0);return l.alloc(+t)},e.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),l.poolSize=8192,l._augment=function(t){return t.__proto__=l.prototype,t},l.from=function(t,e,r){return u(null,t,e,r)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(t,e,r){return function(t,e,r,i){return h(e),e<=0?a(t,e):void 0!==r?"string"==typeof i?a(t,e).fill(r,i):a(t,e).fill(r):a(t,e)}(null,t,e,r)},l.allocUnsafe=function(t){return c(null,t)},l.allocUnsafeSlow=function(t){return c(null,t)},l.isBuffer=function(t){return!(null==t||!t._isBuffer)},l.compare=function(t,e){if(!l.isBuffer(t)||!l.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,i=e.length,n=0,o=Math.min(r,i);n<o;++n)if(t[n]!==e[n]){r=t[n],i=e[n];break}return r<i?-1:i<r?1:0},l.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return l.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var i=l.allocUnsafe(e),n=0;for(r=0;r<t.length;++r){var s=t[r];if(!l.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,n),n+=s.length}return i},l.byteLength=f,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)y(this,e,e+1);return this},l.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},l.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},l.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?E(this,0,t):g.apply(this,arguments)},l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===l.compare(this,t)},l.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},l.prototype.compare=function(t,e,r,i,n){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(n>>>=0)-(i>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(i,n),h=t.slice(e,r),c=0;c<a;++c)if(u[c]!==h[c]){o=u[c],s=h[c];break}return o<s?-1:s<o?1:0},l.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},l.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},l.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},l.prototype.write=function(t,e,r,i){if(void 0===e)i="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)i=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return x(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return b(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function R(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n)i+=String.fromCharCode(127&t[n]);return i}function P(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}function I(t,e,r){var i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);for(var n="",o=e;o<r;++o)n+=G(t[o]);return n}function O(t,e,r){for(var i=t.slice(e,r),n="",o=0;o<i.length;o+=2)n+=String.fromCharCode(i[o]+256*i[o+1]);return n}function L(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,r,i,n,o){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}function F(t,e,r,i){e<0&&(e=65535+e+1);for(var n=0,o=Math.min(t.length-r,2);n<o;++n)t[r+n]=(e&255<<8*(i?n:1-n))>>>8*(i?n:1-n)}function A(t,e,r,i){e<0&&(e=4294967295+e+1);for(var n=0,o=Math.min(t.length-r,4);n<o;++n)t[r+n]=e>>>8*(i?n:3-n)&255}function k(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(t,e,r,i,o){return o||k(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function j(t,e,r,i,o){return o||k(t,0,r,8),n.write(t,e,r,i,52,8),r+8}l.prototype.slice=function(t,e){var r,i=this.length;if((t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e<t&&(e=t),l.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=l.prototype;else{var n=e-t;r=new l(n,void 0);for(var o=0;o<n;++o)r[o]=this[o+t]}return r},l.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||L(t,e,this.length);for(var i=this[t],n=1,o=0;++o<e&&(n*=256);)i+=this[t+o]*n;return i},l.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||L(t,e,this.length);for(var i=this[t+--e],n=1;e>0&&(n*=256);)i+=this[t+--e]*n;return i},l.prototype.readUInt8=function(t,e){return e||L(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return e||L(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return e||L(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||L(t,e,this.length);for(var i=this[t],n=1,o=0;++o<e&&(n*=256);)i+=this[t+o]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*e)),i},l.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||L(t,e,this.length);for(var i=e,n=1,o=this[t+--i];i>0&&(n*=256);)o+=this[t+--i]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*e)),o},l.prototype.readInt8=function(t,e){return e||L(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){e||L(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(t,e){e||L(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(t,e){return e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return e||L(t,4,this.length),n.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return e||L(t,4,this.length),n.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return e||L(t,8,this.length),n.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return e||L(t,8,this.length),n.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,r,i){(t=+t,e|=0,r|=0,i)||M(this,t,e,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[e]=255&t;++o<r&&(n*=256);)this[e+o]=t/n&255;return e+r},l.prototype.writeUIntBE=function(t,e,r,i){(t=+t,e|=0,r|=0,i)||M(this,t,e,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[e+n]=255&t;--n>=0&&(o*=256);)this[e+n]=t/o&255;return e+r},l.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):F(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):F(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):A(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):A(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);M(this,t,e,r,n-1,-n)}var o=0,s=1,a=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},l.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);M(this,t,e,r,n-1,-n)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},l.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):F(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):F(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):A(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):A(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},l.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},l.prototype.writeDoubleLE=function(t,e,r){return j(this,t,e,!0,r)},l.prototype.writeDoubleBE=function(t,e,r){return j(this,t,e,!1,r)},l.prototype.copy=function(t,e,r,i){if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);var n,o=i-r;if(this===t&&r<e&&e<i)for(n=o-1;n>=0;--n)t[n+e]=this[n+r];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(n=0;n<o;++n)t[n+e]=this[n+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},l.prototype.fill=function(t,e,r,i){if("string"==typeof t){if("string"==typeof e?(i=e,e=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),1===t.length){var n=t.charCodeAt(0);n<256&&(t=n)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!l.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var s=l.isBuffer(t)?t:z(new l(t,i).toString()),a=s.length;for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};var D=/[^+\/0-9A-Za-z-_]/g;function G(t){return t<16?"0"+t.toString(16):t.toString(16)}function z(t,e){var r;e=e||1/0;for(var i=t.length,n=null,o=[],s=0;s<i;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function B(t){return i.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(D,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function U(t,e,r,i){for(var n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}}).call(this,r(5))},function(t,e,r){"use strict";e.byteLength=function(t){var e=u(t),r=e[0],i=e[1];return 3*(r+i)/4-i},e.toByteArray=function(t){var e,r,i=u(t),s=i[0],a=i[1],l=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),h=0,c=a>0?s-4:s;for(r=0;r<c;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],l[h++]=e>>16&255,l[h++]=e>>8&255,l[h++]=255&e;2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,l[h++]=255&e);1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,l[h++]=e>>8&255,l[h++]=255&e);return l},e.fromByteArray=function(t){for(var e,r=t.length,n=r%3,o=[],s=0,a=r-n;s<a;s+=16383)o.push(h(t,s,s+16383>a?a:s+16383));1===n?(e=t[r-1],o.push(i[e>>2]+i[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],o.push(i[e>>10]+i[e>>4&63]+i[e<<2&63]+"="));return o.join("")};for(var i=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=s.length;a<l;++a)i[a]=s[a],n[s.charCodeAt(a)]=a;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function h(t,e,r){for(var n,o,s=[],a=e;a<r;a+=3)n=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(i[(o=n)>>18&63]+i[o>>12&63]+i[o>>6&63]+i[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){"use strict";function i(){return function(){throw new Error("Unimplemented abstract method.")}()}r.r(e);var n=0;function o(t){return t.ol_uid||(t.ol_uid=String(++n))}var s,a=(s=function(t,e){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),l=function(t){function e(e){var r=this,i="Assertion failed. See https://openlayers.org/en/"+("v"+"6.4.0".split("-")[0])+"/doc/errors/#"+e+" for details.";return(r=t.call(this,i)||this).code=e,r.name="AssertionError",r.message=i,r}return a(e,t),e}(Error);function u(t){t.stopPropagation()}var h=function(){function t(t){this.propagationStopped,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.propagationStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}(),c="propertychange",p=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function d(t,e){return t>e?1:t<e?-1:0}function f(t,e){return t.indexOf(e)>=0}function g(t,e,r){var i=t.length;if(t[0]<=e)return 0;if(e<=t[i-1])return i-1;var n=void 0;if(r>0){for(n=1;n<i;++n)if(t[n]<e)return n-1}else if(r<0){for(n=1;n<i;++n)if(t[n]<=e)return n}else for(n=1;n<i;++n){if(t[n]==e)return n;if(t[n]<e)return t[n-1]-e<e-t[n]?n-1:n}return i-1}function y(t,e,r){for(;e<r;){var i=t[e];t[e]=t[r],t[r]=i,++e,--r}}function m(t,e){for(var r=Array.isArray(e)?e:[e],i=r.length,n=0;n<i;n++)t[t.length]=r[n]}function _(t,e){for(var r,i=t.length>>>0,n=0;n<i;n++)if(e(r=t[n],n,t))return r;return null}function v(t,e){var r=t.length;if(r!==e.length)return!1;for(var i=0;i<r;i++)if(t[i]!==e[i])return!1;return!0}function x(t,e){var r;return!t.every((function(i,n){return r=n,!e(i,n,t)}))?r:-1}function w(){return!0}function b(){return!1}function S(){}var T="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(t),i=1,n=arguments.length;i<n;++i){var o=arguments[i];if(null!=o)for(var s in o)o.hasOwnProperty(s)&&(r[s]=o[s])}return r};function C(t){for(var e in t)delete t[e]}var E="function"==typeof Object.values?Object.values:function(t){var e=[];for(var r in t)e.push(t[r]);return e};function R(t){var e;for(e in t)return!1;return!e}var P=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),I=function(t){function e(e){var r=t.call(this)||this;return r.eventTarget_=e,r.pendingRemovals_=null,r.dispatching_=null,r.listeners_=null,r}return P(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var r=this.listeners_||(this.listeners_={}),i=r[t]||(r[t]=[]);-1===i.indexOf(e)&&i.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t?new h(t):t,r=e.type;e.target||(e.target=this.eventTarget_||this);var i,n=this.listeners_&&this.listeners_[r];if(n){var o=this.dispatching_||(this.dispatching_={}),s=this.pendingRemovals_||(this.pendingRemovals_={});r in o||(o[r]=0,s[r]=0),++o[r];for(var a=0,l=n.length;a<l;++a)if(!1===(i="handleEvent"in n[a]?n[a].handleEvent(e):n[a].call(this,e))||e.propagationStopped){i=!1;break}if(--o[r],0===o[r]){var u=s[r];for(delete s[r];u--;)this.removeEventListener(r,S);delete o[r]}return i}},e.prototype.disposeInternal=function(){this.listeners_&&C(this.listeners_)},e.prototype.getListeners=function(t){return this.listeners_&&this.listeners_[t]||void 0},e.prototype.hasListener=function(t){return!!this.listeners_&&(t?t in this.listeners_:Object.keys(this.listeners_).length>0)},e.prototype.removeEventListener=function(t,e){var r=this.listeners_&&this.listeners_[t];if(r){var i=r.indexOf(e);-1!==i&&(this.pendingRemovals_&&t in this.pendingRemovals_?(r[i]=S,++this.pendingRemovals_[t]):(r.splice(i,1),0===r.length&&delete this.listeners_[t]))}},e}(p),O="change",L="error",M="contextmenu",F="click",A="dblclick",k="dragenter",N="dragover",j="drop",D="keydown",G="keypress",z="load",B="resize",U="touchmove",Y="wheel";function W(t,e,r,i,n){if(i&&i!==t&&(r=r.bind(i)),n){var o=r;r=function(){t.removeEventListener(e,r),o.apply(this,arguments)}}var s={target:t,type:e,listener:r};return t.addEventListener(e,r),s}function V(t,e,r,i){return W(t,e,r,i,!0)}function X(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),C(t))}var q=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function Z(t){if(Array.isArray(t))for(var e=0,r=t.length;e<r;++e)X(t[e]);else X(t)}var K=function(t){function e(){var e=t.call(this)||this;return e.revision_=0,e}return q(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(O)},e.prototype.getRevision=function(){return this.revision_},e.prototype.on=function(t,e){if(Array.isArray(t)){for(var r=t.length,i=new Array(r),n=0;n<r;++n)i[n]=W(this,t[n],e);return i}return W(this,t,e)},e.prototype.once=function(t,e){var r;if(Array.isArray(t)){var i=t.length;r=new Array(i);for(var n=0;n<i;++n)r[n]=V(this,t[n],e)}else r=V(this,t,e);return e.ol_key=r,r},e.prototype.un=function(t,e){var r=e.ol_key;if(r)Z(r);else if(Array.isArray(t))for(var i=0,n=t.length;i<n;++i)this.removeEventListener(t[i],e);else this.removeEventListener(t,e)},e}(I),H=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),J=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.key=r,n.oldValue=i,n}return H(e,t),e}(h),$=function(t){function e(e){var r=t.call(this)||this;return o(r),r.values_=null,void 0!==e&&r.setProperties(e),r}return H(e,t),e.prototype.get=function(t){var e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e},e.prototype.getKeys=function(){return this.values_&&Object.keys(this.values_)||[]},e.prototype.getProperties=function(){return this.values_&&T({},this.values_)||{}},e.prototype.hasProperties=function(){return!!this.values_},e.prototype.notify=function(t,e){var r;r=tt(t),this.dispatchEvent(new J(r,t,e)),r=c,this.dispatchEvent(new J(r,t,e))},e.prototype.set=function(t,e,r){var i=this.values_||(this.values_={});if(r)i[t]=e;else{var n=i[t];i[t]=e,n!==e&&this.notify(t,n)}},e.prototype.setProperties=function(t,e){for(var r in t)this.set(r,t[r],e)},e.prototype.unset=function(t,e){if(this.values_&&t in this.values_){var r=this.values_[t];delete this.values_[t],R(this.values_)&&(this.values_=null),e||this.notify(t,r)}},e}(K),Q={};function tt(t){return Q.hasOwnProperty(t)?Q[t]:Q[t]="change:"+t}var et=$,rt="add",it="remove",nt=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),ot="length",st=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.element=r,n.index=i,n}return nt(e,t),e}(h),at=function(t){function e(e,r){var i=t.call(this)||this,n=r||{};if(i.unique_=!!n.unique,i.array_=e||[],i.unique_)for(var o=0,s=i.array_.length;o<s;++o)i.assertUnique_(i.array_[o],o);return i.updateLength_(),i}return nt(e,t),e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,r=t.length;e<r;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,r=0,i=e.length;r<i;++r)t(e[r],r,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get(ot)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new st(rt,e,t))},e.prototype.pop=function(){return this.removeAt(this.getLength()-1)},e.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},e.prototype.remove=function(t){for(var e=this.array_,r=0,i=e.length;r<i;++r)if(e[r]===t)return this.removeAt(r)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new st(it,e,t)),e},e.prototype.setAt=function(t,e){var r=this.getLength();if(t<r){this.unique_&&this.assertUnique_(e,t);var i=this.array_[t];this.array_[t]=e,this.dispatchEvent(new st(it,i,t)),this.dispatchEvent(new st(rt,e,t))}else{for(var n=r;n<t;++n)this.insertAt(n,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set(ot,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var r=0,i=this.array_.length;r<i;++r)if(this.array_[r]===t&&r!==e)throw new l(58)},e}(et);function lt(t,e){if(!t)throw new l(e)}var ut=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();var ht=function(t){function e(e){var r=t.call(this)||this;if(r.id_=void 0,r.geometryName_="geometry",r.style_=null,r.styleFunction_=void 0,r.geometryChangeKey_=null,r.addEventListener(tt(r.geometryName_),r.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){var i=e;r.setGeometry(i)}else{var n=e;r.setProperties(n)}return r}return ut(e,t),e.prototype.clone=function(){var t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var r=this.getGeometry();r&&t.setGeometry(r.clone());var i=this.getStyle();return i&&t.setStyle(i),t},e.prototype.getGeometry=function(){return this.get(this.geometryName_)},e.prototype.getId=function(){return this.id_},e.prototype.getGeometryName=function(){return this.geometryName_},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.handleGeometryChange_=function(){this.changed()},e.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(X(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=W(t,O,this.handleGeometryChange_,this)),this.changed()},e.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},e.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?function(t){if("function"==typeof t)return t;var e;Array.isArray(t)?e=t:(lt("function"==typeof t.getZIndex,41),e=[t]);return function(){return e}}(t):void 0,this.changed()},e.prototype.setId=function(t){this.id_=t,this.changed()},e.prototype.setGeometryName=function(t){this.removeEventListener(tt(this.geometryName_),this.handleGeometryChanged_),this.geometryName_=t,this.addEventListener(tt(this.geometryName_),this.handleGeometryChanged_),this.handleGeometryChanged_()},e}(et),ct="XY",pt="XYZ",dt="XYM",ft="XYZM",gt={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"},yt={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},mt={};mt[yt.DEGREES]=2*Math.PI*6370997/360,mt[yt.FEET]=.3048,mt[yt.METERS]=1,mt[yt.USFEET]=1200/3937;var _t=yt,vt=new Array(6);function xt(t){return bt(t,1,0,0,1,0,0)}function wt(t,e){var r=t[0],i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],l=e[0],u=e[1],h=e[2],c=e[3],p=e[4],d=e[5];return t[0]=r*l+n*u,t[1]=i*l+o*u,t[2]=r*h+n*c,t[3]=i*h+o*c,t[4]=r*p+n*d+s,t[5]=i*p+o*d+a,t}function bt(t,e,r,i,n,o,s){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t[4]=o,t[5]=s,t}function St(t,e){var r=e[0],i=e[1];return e[0]=t[0]*r+t[2]*i+t[4],e[1]=t[1]*r+t[3]*i+t[5],e}function Tt(t,e,r){return wt(t,bt(vt,e,0,0,r,0,0))}function Ct(t,e,r,i,n,o,s,a){var l=Math.sin(o),u=Math.cos(o);return t[0]=i*u,t[1]=n*l,t[2]=-i*l,t[3]=n*u,t[4]=s*i*u-a*i*l+e,t[5]=s*n*l+a*n*u+r,t}function Et(t,e){var r,i=(r=e)[0]*r[3]-r[1]*r[2];lt(0!==i,32);var n=e[0],o=e[1],s=e[2],a=e[3],l=e[4],u=e[5];return t[0]=a/i,t[1]=-o/i,t[2]=-s/i,t[3]=n/i,t[4]=(s*u-a*l)/i,t[5]=-(n*u-o*l)/i,t}function Rt(t){return"matrix("+t.join(", ")+")"}var Pt="bottom-left",It="bottom-right",Ot="top-left",Lt="top-right",Mt=0,Ft=1,At=2,kt=4,Nt=8,jt=16;function Dt(t){for(var e=Xt(),r=0,i=t.length;r<i;++r)Qt(e,t[r]);return e}function Gt(t,e,r){return r?(r[0]=t[0]-e,r[1]=t[1]-e,r[2]=t[2]+e,r[3]=t[3]+e,r):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function zt(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function Bt(t,e,r){var i,n;return(i=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*i+(n=r<t[1]?t[1]-r:t[3]<r?r-t[3]:0)*n}function Ut(t,e){return Wt(t,e[0],e[1])}function Yt(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function Wt(t,e,r){return t[0]<=e&&e<=t[2]&&t[1]<=r&&r<=t[3]}function Vt(t,e){var r=t[0],i=t[1],n=t[2],o=t[3],s=e[0],a=e[1],l=Mt;return s<r?l|=jt:s>n&&(l|=kt),a<i?l|=Nt:a>o&&(l|=At),l===Mt&&(l=Ft),l}function Xt(){return[1/0,1/0,-1/0,-1/0]}function qt(t,e,r,i,n){return n?(n[0]=t,n[1]=e,n[2]=r,n[3]=i,n):[t,e,r,i]}function Zt(t){return qt(1/0,1/0,-1/0,-1/0,t)}function Kt(t,e){var r=t[0],i=t[1];return qt(r,i,r,i,e)}function Ht(t,e,r,i,n){return ee(Zt(n),t,e,r,i)}function Jt(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function $t(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function Qt(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function te(t,e){for(var r=0,i=e.length;r<i;++r)Qt(t,e[r]);return t}function ee(t,e,r,i,n){for(;r<i;r+=n)re(t,e[r],e[r+1]);return t}function re(t,e,r){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],r),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],r)}function ie(t,e){var r;return(r=e(oe(t)))||(r=e(se(t)))||(r=e(de(t)))?r:(r=e(pe(t)))||!1}function ne(t){var e=0;return ye(t)||(e=fe(t)*he(t)),e}function oe(t){return[t[0],t[1]]}function se(t){return[t[2],t[1]]}function ae(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function le(t,e){var r;return e===Pt?r=oe(t):e===It?r=se(t):e===Ot?r=pe(t):e===Lt?r=de(t):lt(!1,13),r}function ue(t,e,r,i,n){var o=e*i[0]/2,s=e*i[1]/2,a=Math.cos(r),l=Math.sin(r),u=o*a,h=o*l,c=s*a,p=s*l,d=t[0],f=t[1],g=d-u+p,y=d-u-p,m=d+u-p,_=d+u+p,v=f-h-c,x=f-h+c,w=f+h+c,b=f+h-c;return qt(Math.min(g,y,m,_),Math.min(v,x,w,b),Math.max(g,y,m,_),Math.max(v,x,w,b),n)}function he(t){return t[3]-t[1]}function ce(t,e,r){var i=r||[1/0,1/0,-1/0,-1/0];return ge(t,e)?(t[0]>e[0]?i[0]=t[0]:i[0]=e[0],t[1]>e[1]?i[1]=t[1]:i[1]=e[1],t[2]<e[2]?i[2]=t[2]:i[2]=e[2],t[3]<e[3]?i[3]=t[3]:i[3]=e[3]):Zt(i),i}function pe(t){return[t[0],t[3]]}function de(t){return[t[2],t[3]]}function fe(t){return t[2]-t[0]}function ge(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function ye(t){return t[2]<t[0]||t[3]<t[1]}function me(t,e){var r=(t[2]-t[0])/2*(e-1),i=(t[3]-t[1])/2*(e-1);t[0]-=r,t[2]+=r,t[1]-=i,t[3]+=i}function _e(t,e,r,i){var n=[];if(i>1)for(var o=t[2]-t[0],s=t[3]-t[1],a=0;a<i;++a)n.push(t[0]+o*a/i,t[1],t[2],t[1]+s*a/i,t[2]-o*a/i,t[3],t[0],t[3]-s*a/i);else n=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(n,n,2);for(var l=[],u=[],h=(a=0,n.length);a<h;a+=2)l.push(n[a]),u.push(n[a+1]);return function(t,e,r){return qt(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),r)}(l,u,r)}function ve(t,e){var r=e.getExtent(),i=ae(t);if(e.canWrapX()&&(i[0]<r[0]||i[0]>=r[2])){var n=fe(r),o=Math.floor((i[0]-r[0])/n)*n;t[0]-=o,t[2]-=o}return t}var xe=function(){function t(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||mt[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}();function we(t,e,r){return Math.min(Math.max(t,e),r)}var be="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},Se="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function Te(t,e,r,i,n,o){var s=n-r,a=o-i;if(0!==s||0!==a){var l=((t-r)*s+(e-i)*a)/(s*s+a*a);l>1?(r=n,i=o):l>0&&(r+=s*l,i+=a*l)}return Ce(t,e,r,i)}function Ce(t,e,r,i){var n=r-t,o=i-e;return n*n+o*o}function Ee(t){return 180*t/Math.PI}function Re(t){return t*Math.PI/180}function Pe(t,e){var r=t%e;return r*e<0?r+e:r}function Ie(t,e,r){return t+r*(e-t)}var Oe=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Le=6378137*Math.PI,Me=[-Le,-Le,Le,Le],Fe=[-180,-85,180,85],Ae=function(t){function e(e){return t.call(this,{code:e,units:_t.METERS,extent:Me,global:!0,worldExtent:Fe,getPointResolution:function(t,e){return t/be(e[1]/6378137)}})||this}return Oe(e,t),e}(xe),ke=[new Ae("EPSG:3857"),new Ae("EPSG:102100"),new Ae("EPSG:102113"),new Ae("EPSG:900913"),new Ae("urn:ogc:def:crs:EPSG:6.18:3:3857"),new Ae("urn:ogc:def:crs:EPSG::3857"),new Ae("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Ne(t,e,r){var i=t.length,n=r>1?r:2,o=e;void 0===o&&(o=n>2?t.slice():new Array(i));for(var s=Le,a=0;a<i;a+=n){o[a]=s*t[a]/180;var l=6378137*Math.log(Math.tan(Math.PI*(+t[a+1]+90)/360));l>s?l=s:l<-s&&(l=-s),o[a+1]=l}return o}function je(t,e,r){var i=t.length,n=r>1?r:2,o=e;void 0===o&&(o=n>2?t.slice():new Array(i));for(var s=0;s<i;s+=n)o[s]=180*t[s]/Le,o[s+1]=360*Math.atan(Math.exp(t[s+1]/6378137))/Math.PI-90;return o}var De=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ge=[-180,-90,180,90],ze=6378137*Math.PI/180,Be=function(t){function e(e,r){return t.call(this,{code:e,units:_t.DEGREES,extent:Ge,axisOrientation:r,global:!0,metersPerUnit:ze,worldExtent:Ge})||this}return De(e,t),e}(xe),Ue=[new Be("CRS:84"),new Be("EPSG:4326","neu"),new Be("urn:ogc:def:crs:EPSG::4326","neu"),new Be("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new Be("urn:ogc:def:crs:OGC:1.3:CRS84"),new Be("urn:ogc:def:crs:OGC:2:84"),new Be("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Be("urn:x-ogc:def:crs:EPSG:4326","neu")],Ye={};var We={};function Ve(t,e,r){var i=t.getCode(),n=e.getCode();i in We||(We[i]={}),We[i][n]=r}function Xe(t,e){var r;return t in We&&e in We[t]&&(r=We[t][e]),r}function qe(t,e,r){var i=r||6371008.8,n=Re(t[1]),o=Re(e[1]),s=(o-n)/2,a=Re(e[0]-t[0])/2,l=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(n)*Math.cos(o);return 2*i*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function Ze(t,e){for(var r=0,i=0,n=t.length;i<n-1;++i)r+=qe(t[i],t[i+1],e);return r}function Ke(t,e){for(var r=0,i=t.length,n=t[i-1][0],o=t[i-1][1],s=0;s<i;s++){var a=t[s][0],l=t[s][1];r+=Re(a-n)*(2+Math.sin(Re(o))+Math.sin(Re(l))),n=a,o=l}return r*e*e/2}function He(t,e,r,i){var n=i||6371008.8,o=Re(t[1]),s=Re(t[0]),a=e/n,l=Math.asin(Math.sin(o)*Math.cos(a)+Math.cos(o)*Math.sin(a)*Math.cos(r));return[Ee(s+Math.atan2(Math.sin(r)*Math.sin(a)*Math.cos(o),Math.cos(a)-Math.sin(o)*Math.sin(l))),Ee(l)]}function Je(t,e,r){var i=void 0!==r?t.toFixed(r):""+t,n=i.indexOf(".");return(n=-1===n?i.length:n)>e?i:new Array(1+e-n).join("0")+i}function $e(t,e){for(var r=(""+t).split("."),i=(""+e).split("."),n=0;n<Math.max(r.length,i.length);n++){var o=parseInt(r[n]||"0",10),s=parseInt(i[n]||"0",10);if(o>s)return 1;if(s>o)return-1}return 0}function Qe(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function tr(t,e){var r,i,n=t[0],o=t[1],s=e[0],a=e[1],l=s[0],u=s[1],h=a[0],c=a[1],p=h-l,d=c-u,f=0===p&&0===d?0:(p*(n-l)+d*(o-u))/(p*p+d*d||0);return f<=0?(r=l,i=u):f>=1?(r=h,i=c):(r=l+f*p,i=u+f*d),[r,i]}function er(t,e,r){var i=Pe(e+180,360)-180,n=Math.abs(3600*i),o=r||0,s=Math.pow(10,o),a=Math.floor(n/3600),l=Math.floor((n-3600*a)/60),u=n-3600*a-60*l;return(u=Math.ceil(u*s)/s)>=60&&(u=0,l+=1),l>=60&&(l=0,a+=1),a+"° "+Je(l,2)+"′ "+Je(u,2,o)+"″"+(0==i?"":" "+t.charAt(i<0?1:0))}function rr(t,e,r){return t?e.replace("{x}",t[0].toFixed(r)).replace("{y}",t[1].toFixed(r)):""}function ir(t,e){for(var r=!0,i=t.length-1;i>=0;--i)if(t[i]!=e[i]){r=!1;break}return r}function nr(t,e){var r=Math.cos(e),i=Math.sin(e),n=t[0]*r-t[1]*i,o=t[1]*r+t[0]*i;return t[0]=n,t[1]=o,t}function or(t,e){return t[0]*=e,t[1]*=e,t}function sr(t,e){var r=t[0]-e[0],i=t[1]-e[1];return r*r+i*i}function ar(t,e){return Math.sqrt(sr(t,e))}function lr(t,e){return sr(t,tr(t,e))}function ur(t,e){return rr(t,"{x}, {y}",e)}function hr(t,e){var r=fe(e.getExtent()),i=cr(t,e,r);return i&&(t[0]-=i*r),t}function cr(t,e,r){var i=e.getExtent(),n=0;if(e.canWrapX()&&(t[0]<i[0]||t[0]>i[2])){var o=r||fe(i);n=Math.floor((t[0]-i[0])/o)}return n}function pr(t,e,r){var i;if(void 0!==e){for(var n=0,o=t.length;n<o;++n)e[n]=t[n];i=e}else i=t.slice();return i}function dr(t,e,r){if(void 0!==e&&t!==e){for(var i=0,n=t.length;i<n;++i)e[i]=t[i];t=e}return t}function fr(t){!function(t,e){Ye[t]=e}(t.getCode(),t),Ve(t,t,pr)}function gr(t){return"string"==typeof t?Ye[t]||null:t||null}function yr(t,e,r,i){var n,o=(t=gr(t)).getPointResolutionFunc();if(o)n=o(e,r),i&&i!==t.getUnits()&&(s=t.getMetersPerUnit())&&(n=n*s/mt[i]);else if(t.getUnits()==_t.DEGREES&&!i||i==_t.DEGREES)n=e;else{var s,a=br(t,gr("EPSG:4326")),l=[r[0]-e/2,r[1],r[0]+e/2,r[1],r[0],r[1]-e/2,r[0],r[1]+e/2];n=(qe((l=a(l,l,2)).slice(0,2),l.slice(2,4))+qe(l.slice(4,6),l.slice(6,8)))/2,void 0!==(s=i?mt[i]:t.getMetersPerUnit())&&(n/=s)}return n}function mr(t){!function(t){t.forEach(fr)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&Ve(e,t,pr)}))}))}function _r(t,e){return t?"string"==typeof t?gr(t):t:gr(e)}function vr(t){return function(e,r,i){for(var n=e.length,o=void 0!==i?i:2,s=void 0!==r?r:new Array(n),a=0;a<n;a+=o){var l=t([e[a],e[a+1]]);s[a]=l[0],s[a+1]=l[1];for(var u=o-1;u>=2;--u)s[a+u]=e[a+u]}return s}}function xr(t,e,r,i){var n=gr(t),o=gr(e);Ve(n,o,vr(r)),Ve(o,n,vr(i))}function wr(t,e){if(t===e)return!0;var r=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||br(t,e)===pr)&&r}function br(t,e){var r=Xe(t.getCode(),e.getCode());return r||(r=dr),r}function Sr(t,e){return br(gr(t),gr(e))}function Tr(t,e,r){return Sr(e,r)(t,void 0,t.length)}function Cr(t,e,r,i){return _e(t,Sr(e,r),void 0,i)}var Er,Rr,Pr,Ir=null;function Or(){return Ir}function Lr(t,e){return Ir?Tr(t,e,Ir):t}function Mr(t,e){return Ir?Tr(t,Ir,e):t}function Fr(t,e){return Ir?Cr(t,e,Ir):t}function Ar(t,e){return Ir?Cr(t,Ir,e):t}function kr(t,e,r){return function(i){var n,o,s=i[0],a=i[1];if(t.canWrapX()){var l=t.getExtent(),u=fe(l);(o=cr(i,t,u))&&(s-=o*u),s=we(s,l[0],l[2]),a=we(a,l[1],l[3]),n=r([s,a])}else n=r(i);return o&&e.canWrapX()&&(n[0]+=o*fe(e.getExtent())),n}}function Nr(t,e,r,i,n,o){for(var s=o||[],a=0,l=e;l<r;l+=i){var u=t[l],h=t[l+1];s[a++]=n[0]*u+n[2]*h+n[4],s[a++]=n[1]*u+n[3]*h+n[5]}return o&&s.length!=a&&(s.length=a),s}function jr(t,e,r,i,n,o,s){for(var a=s||[],l=Math.cos(n),u=Math.sin(n),h=o[0],c=o[1],p=0,d=e;d<r;d+=i){var f=t[d]-h,g=t[d+1]-c;a[p++]=h+f*l-g*u,a[p++]=c+f*u+g*l;for(var y=d+2;y<d+i;++y)a[p++]=t[y]}return s&&a.length!=p&&(a.length=p),a}function Dr(t,e,r,i,n,o,s){for(var a=s||[],l=0,u=e;u<r;u+=i){a[l++]=t[u]+n,a[l++]=t[u+1]+o;for(var h=u+2;h<u+i;++h)a[l++]=t[h]}return s&&a.length!=l&&(a.length=l),a}mr(ke),mr(Ue),Er=ke,Rr=Ne,Pr=je,Ue.forEach((function(t){Er.forEach((function(e){Ve(t,e,Rr),Ve(e,t,Pr)}))}));var Gr=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),zr=[1,0,0,1,0,0],Br=function(t){function e(){var e,r,i,n,o,s=t.call(this)||this;return s.extent_=[1/0,1/0,-1/0,-1/0],s.extentRevision_=-1,s.simplifiedGeometryMaxMinSquaredTolerance=0,s.simplifiedGeometryRevision=0,s.simplifyTransformedInternal=(e=function(t,e,r){if(!r)return this.getSimplifiedGeometry(e);var i=this.clone();return i.applyTransform(r),i.getSimplifiedGeometry(e)},o=!1,function(){var t=Array.prototype.slice.call(arguments);return o&&this===n&&v(t,i)||(o=!0,n=this,i=t,r=e.apply(this,arguments)),r}),s}return Gr(e,t),e.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},e.prototype.clone=function(){return i()},e.prototype.closestPointXY=function(t,e,r,n){return i()},e.prototype.containsXY=function(t,e){var r=this.getClosestPoint([t,e]);return r[0]===t&&r[1]===e},e.prototype.getClosestPoint=function(t,e){var r=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],r,1/0),r},e.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},e.prototype.computeExtent=function(t){return i()},e.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&Zt(e),this.extentRevision_=this.getRevision()}return function(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}(this.extent_,t)},e.prototype.rotate=function(t,e){i()},e.prototype.scale=function(t,e,r){i()},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(t){return i()},e.prototype.getType=function(){return i()},e.prototype.applyTransform=function(t){i()},e.prototype.intersectsExtent=function(t){return i()},e.prototype.translate=function(t,e){i()},e.prototype.transform=function(t,e){var r=gr(t),i=r.getUnits()==_t.TILE_PIXELS?function(t,i,n){var o=r.getExtent(),s=r.getWorldExtent(),a=he(s)/he(o);return Ct(zr,s[0],s[3],a,-a,0,0,0),Nr(t,0,t.length,n,zr,i),Sr(r,e)(t,i,n)}:Sr(r,e);return this.applyTransform(i),this},e}(et),Ur=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function Yr(t){var e;return t==ct?e=2:t==pt||t==dt?e=3:t==ft&&(e=4),e}var Wr=function(t){function e(){var e=t.call(this)||this;return e.layout=ct,e.stride=2,e.flatCoordinates=null,e}return Ur(e,t),e.prototype.computeExtent=function(t){return Ht(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinates=function(){return i()},e.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.getFlatCoordinates=function(){return this.flatCoordinates},e.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},e.prototype.getLayout=function(){return this.layout},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},e.prototype.getSimplifiedGeometryInternal=function(t){return this},e.prototype.getStride=function(){return this.stride},e.prototype.setFlatCoordinates=function(t,e){this.stride=Yr(t),this.layout=t,this.flatCoordinates=e},e.prototype.setCoordinates=function(t,e){i()},e.prototype.setLayout=function(t,e,r){var i;if(t)i=Yr(t);else{for(var n=0;n<r;++n){if(0===e.length)return this.layout=ct,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=ct:3==t?e=pt:4==t&&(e=ft);return(e)}(i=e.length)}this.layout=t,this.stride=i},e.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},e.prototype.rotate=function(t,e){var r=this.getFlatCoordinates();if(r){var i=this.getStride();jr(r,0,r.length,i,t,e,r),this.changed()}},e.prototype.scale=function(t,e,r){var i=e;void 0===i&&(i=t);var n=r;n||(n=ae(this.getExtent()));var o=this.getFlatCoordinates();if(o){var s=this.getStride();!function(t,e,r,i,n,o,s,a){for(var l=a||[],u=s[0],h=s[1],c=0,p=e;p<r;p+=i){var d=t[p]-u,f=t[p+1]-h;l[c++]=u+n*d,l[c++]=h+o*f;for(var g=p+2;g<p+i;++g)l[c++]=t[g]}a&&l.length!=c&&(l.length=c)}(o,0,o.length,s,t,i,n,o),this.changed()}},e.prototype.translate=function(t,e){var r=this.getFlatCoordinates();if(r){var i=this.getStride();Dr(r,0,r.length,i,t,e,r),this.changed()}},e}(Br);function Vr(t,e,r,i,n,o,s){var a,l=t[e],u=t[e+1],h=t[r]-l,c=t[r+1]-u;if(0===h&&0===c)a=e;else{var p=((n-l)*h+(o-u)*c)/(h*h+c*c);if(p>1)a=r;else{if(p>0){for(var d=0;d<i;++d)s[d]=Ie(t[e+d],t[r+d],p);return void(s.length=i)}a=e}}for(d=0;d<i;++d)s[d]=t[a+d];s.length=i}function Xr(t,e,r,i,n){var o=t[e],s=t[e+1];for(e+=i;e<r;e+=i){var a=t[e],l=t[e+1],u=Ce(o,s,a,l);u>n&&(n=u),o=a,s=l}return n}function qr(t,e,r,i,n){for(var o=0,s=r.length;o<s;++o){var a=r[o];n=Xr(t,e,a,i,n),e=a}return n}function Zr(t,e,r,i,n,o,s,a,l,u,h){if(e==r)return u;var c,p;if(0===n){if((p=Ce(s,a,t[e],t[e+1]))<u){for(c=0;c<i;++c)l[c]=t[e+c];return l.length=i,p}return u}for(var d=h||[NaN,NaN],f=e+i;f<r;)if(Vr(t,f-i,f,i,s,a,d),(p=Ce(s,a,d[0],d[1]))<u){for(u=p,c=0;c<i;++c)l[c]=d[c];l.length=i,f+=i}else f+=i*Math.max((Math.sqrt(p)-Math.sqrt(u))/n|0,1);if(o&&(Vr(t,r-i,e,i,s,a,d),(p=Ce(s,a,d[0],d[1]))<u)){for(u=p,c=0;c<i;++c)l[c]=d[c];l.length=i}return u}function Kr(t,e,r,i,n,o,s,a,l,u,h){for(var c=h||[NaN,NaN],p=0,d=r.length;p<d;++p){var f=r[p];u=Zr(t,e,f,i,n,o,s,a,l,u,c),e=f}return u}function Hr(t,e,r,i){for(var n=0,o=r.length;n<o;++n)t[e++]=r[n];return e}function Jr(t,e,r,i){for(var n=0,o=r.length;n<o;++n)for(var s=r[n],a=0;a<i;++a)t[e++]=s[a];return e}function $r(t,e,r,i,n){for(var o=n||[],s=0,a=0,l=r.length;a<l;++a){var u=Jr(t,e,r[a],i);o[s++]=u,e=u}return o.length=s,o}function Qr(t,e,r,i,n,o,s){var a=(r-e)/i;if(a<3){for(;e<r;e+=i)o[s++]=t[e],o[s++]=t[e+1];return s}var l=new Array(a);l[0]=1,l[a-1]=1;for(var u=[e,r-i],h=0;u.length>0;){for(var c=u.pop(),p=u.pop(),d=0,f=t[p],g=t[p+1],y=t[c],m=t[c+1],_=p+i;_<c;_+=i){var v=Te(t[_],t[_+1],f,g,y,m);v>d&&(h=_,d=v)}d>n&&(l[(h-e)/i]=1,p+i<h&&u.push(p,h),h+i<c&&u.push(h,c))}for(_=0;_<a;++_)l[_]&&(o[s++]=t[e+_*i],o[s++]=t[e+_*i+1]);return s}function ti(t,e,r,i,n,o,s,a){for(var l=0,u=r.length;l<u;++l){var h=r[l];s=Qr(t,e,h,i,n,o,s),a.push(s),e=h}return s}function ei(t,e){return e*Math.round(t/e)}function ri(t,e,r,i,n,o,s){if(e==r)return s;var a,l,u=ei(t[e],n),h=ei(t[e+1],n);e+=i,o[s++]=u,o[s++]=h;do{if(a=ei(t[e],n),l=ei(t[e+1],n),(e+=i)==r)return o[s++]=a,o[s++]=l,s}while(a==u&&l==h);for(;e<r;){var c=ei(t[e],n),p=ei(t[e+1],n);if(e+=i,c!=a||p!=l){var d=a-u,f=l-h,g=c-u,y=p-h;d*y==f*g&&(d<0&&g<d||d==g||d>0&&g>d)&&(f<0&&y<f||f==y||f>0&&y>f)?(a=c,l=p):(o[s++]=a,o[s++]=l,u=a,h=l,a=c,l=p)}}return o[s++]=a,o[s++]=l,s}function ii(t,e,r,i,n,o,s,a){for(var l=0,u=r.length;l<u;++l){var h=r[l];s=ri(t,e,h,i,n,o,s),a.push(s),e=h}return s}function ni(t,e,r,i,n){for(var o=void 0!==n?n:[],s=0,a=e;a<r;a+=i)o[s++]=t.slice(a,a+i);return o.length=s,o}function oi(t,e,r,i,n){for(var o=void 0!==n?n:[],s=0,a=0,l=r.length;a<l;++a){var u=r[a];o[s++]=ni(t,e,u,i,o[s]),e=u}return o.length=s,o}function si(t,e,r,i,n){for(var o=void 0!==n?n:[],s=0,a=0,l=r.length;a<l;++a){var u=r[a];o[s++]=oi(t,e,u,i,o[s]),e=u[u.length-1]}return o.length=s,o}function ai(t,e,r,i){for(var n=0,o=t[r-i],s=t[r-i+1];e<r;e+=i){var a=t[e],l=t[e+1];n+=s*a-o*l,o=a,s=l}return n/2}function li(t,e,r,i){for(var n=0,o=0,s=r.length;o<s;++o){var a=r[o];n+=ai(t,e,a,i),e=a}return n}var ui=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),hi=function(t){function e(e,r){var i=t.call(this)||this;return i.maxDelta_=-1,i.maxDeltaRevision_=-1,void 0===r||Array.isArray(e[0])?i.setCoordinates(e,r):i.setFlatCoordinates(r,e),i}return ui(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,r,i){return i<Bt(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Xr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Zr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,r,i))},e.prototype.getArea=function(){return ai(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return ni(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[];return r.length=Qr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r,0),new e(r,ct)},e.prototype.getType=function(){return gt.LINEAR_RING},e.prototype.intersectsExtent=function(t){return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Jr(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Wr),ci=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),pi=function(t){function e(e,r){var i=t.call(this)||this;return i.setCoordinates(e,r),i}return ci(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,r,i){var n=this.flatCoordinates,o=Ce(t,e,n[0],n[1]);if(o<i){for(var s=this.stride,a=0;a<s;++a)r[a]=n[a];return r.length=s,o}return i},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return Kt(this.flatCoordinates,t)},e.prototype.getType=function(){return gt.POINT},e.prototype.intersectsExtent=function(t){return Wt(t,this.flatCoordinates[0],this.flatCoordinates[1])},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Hr(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Wr);function di(t,e,r,i,n){return!ie(n,(function(n){return!fi(t,e,r,i,n[0],n[1])}))}function fi(t,e,r,i,n,o){for(var s=0,a=t[r-i],l=t[r-i+1];e<r;e+=i){var u=t[e],h=t[e+1];l<=o?h>o&&(u-a)*(o-l)-(n-a)*(h-l)>0&&s++:h<=o&&(u-a)*(o-l)-(n-a)*(h-l)<0&&s--,a=u,l=h}return 0!==s}function gi(t,e,r,i,n,o){if(0===r.length)return!1;if(!fi(t,e,r[0],i,n,o))return!1;for(var s=1,a=r.length;s<a;++s)if(fi(t,r[s-1],r[s],i,n,o))return!1;return!0}function yi(t,e,r,i,n,o,s){for(var a,l,u,h,c,p,f,g=n[o+1],y=[],m=0,_=r.length;m<_;++m){var v=r[m];for(h=t[v-i],p=t[v-i+1],a=e;a<v;a+=i)c=t[a],f=t[a+1],(g<=p&&f<=g||p<=g&&g<=f)&&(u=(g-p)/(f-p)*(c-h)+h,y.push(u)),h=c,p=f}var x=NaN,w=-1/0;for(y.sort(d),h=y[0],a=1,l=y.length;a<l;++a){c=y[a];var b=Math.abs(c-h);b>w&&gi(t,e,r,i,u=(h+c)/2,g)&&(x=u,w=b),h=c}return isNaN(x)&&(x=n[o]),s?(s.push(x,g,w),s):[x,g,w]}function mi(t,e,r,i,n){for(var o=[],s=0,a=r.length;s<a;++s){var l=r[s];o=yi(t,e,l,i,n,2*s,o),e=l[l.length-1]}return o}function _i(t,e,r,i,n){for(var o,s=[t[e],t[e+1]],a=[];e+i<r;e+=i){if(a[0]=t[e+i],a[1]=t[e+i+1],o=n(s,a))return o;s[0]=a[0],s[1]=a[1]}return!1}function vi(t,e,r,i,n){var o=ee([1/0,1/0,-1/0,-1/0],t,e,r,i);return!!ge(n,o)&&(!!Yt(n,o)||(o[0]>=n[0]&&o[2]<=n[2]||(o[1]>=n[1]&&o[3]<=n[3]||_i(t,e,r,i,(function(t,e){return function(t,e,r){var i=!1,n=Vt(t,e),o=Vt(t,r);if(n===Ft||o===Ft)i=!0;else{var s=t[0],a=t[1],l=t[2],u=t[3],h=e[0],c=e[1],p=r[0],d=r[1],f=(d-c)/(p-h),g=void 0,y=void 0;o&At&&!(n&At)&&(i=(g=p-(d-u)/f)>=s&&g<=l),i||!(o&kt)||n&kt||(i=(y=d-(p-l)*f)>=a&&y<=u),i||!(o&Nt)||n&Nt||(i=(g=p-(d-a)/f)>=s&&g<=l),i||!(o&jt)||n&jt||(i=(y=d-(p-s)*f)>=a&&y<=u)}return i}(n,t,e)})))))}function xi(t,e,r,i,n){if(!function(t,e,r,i,n){return!!vi(t,e,r,i,n)||(!!fi(t,e,r,i,n[0],n[1])||(!!fi(t,e,r,i,n[0],n[3])||(!!fi(t,e,r,i,n[2],n[1])||!!fi(t,e,r,i,n[2],n[3]))))}(t,e,r[0],i,n))return!1;if(1===r.length)return!0;for(var o=1,s=r.length;o<s;++o)if(di(t,r[o-1],r[o],i,n)&&!vi(t,r[o-1],r[o],i,n))return!1;return!0}function wi(t,e,r,i){for(;e<r-i;){for(var n=0;n<i;++n){var o=t[e+n];t[e+n]=t[r-i+n],t[r-i+n]=o}e+=i,r-=i}}function bi(t,e,r,i){for(var n=!0,o=0;o<i;++o)if(t[e+o]!==t[r-i+o]){n=!1;break}n&&(r-=i);var s=function(t,e,r,i){for(var n=-1,o=1/0,s=1/0,a=e;a<r;a+=i){var l=t[a],u=t[a+1];u>o||(u==o&&l>=s||(n=a,o=u,s=l))}return n}(t,e,r,i),a=s-i;a<e&&(a=r-i);var l=s+i;l>=r&&(l=e);var u=t[a],h=t[a+1],c=t[s],p=t[s+1],d=t[l],f=t[l+1];return c*f+u*p+h*d-(h*c+p*d+u*f)<0}function Si(t,e,r,i,n){for(var o=void 0!==n&&n,s=0,a=r.length;s<a;++s){var l=r[s],u=bi(t,e,l,i);if(0===s){if(o&&u||!o&&!u)return!1}else if(o&&!u||!o&&u)return!1;e=l}return!0}function Ti(t,e,r,i,n){for(var o=void 0!==n&&n,s=0,a=r.length;s<a;++s){var l=r[s],u=bi(t,e,l,i);(0===s?o&&u||!o&&!u:o&&!u||!o&&u)&&wi(t,e,l,i),e=l}return e}function Ci(t,e,r,i,n){for(var o=0,s=r.length;o<s;++o)e=Ti(t,e,r[o],i,n);return e}var Ei=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ri=function(t){function e(e,r,i){var n=t.call(this)||this;return n.ends_=[],n.flatInteriorPointRevision_=-1,n.flatInteriorPoint_=null,n.maxDelta_=-1,n.maxDeltaRevision_=-1,n.orientedRevision_=-1,n.orientedFlatCoordinates_=null,void 0!==r&&i?(n.setFlatCoordinates(r,e),n.ends_=i):n.setCoordinates(e,r),n}return Ei(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?m(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},e.prototype.closestPointXY=function(t,e,r,i){return i<Bt(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(qr(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Kr(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,r,i))},e.prototype.containsXY=function(t,e){return gi(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return li(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Ti(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,oi(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=ae(this.getExtent());this.flatInteriorPoint_=yi(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new pi(this.getFlatInteriorPoint(),dt)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new hi(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,r=this.ends_,i=[],n=0,o=0,s=r.length;o<s;++o){var a=r[o],l=new hi(e.slice(n,a),t);i.push(l),n=a}return i},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;Si(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Ti(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],i=[];return r.length=ii(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),r,0,i),new e(r,ct,i)},e.prototype.getType=function(){return gt.POLYGON},e.prototype.intersectsExtent=function(t){return xi(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var r=$r(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===r.length?0:r[r.length-1],this.changed()},e}(Wr),Pi=Ri;function Ii(t,e,r,i){for(var n=r||32,o=[],s=0;s<n;++s)m(o,He(t,e,2*Math.PI*s/n,i));return o.push(o[0],o[1]),new Ri(o,ct,[o.length])}function Oi(t){var e=t[0],r=t[1],i=t[2],n=t[3],o=[e,r,e,n,i,n,i,r,e,r];return new Ri(o,ct,[o.length])}function Li(t,e,r){for(var i=e||32,n=t.getStride(),o=t.getLayout(),s=t.getCenter(),a=n*(i+1),l=new Array(a),u=0;u<a;u+=n){l[u]=0,l[u+1]=0;for(var h=2;h<n;h++)l[u+h]=s[h]}var c=[l.length],p=new Ri(l,o,c);return Mi(p,s,t.getRadius(),r),p}function Mi(t,e,r,i){for(var n=t.getFlatCoordinates(),o=t.getStride(),s=n.length/o-1,a=i||0,l=0;l<=s;++l){var u=l*o,h=a+2*Pe(l,s)*Math.PI/s;n[u]=e[0]+r*Math.cos(h),n[u+1]=e[1]+r*Math.sin(h)}t.changed()}var Fi=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ai="accuracy",ki="accuracyGeometry",Ni="altitude",ji="altitudeAccuracy",Di="heading",Gi="position",zi="projection",Bi="speed",Ui="tracking",Yi="trackingOptions",Wi=function(t){function e(e){var r=t.call(this,L)||this;return r.code=e.code,r.message=e.message,r}return Fi(e,t),e}(h),Vi=function(t){function e(e){var r=t.call(this)||this,i=e||{};return r.position_=null,r.transform_=dr,r.watchId_=void 0,r.addEventListener(tt(zi),r.handleProjectionChanged_),r.addEventListener(tt(Ui),r.handleTrackingChanged_),void 0!==i.projection&&r.setProjection(i.projection),void 0!==i.trackingOptions&&r.setTrackingOptions(i.trackingOptions),r.setTracking(void 0!==i.tracking&&i.tracking),r}return Fi(e,t),e.prototype.disposeInternal=function(){this.setTracking(!1),t.prototype.disposeInternal.call(this)},e.prototype.handleProjectionChanged_=function(){var t=this.getProjection();t&&(this.transform_=br(gr("EPSG:4326"),t),this.position_&&this.set(Gi,this.transform_(this.position_)))},e.prototype.handleTrackingChanged_=function(){if("geolocation"in navigator){var t=this.getTracking();t&&void 0===this.watchId_?this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions()):t||void 0===this.watchId_||(navigator.geolocation.clearWatch(this.watchId_),this.watchId_=void 0)}},e.prototype.positionChange_=function(t){var e=t.coords;this.set(Ai,e.accuracy),this.set(Ni,null===e.altitude?void 0:e.altitude),this.set(ji,null===e.altitudeAccuracy?void 0:e.altitudeAccuracy),this.set(Di,null===e.heading?void 0:Re(e.heading)),this.position_?(this.position_[0]=e.longitude,this.position_[1]=e.latitude):this.position_=[e.longitude,e.latitude];var r=this.transform_(this.position_);this.set(Gi,r),this.set(Bi,null===e.speed?void 0:e.speed);var i=Ii(this.position_,e.accuracy);i.applyTransform(this.transform_),this.set(ki,i),this.changed()},e.prototype.positionError_=function(t){this.dispatchEvent(new Wi(t))},e.prototype.getAccuracy=function(){return this.get(Ai)},e.prototype.getAccuracyGeometry=function(){return this.get(ki)||null},e.prototype.getAltitude=function(){return this.get(Ni)},e.prototype.getAltitudeAccuracy=function(){return this.get(ji)},e.prototype.getHeading=function(){return this.get(Di)},e.prototype.getPosition=function(){return this.get(Gi)},e.prototype.getProjection=function(){return this.get(zi)},e.prototype.getSpeed=function(){return this.get(Bi)},e.prototype.getTracking=function(){return this.get(Ui)},e.prototype.getTrackingOptions=function(){return this.get(Yi)},e.prototype.setProjection=function(t){this.set(zi,gr(t))},e.prototype.setTracking=function(t){this.set(Ui,t)},e.prototype.setTrackingOptions=function(t){this.set(Yi,t)},e}(et),Xi=function(){function t(t,e,r){this.decay_=t,this.minVelocity_=e,this.delay_=r,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;for(var r=e-3;r>0&&this.points_[r+2]>t;)r-=3;var i=this.points_[e+2]-this.points_[r+2];if(i<1e3/60)return!1;var n=this.points_[e]-this.points_[r],o=this.points_[e+1]-this.points_[r+1];return this.angle_=Math.atan2(o,n),this.initialVelocity_=Math.sqrt(n*n+o*o)/i,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),qi=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Zi=/^([a-z]*)$|^hsla?\(.*\)$/i;function Ki(t){return"string"==typeof t?t:rn(t)}function Hi(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var r=getComputedStyle(e).color;return document.body.removeChild(e),r}return""}var Ji,$i,Qi=(Ji={},$i=0,function(t){var e;if(Ji.hasOwnProperty(t))e=Ji[t];else{if($i>=1024){var r=0;for(var i in Ji)0==(3&r++)&&(delete Ji[i],--$i)}e=function(t){var e,r,i,n,o;if(Zi.exec(t)&&(t=Hi(t)),qi.exec(t)){var s=t.length-1,a=void 0;a=s<=4?1:2;var l=4===s||8===s;e=parseInt(t.substr(1+0*a,a),16),r=parseInt(t.substr(1+1*a,a),16),i=parseInt(t.substr(1+2*a,a),16),n=l?parseInt(t.substr(1+3*a,a),16):255,1==a&&(e=(e<<4)+e,r=(r<<4)+r,i=(i<<4)+i,l&&(n=(n<<4)+n)),o=[e,r,i,n/255]}else 0==t.indexOf("rgba(")?en(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),en(o)):lt(!1,14);return o}(t),Ji[t]=e,++$i}return e});function tn(t){return Array.isArray(t)?t:Qi(t)}function en(t){return t[0]=we(t[0]+.5|0,0,255),t[1]=we(t[1]+.5|0,0,255),t[2]=we(t[2]+.5|0,0,255),t[3]=we(t[3],0,1),t}function rn(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var r=t[1];r!=(0|r)&&(r=r+.5|0);var i=t[2];return i!=(0|i)&&(i=i+.5|0),"rgba("+e+","+r+","+i+","+(void 0===t[3]?1:t[3])+")"}var nn=function(){function t(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return t.prototype.clear=function(){this.cache_={},this.cacheSize_=0},t.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var r=this.cache_[e];0!=(3&t++)||r.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,r){var i=on(t,e,r);return i in this.cache_?this.cache_[i]:null},t.prototype.set=function(t,e,r,i){var n=on(t,e,r);this.cache_[n]=i,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}();function on(t,e,r){return e+":"+t+":"+(r?Ki(r):"null")}var sn=new nn,an="opacity",ln="visible",un="extent",hn="zIndex",cn="maxResolution",pn="minResolution",dn="maxZoom",fn="minZoom",gn="source",yn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),mn=function(t){function e(e){var r=t.call(this)||this,i=T({},e);return i[an]=void 0!==e.opacity?e.opacity:1,lt("number"==typeof i[an],64),i[ln]=void 0===e.visible||e.visible,i[hn]=e.zIndex,i[cn]=void 0!==e.maxResolution?e.maxResolution:1/0,i[pn]=void 0!==e.minResolution?e.minResolution:0,i[fn]=void 0!==e.minZoom?e.minZoom:-1/0,i[dn]=void 0!==e.maxZoom?e.maxZoom:1/0,r.className_=void 0!==i.className?e.className:"ol-layer",delete i.className,r.setProperties(i),r.state_=null,r}return yn(e,t),e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},r=this.getZIndex();return e.opacity=we(Math.round(100*this.getOpacity())/100,0,1),e.sourceState=this.getSourceState(),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==r?r:!1===e.managed?1/0:0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},e.prototype.getLayersArray=function(t){return i()},e.prototype.getLayerStatesArray=function(t){return i()},e.prototype.getExtent=function(){return this.get(un)},e.prototype.getMaxResolution=function(){return this.get(cn)},e.prototype.getMinResolution=function(){return this.get(pn)},e.prototype.getMinZoom=function(){return this.get(fn)},e.prototype.getMaxZoom=function(){return this.get(dn)},e.prototype.getOpacity=function(){return this.get(an)},e.prototype.getSourceState=function(){return i()},e.prototype.getVisible=function(){return this.get(ln)},e.prototype.getZIndex=function(){return this.get(hn)},e.prototype.setExtent=function(t){this.set(un,t)},e.prototype.setMaxResolution=function(t){this.set(cn,t)},e.prototype.setMinResolution=function(t){this.set(pn,t)},e.prototype.setMaxZoom=function(t){this.set(dn,t)},e.prototype.setMinZoom=function(t){this.set(fn,t)},e.prototype.setOpacity=function(t){lt("number"==typeof t,64),this.set(an,t)},e.prototype.setVisible=function(t){this.set(ln,t)},e.prototype.setZIndex=function(t){this.set(hn,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(et),_n="prerender",vn="postrender",xn="precompose",wn="postcompose",bn="rendercomplete",Sn="undefined",Tn="loading",Cn="ready",En="error",Rn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function Pn(t,e){if(!t.visible)return!1;var r=e.resolution;if(r<t.minResolution||r>=t.maxResolution)return!1;var i=e.zoom;return i>t.minZoom&&i<=t.maxZoom}var In=function(t){function e(e){var r=this,i=T({},e);delete i.source,(r=t.call(this,i)||this).mapPrecomposeKey_=null,r.mapRenderKey_=null,r.sourceChangeKey_=null,r.renderer_=null,e.render&&(r.render=e.render),e.map&&r.setMap(e.map),r.addEventListener(tt(gn),r.handleSourcePropertyChange_);var n=e.source?e.source:null;return r.setSource(n),r}return Rn(e,t),e.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},e.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},e.prototype.getSource=function(){return this.get(gn)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():Sn},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(X(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=W(t,O,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_.getFeatures(t)},e.prototype.render=function(t,e){var r=this.getRenderer();if(r.prepareFrame(t))return r.renderFrame(t,e)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(X(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(X(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=W(t,xn,(function(t){var e=t.frameState.layerStatesArray,r=this.getLayerState(!1);lt(!e.some((function(t){return t.layer===r.layer})),67),e.push(r)}),this),this.mapRenderKey_=W(this,O,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(gn,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.setSource(null),t.prototype.disposeInternal.call(this)},e}(mn),On=function(){function t(){}return t.prototype.drawCustom=function(t,e,r){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,e){},t.prototype.drawFeature=function(t,e){},t.prototype.drawGeometryCollection=function(t,e){},t.prototype.drawLineString=function(t,e){},t.prototype.drawMultiLineString=function(t,e){},t.prototype.drawMultiPoint=function(t,e){},t.prototype.drawMultiPolygon=function(t,e){},t.prototype.drawPoint=function(t,e){},t.prototype.drawPolygon=function(t,e){},t.prototype.drawText=function(t,e){},t.prototype.setFillStrokeStyle=function(t,e){},t.prototype.setImageStyle=function(t,e){},t.prototype.setTextStyle=function(t,e){},t}();function Ln(t){return Array.isArray(t)?rn(t):t}var Mn="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",Fn=-1!==Mn.indexOf("firefox"),An=(-1!==Mn.indexOf("safari")&&Mn.indexOf("chrom"),-1!==Mn.indexOf("webkit")&&-1==Mn.indexOf("edge")),kn=-1!==Mn.indexOf("macintosh"),Nn="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,jn="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,Dn="undefined"!=typeof Image&&Image.prototype.decode,Gn=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(t){}return t}();function zn(t,e,r){var i=r&&r.length?r.shift():jn?new OffscreenCanvas(t||300,e||300):document.createElement("canvas");return t&&(i.width=t),e&&(i.height=e),i.getContext("2d")}function Bn(t){var e=t.offsetWidth,r=getComputedStyle(t);return e+=parseInt(r.marginLeft,10)+parseInt(r.marginRight,10)}function Un(t){var e=t.offsetHeight,r=getComputedStyle(t);return e+=parseInt(r.marginTop,10)+parseInt(r.marginBottom,10)}function Yn(t,e){var r=e.parentNode;r&&r.replaceChild(t,e)}function Wn(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function Vn(t){for(;t.lastChild;)t.removeChild(t.lastChild)}var Xn=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""),"i"),qn=["style","variant","weight","size","lineHeight","family"],Zn=function(t){var e=t.match(Xn);if(!e)return null;for(var r={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},i=0,n=qn.length;i<n;++i){var o=e[i+1];void 0!==o&&(r[qn[i]]=o)}return r.families=r.family.split(/,\s?/),r},Kn=[],Hn=[0,0,0,0],Jn=new et,$n=new I;$n.setSize=function(){console.warn("labelCache is deprecated.")};var Qn,to,eo,ro=null,io={},no=function(){var t,e,r=["monospace","serif"],i=r.length,n="wmytzilWMYTZIL@#/&?$%10";function o(t,o,s){for(var a=!0,l=0;l<i;++l){var u=r[l];if(e=ao(t+" "+o+" 32px "+u,n),s!=u){var h=ao(t+" "+o+" 32px "+s+","+u,n);a=a&&h!=e}}return!!a}function s(){for(var e=!0,r=Jn.getKeys(),i=0,n=r.length;i<n;++i){var s=r[i];Jn.get(s)<100&&(o.apply(this,s.split("\n"))?(C(io),ro=null,Qn=void 0,Jn.set(s,100)):(Jn.set(s,Jn.get(s)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var r=Zn(e);if(r)for(var i=r.families,n=0,a=i.length;n<a;++n){var l=i[n],u=r.style+"\n"+r.weight+"\n"+l;void 0===Jn.get(u)&&(Jn.set(u,100,!0),o(r.style,r.weight,l)||(Jn.set(u,0,!0),void 0===t&&(t=setInterval(s,32))))}}}(),oo=(eo=io,function(t){var e=eo[t];if(null==e)if(jn){var r=Zn(t),i=so(t,"Žg"),n=isNaN(Number(r.lineHeight))?1.2:Number(r.lineHeight);io[t]=n*(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent)}else to||((to=document.createElement("div")).innerHTML="M",to.style.margin="0 !important",to.style.padding="0 !important",to.style.position="absolute !important",to.style.left="-99999px !important"),to.style.font=t,document.body.appendChild(to),e=to.offsetHeight,eo[t]=e,document.body.removeChild(to);return e});function so(t,e){return ro||(ro=zn(1,1)),t!=Qn&&(ro.font=t,Qn=ro.font),ro.measureText(e)}function ao(t,e){return so(t,e).width}function lo(t,e,r){if(e in r)return r[e];var i=ao(t,e);return r[e]=i,i}function uo(t,e,r,i){0!==e&&(t.translate(r,i),t.rotate(e),t.translate(-r,-i))}function ho(t,e,r,i,n,o,s,a,l,u,h){t.save(),1!==r&&(t.globalAlpha*=r),e&&t.setTransform.apply(t,e),i.contextInstructions?(t.translate(l,u),t.scale(h[0],h[1]),function(t,e){for(var r=t.contextInstructions,i=0,n=r.length;i<n;i+=2)Array.isArray(r[i+1])?e[r[i]].apply(e,r[i+1]):e[r[i]]=r[i+1]}(i,t)):h[0]<0||h[1]<0?(t.translate(l,u),t.scale(h[0],h[1]),t.drawImage(i,n,o,s,a,0,0,s,a)):t.drawImage(i,n,o,s,a,l,u,s*h[0],a*h[1]),t.restore()}var co=null;function po(t){return jn?Rt(t):(co||(co=zn(1,1).canvas),co.style.transform=Rt(t),co.style.transform)}var fo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),go=function(t){function e(e,r,i,n,o,s,a){var l=t.call(this)||this;return l.context_=e,l.pixelRatio_=r,l.extent_=i,l.transform_=n,l.viewRotation_=o,l.squaredTolerance_=s,l.userTransform_=a,l.contextFillState_=null,l.contextStrokeState_=null,l.contextTextState_=null,l.fillState_=null,l.strokeState_=null,l.image_=null,l.imageAnchorX_=0,l.imageAnchorY_=0,l.imageHeight_=0,l.imageOpacity_=0,l.imageOriginX_=0,l.imageOriginY_=0,l.imageRotateWithView_=!1,l.imageRotation_=0,l.imageScale_=[0,0],l.imageWidth_=0,l.text_="",l.textOffsetX_=0,l.textOffsetY_=0,l.textRotateWithView_=!1,l.textRotation_=0,l.textScale_=[0,0],l.textFillState_=null,l.textStrokeState_=null,l.textState_=null,l.pixelCoordinates_=[],l.tmpLocalTransform_=[1,0,0,1,0,0],l}return fo(e,t),e.prototype.drawImages_=function(t,e,r,i){if(this.image_){var n=Nr(t,e,r,2,this.transform_,this.pixelCoordinates_),o=this.context_,s=this.tmpLocalTransform_,a=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=a*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var u=0,h=n.length;u<h;u+=2){var c=n[u]-this.imageAnchorX_,p=n[u+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var d=c+this.imageAnchorX_,f=p+this.imageAnchorY_;Ct(s,d,f,1,1,l,-d,-f),o.setTransform.apply(o,s),o.translate(d,f),o.scale(this.imageScale_[0],this.imageScale_[1]),o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),o.setTransform(1,0,0,1,0,0)}else o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,c,p,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(o.globalAlpha=a)}},e.prototype.drawText_=function(t,e,r,i){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var n=Nr(t,e,r,i,this.transform_,this.pixelCoordinates_),o=this.context_,s=this.textRotation_;for(this.textRotateWithView_&&(s+=this.viewRotation_);e<r;e+=i){var a=n[e]+this.textOffsetX_,l=n[e+1]+this.textOffsetY_;if(0!==s||1!=this.textScale_[0]||1!=this.textScale_[1]){var u=Ct(this.tmpLocalTransform_,a,l,1,1,s,-a,-l);o.setTransform.apply(o,u),o.translate(a,l),o.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&o.strokeText(this.text_,0,0),this.textFillState_&&o.fillText(this.text_,0,0),o.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&o.strokeText(this.text_,a,l),this.textFillState_&&o.fillText(this.text_,a,l)}}},e.prototype.moveToLineTo_=function(t,e,r,i,n){var o=this.context_,s=Nr(t,e,r,i,this.transform_,this.pixelCoordinates_);o.moveTo(s[0],s[1]);var a=s.length;n&&(a-=2);for(var l=2;l<a;l+=2)o.lineTo(s[l],s[l+1]);return n&&o.closePath(),r},e.prototype.drawRings_=function(t,e,r,i){for(var n=0,o=r.length;n<o;++n)e=this.moveToLineTo_(t,e,r[n],i,!0);return e},e.prototype.drawCircle=function(t){if(ge(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=function(t,e,r){var i=t.getFlatCoordinates();if(i){var n=t.getStride();return Nr(i,0,i.length,n,e,r)}return null}(t,this.transform_,this.pixelCoordinates_),r=e[2]-e[0],i=e[3]-e[1],n=Math.sqrt(r*r+i*i),o=this.context_;o.beginPath(),o.arc(e[0],e[1],n,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.setTransform=function(t){this.transform_=t},e.prototype.drawGeometry=function(t){switch(t.getType()){case gt.POINT:this.drawPoint(t);break;case gt.LINE_STRING:this.drawLineString(t);break;case gt.POLYGON:this.drawPolygon(t);break;case gt.MULTI_POINT:this.drawMultiPoint(t);break;case gt.MULTI_LINE_STRING:this.drawMultiLineString(t);break;case gt.MULTI_POLYGON:this.drawMultiPolygon(t);break;case gt.GEOMETRY_COLLECTION:this.drawGeometryCollection(t);break;case gt.CIRCLE:this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var r=e.getGeometryFunction()(t);r&&ge(this.extent_,r.getExtent())&&(this.setStyle(e),this.drawGeometry(r))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),r=0,i=e.length;r<i;++r)this.drawGeometry(e[r])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),r=t.getStride();this.image_&&this.drawImages_(e,0,e.length,r),""!==this.text_&&this.drawText_(e,0,e.length,r)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),r=t.getStride();this.image_&&this.drawImages_(e,0,e.length,r),""!==this.text_&&this.drawText_(e,0,e.length,r)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),ge(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,r=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(r,0,r.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var i=t.getFlatMidpoint();this.drawText_(i,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(ge(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var r=this.context_,i=t.getFlatCoordinates(),n=0,o=t.getEnds(),s=t.getStride();r.beginPath();for(var a=0,l=o.length;a<l;++a)n=this.moveToLineTo_(i,n,o[a],s,!1);r.stroke()}if(""!==this.text_){var u=t.getFlatMidpoints();this.drawText_(u,0,u.length,2)}}},e.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),ge(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var r=t.getFlatInteriorPoint();this.drawText_(r,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),ge(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_,r=t.getOrientedFlatCoordinates(),i=0,n=t.getEndss(),o=t.getStride();e.beginPath();for(var s=0,a=n.length;s<a;++s){var l=n[s];i=this.drawRings_(r,i,l,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var u=t.getFlatInteriorPoints();this.drawText_(u,0,u.length,2)}}},e.prototype.setContextFillState_=function(t){var e=this.context_,r=this.contextFillState_;r?r.fillStyle!=t.fillStyle&&(r.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var e=this.context_,r=this.contextStrokeState_;r?(r.lineCap!=t.lineCap&&(r.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(v(r.lineDash,t.lineDash)||e.setLineDash(r.lineDash=t.lineDash),r.lineDashOffset!=t.lineDashOffset&&(r.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),r.lineJoin!=t.lineJoin&&(r.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),r.lineWidth!=t.lineWidth&&(r.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),r.miterLimit!=t.miterLimit&&(r.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),r.strokeStyle!=t.strokeStyle&&(r.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var e=this.context_,r=this.contextTextState_,i=t.textAlign?t.textAlign:"center";r?(r.font!=t.font&&(r.font=t.font,e.font=t.font),r.textAlign!=i&&(r.textAlign=i,e.textAlign=i),r.textBaseline!=t.textBaseline&&(r.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=i,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:i,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){if(t){var r=t.getColor();this.fillState_={fillStyle:Ln(r||"#000")}}else this.fillState_=null;if(e){var i=e.getColor(),n=e.getLineCap(),o=e.getLineDash(),s=e.getLineDashOffset(),a=e.getLineJoin(),l=e.getWidth(),u=e.getMiterLimit();this.strokeState_={lineCap:void 0!==n?n:"round",lineDash:o||Kn,lineDashOffset:s||0,lineJoin:void 0!==a?a:"round",lineWidth:this.pixelRatio_*(void 0!==l?l:1),miterLimit:void 0!==u?u:10,strokeStyle:Ln(i||"#000")}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){if(t){var e=t.getSize();if(e){var r=t.getAnchor(),i=t.getImage(1),n=t.getOrigin(),o=t.getScaleArray();this.imageAnchorX_=r[0],this.imageAnchorY_=r[1],this.imageHeight_=e[1],this.image_=i,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=n[0],this.imageOriginY_=n[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=[this.pixelRatio_*o[0],this.pixelRatio_*o[1]],this.imageWidth_=e[0]}else this.image_=null}else this.image_=null},e.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var r=e.getColor();this.textFillState_={fillStyle:Ln(r||"#000")}}else this.textFillState_=null;var i=t.getStroke();if(i){var n=i.getColor(),o=i.getLineCap(),s=i.getLineDash(),a=i.getLineDashOffset(),l=i.getLineJoin(),u=i.getWidth(),h=i.getMiterLimit();this.textStrokeState_={lineCap:void 0!==o?o:"round",lineDash:s||Kn,lineDashOffset:a||0,lineJoin:void 0!==l?l:"round",lineWidth:void 0!==u?u:1,miterLimit:void 0!==h?h:10,strokeStyle:Ln(n||"#000")}}else this.textStrokeState_=null;var c=t.getFont(),p=t.getOffsetX(),d=t.getOffsetY(),f=t.getRotateWithView(),g=t.getRotation(),y=t.getScaleArray(),m=t.getText(),_=t.getTextAlign(),v=t.getTextBaseline();this.textState_={font:void 0!==c?c:"10px sans-serif",textAlign:void 0!==_?_:"center",textBaseline:void 0!==v?v:"middle"},this.text_=void 0!==m?m:"",this.textOffsetX_=void 0!==p?this.pixelRatio_*p:0,this.textOffsetY_=void 0!==d?this.pixelRatio_*d:0,this.textRotateWithView_=void 0!==f&&f,this.textRotation_=void 0!==g?g:0,this.textScale_=[this.pixelRatio_*y[0],this.pixelRatio_*y[1]]}else this.text_=""},e}(On),yo="Circle",mo="Default",_o="Image",vo="LineString",xo="Polygon",wo="Text",bo=0,So=1,To=2,Co=3,Eo=4,Ro={Point:function(t,e,r,i){var n=r.getImage();if(n){if(n.getImageState()!=To)return;var o=t.getBuilder(r.getZIndex(),_o);o.setImageStyle(n,t.addDeclutter(!1)),o.drawPoint(e,i)}var s=r.getText();if(s){var a=t.getBuilder(r.getZIndex(),wo);a.setTextStyle(s,t.addDeclutter(!!n)),a.drawText(e,i)}},LineString:function(t,e,r,i){var n=r.getStroke();if(n){var o=t.getBuilder(r.getZIndex(),vo);o.setFillStrokeStyle(null,n),o.drawLineString(e,i)}var s=r.getText();if(s){var a=t.getBuilder(r.getZIndex(),wo);a.setTextStyle(s,t.addDeclutter(!1)),a.drawText(e,i)}},Polygon:function(t,e,r,i){var n=r.getFill(),o=r.getStroke();if(n||o){var s=t.getBuilder(r.getZIndex(),xo);s.setFillStrokeStyle(n,o),s.drawPolygon(e,i)}var a=r.getText();if(a){var l=t.getBuilder(r.getZIndex(),wo);l.setTextStyle(a,t.addDeclutter(!1)),l.drawText(e,i)}},MultiPoint:function(t,e,r,i){var n=r.getImage();if(n){if(n.getImageState()!=To)return;var o=t.getBuilder(r.getZIndex(),_o);o.setImageStyle(n,t.addDeclutter(!1)),o.drawMultiPoint(e,i)}var s=r.getText();if(s){var a=t.getBuilder(r.getZIndex(),wo);a.setTextStyle(s,t.addDeclutter(!!n)),a.drawText(e,i)}},MultiLineString:function(t,e,r,i){var n=r.getStroke();if(n){var o=t.getBuilder(r.getZIndex(),vo);o.setFillStrokeStyle(null,n),o.drawMultiLineString(e,i)}var s=r.getText();if(s){var a=t.getBuilder(r.getZIndex(),wo);a.setTextStyle(s,t.addDeclutter(!1)),a.drawText(e,i)}},MultiPolygon:function(t,e,r,i){var n=r.getFill(),o=r.getStroke();if(o||n){var s=t.getBuilder(r.getZIndex(),xo);s.setFillStrokeStyle(n,o),s.drawMultiPolygon(e,i)}var a=r.getText();if(a){var l=t.getBuilder(r.getZIndex(),wo);l.setTextStyle(a,t.addDeclutter(!1)),l.drawText(e,i)}},GeometryCollection:function(t,e,r,i){var n,o,s=e.getGeometriesArray();for(n=0,o=s.length;n<o;++n){(0,Ro[s[n].getType()])(t,s[n],r,i)}},Circle:function(t,e,r,i){var n=r.getFill(),o=r.getStroke();if(n||o){var s=t.getBuilder(r.getZIndex(),yo);s.setFillStrokeStyle(n,o),s.drawCircle(e,i)}var a=r.getText();if(a){var l=t.getBuilder(r.getZIndex(),wo);l.setTextStyle(a,t.addDeclutter(!1)),l.drawText(e,i)}}};function Po(t,e){return parseInt(o(t),10)-parseInt(o(e),10)}function Io(t,e){var r=Oo(t,e);return r*r}function Oo(t,e){return.5*t/e}function Lo(t,e,r,i,n,o){var s=!1,a=r.getImage();if(a){var l=a.getImageState();l==To||l==Co?a.unlistenImageChange(n):(l==bo&&a.load(),l=a.getImageState(),a.listenImageChange(n),s=!0)}return function(t,e,r,i,n){var o=r.getGeometryFunction()(e);if(!o)return;var s=o.simplifyTransformed(i,n);if(r.getRenderer())!function t(e,r,i,n){if(r.getType()==gt.GEOMETRY_COLLECTION){for(var o=r.getGeometries(),s=0,a=o.length;s<a;++s)t(e,o[s],i,n);return}e.getBuilder(i.getZIndex(),mo).drawCustom(r,n,i.getRenderer())}(t,s,r,e);else{(0,Ro[s.getType()])(t,s,r,e)}}(t,e,r,i,o),s}function Mo(t){var e,r=t.frameState,i=wt(t.inversePixelTransform.slice(),r.coordinateToPixelTransform),n=Io(r.viewState.resolution,r.pixelRatio),o=Or();return o&&(e=br(o,r.viewState.projection)),new go(t.context,r.pixelRatio,r.extent,i,r.viewState.rotation,n,e)}function Fo(t,e){e&&e.clear();for(var r=t.declutterItems,i=r.length-1;i>=0;--i)for(var n=r[i],o=n.items,s=0,a=o.length;s<a;s+=3)e=o[s].renderDeclutter(o[s+1],o[s+2],n.opacity,e);return r.length=0,e}var Ao=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function ko(t,e){sn.expire()}var No=function(t){function e(e){var r=t.call(this)||this;return r.map_=e,r.declutterTree_=null,r}return Ao(e,t),e.prototype.dispatchRenderEvent=function(t,e){i()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,r=t.coordinateToPixelTransform,i=t.pixelToCoordinateTransform;Ct(r,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Et(i,r)},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,i,n,o,s,a){var l,u=e.viewState;function h(t,e,r){return n.call(o,e,t?r:null)}var c=u.projection,p=hr(t.slice(),c),d=[[0,0]];if(c.canWrapX()&&i){var f=fe(c.getExtent());d.push([-f,0],[f,0])}var g,y=e.layerStatesArray,m=y.length;this.declutterTree_&&(g=this.declutterTree_.all().map((function(t){return t.value})));for(var _=[],v=0;v<d.length;v++)for(var x=m-1;x>=0;--x){var w=y[x],b=w.layer;if(b.hasRenderer()&&Pn(w,u)&&s.call(a,b)){var S=b.getRenderer(),T=b.getSource();if(S&&T){var C=T.getWrapX()?p:t,E=h.bind(null,w.managed);_[0]=C[0]+d[v][0],_[1]=C[1]+d[v][1],l=S.forEachFeatureAtCoordinate(_,e,r,E,g)}if(l)return l}}},e.prototype.forEachLayerAtPixel=function(t,e,r,n,o){return i()},e.prototype.hasFeatureAtCoordinate=function(t,e,r,i,n,o){return void 0!==this.forEachFeatureAtCoordinate(t,e,r,i,w,this,n,o)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){this.declutterTree_=Fo(t,this.declutterTree_)},e.prototype.scheduleExpireIconCache=function(t){sn.canExpireCache()&&t.postRenderFunctions.push(ko)},e}(p),jo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Do=function(t){function e(e,r,i,n){var o=t.call(this,e)||this;return o.inversePixelTransform=r,o.frameState=i,o.context=n,o}return jo(e,t),e}(h),Go=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),zo=function(t){function e(e){var r=t.call(this,e)||this;r.fontChangeListenerKey_=W(Jn,c,e.redrawText.bind(e)),r.element_=document.createElement("div");var i=r.element_.style;i.position="absolute",i.width="100%",i.height="100%",i.zIndex="0",r.element_.className="ol-unselectable ol-layers";var n=e.getViewport();return n.insertBefore(r.element_,n.firstChild||null),r.children_=[],r.renderedVisible_=!0,r}return Go(e,t),e.prototype.dispatchRenderEvent=function(t,e){var r=this.getMap();if(r.hasListener(t)){var i=new Do(t,void 0,e);r.dispatchEvent(i)}},e.prototype.disposeInternal=function(){X(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),t.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(e){if(e){this.calculateMatrices2D(e),this.dispatchRenderEvent(xn,e);var r=e.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),i=e.viewState;this.children_.length=0;for(var n=null,o=0,s=r.length;o<s;++o){var a=r[o];if(e.layerIndex=o,Pn(a,i)&&(a.sourceState==Cn||a.sourceState==Sn)){var l=a.layer.render(e,n);l&&l!==n&&(this.children_.push(l),n=l)}}t.prototype.renderFrame.call(this,e),function(t,e){for(var r=t.childNodes,i=0;;++i){var n=r[i],o=e[i];if(!n&&!o)break;n!==o&&(n?o?t.insertBefore(o,n):(t.removeChild(n),--i):t.appendChild(o))}}(this.element_,this.children_),this.dispatchRenderEvent(wn,e),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(e)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,r,i,n){for(var o=e.viewState,s=e.layerStatesArray,a=s.length-1;a>=0;--a){var l=s[a],u=l.layer;if(u.hasRenderer()&&Pn(l,o)&&n(u)){var h=u.getRenderer().getDataAtPixel(t,e,r);if(h){var c=i(u,h);if(c)return c}}}},e}(No),Bo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Uo="layers",Yo=function(t){function e(e){var r=this,i=e||{},n=T({},i);delete n.layers;var o=i.layers;return(r=t.call(this,n)||this).layersListenerKeys_=[],r.listenerKeys_={},r.addEventListener(tt(Uo),r.handleLayersChanged_),o?Array.isArray(o)?o=new at(o.slice(),{unique:!0}):lt("function"==typeof o.getArray,43):o=new at(void 0,{unique:!0}),r.setLayers(o),r}return Bo(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(X),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(W(t,rt,this.handleLayersAdd_,this),W(t,it,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(X);C(this.listenerKeys_);for(var r=t.getArray(),i=0,n=r.length;i<n;i++){var s=r[i];this.listenerKeys_[o(s)]=[W(s,c,this.handleLayerChange_,this),W(s,O,this.handleLayerChange_,this)]}this.changed()},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.listenerKeys_[o(e)]=[W(e,c,this.handleLayerChange_,this),W(e,O,this.handleLayerChange_,this)],this.changed()},e.prototype.handleLayersRemove_=function(t){var e=o(t.element);this.listenerKeys_[e].forEach(X),delete this.listenerKeys_[e],this.changed()},e.prototype.getLayers=function(){return this.get(Uo)},e.prototype.setLayers=function(t){this.set(Uo,t)},e.prototype.getLayersArray=function(t){var e=void 0!==t?t:[];return this.getLayers().forEach((function(t){t.getLayersArray(e)})),e},e.prototype.getLayerStatesArray=function(t){var e=void 0!==t?t:[],r=e.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(e)}));for(var i=this.getLayerState(),n=r,o=e.length;n<o;n++){var s=e[n];s.opacity*=i.opacity,s.visible=s.visible&&i.visible,s.maxResolution=Math.min(s.maxResolution,i.maxResolution),s.minResolution=Math.max(s.minResolution,i.minResolution),s.minZoom=Math.max(s.minZoom,i.minZoom),s.maxZoom=Math.min(s.maxZoom,i.maxZoom),void 0!==i.extent&&(void 0!==s.extent?s.extent=ce(s.extent,i.extent):s.extent=i.extent)}return e},e.prototype.getSourceState=function(){return Cn},e}(mn),Wo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Vo=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.map=r,n.frameState=void 0!==i?i:null,n}return Wo(e,t),e}(h),Xo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),qo=function(t){function e(e,r,i,n,o){var s=t.call(this,e,r,o)||this;return s.originalEvent=i,s.pixel_=null,s.coordinate_=null,s.dragging=void 0!==n&&n,s}return Xo(e,t),Object.defineProperty(e.prototype,"pixel",{get:function(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_},set:function(t){this.pixel_=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coordinate",{get:function(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_},set:function(t){this.coordinate_=t},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){t.prototype.preventDefault.call(this),this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this),this.originalEvent.stopPropagation()},e}(Vo),Zo={SINGLECLICK:"singleclick",CLICK:F,DBLCLICK:A,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Ko="pointermove",Ho="pointerdown",Jo="pointerup",$o="pointerout",Qo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),ts=function(t){function e(e,r){var i=t.call(this,e)||this;i.map_=e,i.clickTimeoutId_,i.dragging_=!1,i.dragListenerKeys_=[],i.moveTolerance_=r?r*Nn:Nn,i.down_=null;var n=i.map_.getViewport();return i.activePointers_=0,i.trackedTouches_={},i.element_=n,i.pointerdownListenerKey_=W(n,Ho,i.handlePointerDown_,i),i.originalPointerMoveEvent_,i.relayedListenerKey_=W(n,Ko,i.relayEvent_,i),i.boundHandleTouchMove_=i.handleTouchMove_.bind(i),i.element_.addEventListener(U,i.boundHandleTouchMove_,!!Gn&&{passive:!1}),i}return Qo(e,t),e.prototype.emulateClick_=function(t){var e=new qo(Zo.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new qo(Zo.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new qo(Zo.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==Zo.POINTERUP||e.type==Zo.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==Zo.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new qo(Zo.POINTERUP,this.map_,t);this.dispatchEvent(e),e.propagationStopped||this.dragging_||!this.isMouseActionButton_(t)||this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(X),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},e.prototype.isMouseActionButton_=function(t){return 0===t.button},e.prototype.handlePointerDown_=function(t){this.updateActivePointers_(t);var e=new qo(Zo.POINTERDOWN,this.map_,t);this.dispatchEvent(e),this.down_=t,0===this.dragListenerKeys_.length&&(this.dragListenerKeys_.push(W(document,Zo.POINTERMOVE,this.handlePointerMove_,this),W(document,Zo.POINTERUP,this.handlePointerUp_,this),W(this.element_,Zo.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==document&&this.dragListenerKeys_.push(W(this.element_.getRootNode(),Zo.POINTERUP,this.handlePointerUp_,this)))},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new qo(Zo.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(e)}},e.prototype.relayEvent_=function(t){this.originalPointerMoveEvent_=t;var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new qo(t.type,this.map_,t,e))},e.prototype.handleTouchMove_=function(t){this.originalPointerMoveEvent_&&!this.originalPointerMoveEvent_.defaultPrevented||t.preventDefault()},e.prototype.isMoving_=function(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(X(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(U,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(X(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(X),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(I),es="postrender",rs="movestart",is="moveend",ns="layergroup",os="size",ss="target",as="view",ls=function(){function t(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,C(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,r=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var i=this.keyFunction_(r);return delete this.queuedElements_[i],r},t.prototype.enqueue=function(t){lt(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=1/0&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,r=this.priorities_,i=e.length,n=e[t],o=r[t],s=t;t<i>>1;){var a=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),u=l<i&&r[l]<r[a]?l:a;e[t]=e[u],r[t]=r[u],t=u}e[t]=n,r[t]=o,this.siftDown_(s,t)},t.prototype.siftDown_=function(t,e){for(var r=this.elements_,i=this.priorities_,n=r[e],o=i[e];e>t;){var s=this.getParentIndex_(e);if(!(i[s]>o))break;r[e]=r[s],i[e]=i[s],e=s}r[e]=n,i[e]=o},t.prototype.reprioritize=function(){var t,e,r,i=this.priorityFunction_,n=this.elements_,o=this.priorities_,s=0,a=n.length;for(e=0;e<a;++e)(r=i(t=n[e]))==1/0?delete this.queuedElements_[this.keyFunction_(t)]:(o[s]=r,n[s++]=t);n.length=s,o.length=s,this.heapify_()},t}(),us=0,hs=1,cs=2,ps=3,ds=4,fs=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),gs=function(t){function e(e,r){var i=t.call(this,(function(t){return e.apply(null,t)}),(function(t){return t[0].getKey()}))||this;return i.boundHandleTileChange_=i.handleTileChange.bind(i),i.tileChangeCallback_=r,i.tilesLoading_=0,i.tilesLoadingKeys_={},i}return fs(e,t),e.prototype.enqueue=function(e){var r=t.prototype.enqueue.call(this,e);r&&e[0].addEventListener(O,this.boundHandleTileChange_);return r},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,r=e.getState();if(e.hifi&&r===cs||r===ps||r===ds){e.removeEventListener(O,this.boundHandleTileChange_);var i=e.getKey();i in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[i],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var r,i,n=0;this.tilesLoading_<t&&n<e&&this.getCount()>0;)i=(r=this.dequeue()[0]).getKey(),r.getState()!==us||i in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[i]=!0,++this.tilesLoading_,++n,r.load())},e}(ls);var ys=0,ms=1,_s="center",vs="resolution",xs="rotation";function ws(t,e,r){return function(i,n,o,s){if(i){var a=e?0:o[0]*n,l=e?0:o[1]*n,u=t[0]+a/2,h=t[2]-a/2,c=t[1]+l/2,p=t[3]-l/2;u>h&&(h=u=(h+u)/2),c>p&&(p=c=(p+c)/2);var d=we(i[0],u,h),f=we(i[1],c,p),g=30*n;return s&&r&&(d+=-g*Math.log(1+Math.max(0,u-i[0])/g)+g*Math.log(1+Math.max(0,i[0]-h)/g),f+=-g*Math.log(1+Math.max(0,c-i[1])/g)+g*Math.log(1+Math.max(0,i[1]-p)/g)),[d,f]}}}function bs(t){return t}function Ss(t,e,r,i){var n=fe(e)/r[0],o=he(e)/r[1];return i?Math.min(t,Math.max(n,o)):Math.min(t,Math.min(n,o))}function Ts(t,e,r){var i=Math.min(t,e);return i*=Math.log(1+50*Math.max(0,t/e-1))/50+1,r&&(i=Math.max(i,r),i/=Math.log(1+50*Math.max(0,r/t-1))/50+1),we(i,r/2,2*e)}function Cs(t,e,r,i,n){return function(o,s,a,l){if(void 0!==o){var u=i?Ss(t,i,a,n):t;return(void 0===r||r)&&l?Ts(o,u,e):we(o,e,u)}}}function Es(t){return void 0!==t?0:void 0}function Rs(t){return void 0!==t?t:void 0}function Ps(t){return Math.pow(t,3)}function Is(t){return 1-Ps(1-t)}function Os(t){return 3*t*t-2*t*t*t}function Ls(t){return t}var Ms=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function Fs(t,e){setTimeout((function(){t(e)}),0)}function As(t){return!(t.sourceCenter&&t.targetCenter&&!ir(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}var ks=function(t){function e(e){var r=t.call(this)||this,i=T({},e);return r.hints_=[0,0],r.animations_=[],r.updateAnimationKey_,r.projection_=_r(i.projection,"EPSG:3857"),r.viewportSize_=[100,100],r.targetCenter_=null,r.targetResolution_,r.targetRotation_,r.cancelAnchor_=void 0,i.center&&(i.center=Mr(i.center,r.projection_)),i.extent&&(i.extent=Ar(i.extent,r.projection_)),r.applyOptions_(i),r}return Ms(e,t),e.prototype.applyOptions_=function(t){var e=function(t){var e,r,i,n=void 0!==t.minZoom?t.minZoom:0,o=void 0!==t.maxZoom?t.maxZoom:28,s=void 0!==t.zoomFactor?t.zoomFactor:2,a=void 0!==t.multiWorld&&t.multiWorld,l=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,u=void 0!==t.showFullExtent&&t.showFullExtent,h=_r(t.projection,"EPSG:3857"),c=h.getExtent(),p=t.constrainOnlyCenter,d=t.extent;a||d||!h.isGlobal()||(p=!1,d=c);if(void 0!==t.resolutions){var f=t.resolutions;r=f[n],i=void 0!==f[o]?f[o]:f[f.length-1],e=t.constrainResolution?function(t,e,r,i){return function(n,o,s,a){if(void 0!==n){var l=t[0],u=t[t.length-1],h=r?Ss(l,r,s,i):l;if(a)return void 0===e||e?Ts(n,h,u):we(n,u,h);var c=Math.min(h,n),p=Math.floor(g(t,c,o));return t[p]>h&&p<t.length-1?t[p+1]:t[p]}}}(f,l,!p&&d,u):Cs(r,i,l,!p&&d,u)}else{var y=(c?Math.max(fe(c),he(c)):360*mt[_t.DEGREES]/h.getMetersPerUnit())/256/Math.pow(2,0),m=y/Math.pow(2,28);void 0!==(r=t.maxResolution)?n=0:r=y/Math.pow(s,n),void 0===(i=t.minResolution)&&(i=void 0!==t.maxZoom?void 0!==t.maxResolution?r/Math.pow(s,o):y/Math.pow(s,o):m),o=n+Math.floor(Math.log(r/i)/Math.log(s)),i=r/Math.pow(s,o-n),e=t.constrainResolution?function(t,e,r,i,n,o){return function(s,a,l,u){if(void 0!==s){var h=n?Ss(e,n,l,o):e,c=void 0!==r?r:0;if(u)return void 0===i||i?Ts(s,h,c):we(s,c,h);var p=Math.ceil(Math.log(e/h)/Math.log(t)-1e-9),d=-a*(.5-1e-9)+.5,f=Math.min(h,s),g=Math.floor(Math.log(e/f)/Math.log(t)+d),y=Math.max(p,g);return we(e/Math.pow(t,y),c,h)}}}(s,r,i,l,!p&&d,u):Cs(r,i,l,!p&&d,u)}return{constraint:e,maxResolution:r,minResolution:i,minZoom:n,zoomFactor:s}}(t);this.maxResolution_=e.maxResolution,this.minResolution_=e.minResolution,this.zoomFactor_=e.zoomFactor,this.resolutions_=t.resolutions,this.minZoom_=e.minZoom;var r=function(t){if(void 0!==t.extent){var e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return ws(t.extent,t.constrainOnlyCenter,e)}var r=_r(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&r.isGlobal()){var i=r.getExtent().slice();return i[0]=-1/0,i[2]=1/0,ws(i,!1,!1)}return bs}(t),i=e.constraint,n=function(t){if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?(o=n||Re(5),function(t,e){return e?t:void 0!==t?Math.abs(t)<=o?0:t:void 0}):!1===e?Rs:"number"==typeof e?(r=e,i=2*Math.PI/r,function(t,e){return e?t:void 0!==t?t=Math.floor(t/i+.5)*i:void 0}):Rs}return Es;var r,i;var n,o}(t);this.constraints_={center:r,resolution:i,rotation:n},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom),this.setProperties({}),this.options_=t},e.prototype.getUpdatedOptions_=function(t){var e=T({},this.options_);return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),T({},e,t)},e.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var e=new Array(arguments.length),r=0;r<e.length;++r){var i=arguments[r];i.center&&((i=T({},i)).center=Mr(i.center,this.getProjection())),i.anchor&&((i=T({},i)).anchor=Mr(i.anchor,this.getProjection())),e[r]=i}this.animateInternal.apply(this,e)},e.prototype.animateInternal=function(t){var e,r=arguments.length;if(r>1&&"function"==typeof arguments[r-1]&&(e=arguments[r-1],--r),!this.isDef()){var i=arguments[r-1];return i.center&&this.setCenterInternal(i.center),void 0!==i.zoom&&this.setZoom(i.zoom),void 0!==i.rotation&&this.setRotation(i.rotation),void(e&&Fs(e,!0))}for(var n=Date.now(),o=this.targetCenter_.slice(),s=this.targetResolution_,a=this.targetRotation_,l=[],u=0;u<r;++u){var h=arguments[u],c={start:n,complete:!1,anchor:h.anchor,duration:void 0!==h.duration?h.duration:1e3,easing:h.easing||Os,callback:e};if(h.center&&(c.sourceCenter=o,c.targetCenter=h.center.slice(),o=c.targetCenter),void 0!==h.zoom?(c.sourceResolution=s,c.targetResolution=this.getResolutionForZoom(h.zoom),s=c.targetResolution):h.resolution&&(c.sourceResolution=s,c.targetResolution=h.resolution,s=c.targetResolution),void 0!==h.rotation){c.sourceRotation=a;var p=Pe(h.rotation-a+Math.PI,2*Math.PI)-Math.PI;c.targetRotation=a+p,a=c.targetRotation}As(c)?c.complete=!0:n+=c.duration,l.push(c)}this.animations_.push(l),this.setHint(ys,1),this.updateAnimations_()},e.prototype.getAnimating=function(){return this.hints_[ys]>0},e.prototype.getInteracting=function(){return this.hints_[ms]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(ys,-this.hints_[ys]);for(var e=0,r=this.animations_.length;e<r;++e){var i=this.animations_[e];if(i[0].callback&&Fs(i[0].callback,!1),!t)for(var n=0,o=i.length;n<o;++n){var s=i[n];if(!s.complete){t=s.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t},e.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),e=!1,r=this.animations_.length-1;r>=0;--r){for(var i=this.animations_[r],n=!0,o=0,s=i.length;o<s;++o){var a=i[o];if(!a.complete){var l=t-a.start,u=a.duration>0?l/a.duration:1;u>=1?(a.complete=!0,u=1):n=!1;var h=a.easing(u);if(a.sourceCenter){var c=a.sourceCenter[0],p=a.sourceCenter[1],d=c+h*(a.targetCenter[0]-c),f=p+h*(a.targetCenter[1]-p);this.targetCenter_=[d,f]}if(a.sourceResolution&&a.targetResolution){var g=1===h?a.targetResolution:a.sourceResolution+h*(a.targetResolution-a.sourceResolution);if(a.anchor){var y=this.getViewportSize_(this.getRotation()),m=this.constraints_.resolution(g,0,y,!0);this.targetCenter_=this.calculateCenterZoom(m,a.anchor)}this.targetResolution_=g,this.applyTargetState_(!0)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var _=1===h?Pe(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+h*(a.targetRotation-a.sourceRotation);if(a.anchor){var v=this.constraints_.rotation(_,!0);this.targetCenter_=this.calculateCenterRotate(v,a.anchor)}this.targetRotation_=_}if(this.applyTargetState_(!0),e=!0,!a.complete)break}}if(n){this.animations_[r]=null,this.setHint(ys,-1);var x=i[0].callback;x&&Fs(x,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var r,i=this.getCenterInternal();return void 0!==i&&(nr(r=[i[0]-e[0],i[1]-e[1]],t-this.getRotation()),Qe(r,e)),r},e.prototype.calculateCenterZoom=function(t,e){var r,i=this.getCenterInternal(),n=this.getResolution();void 0!==i&&void 0!==n&&(r=[e[0]-t*(e[0]-i[0])/n,e[1]-t*(e[1]-i[1])/n]);return r},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var r=e[0],i=e[1];return[Math.abs(r*Math.cos(t))+Math.abs(i*Math.sin(t)),Math.abs(r*Math.sin(t))+Math.abs(i*Math.cos(t))]}return e},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?Lr(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(_s)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.options_.constrainResolution},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){return Fr(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSize_(),r=this.getCenterInternal();lt(r,1);var i=this.getResolution();lt(void 0!==i,2);var n=this.getRotation();return lt(void 0!==n,3),ue(r,i,n,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(vs)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(Ar(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var r=e||this.getViewportSize_(),i=fe(t)/r[0],n=he(t)/r[1];return Math.max(i,n)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,r=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,n=Math.log(r/i)/Math.log(e);return function(t){return r/Math.pow(e,t*n)}},e.prototype.getRotation=function(){return this.get(xs)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),r=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,n=Math.log(r/i)/e;return function(t){return Math.log(r/t)/e/n}},e.prototype.getState=function(){var t=this.getCenterInternal(),e=this.getProjection(),r=this.getResolution(),i=this.getRotation();return{center:t.slice(0),projection:void 0!==e?e:null,resolution:r,rotation:i,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,r,i=this.minZoom_||0;if(this.resolutions_){var n=g(this.resolutions_,t,1);i=n,e=this.resolutions_[n],r=n==this.resolutions_.length-1?2:e/this.resolutions_[n+1]}else e=this.maxResolution_,r=this.zoomFactor_;return i+Math.log(e/t)/Math.log(r)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=we(Math.floor(t),0,this.resolutions_.length-2),r=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(r,we(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var r,i=T({size:this.getViewportSize_()},e||{});if(lt(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))lt(!ye(t),25),r=Oi(n=Ar(t,this.getProjection()));else if(t.getType()===gt.CIRCLE){var n;(r=Oi(n=Ar(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),ae(n))}else{var o=Or();r=o?t.clone().transform(o,this.getProjection()):t}this.fitInternal(r,i)},e.prototype.fitInternal=function(t,e){var r=e||{},i=r.size;i||(i=this.getViewportSize_());var n,o=void 0!==r.padding?r.padding:[0,0,0,0],s=void 0!==r.nearest&&r.nearest;n=void 0!==r.minResolution?r.minResolution:void 0!==r.maxZoom?this.getResolutionForZoom(r.maxZoom):0;for(var a=t.getFlatCoordinates(),l=this.getRotation(),u=Math.cos(-l),h=Math.sin(-l),c=1/0,p=1/0,d=-1/0,f=-1/0,g=t.getStride(),y=0,m=a.length;y<m;y+=g){var _=a[y]*u-a[y+1]*h,v=a[y]*h+a[y+1]*u;c=Math.min(c,_),p=Math.min(p,v),d=Math.max(d,_),f=Math.max(f,v)}var x=this.getResolutionForExtentInternal([c,p,d,f],[i[0]-o[1]-o[3],i[1]-o[0]-o[2]]);x=isNaN(x)?n:Math.max(x,n),x=this.getConstrainedResolution(x,s?0:1),h=-h;var w=(c+d)/2,b=(p+f)/2,T=[(w+=(o[1]-o[3])/2*x)*u-(b+=(o[0]-o[2])/2*x)*h,b*u+w*h],C=r.callback?r.callback:S;void 0!==r.duration?this.animateInternal({resolution:x,center:this.getConstrainedCenter(T,x),duration:r.duration,easing:r.easing},C):(this.targetResolution_=x,this.targetCenter_=T,this.applyTargetState_(!1,!0),Fs(C,!0))},e.prototype.centerOn=function(t,e,r){this.centerOnInternal(Mr(t,this.getProjection()),e,r)},e.prototype.centerOnInternal=function(t,e,r){var i=this.getRotation(),n=Math.cos(-i),o=Math.sin(-i),s=t[0]*n-t[1]*o,a=t[1]*n+t[0]*o,l=this.getResolution(),u=(s+=(e[0]/2-r[0])*l)*n-(a+=(r[1]-e[1]/2)*l)*(o=-o),h=a*n+s*o;this.setCenterInternal([u,h])},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=Lr(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustCenterInternal=function(t){var e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustResolution=function(t,e){var r=e&&Mr(e,this.getProjection());this.adjustResolutionInternal(t,r)},e.prototype.adjustResolutionInternal=function(t,e){var r=this.getAnimating()||this.getInteracting(),i=this.getViewportSize_(this.getRotation()),n=this.constraints_.resolution(this.targetResolution_*t,0,i,r);e&&(this.targetCenter_=this.calculateCenterZoom(n,e)),this.targetResolution_*=t,this.applyTargetState_()},e.prototype.adjustZoom=function(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)},e.prototype.adjustRotation=function(t,e){e&&(e=Mr(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var r=this.getAnimating()||this.getInteracting(),i=this.constraints_.rotation(this.targetRotation_+t,r);e&&(this.targetCenter_=this.calculateCenterRotate(i,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(Mr(t,this.getProjection()))},e.prototype.setCenterInternal=function(t){this.targetCenter_=t,this.applyTargetState_()},e.prototype.setHint=function(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]},e.prototype.setResolution=function(t){this.targetResolution_=t,this.applyTargetState_()},e.prototype.setRotation=function(t){this.targetRotation_=t,this.applyTargetState_()},e.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},e.prototype.applyTargetState_=function(t,e){var r=this.getAnimating()||this.getInteracting()||e,i=this.constraints_.rotation(this.targetRotation_,r),n=this.getViewportSize_(i),o=this.constraints_.resolution(this.targetResolution_,0,n,r),s=this.constraints_.center(this.targetCenter_,o,n,r);this.get(xs)!==i&&this.set(xs,i),this.get(vs)!==o&&this.set(vs,o),this.get(_s)&&ir(this.get(_s),s)||this.set(_s,s),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,r){var i=void 0!==t?t:200,n=e||0,o=this.constraints_.rotation(this.targetRotation_),s=this.getViewportSize_(o),a=this.constraints_.resolution(this.targetResolution_,n,s),l=this.constraints_.center(this.targetCenter_,a,s);if(0===i&&!this.cancelAnchor_)return this.targetResolution_=a,this.targetRotation_=o,this.targetCenter_=l,void this.applyTargetState_();var u=r||(0===i?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===a&&this.getRotation()===o&&this.getCenterInternal()&&ir(this.getCenterInternal(),l)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:o,center:l,resolution:a,duration:i,easing:Is,anchor:u}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(ms,1)},e.prototype.endInteraction=function(t,e,r){var i=r&&Mr(r,this.getProjection());this.endInteractionInternal(t,e,i)},e.prototype.endInteractionInternal=function(t,e,r){this.setHint(ms,-1),this.resolveConstraints(t,e,r)},e.prototype.getConstrainedCenter=function(t,e){var r=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),r)},e.prototype.getConstrainedZoom=function(t,e){var r=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(r,e))},e.prototype.getConstrainedResolution=function(t,e){var r=e||0,i=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,r,i)},e}(et);function Ns(t,e,r){return void 0===r&&(r=[0,0]),r[0]=t[0]+2*e,r[1]=t[1]+2*e,r}function js(t,e,r){return void 0===r&&(r=[0,0]),r[0]=t[0]*e+.5|0,r[1]=t[1]*e+.5|0,r}function Ds(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var Gs=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();var zs=function(t){function e(e){var r=t.call(this)||this,i=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var r,i,n,o={},s=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new Yo({layers:t.layers});o[ns]=s,o[ss]=t.target,o[as]=void 0!==t.view?t.view:new ks,void 0!==t.controls&&(Array.isArray(t.controls)?r=new at(t.controls.slice()):(lt("function"==typeof t.controls.getArray,47),r=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?i=new at(t.interactions.slice()):(lt("function"==typeof t.interactions.getArray,48),i=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?n=new at(t.overlays.slice()):(lt("function"==typeof t.overlays.getArray,49),n=t.overlays):n=new at;return{controls:r,interactions:i,keyboardEventTarget:e,overlays:n,values:o}}(e);return r.boundHandleBrowserEvent_=r.handleBrowserEvent.bind(r),r.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,r.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:Nn,r.postRenderTimeoutHandle_,r.animationDelayKey_,r.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(r),r.coordinateToPixelTransform_=[1,0,0,1,0,0],r.pixelToCoordinateTransform_=[1,0,0,1,0,0],r.frameIndex_=0,r.frameState_=null,r.previousExtent_=null,r.viewPropertyListenerKey_=null,r.viewChangeListenerKey_=null,r.layerGroupPropertyListenerKeys_=null,r.viewport_=document.createElement("div"),r.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),r.viewport_.style.position="relative",r.viewport_.style.overflow="hidden",r.viewport_.style.width="100%",r.viewport_.style.height="100%",r.overlayContainer_=document.createElement("div"),r.overlayContainer_.style.position="absolute",r.overlayContainer_.style.zIndex="0",r.overlayContainer_.style.width="100%",r.overlayContainer_.style.height="100%",r.overlayContainer_.style.pointerEvents="none",r.overlayContainer_.className="ol-overlaycontainer",r.viewport_.appendChild(r.overlayContainer_),r.overlayContainerStopEvent_=document.createElement("div"),r.overlayContainerStopEvent_.style.position="absolute",r.overlayContainerStopEvent_.style.zIndex="0",r.overlayContainerStopEvent_.style.width="100%",r.overlayContainerStopEvent_.style.height="100%",r.overlayContainerStopEvent_.style.pointerEvents="none",r.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",r.viewport_.appendChild(r.overlayContainerStopEvent_),r.mapBrowserEventHandler_=null,r.moveTolerance_=e.moveTolerance,r.keyboardEventTarget_=i.keyboardEventTarget,r.keyHandlerKeys_=null,r.controls=i.controls||new at,r.interactions=i.interactions||new at,r.overlays_=i.overlays,r.overlayIdIndex_={},r.renderer_=null,r.handleResize_,r.postRenderFunctions_=[],r.tileQueue_=new gs(r.getTilePriority.bind(r),r.handleTileChange_.bind(r)),r.addEventListener(tt(ns),r.handleLayerGroupChanged_),r.addEventListener(tt(as),r.handleViewChanged_),r.addEventListener(tt(os),r.handleSizeChanged_),r.addEventListener(tt(ss),r.handleTargetChanged_),r.setProperties(i.values),r.controls.forEach(function(t){t.setMap(this)}.bind(r)),r.controls.addEventListener(rt,function(t){t.element.setMap(this)}.bind(r)),r.controls.addEventListener(it,function(t){t.element.setMap(null)}.bind(r)),r.interactions.forEach(function(t){t.setMap(this)}.bind(r)),r.interactions.addEventListener(rt,function(t){t.element.setMap(this)}.bind(r)),r.interactions.addEventListener(it,function(t){t.element.setMap(null)}.bind(r)),r.overlays_.forEach(r.addOverlayInternal_.bind(r)),r.overlays_.addEventListener(rt,function(t){this.addOverlayInternal_(t.element)}.bind(r)),r.overlays_.addEventListener(it,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(r)),r}return Gs(e,t),e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},e.prototype.addControl=function(t){this.getControls().push(t)},e.prototype.addInteraction=function(t){this.getInteractions().push(t)},e.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},e.prototype.addOverlay=function(t){this.getOverlays().push(t)},e.prototype.addOverlayInternal_=function(t){var e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},e.prototype.disposeInternal=function(){this.setTarget(null),t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,e,r){if(this.frameState_){var i=this.getCoordinateFromPixelInternal(t),n=void 0!==(r=void 0!==r?r:{}).hitTolerance?r.hitTolerance*this.frameState_.pixelRatio:0,o=void 0!==r.layerFilter?r.layerFilter:w,s=!1!==r.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(i,this.frameState_,n,s,e,null,o,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var r=[];return this.forEachFeatureAtPixel(t,(function(t){r.push(t)}),e),r},e.prototype.forEachLayerAtPixel=function(t,e,r){if(this.frameState_){var i=r||{},n=void 0!==i.hitTolerance?i.hitTolerance*this.frameState_.pixelRatio:0,o=i.layerFilter||w;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,n,e,o)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var r=this.getCoordinateFromPixelInternal(t),i=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:w,n=void 0!==e.hitTolerance?e.hitTolerance*this.frameState_.pixelRatio:0,o=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(r,this.frameState_,n,o,i,null)},e.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},e.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},e.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),r="changedTouches"in t?t.changedTouches[0]:t;return[r.clientX-e.left,r.clientY-e.top]},e.prototype.getTarget=function(){return this.get(ss)},e.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},e.prototype.getCoordinateFromPixel=function(t){return Lr(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?St(e.pixelToCoordinateTransform,t.slice()):null},e.prototype.getControls=function(){return this.controls},e.prototype.getOverlays=function(){return this.overlays_},e.prototype.getOverlayById=function(t){var e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getInteractions=function(){return this.interactions},e.prototype.getLayerGroup=function(){return this.get(ns)},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoading=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,r=t.length;e<r;++e){var i=t[e].layer.getSource();if(i&&i.loading)return!0}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=Mr(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},e.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?St(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(os)},e.prototype.getView=function(){return this.get(as)},e.prototype.getViewport=function(){return this.viewport_},e.prototype.getOverlayContainer=function(){return this.overlayContainer_},e.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},e.prototype.getTilePriority=function(t,e,r,i){return function(t,e,r,i,n){if(!(t&&r in t.wantedTiles))return 1/0;if(!t.wantedTiles[r][e.getKey()])return 1/0;var o=t.viewState.center,s=i[0]-o[0],a=i[1]-o[1];return 65536*Math.log(n)+Math.sqrt(s*s+a*a)/n}(this.frameState_,t,e,r,i)},e.prototype.handleBrowserEvent=function(t,e){var r=e||t.type,i=new qo(r,this,t);this.handleMapBrowserEvent(i)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,r=e.type;if(r===Ho||r===Y||r===D){var i=this.viewport_.getRootNode?this.viewport_.getRootNode():document,n=i===document?e.target:i.elementFromPoint(e.clientX,e.clientY);if(!i.contains(n)||this.overlayContainerStopEvent_.contains(n))return}t.frameState=this.frameState_;var o=this.getInteractions().getArray();if(!1!==this.dispatchEvent(t))for(var s=o.length-1;s>=0;s--){var a=o[s];if(a.getActive())if(!a.handleEvent(t))break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var r=this.maxTilesLoading_,i=r;if(t){var n=t.viewHints;if(n[ys]||n[ms]){var o=!Dn&&Date.now()-t.time>8;r=o?0:8,i=o?0:2}}e.getTilesLoading()<r&&(e.reprioritize(),e.loadMoreTiles(r,i))}!t||!this.hasListener(bn)||t.animate||this.tileQueue_.getTilesLoading()||this.getLoading()||this.renderer_.dispatchRenderEvent(bn,t);for(var s=this.postRenderFunctions_,a=0,l=s.length;a<l;++a)s[a](this,t);s.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(t){var e;if(this.getTarget()&&(e=this.getTargetElement()),t.oldValue){for(var r=0,i=this.keyHandlerKeys_.length;r<i;++r)X(this.keyHandlerKeys_[r]);this.keyHandlerKeys_=null,this.viewport_.removeEventListener(M,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(Y,this.boundHandleBrowserEvent_),void 0!==this.handleResize_&&(removeEventListener(B,this.handleResize_,!1),this.handleResize_=void 0),this.mapBrowserEventHandler_.dispose(),Wn(this.viewport_)}if(e){for(var n in e.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new ts(this,this.moveTolerance_),Zo)this.mapBrowserEventHandler_.addEventListener(Zo[n],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(M,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(Y,this.boundHandleBrowserEvent_,!!Gn&&{passive:!1});var o=this.keyboardEventTarget_?this.keyboardEventTarget_:e;this.keyHandlerKeys_=[W(o,D,this.handleBrowserEvent,this),W(o,G,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),window.addEventListener(B,this.handleResize_,!1))}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);this.updateSize()},e.prototype.handleTileChange_=function(){this.render()},e.prototype.handleViewPropertyChanged_=function(){this.render()},e.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(X(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(X(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=W(t,c,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=W(t,O,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(X),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.layerGroupPropertyListenerKeys_=[W(t,c,this.render,this),W(t,O,this.render,this)]),this.render()},e.prototype.isRendered=function(){return!!this.frameState_},e.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},e.prototype.redrawText=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,r=t.length;e<r;++e){var i=t[e].layer;i.hasRenderer()&&i.getRenderer().handleFontsChanged()}},e.prototype.render=function(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},e.prototype.removeControl=function(t){return this.getControls().remove(t)},e.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},e.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},e.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var e=this.getSize(),r=this.getView(),i=this.frameState_,n=null;if(void 0!==e&&function(t){return t[0]>0&&t[1]>0}(e)&&r&&r.isDef()){var o=r.getHints(this.frameState_?this.frameState_.viewHints:void 0),s=r.getState();n={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterItems:i?i.declutterItems:[],extent:ue(s.center,s.resolution,s.rotation,e),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:e,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:s,viewHints:o,wantedTiles:{}}}if(this.frameState_=n,this.renderer_.renderFrame(n),n){if(n.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,n.postRenderFunctions),i)(!this.previousExtent_||!ye(this.previousExtent_)&&!Jt(n.extent,this.previousExtent_))&&(this.dispatchEvent(new Vo(rs,this,i)),this.previousExtent_=Zt(this.previousExtent_));this.previousExtent_&&!n.viewHints[ys]&&!n.viewHints[ms]&&!Jt(n.extent,this.previousExtent_)&&(this.dispatchEvent(new Vo(is,this,n)),zt(n.extent,this.previousExtent_))}this.dispatchEvent(new Vo(es,this,n)),this.postRenderTimeoutHandle_=setTimeout(this.handlePostRender.bind(this),0)},e.prototype.setLayerGroup=function(t){this.set(ns,t)},e.prototype.setSize=function(t){this.set(os,t)},e.prototype.setTarget=function(t){this.set(ss,t)},e.prototype.setView=function(t){this.set(as,t)},e.prototype.updateSize=function(){var t=this.getTargetElement();if(t){var e=getComputedStyle(t);this.setSize([t.offsetWidth-parseFloat(e.borderLeftWidth)-parseFloat(e.paddingLeft)-parseFloat(e.paddingRight)-parseFloat(e.borderRightWidth),t.offsetHeight-parseFloat(e.borderTopWidth)-parseFloat(e.paddingTop)-parseFloat(e.paddingBottom)-parseFloat(e.borderBottomWidth)])}else this.setSize(void 0);this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var e=void 0,r=getComputedStyle(this.viewport_);r.width&&r.height&&(e=[parseInt(r.width,10),parseInt(r.height,10)]),t.setViewportSize(e)}},e}(et),Bs=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Us=function(t){function e(e){var r=t.call(this)||this,i=e.element;return!i||e.target||i.style.pointerEvents||(i.style.pointerEvents="auto"),r.element=i||null,r.target_=null,r.map_=null,r.listenerKeys=[],e.render&&(r.render=e.render),e.target&&r.setTarget(e.target),r}return Bs(e,t),e.prototype.disposeInternal=function(){Wn(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&Wn(this.element);for(var e=0,r=this.listenerKeys.length;e<r;++e)X(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,this.map_)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==S&&this.listenerKeys.push(W(t,es,this.render,this)),t.render())},e.prototype.render=function(t){},e.prototype.setTarget=function(t){this.target_="string"==typeof t?document.getElementById(t):t},e}(et),Ys=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ws=function(t){function e(e){var r=this,i=e||{};(r=t.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this).ulElement_=document.createElement("ul"),r.collapsed_=void 0===i.collapsed||i.collapsed,r.overrideCollapsible_=void 0!==i.collapsible,r.collapsible_=void 0===i.collapsible||i.collapsible,r.collapsible_||(r.collapsed_=!1);var n=void 0!==i.className?i.className:"ol-attribution",o=void 0!==i.tipLabel?i.tipLabel:"Attributions",s=void 0!==i.collapseLabel?i.collapseLabel:"»";"string"==typeof s?(r.collapseLabel_=document.createElement("span"),r.collapseLabel_.textContent=s):r.collapseLabel_=s;var a=void 0!==i.label?i.label:"i";"string"==typeof a?(r.label_=document.createElement("span"),r.label_.textContent=a):r.label_=a;var l=r.collapsible_&&!r.collapsed_?r.collapseLabel_:r.label_,u=document.createElement("button");u.setAttribute("type","button"),u.title=o,u.appendChild(l),u.addEventListener(F,r.handleClick_.bind(r),!1);var h=n+" ol-unselectable ol-control"+(r.collapsed_&&r.collapsible_?" ol-collapsed":"")+(r.collapsible_?"":" ol-uncollapsible"),c=r.element;return c.className=h,c.appendChild(r.ulElement_),c.appendChild(u),r.renderedAttributions_=[],r.renderedVisible_=!0,r}return Ys(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},r=[],i=t.layerStatesArray,n=0,o=i.length;n<o;++n){var s=i[n];if(Pn(s,t.viewState)){var a=s.layer.getSource();if(a){var l=a.getAttributions();if(l){var u=l(t);if(u)if(this.overrideCollapsible_||!1!==a.getAttributionsCollapsible()||this.setCollapsible(!1),Array.isArray(u))for(var h=0,c=u.length;h<c;++h)u[h]in e||(r.push(u[h]),e[u[h]]=!0);else u in e||(r.push(u),e[u]=!0)}}}}return r},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),r=e.length>0;if(this.renderedVisible_!=r&&(this.element.style.display=r?"":"none",this.renderedVisible_=r),!v(e,this.renderedAttributions_)){Vn(this.ulElement_);for(var i=0,n=e.length;i<n;++i){var o=document.createElement("li");o.innerHTML=e[i],this.ulElement_.appendChild(o)}this.renderedAttributions_=e}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_()},e.prototype.handleToggle_=function(){this.element.classList.toggle("ol-collapsed"),this.collapsed_?Yn(this.collapseLabel_,this.label_):Yn(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.render=function(t){this.updateElement_(t.frameState)},e}(Us),Vs=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Xs=function(t){function e(e){var r=this,i=e||{};r=t.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this;var n=void 0!==i.className?i.className:"ol-rotate",o=void 0!==i.label?i.label:"⇧";r.label_=null,"string"==typeof o?(r.label_=document.createElement("span"),r.label_.className="ol-compass",r.label_.textContent=o):(r.label_=o,r.label_.classList.add("ol-compass"));var s=i.tipLabel?i.tipLabel:"Reset rotation",a=document.createElement("button");a.className=n+"-reset",a.setAttribute("type","button"),a.title=s,a.appendChild(r.label_),a.addEventListener(F,r.handleClick_.bind(r),!1);var l=n+" ol-unselectable ol-control",u=r.element;return u.className=l,u.appendChild(a),r.callResetNorth_=i.resetNorth?i.resetNorth:void 0,r.duration_=void 0!==i.duration?i.duration:250,r.autoHide_=void 0===i.autoHide||i.autoHide,r.rotation_=void 0,r.autoHide_&&r.element.classList.add("ol-hidden"),r}return Vs(e,t),e.prototype.handleClick_=function(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},e.prototype.resetNorth_=function(){var t=this.getMap().getView();if(t){var e=t.getRotation();void 0!==e&&(this.duration_>0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:Is}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var r=e.viewState.rotation;if(r!=this.rotation_){var i="rotate("+r+"rad)";if(this.autoHide_){var n=this.element.classList.contains("ol-hidden");n||0!==r?n&&0!==r&&this.element.classList.remove("ol-hidden"):this.element.classList.add("ol-hidden")}this.label_.style.transform=i}this.rotation_=r}},e}(Us),qs=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Zs=function(t){function e(e){var r=this,i=e||{};r=t.call(this,{element:document.createElement("div"),target:i.target})||this;var n=void 0!==i.className?i.className:"ol-zoom",o=void 0!==i.delta?i.delta:1,s=void 0!==i.zoomInLabel?i.zoomInLabel:"+",a=void 0!==i.zoomOutLabel?i.zoomOutLabel:"−",l=void 0!==i.zoomInTipLabel?i.zoomInTipLabel:"Zoom in",u=void 0!==i.zoomOutTipLabel?i.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=n+"-in",h.setAttribute("type","button"),h.title=l,h.appendChild("string"==typeof s?document.createTextNode(s):s),h.addEventListener(F,r.handleClick_.bind(r,o),!1);var c=document.createElement("button");c.className=n+"-out",c.setAttribute("type","button"),c.title=u,c.appendChild("string"==typeof a?document.createTextNode(a):a),c.addEventListener(F,r.handleClick_.bind(r,-o),!1);var p=n+" ol-unselectable ol-control",d=r.element;return d.className=p,d.appendChild(h),d.appendChild(c),r.duration_=void 0!==i.duration?i.duration:250,r}return qs(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var r=e.getZoom();if(void 0!==r){var i=e.getConstrainedZoom(r+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:i,duration:this.duration_,easing:Is})):e.setZoom(i)}}},e}(Us);function Ks(t){var e=t||{},r=new at;return(void 0===e.zoom||e.zoom)&&r.push(new Zs(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&r.push(new Xs(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&r.push(new Ws(e.attributionOptions)),r}var Hs="active",Js=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function $s(t,e,r,i){var n=t.getZoom();if(void 0!==n){var o=t.getConstrainedZoom(n+e),s=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:r,duration:void 0!==i?i:250,easing:Is})}}var Qs=function(t){function e(e){var r=t.call(this)||this;return e&&e.handleEvent&&(r.handleEvent=e.handleEvent),r.map_=null,r.setActive(!0),r}return Js(e,t),e.prototype.getActive=function(){return this.get(Hs)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(Hs,t)},e.prototype.setMap=function(t){this.map_=t},e}(et),ta=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),ea=function(t){function e(e){var r=t.call(this)||this,i=e||{};return r.delta_=i.delta?i.delta:1,r.duration_=void 0!==i.duration?i.duration:250,r}return ta(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Zo.DBLCLICK){var r=t.originalEvent,i=t.map,n=t.coordinate,o=r.shiftKey?-this.delta_:this.delta_;$s(i.getView(),o,n,this.duration_),t.preventDefault(),e=!0}return!e},e}(Qs),ra=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function ia(t){for(var e=t.length,r=0,i=0,n=0;n<e;n++)r+=t[n].clientX,i+=t[n].clientY;return[r/e,i/e]}var na=function(t){function e(e){var r=this,i=e||{};return r=t.call(this,i)||this,i.handleDownEvent&&(r.handleDownEvent=i.handleDownEvent),i.handleDragEvent&&(r.handleDragEvent=i.handleDragEvent),i.handleMoveEvent&&(r.handleMoveEvent=i.handleMoveEvent),i.handleUpEvent&&(r.handleUpEvent=i.handleUpEvent),i.stopDown&&(r.stopDown=i.stopDown),r.handlingDownUpSequence=!1,r.trackedPointers_={},r.targetPointers=[],r}return ra(e,t),e.prototype.getPointerCount=function(){return this.targetPointers.length},e.prototype.handleDownEvent=function(t){return!1},e.prototype.handleDragEvent=function(t){},e.prototype.handleEvent=function(t){if(!t.originalEvent)return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==Zo.POINTERDRAG)this.handleDragEvent(t),t.preventDefault();else if(t.type==Zo.POINTERUP){var r=this.handleUpEvent(t);this.handlingDownUpSequence=r&&this.targetPointers.length>0}}else if(t.type==Zo.POINTERDOWN){var i=this.handleDownEvent(t);this.handlingDownUpSequence=i,e=this.stopDown(i)}else t.type==Zo.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===Zo.POINTERDOWN||e===Zo.POINTERDRAG||e===Zo.POINTERUP}(t)){var e=t.originalEvent,r=e.pointerId.toString();t.type==Zo.POINTERUP?delete this.trackedPointers_[r]:(t.type==Zo.POINTERDOWN||r in this.trackedPointers_)&&(this.trackedPointers_[r]=e),this.targetPointers=E(this.trackedPointers_)}},e}(Qs);function oa(t){var e=arguments;return function(t){for(var r=!0,i=0,n=e.length;i<n&&(r=r&&e[i](t));++i);return r}}var sa=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},aa=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},la=function(t){return t.target.getTargetElement().contains(document.activeElement)},ua=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||la(t)},ha=w,ca=function(t){var e=t.originalEvent;return 0==e.button&&!(An&&kn&&e.ctrlKey)},pa=b,da=function(t){return t.type==Zo.SINGLECLICK},fa=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},ga=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},ya=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},ma=function(t){var e=t.originalEvent;return lt(void 0!==e,56),"mouse"==e.pointerType},_a=function(t){var e=t.originalEvent;return lt(void 0!==e,56),e.isPrimary&&0===e.button},va=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),xa=function(t){function e(e){var r=t.call(this,{stopDown:b})||this,i=e||{};r.kinetic_=i.kinetic,r.lastCentroid=null,r.lastPointersCount_,r.panning_=!1;var n=i.condition?i.condition:oa(fa,_a);return r.condition_=i.onFocusOnly?oa(ua,n):n,r.noKinetic_=!1,r}return va(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e=this.targetPointers,r=ia(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(r[0],r[1]),this.lastCentroid){var i=[this.lastCentroid[0]-r[0],r[1]-this.lastCentroid[1]],n=t.map.getView();or(i,n.getResolution()),nr(i,n.getRotation()),n.adjustCenterInternal(i)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=r,this.lastPointersCount_=e.length,t.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(t){var e=t.map,r=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var i=this.kinetic_.getDistance(),n=this.kinetic_.getAngle(),o=r.getCenterInternal(),s=e.getPixelFromCoordinateInternal(o),a=e.getCoordinateFromPixelInternal([s[0]-i*Math.cos(n),s[1]-i*Math.sin(n)]);r.animateInternal({center:r.getConstrainedCenter(a),duration:500,easing:Is})}return this.panning_&&(this.panning_=!1,r.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(na),wa=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),ba=function(t){function e(e){var r=this,i=e||{};return(r=t.call(this,{stopDown:b})||this).condition_=i.condition?i.condition:aa,r.lastAngle_=void 0,r.duration_=void 0!==i.duration?i.duration:250,r}return wa(e,t),e.prototype.handleDragEvent=function(t){if(ma(t)){var e=t.map,r=e.getView();if(r.getConstraints().rotation!==Es){var i=e.getSize(),n=t.pixel,o=Math.atan2(i[1]/2-n[1],n[0]-i[0]/2);if(void 0!==this.lastAngle_){var s=o-this.lastAngle_;r.adjustRotationInternal(-s)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){return!ma(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!ma(t)&&(!(!ca(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(na),Sa=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ta=function(t){function e(e){var r=t.call(this)||this;return r.geometry_=null,r.element_=document.createElement("div"),r.element_.style.position="absolute",r.element_.style.pointerEvents="auto",r.element_.className="ol-box "+e,r.map_=null,r.startPixel_=null,r.endPixel_=null,r}return Sa(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,r=this.element_.style;r.left=Math.min(t[0],e[0])+"px",r.top=Math.min(t[1],e[1])+"px",r.width=Math.abs(e[0]-t[0])+"px",r.height=Math.abs(e[1]-t[1])+"px"},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,r=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);r[4]=r[0].slice(),this.geometry_?this.geometry_.setCoordinates([r]):this.geometry_=new Pi([r])},e.prototype.getGeometry=function(){return this.geometry_},e}(p),Ca=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ea="boxstart",Ra="boxdrag",Pa="boxend",Ia=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.coordinate=r,n.mapBrowserEvent=i,n}return Ca(e,t),e}(h),Oa=function(t){function e(e){var r=t.call(this)||this,i=e||{};return r.box_=new Ta(i.className||"ol-dragbox"),r.minArea_=void 0!==i.minArea?i.minArea:64,i.onBoxEnd&&(r.onBoxEnd=i.onBoxEnd),r.startPixel_=null,r.condition_=i.condition?i.condition:ca,r.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:r.defaultBoxEndCondition,r}return Ca(e,t),e.prototype.defaultBoxEndCondition=function(t,e,r){var i=r[0]-e[0],n=r[1]-e[1];return i*i+n*n>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Ia(Ra,t.coordinate,t))},e.prototype.handleUpEvent=function(t){return this.box_.setMap(null),this.boxEndCondition_(t,this.startPixel_,t.pixel)&&(this.onBoxEnd(t),this.dispatchEvent(new Ia(Pa,t.coordinate,t))),!1},e.prototype.handleDownEvent=function(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Ia(Ea,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(na),La=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ma=function(t){function e(e){var r=this,i=e||{},n=i.condition?i.condition:ga;return(r=t.call(this,{condition:n,className:i.className||"ol-dragzoom",minArea:i.minArea})||this).duration_=void 0!==i.duration?i.duration:200,r.out_=void 0!==i.out&&i.out,r}return La(e,t),e.prototype.onBoxEnd=function(t){var e,r,i=this.getMap(),n=i.getView(),o=i.getSize(),s=this.getGeometry().getExtent();if(this.out_){var a=n.calculateExtentInternal(o),l=(e=[i.getPixelFromCoordinateInternal(oe(s)),i.getPixelFromCoordinateInternal(de(s))],te(Zt(r),e));me(a,1/n.getResolutionForExtentInternal(l,o)),s=a}var u=n.getConstrainedResolution(n.getResolutionForExtentInternal(s,o)),h=n.getConstrainedCenter(ae(s),u);n.animateInternal({resolution:u,center:h,duration:this.duration_,easing:Is})},e}(Oa),Fa=37,Aa=38,ka=39,Na=40,ja=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Da=function(t){function e(e){var r=t.call(this)||this,i=e||{};return r.defaultCondition_=function(t){return fa(t)&&ya(t)},r.condition_=void 0!==i.condition?i.condition:r.defaultCondition_,r.duration_=void 0!==i.duration?i.duration:100,r.pixelDelta_=void 0!==i.pixelDelta?i.pixelDelta:128,r}return ja(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==D){var r=t.originalEvent.keyCode;if(this.condition_(t)&&(r==Na||r==Fa||r==ka||r==Aa)){var i=t.map.getView(),n=i.getResolution()*this.pixelDelta_,o=0,s=0;r==Na?s=-n:r==Fa?o=-n:r==ka?o=n:s=n;var a=[o,s];nr(a,i.getRotation()),function(t,e,r){var i=t.getCenterInternal();if(i){var n=[i[0]+e[0],i[1]+e[1]];t.animateInternal({duration:void 0!==r?r:250,easing:Ls,center:t.getConstrainedCenter(n)})}}(i,a,this.duration_),t.preventDefault(),e=!0}}return!e},e}(Qs),Ga=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),za=function(t){function e(e){var r=t.call(this)||this,i=e||{};return r.condition_=i.condition?i.condition:ya,r.delta_=i.delta?i.delta:1,r.duration_=void 0!==i.duration?i.duration:100,r}return Ga(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==D||t.type==G){var r=t.originalEvent.charCode;if(this.condition_(t)&&(r=="+".charCodeAt(0)||r=="-".charCodeAt(0))){var i=t.map,n=r=="+".charCodeAt(0)?this.delta_:-this.delta_;$s(i.getView(),n,void 0,this.duration_),t.preventDefault(),e=!0}}return!e},e}(Qs),Ba=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ua="trackpad",Ya="wheel",Wa=function(t){function e(e){var r=this,i=e||{};(r=t.call(this,i)||this).totalDelta_=0,r.lastDelta_=0,r.maxDelta_=void 0!==i.maxDelta?i.maxDelta:1,r.duration_=void 0!==i.duration?i.duration:250,r.timeout_=void 0!==i.timeout?i.timeout:80,r.useAnchor_=void 0===i.useAnchor||i.useAnchor,r.constrainResolution_=void 0!==i.constrainResolution&&i.constrainResolution;var n=i.condition?i.condition:ha;return r.condition_=i.onFocusOnly?oa(ua,n):n,r.lastAnchor_=null,r.startTime_=void 0,r.timeoutId_,r.mode_=void 0,r.trackpadEventGap_=400,r.trackpadTimeoutId_,r.deltaPerZoom_=300,r}return Ba(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==Y)return!0;t.preventDefault();var e,r=t.map,i=t.originalEvent;if(this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==Y&&(e=i.deltaY,Fn&&i.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=Nn),i.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var n=Date.now();void 0===this.startTime_&&(this.startTime_=n),(!this.mode_||n-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?Ua:Ya);var o=r.getView();if(this.mode_===Ua&&!o.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),o.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=n,!1;this.totalDelta_+=e;var s=Math.max(this.timeout_-(n-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,r),s),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var r=-we(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(r=r?r>0?1:-1:0),$s(e,r,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(Qs),Va=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Xa=function(t){function e(e){var r=this,i=e||{},n=i;return n.stopDown||(n.stopDown=b),(r=t.call(this,n)||this).anchor_=null,r.lastAngle_=void 0,r.rotating_=!1,r.rotationDelta_=0,r.threshold_=void 0!==i.threshold?i.threshold:.3,r.duration_=void 0!==i.duration?i.duration:250,r}return Va(e,t),e.prototype.handleDragEvent=function(t){var e=0,r=this.targetPointers[0],i=this.targetPointers[1],n=Math.atan2(i.clientY-r.clientY,i.clientX-r.clientX);if(void 0!==this.lastAngle_){var o=n-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=o}this.lastAngle_=n;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==Es){var l=s.getViewport().getBoundingClientRect(),u=ia(this.targetPointers);u[0]-=l.left,u[1]-=l.top,this.anchor_=s.getCoordinateFromPixelInternal(u),this.rotating_&&(s.render(),a.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(na),qa=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Za=function(t){function e(e){var r=this,i=e||{},n=i;return n.stopDown||(n.stopDown=b),(r=t.call(this,n)||this).anchor_=null,r.duration_=void 0!==i.duration?i.duration:400,r.lastDistance_=void 0,r.lastScaleDelta_=1,r}return qa(e,t),e.prototype.handleDragEvent=function(t){var e=1,r=this.targetPointers[0],i=this.targetPointers[1],n=r.clientX-i.clientX,o=r.clientY-i.clientY,s=Math.sqrt(n*n+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/s),this.lastDistance_=s;var a=t.map,l=a.getView();1!=e&&(this.lastScaleDelta_=e);var u=a.getViewport().getBoundingClientRect(),h=ia(this.targetPointers);h[0]-=u.left,h[1]-=u.top,this.anchor_=a.getCoordinateFromPixelInternal(h),a.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),r=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,r),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(na);function Ka(t){var e=t||{},r=new at,i=new Xi(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&r.push(new ba),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&r.push(new ea({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&r.push(new xa({onFocusOnly:e.onFocusOnly,kinetic:i})),(void 0===e.pinchRotate||e.pinchRotate)&&r.push(new Xa),(void 0===e.pinchZoom||e.pinchZoom)&&r.push(new Za({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(r.push(new Da),r.push(new za({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&r.push(new Wa({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&r.push(new Ma({duration:e.zoomDuration})),r}var Ha=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ja=function(t){function e(e){return(e=T({},e)).controls||(e.controls=Ks()),e.interactions||(e.interactions=Ka({onFocusOnly:!0})),t.call(this,e)||this}return Ha(e,t),e.prototype.createRenderer=function(){return new zo(this)},e}(zs),$a="bottom-left",Qa="bottom-center",tl="bottom-right",el="center-left",rl="center-center",il="center-right",nl="top-left",ol="top-center",sl="top-right",al=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),ll="element",ul="map",hl="offset",cl="position",pl="positioning",dl=function(t){function e(e){var r=t.call(this)||this;r.options=e,r.id=e.id,r.insertFirst=void 0===e.insertFirst||e.insertFirst,r.stopEvent=void 0===e.stopEvent||e.stopEvent,r.element=document.createElement("div"),r.element.className=void 0!==e.className?e.className:"ol-overlay-container ol-selectable",r.element.style.position="absolute",r.element.style.pointerEvents="auto";var i=e.autoPan;return i&&"object"!=typeof i&&(i={animation:e.autoPanAnimation,margin:e.autoPanMargin}),r.autoPan=i||!1,r.rendered={transform_:"",visible:!0},r.mapPostrenderListenerKey=null,r.addEventListener(tt(ll),r.handleElementChanged),r.addEventListener(tt(ul),r.handleMapChanged),r.addEventListener(tt(hl),r.handleOffsetChanged),r.addEventListener(tt(cl),r.handlePositionChanged),r.addEventListener(tt(pl),r.handlePositioningChanged),void 0!==e.element&&r.setElement(e.element),r.setOffset(void 0!==e.offset?e.offset:[0,0]),r.setPositioning(void 0!==e.positioning?e.positioning:nl),void 0!==e.position&&r.setPosition(e.position),r}return al(e,t),e.prototype.getElement=function(){return this.get(ll)},e.prototype.getId=function(){return this.id},e.prototype.getMap=function(){return this.get(ul)},e.prototype.getOffset=function(){return this.get(hl)},e.prototype.getPosition=function(){return this.get(cl)},e.prototype.getPositioning=function(){return this.get(pl)},e.prototype.handleElementChanged=function(){Vn(this.element);var t=this.getElement();t&&this.element.appendChild(t)},e.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(Wn(this.element),X(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=W(t,es,this.render,this),this.updatePixelPosition();var e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}},e.prototype.render=function(){this.updatePixelPosition()},e.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},e.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.performAutoPan()},e.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},e.prototype.setElement=function(t){this.set(ll,t)},e.prototype.setMap=function(t){this.set(ul,t)},e.prototype.setOffset=function(t){this.set(hl,t)},e.prototype.setPosition=function(t){this.set(cl,t)},e.prototype.performAutoPan=function(){this.autoPan&&this.panIntoView(this.autoPan)},e.prototype.panIntoView=function(t){var e=this.getMap();if(e&&e.getTargetElement()&&this.get(cl)){var r=this.getRect(e.getTargetElement(),e.getSize()),i=this.getElement(),n=this.getRect(i,[Bn(i),Un(i)]),o=t||{},s=void 0===o.margin?20:o.margin;if(!Yt(r,n)){var a=n[0]-r[0],l=r[2]-n[2],u=n[1]-r[1],h=r[3]-n[3],c=[0,0];if(a<0?c[0]=a-s:l<0&&(c[0]=Math.abs(l)+s),u<0?c[1]=u-s:h<0&&(c[1]=Math.abs(h)+s),0!==c[0]||0!==c[1]){var p=e.getView().getCenterInternal(),d=e.getPixelFromCoordinateInternal(p),f=[d[0]+c[0],d[1]+c[1]],g=o.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(f),duration:g.duration,easing:g.easing})}}}},e.prototype.getRect=function(t,e){var r=t.getBoundingClientRect(),i=r.left+window.pageXOffset,n=r.top+window.pageYOffset;return[i,n,i+e[0],n+e[1]]},e.prototype.setPositioning=function(t){this.set(pl,t)},e.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},e.prototype.updatePixelPosition=function(){var t=this.getMap(),e=this.getPosition();if(t&&t.isRendered()&&e){var r=t.getPixelFromCoordinate(e),i=t.getSize();this.updateRenderedPosition(r,i)}else this.setVisible(!1)},e.prototype.updateRenderedPosition=function(t,e){var r=this.element.style,i=this.getOffset(),n=this.getPositioning();this.setVisible(!0);var o=Math.round(t[0]+i[0])+"px",s=Math.round(t[1]+i[1])+"px",a="0%",l="0%";n==tl||n==il||n==sl?a="-100%":n!=Qa&&n!=rl&&n!=ol||(a="-50%"),n==$a||n==Qa||n==tl?l="-100%":n!=el&&n!=rl&&n!=il||(l="-50%");var u="translate("+a+", "+l+") translate("+o+", "+s+")";this.rendered.transform_!=u&&(this.rendered.transform_=u,r.transform=u,r.msTransform=u)},e.prototype.getOptions=function(){return this.options},e}(et),fl="arraybuffer",gl="json",yl="text",ml="xml",_l=!1;function vl(t,e,r,i){return function(n,o,s){var a=new XMLHttpRequest;a.open("GET","function"==typeof t?t(n,o,s):t,!0),e.getType()==fl&&(a.responseType="arraybuffer"),a.withCredentials=_l,a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){var o=e.getType(),l=void 0;o==gl||o==yl?l=a.responseText:o==ml?(l=a.responseXML)||(l=(new DOMParser).parseFromString(a.responseText,"application/xml")):o==fl&&(l=a.response),l?r.call(this,e.readFeatures(l,{extent:n,featureProjection:s}),e.readProjection(l)):i.call(this)}else i.call(this)}.bind(this),a.onerror=function(){i.call(this)}.bind(this),a.send()}}function xl(t,e){return vl(t,e,(function(t,e){"function"==typeof this.addFeatures&&this.addFeatures(t)}),S)}function wl(t,e){return[[-1/0,-1/0,1/0,1/0]]}var bl=function(){function t(t,e,r,i){this.minX=t,this.maxX=e,this.minY=r,this.maxY=i}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function Sl(t,e,r,i,n){return void 0!==n?(n.minX=t,n.maxX=e,n.minY=r,n.maxY=i,n):new bl(t,e,r,i)}var Tl=bl;function Cl(t,e,r,i){return void 0!==i?(i[0]=t,i[1]=e,i[2]=r,i):[t,e,r]}function El(t,e,r){return t+"/"+e+"/"+r}function Rl(t){return El(t[0],t[1],t[2])}function Pl(t){return t.split("/").map(Number)}function Il(t){return(t[1]<<t[0])+t[2]}var Ol=[0,0,0],Ll=function(){function t(t){var e,r,i,n;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,lt((e=this.resolutions_,r=!0,i=function(t,e){return e-t}||d,e.every((function(t,n){if(0===n)return!0;var o=i(e[n-1],t);return!(o>0||r&&0===o)}))),17),!t.origins)for(var o=0,s=this.resolutions_.length-1;o<s;++o)if(n){if(this.resolutions_[o]/this.resolutions_[o+1]!==n){n=void 0;break}}else n=this.resolutions_[o]/this.resolutions_[o+1];this.zoomFactor_=n,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,lt(this.origins_.length==this.resolutions_.length,20));var a=t.extent;void 0===a||this.origin_||this.origins_||(this.origin_=pe(a)),lt(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,lt(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:256,lt(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==a?a:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((function(t,e){return new Tl(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1))}),this):a&&this.calculateTileRanges_(a)}return t.prototype.forEachTileCoord=function(t,e,r){for(var i=this.getTileRangeForExtentAndZ(t,e),n=i.minX,o=i.maxX;n<=o;++n)for(var s=i.minY,a=i.maxY;s<=a;++s)r([e,n,s])},t.prototype.forEachTileCoordParentTileRange=function(t,e,r,i){var n,o,s=null,a=t[0]-1;for(2===this.zoomFactor_?(n=t[1],o=t[2]):s=this.getTileCoordExtent(t,i);a>=this.minZoom;){if(e(a,2===this.zoomFactor_?Sl(n=Math.floor(n/2),n,o=Math.floor(o/2),o,r):this.getTileRangeForExtentAndZ(s,a,r)))return!0;--a}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,r){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var i=2*t[1],n=2*t[2];return Sl(i,i+1,n,n+1,e)}var o=this.getTileCoordExtent(t,r);return this.getTileRangeForExtentAndZ(o,t[0]+1,e)}return null},t.prototype.getTileRangeExtent=function(t,e,r){var i=this.getOrigin(t),n=this.getResolution(t),o=Ds(this.getTileSize(t),this.tmpSize_),s=i[0]+e.minX*o[0]*n,a=i[0]+(e.maxX+1)*o[0]*n;return qt(s,i[1]+e.minY*o[1]*n,a,i[1]+(e.maxY+1)*o[1]*n,r)},t.prototype.getTileRangeForExtentAndZ=function(t,e,r){var i=Ol;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,i);var n=i[1],o=i[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,i),Sl(n,i[1],o,i[2],r)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),r=this.getResolution(t[0]),i=Ds(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*i[0]*r,e[1]-(t[2]+.5)*i[1]*r]},t.prototype.getTileCoordExtent=function(t,e){var r=this.getOrigin(t[0]),i=this.getResolution(t[0]),n=Ds(this.getTileSize(t[0]),this.tmpSize_),o=r[0]+t[1]*n[0]*i,s=r[1]-(t[2]+1)*n[1]*i;return qt(o,s,o+n[0]*i,s+n[1]*i,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,r){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,r)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,r,i,n){var o=this.getZForResolution(r),s=r/this.getResolution(o),a=this.getOrigin(o),l=Ds(this.getTileSize(o),this.tmpSize_),u=i?.5:0,h=i?.5:0,c=Math.floor((t-a[0])/r+u),p=Math.floor((a[1]-e)/r+h),d=s*c/l[0],f=s*p/l[1];return i?(d=Math.ceil(d)-1,f=Math.ceil(f)-1):(d=Math.floor(d),f=Math.floor(f)),Cl(o,d,f,n)},t.prototype.getTileCoordForXYAndZ_=function(t,e,r,i,n){var o=this.getOrigin(r),s=this.getResolution(r),a=Ds(this.getTileSize(r),this.tmpSize_),l=i?.5:0,u=i?.5:0,h=Math.floor((t-o[0])/s+l),c=Math.floor((o[1]-e)/s+u),p=h/a[0],d=c/a[1];return i?(p=Math.ceil(p)-1,d=Math.ceil(d)-1):(p=Math.floor(p),d=Math.floor(d)),Cl(r,p,d,n)},t.prototype.getTileCoordForCoordAndZ=function(t,e,r){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,r)},t.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},t.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},t.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:null},t.prototype.getZForResolution=function(t,e){return we(g(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,r=new Array(e),i=this.minZoom;i<e;++i)r[i]=this.getTileRangeForExtentAndZ(t,i);this.fullTileRanges_=r},t}();function Ml(t){var e=t.getDefaultTileGrid();return e||(e=kl(t),t.setDefaultTileGrid(e)),e}function Fl(t){var e=t||{},r=e.extent||gr("EPSG:3857").getExtent(),i={extent:r,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:Al(r,e.maxZoom,e.tileSize,e.maxResolution)};return new Ll(i)}function Al(t,e,r,i){for(var n=void 0!==e?e:42,o=he(t),s=fe(t),a=Ds(void 0!==r?r:256),l=i>0?i:Math.max(s/a[0],o/a[1]),u=n+1,h=new Array(u),c=0;c<u;++c)h[c]=l/Math.pow(2,c);return h}function kl(t,e,r,i){return function(t,e,r,i){var n=void 0!==i?i:Ot,o=Al(t,e,r);return new Ll({extent:t,origin:le(t,n),resolutions:o,tileSize:r})}(Nl(t),e,r,i)}function Nl(t){var e=(t=gr(t)).getExtent();if(!e){var r=180*mt[_t.DEGREES]/t.getMetersPerUnit();e=qt(-r,-r,r,r)}return e}var jl,Dl=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function Gl(t,e){for(var r=Dl.length,i=0;i<r;++i)try{var n=t.getContext(Dl[i],e);if(n)return n}catch(t){}return null}var zl="http://www.w3.org/2001/XMLSchema-instance";function Bl(t,e){return lu().createElementNS(t,e)}function Ul(t,e){return function t(e,r,i){if(e.nodeType==Node.CDATA_SECTION_NODE||e.nodeType==Node.TEXT_NODE)r?i.push(String(e.nodeValue).replace(/(\r\n|\r|\n)/g,"")):i.push(e.nodeValue);else{var n=void 0;for(n=e.firstChild;n;n=n.nextSibling)t(n,r,i)}return i}(t,e,[]).join("")}function Yl(t){return"documentElement"in t}function Wl(t){return(new DOMParser).parseFromString(t,"application/xml")}function Vl(t,e){return function(r,i){var n=t.call(void 0!==e?e:this,r,i);void 0!==n&&m(i[i.length-1],n)}}function Xl(t,e){return function(r,i){var n=t.call(void 0!==e?e:this,r,i);void 0!==n&&i[i.length-1].push(n)}}function ql(t,e){return function(r,i){var n=t.call(void 0!==e?e:this,r,i);void 0!==n&&(i[i.length-1]=n)}}function Zl(t,e,r){return function(i,n){var o=t.call(void 0!==r?r:this,i,n);if(void 0!==o){var s=n[n.length-1],a=void 0!==e?e:i.localName,l=void 0;a in s?l=s[a]:(l=[],s[a]=l),l.push(o)}}}function Kl(t,e,r){return function(i,n){var o=t.call(void 0!==r?r:this,i,n);void 0!==o&&(n[n.length-1][void 0!==e?e:i.localName]=o)}}function Hl(t,e){return function(r,i,n){t.call(void 0!==e?e:this,r,i,n),n[n.length-1].node.appendChild(r)}}function Jl(t,e){var r,i;return function(e,n,o){if(void 0===r){r={};var s={};s[e.localName]=t,r[e.namespaceURI]=s,i=$l(e.localName)}nu(r,i,n,o)}}function $l(t,e){var r=t;return(function(t,i,n){var o=i[i.length-1].node,s=r;return void 0===s&&(s=n),Bl(void 0!==e?e:o.namespaceURI,s)})}var Ql=$l();function tu(t,e){for(var r=e.length,i=new Array(r),n=0;n<r;++n)i[n]=t[e[n]];return i}function eu(t,e,r){var i,n,o=void 0!==r?r:{};for(i=0,n=t.length;i<n;++i)o[t[i]]=e;return o}function ru(t,e,r,i){var n;for(n=e.firstElementChild;n;n=n.nextElementSibling){var o=t[n.namespaceURI];if(void 0!==o){var s=o[n.localName];void 0!==s&&s.call(i,n,r)}}}function iu(t,e,r,i,n){return i.push(t),ru(e,r,i,n),i.pop()}function nu(t,e,r,i,n,o){for(var s,a,l=(void 0!==n?n:r).length,u=0;u<l;++u)void 0!==(s=r[u])&&void 0!==(a=e.call(void 0!==o?o:this,s,i,void 0!==n?n[u]:void 0))&&t[a.namespaceURI][a.localName].call(o,a,s,i)}function ou(t,e,r,i,n,o,s){return n.push(t),nu(e,r,i,n,o,s),n.pop()}var su=void 0;var au=void 0;function lu(){return void 0===au&&"undefined"!=typeof document&&(au=document.implementation.createDocument("","",null)),au}var uu=35044;function hu(t){switch(t){case 34962:return Float32Array;case 34963:return Uint32Array;default:return Float32Array}}var cu=function(){function t(t,e){this.array=null,this.type=t,lt(34962===t||34963===t,62),this.usage=void 0!==e?e:uu}return t.prototype.ofSize=function(t){this.array=new(hu(this.type))(t)},t.prototype.fromArray=function(t){this.array=hu(this.type).from(t)},t.prototype.fromArrayBuffer=function(t){this.array=new(hu(this.type))(t)},t.prototype.getType=function(){return this.type},t.prototype.getArray=function(){return this.array},t.prototype.getUsage=function(){return this.usage},t.prototype.getSize=function(){return this.array?this.array.length:0},t}(),pu="webglcontextlost",du="webglcontextrestored",fu=function(){function t(t){this.gl_=t.webGlContext;var e=this.gl_;this.scaleRatio_=t.scaleRatio||1,this.renderTargetTexture_=e.createTexture(),this.renderTargetTextureSize_=null,this.frameBuffer_=e.createFramebuffer();var r=e.createShader(e.VERTEX_SHADER);e.shaderSource(r,t.vertexShader||"\n  precision mediump float;\n  \n  attribute vec2 a_position;\n  varying vec2 v_texCoord;\n  varying vec2 v_screenCoord;\n  \n  uniform vec2 u_screenSize;\n   \n  void main() {\n    v_texCoord = a_position * 0.5 + 0.5;\n    v_screenCoord = v_texCoord * u_screenSize;\n    gl_Position = vec4(a_position, 0.0, 1.0);\n  }\n"),e.compileShader(r);var i=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(i,t.fragmentShader||"\n  precision mediump float;\n   \n  uniform sampler2D u_image;\n   \n  varying vec2 v_texCoord;\n   \n  void main() {\n    gl_FragColor = texture2D(u_image, v_texCoord);\n  }\n"),e.compileShader(i),this.renderTargetProgram_=e.createProgram(),e.attachShader(this.renderTargetProgram_,r),e.attachShader(this.renderTargetProgram_,i),e.linkProgram(this.renderTargetProgram_),this.renderTargetVerticesBuffer_=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,-1,1,1,-1,1]),e.STATIC_DRAW),this.renderTargetAttribLocation_=e.getAttribLocation(this.renderTargetProgram_,"a_position"),this.renderTargetUniformLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_screenSize"),this.renderTargetTextureLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_image"),this.uniforms_=[],t.uniforms&&Object.keys(t.uniforms).forEach(function(r){this.uniforms_.push({value:t.uniforms[r],location:e.getUniformLocation(this.renderTargetProgram_,r)})}.bind(this))}return t.prototype.getGL=function(){return this.gl_},t.prototype.init=function(t){var e=this.getGL(),r=[e.drawingBufferWidth*this.scaleRatio_,e.drawingBufferHeight*this.scaleRatio_];if(e.bindFramebuffer(e.FRAMEBUFFER,this.getFrameBuffer()),e.viewport(0,0,r[0],r[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==r[0]||this.renderTargetTextureSize_[1]!==r[1]){this.renderTargetTextureSize_=r;var i=e.RGBA,n=e.RGBA,o=e.UNSIGNED_BYTE;e.bindTexture(e.TEXTURE_2D,this.renderTargetTexture_),e.texImage2D(e.TEXTURE_2D,0,i,r[0],r[1],0,n,o,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.renderTargetTexture_,0)}},t.prototype.apply=function(t,e){var r=this.getGL(),i=t.size;r.bindFramebuffer(r.FRAMEBUFFER,e?e.getFrameBuffer():null),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,this.renderTargetTexture_),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.enable(r.BLEND),r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA),r.viewport(0,0,r.drawingBufferWidth,r.drawingBufferHeight),r.bindBuffer(r.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),r.useProgram(this.renderTargetProgram_),r.enableVertexAttribArray(this.renderTargetAttribLocation_),r.vertexAttribPointer(this.renderTargetAttribLocation_,2,r.FLOAT,!1,0,0),r.uniform2f(this.renderTargetUniformLocation_,i[0],i[1]),r.uniform1i(this.renderTargetTextureLocation_,0),this.applyUniforms(t),r.drawArrays(r.TRIANGLES,0,6)},t.prototype.getFrameBuffer=function(){return this.frameBuffer_},t.prototype.applyUniforms=function(t){var e,r=this.getGL(),i=1;this.uniforms_.forEach((function(n){if((e="function"==typeof n.value?n.value(t):n.value)instanceof HTMLCanvasElement||e instanceof ImageData)n.texture||(n.texture=r.createTexture()),r.activeTexture(r["TEXTURE"+i]),r.bindTexture(r.TEXTURE_2D,n.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),e instanceof ImageData?r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,e.width,e.height,0,r.UNSIGNED_BYTE,new Uint8Array(e.data)):r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e),r.uniform1i(n.location,i++);else if(Array.isArray(e))switch(e.length){case 2:return void r.uniform2f(n.location,e[0],e[1]);case 3:return void r.uniform3f(n.location,e[0],e[1],e[2]);case 4:return void r.uniform4f(n.location,e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&r.uniform1f(n.location,e)}))},t}();function gu(t,e){return t[0]=e[0],t[1]=e[1],t[4]=e[2],t[5]=e[3],t[12]=e[4],t[13]=e[5],t}var yu=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),mu="u_projectionMatrix",_u="u_offsetScaleMatrix",vu="u_offsetRotateMatrix",xu="u_time",wu="u_zoom",bu="u_resolution",Su={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126};function Tu(t){for(var e=0,r=0;r<t.length;r++){var i=t[r];e+=i.size*Cu(i.type)}return e}function Cu(t){switch(t){case Su.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Su.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Su.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Su.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}var Eu=function(t){function e(e){var r=t.call(this)||this,i=e||{};r.boundHandleWebGLContextLost_=r.handleWebGLContextLost.bind(r),r.boundHandleWebGLContextRestored_=r.handleWebGLContextRestored.bind(r),r.canvas_=document.createElement("canvas"),r.canvas_.style.position="absolute",r.canvas_.style.left="0",r.gl_=Gl(r.canvas_);var n=r.getGL();if(r.bufferCache_={},r.currentProgram_=null,lt(f(function(){if(!jl){var t=Gl(document.createElement("canvas"));t&&(jl=t.getSupportedExtensions())}return jl}(),"OES_element_index_uint"),63),n.getExtension("OES_element_index_uint"),r.canvas_.addEventListener(pu,r.boundHandleWebGLContextLost_),r.canvas_.addEventListener(du,r.boundHandleWebGLContextRestored_),r.offsetRotateMatrix_=[1,0,0,1,0,0],r.offsetScaleMatrix_=[1,0,0,1,0,0],r.tmpMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],r.uniformLocations_={},r.attribLocations_={},r.uniforms_=[],i.uniforms)for(var o in i.uniforms)r.uniforms_.push({name:o,value:i.uniforms[o]});return r.postProcessPasses_=i.postProcesses?i.postProcesses.map((function(t){return new fu({webGlContext:n,scaleRatio:t.scaleRatio,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms})})):[new fu({webGlContext:n})],r.shaderCompileErrors_=null,r.startTime_=Date.now(),r}return yu(e,t),e.prototype.bindBuffer=function(t){var e=this.getGL(),r=o(t),i=this.bufferCache_[r];i||(i={buffer:t,webGlBuffer:e.createBuffer()},this.bufferCache_[r]=i);e.bindBuffer(t.getType(),i.webGlBuffer)},e.prototype.flushBufferData=function(t){var e=this.getGL();this.bindBuffer(t),e.bufferData(t.getType(),t.getArray(),t.getUsage())},e.prototype.deleteBuffer=function(t){var e=this.getGL(),r=o(t),i=this.bufferCache_[r];e.isContextLost()||e.deleteBuffer(i.buffer),delete this.bufferCache_[r]},e.prototype.disposeInternal=function(){this.canvas_.removeEventListener(pu,this.boundHandleWebGLContextLost_),this.canvas_.removeEventListener(du,this.boundHandleWebGLContextRestored_)},e.prototype.prepareDraw=function(t){var e=this.getGL(),r=this.getCanvas(),i=t.size,n=t.pixelRatio;r.width=i[0]*n,r.height=i[1]*n,r.style.width=i[0]+"px",r.style.height=i[1]+"px",e.useProgram(this.currentProgram_);for(var o=this.postProcessPasses_.length-1;o>=0;o--)this.postProcessPasses_[o].init(t);e.bindTexture(e.TEXTURE_2D,null),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),e.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.prepareDrawToRenderTarget=function(t,e,r){var i=this.getGL(),n=e.getSize();i.bindFramebuffer(i.FRAMEBUFFER,e.getFramebuffer()),i.viewport(0,0,n[0],n[1]),i.bindTexture(i.TEXTURE_2D,e.getTexture()),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.enable(i.BLEND),i.blendFunc(i.ONE,r?i.ZERO:i.ONE_MINUS_SRC_ALPHA),i.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.drawElements=function(t,e){var r=this.getGL(),i=r.UNSIGNED_INT,n=e-t,o=4*t;r.drawElements(r.TRIANGLES,n,i,o)},e.prototype.finalizeDraw=function(t){for(var e=0;e<this.postProcessPasses_.length;e++)this.postProcessPasses_[e].apply(t,this.postProcessPasses_[e+1]||null)},e.prototype.getCanvas=function(){return this.canvas_},e.prototype.getGL=function(){return this.gl_},e.prototype.applyFrameState=function(t){var e=t.size,r=t.viewState.rotation,i=xt(this.offsetScaleMatrix_);Tt(i,2/e[0],2/e[1]);var n,o,s,a,l=xt(this.offsetRotateMatrix_);0!==r&&(n=l,o=-r,s=Math.cos(o),a=Math.sin(o),wt(n,bt(vt,s,a,-a,s,0,0))),this.setUniformMatrixValue(_u,gu(this.tmpMat4_,i)),this.setUniformMatrixValue(vu,gu(this.tmpMat4_,l)),this.setUniformFloatValue(xu,.001*(Date.now()-this.startTime_)),this.setUniformFloatValue(wu,t.viewState.zoom),this.setUniformFloatValue(bu,t.viewState.resolution)},e.prototype.applyUniforms=function(t){var e,r=this.getGL(),i=0;this.uniforms_.forEach(function(n){if((e="function"==typeof n.value?n.value(t):n.value)instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageData)n.texture||(n.prevValue=void 0,n.texture=r.createTexture()),r.activeTexture(r["TEXTURE"+i]),r.bindTexture(r.TEXTURE_2D,n.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),(!(e instanceof HTMLImageElement)||e.complete)&&n.prevValue!==e&&(n.prevValue=e,r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e)),r.uniform1i(this.getUniformLocation(n.name),i++);else if(Array.isArray(e)&&6===e.length)this.setUniformMatrixValue(n.name,gu(this.tmpMat4_,e));else if(Array.isArray(e)&&e.length<=4)switch(e.length){case 2:return void r.uniform2f(this.getUniformLocation(n.name),e[0],e[1]);case 3:return void r.uniform3f(this.getUniformLocation(n.name),e[0],e[1],e[2]);case 4:return void r.uniform4f(this.getUniformLocation(n.name),e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&r.uniform1f(this.getUniformLocation(n.name),e)}.bind(this))},e.prototype.useProgram=function(t){return t!=this.currentProgram_&&(this.getGL().useProgram(t),this.currentProgram_=t,this.uniformLocations_={},this.attribLocations_={},!0)},e.prototype.compileShader=function(t,e){var r=this.getGL(),i=r.createShader(e);return r.shaderSource(i,t),r.compileShader(i),i},e.prototype.getProgram=function(t,e){var r=this.getGL(),i=this.compileShader(t,r.FRAGMENT_SHADER),n=this.compileShader(e,r.VERTEX_SHADER);this.shaderCompileErrors_=null,r.getShaderInfoLog(i)&&(this.shaderCompileErrors_="Fragment shader compilation failed:\n"+r.getShaderInfoLog(i)),r.getShaderInfoLog(n)&&(this.shaderCompileErrors_=(this.shaderCompileErrors_||"")+"Vertex shader compilation failed:\n"+r.getShaderInfoLog(n));var o=r.createProgram();return r.attachShader(o,i),r.attachShader(o,n),r.linkProgram(o),o},e.prototype.getShaderCompileErrors=function(){return this.shaderCompileErrors_},e.prototype.getUniformLocation=function(t){return void 0===this.uniformLocations_[t]&&(this.uniformLocations_[t]=this.getGL().getUniformLocation(this.currentProgram_,t)),this.uniformLocations_[t]},e.prototype.getAttributeLocation=function(t){return void 0===this.attribLocations_[t]&&(this.attribLocations_[t]=this.getGL().getAttribLocation(this.currentProgram_,t)),this.attribLocations_[t]},e.prototype.makeProjectionTransform=function(t,e){var r=t.size,i=t.viewState.rotation,n=t.viewState.resolution,o=t.viewState.center;return xt(e),Ct(e,0,0,2/(n*r[0]),2/(n*r[1]),-i,-o[0],-o[1]),e},e.prototype.setUniformFloatValue=function(t,e){this.getGL().uniform1f(this.getUniformLocation(t),e)},e.prototype.setUniformMatrixValue=function(t,e){this.getGL().uniformMatrix4fv(this.getUniformLocation(t),!1,e)},e.prototype.enableAttributeArray_=function(t,e,r,i,n){var o=this.getAttributeLocation(t);o<0||(this.getGL().enableVertexAttribArray(o),this.getGL().vertexAttribPointer(o,e,r,!1,i,n))},e.prototype.enableAttributes=function(t){for(var e=Tu(t),r=0,i=0;i<t.length;i++){var n=t[i];this.enableAttributeArray_(n.name,n.size,n.type||5126,e,r),r+=n.size*Cu(n.type)}},e.prototype.handleWebGLContextLost=function(){C(this.bufferCache_),this.currentProgram_=null},e.prototype.handleWebGLContextRestored=function(){},e.prototype.createTexture=function(t,e,r){var i=this.getGL(),n=r||i.createTexture(),o=i.RGBA,s=i.RGBA,a=i.UNSIGNED_BYTE;return i.bindTexture(i.TEXTURE_2D,n),e?i.texImage2D(i.TEXTURE_2D,0,o,s,a,e):i.texImage2D(i.TEXTURE_2D,0,o,t[0],t[1],0,s,a,null),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),n},e}(p),Ru=new Uint8Array(4),Pu=function(){function t(t,e){this.helper_=t;var r=t.getGL();this.texture_=r.createTexture(),this.framebuffer_=r.createFramebuffer(),this.size_=e||[1,1],this.data_=new Uint8Array(0),this.dataCacheDirty_=!0,this.updateSize_()}return t.prototype.setSize=function(t){v(t,this.size_)||(this.size_[0]=t[0],this.size_[1]=t[1],this.updateSize_())},t.prototype.getSize=function(){return this.size_},t.prototype.clearCachedData=function(){this.dataCacheDirty_=!0},t.prototype.readAll=function(){if(this.dataCacheDirty_){var t=this.size_,e=this.helper_.getGL();e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.readPixels(0,0,t[0],t[1],e.RGBA,e.UNSIGNED_BYTE,this.data_),this.dataCacheDirty_=!1}return this.data_},t.prototype.readPixel=function(t,e){if(t<0||e<0||t>this.size_[0]||e>=this.size_[1])return Ru[0]=0,Ru[1]=0,Ru[2]=0,Ru[3]=0,Ru;this.readAll();var r=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return Ru[0]=this.data_[4*r],Ru[1]=this.data_[4*r+1],Ru[2]=this.data_[4*r+2],Ru[3]=this.data_[4*r+3],Ru},t.prototype.getTexture=function(){return this.texture_},t.prototype.getFramebuffer=function(){return this.framebuffer_},t.prototype.updateSize_=function(){var t=this.size_,e=this.helper_.getGL();this.texture_=this.helper_.createTexture(t,null,this.texture_),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.viewport(0,0,t[0],t[1]),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture_,0),this.data_=new Uint8Array(t[0]*t[1]*4)},t}(),Iu=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ou=function(t){function e(e){var r=t.call(this,{extent:e.extent,origin:e.origin,origins:e.origins,resolutions:e.resolutions,tileSize:e.tileSize,tileSizes:e.tileSizes,sizes:e.sizes})||this;return r.matrixIds_=e.matrixIds,r}return Iu(e,t),e.prototype.getMatrixId=function(t){return this.matrixIds_[t]},e.prototype.getMatrixIds=function(){return this.matrixIds_},e}(Ll),Lu=Ou;function Mu(t,e,r){var i=[],n=[],o=[],s=[],a=[],l=void 0!==r?r:[],u=t.SupportedCRS,h=gr(u.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||gr(u),c=h.getMetersPerUnit(),p="ne"==h.getAxisOrientation().substr(0,2);return t.TileMatrix.sort((function(t,e){return e.ScaleDenominator-t.ScaleDenominator})),t.TileMatrix.forEach((function(e){if(!(l.length>0)||_(l,(function(r){return e.Identifier==r.TileMatrix||-1===e.Identifier.indexOf(":")&&t.Identifier+":"+e.Identifier===r.TileMatrix}))){n.push(e.Identifier);var r=28e-5*e.ScaleDenominator/c,u=e.TileWidth,h=e.TileHeight;p?o.push([e.TopLeftCorner[1],e.TopLeftCorner[0]]):o.push(e.TopLeftCorner),i.push(r),s.push(u==h?u:[u,h]),a.push([e.MatrixWidth,e.MatrixHeight])}})),new Ou({extent:e,origins:o,resolutions:i,matrixIds:n,tileSizes:s,sizes:a})}var Fu=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Ds(t.scale),this.displacement_=t.displacement}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getAnchor=function(){return i()},t.prototype.getImage=function(t){return i()},t.prototype.getHitDetectionImage=function(t){return i()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return i()},t.prototype.getImageSize=function(){return i()},t.prototype.getHitDetectionImageSize=function(){return i()},t.prototype.getOrigin=function(){return i()},t.prototype.getSize=function(){return i()},t.prototype.setOpacity=function(t){this.opacity_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Ds(t)},t.prototype.listenImageChange=function(t){i()},t.prototype.load=function(){i()},t.prototype.unlistenImageChange=function(t){i()},t}(),Au=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),ku=function(t){function e(e){var r=this,i=void 0!==e.rotateWithView&&e.rotateWithView;return(r=t.call(this,{opacity:1,rotateWithView:i,rotation:void 0!==e.rotation?e.rotation:0,scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0]})||this).canvas_={},r.hitDetectionCanvas_={},r.fill_=void 0!==e.fill?e.fill:null,r.origin_=[0,0],r.points_=e.points,r.radius_=void 0!==e.radius?e.radius:e.radius1,r.radius2_=e.radius2,r.angle_=void 0!==e.angle?e.angle:0,r.stroke_=void 0!==e.stroke?e.stroke:null,r.anchor_=null,r.size_=null,r.imageSize_=null,r.hitDetectionImageSize_=null,r.render(),r}return Au(e,t),e.prototype.clone=function(){var t=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},e.prototype.getAnchor=function(){return this.anchor_},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.getHitDetectionImage=function(t){if(!this.hitDetectionCanvas_[t||1]){var e=this.createRenderOptions();this.createHitDetectionCanvas_(e,t||1)}return this.hitDetectionCanvas_[t||1]},e.prototype.getImage=function(t){if(!this.canvas_[t||1]){var e=this.createRenderOptions(),r=zn(e.size*t||1,e.size*t||1);this.draw_(e,r,0,0,t||1),this.canvas_[t||1]=r.canvas}return this.canvas_[t||1]},e.prototype.getPixelRatio=function(t){return t},e.prototype.getImageSize=function(){return this.imageSize_},e.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_},e.prototype.getImageState=function(){return To},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.createRenderOptions=function(){var t,e="round",r="round",i=0,n=null,o=0,s=0;return this.stroke_&&(null===(t=this.stroke_.getColor())&&(t="#000"),t=Ln(t),void 0===(s=this.stroke_.getWidth())&&(s=1),n=this.stroke_.getLineDash(),o=this.stroke_.getLineDashOffset(),void 0===(r=this.stroke_.getLineJoin())&&(r="round"),void 0===(e=this.stroke_.getLineCap())&&(e="round"),void 0===(i=this.stroke_.getMiterLimit())&&(i=10)),{strokeStyle:t,strokeWidth:s,size:2*(this.radius_+s)+1,lineCap:e,lineDash:n,lineDashOffset:o,lineJoin:r,miterLimit:i}},e.prototype.render=function(){var t=this.createRenderOptions(),e=zn(t.size,t.size);this.draw_(t,e,0,0,1),this.canvas_[1]=e.canvas;var r=e.canvas.width,i=r,n=this.getDisplacement();this.hitDetectionImageSize_=[t.size,t.size],this.createHitDetectionCanvas_(t,1),this.anchor_=[r/2-n[0],r/2+n[1]],this.size_=[r,r],this.imageSize_=[i,i]},e.prototype.draw_=function(t,e,r,i,n){var o,s,a;e.setTransform(n,0,0,n,0,0),e.translate(r,i),e.beginPath();var l=this.points_;if(l===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var u=void 0!==this.radius2_?this.radius2_:this.radius_;for(u!==this.radius_&&(l*=2),o=0;o<=l;o++)s=2*o*Math.PI/l-Math.PI/2+this.angle_,a=o%2==0?this.radius_:u,e.lineTo(t.size/2+a*Math.cos(s),t.size/2+a*Math.sin(s))}if(this.fill_){var h=this.fill_.getColor();null===h&&(h="#000"),e.fillStyle=Ln(h),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,e.setLineDash&&t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineCap=t.lineCap,e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke()),e.closePath()},e.prototype.createHitDetectionCanvas_=function(t,e){if(this.hitDetectionCanvas_[e]=this.getImage(e),this.fill_){var r=this.fill_.getColor(),i=0;if("string"==typeof r&&(r=tn(r)),null===r?i=1:Array.isArray(r)&&(i=4===r.length?r[3]:1),0===i){var n=zn(t.size*e,t.size*e);this.hitDetectionCanvas_[e]=n.canvas,this.drawHitDetectionCanvas_(t,n,0,0,e)}}},e.prototype.drawHitDetectionCanvas_=function(t,e,r,i,n){e.setTransform(n,0,0,n,0,0),e.translate(r,i),e.beginPath();var o=this.points_;if(o===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var s=void 0!==this.radius2_?this.radius2_:this.radius_;s!==this.radius_&&(o*=2);var a=void 0,l=void 0,u=void 0;for(a=0;a<=o;a++)u=2*a*Math.PI/o-Math.PI/2+this.angle_,l=a%2==0?this.radius_:s,e.lineTo(t.size/2+l*Math.cos(u),t.size/2+l*Math.sin(u))}e.fillStyle="#000",e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.stroke()),e.closePath()},e}(Fu),Nu=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),ju=function(t){function e(e){var r=e||{};return t.call(this,{points:1/0,fill:r.fill,radius:r.radius,stroke:r.stroke,displacement:void 0!==r.displacement?r.displacement:[0,0]})||this}return Nu(e,t),e.prototype.clone=function(){var t=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),displacement:this.getDisplacement().slice()});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(ku),Du=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0})},t.prototype.getColor=function(){return this.color_},t.prototype.setColor=function(t){this.color_=t},t}(),Gu="fraction",zu="pixels",Bu="bottom-left",Uu="bottom-right",Yu="top-left",Wu="top-right",Vu=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Xu=function(t){function e(e,r,i,n){var o=t.call(this)||this;return o.extent=e,o.pixelRatio_=i,o.resolution=r,o.state=n,o}return Vu(e,t),e.prototype.changed=function(){this.dispatchEvent(O)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return i()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){i()},e}(I),qu=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function Zu(t,e,r){var i=t;if(i.src&&Dn){var n=i.decode(),o=!0;return n.then((function(){o&&e()})).catch((function(t){o&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():r())})),function(){o=!1}}var s=[V(i,z,e),V(i,L,r)];return function(){s.forEach(X)}}var Ku=function(t){function e(e,r,i,n,o,s){var a=t.call(this,e,r,i,bo)||this;return a.src_=n,a.image_=new Image,null!==o&&(a.image_.crossOrigin=o),a.unlisten_=null,a.state=bo,a.imageLoadFunction_=s,a}return qu(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=Co,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=he(this.extent)/this.image_.height),this.state=To,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=bo&&this.state!=Co||(this.state=So,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Zu(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Xu),Hu=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ju=null,$u=function(t){function e(e,r,i,n,o,s){var a=t.call(this)||this;return a.hitDetectionImage_={},a.image_=e||new Image,null!==n&&(a.image_.crossOrigin=n),a.canvas_={},a.color_=s,a.unlisten_=null,a.imageState_=o,a.size_=i,a.src_=r,a.tainted_,a}return Hu(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===To){Ju||(Ju=zn(1,1)),Ju.drawImage(this.image_,0,0);try{Ju.getImageData(0,0,1,1),this.tainted_=!1}catch(t){Ju=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(O)},e.prototype.handleImageError_=function(){this.imageState_=Co,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=To,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(t){if(!this.hitDetectionImage_[t])if(this.isTainted_()){var e=this.color_?t:1,r=this.size_[0],i=this.size_[1],n=zn(Math.ceil(r*e),Math.ceil(i*e));n.scale(e,e),n.fillRect(0,0,r,i),this.hitDetectionImage_[t]=n.canvas}else this.hitDetectionImage_[t]=this.image_;return this.hitDetectionImage_[t]},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==bo){this.imageState_=So;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=Zu(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]){var e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);var r=e.getContext("2d");if(r.scale(t,t),r.drawImage(this.image_,0,0),this.isTainted_()){var i=this.color_;return r.globalCompositeOperation="multiply",r.fillStyle="rgb("+i[0]+","+i[1]+","+i[2]+")",r.fillRect(0,0,e.width,e.height),r.globalCompositeOperation="destination-in",void r.drawImage(this.image_,0,0)}for(var n=r.getImageData(0,0,e.width,e.height),o=n.data,s=this.color_[0]/255,a=this.color_[1]/255,l=this.color_[2]/255,u=0,h=o.length;u<h;u+=4)o[u]*=s,o[u+1]*=a,o[u+2]*=l;r.putImageData(n,0,0)}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(I);var Qu=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),th=function(t){function e(e){var r=this,i=e||{},n=void 0!==i.opacity?i.opacity:1,s=void 0!==i.rotation?i.rotation:0,a=void 0!==i.scale?i.scale:1,l=void 0!==i.rotateWithView&&i.rotateWithView;(r=t.call(this,{opacity:n,rotation:s,scale:a,displacement:void 0!==i.displacement?i.displacement:[0,0],rotateWithView:l})||this).anchor_=void 0!==i.anchor?i.anchor:[.5,.5],r.normalizedAnchor_=null,r.anchorOrigin_=void 0!==i.anchorOrigin?i.anchorOrigin:Yu,r.anchorXUnits_=void 0!==i.anchorXUnits?i.anchorXUnits:Gu,r.anchorYUnits_=void 0!==i.anchorYUnits?i.anchorYUnits:Gu,r.crossOrigin_=void 0!==i.crossOrigin?i.crossOrigin:null;var u=void 0!==i.img?i.img:null,h=void 0!==i.imgSize?i.imgSize:null,c=i.src;lt(!(void 0!==c&&u),4),lt(!u||u&&h,5),void 0!==c&&0!==c.length||!u||(c=u.src||o(u)),lt(void 0!==c&&c.length>0,6);var p=void 0!==i.src?bo:To;return r.color_=void 0!==i.color?tn(i.color):null,r.iconImage_=function(t,e,r,i,n,o){var s=sn.get(e,i,o);return s||(s=new $u(t,e,r,i,n,o),sn.set(e,i,o,s)),s}(u,c,h,r.crossOrigin_,p,r.color_),r.offset_=void 0!==i.offset?i.offset:[0,0],r.offsetOrigin_=void 0!==i.offsetOrigin?i.offsetOrigin:Yu,r.origin_=null,r.size_=void 0!==i.size?i.size:null,r}return Qu(e,t),e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},e.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,e=this.getSize();if(this.anchorXUnits_==Gu||this.anchorYUnits_==Gu){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==Gu&&(t[0]*=e[0]),this.anchorYUnits_==Gu&&(t[1]*=e[1])}if(this.anchorOrigin_!=Yu){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Wu&&this.anchorOrigin_!=Uu||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Bu&&this.anchorOrigin_!=Uu||(t[1]=-t[1]+e[1])}return this.normalizedAnchor_=t,this.normalizedAnchor_},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(t){return this.iconImage_.getHitDetectionImage(t)},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_,e=this.getDisplacement();if(this.offsetOrigin_!=Yu){var r=this.getSize(),i=this.iconImage_.getSize();if(!r||!i)return null;t=t.slice(),this.offsetOrigin_!=Wu&&this.offsetOrigin_!=Uu||(t[0]=i[0]-r[0]-t[0]),this.offsetOrigin_!=Bu&&this.offsetOrigin_!=Uu||(t[1]=i[1]-r[1]-t[1])}return t[0]+=e[0],t[1]+=e[1],this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(O,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(O,t)},e}(Fu),eh=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(t){this.color_=t},t.prototype.setLineCap=function(t){this.lineCap_=t},t.prototype.setLineDash=function(t){this.lineDash_=t},t.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t},t.prototype.setLineJoin=function(t){this.lineJoin_=t},t.prototype.setMiterLimit=function(t){this.miterLimit_=t},t.prototype.setWidth=function(t){this.width_=t},t}(),rh=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=sh,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new t({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=sh,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var ih=null;function nh(t,e){if(!ih){var r=new Du({color:"rgba(255,255,255,0.4)"}),i=new eh({color:"#3399CC",width:1.25});ih=[new rh({image:new ju({fill:r,stroke:i,radius:5}),fill:r,stroke:i})]}return ih}function oh(){var t={},e=[255,255,255,1],r=[0,153,255,1];return t[gt.POLYGON]=[new rh({fill:new Du({color:[255,255,255,.5]})})],t[gt.MULTI_POLYGON]=t[gt.POLYGON],t[gt.LINE_STRING]=[new rh({stroke:new eh({color:e,width:5})}),new rh({stroke:new eh({color:r,width:3})})],t[gt.MULTI_LINE_STRING]=t[gt.LINE_STRING],t[gt.CIRCLE]=t[gt.POLYGON].concat(t[gt.LINE_STRING]),t[gt.POINT]=[new rh({image:new ju({radius:6,fill:new Du({color:r}),stroke:new eh({color:e,width:1.5})}),zIndex:1/0})],t[gt.MULTI_POINT]=t[gt.POINT],t[gt.GEOMETRY_COLLECTION]=t[gt.POLYGON].concat(t[gt.LINE_STRING],t[gt.POINT]),t}function sh(t){return t.getGeometry()}var ah=rh,lh="point",uh="line",hh=function(){function t(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=Ds(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new Du({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:lh,this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){var e=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()})},t.prototype.getOverflow=function(){return this.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Ds(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}(),ch=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),ph=function(t){function e(e,r,i){var n=t.call(this)||this,o=i||{};return n.tileCoord=e,n.state=r,n.interimTile=null,n.hifi=!0,n.key="",n.transition_=void 0===o.transition?250:o.transition,n.transitionStarts_={},n}return ch(e,t),e.prototype.changed=function(){this.dispatchEvent(O)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==cs)return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==cs){t.interimTile=null;break}t.getState()==hs?e=t:t.getState()==us?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(this.state!==ps&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){i()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var r=this.transitionStarts_[t];if(r){if(-1===r)return 1}else r=e,this.transitionStarts_[t]=r;var i=e-r+1e3/60;return i>=this.transition_?1:Ps(i/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(I),dh=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();var fh,gh=function(t){function e(e,r,i,n,o,s){var a=t.call(this,e,r,s)||this;return a.crossOrigin_=n,a.src_=i,a.image_=new Image,null!==n&&(a.image_.crossOrigin=n),a.unlisten_=null,a.tileLoadFunction_=o,a}return dh(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.getKey=function(){return this.src_},e.prototype.handleImageError_=function(){var t;this.state=ps,this.unlistenImage_(),this.image_=((t=zn(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=cs:this.state=ds,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==ps&&(this.state=us,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==us&&(this.state=hs,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Zu(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(ph),yh=function(){function t(t,e,r,i,n,o){this.sourceProj_=t,this.targetProj_=e;var s={},a=Sr(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return s[e]||(s[e]=a(t)),s[e]},this.maxSourceExtent_=i,this.errorThresholdSquared_=n*n,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!i&&!!this.sourceProj_.getExtent()&&fe(i)==fe(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?fe(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?fe(this.targetProj_.getExtent()):null;var l=pe(r),u=de(r),h=se(r),c=oe(r),p=this.transformInv_(l),d=this.transformInv_(u),f=this.transformInv_(h),g=this.transformInv_(c),y=10+(o?Math.max(0,Math.ceil(Se(ne(r)/(o*o*256*256)))):0);if(this.addQuad_(l,u,h,c,p,d,f,g,y),this.wrapsXInSource_){var m=1/0;this.triangles_.forEach((function(t,e,r){m=Math.min(m,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-m>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-m>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-m>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-m>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var r=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-r<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}s={}}return t.prototype.addTriangle_=function(t,e,r,i,n,o){this.triangles_.push({source:[i,n,o],target:[t,e,r]})},t.prototype.addQuad_=function(t,e,r,i,n,o,s,a,l){var u=Dt([n,o,s,a]),h=this.sourceWorldWidth_?fe(u)/this.sourceWorldWidth_:null,c=this.sourceWorldWidth_,p=this.sourceProj_.canWrapX()&&h>.5&&h<1,d=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)d=fe(Dt([t,e,r,i]))/this.targetWorldWidth_>.25||d;!p&&this.sourceProj_.isGlobal()&&h&&(d=h>.25||d)}if(!(!d&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3]))||ge(u,this.maxSourceExtent_)){var f=0;if(!(d||isFinite(n[0])&&isFinite(n[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])))if(l>0)d=!0;else if(1!=(f=(isFinite(n[0])&&isFinite(n[1])?0:8)+(isFinite(o[0])&&isFinite(o[1])?0:4)+(isFinite(s[0])&&isFinite(s[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1))&&2!=f&&4!=f&&8!=f)return;if(l>0){if(!d){var g=[(t[0]+r[0])/2,(t[1]+r[1])/2],y=this.transformInv_(g),m=void 0;if(p)m=(Pe(n[0],c)+Pe(s[0],c))/2-Pe(y[0],c);else m=(n[0]+s[0])/2-y[0];var _=(n[1]+s[1])/2-y[1];d=m*m+_*_>this.errorThresholdSquared_}if(d){if(Math.abs(t[0]-r[0])<=Math.abs(t[1]-r[1])){var v=[(e[0]+r[0])/2,(e[1]+r[1])/2],x=this.transformInv_(v),w=[(i[0]+t[0])/2,(i[1]+t[1])/2],b=this.transformInv_(w);this.addQuad_(t,e,v,w,n,o,x,b,l-1),this.addQuad_(w,v,r,i,b,x,s,a,l-1)}else{var S=[(t[0]+e[0])/2,(t[1]+e[1])/2],T=this.transformInv_(S),C=[(r[0]+i[0])/2,(r[1]+i[1])/2],E=this.transformInv_(C);this.addQuad_(t,S,C,i,n,T,E,a,l-1),this.addQuad_(S,e,r,C,T,o,s,E,l-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&f)&&this.addTriangle_(t,r,i,n,s,a),0==(14&f)&&this.addTriangle_(t,r,e,n,s,o),f&&(0==(13&f)&&this.addTriangle_(e,i,t,o,a,n),0==(7&f)&&this.addTriangle_(e,i,r,o,a,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,r,i){var n=e.source;Qt(t,n[0]),Qt(t,n[1]),Qt(t,n[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),mh={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function _h(t,e,r,i,n){t.beginPath(),t.moveTo(0,0),t.lineTo(e,r),t.lineTo(i,n),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,i)+1,Math.max(r,n)),t.restore()}function vh(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function xh(t,e,r,i){var n=Tr(r,e,t),o=yr(e,i,r),s=e.getMetersPerUnit();void 0!==s&&(o*=s);var a=t.getMetersPerUnit();void 0!==a&&(o/=a);var l=t.getExtent();if(!l||Ut(l,n)){var u=yr(t,o,n)/o;isFinite(u)&&u>0&&(o/=u)}return o}function wh(t,e,r,i,n,o,s,a,l,u,h,c){var p=zn(Math.round(r*t),Math.round(r*e));if(T(p,c),0===l.length)return p.canvas;function d(t){return Math.round(t*r)/r}p.scale(r,r),p.globalCompositeOperation="lighter";var f=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,r){$t(f,t.extent)}));var g=fe(f),y=he(f),m=zn(Math.round(r*g/i),Math.round(r*y/i));T(m,c);var _=r/i;l.forEach((function(t,e,r){var i=t.extent[0]-f[0],n=-(t.extent[3]-f[3]),o=fe(t.extent),s=he(t.extent);t.image.width>0&&t.image.height>0&&m.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,i*_,n*_,o*_,s*_)}));var v=pe(s);return a.getTriangles().forEach((function(t,e,n){var s=t.source,a=t.target,l=s[0][0],u=s[0][1],h=s[1][0],g=s[1][1],y=s[2][0],_=s[2][1],x=d((a[0][0]-v[0])/o),w=d(-(a[0][1]-v[1])/o),b=d((a[1][0]-v[0])/o),S=d(-(a[1][1]-v[1])/o),T=d((a[2][0]-v[0])/o),C=d(-(a[2][1]-v[1])/o),E=l,R=u;l=0,u=0;var P=function(t){for(var e=t.length,r=0;r<e;r++){for(var i=r,n=Math.abs(t[r][r]),o=r+1;o<e;o++){var s=Math.abs(t[o][r]);s>n&&(n=s,i=o)}if(0===n)return null;var a=t[i];t[i]=t[r],t[r]=a;for(var l=r+1;l<e;l++)for(var u=-t[l][r]/t[r][r],h=r;h<e+1;h++)r==h?t[l][h]=0:t[l][h]+=u*t[r][h]}for(var c=new Array(e),p=e-1;p>=0;p--){c[p]=t[p][e]/t[p][p];for(var d=p-1;d>=0;d--)t[d][e]-=t[d][p]*c[p]}return c}([[h-=E,g-=R,0,0,b-x],[y-=E,_-=R,0,0,T-x],[0,0,h,g,S-w],[0,0,y,_,C-w]]);if(P){if(p.save(),p.beginPath(),function(){if(void 0===fh){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",_h(t,4,5,4,0),_h(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;fh=vh(e,0)||vh(e,4)||vh(e,8)}return fh}()||c===mh){p.moveTo(b,S);for(var I=x-b,O=w-S,L=0;L<4;L++)p.lineTo(b+d((L+1)*I/4),S+d(L*O/3)),3!=L&&p.lineTo(b+d((L+1)*I/4),S+d((L+1)*O/3));p.lineTo(T,C)}else p.moveTo(b,S),p.lineTo(x,w),p.lineTo(T,C);p.clip(),p.transform(P[0],P[2],P[1],P[3],x,w),p.translate(f[0]-E,f[3]-R),p.scale(i/r,-i/r),p.drawImage(m.canvas,0,0),p.restore()}})),h&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,a.getTriangles().forEach((function(t,e,r){var i=t.target,n=(i[0][0]-v[0])/o,s=-(i[0][1]-v[1])/o,a=(i[1][0]-v[0])/o,l=-(i[1][1]-v[1])/o,u=(i[2][0]-v[0])/o,h=-(i[2][1]-v[1])/o;p.beginPath(),p.moveTo(a,l),p.lineTo(n,s),p.lineTo(u,h),p.closePath(),p.stroke()})),p.restore()),p.canvas}var bh=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Sh=function(t){function e(e,r,i,n,o,s,a,l,u,h,c,p){var d=t.call(this,o,us)||this;d.renderEdges_=void 0!==c&&c,d.contextOptions_=p,d.pixelRatio_=a,d.gutter_=l,d.canvas_=null,d.sourceTileGrid_=r,d.targetTileGrid_=n,d.wrappedTileCoord_=s||o,d.sourceTiles_=[],d.sourcesListenerKeys_=null,d.sourceZ_=0;var f=n.getTileCoordExtent(d.wrappedTileCoord_),g=d.targetTileGrid_.getExtent(),y=d.sourceTileGrid_.getExtent(),m=g?ce(f,g):f;if(0===ne(m))return d.state=ds,d;var _=e.getExtent();_&&(y=y?ce(y,_):_);var v=n.getResolution(d.wrappedTileCoord_[0]),x=function(t,e,r,i){var n=ae(r),o=xh(t,e,n,i);return(!isFinite(o)||o<=0)&&ie(r,(function(r){return o=xh(t,e,r,i),isFinite(o)&&o>0})),o}(e,i,m,v);if(!isFinite(x)||x<=0)return d.state=ds,d;var w=void 0!==h?h:.5;if(d.triangulation_=new yh(e,i,m,y,x*w,v),0===d.triangulation_.getTriangles().length)return d.state=ds,d;d.sourceZ_=r.getZForResolution(x);var b=d.triangulation_.calculateSourceExtent();if(y&&(e.canWrapX()?(b[1]=we(b[1],y[1],y[3]),b[3]=we(b[3],y[1],y[3])):b=ce(b,y)),ne(b)){for(var S=r.getTileRangeForExtentAndZ(b,d.sourceZ_),T=S.minX;T<=S.maxX;T++)for(var C=S.minY;C<=S.maxY;C++){var E=u(d.sourceZ_,T,C,a);E&&d.sourceTiles_.push(E)}0===d.sourceTiles_.length&&(d.state=ds)}else d.state=ds;return d}return bh(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,r,i){e&&e.getState()==cs&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=ps;else{var e=this.wrappedTileCoord_[0],r=this.targetTileGrid_.getTileSize(e),i="number"==typeof r?r:r[0],n="number"==typeof r?r:r[1],o=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=wh(i,n,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),o,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=cs}this.changed()},e.prototype.load=function(){if(this.state==us){this.state=hs,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,r,i){var n=e.getState();if(n==us||n==hs){t++;var o=W(e,O,(function(r){var i=e.getState();i!=cs&&i!=ps&&i!=ds||(X(o),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(o)}}.bind(this)),this.sourceTiles_.forEach((function(t,e,r){t.getState()==us&&t.load()})),0===t&&setTimeout(this.reproject_.bind(this),0)}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(X),this.sourcesListenerKeys_=null},e}(ph),Th=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var r=this.entries_[t];return lt(void 0!==r,15),r===this.newest_||(r===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(r.newer.older=r.older,r.older.newer=r.newer),r.newer=null,r.older=this.newest_,this.newest_.newer=r,this.newest_=r),r.value_},t.prototype.remove=function(t){var e=this.entries_[t];return lt(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),r=0;for(t=this.newest_;t;t=t.older)e[r++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),r=0;for(t=this.newest_;t;t=t.older)e[r++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){lt(!(t in this.entries_),16);var r={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=r:this.oldest_=r,this.newest_=r,this.entries_[t]=r,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}(),Ch=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Eh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ch(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=Pl(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(Rl(e.tileCoord)),e.release())}.bind(this))}},e}(Th),Rh="tileloadstart",Ph="tileloadend",Ih="tileloaderror",Oh=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function Lh(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var Mh=function(t){function e(e){var r=t.call(this)||this;return r.projection_=gr(e.projection),r.attributions_=Lh(e.attributions),r.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,r.loading=!1,r.state_=void 0!==e.state?e.state:Cn,r.wrapX_=void 0!==e.wrapX&&e.wrapX,r}return Oh(e,t),e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolutions=function(){return i()},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getContextOptions=function(){},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=Lh(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(et),Fh=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ah=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX})||this;r.opaque_=void 0!==e.opaque&&e.opaque,r.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,r.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;var i=e.tileGrid;return i&&Ds(i.getTileSize(i.getMinZoom()),[256,256]),r.tileCache=new Eh(e.cacheSize||0),r.tmpSize=[0,0],r.key_=e.key||"",r.tileOptions={transition:e.transition},r.zDirection=e.zDirection?e.zDirection:0,r}return Fh(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var r=this.getTileCacheForProjection(t);r&&r.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,r,i){var n=this.getTileCacheForProjection(t);if(!n)return!1;for(var o,s,a,l=!0,u=r.minX;u<=r.maxX;++u)for(var h=r.minY;h<=r.maxY;++h)s=El(e,u,h),a=!1,n.containsKey(s)&&(a=(o=n.get(s)).getState()===cs)&&(a=!1!==i(o)),a||(l=!1);return l},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},e.prototype.getTile=function(t,e,r,n,o){return i()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Ml(t)},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();return e&&!wr(e,t)?null:this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,r){var i=this.getTileGridForProjection(r),n=this.getTilePixelRatio(e),o=Ds(i.getTileSize(t),this.tmpSize);return 1==n?o:js(o,n,this.tmpSize)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var r=void 0!==e?e:this.getProjection(),i=this.getTileGridForProjection(r);return this.getWrapX()&&r.isGlobal()&&(t=function(t,e,r){var i=e[0],n=t.getTileCoordCenter(e),o=Nl(r);if(Ut(o,n))return e;var s=fe(o),a=Math.ceil((o[0]-n[0])/s);return n[0]+=s*a,t.getTileCoordForCoordAndZ(n,i)}(i,t,r)),function(t,e){var r=t[0],i=t[1],n=t[2];if(e.getMinZoom()>r||r>e.getMaxZoom())return!1;var o,s=e.getExtent();return!(o=s?e.getTileRangeForExtentAndZ(s,r):e.getFullTileRange(r))||o.containsXY(i,n)}(t,i)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var r=this.getTileCacheForProjection(e);t>r.highWaterMark&&(r.highWaterMark=t)},e.prototype.useTile=function(t,e,r,i){},e}(Mh),kh=function(t){function e(e,r){var i=t.call(this,e)||this;return i.tile=r,i}return Fh(e,t),e}(h),Nh=Ah;function jh(t,e){var r=/\{z\}/g,i=/\{x\}/g,n=/\{y\}/g,o=/\{-y\}/g;return function(s,a,l){return s?t.replace(r,s[0].toString()).replace(i,s[1].toString()).replace(n,s[2].toString()).replace(o,(function(){var t=s[0],r=e.getFullTileRange(t);return lt(r,55),(r.getHeight()-s[2]-1).toString()})):void 0}}function Dh(t,e){for(var r=t.length,i=new Array(r),n=0;n<r;++n)i[n]=jh(t[n],e);return Gh(i)}function Gh(t){return 1===t.length?t[0]:function(e,r,i){if(e){var n=Pe(Il(e),t.length);return t[n](e,r,i)}}}function zh(t,e,r){}function Bh(t){var e=[],r=/\{([a-z])-([a-z])\}/.exec(t);if(r){var i=r[1].charCodeAt(0),n=r[2].charCodeAt(0),o=void 0;for(o=i;o<=n;++o)e.push(t.replace(r[0],String.fromCharCode(o)));return e}if(r=/\{(\d+)-(\d+)\}/.exec(t)){for(var s=parseInt(r[2],10),a=parseInt(r[1],10);a<=s;a++)e.push(t.replace(r[0],a.toString()));return e}return e.push(t),e}var Uh=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Yh=function(t){function e(r){var i=t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,opaque:r.opaque,projection:r.projection,state:r.state,tileGrid:r.tileGrid,tilePixelRatio:r.tilePixelRatio,wrapX:r.wrapX,transition:r.transition,key:r.key,attributionsCollapsible:r.attributionsCollapsible,zDirection:r.zDirection})||this;return i.generateTileUrlFunction_=i.tileUrlFunction===e.prototype.tileUrlFunction,i.tileLoadFunction=r.tileLoadFunction,r.tileUrlFunction&&(i.tileUrlFunction=r.tileUrlFunction.bind(i)),i.urls=null,r.urls?i.setUrls(r.urls):r.url&&i.setUrl(r.url),i.tileLoadingKeys_={},i}return Uh(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,r=t.target,i=o(r),n=r.getState();n==hs?(this.tileLoadingKeys_[i]=!0,e=Rh):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],e=n==ps?Ih:n==cs?Ph:void 0),null!=e&&this.dispatchEvent(new kh(e,r))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=Bh(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(Dh(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,r){},e.prototype.useTile=function(t,e,r){var i=El(t,e,r);this.tileCache.containsKey(i)&&this.tileCache.get(i)},e}(Nh),Wh=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function Vh(t,e){t.getImage().src=e}var Xh=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Vh,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this;return r.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,r.tileClass=void 0!==e.tileClass?e.tileClass:gh,r.tileCacheForProjection={},r.tileGridForProjection={},r.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,r.contextOptions_=!1===e.imageSmoothing?mh:void 0,r.renderReprojectionEdges_=!1,r}return Wh(e,t),e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var r=this.getTileCacheForProjection(t);for(var i in this.tileCache.expireCache(this.tileCache==r?e:{}),this.tileCacheForProjection){var n=this.tileCacheForProjection[i];n.expireCache(n==r?e:{})}},e.prototype.getContextOptions=function(){return this.contextOptions_},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!wr(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){return t.prototype.getKey.call(this)+(this.contextOptions_?"\n"+JSON.stringify(this.contextOptions_):"")},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!wr(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!wr(e,t)){var r=o(t);return r in this.tileGridForProjection||(this.tileGridForProjection[r]=Ml(t)),this.tileGridForProjection[r]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||wr(e,t))return this.tileCache;var r=o(t);return r in this.tileCacheForProjection||(this.tileCacheForProjection[r]=new Eh(this.tileCache.highWaterMark)),this.tileCacheForProjection[r]},e.prototype.createTile_=function(t,e,r,i,n,o){var s=[t,e,r],a=this.getTileCoordForTileUrlFunction(s,n),l=a?this.tileUrlFunction(a,i,n):void 0,u=new this.tileClass(s,void 0!==l?us:ds,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=o,u.addEventListener(O,this.handleTileChange.bind(this)),u},e.prototype.getTile=function(t,e,r,i,n){var o=this.getProjection();if(o&&n&&!wr(o,n)){var s=this.getTileCacheForProjection(n),a=[t,e,r],l=void 0,u=Rl(a);s.containsKey(u)&&(l=s.get(u));var h=this.getKey();if(l&&l.key==h)return l;var c=this.getTileGridForProjection(o),p=this.getTileGridForProjection(n),d=this.getTileCoordForTileUrlFunction(a,n),f=new Sh(o,c,n,p,a,d,this.getTilePixelRatio(i),this.getGutter(),function(t,e,r,i){return this.getTileInternal(t,e,r,i,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.contextOptions_);return f.key=h,l?(f.interimTile=l,f.refreshInterimChain(),s.replace(u,f)):s.set(u,f),f}return this.getTileInternal(t,e,r,i,o||n)},e.prototype.getTileInternal=function(t,e,r,i,n){var o=null,s=El(t,e,r),a=this.getKey();if(this.tileCache.containsKey(s)){if((o=this.tileCache.get(s)).key!=a){var l=o;o=this.createTile_(t,e,r,i,n,a),l.getState()==us?o.interimTile=l.interimTile:o.interimTile=l,o.refreshInterimChain(),this.tileCache.replace(s,o)}}else o=this.createTile_(t,e,r,i,n,a),this.tileCache.set(s,o);return o},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var r=gr(t);if(r){var i=o(r);i in this.tileGridForProjection||(this.tileGridForProjection[i]=e)}},e}(Yh);function qh(t,e,r,i){var n=document.createElement("script"),s="olc_"+o(e);function a(){delete window[s],n.parentNode.removeChild(n)}n.async=!0,n.src=t+(-1==t.indexOf("?")?"?":"&")+(i||"callback")+"="+s;var l=setTimeout((function(){a(),r&&r()}),1e4);window[s]=function(t){clearTimeout(l),a(),e(t)},document.getElementsByTagName("head")[0].appendChild(n)}var Zh=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();var Kh=function(t){function e(e){var r=this,i=void 0!==e.hidpi&&e.hidpi;return(r=t.call(this,{cacheSize:e.cacheSize,crossOrigin:"anonymous",imageSmoothing:e.imageSmoothing,opaque:!0,projection:gr("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:Tn,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:i?2:1,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition})||this).hidpi_=i,r.culture_=void 0!==e.culture?e.culture:"en-us",r.maxZoom_=void 0!==e.maxZoom?e.maxZoom:-1,r.apiKey_=e.key,r.imagerySet_=e.imagerySet,qh("https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+r.imagerySet_+"?uriScheme=https&include=ImageryProviders&key="+r.apiKey_+"&c="+r.culture_,r.handleImageryMetadataResponse.bind(r),void 0,"jsonp"),r}return Zh(e,t),e.prototype.getApiKey=function(){return this.apiKey_},e.prototype.getImagerySet=function(){return this.imagerySet_},e.prototype.handleImageryMetadataResponse=function(t){if(200==t.statusCode&&"OK"==t.statusDescription&&"ValidCredentials"==t.authenticationResultCode&&1==t.resourceSets.length&&1==t.resourceSets[0].resources.length){var e=t.resourceSets[0].resources[0],r=-1==this.maxZoom_?e.zoomMax:this.maxZoom_,i=Nl(this.getProjection()),n=this.hidpi_?2:1,o=e.imageWidth==e.imageHeight?e.imageWidth/n:[e.imageWidth/n,e.imageHeight/n],s=Fl({extent:i,minZoom:e.zoomMin,maxZoom:r,tileSize:o});this.tileGrid=s;var a=this.culture_,l=this.hidpi_;if(this.tileUrlFunction=Gh(e.imageUrlSubdomains.map((function(t){var r=[0,0,0],i=e.imageUrl.replace("{subdomain}",t).replace("{culture}",a);return function(t,e,n){if(t){Cl(t[0],t[1],t[2],r);var o=i;return l&&(o+="&dpi=d1&device=mobile"),o.replace("{quadkey}",function(t){var e,r,i=t[0],n=new Array(i),o=1<<i-1;for(e=0;e<i;++e)r=48,t[1]&o&&(r+=1),t[2]&o&&(r+=2),n[e]=String.fromCharCode(r),o>>=1;return n.join("")}(r))}}}))),e.imageryProviders){var u=br(gr("EPSG:4326"),this.getProjection());this.setAttributions(function(t){var r=[],i=t.viewState,n=this.getTileGrid(),o=n.getZForResolution(i.resolution,this.zDirection),s=n.getTileCoordForCoordAndZ(i.center,o)[0];return e.imageryProviders.map((function(e){for(var i=!1,n=e.coverageAreas,o=0,a=n.length;o<a;++o){var l=n[o];if(s>=l.zoomMin&&s<=l.zoomMax){var h=l.bbox;if(ge(_e([h[1],h[0],h[3],h[2]],u),t.extent)){i=!0;break}}}i&&r.push(e.attribution)})),r.push('<a class="ol-attribution-bing-tos" href="https://www.microsoft.com/maps/product/terms.html" target="_blank">Terms of Use</a>'),r}.bind(this))}this.setState(Cn)}else this.setState(En)},e}(Xh),Hh=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Jh=function(t){function e(e){var r=e||{},i=void 0!==r.projection?r.projection:"EPSG:3857",n=void 0!==r.tileGrid?r.tileGrid:Fl({extent:Nl(i),maxResolution:r.maxResolution,maxZoom:r.maxZoom,minZoom:r.minZoom,tileSize:r.tileSize});return t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,imageSmoothing:r.imageSmoothing,opaque:r.opaque,projection:i,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileGrid:n,tileLoadFunction:r.tileLoadFunction,tilePixelRatio:r.tilePixelRatio,tileUrlFunction:r.tileUrlFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,attributionsCollapsible:r.attributionsCollapsible,zDirection:r.zDirection})||this}return Hh(e,t),e}(Xh),$h=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Qh=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,maxZoom:void 0!==e.maxZoom?e.maxZoom:18,minZoom:e.minZoom,projection:e.projection,wrapX:e.wrapX})||this;return r.account_=e.account,r.mapId_=e.map||"",r.config_=e.config||{},r.templateCache_={},r.initializeMap_(),r}return $h(e,t),e.prototype.getConfig=function(){return this.config_},e.prototype.updateConfig=function(t){T(this.config_,t),this.initializeMap_()},e.prototype.setConfig=function(t){this.config_=t||{},this.initializeMap_()},e.prototype.initializeMap_=function(){var t=JSON.stringify(this.config_);if(this.templateCache_[t])this.applyTemplate_(this.templateCache_[t]);else{var e="https://"+this.account_+".carto.com/api/v1/map";this.mapId_&&(e+="/named/"+this.mapId_);var r=new XMLHttpRequest;r.addEventListener("load",this.handleInitResponse_.bind(this,t)),r.addEventListener("error",this.handleInitError_.bind(this)),r.open("POST",e),r.setRequestHeader("Content-type","application/json"),r.send(JSON.stringify(this.config_))}},e.prototype.handleInitResponse_=function(t,e){var r=e.target;if(!r.status||r.status>=200&&r.status<300){var i=void 0;try{i=JSON.parse(r.responseText)}catch(t){return void this.setState(En)}this.applyTemplate_(i),this.templateCache_[t]=i,this.setState(Cn)}else this.setState(En)},e.prototype.handleInitError_=function(t){this.setState(En)},e.prototype.applyTemplate_=function(t){var e="https://"+t.cdn_url.https+"/"+this.account_+"/api/v1/map/"+t.layergroupid+"/{z}/{x}/{y}.png";this.setUrl(e)},e}(Jh),tc=r(1),ec=r.n(tc),rc=function(){function t(t){this.rbush_=new ec.a(t),this.items_={}}return t.prototype.insert=function(t,e){var r={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(r),this.items_[o(e)]=r},t.prototype.load=function(t,e){for(var r=new Array(e.length),i=0,n=e.length;i<n;i++){var s=t[i],a=e[i],l={minX:s[0],minY:s[1],maxX:s[2],maxY:s[3],value:a};r[i]=l,this.items_[o(a)]=l}this.rbush_.load(r)},t.prototype.remove=function(t){var e=o(t),r=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(r)},t.prototype.update=function(t,e){var r=this.items_[o(e)];Jt([r.minX,r.minY,r.maxX,r.maxY],t)||(this.remove(e),this.insert(t,e))},t.prototype.getAll=function(){return this.rbush_.all().map((function(t){return t.value}))},t.prototype.getInExtent=function(t){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map((function(t){return t.value}))},t.prototype.forEach=function(t){return this.forEach_(this.getAll(),t)},t.prototype.forEachInExtent=function(t,e){return this.forEach_(this.getInExtent(t),e)},t.prototype.forEach_=function(t,e){for(var r,i=0,n=t.length;i<n;i++)if(r=e(t[i]))return r;return r},t.prototype.isEmpty=function(){return R(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return qt(e.minX,e.minY,e.maxX,e.maxY,t)},t.prototype.concat=function(t){for(var e in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[e]=t.items_[e]},t}(),ic="addfeature",nc="changefeature",oc="clear",sc="removefeature",ac=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),lc=function(t){function e(e,r){var i=t.call(this,e)||this;return i.feature=r,i}return ac(e,t),e}(h),uc=function(t){function e(e){var r=this,i=e||{};(r=t.call(this,{attributions:i.attributions,projection:void 0,state:Cn,wrapX:void 0===i.wrapX||i.wrapX})||this).loader_=S,r.format_=i.format,r.overlaps_=void 0===i.overlaps||i.overlaps,r.url_=i.url,void 0!==i.loader?r.loader_=i.loader:void 0!==r.url_&&(lt(r.format_,7),r.loader_=xl(r.url_,r.format_)),r.strategy_=void 0!==i.strategy?i.strategy:wl;var n,o,s=void 0===i.useSpatialIndex||i.useSpatialIndex;return r.featuresRtree_=s?new rc:null,r.loadedExtentsRtree_=new rc,r.nullGeometryFeatures_={},r.idIndex_={},r.uidIndex_={},r.featureChangeKeys_={},r.featuresCollection_=null,Array.isArray(i.features)?o=i.features:i.features&&(o=(n=i.features).getArray()),s||void 0!==n||(n=new at(o)),void 0!==o&&r.addFeaturesInternal(o),void 0!==n&&r.bindFeaturesCollection_(n),r}return ac(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=o(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var r=t.getGeometry();if(r){var i=r.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(i,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new lc(ic,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[W(e,O,this.handleFeatureChange_,this),W(e,c,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var r=!0,i=e.getId();return void 0!==i&&(i.toString()in this.idIndex_?r=!1:this.idIndex_[i.toString()]=e),r&&(lt(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),r},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],r=[],i=[],n=0,s=t.length;n<s;n++){var a=o(u=t[n]);this.addToIndex_(a,u)&&r.push(u)}n=0;for(var l=r.length;n<l;n++){var u;a=o(u=r[n]);this.setupChangeEvents_(a,u);var h=u.getGeometry();if(h){var c=h.getExtent();e.push(c),i.push(u)}else this.nullGeometryFeatures_[a]=u}this.featuresRtree_&&this.featuresRtree_.load(e,i);n=0;for(var p=r.length;n<p;n++)this.dispatchEvent(new lc(ic,r[n]))},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(ic,(function(r){e||(e=!0,t.push(r.feature),e=!1)})),this.addEventListener(sc,(function(r){e||(e=!0,t.remove(r.feature),e=!1)})),t.addEventListener(rt,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(it,function(t){e||(e=!0,this.removeFeature(t.element),e=!1)}.bind(this)),this.featuresCollection_=t},e.prototype.clear=function(t){if(t){for(var e in this.featureChangeKeys_){this.featureChangeKeys_[e].forEach(X)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_)for(var r in this.featuresRtree_.forEach(this.removeFeatureInternal.bind(this)),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[r]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var i=new lc(oc);this.dispatchEvent(i),this.changed()},e.prototype.forEachFeature=function(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},e.prototype.forEachFeatureAtCoordinateDirect=function(t,e){var r=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(r,(function(r){return r.getGeometry().intersectsCoordinate(t)?e(r):void 0}))},e.prototype.forEachFeatureInExtent=function(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},e.prototype.forEachFeatureIntersectingExtent=function(t,e){return this.forEachFeatureInExtent(t,(function(r){if(r.getGeometry().intersectsExtent(t)){var i=e(r);if(i)return i}}))},e.prototype.getFeaturesCollection=function(){return this.featuresCollection_},e.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray():this.featuresRtree_&&(t=this.featuresRtree_.getAll(),R(this.nullGeometryFeatures_)||m(t,E(this.nullGeometryFeatures_))),t},e.prototype.getFeaturesAtCoordinate=function(t){var e=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){e.push(t)})),e},e.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_?this.featuresRtree_.getInExtent(t):this.featuresCollection_?this.featuresCollection_.getArray():[]},e.prototype.getClosestFeatureToCoordinate=function(t,e){var r=t[0],i=t[1],n=null,o=[NaN,NaN],s=1/0,a=[-1/0,-1/0,1/0,1/0],l=e||w;return this.featuresRtree_.forEachInExtent(a,(function(t){if(l(t)){var e=t.getGeometry(),u=s;if((s=e.closestPointXY(r,i,o,s))<u){n=t;var h=Math.sqrt(s);a[0]=r-h,a[1]=i-h,a[2]=r+h,a[3]=i+h}}})),n},e.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},e.prototype.getFeatureById=function(t){var e=this.idIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getFeatureByUid=function(t){var e=this.uidIndex_[t];return void 0!==e?e:null},e.prototype.getFormat=function(){return this.format_},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.getUrl=function(){return this.url_},e.prototype.handleFeatureChange_=function(t){var e=t.target,r=o(e),i=e.getGeometry();if(i){var n=i.getExtent();r in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[r],this.featuresRtree_&&this.featuresRtree_.insert(n,e)):this.featuresRtree_&&this.featuresRtree_.update(n,e)}else r in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[r]=e);var s=e.getId();if(void 0!==s){var a=s.toString();this.idIndex_[a]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[a]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[r]=e;this.changed(),this.dispatchEvent(new lc(nc,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:o(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&R(this.nullGeometryFeatures_)},e.prototype.loadFeatures=function(t,e,r){var i=this.loadedExtentsRtree_,n=this.strategy_(t,e);this.loading=!1;for(var o=function(t,o){var a=n[t];i.forEachInExtent(a,(function(t){return Yt(t.extent,a)}))||(s.loader_.call(s,a,e,r),i.insert(a,{extent:a.slice()}),s.loading=s.loader_!==S)},s=this,a=0,l=n.length;a<l;++a)o(a)},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,r=this.loadedExtentsRtree_;r.forEachInExtent(t,(function(r){if(Jt(r.extent,t))return e=r,!0})),e&&r.remove(e)},e.prototype.removeFeature=function(t){var e=o(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t),this.changed()},e.prototype.removeFeatureInternal=function(t){var e=o(t);this.featureChangeKeys_[e].forEach(X),delete this.featureChangeKeys_[e];var r=t.getId();void 0!==r&&delete this.idIndex_[r.toString()],delete this.uidIndex_[e],this.dispatchEvent(new lc(sc,t))},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var r in this.idIndex_)if(this.idIndex_[r]===t){delete this.idIndex_[r],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){lt(this.format_,7),this.setLoader(xl(t,this.format_))},e}(Mh),hc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),cc=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,wrapX:e.wrapX})||this;return r.resolution=void 0,r.distance=void 0!==e.distance?e.distance:20,r.features=[],r.geometryFunction=e.geometryFunction||function(t){var e=t.getGeometry();return lt(e.getType()==gt.POINT,10),e},r.boundRefresh_=r.refresh.bind(r),r.setSource(e.source||null),r}return hc(e,t),e.prototype.clear=function(e){this.features.length=0,t.prototype.clear.call(this,e)},e.prototype.getDistance=function(){return this.distance},e.prototype.getSource=function(){return this.source},e.prototype.loadFeatures=function(t,e,r){this.source.loadFeatures(t,e,r),e!==this.resolution&&(this.clear(),this.resolution=e,this.cluster(),this.addFeatures(this.features))},e.prototype.setDistance=function(t){this.distance=t,this.refresh()},e.prototype.setSource=function(t){this.source&&this.source.removeEventListener(O,this.boundRefresh_),this.source=t,t&&t.addEventListener(O,this.boundRefresh_),this.refresh()},e.prototype.refresh=function(){this.clear(),this.cluster(),this.addFeatures(this.features)},e.prototype.cluster=function(){if(void 0!==this.resolution&&this.source)for(var t=[1/0,1/0,-1/0,-1/0],e=this.distance*this.resolution,r=this.source.getFeatures(),i={},n=0,s=r.length;n<s;n++){var a=r[n];if(!(o(a)in i)){var l=this.geometryFunction(a);if(l){Kt(l.getCoordinates(),t),Gt(t,e,t);var u=this.source.getFeaturesInExtent(t);u=u.filter((function(t){var e=o(t);return!(e in i)&&(i[e]=!0,!0)})),this.features.push(this.createCluster(u))}}}},e.prototype.createCluster=function(t){for(var e=[0,0],r=t.length-1;r>=0;--r){var i=this.geometryFunction(t[r]);i?Qe(e,i.getCoordinates()):t.splice(r,1)}or(e,1/t.length);var n=new ht(new pi(e));return n.set("features",t),n},e}(uc),pc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),dc="default",fc="truncated",gc=function(t){function e(e,r,i,n,o,s,a){var l=t.call(this,r,i,n,o,s,a)||this;return l.zoomifyImage_=null,l.tileSize_=e,l}return pc(e,t),e.prototype.getImage=function(){if(this.zoomifyImage_)return this.zoomifyImage_;var e=t.prototype.getImage.call(this);if(this.state==cs){var r=this.tileSize_;if(e.width==r[0]&&e.height==r[1])return this.zoomifyImage_=e,e;var i=zn(r[0],r[1]);return i.drawImage(e,0,0),this.zoomifyImage_=i.canvas,i.canvas}return e},e}(gh),yc=function(t){function e(e){var r=this,i=e,n=i.size,o=void 0!==i.tierSizeCalculation?i.tierSizeCalculation:dc,s=i.tilePixelRatio||1,a=n[0],l=n[1],u=[],h=i.tileSize||256,c=h*s;switch(o){case dc:for(;a>c||l>c;)u.push([Math.ceil(a/c),Math.ceil(l/c)]),c+=c;break;case fc:for(var p=a,d=l;p>c||d>c;)u.push([Math.ceil(p/c),Math.ceil(d/c)]),p>>=1,d>>=1;break;default:lt(!1,53)}u.push([1,1]),u.reverse();for(var f=[s],g=[0],y=1,m=u.length;y<m;y++)f.push(s<<y),g.push(u[y-1][0]*u[y-1][1]+g[y-1]);f.reverse();var _=new Ll({tileSize:h,extent:i.extent||[0,-l,a,0],resolutions:f}),v=i.url;v&&-1==v.indexOf("{TileGroup}")&&-1==v.indexOf("{tileIndex}")&&(v+="{TileGroup}/{z}-{x}-{y}.jpg");var x=Bh(v),w=h*s;var b=Gh(x.map((function(t){return function(e,r,i){if(e){var n=e[0],o=e[1],s=e[2],a=o+s*u[n][0],l={z:n,x:o,y:s,tileIndex:a,TileGroup:"TileGroup"+((a+g[n])/w|0)};return t.replace(/\{(\w+?)\}/g,(function(t,e){return l[e]}))}}}))),S=gc.bind(null,Ds(h*s));(r=t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,imageSmoothing:i.imageSmoothing,projection:i.projection,tilePixelRatio:s,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileClass:S,tileGrid:_,tileUrlFunction:b,transition:i.transition})||this).zDirection=i.zDirection;var T=b(_.getTileCoordForCoordAndResolution(ae(_.getExtent()),f[f.length-1]),1,null),C=new Image;return C.addEventListener("error",function(){w=h,this.changed()}.bind(r)),C.src=T,r}return pc(e,t),e}(Xh),mc=function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var i=Array(t),n=0;for(e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,n++)i[n]=o[s];return i},_c="version1",vc="version2",xc="version3",wc={};wc[_c]={level0:{supports:[],formats:[],qualities:["native"]},level1:{supports:["regionByPx","sizeByW","sizeByH","sizeByPct"],formats:["jpg"],qualities:["native"]},level2:{supports:["regionByPx","regionByPct","sizeByW","sizeByH","sizeByPct","sizeByConfinedWh","sizeByWh"],formats:["jpg","png"],qualities:["native","color","grey","bitonal"]}},wc[vc]={level0:{supports:[],formats:["jpg"],qualities:["default"]},level1:{supports:["regionByPx","sizeByW","sizeByH","sizeByPct"],formats:["jpg"],qualities:["default"]},level2:{supports:["regionByPx","regionByPct","sizeByW","sizeByH","sizeByPct","sizeByConfinedWh","sizeByDistortedWh","sizeByWh"],formats:["jpg","png"],qualities:["default","bitonal"]}},wc[xc]={level0:{supports:[],formats:["jpg"],qualities:["default"]},level1:{supports:["regionByPx","regionSquare","sizeByW","sizeByH","sizeByWh"],formats:["jpg"],qualities:["default"]},level2:{supports:["regionByPx","regionSquare","regionByPct","sizeByW","sizeByH","sizeByPct","sizeByConfinedWh","sizeByWh"],formats:["jpg","png"],qualities:["default"]}},wc.none={none:{supports:[],formats:[],qualities:[]}};var bc=/^https?:\/\/library\.stanford\.edu\/iiif\/image-api\/(?:1\.1\/)?compliance\.html#level[0-2]$/,Sc=/^https?:\/\/iiif\.io\/api\/image\/2\/level[0-2](?:\.json)?$/,Tc=/(^https?:\/\/iiif\.io\/api\/image\/3\/level[0-2](?:\.json)?$)|(^level[0-2]$)/;var Cc={};Cc[_c]=function(t){var e=t.getComplianceLevelSupportedFeatures();return void 0===e&&(e=wc[_c].level0),{url:void 0===t.imageInfo["@id"]?void 0:t.imageInfo["@id"].replace(/\/?(?:info\.json)?$/g,""),supports:e.supports,formats:mc(e.formats,[void 0===t.imageInfo.formats?[]:t.imageInfo.formats]),qualities:mc(e.qualities,[void 0===t.imageInfo.qualities?[]:t.imageInfo.qualities]),resolutions:t.imageInfo.scale_factors,tileSize:void 0!==t.imageInfo.tile_width?void 0!==t.imageInfo.tile_height?[t.imageInfo.tile_width,t.imageInfo.tile_height]:[t.imageInfo.tile_width,t.imageInfo.tile_width]:null!=t.imageInfo.tile_height?[t.imageInfo.tile_height,t.imageInfo.tile_height]:void 0}},Cc[vc]=function(t){var e=t.getComplianceLevelSupportedFeatures(),r=Array.isArray(t.imageInfo.profile)&&t.imageInfo.profile.length>1,i=r&&t.imageInfo.profile[1].supports?t.imageInfo.profile[1].supports:[],n=r&&t.imageInfo.profile[1].formats?t.imageInfo.profile[1].formats:[],o=r&&t.imageInfo.profile[1].qualities?t.imageInfo.profile[1].qualities:[];return{url:t.imageInfo["@id"].replace(/\/?(?:info\.json)?$/g,""),sizes:void 0===t.imageInfo.sizes?void 0:t.imageInfo.sizes.map((function(t){return[t.width,t.height]})),tileSize:void 0===t.imageInfo.tiles?void 0:[t.imageInfo.tiles.map((function(t){return t.width}))[0],t.imageInfo.tiles.map((function(t){return void 0===t.height?t.width:t.height}))[0]],resolutions:void 0===t.imageInfo.tiles?void 0:t.imageInfo.tiles.map((function(t){return t.scaleFactors}))[0],supports:mc(e.supports,i),formats:mc(e.formats,n),qualities:mc(e.qualities,o)}},Cc[xc]=function(t){var e=t.getComplianceLevelSupportedFeatures(),r=void 0===t.imageInfo.extraFormats?e.formats:mc(e.formats,t.imageInfo.extraFormats),i=void 0!==t.imageInfo.preferredFormats&&Array.isArray(t.imageInfo.preferredFormats)&&t.imageInfo.preferredFormats.length>0?t.imageInfo.preferredFormats.filter((function(t){return["jpg","png","gif"].includes(t)})).reduce((function(t,e){return void 0===t&&r.includes(e)?e:t}),void 0):void 0;return{url:t.imageInfo.id,sizes:void 0===t.imageInfo.sizes?void 0:t.imageInfo.sizes.map((function(t){return[t.width,t.height]})),tileSize:void 0===t.imageInfo.tiles?void 0:[t.imageInfo.tiles.map((function(t){return t.width}))[0],t.imageInfo.tiles.map((function(t){return t.height}))[0]],resolutions:void 0===t.imageInfo.tiles?void 0:t.imageInfo.tiles.map((function(t){return t.scaleFactors}))[0],supports:void 0===t.imageInfo.extraFeatures?e.supports:mc(e.supports,t.imageInfo.extraFeatures),formats:r,qualities:void 0===t.imageInfo.extraQualities?e.qualities:mc(e.qualities,t.imageInfo.extraQualities),preferredFormat:i}};var Ec=function(){function t(t){this.setImageInfo(t)}return t.prototype.setImageInfo=function(t){this.imageInfo="string"==typeof t?JSON.parse(t):t},t.prototype.getImageApiVersion=function(){if(void 0!==this.imageInfo){var t=this.imageInfo["@context"]||"ol-no-context";"string"==typeof t&&(t=[t]);for(var e=0;e<t.length;e++)switch(t[e]){case"http://library.stanford.edu/iiif/image-api/1.1/context.json":case"http://iiif.io/api/image/1/context.json":return _c;case"http://iiif.io/api/image/2/context.json":return vc;case"http://iiif.io/api/image/3/context.json":return xc;case"ol-no-context":if(this.getComplianceLevelEntryFromProfile(_c)&&this.imageInfo.identifier)return _c}lt(!1,61)}},t.prototype.getComplianceLevelEntryFromProfile=function(t){if(void 0!==this.imageInfo&&void 0!==this.imageInfo.profile)switch(void 0===t&&(t=this.getImageApiVersion()),t){case _c:if(bc.test(this.imageInfo.profile))return this.imageInfo.profile;break;case xc:if(Tc.test(this.imageInfo.profile))return this.imageInfo.profile;break;case vc:if("string"==typeof this.imageInfo.profile&&Sc.test(this.imageInfo.profile))return this.imageInfo.profile;if(Array.isArray(this.imageInfo.profile)&&this.imageInfo.profile.length>0&&"string"==typeof this.imageInfo.profile[0]&&Sc.test(this.imageInfo.profile[0]))return this.imageInfo.profile[0]}},t.prototype.getComplianceLevelFromProfile=function(t){var e=this.getComplianceLevelEntryFromProfile(t);if(void 0!==e){var r=e.match(/level[0-2](?:\.json)?$/g);return Array.isArray(r)?r[0].replace(".json",""):void 0}},t.prototype.getComplianceLevelSupportedFeatures=function(){if(void 0!==this.imageInfo){var t=this.getImageApiVersion(),e=this.getComplianceLevelFromProfile(t);return void 0===e?wc.none.none:wc[t][e]}},t.prototype.getTileSourceOptions=function(t){var e=t||{},r=this.getImageApiVersion();if(void 0!==r){var i=void 0===r?void 0:Cc[r](this);if(void 0!==i)return{url:i.url,version:r,size:[this.imageInfo.width,this.imageInfo.height],sizes:i.sizes,format:void 0!==e.format&&i.formats.includes(e.format)?e.format:void 0!==i.preferredFormat?i.preferredFormat:"jpg",supports:i.supports,quality:e.quality&&i.qualities.includes(e.quality)?e.quality:i.qualities.includes("native")?"native":"default",resolutions:Array.isArray(i.resolutions)?i.resolutions.sort((function(t,e){return e-t})):void 0,tileSize:i.tileSize}}},t}(),Rc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function Pc(t){return t.toLocaleString("en",{maximumFractionDigits:10})}var Ic=function(t){function e(e){var r=this,i=e||{},n=i.url||"";n+=n.lastIndexOf("/")===n.length-1||""===n?"":"/";var o=i.version||vc,s=i.sizes||[],a=i.size;lt(null!=a&&Array.isArray(a)&&2==a.length&&!isNaN(a[0])&&a[0]>0&&!isNaN(a[1])&&a[1]>0,60);var l,u,h,c=a[0],p=a[1],d=i.tileSize,f=i.tilePixelRatio||1,g=i.format||"jpg",y=i.quality||(i.version==_c?"native":"default"),m=i.resolutions||[],_=i.supports||[],v=i.extent||[0,-p,c,0],x=null!=s&&Array.isArray(s)&&s.length>0,w=void 0!==d&&("number"==typeof d&&Number.isInteger(d)&&d>0||Array.isArray(d)&&d.length>0),b=null!=_&&Array.isArray(_)&&(_.includes("regionByPx")||_.includes("regionByPct"))&&(_.includes("sizeByWh")||_.includes("sizeByH")||_.includes("sizeByW")||_.includes("sizeByPct"));if(m.sort((function(t,e){return e-t})),w||b)if(null!=d&&("number"==typeof d&&Number.isInteger(d)&&d>0?(l=d,u=d):Array.isArray(d)&&d.length>0&&((1==d.length||null==d[1]&&Number.isInteger(d[0]))&&(l=d[0],u=d[0]),2==d.length&&(Number.isInteger(d[0])&&Number.isInteger(d[1])?(l=d[0],u=d[1]):null==d[0]&&Number.isInteger(d[1])&&(l=d[1],u=d[1])))),void 0!==l&&void 0!==u||(l=256,u=256),0==m.length)for(var S=h=Math.max(Math.ceil(Math.log(c/l)/Math.LN2),Math.ceil(Math.log(p/u)/Math.LN2));S>=0;S--)m.push(Math.pow(2,S));else{var T=Math.max.apply(Math,m);h=Math.round(Math.log(T)/Math.LN2)}else if(l=c,u=p,m=[],x){s.sort((function(t,e){return t[0]-e[0]})),h=-1;var C=[];for(S=0;S<s.length;S++){var E=c/s[S][0];m.length>0&&m[m.length-1]==E?C.push(S):(m.push(E),h++)}if(C.length>0)for(S=0;S<C.length;S++)s.splice(C[S]-S,1)}else m.push(1),s.push([c,p]),h=0;var R=new Ll({tileSize:[l,u],extent:v,origin:pe(v),resolutions:m}),P=gc.bind(null,Ds(d||256).map((function(t){return t*f})));return(r=t.call(this,{attributions:i.attributions,attributionsCollapsible:i.attributionsCollapsible,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,imageSmoothing:i.imageSmoothing,projection:i.projection,reprojectionErrorThreshold:i.reprojectionErrorThreshold,state:i.state,tileClass:P,tileGrid:R,tilePixelRatio:i.tilePixelRatio,tileUrlFunction:function(t,e,r){var i,a,d=t[0];if(!(d>h)){var f=t[1],v=t[2],S=m[d];if(!(void 0===f||void 0===v||void 0===S||f<0||Math.ceil(c/S/l)<=f||v<0||Math.ceil(p/S/u)<=v)){if(b||w){var T=f*l*S,C=v*u*S,E=l*S,R=u*S,P=l,I=u;if(T+E>c&&(E=c-T),C+R>p&&(R=p-C),T+l*S>c&&(P=Math.floor((c-T+S-1)/S)),C+u*S>p&&(I=Math.floor((p-C+S-1)/S)),0==T&&E==c&&0==C&&R==p)i="full";else if(!b||_.includes("regionByPx"))i=T+","+C+","+E+","+R;else if(_.includes("regionByPct")){i="pct:"+Pc(T/c*100)+","+Pc(C/p*100)+","+Pc(E/c*100)+","+Pc(R/p*100)}o!=xc||b&&!_.includes("sizeByWh")?!b||_.includes("sizeByW")?a=P+",":_.includes("sizeByH")?a=","+I:_.includes("sizeByWh")?a=P+","+I:_.includes("sizeByPct")&&(a="pct:"+Pc(100/S)):a=P+","+I}else if(i="full",x){var O=s[d][0],L=s[d][1];a=o==xc?O==c&&L==p?"max":O+","+L:O==c?"full":O+","}else a=o==xc?"max":"full";return n+i+"/"+a+"/0/"+y+"."+g}}},transition:i.transition})||this).zDirection=i.zDirection,r}return Rc(e,t),e}(Xh),Oc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Lc=function(t){function e(e,r,i,n,o,s,a){var l=this,u=e.getExtent(),h=r.getExtent(),c=h?ce(i,h):i,p=xh(e,r,ae(c),n),d=new yh(e,r,c,u,.5*p,n),f=s(d.calculateSourceExtent(),p,o),g=f?bo:Eo,y=f?f.getPixelRatio():1;return(l=t.call(this,i,n,y,g)||this).targetProj_=r,l.maxSourceExtent_=u,l.triangulation_=d,l.targetResolution_=n,l.targetExtent_=i,l.sourceImage_=f,l.sourcePixelRatio_=y,l.contextOptions_=a,l.canvas_=null,l.sourceListenerKey_=null,l}return Oc(e,t),e.prototype.disposeInternal=function(){this.state==So&&this.unlistenSource_(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.canvas_},e.prototype.getProjection=function(){return this.targetProj_},e.prototype.reproject_=function(){var t=this.sourceImage_.getState();if(t==To){var e=fe(this.targetExtent_)/this.targetResolution_,r=he(this.targetExtent_)/this.targetResolution_;this.canvas_=wh(e,r,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.contextOptions_)}this.state=t,this.changed()},e.prototype.load=function(){if(this.state==bo){this.state=So,this.changed();var t=this.sourceImage_.getState();t==To||t==Co?this.reproject_():(this.sourceListenerKey_=W(this.sourceImage_,O,(function(t){var e=this.sourceImage_.getState();e!=To&&e!=Co||(this.unlistenSource_(),this.reproject_())}),this),this.sourceImage_.load())}},e.prototype.unlistenSource_=function(){X(this.sourceListenerKey_),this.sourceListenerKey_=null},e}(Xu),Mc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Fc="imageloadstart",Ac="imageloadend",kc="imageloaderror",Nc=function(t){function e(e,r){var i=t.call(this,e)||this;return i.image=r,i}return Mc(e,t),e}(h);function jc(t,e){t.getImage().src=e}var Dc=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,projection:e.projection,state:e.state})||this;return r.resolutions_=void 0!==e.resolutions?e.resolutions:null,r.reprojectedImage_=null,r.reprojectedRevision_=0,r.contextOptions_=!1===e.imageSmoothing?mh:void 0,r}return Mc(e,t),e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getContextOptions=function(){return this.contextOptions_},e.prototype.findNearestResolution=function(t){if(this.resolutions_){var e=g(this.resolutions_,t,0);t=this.resolutions_[e]}return t},e.prototype.getImage=function(t,e,r,i){var n=this.getProjection();if(n&&i&&!wr(n,i)){if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&wr(this.reprojectedImage_.getProjection(),i)&&this.reprojectedImage_.getResolution()==e&&Jt(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new Lc(n,i,t,e,r,function(t,e,r){return this.getImageInternal(t,e,r,n)}.bind(this),this.contextOptions_),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}return n&&(i=n),this.getImageInternal(t,e,r,i)},e.prototype.getImageInternal=function(t,e,r,n){return i()},e.prototype.handleImageChange=function(t){var e=t.target;switch(e.getState()){case So:this.loading=!0,this.dispatchEvent(new Nc(Fc,e));break;case To:this.loading=!1,this.dispatchEvent(new Nc(Ac,e));break;case Co:this.loading=!1,this.dispatchEvent(new Nc(kc,e))}},e}(Mh);function Gc(t,e){var r=[];Object.keys(e).forEach((function(t){null!==e[t]&&void 0!==e[t]&&r.push(t+"="+encodeURIComponent(e[t]))}));var i=r.join("&");return(t=-1===(t=t.replace(/[?&]$/,"")).indexOf("?")?t+"?":t+"&")+i}var zc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Bc=function(t){function e(e){var r=this,i=e||{};return(r=t.call(this,{attributions:i.attributions,imageSmoothing:i.imageSmoothing,projection:i.projection,resolutions:i.resolutions})||this).crossOrigin_=void 0!==i.crossOrigin?i.crossOrigin:null,r.hidpi_=void 0===i.hidpi||i.hidpi,r.url_=i.url,r.imageLoadFunction_=void 0!==i.imageLoadFunction?i.imageLoadFunction:jc,r.params_=i.params||{},r.image_=null,r.imageSize_=[0,0],r.renderedRevision_=0,r.ratio_=void 0!==i.ratio?i.ratio:1.5,r}return zc(e,t),e.prototype.getParams=function(){return this.params_},e.prototype.getImageInternal=function(t,e,r,i){if(void 0===this.url_)return null;e=this.findNearestResolution(e),r=this.hidpi_?r:1;var n=this.image_;if(n&&this.renderedRevision_==this.getRevision()&&n.getResolution()==e&&n.getPixelRatio()==r&&Yt(n.getExtent(),t))return n;var o={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};T(o,this.params_);var s=((t=t.slice())[0]+t[2])/2,a=(t[1]+t[3])/2;if(1!=this.ratio_){var l=this.ratio_*fe(t)/2,u=this.ratio_*he(t)/2;t[0]=s-l,t[1]=a-u,t[2]=s+l,t[3]=a+u}var h=e/r,c=Math.ceil(fe(t)/h),p=Math.ceil(he(t)/h);t[0]=s-h*c/2,t[2]=s+h*c/2,t[1]=a-h*p/2,t[3]=a+h*p/2,this.imageSize_[0]=c,this.imageSize_[1]=p;var d=this.getRequestUrl_(t,this.imageSize_,r,i,o);return this.image_=new Ku(t,e,r,d,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this.image_.addEventListener(O,this.handleImageChange.bind(this)),this.image_},e.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},e.prototype.getRequestUrl_=function(t,e,r,i,n){var o=i.getCode().split(":").pop();n.SIZE=e[0]+","+e[1],n.BBOX=t.join(","),n.BBOXSR=o,n.IMAGESR=o,n.DPI=Math.round(90*r);var s=this.url_,a=s.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage");return a==s&&lt(!1,50),Gc(a,n)},e.prototype.getUrl=function(){return this.url_},e.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()},e.prototype.setUrl=function(t){t!=this.url_&&(this.url_=t,this.image_=null,this.changed())},e.prototype.updateParams=function(t){T(this.params_,t),this.image_=null,this.changed()},e}(Dc),Uc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Yc=function(t){function e(e,r,i,n,o){var s=this,a=void 0!==o?bo:To;return(s=t.call(this,e,r,i,a)||this).loader_=void 0!==o?o:null,s.canvas_=n,s.error_=null,s}return Uc(e,t),e.prototype.getError=function(){return this.error_},e.prototype.handleLoad_=function(t){t?(this.error_=t,this.state=Co):this.state=To,this.changed()},e.prototype.load=function(){this.state==bo&&(this.state=So,this.changed(),this.loader_(this.handleLoad_.bind(this)))},e.prototype.getImage=function(){return this.canvas_},e}(Xu),Wc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Vc=function(t){function e(e){var r=this,i=e||{};return(r=t.call(this,{attributions:i.attributions,imageSmoothing:i.imageSmoothing,projection:i.projection,resolutions:i.resolutions,state:i.state})||this).canvasFunction_=i.canvasFunction,r.canvas_=null,r.renderedRevision_=0,r.ratio_=void 0!==i.ratio?i.ratio:1.5,r}return Wc(e,t),e.prototype.getImageInternal=function(t,e,r,i){e=this.findNearestResolution(e);var n=this.canvas_;if(n&&this.renderedRevision_==this.getRevision()&&n.getResolution()==e&&n.getPixelRatio()==r&&Yt(n.getExtent(),t))return n;me(t=t.slice(),this.ratio_);var o=[fe(t)/e*r,he(t)/e*r],s=this.canvasFunction_.call(this,t,e,r,o,i);return s&&(n=new Yc(t,e,r,s)),this.canvas_=n,this.renderedRevision_=this.getRevision(),n},e}(Dc),Xc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();var qc=function(t){function e(e){var r=t.call(this,{imageSmoothing:e.imageSmoothing,projection:e.projection,resolutions:e.resolutions})||this;return r.crossOrigin_=void 0!==e.crossOrigin?e.crossOrigin:null,r.displayDpi_=void 0!==e.displayDpi?e.displayDpi:96,r.params_=e.params||{},r.url_=e.url,r.imageLoadFunction_=void 0!==e.imageLoadFunction?e.imageLoadFunction:jc,r.hidpi_=void 0===e.hidpi||e.hidpi,r.metersPerUnit_=void 0!==e.metersPerUnit?e.metersPerUnit:1,r.ratio_=void 0!==e.ratio?e.ratio:1,r.useOverlay_=void 0!==e.useOverlay&&e.useOverlay,r.image_=null,r.renderedRevision_=0,r}return Xc(e,t),e.prototype.getParams=function(){return this.params_},e.prototype.getImageInternal=function(t,e,r,i){e=this.findNearestResolution(e),r=this.hidpi_?r:1;var n=this.image_;if(n&&this.renderedRevision_==this.getRevision()&&n.getResolution()==e&&n.getPixelRatio()==r&&Yt(n.getExtent(),t))return n;1!=this.ratio_&&me(t=t.slice(),this.ratio_);var o=[fe(t)/e*r,he(t)/e*r];if(void 0!==this.url_){var s=this.getUrl(this.url_,this.params_,t,o,i);(n=new Ku(t,e,r,s,this.crossOrigin_,this.imageLoadFunction_)).addEventListener(O,this.handleImageChange.bind(this))}else n=null;return this.image_=n,this.renderedRevision_=this.getRevision(),n},e.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},e.prototype.updateParams=function(t){T(this.params_,t),this.changed()},e.prototype.getUrl=function(t,e,r,i,n){var o=function(t,e,r,i){var n=fe(t),o=he(t),s=e[0],a=e[1],l=.0254/i;return a*n>s*o?n*r/(s*l):o*r/(a*l)}(r,i,this.metersPerUnit_,this.displayDpi_),s=ae(r),a={OPERATION:this.useOverlay_?"GETDYNAMICMAPOVERLAYIMAGE":"GETMAPIMAGE",VERSION:"2.0.0",LOCALE:"en",CLIENTAGENT:"ol/source/ImageMapGuide source",CLIP:"1",SETDISPLAYDPI:this.displayDpi_,SETDISPLAYWIDTH:Math.round(i[0]),SETDISPLAYHEIGHT:Math.round(i[1]),SETVIEWSCALE:o,SETVIEWCENTERX:s[0],SETVIEWCENTERY:s[1]};return T(a,e),Gc(t,a)},e.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()},e}(Dc),Zc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Kc=function(t){function e(e){var r=this,i=void 0!==e.crossOrigin?e.crossOrigin:null,n=void 0!==e.imageLoadFunction?e.imageLoadFunction:jc;return(r=t.call(this,{attributions:e.attributions,imageSmoothing:e.imageSmoothing,projection:gr(e.projection)})||this).url_=e.url,r.imageExtent_=e.imageExtent,r.image_=new Ku(r.imageExtent_,void 0,1,r.url_,i,n),r.imageSize_=e.imageSize?e.imageSize:null,r.image_.addEventListener(O,r.handleImageChange.bind(r)),r}return Zc(e,t),e.prototype.getImageExtent=function(){return this.imageExtent_},e.prototype.getImageInternal=function(t,e,r,i){return ge(t,this.image_.getExtent())?this.image_:null},e.prototype.getUrl=function(){return this.url_},e.prototype.handleImageChange=function(e){if(this.image_.getState()==To){var r=this.image_.getExtent(),i=this.image_.getImage(),n=void 0,o=void 0;this.imageSize_?(n=this.imageSize_[0],o=this.imageSize_[1]):(n=i.width,o=i.height);var s=he(r)/o,a=Math.ceil(fe(r)/s);if(a!=n){var l=zn(a,o),u=l.canvas;l.drawImage(i,0,0,n,o,0,0,u.width,u.height),this.image_.setImage(u)}}t.prototype.handleImageChange.call(this,e)},e}(Dc),Hc="carmentaserver",Jc="geoserver",$c="mapserver",Qc="qgis",tp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),ep=[101,101],rp=function(t){function e(e){var r=this,i=e||{};return(r=t.call(this,{attributions:i.attributions,imageSmoothing:i.imageSmoothing,projection:i.projection,resolutions:i.resolutions})||this).crossOrigin_=void 0!==i.crossOrigin?i.crossOrigin:null,r.url_=i.url,r.imageLoadFunction_=void 0!==i.imageLoadFunction?i.imageLoadFunction:jc,r.params_=i.params||{},r.v13_=!0,r.updateV13_(),r.serverType_=i.serverType,r.hidpi_=void 0===i.hidpi||i.hidpi,r.image_=null,r.imageSize_=[0,0],r.renderedRevision_=0,r.ratio_=void 0!==i.ratio?i.ratio:1.5,r}return tp(e,t),e.prototype.getFeatureInfoUrl=function(t,e,r,i){if(void 0!==this.url_){var n=gr(r),o=this.getProjection();o&&o!==n&&(e=xh(o,n,t,e),t=Tr(t,n,o));var s=ue(t,e,0,ep),a={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};T(a,this.params_,i);var l=Math.floor((t[0]-s[0])/e),u=Math.floor((s[3]-t[1])/e);return a[this.v13_?"I":"X"]=l,a[this.v13_?"J":"Y"]=u,this.getRequestUrl_(s,ep,1,o||n,a)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.url_){var r={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){var i=this.params_.LAYERS;if(!(!Array.isArray(i)||1===i.length))return;r.LAYER=i}if(void 0!==t){var n=this.getProjection()?this.getProjection().getMetersPerUnit():1;r.SCALE=t*n*39.37*(25.4/.28)}return T(r,e),Gc(this.url_,r)}},e.prototype.getParams=function(){return this.params_},e.prototype.getImageInternal=function(t,e,r,i){if(void 0===this.url_)return null;e=this.findNearestResolution(e),1==r||this.hidpi_&&void 0!==this.serverType_||(r=1);var n=e/r,o=ae(t),s=ue(o,n,0,[Math.ceil(fe(t)/n),Math.ceil(he(t)/n)]),a=ue(o,n,0,[Math.ceil(this.ratio_*fe(t)/n),Math.ceil(this.ratio_*he(t)/n)]),l=this.image_;if(l&&this.renderedRevision_==this.getRevision()&&l.getResolution()==e&&l.getPixelRatio()==r&&Yt(l.getExtent(),s))return l;var u={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};T(u,this.params_),this.imageSize_[0]=Math.round(fe(a)/n),this.imageSize_[1]=Math.round(he(a)/n);var h=this.getRequestUrl_(a,this.imageSize_,r,i,u);return this.image_=new Ku(a,e,r,h,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this.image_.addEventListener(O,this.handleImageChange.bind(this)),this.image_},e.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},e.prototype.getRequestUrl_=function(t,e,r,i,n){if(lt(void 0!==this.url_,9),n[this.v13_?"CRS":"SRS"]=i.getCode(),"STYLES"in this.params_||(n.STYLES=""),1!=r)switch(this.serverType_){case Jc:var o=90*r+.5|0;"FORMAT_OPTIONS"in n?n.FORMAT_OPTIONS+=";dpi:"+o:n.FORMAT_OPTIONS="dpi:"+o;break;case $c:n.MAP_RESOLUTION=90*r;break;case Hc:case Qc:n.DPI=90*r;break;default:lt(!1,8)}n.WIDTH=e[0],n.HEIGHT=e[1];var s,a=i.getAxisOrientation();return s=this.v13_&&"ne"==a.substr(0,2)?[t[1],t[0],t[3],t[2]]:t,n.BBOX=s.join(","),Gc(this.url_,n)},e.prototype.getUrl=function(){return this.url_},e.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()},e.prototype.setUrl=function(t){t!=this.url_&&(this.url_=t,this.image_=null,this.changed())},e.prototype.updateParams=function(t){T(this.params_,t),this.updateV13_(),this.image_=null,this.changed()},e.prototype.updateV13_=function(){var t=this.params_.VERSION||"1.3.0";this.v13_=$e(t,"1.3")>=0},e}(Dc),ip=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),np='&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.',op=function(t){function e(e){var r,i=e||{};r=void 0!==i.attributions?i.attributions:[np];var n=void 0!==i.crossOrigin?i.crossOrigin:"anonymous",o=void 0!==i.url?i.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:r,cacheSize:i.cacheSize,crossOrigin:n,imageSmoothing:i.imageSmoothing,opaque:void 0===i.opaque||i.opaque,maxZoom:void 0!==i.maxZoom?i.maxZoom:19,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileLoadFunction:i.tileLoadFunction,url:o,wrapX:i.wrapX,attributionsCollapsible:!1})||this}return ip(e,t),e}(Jh),sp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),ap=function(t){function e(e){var r=e||{};return t.call(this,r)||this}return sp(e,t),e}(In),lp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),up=function(t){function e(e){var r=t.call(this)||this;return r.boundHandleImageChange_=r.handleImageChange_.bind(r),r.layer_=e,r}return lp(e,t),e.prototype.getFeatures=function(t){return i()},e.prototype.prepareFrame=function(t){return i()},e.prototype.renderFrame=function(t,e){return i()},e.prototype.loadedTileCallback=function(t,e,r){t[e]||(t[e]={}),t[e][r.tileCoord.toString()]=r},e.prototype.createLoadedTileFinder=function(t,e,r){return function(i,n){var o=this.loadedTileCallback.bind(this,r,i);return t.forEachLoadedTile(e,i,n,o)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,i,n){},e.prototype.getDataAtPixel=function(t,e,r){return i()},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){t.target.getState()===To&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=To&&e!=Co&&t.addEventListener(O,this.boundHandleImageChange_),e==bo&&(t.load(),e=t.getState()),e==To},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Cn&&t.changed()},e}(K),hp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),cp=function(t){function e(e){var r=t.call(this,e)||this;return r.container=null,r.renderedResolution,r.tempTransform=[1,0,0,1,0,0],r.pixelTransform=[1,0,0,1,0,0],r.inversePixelTransform=[1,0,0,1,0,0],r.context=null,r.containerReused=!1,r}return hp(e,t),e.prototype.useContainer=function(t,e,r){var i,n,o=this.getLayer().getClassName();t&&""===t.style.opacity&&t.className===o&&((a=t.firstElementChild)instanceof HTMLCanvasElement&&(n=a.getContext("2d")));if(!n||0!==n.canvas.width&&n.canvas.style.transform!==e?this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1):(this.container=t,this.context=n,this.containerReused=!0),!this.container){(i=document.createElement("div")).className=o;var s=i.style;s.position="absolute",s.width="100%",s.height="100%";var a=(n=zn()).canvas;i.appendChild(a),(s=a.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=i,this.context=n}},e.prototype.clip=function(t,e,r){var i=e.pixelRatio,n=e.size[0]*i/2,o=e.size[1]*i/2,s=e.viewState.rotation,a=pe(r),l=de(r),u=se(r),h=oe(r);St(e.coordinateToPixelTransform,a),St(e.coordinateToPixelTransform,l),St(e.coordinateToPixelTransform,u),St(e.coordinateToPixelTransform,h),t.save(),uo(t,-s,n,o),t.beginPath(),t.moveTo(a[0]*i,a[1]*i),t.lineTo(l[0]*i,l[1]*i),t.lineTo(u[0]*i,u[1]*i),t.lineTo(h[0]*i,h[1]*i),t.clip(),uo(t,s,n,o)},e.prototype.clipUnrotated=function(t,e,r){var i=pe(r),n=de(r),o=se(r),s=oe(r);St(e.coordinateToPixelTransform,i),St(e.coordinateToPixelTransform,n),St(e.coordinateToPixelTransform,o),St(e.coordinateToPixelTransform,s);var a=this.inversePixelTransform;St(a,i),St(a,n),St(a,o),St(a,s),t.save(),t.beginPath(),t.moveTo(Math.round(i[0]),Math.round(i[1])),t.lineTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,r){var i=this.getLayer();if(i.hasListener(t)){var n=new Do(t,this.inversePixelTransform,r,e);i.dispatchEvent(n)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(_n,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(vn,t,e)},e.prototype.getRenderTransform=function(t,e,r,i,n,o,s){var a=n/2,l=o/2,u=i/e,h=-u,c=-t[0]+s,p=-t[1];return Ct(this.tempTransform,a,l,u,h,-r,c,p)},e.prototype.getDataAtPixel=function(t,e,r){var i,n=St(this.inversePixelTransform,t.slice()),o=this.context;try{var s=Math.round(n[0]),a=Math.round(n[1]),l=document.createElement("canvas"),u=l.getContext("2d");l.width=1,l.height=1,u.clearRect(0,0,1,1),u.drawImage(o.canvas,s,a,1,1,0,0,1,1),i=u.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?new Uint8Array:i}return 0===i[3]?null:i},e}(up),pp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),dp=function(t){function e(e){var r=t.call(this,e)||this;return r.image_=null,r}return pp(e,t),e.prototype.getImage=function(){return this.image_?this.image_.getImage():null},e.prototype.prepareFrame=function(t){var e=t.layerStatesArray[t.layerIndex],r=t.pixelRatio,i=t.viewState,n=i.resolution,o=this.getLayer().getSource(),s=t.viewHints,a=t.extent;if(void 0!==e.extent&&(a=ce(a,Ar(e.extent,i.projection))),!s[ys]&&!s[ms]&&!ye(a))if(o){var l=i.projection,u=o.getImage(a,n,r,l);u&&this.loadImage(u)&&(this.image_=u)}else this.image_=null;return!!this.image_},e.prototype.renderFrame=function(t,e){var r=this.image_,i=r.getExtent(),n=r.getResolution(),o=r.getPixelRatio(),s=t.layerStatesArray[t.layerIndex],a=t.pixelRatio,l=t.viewState,u=l.center,h=l.resolution,c=t.size,p=a*n/(h*o),d=Math.round(c[0]*a),f=Math.round(c[1]*a),g=l.rotation;if(g){var y=Math.round(Math.sqrt(d*d+f*f));d=y,f=y}Ct(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/a,1/a,g,-d/2,-f/2),Et(this.inversePixelTransform,this.pixelTransform);var m=po(this.pixelTransform);this.useContainer(e,m,s.opacity);var _=this.context,v=_.canvas;v.width!=d||v.height!=f?(v.width=d,v.height=f):this.containerReused||_.clearRect(0,0,d,f);var x=!1;if(s.extent){var w=Ar(s.extent,l.projection);(x=!Yt(w,t.extent)&&ge(w,t.extent))&&this.clipUnrotated(_,t,w)}var b=r.getImage(),S=Ct(this.tempTransform,d/2,f/2,p,p,0,o*(i[0]-u[0])/n,o*(u[1]-i[3])/n);this.renderedResolution=n*a/o;var C=S[4],E=S[5],R=b.width*S[0],P=b.height*S[3];if(T(_,this.getLayer().getSource().getContextOptions()),this.preRender(_,t),R>=.5&&P>=.5){var I=s.opacity,O=void 0;1!==I&&(O=this.context.globalAlpha,this.context.globalAlpha=I),this.context.drawImage(b,0,0,+b.width,+b.height,Math.round(C),Math.round(E),Math.round(R),Math.round(P)),1!==I&&(this.context.globalAlpha=O)}return this.postRender(_,t),x&&_.restore(),m!==v.style.transform&&(v.style.transform=m),this.container},e}(cp),fp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),gp=function(t){function e(e){return t.call(this,e)||this}return fp(e,t),e.prototype.createRenderer=function(){return new dp(this)},e}(ap),yp="preload",mp="useInterimTilesOnError",_p=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),vp=function(t){function e(e){var r=this,i=e||{},n=T({},i);return delete n.preload,delete n.useInterimTilesOnError,(r=t.call(this,n)||this).setPreload(void 0!==i.preload?i.preload:0),r.setUseInterimTilesOnError(void 0===i.useInterimTilesOnError||i.useInterimTilesOnError),r}return _p(e,t),e.prototype.getPreload=function(){return this.get(yp)},e.prototype.setPreload=function(t){this.set(yp,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(mp)},e.prototype.setUseInterimTilesOnError=function(t){this.set(mp,t)},e}(In),xp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),wp=function(t){function e(e){var r=t.call(this,e)||this;return r.extentChanged=!0,r.renderedExtent_=null,r.renderedPixelRatio,r.renderedProjection=null,r.renderedRevision,r.renderedTiles=[],r.newTiles_=!1,r.tmpExtent=[1/0,1/0,-1/0,-1/0],r.tmpTileRange_=new Tl(0,0,0,0),r}return xp(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),r=t.getState(),i=e.getUseInterimTilesOnError();return r==cs||r==ds||r==ps&&!i},e.prototype.getTile=function(t,e,r,i){var n=i.pixelRatio,o=i.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,e,r,n,o);return a.getState()==ps&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):a.setState(cs)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},e.prototype.loadedTileCallback=function(e,r,i){return!!this.isDrawableTile(i)&&t.prototype.loadedTileCallback.call(this,e,r,i)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var r=t.layerStatesArray[t.layerIndex],i=t.viewState,n=i.projection,s=i.resolution,a=i.center,l=i.rotation,u=t.pixelRatio,h=this.getLayer(),c=h.getSource(),p=c.getRevision(),f=c.getTileGridForProjection(n),g=f.getZForResolution(s,c.zDirection),y=f.getResolution(g),m=t.extent,_=r.extent&&Ar(r.extent,n);_&&(m=ce(m,Ar(r.extent,n)));var v=c.getTilePixelRatio(u),x=Math.round(t.size[0]*v),w=Math.round(t.size[1]*v);if(l){var b=Math.round(Math.sqrt(x*x+w*w));x=b,w=b}var S=y*x/2/v,C=y*w/2/v,E=[a[0]-S,a[1]-C,a[0]+S,a[1]+C],R=f.getTileRangeForExtentAndZ(m,g),P={};P[g]={};var I=this.createLoadedTileFinder(c,n,P),O=this.tmpExtent,L=this.tmpTileRange_;this.newTiles_=!1;for(var M=R.minX;M<=R.maxX;++M)for(var F=R.minY;F<=R.maxY;++F){var A=this.getTile(g,M,F,t);if(this.isDrawableTile(A)){var k=o(this);if(A.getState()==cs){P[g][A.tileCoord.toString()]=A;var N=A.inTransition(k);this.newTiles_||!N&&-1!==this.renderedTiles.indexOf(A)||(this.newTiles_=!0)}if(1===A.getAlpha(k,t.time))continue}var j=f.getTileCoordChildTileRange(A.tileCoord,L,O),D=!1;j&&(D=I(g+1,j)),D||f.forEachTileCoordParentTileRange(A.tileCoord,I,L,O)}var G=y/s;Ct(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/v,1/v,l,-x/2,-w/2);var z=po(this.pixelTransform);this.useContainer(e,z,r.opacity);var B=this.context,U=B.canvas;Et(this.inversePixelTransform,this.pixelTransform),Ct(this.tempTransform,x/2,w/2,G,G,0,-x/2,-w/2),U.width!=x||U.height!=w?(U.width=x,U.height=w):this.containerReused||B.clearRect(0,0,x,w),_&&this.clipUnrotated(B,t,_),T(B,c.getContextOptions()),this.preRender(B,t),this.renderedTiles.length=0;var Y,W,V,X=Object.keys(P).map(Number);X.sort(d),1!==r.opacity||this.containerReused&&!c.getOpaque(t.viewState.projection)?(Y=[],W=[]):X=X.reverse();for(var q=X.length-1;q>=0;--q){var Z=X[q],K=c.getTilePixelSize(Z,u,n),H=f.getResolution(Z)/y,J=K[0]*H*G,$=K[1]*H*G,Q=f.getTileCoordForCoordAndZ(pe(E),Z),tt=f.getTileCoordExtent(Q),et=St(this.tempTransform,[v*(tt[0]-E[0])/y,v*(E[3]-tt[3])/y]),rt=v*c.getGutterForProjection(n),it=P[Z];for(var nt in it){var ot=(A=it[nt]).tileCoord,st=et[0]-(Q[1]-ot[1])*J,at=Math.round(st+J),lt=et[1]-(Q[2]-ot[2])*$,ut=Math.round(lt+$),ht=at-(M=Math.round(st)),ct=ut-(F=Math.round(lt)),pt=g===Z;if(!(N=pt&&1!==A.getAlpha(o(this),t.time)))if(Y){B.save(),V=[M,F,M+ht,F,M+ht,F+ct,M,F+ct];for(var dt=0,ft=Y.length;dt<ft;++dt)if(g!==Z&&Z<W[dt]){var gt=Y[dt];B.beginPath(),B.moveTo(V[0],V[1]),B.lineTo(V[2],V[3]),B.lineTo(V[4],V[5]),B.lineTo(V[6],V[7]),B.moveTo(gt[6],gt[7]),B.lineTo(gt[4],gt[5]),B.lineTo(gt[2],gt[3]),B.lineTo(gt[0],gt[1]),B.clip()}Y.push(V),W.push(Z)}else B.clearRect(M,F,ht,ct);this.drawTileImage(A,t,M,F,ht,ct,rt,pt,r.opacity),Y&&!N&&B.restore(),this.renderedTiles.push(A),this.updateUsedTiles(t.usedTiles,c,A)}}return this.renderedRevision=p,this.renderedResolution=y,this.extentChanged=!this.renderedExtent_||!Jt(this.renderedExtent_,E),this.renderedExtent_=E,this.renderedPixelRatio=u,this.renderedProjection=n,this.manageTilePyramid(t,c,f,u,n,m,g,h.getPreload()),this.scheduleExpireCache(t,c),this.postRender(B,t),r.extent&&B.restore(),z!==U.style.transform&&(U.style.transform=z),this.container},e.prototype.drawTileImage=function(t,e,r,i,n,s,a,l,u){var h=this.getTileImage(t);if(h){var c=o(this),p=l?t.getAlpha(c,e.time):1,d=u*p,f=d!==this.context.globalAlpha;f&&(this.context.save(),this.context.globalAlpha=d),this.context.drawImage(h,a,a,h.width-2*a,h.height-2*a,r,i,n,s),f&&this.context.restore(),1!==p?e.animate=!0:l&&t.endTransition(c)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getTileImage=function(t){return t.getImage()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var r=function(t,e,r){var i=o(t);i in r.usedTiles&&t.expireCache(r.viewState.projection,r.usedTiles[i])}.bind(null,e);t.postRenderFunctions.push(r)}},e.prototype.updateUsedTiles=function(t,e,r){var i=o(e);i in t||(t[i]={}),t[i][r.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,r,i,n,s,a,l,u){var h=o(e);h in t.wantedTiles||(t.wantedTiles[h]={});var c,p,d,f,g,y,m=t.wantedTiles[h],_=t.tileQueue,v=0;for(y=r.getMinZoom();y<=a;++y)for(p=r.getTileRangeForExtentAndZ(s,y,p),d=r.getResolution(y),f=p.minX;f<=p.maxX;++f)for(g=p.minY;g<=p.maxY;++g)a-y<=l?(++v,(c=e.getTile(y,f,g,i,n)).getState()==us&&(m[c.getKey()]=!0,_.isKeyQueued(c.getKey())||_.enqueue([c,h,r.getTileCoordCenter(c.tileCoord),d])),void 0!==u&&u(c)):e.useTile(y,f,g,n);e.updateCacheSize(v,n)},e}(cp);wp.prototype.getLayer;var bp=wp,Sp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Tp=function(t){function e(e){return t.call(this,e)||this}return Sp(e,t),e.prototype.createRenderer=function(){return new bp(this)},e}(vp),Cp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ep=!0;try{new ImageData(10,10)}catch(t){Ep=!1}var Rp=document.createElement("canvas").getContext("2d");function Pp(t){var e=!0;try{new ImageData(10,10)}catch(t){e=!1}function r(t,r,i){return e?new ImageData(t,r,i):{data:t,width:r,height:i}}return function(e){var i,n,o=e.buffers,s=e.meta,a=e.imageOps,l=e.width,u=e.height,h=o.length,c=o[0].byteLength;if(a){var p=new Array(h);for(n=0;n<h;++n)p[n]=r(new Uint8ClampedArray(o[n]),l,u);i=t(p,s).data}else{i=new Uint8ClampedArray(c);var d=new Array(h),f=new Array(h);for(n=0;n<h;++n)d[n]=new Uint8ClampedArray(o[n]),f[n]=[0,0,0,0];for(var g=0;g<c;g+=4){for(var y=0;y<h;++y){var m=d[y];f[y][0]=m[g],f[y][1]=m[g+1],f[y][2]=m[g+2],f[y][3]=m[g+3]}var _=t(f,s);i[g]=_[0],i[g+1]=_[1],i[g+2]=_[2],i[g+3]=_[3]}}return i.buffer}}function Ip(t,e){var r=Object.keys(t.lib||{}).map((function(e){return"var "+e+" = "+t.lib[e].toString()+";"})).concat(["var __minion__ = ("+Pp.toString()+")(",t.operation.toString(),");",'self.addEventListener("message", function(event) {',"  var buffer = __minion__(event.data);","  self.postMessage({buffer: buffer, meta: event.data.meta}, [buffer]);","});"]),i=new Blob(r,{type:"text/javascript"}),n=URL.createObjectURL(i),o=new Worker(n);return o.addEventListener("message",e),o}var Op=function(t){function e(e){var r,i=t.call(this)||this;i._imageOps=!!e.imageOps;var n=[];if(r=0===e.threads?0:i._imageOps?1:e.threads||1)for(var o=0;o<r;++o)n[o]=Ip(e,i._onWorkerMessage.bind(i,o));else n[0]=function(t,e){var r=Pp(t.operation),i=!1;return{postMessage:function(t){setTimeout((function(){i||e({data:{buffer:r(t),meta:t.meta}})}),0)},terminate:function(){i=!0}}}(e,i._onWorkerMessage.bind(i,0));return i._workers=n,i._queue=[],i._maxQueueLength=e.queue||1/0,i._running=0,i._dataLookup={},i._job=null,i}return Cp(e,t),e.prototype.process=function(t,e,r){this._enqueue({inputs:t,meta:e,callback:r}),this._dispatch()},e.prototype._enqueue=function(t){for(this._queue.push(t);this._queue.length>this._maxQueueLength;)this._queue.shift().callback(null,null)},e.prototype._dispatch=function(){if(0===this._running&&this._queue.length>0){var t=this._queue.shift();this._job=t;var e=t.inputs[0].width,r=t.inputs[0].height,i=t.inputs.map((function(t){return t.data.buffer})),n=this._workers.length;if(this._running=n,1===n)this._workers[0].postMessage({buffers:i,meta:t.meta,imageOps:this._imageOps,width:e,height:r},i);else for(var o=t.inputs[0].data.length,s=4*Math.ceil(o/4/n),a=0;a<n;++a){for(var l=a*s,u=[],h=0,c=i.length;h<c;++h)u.push(i[a].slice(l,l+s));this._workers[a].postMessage({buffers:u,meta:t.meta,imageOps:this._imageOps,width:e,height:r},u)}}},e.prototype._onWorkerMessage=function(t,e){this.disposed||(this._dataLookup[t]=e.data,--this._running,0===this._running&&this._resolveJob())},e.prototype._resolveJob=function(){var t,e,r=this._job,i=this._workers.length;if(1===i)t=new Uint8ClampedArray(this._dataLookup[0].buffer),e=this._dataLookup[0].meta;else{var n=r.inputs[0].data.length;t=new Uint8ClampedArray(n),e=new Array(n);for(var o=4*Math.ceil(n/4/i),s=0;s<i;++s){var a=this._dataLookup[s].buffer,l=s*o;t.set(new Uint8ClampedArray(a),l),e[s]=this._dataLookup[s].meta}}this._job=null,this._dataLookup={},r.callback(null,function(t,e,r){if(Ep)return new ImageData(t,e,r);var i=Rp.createImageData(e,r);return i.data.set(t),i}(t,r.inputs[0].width,r.inputs[0].height),e),this._dispatch()},e.prototype.disposeInternal=function(){for(var t=0;t<this._workers.length;++t)this._workers[t].terminate();this._workers.length=0},e}(p),Lp="beforeoperations",Mp="afteroperations",Fp="pixel",Ap="image",kp=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.extent=r.extent,n.resolution=r.viewState.resolution/r.pixelRatio,n.data=i,n}return Cp(e,t),e}(h),Np=function(t){function e(e){var r=t.call(this,{projection:null})||this;r.processor_=null,r.operationType_=void 0!==e.operationType?e.operationType:Fp,r.threads_=void 0!==e.threads?e.threads:1,r.layers_=function(t){for(var e=t.length,r=new Array(e),i=0;i<e;++i)r[i]=Gp(t[i]);return r}(e.sources);for(var i,n=r.changed.bind(r),o=0,s=r.layers_.length;o<s;++o)r.layers_[o].addEventListener(O,n);return r.tileQueue_=new gs((function(){return 1}),r.changed.bind(r)),r.requestedFrameState_,r.renderedImageCanvas_=null,r.renderedRevision_,r.frameState_={animate:!1,coordinateToPixelTransform:[1,0,0,1,0,0],extent:null,index:0,layerIndex:0,layerStatesArray:(i=r.layers_,i.map((function(t){return t.getLayerState()}))),pixelRatio:1,pixelToCoordinateTransform:[1,0,0,1,0,0],postRenderFunctions:[],size:[0,0],tileQueue:r.tileQueue_,time:Date.now(),usedTiles:{},viewState:{rotation:0},viewHints:[],wantedTiles:{},declutterItems:[]},r.setAttributions((function(t){for(var r=[],i=0,n=e.sources.length;i<n;++i){var o=e.sources[i],s=(o instanceof Mh?o:o.getSource()).getAttributions();if("function"==typeof s){var a=s(t);r.push.apply(r,a)}}return 0!==r.length?r:null})),void 0!==e.operation&&r.setOperation(e.operation,e.lib),r}return Cp(e,t),e.prototype.setOperation=function(t,e){this.processor_&&this.processor_.dispose(),this.processor_=new Op({operation:t,imageOps:this.operationType_===Ap,queue:1,lib:e,threads:this.threads_}),this.changed()},e.prototype.updateFrameState_=function(t,e,r){var i=T({},this.frameState_);i.viewState=T({},i.viewState);var n=ae(t);i.extent=t.slice(),i.size[0]=Math.round(fe(t)/e),i.size[1]=Math.round(he(t)/e),i.time=1/0;var o=i.viewState;return o.center=n,o.projection=r,o.resolution=e,i},e.prototype.allSourcesReady_=function(){for(var t=!0,e=0,r=this.layers_.length;e<r;++e)if(this.layers_[e].getSource().getState()!==Cn){t=!1;break}return t},e.prototype.getImage=function(t,e,r,i){if(!this.allSourcesReady_())return null;var n=this.updateFrameState_(t,e,i);if(this.requestedFrameState_=n,this.renderedImageCanvas_){var o=this.renderedImageCanvas_.getResolution(),s=this.renderedImageCanvas_.getExtent();e===o&&Jt(t,s)||(this.renderedImageCanvas_=null)}return this.renderedImageCanvas_&&this.getRevision()===this.renderedRevision_||this.processSources_(),n.tileQueue.loadMoreTiles(16,16),n.animate&&requestAnimationFrame(this.changed.bind(this)),this.renderedImageCanvas_},e.prototype.processSources_=function(){for(var t=this.requestedFrameState_,e=this.layers_.length,r=new Array(e),i=0;i<e;++i){t.layerIndex=i;var n=Dp(this.layers_[i],t);if(!n)return;r[i]=n}var o={};this.dispatchEvent(new kp(Lp,t,o)),this.processor_.process(r,o,this.onWorkerComplete_.bind(this,t))},e.prototype.onWorkerComplete_=function(t,e,r,i){if(!e&&r){var n=t.extent,o=t.viewState.resolution;if(o===this.requestedFrameState_.viewState.resolution&&Jt(n,this.requestedFrameState_.extent)){var s;if(this.renderedImageCanvas_)s=this.renderedImageCanvas_.getImage().getContext("2d");else s=zn(Math.round(fe(n)/o),Math.round(he(n)/o)),this.renderedImageCanvas_=new Yc(n,o,1,s.canvas);s.putImageData(r,0,0),this.changed(),this.renderedRevision_=this.getRevision(),this.dispatchEvent(new kp(Mp,t,i))}}},e.prototype.getImageInternal=function(){return null},e.prototype.disposeInternal=function(){this.processor_&&this.processor_.dispose(),t.prototype.disposeInternal.call(this)},e}(Dc);Np.prototype.dispose;var jp=null;function Dp(t,e){var r=t.getRenderer();if(!r)throw new Error("Unsupported layer type: "+t);if(!r.prepareFrame(e))return null;var i,n=e.size[0],o=e.size[1],s=r.renderFrame(e,null);if(s&&(i=s.firstElementChild),!(i instanceof HTMLCanvasElement))throw new Error("Unsupported rendered element: "+i);if(i.width===n&&i.height===o)return i.getContext("2d").getImageData(0,0,n,o);if(jp){var a=jp.canvas;a.width!==n||a.height!==o?jp=zn(n,o):jp.clearRect(0,0,n,o)}else jp=zn(n,o);return jp.drawImage(i,0,0,n,o),jp.getImageData(0,0,n,o)}function Gp(t){var e;return t instanceof Mh?t instanceof Nh?e=new Tp({source:t}):t instanceof Dc&&(e=new gp({source:t})):e=t,e}var zp=Np,Bp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Up=['Map tiles by <a href="https://stamen.com/" target="_blank">Stamen Design</a>, under <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC BY 3.0</a>.',np],Yp={terrain:{extension:"jpg",opaque:!0},"terrain-background":{extension:"jpg",opaque:!0},"terrain-labels":{extension:"png",opaque:!1},"terrain-lines":{extension:"png",opaque:!1},"toner-background":{extension:"png",opaque:!0},toner:{extension:"png",opaque:!0},"toner-hybrid":{extension:"png",opaque:!1},"toner-labels":{extension:"png",opaque:!1},"toner-lines":{extension:"png",opaque:!1},"toner-lite":{extension:"png",opaque:!0},watercolor:{extension:"jpg",opaque:!0}},Wp={terrain:{minZoom:0,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:0,maxZoom:18}},Vp=function(t){function e(e){var r=e.layer.indexOf("-"),i=-1==r?e.layer:e.layer.slice(0,r),n=Wp[i],o=Yp[e.layer],s=void 0!==e.url?e.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+e.layer+"/{z}/{x}/{y}."+o.extension;return t.call(this,{attributions:Up,cacheSize:e.cacheSize,crossOrigin:"anonymous",imageSmoothing:e.imageSmoothing,maxZoom:null!=e.maxZoom?e.maxZoom:n.maxZoom,minZoom:null!=e.minZoom?e.minZoom:n.minZoom,opaque:o.opaque,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:s,wrapX:e.wrapX})||this}return Bp(e,t),e}(Jh),Xp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),qp=function(t){function e(e){var r=this,i=e||{};return(r=t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,imageSmoothing:i.imageSmoothing,projection:i.projection,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:i.tileGrid,tileLoadFunction:i.tileLoadFunction,url:i.url,urls:i.urls,wrapX:void 0===i.wrapX||i.wrapX,transition:i.transition})||this).params_=i.params||{},r.hidpi_=void 0===i.hidpi||i.hidpi,r.tmpExtent_=[1/0,1/0,-1/0,-1/0],r.setKey(r.getKeyForParams_()),r}return Xp(e,t),e.prototype.getKeyForParams_=function(){var t=0,e=[];for(var r in this.params_)e[t++]=r+"-"+this.params_[r];return e.join("/")},e.prototype.getParams=function(){return this.params_},e.prototype.getRequestUrl_=function(t,e,r,i,n,o){var s=this.urls;if(s){var a,l=n.getCode().split(":").pop();if(o.SIZE=e[0]+","+e[1],o.BBOX=r.join(","),o.BBOXSR=l,o.IMAGESR=l,o.DPI=Math.round(o.DPI?o.DPI*i:90*i),1==s.length)a=s[0];else a=s[Pe(Il(t),s.length)];return Gc(a.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage"),o)}},e.prototype.getTilePixelRatio=function(t){return this.hidpi_?t:1},e.prototype.updateParams=function(t){T(this.params_,t),this.setKey(this.getKeyForParams_())},e.prototype.tileUrlFunction=function(t,e,r){var i=this.getTileGrid();if(i||(i=this.getTileGridForProjection(r)),!(i.getResolutions().length<=t[0])){1==e||this.hidpi_||(e=1);var n=i.getTileCoordExtent(t,this.tmpExtent_),o=Ds(i.getTileSize(t[0]),this.tmpSize);1!=e&&(o=js(o,e,this.tmpSize));var s={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};return T(s,this.params_),this.getRequestUrl_(t,o,n,e,r,s)}},e}(Xh),Zp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Kp=function(t){function e(e,r,i){var n=t.call(this,e,cs)||this;return n.tileSize_=r,n.text_=i,n.canvas_=null,n}return Zp(e,t),e.prototype.getImage=function(){if(this.canvas_)return this.canvas_;var t=this.tileSize_,e=zn(t[0],t[1]);return e.strokeStyle="grey",e.strokeRect(.5,.5,t[0]+.5,t[1]+.5),e.fillStyle="grey",e.strokeStyle="white",e.textAlign="center",e.textBaseline="middle",e.font="24px sans-serif",e.lineWidth=4,e.strokeText(this.text_,t[0]/2,t[1]/2,t[0]),e.fillText(this.text_,t[0]/2,t[1]/2,t[0]),this.canvas_=e.canvas,e.canvas},e.prototype.load=function(){},e}(ph),Hp=function(t){function e(e){var r=e||{};return t.call(this,{opaque:!1,projection:r.projection,tileGrid:r.tileGrid,wrapX:void 0===r.wrapX||r.wrapX,zDirection:r.zDirection})||this}return Zp(e,t),e.prototype.getTile=function(t,e,r){var i=El(t,e,r);if(this.tileCache.containsKey(i))return this.tileCache.get(i);var n=Ds(this.tileGrid.getTileSize(t)),o=[t,e,r],s=this.getTileCoordForTileUrlFunction(o),a=void 0;a=s?"z:"+s[0]+" x:"+s[1]+" y:"+s[2]:"none";var l=new Kp(o,n,a);return this.tileCache.set(i,l),l},e}(Jh),Jp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),$p=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,imageSmoothing:e.imageSmoothing,projection:gr("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:Tn,tileLoadFunction:e.tileLoadFunction,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition})||this;if(r.tileJSON_=null,r.tileSize_=e.tileSize,e.url)if(e.jsonp)qh(e.url,r.handleTileJSONResponse.bind(r),r.handleTileJSONError.bind(r));else{var i=new XMLHttpRequest;i.addEventListener("load",r.onXHRLoad_.bind(r)),i.addEventListener("error",r.onXHRError_.bind(r)),i.open("GET",e.url),i.send()}else e.tileJSON?r.handleTileJSONResponse(e.tileJSON):lt(!1,51);return r}return Jp(e,t),e.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||e.status>=200&&e.status<300){var r=void 0;try{r=JSON.parse(e.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(r)}else this.handleTileJSONError()},e.prototype.onXHRError_=function(t){this.handleTileJSONError()},e.prototype.getTileJSON=function(){return this.tileJSON_},e.prototype.handleTileJSONResponse=function(t){var e,r=gr("EPSG:4326"),i=this.getProjection();if(void 0!==t.bounds){var n=br(r,i);e=_e(t.bounds,n)}var o=t.minzoom||0,s=t.maxzoom||22,a=Fl({extent:Nl(i),maxZoom:s,minZoom:o,tileSize:this.tileSize_});if(this.tileGrid=a,this.tileUrlFunction=Dh(t.tiles,a),void 0!==t.attribution&&!this.getAttributions()){var l=void 0!==e?e:r.getExtent();this.setAttributions((function(e){return ge(l,e.extent)?[t.attribution]:null}))}this.tileJSON_=t,this.setState(Cn)},e.prototype.handleTileJSONError=function(){this.setState(En)},e}(Xh),Qp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),td=function(t){function e(e){var r=this,i=e||{},n=i.params||{},o=!("TRANSPARENT"in n)||n.TRANSPARENT;return(r=t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,imageSmoothing:i.imageSmoothing,opaque:!o,projection:i.projection,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileClass:i.tileClass,tileGrid:i.tileGrid,tileLoadFunction:i.tileLoadFunction,url:i.url,urls:i.urls,wrapX:void 0===i.wrapX||i.wrapX,transition:i.transition})||this).gutter_=void 0!==i.gutter?i.gutter:0,r.params_=n,r.v13_=!0,r.serverType_=i.serverType,r.hidpi_=void 0===i.hidpi||i.hidpi,r.tmpExtent_=[1/0,1/0,-1/0,-1/0],r.updateV13_(),r.setKey(r.getKeyForParams_()),r}return Qp(e,t),e.prototype.getFeatureInfoUrl=function(t,e,r,i){var n=gr(r),o=this.getProjection(),s=this.getTileGrid();s||(s=this.getTileGridForProjection(n));var a=s.getZForResolution(e,this.zDirection),l=s.getTileCoordForCoordAndZ(t,a);if(!(s.getResolutions().length<=l[0])){var u=s.getResolution(l[0]),h=s.getTileCoordExtent(l,this.tmpExtent_),c=Ds(s.getTileSize(l[0]),this.tmpSize),p=this.gutter_;0!==p&&(c=Ns(c,p,this.tmpSize),h=Gt(h,u*p,h)),o&&o!==n&&(u=xh(o,n,t,u),h=Cr(h,n,o),t=Tr(t,n,o));var d={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};T(d,this.params_,i);var f=Math.floor((t[0]-h[0])/u),g=Math.floor((h[3]-t[1])/u);return d[this.v13_?"I":"X"]=f,d[this.v13_?"J":"Y"]=g,this.getRequestUrl_(l,c,h,1,o||n,d)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.urls[0]){var r={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){var i=this.params_.LAYERS;if(!(!Array.isArray(i)||1===i.length))return;r.LAYER=i}if(void 0!==t){var n=this.getProjection()?this.getProjection().getMetersPerUnit():1;r.SCALE=t*n*39.37*(25.4/.28)}return T(r,e),Gc(this.urls[0],r)}},e.prototype.getGutter=function(){return this.gutter_},e.prototype.getParams=function(){return this.params_},e.prototype.getRequestUrl_=function(t,e,r,i,n,o){var s=this.urls;if(s){if(o.WIDTH=e[0],o.HEIGHT=e[1],o[this.v13_?"CRS":"SRS"]=n.getCode(),"STYLES"in this.params_||(o.STYLES=""),1!=i)switch(this.serverType_){case Jc:var a=90*i+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+a:o.FORMAT_OPTIONS="dpi:"+a;break;case $c:o.MAP_RESOLUTION=90*i;break;case Hc:case Qc:o.DPI=90*i;break;default:lt(!1,52)}var l,u=n.getAxisOrientation(),h=r;if(this.v13_&&"ne"==u.substr(0,2)){var c=void 0;c=r[0],h[0]=r[1],h[1]=c,c=r[2],h[2]=r[3],h[3]=c}if(o.BBOX=h.join(","),1==s.length)l=s[0];else l=s[Pe(Il(t),s.length)];return Gc(l,o)}},e.prototype.getTilePixelRatio=function(t){return this.hidpi_&&void 0!==this.serverType_?t:1},e.prototype.getKeyForParams_=function(){var t=0,e=[];for(var r in this.params_)e[t++]=r+"-"+this.params_[r];return e.join("/")},e.prototype.updateParams=function(t){T(this.params_,t),this.updateV13_(),this.setKey(this.getKeyForParams_())},e.prototype.updateV13_=function(){var t=this.params_.VERSION||"1.3.0";this.v13_=$e(t,"1.3")>=0},e.prototype.tileUrlFunction=function(t,e,r){var i=this.getTileGrid();if(i||(i=this.getTileGridForProjection(r)),!(i.getResolutions().length<=t[0])){1==e||this.hidpi_&&void 0!==this.serverType_||(e=1);var n=i.getResolution(t[0]),o=i.getTileCoordExtent(t,this.tmpExtent_),s=Ds(i.getTileSize(t[0]),this.tmpSize),a=this.gutter_;0!==a&&(s=Ns(s,a,this.tmpSize),o=Gt(o,n*a,o)),1!=e&&(s=js(s,e,this.tmpSize));var l={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return T(l,this.params_),this.getRequestUrl_(t,s,o,e,r,l)}},e}(Xh),ed=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),rd=function(t){function e(e,r,i,n,o,s){var a=t.call(this,e,r)||this;return a.src_=i,a.extent_=n,a.preemptive_=o,a.grid_=null,a.keys_=null,a.data_=null,a.jsonp_=s,a}return ed(e,t),e.prototype.getImage=function(){return null},e.prototype.getData=function(t){if(!this.grid_||!this.keys_)return null;var e=(t[0]-this.extent_[0])/(this.extent_[2]-this.extent_[0]),r=(t[1]-this.extent_[1])/(this.extent_[3]-this.extent_[1]),i=this.grid_[Math.floor((1-r)*this.grid_.length)];if("string"!=typeof i)return null;var n=i.charCodeAt(Math.floor(e*i.length));n>=93&&n--,n>=35&&n--;var o=null;if((n-=32)in this.keys_){var s=this.keys_[n];o=this.data_&&s in this.data_?this.data_[s]:s}return o},e.prototype.forDataAtCoordinate=function(t,e,r){this.state==ds&&!0===r?(this.state=us,V(this,O,(function(r){e(this.getData(t))}),this),this.loadInternal_()):!0===r?setTimeout(function(){e(this.getData(t))}.bind(this),0):e(this.getData(t))},e.prototype.getKey=function(){return this.src_},e.prototype.handleError_=function(){this.state=ps,this.changed()},e.prototype.handleLoad_=function(t){this.grid_=t.grid,this.keys_=t.keys,this.data_=t.data,this.state=cs,this.changed()},e.prototype.loadInternal_=function(){if(this.state==us)if(this.state=hs,this.jsonp_)qh(this.src_,this.handleLoad_.bind(this),this.handleError_.bind(this));else{var t=new XMLHttpRequest;t.addEventListener("load",this.onXHRLoad_.bind(this)),t.addEventListener("error",this.onXHRError_.bind(this)),t.open("GET",this.src_),t.send()}},e.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||e.status>=200&&e.status<300){var r=void 0;try{r=JSON.parse(e.responseText)}catch(t){return void this.handleError_()}this.handleLoad_(r)}else this.handleError_()},e.prototype.onXHRError_=function(t){this.handleError_()},e.prototype.load=function(){this.preemptive_?this.loadInternal_():this.setState(ds)},e}(ph),id=function(t){function e(e){var r=t.call(this,{projection:gr("EPSG:3857"),state:Tn})||this;if(r.preemptive_=void 0===e.preemptive||e.preemptive,r.tileUrlFunction_=zh,r.template_=void 0,r.jsonp_=e.jsonp||!1,e.url)if(r.jsonp_)qh(e.url,r.handleTileJSONResponse.bind(r),r.handleTileJSONError.bind(r));else{var i=new XMLHttpRequest;i.addEventListener("load",r.onXHRLoad_.bind(r)),i.addEventListener("error",r.onXHRError_.bind(r)),i.open("GET",e.url),i.send()}else e.tileJSON?r.handleTileJSONResponse(e.tileJSON):lt(!1,51);return r}return ed(e,t),e.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||e.status>=200&&e.status<300){var r=void 0;try{r=JSON.parse(e.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(r)}else this.handleTileJSONError()},e.prototype.onXHRError_=function(t){this.handleTileJSONError()},e.prototype.getTemplate=function(){return this.template_},e.prototype.forDataAtCoordinateAndResolution=function(t,e,r,i){if(this.tileGrid){var n=this.tileGrid.getZForResolution(e,this.zDirection),o=this.tileGrid.getTileCoordForCoordAndZ(t,n);this.getTile(o[0],o[1],o[2],1,this.getProjection()).forDataAtCoordinate(t,r,i)}else!0===i?setTimeout((function(){r(null)}),0):r(null)},e.prototype.handleTileJSONError=function(){this.setState(En)},e.prototype.handleTileJSONResponse=function(t){var e,r=gr("EPSG:4326"),i=this.getProjection();if(void 0!==t.bounds){var n=br(r,i);e=_e(t.bounds,n)}var o=t.minzoom||0,s=t.maxzoom||22,a=Fl({extent:Nl(i),maxZoom:s,minZoom:o});this.tileGrid=a,this.template_=t.template;var l=t.grids;if(l){if(this.tileUrlFunction_=Dh(l,a),void 0!==t.attribution){var u=void 0!==e?e:r.getExtent();this.setAttributions((function(e){return ge(u,e.extent)?[t.attribution]:null}))}this.setState(Cn)}else this.setState(En)},e.prototype.getTile=function(t,e,r,i,n){var o=El(t,e,r);if(this.tileCache.containsKey(o))return this.tileCache.get(o);var s=[t,e,r],a=this.getTileCoordForTileUrlFunction(s,n),l=this.tileUrlFunction_(a,i,n),u=new rd(s,void 0!==l?us:ds,void 0!==l?l:"",this.tileGrid.getTileCoordExtent(s),this.preemptive_,this.jsonp_);return this.tileCache.set(o,u),u},e.prototype.useTile=function(t,e,r){var i=El(t,e,r);this.tileCache.containsKey(i)&&this.tileCache.get(i)},e}(Nh),nd=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),od=function(t){function e(e,r,i,n,o,s){var a=t.call(this,e,r,s)||this;return a.extent=null,a.format_=n,a.features_=null,a.loader_,a.projection=null,a.resolution,a.tileLoadFunction_=o,a.url_=i,a}return nd(e,t),e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.getKey=function(){return this.url_},e.prototype.load=function(){this.state==us&&(this.setState(hs),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))},e.prototype.onLoad=function(t,e){this.setFeatures(t)},e.prototype.onError=function(){this.setState(ps)},e.prototype.setFeatures=function(t){this.features_=t,this.setState(cs)},e.prototype.setLoader=function(t){this.loader_=t},e}(ph),sd=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),ad=[],ld=function(t){function e(e,r,i,n){var o=t.call(this,e,r,{transition:0})||this;return o.context_={},o.executorGroups={},o.loadingSourceTiles=0,o.errorSourceTileKeys={},o.hitDetectionImageData={},o.replayState_={},o.sourceTiles=null,o.wantedResolution,o.getSourceTiles=n.bind(void 0,o),o.sourceZ=-1,o.hifi=!1,o.wrappedTileCoord=i,o}return sd(e,t),e.prototype.getContext=function(t){var e=o(t);return e in this.context_||(this.context_[e]=zn(1,1,ad)),this.context_[e]},e.prototype.hasContext=function(t){return o(t)in this.context_},e.prototype.getImage=function(t){return this.hasContext(t)?this.getContext(t).canvas:null},e.prototype.getReplayState=function(t){var e=o(t);return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedZ:-1,renderedTileZ:-1}),this.replayState_[e]},e.prototype.load=function(){this.getSourceTiles()},e.prototype.release=function(){for(var e in this.context_)ad.push(this.context_[e].canvas);t.prototype.release.call(this)},e}(ph),ud=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),hd=function(t){function e(e){var r=this,i=e.projection||"EPSG:3857",n=e.extent||Nl(i),o=e.tileGrid||Fl({extent:n,maxResolution:e.maxResolution,maxZoom:void 0!==e.maxZoom?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});return(r=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,opaque:!1,projection:i,state:e.state,tileGrid:o,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:cd,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:void 0===e.zDirection?1:e.zDirection})||this).format_=e.format?e.format:null,r.loadingTiles_={},r.sourceTileCache=new Eh(r.tileCache.highWaterMark),r.overlaps_=null==e.overlaps||e.overlaps,r.tileClass=e.tileClass?e.tileClass:od,r.tileGrids_={},r}return ud(e,t),e.prototype.getFeaturesInExtent=function(t){var e=[],r=this.tileCache;if(0===r.getCount())return e;var i=Pl(r.peekFirstKey())[0],n=this.tileGrid;return r.forEach((function(r){if(r.tileCoord[0]===i&&r.getState()===cs)for(var o=r.getSourceTiles(),s=0,a=o.length;s<a;++s){var l=o[s],u=l.tileCoord;if(ge(t,n.getTileCoordExtent(u))){var h=l.getFeatures();if(h)for(var c=0,p=h.length;c<p;++c){var d=h[c],f=d.getGeometry();ge(t,f.getExtent())&&e.push(d)}}}})),e},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.clear=function(){this.tileCache.clear(),this.sourceTileCache.clear()},e.prototype.expireCache=function(e,r){t.prototype.expireCache.call(this,e,r),this.sourceTileCache.expireCache({})},e.prototype.getSourceTiles=function(t,e,r){var i=r.wrappedTileCoord,n=this.getTileGridForProjection(e),o=n.getTileCoordExtent(i),s=i[0],a=n.getResolution(s);Gt(o,-a,o);var l=this.tileGrid,u=l.getExtent();u&&ce(o,u,o);var h,c,p,d=l.getZForResolution(a,1),f=l.getMinZoom(),g=r.sourceTiles;if(g&&g.length>0&&g[0].tileCoord[0]===d)h=g,c=!0,p=d;else{h=[],p=d+1;do{--p,c=!0,l.forEachTileCoord(o,p,function(i){var n,o=this.tileUrlFunction(i,t,e);if(void 0!==o)if(this.sourceTileCache.containsKey(o)){var s=(n=this.sourceTileCache.get(o)).getState();if(s===cs||s===ps||s===ds)return void h.push(n)}else p===d&&((n=new this.tileClass(i,us,o,this.format_,this.tileLoadFunction)).extent=l.getTileCoordExtent(i),n.projection=e,n.resolution=l.getResolution(i[0]),this.sourceTileCache.set(o,n),n.addEventListener(O,this.handleTileChange.bind(this)),n.load());c=c&&n&&n.getState()===cs,n&&n.getState()!==ds&&r.getState()===us&&(r.loadingSourceTiles++,n.addEventListener(O,(function t(){var e=n.getState(),i=n.getKey();if(e===cs||e===ps){e===cs?(n.removeEventListener(O,t),r.loadingSourceTiles--,delete r.errorSourceTileKeys[i]):e===ps&&(r.errorSourceTileKeys[i]=!0);var o=Object.keys(r.errorSourceTileKeys).length;r.loadingSourceTiles-o==0&&(r.hifi=0===o,r.sourceZ=d,r.setState(cs))}})))}.bind(this)),c||(h.length=0)}while(!c&&p>f)}return r.getState()===us&&r.setState(hs),c&&(r.hifi=d===p,r.sourceZ=p,r.getState()<cs?r.setState(cs):g&&v(h,g)||(r.sourceTiles=h)),h},e.prototype.getTile=function(t,e,r,i,n){var o,s=El(t,e,r),a=this.getKey();if(this.tileCache.containsKey(s)&&(o=this.tileCache.get(s)).key===a)return o;var l=[t,e,r],u=this.getTileCoordForTileUrlFunction(l,n),h=this.getTileGrid().getExtent(),c=this.getTileGridForProjection(n);if(u&&h){var p=c.getTileCoordExtent(u);Gt(p,-c.getResolution(t),p),ge(h,p)||(u=null)}var d=!0;if(null!==u){var f=this.tileGrid,g=c.getResolution(t),y=f.getZForResolution(g,1),m=c.getTileCoordExtent(u);Gt(m,-g,m),f.forEachTileCoord(m,y,function(t){d=d&&!this.tileUrlFunction(t,i,n)}.bind(this))}var _=new ld(l,d?ds:us,u,this.getSourceTiles.bind(this,i,n));return _.key=a,o?(_.interimTile=o,_.refreshInterimChain(),this.tileCache.replace(s,_)):this.tileCache.set(s,_),_},e.prototype.getTileGridForProjection=function(t){var e=t.getCode(),r=this.tileGrids_[e];if(!r){var i=this.tileGrid;r=kl(t,void 0,i?i.getTileSize(i.getMinZoom()):void 0),this.tileGrids_[e]=r}return r},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.getTilePixelSize=function(t,e,r){var i=Ds(this.getTileGridForProjection(r).getTileSize(t),this.tmpSize);return[Math.round(i[0]*e),Math.round(i[1]*e)]},e.prototype.updateCacheSize=function(e,r){t.prototype.updateCacheSize.call(this,2*e,r)},e}(Yh);function cd(t,e){var r=vl(e,t.getFormat(),t.onLoad.bind(t),t.onError.bind(t));t.setLoader(r)}var pd="KVP",dd="REST",fd=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),gd=function(t){function e(e){var r=this,i=void 0!==e.requestEncoding?e.requestEncoding:pd,n=e.tileGrid,o=e.urls;return void 0===o&&void 0!==e.url&&(o=Bh(e.url)),(r=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,imageSmoothing:e.imageSmoothing,projection:e.projection,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileClass:e.tileClass,tileGrid:n,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,urls:o,wrapX:void 0!==e.wrapX&&e.wrapX,transition:e.transition})||this).version_=void 0!==e.version?e.version:"1.0.0",r.format_=void 0!==e.format?e.format:"image/jpeg",r.dimensions_=void 0!==e.dimensions?e.dimensions:{},r.layer_=e.layer,r.matrixSet_=e.matrixSet,r.style_=e.style,r.requestEncoding_=i,r.setKey(r.getKeyForDimensions_()),o&&o.length>0&&(r.tileUrlFunction=Gh(o.map(r.createFromWMTSTemplate.bind(r)))),r}return fd(e,t),e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.setTileUrlFunction(Gh(t.map(this.createFromWMTSTemplate.bind(this))),e)},e.prototype.getDimensions=function(){return this.dimensions_},e.prototype.getFormat=function(){return this.format_},e.prototype.getLayer=function(){return this.layer_},e.prototype.getMatrixSet=function(){return this.matrixSet_},e.prototype.getRequestEncoding=function(){return this.requestEncoding_},e.prototype.getStyle=function(){return this.style_},e.prototype.getVersion=function(){return this.version_},e.prototype.getKeyForDimensions_=function(){var t=0,e=[];for(var r in this.dimensions_)e[t++]=r+"-"+this.dimensions_[r];return e.join("/")},e.prototype.updateDimensions=function(t){T(this.dimensions_,t),this.setKey(this.getKeyForDimensions_())},e.prototype.createFromWMTSTemplate=function(t){var e=this.requestEncoding_,r={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};e==pd&&T(r,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_}),t=e==pd?Gc(t,r):t.replace(/\{(\w+?)\}/g,(function(t,e){return e.toLowerCase()in r?r[e.toLowerCase()]:t}));var i=this.tileGrid,n=this.dimensions_;return function(r,o,s){if(r){var a={TileMatrix:i.getMatrixId(r[0]),TileCol:r[1],TileRow:r[2]};T(a,n);var l=t;return l=e==pd?Gc(l,a):l.replace(/\{(\w+?)\}/g,(function(t,e){return a[e]}))}}},e}(Xh);var yd=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),md="renderOrder",_d=function(t){function e(e){var r=this,i=e||{},n=T({},i);return delete n.style,delete n.renderBuffer,delete n.updateWhileAnimating,delete n.updateWhileInteracting,(r=t.call(this,n)||this).declutter_=void 0!==i.declutter&&i.declutter,r.renderBuffer_=void 0!==i.renderBuffer?i.renderBuffer:100,r.style_=null,r.styleFunction_=void 0,r.setStyle(i.style),r.updateWhileAnimating_=void 0!==i.updateWhileAnimating&&i.updateWhileAnimating,r.updateWhileInteracting_=void 0!==i.updateWhileInteracting&&i.updateWhileInteracting,r}return yd(e,t),e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(md)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.setRenderOrder=function(t){this.set(md,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:nh,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var r;if(Array.isArray(t))r=t;else lt("function"==typeof t.getZIndex,41),r=[t];e=function(){return r}}return e}(this.style_),this.changed()},e}(In),vd=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),xd="GENERATE_BUFFERS",wd=function(t){function e(e,r){var i=t.call(this,e)||this,n=r||{};return i.helper=new Eu({postProcesses:n.postProcesses,uniforms:n.uniforms}),i}return vd(e,t),e.prototype.disposeInternal=function(){this.helper.dispose(),t.prototype.disposeInternal.call(this)},e.prototype.getShaderCompileErrors=function(){return this.helper.getShaderCompileErrors()},e}(up);var bd=wd,Sd=new Blob(['var e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,o=arguments.length;r<o;++r){var i=arguments[r];if(null!=i)for(var f in i)i.hasOwnProperty(f)&&(t[f]=i[f])}return t},n="GENERATE_BUFFERS",t=[],r={vertexPosition:0,indexPosition:0};function o(e,n,t,r,o){e[n+0]=t,e[n+1]=r,e[n+2]=o}function i(e,n,i,f,s,u){var a=3+s,l=e[n+0],v=e[n+1],c=t;c.length=s;for(var g=0;g<c.length;g++)c[g]=e[n+2+g];var b=u?u.vertexPosition:0,h=u?u.indexPosition:0,d=b/a;return o(i,b,l,v,0),c.length&&i.set(c,b+3),o(i,b+=a,l,v,1),c.length&&i.set(c,b+3),o(i,b+=a,l,v,2),c.length&&i.set(c,b+3),o(i,b+=a,l,v,3),c.length&&i.set(c,b+3),b+=a,f[h++]=d,f[h++]=d+1,f[h++]=d+3,f[h++]=d+1,f[h++]=d+2,f[h++]=d+3,r.vertexPosition=b,r.indexPosition=h,r}var f=self;f.onmessage=function(t){var r=t.data;if(r.type===n){for(var o=r.customAttributesCount,s=2+o,u=new Float32Array(r.renderInstructions),a=u.length/s,l=4*a*(o+3),v=new Uint32Array(6*a),c=new Float32Array(l),g=null,b=0;b<u.length;b+=s)g=i(u,b,c,v,o,g);var h=e({vertexBuffer:c.buffer,indexBuffer:v.buffer,renderInstructions:u.buffer},r);f.postMessage(h,[c.buffer,v.buffer,u.buffer])}};'],{type:"application/javascript"}),Td=URL.createObjectURL(Sd);var Cd=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ed=function(t){function e(e,r){var i=this,n=r.uniforms||{},s=[1,0,0,1,0,0];n[mu]=s,(i=t.call(this,e,{uniforms:n,postProcesses:r.postProcesses})||this).sourceRevision_=-1,i.verticesBuffer_=new cu(34962,35048),i.hitVerticesBuffer_=new cu(34962,35048),i.indicesBuffer_=new cu(34963,35048),i.program_=i.helper.getProgram(r.fragmentShader,r.vertexShader),i.hitDetectionEnabled_=!(!r.hitFragmentShader||!r.hitVertexShader),i.hitProgram_=i.hitDetectionEnabled_&&i.helper.getProgram(r.hitFragmentShader,r.hitVertexShader);var a=r.attributes?r.attributes.map((function(t){return{name:"a_"+t.name,size:1,type:Su.FLOAT}})):[];i.attributes=[{name:"a_position",size:2,type:Su.FLOAT},{name:"a_index",size:1,type:Su.FLOAT}].concat(a),i.hitDetectionAttributes=[{name:"a_position",size:2,type:Su.FLOAT},{name:"a_index",size:1,type:Su.FLOAT},{name:"a_hitColor",size:4,type:Su.FLOAT},{name:"a_featureUid",size:1,type:Su.FLOAT}].concat(a),i.customAttributes=r.attributes?r.attributes:[],i.previousExtent_=[1/0,1/0,-1/0,-1/0],i.currentTransform_=s,i.renderTransform_=[1,0,0,1,0,0],i.invertRenderTransform_=[1,0,0,1,0,0],i.renderInstructions_=new Float32Array(0),i.hitRenderInstructions_=new Float32Array(0),i.hitRenderTarget_=i.hitDetectionEnabled_&&new Pu(i.helper),i.worker_=new Worker(Td),i.worker_.addEventListener("message",function(t){var e=t.data;if(e.type===xd){var r=e.projectionTransform;e.hitDetection?(this.hitVerticesBuffer_.fromArrayBuffer(e.vertexBuffer),this.helper.flushBufferData(this.hitVerticesBuffer_)):(this.verticesBuffer_.fromArrayBuffer(e.vertexBuffer),this.helper.flushBufferData(this.verticesBuffer_)),this.indicesBuffer_.fromArrayBuffer(e.indexBuffer),this.helper.flushBufferData(this.indicesBuffer_),this.renderTransform_=r,Et(this.invertRenderTransform_,this.renderTransform_),e.hitDetection?this.hitRenderInstructions_=new Float32Array(t.data.renderInstructions):this.renderInstructions_=new Float32Array(t.data.renderInstructions),this.getLayer().changed()}}.bind(i)),i.featureCache_={},i.featureCount_=0;var l=i.getLayer().getSource();return i.sourceListenKeys_=[W(l,ic,i.handleSourceFeatureAdded_,i),W(l,nc,i.handleSourceFeatureChanged_,i),W(l,sc,i.handleSourceFeatureDelete_,i),W(l,oc,i.handleSourceFeatureClear_,i)],l.forEachFeature(function(t){this.featureCache_[o(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()},this.featureCount_++}.bind(i)),i}return Cd(e,t),e.prototype.handleSourceFeatureAdded_=function(t){var e=t.feature;this.featureCache_[o(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()},this.featureCount_++},e.prototype.handleSourceFeatureChanged_=function(t){var e=t.feature;this.featureCache_[o(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()}},e.prototype.handleSourceFeatureDelete_=function(t){var e=t.feature;delete this.featureCache_[o(e)],this.featureCount_--},e.prototype.handleSourceFeatureClear_=function(){this.featureCache_={},this.featureCount_=0},e.prototype.renderFrame=function(t){var e=this.indicesBuffer_.getSize();this.helper.drawElements(0,e),this.helper.finalizeDraw(t);var r=this.helper.getCanvas(),i=t.layerStatesArray[t.layerIndex].opacity;return i!==parseFloat(r.style.opacity)&&(r.style.opacity=String(i)),this.hitDetectionEnabled_&&(this.renderHitDetection(t),this.hitRenderTarget_.clearCachedData()),r},e.prototype.prepareFrame=function(t){var e=this.getLayer(),r=e.getSource(),i=t.viewState,n=!t.viewHints[ys]&&!t.viewHints[ms],o=!Jt(this.previousExtent_,t.extent),s=this.sourceRevision_<r.getRevision();if(s&&(this.sourceRevision_=r.getRevision()),n&&(o||s)){var a=i.projection,l=i.resolution,u=e instanceof _d?e.getRenderBuffer():0,h=Gt(t.extent,u*l);r.loadFeatures(h,l,a),this.rebuildBuffers_(t),this.previousExtent_=t.extent.slice()}return this.helper.makeProjectionTransform(t,this.currentTransform_),wt(this.currentTransform_,this.invertRenderTransform_),this.helper.useProgram(this.program_),this.helper.prepareDraw(t),this.helper.bindBuffer(this.verticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.attributes),!0},e.prototype.rebuildBuffers_=function(t){var e=[1,0,0,1,0,0];this.helper.makeProjectionTransform(t,e);var r,i,n=(2+this.customAttributes.length)*this.featureCount_;if(this.renderInstructions_&&this.renderInstructions_.length===n||(this.renderInstructions_=new Float32Array(n)),this.hitDetectionEnabled_){var o=(7+this.customAttributes.length)*this.featureCount_;this.hitRenderInstructions_&&this.hitRenderInstructions_.length===o||(this.hitRenderInstructions_=new Float32Array(o))}var s,a,l,u=[],h=[],c=0,p=0;for(var d in this.featureCache_)if((i=(r=this.featureCache_[d]).geometry)&&i.getType()===gt.POINT){u[0]=i.getFlatCoordinates()[0],u[1]=i.getFlatCoordinates()[1],St(e,u),a=p+6,l=void 0,(l=h||[])[0]=Math.floor(a/256/256/256)/255,l[1]=Math.floor(a/256/256)%256/255,l[2]=Math.floor(a/256)%256/255,l[3]=a%256/255,s=l,this.renderInstructions_[c++]=u[0],this.renderInstructions_[c++]=u[1],this.hitDetectionEnabled_&&(this.hitRenderInstructions_[p++]=u[0],this.hitRenderInstructions_[p++]=u[1],this.hitRenderInstructions_[p++]=s[0],this.hitRenderInstructions_[p++]=s[1],this.hitRenderInstructions_[p++]=s[2],this.hitRenderInstructions_[p++]=s[3],this.hitRenderInstructions_[p++]=Number(d));for(var f=void 0,g=0;g<this.customAttributes.length;g++)f=this.customAttributes[g].callback(r.feature,r.properties),this.renderInstructions_[c++]=f,this.hitDetectionEnabled_&&(this.hitRenderInstructions_[p++]=f)}var y={type:xd,renderInstructions:this.renderInstructions_.buffer,customAttributesCount:this.customAttributes.length};if(y.projectionTransform=e,this.worker_.postMessage(y,[this.renderInstructions_.buffer]),this.renderInstructions_=null,this.hitDetectionEnabled_){var m={type:xd,renderInstructions:this.hitRenderInstructions_.buffer,customAttributesCount:5+this.customAttributes.length};m.projectionTransform=e,m.hitDetection=!0,this.worker_.postMessage(m,[this.hitRenderInstructions_.buffer]),this.hitRenderInstructions_=null}},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,i,n){if(lt(this.hitDetectionEnabled_,66),this.hitRenderInstructions_){var o=St(e.coordinateToPixelTransform,t.slice()),s=this.hitRenderTarget_.readPixel(o[0]/2,o[1]/2),a=function(t){var e=0;return e+=Math.round(256*t[0]*256*256*255),e+=Math.round(256*t[1]*256*255),e+=Math.round(256*t[2]*255),e+=Math.round(255*t[3])}([s[0]/255,s[1]/255,s[2]/255,s[3]/255]),l=this.hitRenderInstructions_[a],u=Math.floor(l).toString(),h=this.getLayer().getSource().getFeatureByUid(u);return h?i(h,this.getLayer()):void 0}},e.prototype.renderHitDetection=function(t){if(this.hitVerticesBuffer_.getSize()){this.hitRenderTarget_.setSize([Math.floor(t.size[0]/2),Math.floor(t.size[1]/2)]),this.helper.useProgram(this.hitProgram_),this.helper.prepareDrawToRenderTarget(t,this.hitRenderTarget_,!0),this.helper.bindBuffer(this.hitVerticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.hitDetectionAttributes);var e=this.indicesBuffer_.getSize();this.helper.drawElements(0,e)}},e.prototype.disposeInternal=function(){this.worker_.terminate(),this.layer_=null,this.sourceListenKeys_.forEach((function(t){X(t)})),this.sourceListenKeys_=null,t.prototype.disposeInternal.call(this)},e}(bd),Rd={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},Pd=[Rd.FILL],Id=[Rd.STROKE],Od=[Rd.BEGIN_PATH],Ld=[Rd.CLOSE_PATH],Md=Rd,Fd=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ad=function(t){function e(e,r,i,n){var o=t.call(this)||this;return o.tolerance=e,o.maxExtent=r,o.pixelRatio=n,o.maxLineWidth=0,o.resolution=i,o.beginGeometryInstruction1_=null,o.beginGeometryInstruction2_=null,o.bufferedMaxExtent_=null,o.instructions=[],o.coordinates=[],o.tmpCoordinate_=[],o.hitDetectionInstructions=[],o.state={},o}return Fd(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))},e.prototype.appendFlatCoordinates=function(t,e,r,i,n,o){var s=this.coordinates.length,a=this.getBufferedMaxExtent();o&&(e+=i);var l,u,h,c=t[e],p=t[e+1],d=this.tmpCoordinate_,f=!0;for(l=e+i;l<r;l+=i)d[0]=t[l],d[1]=t[l+1],(h=Vt(a,d))!==u?(f&&(this.coordinates[s++]=c,this.coordinates[s++]=p),this.coordinates[s++]=d[0],this.coordinates[s++]=d[1],f=!1):h===Ft?(this.coordinates[s++]=d[0],this.coordinates[s++]=d[1],f=!1):f=!0,c=d[0],p=d[1],u=h;return(n&&f||l===e+i)&&(this.coordinates[s++]=c,this.coordinates[s++]=p),s},e.prototype.drawCustomCoordinates_=function(t,e,r,i,n){for(var o=0,s=r.length;o<s;++o){var a=r[o],l=this.appendFlatCoordinates(t,e,a,i,!1,!1);n.push(l),e=a}return e},e.prototype.drawCustom=function(t,e,r){this.beginGeometry(t,e);var i,n,o,s,a,l=t.getType(),u=t.getStride(),h=this.coordinates.length;if(l==gt.MULTI_POLYGON){i=t.getOrientedFlatCoordinates(),s=[];var c=t.getEndss();a=0;for(var p=0,d=c.length;p<d;++p){var f=[];a=this.drawCustomCoordinates_(i,a,c[p],u,f),s.push(f)}this.instructions.push([Md.CUSTOM,h,s,t,r,si])}else l==gt.POLYGON||l==gt.MULTI_LINE_STRING?(o=[],i=l==gt.POLYGON?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),a=this.drawCustomCoordinates_(i,0,t.getEnds(),u,o),this.instructions.push([Md.CUSTOM,h,o,t,r,oi])):l==gt.LINE_STRING||l==gt.MULTI_POINT?(i=t.getFlatCoordinates(),n=this.appendFlatCoordinates(i,0,i.length,u,!1,!1),this.instructions.push([Md.CUSTOM,h,n,t,r,ni])):l==gt.POINT&&(i=t.getFlatCoordinates(),this.coordinates.push(i[0],i[1]),n=this.coordinates.length,this.instructions.push([Md.CUSTOM,h,n,t,r]));this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){var r=t.getExtent();this.beginGeometryInstruction1_=[Md.BEGIN_GEOMETRY,e,0,r],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Md.BEGIN_GEOMETRY,e,0,r],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var r,i,n=e.length,o=-1;for(t=0;t<n;++t)(i=(r=e[t])[0])==Md.END_GEOMETRY?o=t:i==Md.BEGIN_GEOMETRY&&(r[2]=t,y(this.hitDetectionInstructions,o,t),o=-1)},e.prototype.setFillStrokeStyle=function(t,e){var r=this.state;if(t){var i=t.getColor();r.fillStyle=Ln(i||"#000")}else r.fillStyle=void 0;if(e){var n=e.getColor();r.strokeStyle=Ln(n||"#000");var o=e.getLineCap();r.lineCap=void 0!==o?o:"round";var s=e.getLineDash();r.lineDash=s?s.slice():Kn;var a=e.getLineDashOffset();r.lineDashOffset=a||0;var l=e.getLineJoin();r.lineJoin=void 0!==l?l:"round";var u=e.getWidth();r.lineWidth=void 0!==u?u:1;var h=e.getMiterLimit();r.miterLimit=void 0!==h?h:10,r.lineWidth>this.maxLineWidth&&(this.maxLineWidth=r.lineWidth,this.bufferedMaxExtent_=null)}else r.strokeStyle=void 0,r.lineCap=void 0,r.lineDash=null,r.lineDashOffset=void 0,r.lineJoin=void 0,r.lineWidth=void 0,r.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,r=[Md.SET_FILL_STYLE,e];return"string"!=typeof e&&r.push(!0),r},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[Md.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var r=t.fillStyle;"string"==typeof r&&t.currentFillStyle==r||(void 0!==r&&this.instructions.push(e.call(this,t)),t.currentFillStyle=r)},e.prototype.updateStrokeStyle=function(t,e){var r=t.strokeStyle,i=t.lineCap,n=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=r||t.currentLineCap!=i||n!=t.currentLineDash&&!v(t.currentLineDash,n)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(void 0!==r&&e.call(this,t),t.currentStrokeStyle=r,t.currentLineCap=i,t.currentLineDash=n,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[Md.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=zt(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Gt(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(On),kd=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Nd=function(t){function e(e,r,i,n){var o=t.call(this,e,r,i,n)||this;return o.declutterGroups_=null,o.hitDetectionImage_=null,o.image_=null,o.imagePixelRatio_=void 0,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o}return kd(e,t),e.prototype.drawCoordinates_=function(t,e,r,i){return this.appendFlatCoordinates(t,e,r,i,!1,!1)},e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var r=t.getFlatCoordinates(),i=t.getStride(),n=this.coordinates.length,o=this.drawCoordinates_(r,0,r.length,i);this.instructions.push([Md.DRAW_IMAGE,n,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,this.declutterGroups_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_)]),this.hitDetectionInstructions.push([Md.DRAW_IMAGE,n,o,this.hitDetectionImage_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,this.declutterGroups_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_)]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var r=t.getFlatCoordinates(),i=t.getStride(),n=this.coordinates.length,o=this.drawCoordinates_(r,0,r.length,i);this.instructions.push([Md.DRAW_IMAGE,n,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,this.declutterGroups_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_)]),this.hitDetectionInstructions.push([Md.DRAW_IMAGE,n,o,this.hitDetectionImage_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,this.declutterGroups_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_)]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var r=t.getAnchor(),i=t.getSize(),n=t.getHitDetectionImage(this.pixelRatio),o=t.getImage(this.pixelRatio),s=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=r[0],this.anchorY_=r[1],this.declutterGroups_=e,this.hitDetectionImage_=n,this.image_=o,this.height_=i[1],this.opacity_=t.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=i[0]},e}(Ad),jd=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Dd=function(t){function e(e,r,i,n){return t.call(this,e,r,i,n)||this}return jd(e,t),e.prototype.drawFlatCoordinates_=function(t,e,r,i){var n=this.coordinates.length,o=this.appendFlatCoordinates(t,e,r,i,!1,!1),s=[Md.MOVE_TO_LINE_TO,n,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),r},e.prototype.drawLineString=function(t,e){var r=this.state,i=r.strokeStyle,n=r.lineWidth;if(void 0!==i&&void 0!==n){this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Md.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset],Od);var o=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(o,0,o.length,s),this.hitDetectionInstructions.push(Id),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var r=this.state,i=r.strokeStyle,n=r.lineWidth;if(void 0!==i&&void 0!==n){this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Md.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset],Od);for(var o=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),l=0,u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinates_(s,l,o[u],a);this.hitDetectionInstructions.push(Id),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(Id),this.reverseHitDetectionInstructions(),this.state=null,t.prototype.finish.call(this)},e.prototype.applyStroke=function(e){null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(Id),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(Od)},e}(Ad),Gd=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),zd=function(t){function e(e,r,i,n){return t.call(this,e,r,i,n)||this}return Gd(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,r,i){var n=this.state,o=void 0!==n.fillStyle,s=void 0!==n.strokeStyle,a=r.length;this.instructions.push(Od),this.hitDetectionInstructions.push(Od);for(var l=0;l<a;++l){var u=r[l],h=this.coordinates.length,c=this.appendFlatCoordinates(t,e,u,i,!0,!s),p=[Md.MOVE_TO_LINE_TO,h,c];this.instructions.push(p),this.hitDetectionInstructions.push(p),s&&(this.instructions.push(Ld),this.hitDetectionInstructions.push(Ld)),e=u}return o&&(this.instructions.push(Pd),this.hitDetectionInstructions.push(Pd)),s&&(this.instructions.push(Id),this.hitDetectionInstructions.push(Id)),e},e.prototype.drawCircle=function(t,e){var r=this.state,i=r.fillStyle,n=r.strokeStyle;if(void 0!==i||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==r.fillStyle&&this.hitDetectionInstructions.push([Md.SET_FILL_STYLE,"#000"]),void 0!==r.strokeStyle&&this.hitDetectionInstructions.push([Md.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);var o=t.getFlatCoordinates(),s=t.getStride(),a=this.coordinates.length;this.appendFlatCoordinates(o,0,o.length,s,!1,!1);var l=[Md.CIRCLE,a];this.instructions.push(Od,l),this.hitDetectionInstructions.push(Od,l),void 0!==r.fillStyle&&(this.instructions.push(Pd),this.hitDetectionInstructions.push(Pd)),void 0!==r.strokeStyle&&(this.instructions.push(Id),this.hitDetectionInstructions.push(Id)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var r=this.state,i=r.fillStyle,n=r.strokeStyle;if(void 0!==i||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==r.fillStyle&&this.hitDetectionInstructions.push([Md.SET_FILL_STYLE,"#000"]),void 0!==r.strokeStyle&&this.hitDetectionInstructions.push([Md.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);var o=t.getEnds(),s=t.getOrientedFlatCoordinates(),a=t.getStride();this.drawFlatCoordinatess_(s,0,o,a),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var r=this.state,i=r.fillStyle,n=r.strokeStyle;if(void 0!==i||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==r.fillStyle&&this.hitDetectionInstructions.push([Md.SET_FILL_STYLE,"#000"]),void 0!==r.strokeStyle&&this.hitDetectionInstructions.push([Md.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);for(var o=t.getEndss(),s=t.getOrientedFlatCoordinates(),a=t.getStride(),l=0,u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinatess_(s,l,o[u],a);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var r=this.coordinates,i=0,n=r.length;i<n;++i)r[i]=ei(r[i],e);return t.prototype.finish.call(this)},e.prototype.setFillStrokeStyles_=function(){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},e}(Ad);function Bd(t,e,r,i,n){var o,s,a,l,u,h,c,p,d,f=r,g=r,y=0,m=0,_=r;for(o=r;o<i;o+=n){var v=e[o],x=e[o+1];void 0!==l&&(p=v-l,d=x-u,a=Math.sqrt(p*p+d*d),void 0!==h&&(m+=s,Math.acos((h*p+c*d)/(s*a))>t&&(m>y&&(y=m,f=_,g=o),m=0,_=o-n)),s=a,h=p,c=d),l=v,u=x}return(m+=a)>y?[_,o]:[f,g]}var Ud=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Yd={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Wd={Circle:zd,Default:Ad,Image:Nd,LineString:Dd,Polygon:zd,Text:function(t){function e(e,r,i,n){var o=t.call(this,e,r,i,n)||this;return o.declutterGroups_,o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o}return Ud(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var r=this.textFillState_,i=this.textStrokeState_,n=this.textState_;if(""!==this.text_&&n&&(r||i)){var o,s,a=this.coordinates.length,l=t.getType(),u=null,h=2,c=2;if(n.placement===uh){if(!ge(this.getBufferedMaxExtent(),t.getExtent()))return;var p=void 0;if(u=t.getFlatCoordinates(),c=t.getStride(),l==gt.LINE_STRING)p=[u.length];else if(l==gt.MULTI_LINE_STRING)p=t.getEnds();else if(l==gt.POLYGON)p=t.getEnds().slice(0,1);else if(l==gt.MULTI_POLYGON){var d=t.getEndss();for(p=[],o=0,s=d.length;o<s;++o)p.push(d[o][0])}this.beginGeometry(t,e);for(var f=n.textAlign,g=0,y=void 0,m=0,_=p.length;m<_;++m){if(null==f){var v=Bd(n.maxAngle,u,g,p[m],c);g=v[0],y=v[1]}else y=p[m];for(o=g;o<y;o+=c)this.coordinates.push(u[o],u[o+1]);h=this.coordinates.length,g=p[m];var x=this.declutterGroups_?0===m?this.declutterGroups_[0]:[].concat(this.declutterGroups_[0]):null;this.drawChars_(a,h,x),a=h}this.endGeometry(e)}else{var w=null;switch(n.overflow||(w=[]),l){case gt.POINT:case gt.MULTI_POINT:h=(u=t.getFlatCoordinates()).length;break;case gt.LINE_STRING:u=t.getFlatMidpoint();break;case gt.CIRCLE:u=t.getCenter();break;case gt.MULTI_LINE_STRING:h=(u=t.getFlatMidpoints()).length;break;case gt.POLYGON:u=t.getFlatInteriorPoint(),n.overflow||w.push(u[2]/this.resolution),c=3;break;case gt.MULTI_POLYGON:var b=t.getFlatInteriorPoints();for(u=[],o=0,s=b.length;o<s;o+=3)n.overflow||w.push(b[o+2]/this.resolution),u.push(b[o],b[o+1]);if(0==(h=u.length))return}h=this.appendFlatCoordinates(u,0,h,c,!1,!1),this.saveTextStates_(),(n.backgroundFill||n.backgroundStroke)&&(this.setFillStrokeStyle(n.backgroundFill,n.backgroundStroke),n.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),n.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var S=n.padding;if(S!=Hn&&(n.scale[0]<0||n.scale[1]<0)){var T=n.padding[0],C=n.padding[1],E=n.padding[2],R=n.padding[3];n.scale[0]<0&&(C=-C,R=-R),n.scale[1]<0&&(T=-T,E=-E),S=[T,C,E,R]}var P=this.pixelRatio;this.instructions.push([Md.DRAW_IMAGE,a,h,null,NaN,NaN,this.declutterGroups_,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,S==Hn?Hn:S.map((function(t){return t*P})),!!n.backgroundFill,!!n.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,w]);var I=1/P;this.hitDetectionInstructions.push([Md.DRAW_IMAGE,a,h,null,NaN,NaN,this.declutterGroups_,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[I,I],NaN,S,!!n.backgroundFill,!!n.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,w]),this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,r=this.textFillState_,i=this.strokeKey_;t&&(i in this.strokeStates||(this.strokeStates[i]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var n=this.textKey_;n in this.textStates||(this.textStates[n]={font:e.font,textAlign:e.textAlign||"center",textBaseline:e.textBaseline||"middle",scale:e.scale});var o=this.fillKey_;r&&(o in this.fillStates||(this.fillStates[o]={fillStyle:r.fillStyle}))},e.prototype.drawChars_=function(t,e,r){var i=this.textStrokeState_,n=this.textState_,o=this.strokeKey_,s=this.textKey_,a=this.fillKey_;this.saveTextStates_();var l=this.pixelRatio,u=Yd[n.textBaseline],h=this.textOffsetY_*l,c=this.text_,p=i?i.lineWidth*Math.abs(n.scale[0])/2:0;this.instructions.push([Md.DRAW_CHARS,t,e,u,r,n.overflow,a,n.maxAngle,l,h,o,p*l,c,s,1]),this.hitDetectionInstructions.push([Md.DRAW_CHARS,t,e,u,r,n.overflow,a,n.maxAngle,1,h,o,p,c,s,1/l])},e.prototype.setTextStyle=function(t,e){var r,i,n;if(t){this.declutterGroups_=e;var s=t.getFill();s?((i=this.textFillState_)||(i={},this.textFillState_=i),i.fillStyle=Ln(s.getColor()||"#000")):(i=null,this.textFillState_=i);var a=t.getStroke();if(a){(n=this.textStrokeState_)||(n={},this.textStrokeState_=n);var l=a.getLineDash(),u=a.getLineDashOffset(),h=a.getWidth(),c=a.getMiterLimit();n.lineCap=a.getLineCap()||"round",n.lineDash=l?l.slice():Kn,n.lineDashOffset=void 0===u?0:u,n.lineJoin=a.getLineJoin()||"round",n.lineWidth=void 0===h?1:h,n.miterLimit=void 0===c?10:c,n.strokeStyle=Ln(a.getColor()||"#000")}else n=null,this.textStrokeState_=n;r=this.textState_;var p=t.getFont()||"10px sans-serif";no(p);var d=t.getScaleArray();r.overflow=t.getOverflow(),r.font=p,r.maxAngle=t.getMaxAngle(),r.placement=t.getPlacement(),r.textAlign=t.getTextAlign(),r.textBaseline=t.getTextBaseline()||"middle",r.backgroundFill=t.getBackgroundFill(),r.backgroundStroke=t.getBackgroundStroke(),r.padding=t.getPadding()||Hn,r.scale=void 0===d?[1,1]:d;var f=t.getOffsetX(),g=t.getOffsetY(),y=t.getRotateWithView(),m=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===f?0:f,this.textOffsetY_=void 0===g?0:g,this.textRotateWithView_=void 0!==y&&y,this.textRotation_=void 0===m?0:m,this.strokeKey_=n?("string"==typeof n.strokeStyle?n.strokeStyle:o(n.strokeStyle))+n.lineCap+n.lineDashOffset+"|"+n.lineWidth+n.lineJoin+n.miterLimit+"["+n.lineDash.join()+"]":"",this.textKey_=r.font+r.scale+(r.textAlign||"?")+(r.textBaseline||"?"),this.fillKey_=i?"string"==typeof i.fillStyle?i.fillStyle:"|"+o(i.fillStyle):""}else this.text_=""},e}(Ad)},Vd=function(){function t(t,e,r,i,n){this.declutter_=n,this.declutterGroups_=null,this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=i,this.resolution_=r,this.buildersByZIndex_={}}return t.prototype.addDeclutter=function(t){var e=null;return this.declutter_&&(t?(e=this.declutterGroups_)[0][0]++:(e=[[1]],this.declutterGroups_=e)),e},t.prototype.finish=function(){var t={};for(var e in this.buildersByZIndex_){t[e]=t[e]||{};var r=this.buildersByZIndex_[e];for(var i in r){var n=r[i].finish();t[e][i]=n}}return t},t.prototype.getBuilder=function(t,e){var r=void 0!==t?t.toString():"0",i=this.buildersByZIndex_[r];void 0===i&&(i={},this.buildersByZIndex_[r]=i);var n=i[e];void 0===n&&(n=new(0,Wd[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),i[e]=n);return n},t}();function Xd(t,e,r,i,n,o,s,a,l,u,h,c){var p,d=[];if(c){var f=jr(t,e,r,i,c,[t[e],t[e+1]]);p=f[0]>f[f.length-i]}else p=t[e]>t[r-i];for(var g,y,m=n.length,_=t[e],v=t[e+1],x=t[e+=i],w=t[e+1],b=0,S=Math.sqrt(Math.pow(x-_,2)+Math.pow(w-v,2)),T=!1,C=0;C<m;++C){for(var E=n[g=p?m-C-1:C],R=a*l(u,E,h),P=o+R/2;e<r-i&&b+S<P;)_=x,v=w,x=t[e+=i],w=t[e+1],b+=S,S=Math.sqrt(Math.pow(x-_,2)+Math.pow(w-v,2));var I=P-b,O=Math.atan2(w-v,x-_);if(p&&(O+=O>0?-Math.PI:Math.PI),void 0!==y){var L=O-y;if(T=T||0!==L,L+=L>Math.PI?-2*Math.PI:L<-Math.PI?2*Math.PI:0,Math.abs(L)>s)return null}y=O;var M=I/S,F=Ie(_,x,M),A=Ie(v,w,M);d[g]=[F,A,R/2,O,E],o+=R}return T?d:[[d[0][0],d[0][1],d[0][2],d[0][3],n]]}function qd(t,e,r,i){for(var n=t[e],o=t[e+1],s=0,a=e+i;a<r;a+=i){var l=t[a],u=t[a+1];s+=Math.sqrt((l-n)*(l-n)+(u-o)*(u-o)),n=l,o=u}return s}var Zd=[1/0,1/0,-1/0,-1/0],Kd=[1,0,0,1,0,0],Hd=[],Jd=[],$d=[],Qd=[],tf=function(){function t(t,e,r,i,n){this.overlaps=r,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.declutterItems=[],this.instructions=i.instructions,this.coordinates=i.coordinates,this.coordinateCache_={},this.renderBuffer_=n,this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=i.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=i.fillStates||{},this.strokeStates=i.strokeStates||{},this.textStates=i.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,r,i){var n=t+e+r+i;if(this.labels_[n])return this.labels_[n];var o=i?this.strokeStates[i]:null,s=r?this.fillStates[r]:null,a=this.textStates[e],l=this.pixelRatio,u=[a.scale[0]*l,a.scale[1]*l],h=Yd[a.textAlign||"center"],c=i&&o.lineWidth?o.lineWidth:0,p=t.split("\n"),d=p.length,f=[],g=function(t,e,r){for(var i=e.length,n=0,o=0;o<i;++o){var s=ao(t,e[o]);n=Math.max(n,s),r.push(s)}return n}(a.font,p,f),y=oo(a.font),m=g+c,_=[],v=(m+2)*u[0],x=(y*d+c)*u[1],w={width:v<0?Math.floor(v):Math.ceil(v),height:x<0?Math.floor(x):Math.ceil(x),contextInstructions:_};(1==u[0]&&1==u[1]||_.push("scale",u),_.push("font",a.font),i)&&(_.push("strokeStyle",o.strokeStyle),_.push("lineWidth",c),_.push("lineCap",o.lineCap),_.push("lineJoin",o.lineJoin),_.push("miterLimit",o.miterLimit),(jn?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(_.push("setLineDash",[o.lineDash]),_.push("lineDashOffset",o.lineDashOffset)));r&&_.push("fillStyle",s.fillStyle),_.push("textBaseline","middle"),_.push("textAlign","center");var b,S=.5-h,T=h*m+S*c;if(i)for(b=0;b<d;++b)_.push("strokeText",[p[b],T+S*f[b],.5*(c+y)+b*y]);if(r)for(b=0;b<d;++b)_.push("fillText",[p[b],T+S*f[b],.5*(c+y)+b*y]);return this.labels_[n]=w,w},t.prototype.replayTextBackground_=function(t,e,r,i,n,o,s,a){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,r),t.lineTo.apply(t,i),t.lineTo.apply(t,n),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],a&&(t.fillStyle=o[1]),this.fill_(t)),s&&(this.setStrokeStyle_(t,s),t.stroke())},t.prototype.replayImageOrLabel_=function(t,e,r,i,n,o,s,a,l,u,h,c,p,d,f,g,y,m,_){var v=m||_;r-=o*=d[0],i-=s*=d[1];var x=g+h>n.width?n.width-h:g,w=l+c>n.height?n.height-c:l,b=y[3]+x*d[0]+y[1],S=y[0]+w*d[1]+y[2],T=r-y[3],C=i-y[0];(v||0!==p)&&(Hd[0]=T,Qd[0]=T,Hd[1]=C,Jd[1]=C,Jd[0]=T+b,$d[0]=Jd[0],$d[1]=C+S,Qd[1]=$d[1]);var E=null;if(0!==p){var R=r+o,P=i+s;E=Ct(Kd,R,P,1,1,p,-R,-P),St(Kd,Hd),St(Kd,Jd),St(Kd,$d),St(Kd,Qd),qt(Math.min(Hd[0],Jd[0],$d[0],Qd[0]),Math.min(Hd[1],Jd[1],$d[1],Qd[1]),Math.max(Hd[0],Jd[0],$d[0],Qd[0]),Math.max(Hd[1],Jd[1],$d[1],Qd[1]),Zd)}else qt(T,C,T+b,C+S,Zd);this.renderBuffer_[0]=Math.max(this.renderBuffer_[0],fe(Zd)),this.renderBuffer_[1]=Math.max(this.renderBuffer_[1],he(Zd));var I=t.canvas,O=_?_[2]*d[0]/2:0,L=this.renderBuffer_,M=Zd[0]-O<=(I.width+L[0])/e&&Zd[2]+O>=-L[0]/e&&Zd[1]-O<=(I.height+L[1])/e&&Zd[3]+O>=-L[1]/e;if(f&&(r=Math.round(r),i=Math.round(i)),a){if(!M&&1==a[0])return!1;var F=M?[t,E?E.slice(0):null,u,n,h,c,x,w,r,i,d,Zd.slice()]:null;F&&(v&&F.push(m,_,Hd.slice(0),Jd.slice(0),$d.slice(0),Qd.slice(0)),a.push(F))}else M&&(v&&this.replayTextBackground_(t,Hd,Jd,$d,Qd,m,_,!1),ho(t,E,u,n,h,c,x,w,r,i,d));return!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=St(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;t.save(),t.translate(e[0]%r,e[1]%r),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.renderDeclutter=function(t,e,r,i){for(var n=[],o=1,s=t.length;o<s;++o){var a=(c=t[o])[11];n.push({minX:a[0],minY:a[1],maxX:a[2],maxY:a[3],value:e})}i||(i=new ec.a(9));var l=!1;for(o=0,s=n.length;o<s;++o)if(i.collides(n[o])){l=!0;break}if(!l){i.load(n);for(var u=1,h=t.length;u<h;++u){var c,p=(c=t[u])[0],d=p.globalAlpha;d!==r&&(p.globalAlpha=r),c.length>12&&this.replayTextBackground_(c[0],c[14],c[15],c[16],c[17],c[12],c[13],!0),ho.apply(void 0,c),d!==r&&(p.globalAlpha=d)}}return t.length=1,i},t.prototype.drawLabelWithPointPlacement_=function(t,e,r,i){var n=this.textStates[e],o=this.createLabel(t,e,i,r),s=this.strokeStates[r],a=this.pixelRatio,l=Yd[n.textAlign||"center"],u=Yd[n.textBaseline||"middle"],h=s&&s.lineWidth?s.lineWidth:0;return{label:o,anchorX:l*(o.width/a-2*n.scale[0])+2*(.5-l)*h,anchorY:u*o.height/a+2*(.5-u)*h}},t.prototype.execute_=function(t,e,r,i,n,o,s){var a,l,u;this.declutterItems.length=0,this.pixelCoordinates_&&v(r,this.renderedTransform_)?a=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),a=Nr(this.coordinates,0,this.coordinates.length,2,r,this.pixelCoordinates_),l=this.renderedTransform_,u=r,l[0]=u[0],l[1]=u[1],l[2]=u[2],l[3]=u[3],l[4]=u[4],l[5]=u[5]);for(var h,c,p,d,f,g,y,m,_,x,w,b,S,T,C,E,R,P=0,I=i.length,O=0,L=0,M=0,F=null,A=null,k=this.coordinateCache_,N=this.viewRotation_,j=Math.round(1e12*Math.atan2(-r[1],r[0]))/1e12,D={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:N},G=this.instructions!=i||this.overlaps?0:200;P<I;){var z=i[P];switch(z[0]){case Md.BEGIN_GEOMETRY:(C=z[1]).getGeometry()?void 0===s||ge(s,z[3])?++P:P=z[2]+1:P=z[2];break;case Md.BEGIN_PATH:L>G&&(this.fill_(t),L=0),M>G&&(t.stroke(),M=0),L||M||(t.beginPath(),d=NaN,f=NaN),++P;break;case Md.CIRCLE:var B=a[O=z[1]],U=a[O+1],Y=a[O+2]-B,W=a[O+3]-U,V=Math.sqrt(Y*Y+W*W);t.moveTo(B+V,U),t.arc(B,U,V,0,2*Math.PI,!0),++P;break;case Md.CLOSE_PATH:t.closePath(),++P;break;case Md.CUSTOM:O=z[1],h=z[2];var X=z[3],q=z[4],Z=6==z.length?z[5]:void 0;D.geometry=X,D.feature=C,P in k||(k[P]=[]);var K=k[P];Z?Z(a,O,h,2,K):(K[0]=a[O],K[1]=a[O+1],K.length=2),q(K,D),++P;break;case Md.DRAW_IMAGE:O=z[1],h=z[2],x=z[3],c=z[4],p=z[5],_=o?null:z[6];var H=z[7],J=z[8],$=z[9],Q=z[10],tt=z[11],et=z[12],rt=z[13],it=z[14];if(!x&&z.length>=19){w=z[18],b=z[19],S=z[20],T=z[21];var nt=this.drawLabelWithPointPlacement_(w,b,S,T);x=nt.label,z[3]=x;var ot=z[22];c=(nt.anchorX-ot)*this.pixelRatio,z[4]=c;var st=z[23];p=(nt.anchorY-st)*this.pixelRatio,z[5]=p,H=x.height,z[7]=H,it=x.width,z[14]=it}var at=void 0;z.length>24&&(at=z[24]);var lt=void 0,ut=void 0,ht=void 0;z.length>16?(lt=z[15],ut=z[16],ht=z[17]):(lt=Hn,ut=!1,ht=!1),tt&&j?et+=N:tt||j||(et-=N);for(var ct=0,pt=0;O<h;O+=2)if(!(at&&at[ct++]<it/this.pixelRatio)){if(_){var dt=Math.floor(pt);m=_.length<dt+1?[_[0][0]]:_[dt]}(Lt=this.replayImageOrLabel_(t,e,a[O],a[O+1],x,c,p,m,H,J,$,Q,et,rt,n,it,lt,ut?F:null,ht?A:null))&&m&&_[_.length-1]!==m&&_.push(m),m&&(m.length-1===m[0]&&this.declutterItems.push(this,m,C),pt+=1/m[0])}++P;break;case Md.DRAW_CHARS:var ft=z[1],gt=z[2],yt=z[3];m=o?null:z[4];var mt=z[5];T=z[6];var _t=z[7],vt=z[8],xt=z[9];S=z[10];var wt=z[11];w=z[12],b=z[13];var bt=[z[14],z[14]],St=this.textStates[b],Tt=St.font,Ct=[St.scale[0]*vt,St.scale[1]*vt],Et=void 0;Tt in this.widths_?Et=this.widths_[Tt]:(Et={},this.widths_[Tt]=Et);var Rt=qd(a,ft,gt,2),Pt=Math.abs(Ct[0])*lo(Tt,w,Et);if(mt||Pt<=Rt){var It=this.textStates[b].textAlign,Ot=Xd(a,ft,gt,2,w,(Rt-Pt)*Yd[It],_t,Math.abs(Ct[0]),lo,Tt,Et,j?0:this.viewRotation_);if(Ot){var Lt=!1,Mt=void 0,Ft=void 0,At=void 0,kt=void 0,Nt=void 0;if(S)for(Mt=0,Ft=Ot.length;Mt<Ft;++Mt)At=(Nt=Ot[Mt])[4],kt=this.createLabel(At,b,"",S),c=Nt[2]+wt,p=yt*kt.height+2*(.5-yt)*wt*Ct[1]/Ct[0]-xt,Lt=this.replayImageOrLabel_(t,e,Nt[0],Nt[1],kt,c,p,m,kt.height,1,0,0,Nt[3],bt,!1,kt.width,Hn,null,null)||Lt;if(T)for(Mt=0,Ft=Ot.length;Mt<Ft;++Mt)At=(Nt=Ot[Mt])[4],kt=this.createLabel(At,b,T,""),c=Nt[2],p=yt*kt.height-xt,Lt=this.replayImageOrLabel_(t,e,Nt[0],Nt[1],kt,c,p,m,kt.height,1,0,0,Nt[3],bt,!1,kt.width,Hn,null,null)||Lt;Lt&&this.declutterItems.push(this,m,C)}}++P;break;case Md.END_GEOMETRY:if(void 0!==o){var jt=o(C=z[1]);if(jt)return jt}++P;break;case Md.FILL:G?L++:this.fill_(t),++P;break;case Md.MOVE_TO_LINE_TO:for(O=z[1],h=z[2],E=a[O],y=(R=a[O+1])+.5|0,(g=E+.5|0)===d&&y===f||(t.moveTo(E,R),d=g,f=y),O+=2;O<h;O+=2)g=(E=a[O])+.5|0,y=(R=a[O+1])+.5|0,O!=h-2&&g===d&&y===f||(t.lineTo(E,R),d=g,f=y);++P;break;case Md.SET_FILL_STYLE:F=z,this.alignFill_=z[2],L&&(this.fill_(t),L=0,M&&(t.stroke(),M=0)),t.fillStyle=z[1],++P;break;case Md.SET_STROKE_STYLE:A=z,M&&(t.stroke(),M=0),this.setStrokeStyle_(t,z),++P;break;case Md.STROKE:G?M++:t.stroke(),++P;break;default:++P}}L&&this.fill_(t),M&&t.stroke()},t.prototype.execute=function(t,e,r,i,n){this.viewRotation_=i,this.execute_(t,e,r,this.instructions,n,void 0,void 0)},t.prototype.executeHitDetection=function(t,e,r,i,n){return this.viewRotation_=r,this.execute_(t,1,e,this.hitDetectionInstructions,!0,i,n)},t}(),ef=[xo,yo,vo,_o,wo,mo],rf=function(){function t(t,e,r,i,n,o){this.maxExtent_=t,this.overlaps_=i,this.pixelRatio_=r,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(n)}return t.prototype.clip=function(t,e){var r=this.getClipCoords(e);t.beginPath(),t.moveTo(r[0],r[1]),t.lineTo(r[2],r[3]),t.lineTo(r[4],r[5]),t.lineTo(r[6],r[7]),t.clip()},t.prototype.createExecutors_=function(t){for(var e in t){var r=this.executorsByZIndex_[e];void 0===r&&(r={},this.executorsByZIndex_[e]=r);var i=t[e],n=[this.renderBuffer_||0,this.renderBuffer_||0];for(var o in i){var s=i[o];r[o]=new tf(this.resolution_,this.pixelRatio_,this.overlaps_,s,n)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var r=this.executorsByZIndex_[e],i=0,n=t.length;i<n;++i)if(t[i]in r)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,r,i,n,o){var s=2*(i=Math.round(i))+1,a=Ct(this.hitDetectionTransform_,i+.5,i+.5,1/e,-1/e,-r,-t[0],-t[1]);this.hitDetectionContext_||(this.hitDetectionContext_=zn(s,s));var l,u=this.hitDetectionContext_;u.canvas.width!==s||u.canvas.height!==s?(u.canvas.width=s,u.canvas.height=s):u.clearRect(0,0,s,s),void 0!==this.renderBuffer_&&(Qt(l=[1/0,1/0,-1/0,-1/0],t),Gt(l,e*(this.renderBuffer_+i),l));var h,c=function(t){if(void 0!==nf[t])return nf[t];for(var e=2*t+1,r=new Array(e),i=0;i<e;i++)r[i]=new Array(e);var n=t,o=0,s=0;for(;n>=o;)of(r,t+n,t+o),of(r,t+o,t+n),of(r,t-o,t+n),of(r,t-n,t+o),of(r,t-n,t-o),of(r,t-o,t-n),of(r,t+o,t-n),of(r,t+n,t-o),o++,2*((s+=1+2*o)-n)+1>0&&(s+=1-2*(n-=1));return nf[t]=r,r}(i);function p(t){for(var e=u.getImageData(0,0,s,s).data,r=0;r<s;r++)for(var i=0;i<s;i++)if(c[r][i]&&e[4*(i*s+r)+3]>0){var a=void 0;return(!o||h!=_o&&h!=wo||-1!==o.indexOf(t))&&(a=n(t)),a||void u.clearRect(0,0,s,s)}}var f,g,y,m,_,v=Object.keys(this.executorsByZIndex_).map(Number);for(v.sort(d),f=v.length-1;f>=0;--f){var x=v[f].toString();for(y=this.executorsByZIndex_[x],g=ef.length-1;g>=0;--g)if(void 0!==(m=y[h=ef[g]])&&(_=m.executeHitDetection(u,a,r,p,l)))return _}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var r=e[0],i=e[1],n=e[2],o=e[3],s=[r,i,r,o,n,o,n,i];return Nr(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return R(this.executorsByZIndex_)},t.prototype.execute=function(t,e,r,i,n,o,s){var a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(d),this.maxExtent_&&(t.save(),this.clip(t,r));var l,u,h,c,p,f,g=o||ef;for(l=0,u=a.length;l<u;++l){var y=a[l].toString();for(p=this.executorsByZIndex_[y],h=0,c=g.length;h<c;++h){var m=g[h];if(void 0!==(f=p[m]))if(!s||m!=_o&&m!=wo)f.execute(t,e,r,i,n);else{var _=s[y];_?_.push(f,r.slice(0)):s[y]=[f,r.slice(0)]}}}this.maxExtent_&&t.restore()},t}(),nf={0:[[!0]]};function of(t,e,r){var i,n=Math.floor(t.length/2);if(e>=n)for(i=n;i<e;i++)t[i][r]=!0;else if(e<n)for(i=e+1;i<n;i++)t[i][r]=!0}function sf(t,e,r,i,n,o){for(var s=Object.keys(t).map(Number).sort(d),a=0,l=s.length;a<l;++a)for(var u=t[s[a].toString()],h=void 0,c=0,p=u.length;c<p;){var f=u[c++],g=u[c++];f.execute(e,1,g,r,n),f!==h&&f.declutterItems.length>0&&(h=f,o.push({items:f.declutterItems,opacity:i}))}}var af=rf;function lf(t,e,r,i,n,o,s){var a=zn(t[0]/2,t[1]/2);a.imageSmoothingEnabled=!1;for(var l=a.canvas,u=new go(a,.5,n,null,s),h=r.length,c=Math.floor(16777215/h),p={},f=1;f<=h;++f){var g=r[f-1],y=g.getStyleFunction()||i;if(i){var m=y(g,o);if(m){Array.isArray(m)||(m=[m]);for(var _="#"+("000000"+(f*c).toString(16)).slice(-6),v=0,x=m.length;v<x;++v){var w=m[v],b=w.clone(),S=b.getFill();S&&S.setColor(_);var T=b.getStroke();T&&T.setColor(_),b.setText(void 0);var C=w.getImage();if(C){var E=C.getImageSize();if(!E)continue;var R=document.createElement("canvas");R.width=E[0],R.height=E[1];var P=R.getContext("2d",{alpha:!1});P.fillStyle=_;var I=P.canvas;P.fillRect(0,0,I.width,I.height),zn(E?E[0]:I.width,E?E[1]:I.height).drawImage(I,0,0),b.setImage(new th({img:I,imgSize:E,anchor:C.getAnchor(),anchorXUnits:zu,anchorYUnits:zu,offset:C.getOrigin(),size:C.getSize(),opacity:C.getOpacity(),scale:C.getScale(),rotation:C.getRotation(),rotateWithView:C.getRotateWithView()}))}var O=Number(b.getZIndex());(A=p[O])||(A={},p[O]=A,A[gt.POLYGON]=[],A[gt.CIRCLE]=[],A[gt.LINE_STRING]=[],A[gt.POINT]=[]);var L=b.getGeometryFunction()(g);L&&ge(n,L.getExtent())&&A[L.getType().replace("Multi","")].push(L,b)}}}}for(var M=Object.keys(p).map(Number).sort(d),F=(f=0,M.length);f<F;++f){var A=p[M[f]];for(var k in A){var N=A[k];for(v=0,x=N.length;v<x;v+=2){u.setStyle(N[v+1]);for(var j=0,D=e.length;j<D;++j)u.setTransform(e[j]),u.drawGeometry(N[v])}}}return a.getImageData(0,0,l.width,l.height)}function uf(t,e,r){var i=[];if(r){var n=4*(Math.round(t[0]/2)+Math.round(t[1]/2)*r.width),o=r.data[n],s=r.data[n+1],a=r.data[n+2]+256*(s+256*o),l=Math.floor(16777215/e.length);a&&a%l==0&&i.push(e[a/l-1])}return i}var hf=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),cf=function(t){function e(e){var r=t.call(this,e)||this;return r.boundHandleStyleImageChange_=r.handleStyleImageChange_.bind(r),r.animatingOrInteracting_,r.dirty_=!1,r.hitDetectionImageData_=null,r.renderedFeatures_=null,r.renderedRevision_=-1,r.renderedResolution_=NaN,r.renderedExtent_=[1/0,1/0,-1/0,-1/0],r.renderedRotation_,r.renderedCenter_=null,r.renderedProjection_=null,r.renderedRenderOrder_=null,r.replayGroup_=null,r.replayGroupChanged=!0,r}return hf(e,t),e.prototype.useContainer=function(e,r,i){i<1&&(e=null),t.prototype.useContainer.call(this,e,r,i)},e.prototype.renderFrame=function(t,e){var r=t.pixelRatio,i=t.layerStatesArray[t.layerIndex];!function(t,e,r){bt(t,e,0,0,r,0,0)}(this.pixelTransform,1/r,1/r),Et(this.inversePixelTransform,this.pixelTransform);var n=Rt(this.pixelTransform);this.useContainer(e,n,i.opacity);var o=this.context,s=o.canvas,a=this.replayGroup_;if(!a||a.isEmpty())return!this.containerReused&&s.width>0&&(s.width=0),this.container;var l=Math.round(t.size[0]*r),u=Math.round(t.size[1]*r);s.width!=l||s.height!=u?(s.width=l,s.height=u,s.style.transform!==n&&(s.style.transform=n)):this.containerReused||o.clearRect(0,0,l,u),this.preRender(o,t);var h=t.extent,c=t.viewState,p=c.center,d=c.resolution,f=c.projection,g=c.rotation,y=f.getExtent(),m=this.getLayer().getSource(),_=!1;if(i.extent){var v=Ar(i.extent,f);(_=!Yt(v,t.extent)&&ge(v,t.extent))&&this.clipUnrotated(o,t,v)}var x=t.viewHints,w=!(x[ys]||x[ms]),b=this.getRenderTransform(p,d,g,r,l,u,0),S=this.getLayer().getDeclutter()?{}:null;if(a.execute(o,1,b,g,w,void 0,S),m.getWrapX()&&f.canWrapX()&&!Yt(y,h)){for(var T=h[0],C=fe(y),E=0,R=void 0;T<y[0];){R=C*--E;var P=this.getRenderTransform(p,d,g,r,l,u,R);a.execute(o,1,P,g,w,void 0,S),T+=C}for(E=0,T=h[2];T>y[2];){R=C*++E;var I=this.getRenderTransform(p,d,g,r,l,u,R);a.execute(o,1,I,g,w,void 0,S),T-=C}}if(S){var O=t.viewHints;sf(S,o,g,1,!(O[ys]||O[ms]),t.declutterItems)}_&&o.restore(),this.postRender(o,t);var L=i.opacity,M=this.container;return L!==parseFloat(M.style.opacity)&&(M.style.opacity=1===L?"":String(L)),this.renderedRotation_!==c.rotation&&(this.renderedRotation_=c.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e,r){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var i=[this.context.canvas.width,this.context.canvas.height];St(this.pixelTransform,i);var n=this.renderedCenter_,o=this.renderedResolution_,s=this.renderedRotation_,a=this.renderedProjection_,l=this.renderedExtent_,u=this.getLayer(),h=[],c=i[0]/2,p=i[1]/2;h.push(this.getRenderTransform(n,o,s,.5,c,p,0).slice());var d=u.getSource(),f=a.getExtent();if(d.getWrapX()&&a.canWrapX()&&!Yt(f,l)){for(var g=l[0],y=fe(f),m=0,_=void 0;g<f[0];)_=y*--m,h.push(this.getRenderTransform(n,o,s,.5,c,p,_).slice()),g+=y;for(m=0,g=l[2];g>f[2];)_=y*++m,h.push(this.getRenderTransform(n,o,s,.5,c,p,_).slice()),g-=y}this.hitDetectionImageData_=lf(i,h,this.renderedFeatures_,u.getStyleFunction(),l,o,s)}e(uf(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,i,n){if(this.replayGroup_){var s=e.viewState.resolution,a=e.viewState.rotation,l=this.getLayer(),u={};return this.replayGroup_.forEachFeatureAtCoordinate(t,s,a,r,(function(t){var e=o(t);if(!(e in u))return u[e]=!0,i(t,l)}),l.getDeclutter()?n:null)}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var e=this.getLayer(),r=e.getSource();if(!r)return!1;var i=t.viewHints[ys],n=t.viewHints[ms],o=e.getUpdateWhileAnimating(),s=e.getUpdateWhileInteracting();if(!this.dirty_&&!o&&i||!s&&n)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var a=t.extent,l=t.viewState,u=l.projection,h=l.resolution,c=t.pixelRatio,p=e.getRevision(),d=e.getRenderBuffer(),f=e.getRenderOrder();void 0===f&&(f=Po);var g=l.center.slice(),y=Gt(a,d*h),m=[y.slice()],_=u.getExtent();if(r.getWrapX()&&u.canWrapX()&&!Yt(_,t.extent)){var v=fe(_),x=Math.max(fe(y)/2,v);y[0]=_[0]-x,y[2]=_[2]+x,hr(g,u);var w=ve(m[0],u);w[0]<_[0]&&w[2]<_[2]?m.push([w[0]+v,w[1],w[2]+v,w[3]]):w[0]>_[0]&&w[2]>_[2]&&m.push([w[0]-v,w[1],w[2]-v,w[3]])}if(!this.dirty_&&this.renderedResolution_==h&&this.renderedRevision_==p&&this.renderedRenderOrder_==f&&Yt(this.renderedExtent_,y))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var b,S=new Vd(Oo(h,c),y,h,c,e.getDeclutter()),T=Or();if(T){for(var C=0,E=m.length;C<E;++C)r.loadFeatures(Fr(m[C],u),h,T);b=br(T,u)}else for(C=0,E=m.length;C<E;++C)r.loadFeatures(m[C],h,u);var R=Io(h,c),P=function(t){var r,i=t.getStyleFunction()||e.getStyleFunction();if(i&&(r=i(t,h)),r){var n=this.renderFeature(t,R,r,S,b);this.dirty_=this.dirty_||n}}.bind(this),I=Fr(y,u),O=r.getFeaturesInExtent(I);f&&O.sort(f);for(C=0,E=O.length;C<E;++C)P(O[C]);this.renderedFeatures_=O;var L=S.finish(),M=new af(y,h,c,r.getOverlaps(),L,e.getRenderBuffer());return this.renderedResolution_=h,this.renderedRevision_=p,this.renderedRenderOrder_=f,this.renderedExtent_=y,this.renderedCenter_=g,this.renderedProjection_=u,this.replayGroup_=M,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,r,i,n){if(!r)return!1;var o=!1;if(Array.isArray(r))for(var s=0,a=r.length;s<a;++s)o=Lo(i,t,r[s],e,this.boundHandleStyleImageChange_,n)||o;else o=Lo(i,t,r,e,this.boundHandleStyleImageChange_,n);return o},e}(cp),pf=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),df=function(t){function e(e){var r=t.call(this,e)||this;return r.vectorRenderer_=new cf(e),r.layerImageRatio_=e.getImageRatio(),r.coordinateToVectorPixelTransform_=[1,0,0,1,0,0],r.renderedPixelToCoordinateTransform_=null,r}return pf(e,t),e.prototype.disposeInternal=function(){this.vectorRenderer_.dispose(),t.prototype.disposeInternal.call(this)},e.prototype.getFeatures=function(t){if(this.vectorRenderer_){var e=St(this.coordinateToVectorPixelTransform_,St(this.renderedPixelToCoordinateTransform_,t.slice()));return this.vectorRenderer_.getFeatures(e)}return new Promise((function(t,e){t([])}))},e.prototype.handleFontsChanged=function(){this.vectorRenderer_.handleFontsChanged()},e.prototype.prepareFrame=function(t){var e=t.pixelRatio,r=t.viewState,i=r.resolution,n=t.viewHints,o=this.vectorRenderer_,s=t.extent;1!==this.layerImageRatio_&&me(s=s.slice(0),this.layerImageRatio_);var a=fe(s)/i,l=he(s)/i;if(!n[ys]&&!n[ms]&&!ye(s)){o.useContainer(null,null,1);var u=o.context,h=T({},t,{coordinateToPixelTransform:[1,0,0,1,0,0],declutterItems:[],extent:s,size:[a,l],viewState:T({},t.viewState,{rotation:0})}),c=new Yc(s,i,e,u.canvas,(function(t){o.prepareFrame(h)&&o.replayGroupChanged&&(o.renderFrame(h,null),Fo(h,null),t())}));c.addEventListener(O,function(){if(c.getState()===To){this.image_=c;var t=c.getResolution(),i=c.getPixelRatio(),n=t*e/i;this.renderedResolution=n,this.coordinateToVectorPixelTransform_=Ct(this.coordinateToVectorPixelTransform_,a/2,l/2,1/n,-1/n,0,-r.center[0],-r.center[1])}}.bind(this)),c.load()}return this.image_&&(this.renderedPixelToCoordinateTransform_=t.pixelToCoordinateTransform.slice()),!!this.image_},e.prototype.preRender=function(){},e.prototype.postRender=function(){},e.prototype.forEachFeatureAtCoordinate=function(e,r,i,n,o){return this.vectorRenderer_?this.vectorRenderer_.forEachFeatureAtCoordinate(e,r,i,n,o):t.prototype.forEachFeatureAtCoordinate.call(this,e,r,i,n,o)},e}(dp),ff="image",gf="hybrid",yf="vector",mf=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),_f={image:[xo,yo,vo,_o,wo],hybrid:[xo,vo],vector:[]},vf={image:[mo],hybrid:[_o,wo,mo],vector:[xo,yo,vo,_o,wo,mo]},xf=function(t){function e(e){var r=t.call(this,e)||this;return r.boundHandleStyleImageChange_=r.handleStyleImageChange_.bind(r),r.dirty_=!1,r.renderedLayerRevision_,r.renderedPixelToCoordinateTransform_=null,r.renderedRotation_,r.renderTileImageQueue_={},r.tileListenerKeys_={},r.tmpTransform_=[1,0,0,1,0,0],r}return mf(e,t),e.prototype.prepareTile=function(t,e,r,i){var n,s=o(t),a=t.getState();return(a===cs&&t.hifi||a===ps)&&s in this.tileListenerKeys_&&(X(this.tileListenerKeys_[s]),delete this.tileListenerKeys_[s]),a!==cs&&a!==ps||(this.updateExecutorGroup_(t,e,r),this.tileImageNeedsRender_(t,e,r)&&(n=!0,i&&(this.renderTileImageQueue_[s]=t))),n},e.prototype.getTile=function(e,r,i,n){var s=n.pixelRatio,a=n.viewState,l=a.resolution,u=a.projection,h=this.getLayer(),c=h.getSource().getTile(e,r,i,s,u);if(c.getState()<cs){c.wantedResolution=l;var p=o(c);if(!(p in this.tileListenerKeys_)){var d=W(c,O,this.prepareTile.bind(this,c,s,u,!0));this.tileListenerKeys_[p]=d}}else{var f=n.viewHints;!!(f[ys]||f[ms])&&c.wantedResolution||(c.wantedResolution=l),this.prepareTile(c,s,u,!1)&&h.getRenderMode()!==yf&&this.renderTileImage_(c,n)}return t.prototype.getTile.call(this,e,r,i,n)},e.prototype.isDrawableTile=function(e){var r=this.getLayer();return t.prototype.isDrawableTile.call(this,e)&&(r.getRenderMode()===yf?o(r)in e.executorGroups:e.hasContext(r))},e.prototype.getTileImage=function(t){return t.getImage(this.getLayer())},e.prototype.prepareFrame=function(e){var r=this.getLayer().getRevision();return this.renderedLayerRevision_!=r&&(this.renderedTiles.length=0),this.renderedLayerRevision_=r,t.prototype.prepareFrame.call(this,e)},e.prototype.updateExecutorGroup_=function(t,e,r){var i=this.getLayer(),n=i.getRevision(),s=i.getRenderOrder()||null,a=t.wantedResolution,l=t.getReplayState(i);if(l.dirty||l.renderedResolution!==a||l.renderedRevision!=n||l.renderedRenderOrder!=s||l.renderedZ!==t.sourceZ){var u=i.getSource(),h=u.getTileGrid(),c=u.getTileGridForProjection(r).getTileCoordExtent(t.wrappedTileCoord),p=u.getSourceTiles(e,r,t),d=o(i);delete t.hitDetectionImageData[d],t.executorGroups[d]=[];for(var f=function(r,n){var o=p[r];if(o.getState()!=cs)return"continue";var f=o.tileCoord,y=h.getTileCoordExtent(f),m=ce(c,y),_=Jt(y,m)?null:Gt(m,i.getRenderBuffer()*a,g.tmpExtent);l.dirty=!1;var v=new Vd(0,m,a,e,i.getDeclutter()),x=Io(a,e),w=function(t){var e,r=t.getStyleFunction()||i.getStyleFunction();if(r&&(e=r(t,a)),e){var n=this.renderFeature(t,x,e,v);this.dirty_=this.dirty_||n,l.dirty=l.dirty||n}},b=o.getFeatures();s&&s!==l.renderedRenderOrder&&b.sort(s);for(var S=0,T=b.length;S<T;++S){var C=b[S];_&&!ge(_,C.getGeometry().getExtent())||w.call(g,C)}var E=v.finish(),R=i.getRenderMode()!==yf&&i.getDeclutter()&&1===p.length?null:m,P=new af(R,a,e,u.getOverlaps(),E,i.getRenderBuffer());t.executorGroups[d].push(P)},g=this,y=0,m=p.length;y<m;++y)f(y);l.renderedRevision=n,l.renderedZ=t.sourceZ,l.renderedRenderOrder=s,l.renderedResolution=a}},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,i,n){var s=e.viewState.resolution,a=e.viewState.rotation;r=null==r?0:r;var l,u,h,c=this.getLayer(),p=c.getDeclutter(),d=c.getSource().getTileGridForProjection(e.viewState.projection),f={},g=this.renderedTiles,y=function(){var e=g[u],h=Ut(d.getTileCoordExtent(e.wrappedTileCoord),t);if(!p&&!h)return"continue";for(var y=e.executorGroups[o(c)],m=0,_=y.length;m<_;++m){var v=y[m];l=l||v.forEachFeatureAtCoordinate(t,s,a,r,(function(t){if(h||n&&-1!==n.indexOf(t)){var e=t.getId();if(void 0===e&&(e=o(t)),!(e in f))return f[e]=!0,i(t,c)}}),c.getDeclutter()?n:null)}};for(u=0,h=g.length;u<h;++u)y();return l},e.prototype.getFeatures=function(t){return new Promise(function(e,r){for(var i,n=this.getLayer(),s=o(n),a=n.getSource(),l=this.renderedProjection,u=l.getExtent(),h=this.renderedResolution,c=a.getTileGridForProjection(l),p=St(this.renderedPixelToCoordinateTransform_,t.slice()),d=c.getTileCoordForCoordAndResolution(p,h),f=0,g=this.renderedTiles.length;f<g;++f)if(d.toString()===this.renderedTiles[f].tileCoord.toString()){if((i=this.renderedTiles[f]).getState()===cs&&i.hifi){var y=c.getTileCoordExtent(i.tileCoord);a.getWrapX()&&l.canWrapX()&&!Yt(u,y)&&hr(p,l);break}i=void 0}if(!i||i.loadingSourceTiles>0)e([]);else{var m=pe(c.getTileCoordExtent(i.wrappedTileCoord)),_=[(p[0]-m[0])/h,(m[1]-p[1])/h],v=i.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),x=i.hitDetectionImageData[s];if(!x&&!this.animatingOrInteracting_){var w=Ds(c.getTileSize(c.getZForResolution(h))),b=[w[0]/2,w[1]/2],S=this.renderedRotation_;x=lf(w,[this.getRenderTransform(c.getTileCoordCenter(i.wrappedTileCoord),h,0,.5,b[0],b[1],0)],v,n.getStyleFunction(),c.getTileCoordExtent(i.wrappedTileCoord),i.getReplayState(n).renderedResolution,S),i.hitDetectionImageData[s]=x}e(uf(_,v,x))}}.bind(this))},e.prototype.handleFontsChanged=function(){C(this.renderTileImageQueue_);var t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.renderFrame=function(e,r){var i=e.viewHints,n=!(i[ys]||i[ms]);this.renderQueuedTileImages_(n,e),t.prototype.renderFrame.call(this,e,r),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;var s=this.getLayer(),a=s.getRenderMode();if(a===ff)return this.container;var l=s.getSource(),u=e.usedTiles[o(l)];for(var h in this.renderTileImageQueue_)u&&h in u||delete this.renderTileImageQueue_[h];for(var c=this.context,p=s.getDeclutter()?{}:null,d=vf[a],f=e.pixelRatio,g=e.viewState,y=g.center,m=g.resolution,_=g.rotation,v=e.size,x=Math.round(v[0]*f),w=Math.round(v[1]*f),b=this.renderedTiles,S=l.getTileGridForProjection(e.viewState.projection),T=[],C=[],E=b.length-1;E>=0;--E)for(var R=b[E],P=R.tileCoord,I=S.getTileCoordExtent(R.wrappedTileCoord),O=S.getTileCoordExtent(P,this.tmpExtent)[0]-I[0],L=wt(Tt(this.inversePixelTransform.slice(),1/f,1/f),this.getRenderTransform(y,m,_,f,x,w,O)),M=R.executorGroups[o(s)],F=!1,A=0,k=M.length;A<k;++A){var N=M[A];if(N.hasExecutors(d)){var j=R.tileCoord[0],D=void 0;if(!p&&!F){D=N.getClipCoords(L),c.save();for(var G=0,z=T.length;G<z;++G){var B=T[G];j<C[G]&&(c.beginPath(),c.moveTo(D[0],D[1]),c.lineTo(D[2],D[3]),c.lineTo(D[4],D[5]),c.lineTo(D[6],D[7]),c.moveTo(B[6],B[7]),c.lineTo(B[4],B[5]),c.lineTo(B[2],B[3]),c.lineTo(B[0],B[1]),c.clip())}}N.execute(c,1,L,_,n,d,p),p||F||(c.restore(),T.push(D),C.push(j),F=!0)}}p&&sf(p,c,_,e.layerStatesArray[e.layerIndex].opacity,n,e.declutterItems);return this.container},e.prototype.renderQueuedTileImages_=function(t,e){for(var r in this.renderTileImageQueue_){if(!t&&Date.now()-e.time>8){e.animate=!0;break}var i=this.renderTileImageQueue_[r];delete this.renderTileImageQueue_[r],this.renderTileImage_(i,e)}},e.prototype.renderFeature=function(t,e,r,i){if(!r)return!1;var n=!1;if(Array.isArray(r))for(var o=0,s=r.length;o<s;++o)n=Lo(i,t,r[o],e,this.boundHandleStyleImageChange_)||n;else n=Lo(i,t,r,e,this.boundHandleStyleImageChange_);return n},e.prototype.tileImageNeedsRender_=function(t,e,r){var i=this.getLayer(),n=t.getReplayState(i),o=i.getRevision(),s=t.sourceZ,a=t.wantedResolution;return n.renderedTileResolution!==a||n.renderedTileRevision!==o||n.renderedTileZ!==s},e.prototype.renderTileImage_=function(t,e){var r=this.getLayer(),i=t.getReplayState(r),n=r.getRevision(),s=t.executorGroups[o(r)];i.renderedTileRevision=n,i.renderedTileZ=t.sourceZ;var a=t.wrappedTileCoord,l=a[0],u=r.getSource(),h=e.pixelRatio,c=e.viewState.projection,p=u.getTileGridForProjection(c),d=p.getResolution(t.tileCoord[0]),f=e.pixelRatio/t.wantedResolution*d,g=p.getResolution(l),y=t.getContext(r);h=Math.max(h,f/h);var m=u.getTilePixelSize(l,h,c);y.canvas.width=m[0],y.canvas.height=m[1];var _=h/f;if(1!==_){var v=xt(this.tmpTransform_);Tt(v,_,_),y.setTransform.apply(y,v)}var x=p.getTileCoordExtent(a,this.tmpExtent),w=f/g,b=xt(this.tmpTransform_);Tt(b,w,-w),function(t,e,r){wt(t,bt(vt,1,0,0,1,e,r))}(b,-x[0],-x[3]);for(var S=0,T=s.length;S<T;++S){s[S].execute(y,_,b,0,!0,_f[r.getRenderMode()])}i.renderedTileResolution=t.wantedResolution},e}(bp);function wf(t,e,r,i,n,o,s){var a,l,u=(r-e)/i;if(1===u)a=e;else if(2===u)a=e,l=n;else if(0!==u){for(var h=t[e],c=t[e+1],p=0,f=[0],g=e+i;g<r;g+=i){var y=t[g],m=t[g+1];p+=Math.sqrt((y-h)*(y-h)+(m-c)*(m-c)),f.push(p),h=y,c=m}var _=n*p,v=function(t,e,r){for(var i,n,o=r||d,s=0,a=t.length,l=!1;s<a;)(n=+o(t[i=s+(a-s>>1)],e))<0?s=i+1:(a=i,l=!n);return l?s:~s}(f,_);v<0?(l=(_-f[-v-2])/(f[-v-1]-f[-v-2]),a=e+(-v-2)*i):a=e+v*i}var x=s>1?s:2,w=o||new Array(x);for(g=0;g<x;++g)w[g]=void 0===a?NaN:void 0===l?t[a+g]:Ie(t[a+g],t[a+i+g],l);return w}function bf(t,e,r,i,n,o){if(r==e)return null;var s;if(n<t[e+i-1])return o?((s=t.slice(e,e+i))[i-1]=n,s):null;if(t[r-1]<n)return o?((s=t.slice(r-i,r))[i-1]=n,s):null;if(n==t[e+i-1])return t.slice(e,e+i);for(var a=e/i,l=r/i;a<l;){var u=a+l>>1;n<t[(u+1)*i-1]?l=u:a=u+1}var h=t[a*i-1];if(n==h)return t.slice((a-1)*i,(a-1)*i+i);var c=(n-h)/(t[(a+1)*i-1]-h);s=[];for(var p=0;p<i-1;++p)s.push(Ie(t[(a-1)*i+p],t[a*i+p],c));return s.push(n),s}var Sf=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Tf=function(t){function e(e,r){var i=t.call(this)||this;return i.flatMidpoint_=null,i.flatMidpointRevision_=-1,i.maxDelta_=-1,i.maxDeltaRevision_=-1,void 0===r||Array.isArray(e[0])?i.setCoordinates(e,r):i.setFlatCoordinates(r,e),i}return Sf(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?m(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,r,i){return i<Bt(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Xr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Zr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,r,i))},e.prototype.forEachSegment=function(t){return _i(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=dt&&this.layout!=ft)return null;var r=void 0!==e&&e;return bf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r)},e.prototype.getCoordinates=function(){return ni(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return wf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},e.prototype.getLength=function(){return qd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[];return r.length=Qr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r,0),new e(r,ct)},e.prototype.getType=function(){return gt.LINE_STRING},e.prototype.intersectsExtent=function(t){return vi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Jr(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Wr),Cf=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ef=function(t){function e(e){return t.call(this,e)||this}return Cf(e,t),e.prototype.createRenderer=function(){return new cf(this)},e}(_d);function Rf(t,e,r){for(var i,n,o,s,a,l,u=[],h=t(0),c=t(1),p=e(h),d=e(c),f=[c,h],g=[d,p],y=[1,0],m={},_=1e5;--_>0&&y.length>0;)o=y.pop(),h=f.pop(),p=g.pop(),(l=o.toString())in m||(u.push(p[0],p[1]),m[l]=!0),s=y.pop(),c=f.pop(),d=g.pop(),Te((n=e(i=t(a=(o+s)/2)))[0],n[1],p[0],p[1],d[0],d[1])<r?(u.push(d[0],d[1]),m[l=s.toString()]=!0):(y.push(s,a,a,o),g.push(d,n,n,p),f.push(c,i,i,h));return u}var Pf=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),If=new eh({color:"rgba(0,0,0,0.2)"}),Of=[90,45,30,20,10,5,2,1,.5,.2,.1,.05,.01,.005,.002,.001],Lf=function(t){function e(e){var r=this,i=e||{},n=T({updateWhileAnimating:!0,updateWhileInteracting:!0,renderBuffer:0},i);return delete n.maxLines,delete n.strokeStyle,delete n.targetSize,delete n.showLabels,delete n.lonLabelFormatter,delete n.latLabelFormatter,delete n.lonLabelPosition,delete n.latLabelPosition,delete n.lonLabelStyle,delete n.latLabelStyle,delete n.intervals,(r=t.call(this,n)||this).projection_=null,r.maxLat_=1/0,r.maxLon_=1/0,r.minLat_=-1/0,r.minLon_=-1/0,r.maxX_=1/0,r.maxY_=1/0,r.minX_=-1/0,r.minY_=-1/0,r.targetSize_=void 0!==i.targetSize?i.targetSize:100,r.maxLines_=void 0!==i.maxLines?i.maxLines:100,r.meridians_=[],r.parallels_=[],r.strokeStyle_=void 0!==i.strokeStyle?i.strokeStyle:If,r.fromLonLatTransform_=void 0,r.toLonLatTransform_=void 0,r.projectionCenterLonLat_=null,r.bottomLeft_=null,r.bottomRight_=null,r.topLeft_=null,r.topRight_=null,r.meridiansLabels_=null,r.parallelsLabels_=null,i.showLabels&&(r.lonLabelFormatter_=null==i.lonLabelFormatter?er.bind(r,"EW"):i.lonLabelFormatter,r.latLabelFormatter_=null==i.latLabelFormatter?er.bind(r,"NS"):i.latLabelFormatter,r.lonLabelPosition_=null==i.lonLabelPosition?0:i.lonLabelPosition,r.latLabelPosition_=null==i.latLabelPosition?1:i.latLabelPosition,r.lonLabelStyleBase_=new ah({text:void 0!==i.lonLabelStyle?i.lonLabelStyle.clone():new hh({font:"12px Calibri,sans-serif",textBaseline:"bottom",fill:new Du({color:"rgba(0,0,0,1)"}),stroke:new eh({color:"rgba(255,255,255,1)",width:3})})}),r.lonLabelStyle_=function(t){var e=t.get("graticule_label");return this.lonLabelStyleBase_.getText().setText(e),this.lonLabelStyleBase_}.bind(r),r.latLabelStyleBase_=new ah({text:void 0!==i.latLabelStyle?i.latLabelStyle.clone():new hh({font:"12px Calibri,sans-serif",textAlign:"right",fill:new Du({color:"rgba(0,0,0,1)"}),stroke:new eh({color:"rgba(255,255,255,1)",width:3})})}),r.latLabelStyle_=function(t){var e=t.get("graticule_label");return this.latLabelStyleBase_.getText().setText(e),this.latLabelStyleBase_}.bind(r),r.meridiansLabels_=[],r.parallelsLabels_=[],r.addEventListener(vn,r.drawLabels_.bind(r))),r.intervals_=void 0!==i.intervals?i.intervals:Of,r.setSource(new uc({loader:r.loaderFunction.bind(r),strategy:r.strategyFunction.bind(r),features:new at,overlaps:!1,useSpatialIndex:!1,wrapX:i.wrapX})),r.featurePool_=[],r.lineStyle_=new ah({stroke:r.strokeStyle_}),r.loadedExtent_=null,r.renderedExtent_=null,r.setRenderOrder(null),r}return Pf(e,t),e.prototype.strategyFunction=function(t,e){var r,i,n,o=t.slice();return this.projection_&&this.getSource().getWrapX()&&ve(o,this.projection_),this.loadedExtent_&&(r=this.loadedExtent_,i=o,n=e,Math.abs(r[0]-i[0])<n&&Math.abs(r[2]-i[2])<n&&Math.abs(r[1]-i[1])<n&&Math.abs(r[3]-i[3])<n?o=this.loadedExtent_.slice():this.getSource().removeLoadedExtent(this.loadedExtent_)),[o]},e.prototype.loaderFunction=function(t,e,r){this.loadedExtent_=t;var i=this.getSource(),n=ce(this.getExtent()||[-1/0,-1/0,1/0,1/0],t);if(!(this.renderedExtent_&&Jt(this.renderedExtent_,n)||(this.renderedExtent_=n,ye(n)))){var o=ae(n),s=e*e/4;(!this.projection_||!wr(this.projection_,r))&&this.updateProjectionInfo_(r),this.createGraticule_(n,o,e,s);var a,l=this.meridians_.length+this.parallels_.length;for(this.meridiansLabels_&&(l+=this.meridians_.length),this.parallelsLabels_&&(l+=this.parallels_.length);l>this.featurePool_.length;)a=new ht,this.featurePool_.push(a);var u=i.getFeaturesCollection();u.clear();var h,c,p=0;for(h=0,c=this.meridians_.length;h<c;++h)(a=this.featurePool_[p++]).setGeometry(this.meridians_[h]),a.setStyle(this.lineStyle_),u.push(a);for(h=0,c=this.parallels_.length;h<c;++h)(a=this.featurePool_[p++]).setGeometry(this.parallels_[h]),a.setStyle(this.lineStyle_),u.push(a)}},e.prototype.addMeridian_=function(t,e,r,i,n,o){var s=this.getMeridian_(t,e,r,i,o);if(ge(s.getExtent(),n)){if(this.meridiansLabels_){var a=this.lonLabelFormatter_(t);o in this.meridiansLabels_?this.meridiansLabels_[o].text=a:this.meridiansLabels_[o]={geom:new pi([]),text:a}}this.meridians_[o++]=s}return o},e.prototype.addParallel_=function(t,e,r,i,n,o){var s=this.getParallel_(t,e,r,i,o);if(ge(s.getExtent(),n)){if(this.parallelsLabels_){var a=this.latLabelFormatter_(t);o in this.parallelsLabels_?this.parallelsLabels_[o].text=a:this.parallelsLabels_[o]={geom:new pi([]),text:a}}this.parallels_[o++]=s}return o},e.prototype.drawLabels_=function(t){var e=t.frameState.viewState.rotation,r=t.frameState.extent,i=ae(r),n=r;if(e){var o=fe(r),s=he(r),a=Math.abs(Math.cos(e)),l=Math.abs(Math.sin(e)),u=(l*s-a*o)/(l*l-a*a),h=(l*o-a*s)/(l*l-a*a);n=[i[0]-u/2,i[1]-h/2,i[0]+u/2,i[1]+h/2]}var c=0,p=0,d=this.latLabelPosition_<.5,f=this.projection_.getExtent(),g=fe(f);this.getSource().getWrapX()&&this.projection_.canWrapX()&&!Yt(f,r)&&(c=Math.floor((r[0]-f[0])/g),p=Math.ceil((r[2]-f[2])/g),d=d!==Math.abs(e)>Math.PI/2);for(var y=Mo(t),m=c;m<=p;++m){var _=this.meridians_.length+this.parallels_.length,v=void 0,x=void 0,w=void 0,b=void 0;if(this.meridiansLabels_)for(x=0,w=this.meridiansLabels_.length;x<w;++x){var S=this.meridians_[x];if(e||0!==m)(T=S.clone()).translate(m*g,0),T.rotate(-e,i),(b=this.getMeridianPoint_(T,n,x)).rotate(e,i);else b=this.getMeridianPoint_(S,r,x);(v=this.featurePool_[_++]).setGeometry(b),v.set("graticule_label",this.meridiansLabels_[x].text),y.drawFeature(v,this.lonLabelStyle_(v))}if(this.parallelsLabels_&&(m===c&&d||m===p&&!d))for(x=0,w=this.parallels_.length;x<w;++x){var T;S=this.parallels_[x];if(e||0!==m)(T=S.clone()).translate(m*g,0),T.rotate(-e,i),(b=this.getParallelPoint_(T,n,x)).rotate(e,i);else b=this.getParallelPoint_(S,r,x);(v=this.featurePool_[_++]).setGeometry(b),v.set("graticule_label",this.parallelsLabels_[x].text),y.drawFeature(v,this.latLabelStyle_(v))}}},e.prototype.createGraticule_=function(t,e,r,i){var n=this.getInterval_(r);if(-1==n)return this.meridians_.length=0,this.parallels_.length=0,this.meridiansLabels_&&(this.meridiansLabels_.length=0),void(this.parallelsLabels_&&(this.parallelsLabels_.length=0));var o=!1,s=this.projection_.getExtent(),a=fe(s);this.getSource().getWrapX()&&this.projection_.canWrapX()&&!Yt(s,t)&&(fe(t)>=a?(t[0]=s[0],t[2]=s[2]):o=!0);var l=[we(e[0],this.minX_,this.maxX_),we(e[1],this.minY_,this.maxY_)],u=this.toLonLatTransform_(l);isNaN(u[1])&&(u[1]=Math.abs(this.maxLat_)>=Math.abs(this.minLat_)?this.maxLat_:this.minLat_);var h,c,p,d,f=we(u[0],this.minLon_,this.maxLon_),g=we(u[1],this.minLat_,this.maxLat_),y=this.maxLines_,m=t;o||(m=[we(t[0],this.minX_,this.maxX_),we(t[1],this.minY_,this.maxY_),we(t[2],this.minX_,this.maxX_),we(t[3],this.minY_,this.maxY_)]);var _=_e(m,this.toLonLatTransform_,void 0,8),v=_[3],x=_[2],w=_[1],b=_[0];if(o||(Ut(m,this.bottomLeft_)&&(b=this.minLon_,w=this.minLat_),Ut(m,this.bottomRight_)&&(x=this.maxLon_,w=this.minLat_),Ut(m,this.topLeft_)&&(b=this.minLon_,v=this.maxLat_),Ut(m,this.topRight_)&&(x=this.maxLon_,v=this.maxLat_),v=we(v,g,this.maxLat_),x=we(x,f,this.maxLon_),w=we(w,this.minLat_,g),b=we(b,this.minLon_,f)),d=we(f=Math.floor(f/n)*n,this.minLon_,this.maxLon_),c=this.addMeridian_(d,w,v,i,t,0),h=0,o)for(;(d-=n)>=b&&h++<y;)c=this.addMeridian_(d,w,v,i,t,c);else for(;d!=this.minLon_&&h++<y;)d=Math.max(d-n,this.minLon_),c=this.addMeridian_(d,w,v,i,t,c);if(d=we(f,this.minLon_,this.maxLon_),h=0,o)for(;(d+=n)<=x&&h++<y;)c=this.addMeridian_(d,w,v,i,t,c);else for(;d!=this.maxLon_&&h++<y;)d=Math.min(d+n,this.maxLon_),c=this.addMeridian_(d,w,v,i,t,c);for(this.meridians_.length=c,this.meridiansLabels_&&(this.meridiansLabels_.length=c),p=we(g=Math.floor(g/n)*n,this.minLat_,this.maxLat_),c=this.addParallel_(p,b,x,i,t,0),h=0;p!=this.minLat_&&h++<y;)p=Math.max(p-n,this.minLat_),c=this.addParallel_(p,b,x,i,t,c);for(p=we(g,this.minLat_,this.maxLat_),h=0;p!=this.maxLat_&&h++<y;)p=Math.min(p+n,this.maxLat_),c=this.addParallel_(p,b,x,i,t,c);this.parallels_.length=c,this.parallelsLabels_&&(this.parallelsLabels_.length=c)},e.prototype.getInterval_=function(t){for(var e=this.projectionCenterLonLat_[0],r=this.projectionCenterLonLat_[1],i=-1,n=Math.pow(this.targetSize_*t,2),o=[],s=[],a=0,l=this.intervals_.length;a<l;++a){var u=we(this.intervals_[a]/2,0,90),h=we(r,-90+u,90-u);if(o[0]=e-u,o[1]=h-u,s[0]=e+u,s[1]=h+u,this.fromLonLatTransform_(o,o),this.fromLonLatTransform_(s,s),Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)<=n)break;i=this.intervals_[a]}return i},e.prototype.getMeridian_=function(t,e,r,i,n){var o=function(t,e,r,i,n){return Rf((function(i){return[t,e+(r-e)*i]}),Sr(gr("EPSG:4326"),i),n)}(t,e,r,this.projection_,i),s=this.meridians_[n];return s?(s.setFlatCoordinates(ct,o),s.changed()):(s=new Tf(o,ct),this.meridians_[n]=s),s},e.prototype.getMeridianPoint_=function(t,e,r){var i=t.getFlatCoordinates(),n=1,o=i.length-1;i[n]>i[o]&&(n=o,o=1);var s=Math.max(e[1],i[n]),a=Math.min(e[3],i[o]),l=we(e[1]+Math.abs(e[1]-e[3])*this.lonLabelPosition_,s,a),u=[i[n-1]+(i[o-1]-i[n-1])*(l-i[n])/(i[o]-i[n]),l],h=this.meridiansLabels_[r].geom;return h.setCoordinates(u),h},e.prototype.getMeridians=function(){return this.meridians_},e.prototype.getParallel_=function(t,e,r,i,n){var o=function(t,e,r,i,n){return Rf((function(i){return[e+(r-e)*i,t]}),Sr(gr("EPSG:4326"),i),n)}(t,e,r,this.projection_,i),s=this.parallels_[n];return s?(s.setFlatCoordinates(ct,o),s.changed()):s=new Tf(o,ct),s},e.prototype.getParallelPoint_=function(t,e,r){var i=t.getFlatCoordinates(),n=0,o=i.length-2;i[n]>i[o]&&(n=o,o=0);var s=Math.max(e[0],i[n]),a=Math.min(e[2],i[o]),l=we(e[0]+Math.abs(e[0]-e[2])*this.latLabelPosition_,s,a),u=[l,i[n+1]+(i[o+1]-i[n+1])*(l-i[n])/(i[o]-i[n])],h=this.parallelsLabels_[r].geom;return h.setCoordinates(u),h},e.prototype.getParallels=function(){return this.parallels_},e.prototype.updateProjectionInfo_=function(t){var e=gr("EPSG:4326"),r=t.getWorldExtent();this.maxLat_=r[3],this.maxLon_=r[2],this.minLat_=r[1],this.minLon_=r[0];var i=Sr(t,e);if(this.minLon_<this.maxLon_)this.toLonLatTransform_=i;else{var n=this.minLon_+this.maxLon_/2;this.maxLon_+=360,this.toLonLatTransform_=function(t,e,r){for(var o=r||2,s=i(t,e,o),a=0,l=s.length;a<l;a+=o)s[a]<n&&(s[a]+=360);return s}}this.fromLonLatTransform_=Sr(e,t);var o=_e([this.minLon_,this.minLat_,this.maxLon_,this.maxLat_],this.fromLonLatTransform_,void 0,8);this.minX_=o[0],this.maxX_=o[2],this.minY_=o[1],this.maxY_=o[3],this.bottomLeft_=this.fromLonLatTransform_([this.minLon_,this.minLat_]),this.bottomRight_=this.fromLonLatTransform_([this.maxLon_,this.minLat_]),this.topLeft_=this.fromLonLatTransform_([this.minLon_,this.maxLat_]),this.topRight_=this.fromLonLatTransform_([this.maxLon_,this.maxLat_]),this.projectionCenterLonLat_=this.toLonLatTransform_(ae(t.getExtent())),isNaN(this.projectionCenterLonLat_[1])&&(this.projectionCenterLonLat_[1]=Math.abs(this.maxLat_)>=Math.abs(this.minLat_)?this.maxLat_:this.minLat_),this.projection_=t},e}(Ef),Mf=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ff="blur",Af="gradient",kf="radius",Nf=["#00f","#0ff","#0f0","#ff0","#f00"];var jf=function(t){function e(e){var r=this,i=e||{},n=T({},i);delete n.gradient,delete n.radius,delete n.blur,delete n.weight,(r=t.call(this,n)||this).gradient_=null,r.addEventListener(tt(Af),r.handleGradientChanged_),r.setGradient(i.gradient?i.gradient:Nf),r.setBlur(void 0!==i.blur?i.blur:15),r.setRadius(void 0!==i.radius?i.radius:8);var o=i.weight?i.weight:"weight";return r.weightFunction_="string"==typeof o?function(t){return t.get(o)}:o,r.setRenderOrder(null),r}return Mf(e,t),e.prototype.getBlur=function(){return this.get(Ff)},e.prototype.getGradient=function(){return this.get(Af)},e.prototype.getRadius=function(){return this.get(kf)},e.prototype.handleGradientChanged_=function(){this.gradient_=function(t){for(var e=zn(1,256),r=e.createLinearGradient(0,0,1,256),i=1/(t.length-1),n=0,o=t.length;n<o;++n)r.addColorStop(n*i,t[n]);return e.fillStyle=r,e.fillRect(0,0,1,256),e.canvas}(this.getGradient())},e.prototype.setBlur=function(t){this.set(Ff,t)},e.prototype.setGradient=function(t){this.set(Af,t)},e.prototype.setRadius=function(t){this.set(kf,t)},e.prototype.createRenderer=function(){return new Ed(this,{attributes:[{name:"weight",callback:function(t){var e=this.weightFunction_(t);return void 0!==e?we(e,0,1):1}.bind(this)}],vertexShader:"\n        precision mediump float;\n        uniform mat4 u_projectionMatrix;\n        uniform mat4 u_offsetScaleMatrix;\n        uniform float u_size;\n        attribute vec2 a_position;\n        attribute float a_index;\n        attribute float a_weight;\n\n        varying vec2 v_texCoord;\n        varying float v_weight;\n\n        void main(void) {\n          mat4 offsetMatrix = u_offsetScaleMatrix;\n          float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n          float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n          vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n          gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n          float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n          float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n          v_texCoord = vec2(u, v);\n          v_weight = a_weight;\n        }",fragmentShader:"\n        precision mediump float;\n        uniform float u_blurSlope;\n\n        varying vec2 v_texCoord;\n        varying float v_weight;\n\n        void main(void) {\n          vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n          float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n          float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n          float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n          gl_FragColor = vec4(alpha, alpha, alpha, alpha);\n        }",hitVertexShader:"\n        precision mediump float;\n        uniform mat4 u_projectionMatrix;\n        uniform mat4 u_offsetScaleMatrix;\n        uniform float u_size;\n        attribute vec2 a_position;\n        attribute float a_index;\n        attribute float a_weight;\n        attribute vec4 a_hitColor;\n\n        varying vec2 v_texCoord;\n        varying float v_weight;\n        varying vec4 v_hitColor;\n\n        void main(void) {\n          mat4 offsetMatrix = u_offsetScaleMatrix;\n          float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n          float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n          vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n          gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n          float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n          float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n          v_texCoord = vec2(u, v);\n          v_hitColor = a_hitColor;\n          v_weight = a_weight;\n        }",hitFragmentShader:"\n        precision mediump float;\n        uniform float u_blurSlope;\n\n        varying vec2 v_texCoord;\n        varying float v_weight;\n        varying vec4 v_hitColor;\n\n        void main(void) {\n          vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n          float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n          float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n          float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n          if (alpha < 0.05) {\n            discard;\n          }\n\n          gl_FragColor = v_hitColor;\n        }",uniforms:{u_size:function(){return 2*(this.get(kf)+this.get(Ff))}.bind(this),u_blurSlope:function(){return this.get(kf)/Math.max(1,this.get(Ff))}.bind(this)},postProcesses:[{fragmentShader:"\n            precision mediump float;\n\n            uniform sampler2D u_image;\n            uniform sampler2D u_gradientTexture;\n\n            varying vec2 v_texCoord;\n\n            void main() {\n              vec4 color = texture2D(u_image, v_texCoord);\n              gl_FragColor.a = color.a;\n              gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb;\n              gl_FragColor.rgb *= gl_FragColor.a;\n            }",uniforms:{u_gradientTexture:function(){return this.gradient_}.bind(this)}}]})},e}(Ef),Df=function(){function t(){this.dataProjection=null,this.defaultFeatureProjection=null}return t.prototype.getReadOptions=function(t,e){var r;if(e){var i=e.dataProjection?gr(e.dataProjection):this.readProjection(t);e.extent&&i&&i.getUnits()===_t.TILE_PIXELS&&(i=gr(i)).setWorldExtent(e.extent),r={dataProjection:i,featureProjection:e.featureProjection}}return this.adaptOptions(r)},t.prototype.adaptOptions=function(t){return T({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},t.prototype.getType=function(){return i()},t.prototype.readFeature=function(t,e){return i()},t.prototype.readFeatures=function(t,e){return i()},t.prototype.readGeometry=function(t,e){return i()},t.prototype.readProjection=function(t){return i()},t.prototype.writeFeature=function(t,e){return i()},t.prototype.writeFeatures=function(t,e){return i()},t.prototype.writeGeometry=function(t,e){return i()},t}();function Gf(t,e,r){var i,n=r?gr(r.featureProjection):null,o=r?gr(r.dataProjection):null;if(i=n&&o&&!wr(n,o)?(e?t.clone():t).transform(e?n:o,e?o:n):t,e&&r&&void 0!==r.decimals){var s=Math.pow(10,r.decimals);i===t&&(i=t.clone()),i.applyTransform((function(t){for(var e=0,r=t.length;e<r;++e)t[e]=Math.round(t[e]*s)/s;return t}))}return i}function zf(t,e){var r=e?gr(e.featureProjection):null,i=e?gr(e.dataProjection):null;return r&&i&&!wr(r,i)?Cr(t,i,r):t}var Bf=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Uf=function(t){function e(e,r,i){var n=t.call(this)||this;if(n.ends_=[],n.maxDelta_=-1,n.maxDeltaRevision_=-1,Array.isArray(e[0]))n.setCoordinates(e,r);else if(void 0!==r&&i)n.setFlatCoordinates(r,e),n.ends_=i;else{for(var o=n.getLayout(),s=e,a=[],l=[],u=0,h=s.length;u<h;++u){var c=s[u];0===u&&(o=c.getLayout()),m(a,c.getFlatCoordinates()),l.push(a.length)}n.setFlatCoordinates(o,a),n.ends_=l}return n}return Bf(e,t),e.prototype.appendLineString=function(t){this.flatCoordinates?m(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},e.prototype.closestPointXY=function(t,e,r,i){return i<Bt(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(qr(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Kr(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,r,i))},e.prototype.getCoordinateAtM=function(t,e,r){if(this.layout!=dt&&this.layout!=ft||0===this.flatCoordinates.length)return null;var i=void 0!==e&&e,n=void 0!==r&&r;return function(t,e,r,i,n,o,s){if(s)return bf(t,e,r[r.length-1],i,n,o);var a;if(n<t[i-1])return o?((a=t.slice(0,i))[i-1]=n,a):null;if(t[t.length-1]<n)return o?((a=t.slice(t.length-i))[i-1]=n,a):null;for(var l=0,u=r.length;l<u;++l){var h=r[l];if(e!=h){if(n<t[e+i-1])return null;if(n<=t[h-1])return bf(t,e,h,i,n,!1);e=h}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,i,n)},e.prototype.getCoordinates=function(){return oi(this.flatCoordinates,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getLineString=function(t){return t<0||this.ends_.length<=t?null:new Tf(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,r=this.layout,i=[],n=0,o=0,s=e.length;o<s;++o){var a=e[o],l=new Tf(t.slice(n,a),r);i.push(l),n=a}return i},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,r=0,i=this.ends_,n=this.stride,o=0,s=i.length;o<s;++o){var a=i[o];m(t,wf(e,r,a,n,.5)),r=a}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],i=[];return r.length=ti(this.flatCoordinates,0,this.ends_,this.stride,t,r,0,i),new e(r,ct,i)},e.prototype.getType=function(){return gt.MULTI_LINE_STRING},e.prototype.intersectsExtent=function(t){return function(t,e,r,i,n){for(var o=0,s=r.length;o<s;++o){if(vi(t,e,r[o],i,n))return!0;e=r[o]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var r=$r(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===r.length?0:r[r.length-1],this.changed()},e}(Wr),Yf=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Wf=function(t){function e(e,r){var i=t.call(this)||this;return r&&!Array.isArray(e[0])?i.setFlatCoordinates(r,e):i.setCoordinates(e,r),i}return Yf(e,t),e.prototype.appendPoint=function(t){this.flatCoordinates?m(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,r,i){if(i<Bt(this.getExtent(),t,e))return i;for(var n=this.flatCoordinates,o=this.stride,s=0,a=n.length;s<a;s+=o){var l=Ce(t,e,n[s],n[s+1]);if(l<i){i=l;for(var u=0;u<o;++u)r[u]=n[s+u];r.length=o}}return i},e.prototype.getCoordinates=function(){return ni(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getPoint=function(t){var e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new pi(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,r=this.stride,i=[],n=0,o=t.length;n<o;n+=r){var s=new pi(t.slice(n,n+r),e);i.push(s)}return i},e.prototype.getType=function(){return gt.MULTI_POINT},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,r=this.stride,i=0,n=e.length;i<n;i+=r){if(Wt(t,e[i],e[i+1]))return!0}return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Jr(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Wr);function Vf(t,e,r,i){for(var n=[],o=[1/0,1/0,-1/0,-1/0],s=0,a=r.length;s<a;++s){var l=r[s];o=Ht(t,e,l[0],i),n.push((o[0]+o[2])/2,(o[1]+o[3])/2),e=l[l.length-1]}return n}var Xf=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),qf=function(t){function e(e,r,i){var n=t.call(this)||this;if(n.endss_=[],n.flatInteriorPointsRevision_=-1,n.flatInteriorPoints_=null,n.maxDelta_=-1,n.maxDeltaRevision_=-1,n.orientedRevision_=-1,n.orientedFlatCoordinates_=null,!i&&!Array.isArray(e[0])){for(var o=n.getLayout(),s=e,a=[],l=[],u=0,h=s.length;u<h;++u){var c=s[u];0===u&&(o=c.getLayout());for(var p=a.length,d=c.getEnds(),f=0,g=d.length;f<g;++f)d[f]+=p;m(a,c.getFlatCoordinates()),l.push(d)}r=o,e=a,i=l}return void 0!==r&&i?(n.setFlatCoordinates(r,e),n.endss_=i):n.setCoordinates(e,r),n}return Xf(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var r=this.flatCoordinates.length;m(this.flatCoordinates,t.getFlatCoordinates());for(var i=0,n=(e=t.getEnds().slice()).length;i<n;++i)e[i]+=r}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()},e.prototype.clone=function(){for(var t=this.endss_.length,r=new Array(t),i=0;i<t;++i)r[i]=this.endss_[i].slice();return new e(this.flatCoordinates.slice(),this.layout,r)},e.prototype.closestPointXY=function(t,e,r,i){return i<Bt(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,r,i,n){for(var o=0,s=r.length;o<s;++o){var a=r[o];n=qr(t,e,a,i,n),e=a[a.length-1]}return n}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,r,i,n,o,s,a,l,u,h){for(var c=h||[NaN,NaN],p=0,d=r.length;p<d;++p){var f=r[p];u=Kr(t,e,f,i,n,o,s,a,l,u,c),e=f[f.length-1]}return u}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,r,i))},e.prototype.containsXY=function(t,e){return function(t,e,r,i,n,o){if(0===r.length)return!1;for(var s=0,a=r.length;s<a;++s){var l=r[s];if(gi(t,e,l,i,n,o))return!0;e=l[l.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},e.prototype.getArea=function(){return function(t,e,r,i){for(var n=0,o=0,s=r.length;o<s;++o){var a=r[o];n+=li(t,e,a,i),e=a[a.length-1]}return n}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Ci(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,si(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=Vf(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=mi(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new Wf(this.getFlatInteriorPoints().slice(),dt)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,r,i,n){for(var o=0,s=r.length;o<s;++o){var a=r[o];if(!Si(t,e,a,i,n))return!1;a.length&&(e=a[a.length-1])}return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Ci(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],i=[];return r.length=function(t,e,r,i,n,o,s,a){for(var l=0,u=r.length;l<u;++l){var h=r[l],c=[];s=ii(t,e,h,i,n,o,s,c),a.push(c),e=h[h.length-1]}return s}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),r,0,i),new e(r,ct,i)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var r=this.endss_[t-1];e=r[r.length-1]}var i=this.endss_[t].slice(),n=i[i.length-1];if(0!==e)for(var o=0,s=i.length;o<s;++o)i[o]-=e;return new Pi(this.flatCoordinates.slice(e,n),this.layout,i)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,r=this.endss_,i=[],n=0,o=0,s=r.length;o<s;++o){var a=r[o].slice(),l=a[a.length-1];if(0!==n)for(var u=0,h=a.length;u<h;++u)a[u]-=n;var c=new Pi(e.slice(n,l),t,a);i.push(c),n=l}return i},e.prototype.getType=function(){return gt.MULTI_POLYGON},e.prototype.intersectsExtent=function(t){return function(t,e,r,i,n){for(var o=0,s=r.length;o<s;++o){var a=r[o];if(xi(t,e,a,i,n))return!0;e=a[a.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var r=function(t,e,r,i,n){for(var o=n||[],s=0,a=0,l=r.length;a<l;++a){var u=$r(t,e,r[a],i,o[s]);o[s++]=u,e=u[u.length-1]}return o.length=s,o}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===r.length)this.flatCoordinates.length=0;else{var i=r[r.length-1];this.flatCoordinates.length=0===i.length?0:i[i.length-1]}this.changed()},e}(Wr),Zf=r(2),Kf=r.n(Zf),Hf=[1,0,0,1,0,0],Jf=function(){function t(t,e,r,i,n){this.extent_,this.id_=n,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=r,this.properties_=i}return t.prototype.get=function(t){return this.properties_[t]},t.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===gt.POINT?Kt(this.flatCoordinates_):Ht(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},t.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=ae(this.getExtent());this.flatInteriorPoints_=yi(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},t.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=Vf(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=mi(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},t.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=wf(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},t.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var t=this.flatCoordinates_,e=0,r=this.ends_,i=0,n=r.length;i<n;++i){var o=r[i],s=wf(t,e,o,2,.5);m(this.flatMidpoints_,s),e=o}}return this.flatMidpoints_},t.prototype.getId=function(){return this.id_},t.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},t.prototype.getGeometry=function(){return this},t.prototype.getSimplifiedGeometry=function(t){return this},t.prototype.simplifyTransformed=function(t,e){return this},t.prototype.getProperties=function(){return this.properties_},t.prototype.getStride=function(){return 2},t.prototype.getStyleFunction=function(){},t.prototype.getType=function(){return this.type_},t.prototype.transform=function(t,e){var r=(t=gr(t)).getExtent(),i=t.getWorldExtent(),n=he(i)/he(r);Ct(Hf,i[0],i[3],n,-n,0,0,0),Nr(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Hf,this.flatCoordinates_)},t.prototype.getEnds=function(){return this.ends_},t}();Jf.prototype.getEndss=Jf.prototype.getEnds,Jf.prototype.getFlatCoordinates=Jf.prototype.getOrientedFlatCoordinates;var $f=Jf,Qf=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function tg(t,e,r){if(3===t){var i={keys:[],values:[],features:[]},n=r.readVarint()+r.pos;r.readFields(eg,i,n),i.length=i.features.length,i.length&&(e[i.name]=i)}}function eg(t,e,r){if(15===t)e.version=r.readVarint();else if(1===t)e.name=r.readString();else if(5===t)e.extent=r.readVarint();else if(2===t)e.features.push(r.pos);else if(3===t)e.keys.push(r.readString());else if(4===t){for(var i=null,n=r.readVarint()+r.pos;r.pos<n;)i=1===(t=r.readVarint()>>3)?r.readString():2===t?r.readFloat():3===t?r.readDouble():4===t?r.readVarint64():5===t?r.readVarint():6===t?r.readSVarint():7===t?r.readBoolean():null;e.values.push(i)}}function rg(t,e,r){if(1==t)e.id=r.readVarint();else if(2==t)for(var i=r.readVarint()+r.pos;r.pos<i;){var n=e.layer.keys[r.readVarint()],o=e.layer.values[r.readVarint()];e.properties[n]=o}else 3==t?e.type=r.readVarint():4==t&&(e.geometry=r.pos)}function ig(t,e,r){t.pos=e.features[r];var i=t.readVarint()+t.pos,n={layer:e,type:0,properties:{}};return t.readFields(rg,n,i),n}var ng=function(t){function e(e){var r=t.call(this)||this,i=e||{};return r.dataProjection=new xe({code:"",units:_t.TILE_PIXELS}),r.featureClass_=i.featureClass?i.featureClass:$f,r.geometryName_=i.geometryName,r.layerName_=i.layerName?i.layerName:"layer",r.layers_=i.layers?i.layers:null,r.idProperty_=i.idProperty,r}return Qf(e,t),e.prototype.readRawGeometry_=function(t,e,r,i){t.pos=e.geometry;for(var n=t.readVarint()+t.pos,o=1,s=0,a=0,l=0,u=0,h=0;t.pos<n;){if(!s){var c=t.readVarint();o=7&c,s=c>>3}s--,1===o||2===o?(a+=t.readSVarint(),l+=t.readSVarint(),1===o&&u>h&&(i.push(u),h=u),r.push(a,l),u+=2):7===o?u>h&&(r.push(r[h],r[h+1]),u+=2):lt(!1,59)}u>h&&(i.push(u),h=u)},e.prototype.createFeature_=function(t,e,r){var i,n=e.type;if(0===n)return null;var o,s=e.properties;this.idProperty_?(o=s[this.idProperty_],delete s[this.idProperty_]):o=e.id,s[this.layerName_]=e.layer.name;var a=[],l=[];this.readRawGeometry_(t,e,a,l);var u=function(t,e){var r;1===t?r=1===e?gt.POINT:gt.MULTI_POINT:2===t?r=1===e?gt.LINE_STRING:gt.MULTI_LINE_STRING:3===t&&(r=gt.POLYGON);return r}(n,l.length);if(this.featureClass_===$f)(i=new this.featureClass_(u,a,l,s,o)).transform(r.dataProjection,r.featureProjection);else{var h=void 0;if(u==gt.POLYGON){for(var c=[],p=0,d=0,f=0,g=l.length;f<g;++f){var y=l[f];if(bi(a,p,y,2)){if(0===c.length)continue;c[c.length-1].push(l[d])}else c.push(l.slice(d,f+1));d=f+1,p=y}h=c.length>1?new qf(a,ct,c):new Pi(a,ct,l)}else h=u===gt.POINT?new pi(a,ct):u===gt.LINE_STRING?new Tf(a,ct):u===gt.POLYGON?new Pi(a,ct,l):u===gt.MULTI_POINT?new Wf(a,ct):u===gt.MULTI_LINE_STRING?new Uf(a,ct,l):null;i=new(0,this.featureClass_),this.geometryName_&&i.setGeometryName(this.geometryName_);var m=Gf(h,!1,r);i.setGeometry(m),i.setId(o),i.setProperties(s,!0)}return i},e.prototype.getType=function(){return fl},e.prototype.readFeatures=function(t,e){var r=this.layers_,i=this.adaptOptions(e),n=gr(i.dataProjection);n.setWorldExtent(i.extent),i.dataProjection=n;var o=new Kf.a(t),s=o.readFields(tg,{}),a=[];for(var l in s)if(!r||-1!=r.indexOf(l)){var u=s[l],h=u?[0,0,u.extent,u.extent]:null;n.setExtent(h);for(var c=0,p=u.length;c<p;++c){var d=ig(o,u,c);a.push(this.createFeature_(o,d,i))}}return a},e.prototype.readProjection=function(t){return this.dataProjection},e.prototype.setLayers=function(t){this.layers_=t},e}(Df),og=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),sg=function(t){function e(e){var r=this,i=e||{},n=T({},i);delete n.preload,delete n.useInterimTilesOnError,r=t.call(this,n)||this;var o=i.renderMode||gf;return lt(null==o||o==ff||o==gf||o==yf,28),r.renderMode_=o,r.setPreload(i.preload?i.preload:0),r.setUseInterimTilesOnError(void 0===i.useInterimTilesOnError||i.useInterimTilesOnError),r}return og(e,t),e.prototype.createRenderer=function(){return new xf(this)},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderMode=function(){return this.renderMode_},e.prototype.getPreload=function(){return this.get(yp)},e.prototype.getUseInterimTilesOnError=function(){return this.get(mp)},e.prototype.setPreload=function(t){this.set(yp,t)},e.prototype.setUseInterimTilesOnError=function(t){this.set(mp,t)},e}(_d),ag=r(3),lg=r.n(ag),ug=0,hg=1,cg=2,pg=3;function dg(){return function(){throw new Error("Unimplemented abstract method.")}()}let fg=0;function gg(t){return t.ol_uid||(t.ol_uid=String(++fg))}function yg(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}class mg{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=yg(t.scale),this.displacement_=t.displacement}clone(){const t=this.getScale();return new mg({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getAnchor(){return dg()}getImage(t){return dg()}getHitDetectionImage(t){return dg()}getPixelRatio(t){return 1}getImageState(){return dg()}getImageSize(){return dg()}getHitDetectionImageSize(){return dg()}getOrigin(){return dg()}getSize(){return dg()}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=yg(t)}listenImageChange(t){dg()}load(){dg()}unlistenImageChange(t){dg()}}var _g=mg;class vg extends Error{constructor(t){const e="Assertion failed. See https://openlayers.org/en/latest/doc/errors/#"+t+" for details.";super(e),this.code=t,this.name="AssertionError",this.message=e}}var xg=vg;function wg(t,e){if(!t)throw new xg(e)}function bg(t,e,r){return Math.min(Math.max(t,e),r)}const Sg=function(){let t;return t="cosh"in Math?Math.cosh:function(t){const e=Math.exp(t);return(e+1/e)/2},t}();!function(){let t;t="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E}}();function Tg(t,e,r,i,n,o){const s=n-r,a=o-i;if(0!==s||0!==a){const l=((t-r)*s+(e-i)*a)/(s*s+a*a);l>1?(r=n,i=o):l>0&&(r+=s*l,i+=a*l)}return Cg(t,e,r,i)}function Cg(t,e,r,i){const n=r-t,o=i-e;return n*n+o*o}function Eg(t,e,r){return t+r*(e-t)}const Rg=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Pg=/^([a-z]*)$|^hsla?\(.*\)$/i;function Ig(t){const e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);const t=getComputedStyle(e).color;return document.body.removeChild(e),t}return""}const Og=function(){const t={};let e=0;return(function(r){let i;if(t.hasOwnProperty(r))i=t[r];else{if(e>=1024){let r=0;for(const i in t)0==(3&r++)&&(delete t[i],--e)}i=function(t){let e,r,i,n,o;Pg.exec(t)&&(t=Ig(t));if(Rg.exec(t)){const s=t.length-1;let a;a=s<=4?1:2;const l=4===s||8===s;e=parseInt(t.substr(1+0*a,a),16),r=parseInt(t.substr(1+1*a,a),16),i=parseInt(t.substr(1+2*a,a),16),n=l?parseInt(t.substr(1+3*a,a),16):255,1==a&&(e=(e<<4)+e,r=(r<<4)+r,i=(i<<4)+i,l&&(n=(n<<4)+n)),o=[e,r,i,n/255]}else 0==t.indexOf("rgba(")?(o=t.slice(5,-1).split(",").map(Number),Mg(o)):0==t.indexOf("rgb(")?(o=t.slice(4,-1).split(",").map(Number),o.push(1),Mg(o)):wg(!1,14);return o}(r),t[r]=i,++e}return i})}();function Lg(t){return Array.isArray(t)?t:Og(t)}function Mg(t){return t[0]=bg(t[0]+.5|0,0,255),t[1]=bg(t[1]+.5|0,0,255),t[2]=bg(t[2]+.5|0,0,255),t[3]=bg(t[3],0,1),t}function Fg(t){let e=t[0];e!=(0|e)&&(e=e+.5|0);let r=t[1];r!=(0|r)&&(r=r+.5|0);let i=t[2];return i!=(0|i)&&(i=i+.5|0),"rgba("+e+","+r+","+i+","+(void 0===t[3]?1:t[3])+")"}function Ag(t){return Array.isArray(t)?Fg(t):t}const kg="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",Ng=(kg.indexOf("firefox"),-1!==kg.indexOf("safari")&&kg.indexOf("chrom"),-1!==kg.indexOf("webkit")&&kg.indexOf("edge"),kg.indexOf("macintosh"),"undefined"!=typeof devicePixelRatio&&devicePixelRatio,"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope),jg="undefined"!=typeof Image&&Image.prototype.decode;!function(){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(t){}}();function Dg(t,e,r){const i=r&&r.length?r.shift():Ng?new OffscreenCanvas(t||300,e||300):document.createElement("canvas");return t&&(i.width=t),e&&(i.height=e),i.getContext("2d")}var Gg=class{constructor(t){this.propagationStopped,this.type=t,this.target=null}preventDefault(){this.propagationStopped=!0}stopPropagation(){this.propagationStopped=!0}},zg="propertychange";var Bg=class{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}};function Ug(t,e){return t>e?1:t<e?-1:0}function Yg(t,e,r){for(;e<r;){const i=t[e];t[e]=t[r],t[r]=i,++e,--r}}function Wg(t,e){const r=Array.isArray(e)?e:[e],i=r.length;for(let e=0;e<i;e++)t[t.length]=r[e]}function Vg(t,e){const r=t.length;if(r!==e.length)return!1;for(let i=0;i<r;i++)if(t[i]!==e[i])return!1;return!0}function Xg(){}const qg="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");const r=Object(t);for(let t=1,e=arguments.length;t<e;++t){const e=arguments[t];if(null!=e)for(const t in e)e.hasOwnProperty(t)&&(r[t]=e[t])}return r};function Zg(t){for(const e in t)delete t[e]}"function"==typeof Object.values&&Object.values;function Kg(t){let e;for(e in t)return!1;return!e}var Hg=class extends Bg{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const r=this.listeners_||(this.listeners_={}),i=r[t]||(r[t]=[]);-1===i.indexOf(e)&&i.push(e)}dispatchEvent(t){const e="string"==typeof t?new Gg(t):t,r=e.type;e.target||(e.target=this.eventTarget_||this);const i=this.listeners_&&this.listeners_[r];let n;if(i){const t=this.dispatching_||(this.dispatching_={}),o=this.pendingRemovals_||(this.pendingRemovals_={});r in t||(t[r]=0,o[r]=0),++t[r];for(let t=0,r=i.length;t<r;++t)if(n="handleEvent"in i[t]?i[t].handleEvent(e):i[t].call(this,e),!1===n||e.propagationStopped){n=!1;break}if(--t[r],0===t[r]){let e=o[r];for(delete o[r];e--;)this.removeEventListener(r,Xg);delete t[r]}return n}}disposeInternal(){this.listeners_&&Zg(this.listeners_)}getListeners(t){return this.listeners_&&this.listeners_[t]||void 0}hasListener(t){return!!this.listeners_&&(t?t in this.listeners_:Object.keys(this.listeners_).length>0)}removeEventListener(t,e){const r=this.listeners_&&this.listeners_[t];if(r){const i=r.indexOf(e);-1!==i&&(this.pendingRemovals_&&t in this.pendingRemovals_?(r[i]=Xg,++this.pendingRemovals_[t]):(r.splice(i,1),0===r.length&&delete this.listeners_[t]))}}},Jg="change",$g="error",Qg="clear",ty="load";function ey(t,e,r,i,n){if(i&&i!==t&&(r=r.bind(i)),n){const i=r;r=function(){t.removeEventListener(e,r),i.apply(this,arguments)}}const o={target:t,type:e,listener:r};return t.addEventListener(e,r),o}function ry(t,e,r,i){return ey(t,e,r,i,!0)}function iy(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),Zg(t))}function ny(t){if(Array.isArray(t))for(let e=0,r=t.length;e<r;++e)iy(t[e]);else iy(t)}var oy=class extends Hg{constructor(){super(),this.revision_=0}changed(){++this.revision_,this.dispatchEvent(Jg)}getRevision(){return this.revision_}on(t,e){if(Array.isArray(t)){const r=t.length,i=new Array(r);for(let n=0;n<r;++n)i[n]=ey(this,t[n],e);return i}return ey(this,t,e)}once(t,e){let r;if(Array.isArray(t)){const i=t.length;r=new Array(i);for(let n=0;n<i;++n)r[n]=ry(this,t[n],e)}else r=ry(this,t,e);return e.ol_key=r,r}un(t,e){const r=e.ol_key;if(r)ny(r);else if(Array.isArray(t))for(let r=0,i=t.length;r<i;++r)this.removeEventListener(t[r],e);else this.removeEventListener(t,e)}};class sy extends Gg{constructor(t,e,r){super(t),this.key=e,this.oldValue=r}}const ay={};function ly(t){return ay.hasOwnProperty(t)?ay[t]:ay[t]="change:"+t}var uy=class extends oy{constructor(t){super(),gg(this),this.values_=null,void 0!==t&&this.setProperties(t)}get(t){let e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&qg({},this.values_)||{}}hasProperties(){return!!this.values_}notify(t,e){let r;r=ly(t),this.dispatchEvent(new sy(r,t,e)),r=zg,this.dispatchEvent(new sy(r,t,e))}set(t,e,r){const i=this.values_||(this.values_={});if(r)i[t]=e;else{const r=i[t];i[t]=e,r!==e&&this.notify(t,r)}}setProperties(t,e){for(const r in t)this.set(r,t[r],e)}unset(t,e){if(this.values_&&t in this.values_){const r=this.values_[t];delete this.values_[t],Kg(this.values_)&&(this.values_=null),e||this.notify(t,r)}}};const hy=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""),"i"),cy=["style","variant","weight","size","lineHeight","family"],py=function(t){const e=t.match(hy);if(!e)return null;const r={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let t=0,i=cy.length;t<i;++t){const i=e[t+1];void 0!==i&&(r[cy[t]]=i)}return r.families=r.family.split(/,\s?/),r},dy=new Array(6);function fy(t){return yy(t,1,0,0,1,0,0)}function gy(t,e){const r=t[0],i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],l=e[0],u=e[1],h=e[2],c=e[3],p=e[4],d=e[5];return t[0]=r*l+n*u,t[1]=i*l+o*u,t[2]=r*h+n*c,t[3]=i*h+o*c,t[4]=r*p+n*d+s,t[5]=i*p+o*d+a,t}function yy(t,e,r,i,n,o,s){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t[4]=o,t[5]=s,t}function my(t,e){const r=e[0],i=e[1];return e[0]=t[0]*r+t[2]*i+t[4],e[1]=t[1]*r+t[3]*i+t[5],e}function _y(t,e,r){return gy(t,yy(dy,e,0,0,r,0,0))}function vy(t,e,r,i,n,o,s,a){const l=Math.sin(o),u=Math.cos(o);return t[0]=i*u,t[1]=n*l,t[2]=-i*l,t[3]=n*u,t[4]=s*i*u-a*i*l+e,t[5]=s*n*l+a*n*u+r,t}function xy(t,e){const r=(i=e)[0]*i[3]-i[1]*i[2];var i;wg(0!==r,32);const n=e[0],o=e[1],s=e[2],a=e[3],l=e[4],u=e[5];return t[0]=a/r,t[1]=-o/r,t[2]=-s/r,t[3]=n/r,t[4]=(s*u-a*l)/r,t[5]=-(n*u-o*l)/r,t}function wy(t){return"matrix("+t.join(", ")+")"}const by=[],Sy=[0,0,0,0],Ty=new uy,Cy=new Hg;Cy.setSize=function(){console.warn("labelCache is deprecated.")};let Ey,Ry=null;const Py={},Iy=function(){const t=["monospace","serif"],e=t.length,r="wmytzilWMYTZIL@#/&?$%10";let i,n;function o(i,o,s){let a=!0;for(let l=0;l<e;++l){const e=t[l];if(n=My(i+" "+o+" 32px "+e,r),s!=e){const t=My(i+" "+o+" 32px "+s+","+e,r);a=a&&t!=n}}return!!a}function s(){let t=!0;const e=Ty.getKeys();for(let r=0,i=e.length;r<i;++r){const i=e[r];Ty.get(i)<100&&(o.apply(this,i.split("\n"))?(Zg(Py),Ry=null,Ey=void 0,Ty.set(i,100)):(Ty.set(i,Ty.get(i)+1,!0),t=!1))}t&&(clearInterval(i),i=void 0)}return function(t){const e=py(t);if(!e)return;const r=e.families;for(let t=0,n=r.length;t<n;++t){const n=r[t],a=e.style+"\n"+e.weight+"\n"+n;void 0===Ty.get(a)&&(Ty.set(a,100,!0),o(e.style,e.weight,n)||(Ty.set(a,0,!0),void 0===i&&(i=setInterval(s,32))))}}}(),Oy=function(){let t;const e=Py;return function(r){let i=e[r];if(null==i)if(Ng){const t=py(r),e=Ly(r,"Žg"),i=isNaN(Number(t.lineHeight))?1.2:Number(t.lineHeight);Py[r]=i*(e.actualBoundingBoxAscent+e.actualBoundingBoxDescent)}else t||(t=document.createElement("div"),t.innerHTML="M",t.style.margin="0 !important",t.style.padding="0 !important",t.style.position="absolute !important",t.style.left="-99999px !important"),t.style.font=r,document.body.appendChild(t),i=t.offsetHeight,e[r]=i,document.body.removeChild(t);return i}}();function Ly(t,e){return Ry||(Ry=Dg(1,1)),t!=Ey&&(Ry.font=t,Ey=Ry.font),Ry.measureText(e)}function My(t,e){return Ly(t,e).width}function Fy(t,e,r){if(e in r)return r[e];const i=My(t,e);return r[e]=i,i}function Ay(t,e,r,i){0!==e&&(t.translate(r,i),t.rotate(e),t.translate(-r,-i))}function ky(t,e,r,i,n,o,s,a,l,u,h){t.save(),1!==r&&(t.globalAlpha*=r),e&&t.setTransform.apply(t,e),i.contextInstructions?(t.translate(l,u),t.scale(h[0],h[1]),function(t,e){const r=t.contextInstructions;for(let t=0,i=r.length;t<i;t+=2)Array.isArray(r[t+1])?e[r[t]].apply(e,r[t+1]):e[r[t]]=r[t+1]}(i,t)):h[0]<0||h[1]<0?(t.translate(l,u),t.scale(h[0],h[1]),t.drawImage(i,n,o,s,a,0,0,s,a)):t.drawImage(i,n,o,s,a,l,u,s*h[0],a*h[1]),t.restore()}let Ny=null;class jy extends _g{constructor(t){super({opacity:1,rotateWithView:void 0!==t.rotateWithView&&t.rotateWithView,rotation:void 0!==t.rotation?t.rotation:0,scale:1,displacement:void 0!==t.displacement?t.displacement:[0,0]}),this.canvas_={},this.hitDetectionCanvas_={},this.fill_=void 0!==t.fill?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius_=void 0!==t.radius?t.radius:t.radius1,this.radius2_=t.radius2,this.angle_=void 0!==t.angle?t.angle:0,this.stroke_=void 0!==t.stroke?t.stroke:null,this.anchor_=null,this.size_=null,this.imageSize_=null,this.hitDetectionImageSize_=null,this.render()}clone(){const t=new jy({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t}getAnchor(){return this.anchor_}getAngle(){return this.angle_}getFill(){return this.fill_}getHitDetectionImage(t){if(!this.hitDetectionCanvas_[t||1]){const e=this.createRenderOptions();this.createHitDetectionCanvas_(e,t||1)}return this.hitDetectionCanvas_[t||1]}getImage(t){if(!this.canvas_[t||1]){const e=this.createRenderOptions(),r=Dg(e.size*t||1,e.size*t||1);this.draw_(e,r,0,0,t||1),this.canvas_[t||1]=r.canvas}return this.canvas_[t||1]}getPixelRatio(t){return t}getImageSize(){return this.imageSize_}getHitDetectionImageSize(){return this.hitDetectionImageSize_}getImageState(){return cg}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius_}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}listenImageChange(t){}load(){}unlistenImageChange(t){}createRenderOptions(){let t,e="round",r="round",i=0,n=null,o=0,s=0;return this.stroke_&&(t=this.stroke_.getColor(),null===t&&(t="#000"),t=Ag(t),s=this.stroke_.getWidth(),void 0===s&&(s=1),n=this.stroke_.getLineDash(),o=this.stroke_.getLineDashOffset(),r=this.stroke_.getLineJoin(),void 0===r&&(r="round"),e=this.stroke_.getLineCap(),void 0===e&&(e="round"),i=this.stroke_.getMiterLimit(),void 0===i&&(i=10)),{strokeStyle:t,strokeWidth:s,size:2*(this.radius_+s)+1,lineCap:e,lineDash:n,lineDashOffset:o,lineJoin:r,miterLimit:i}}render(){const t=this.createRenderOptions(),e=Dg(t.size,t.size);this.draw_(t,e,0,0,1),this.canvas_[1]=e.canvas;const r=e.canvas.width,i=r,n=this.getDisplacement();this.hitDetectionImageSize_=[t.size,t.size],this.createHitDetectionCanvas_(t,1),this.anchor_=[r/2-n[0],r/2+n[1]],this.size_=[r,r],this.imageSize_=[i,i]}draw_(t,e,r,i,n){let o,s,a;e.setTransform(n,0,0,n,0,0),e.translate(r,i),e.beginPath();let l=this.points_;if(l===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{const r=void 0!==this.radius2_?this.radius2_:this.radius_;for(r!==this.radius_&&(l*=2),o=0;o<=l;o++)s=2*o*Math.PI/l-Math.PI/2+this.angle_,a=o%2==0?this.radius_:r,e.lineTo(t.size/2+a*Math.cos(s),t.size/2+a*Math.sin(s))}if(this.fill_){let t=this.fill_.getColor();null===t&&(t="#000"),e.fillStyle=Ag(t),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,e.setLineDash&&t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineCap=t.lineCap,e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke()),e.closePath()}createHitDetectionCanvas_(t,e){if(this.hitDetectionCanvas_[e]=this.getImage(e),this.fill_){let r=this.fill_.getColor(),i=0;if("string"==typeof r&&(r=Lg(r)),null===r?i=1:Array.isArray(r)&&(i=4===r.length?r[3]:1),0===i){const r=Dg(t.size*e,t.size*e);this.hitDetectionCanvas_[e]=r.canvas,this.drawHitDetectionCanvas_(t,r,0,0,e)}}}drawHitDetectionCanvas_(t,e,r,i,n){e.setTransform(n,0,0,n,0,0),e.translate(r,i),e.beginPath();let o=this.points_;if(o===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{const r=void 0!==this.radius2_?this.radius2_:this.radius_;let i,n,s;for(r!==this.radius_&&(o*=2),i=0;i<=o;i++)s=2*i*Math.PI/o-Math.PI/2+this.angle_,n=i%2==0?this.radius_:r,e.lineTo(t.size/2+n*Math.cos(s),t.size/2+n*Math.sin(s))}e.fillStyle="#000",e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.stroke()),e.closePath()}}var Dy=jy;class Gy extends Dy{constructor(t){const e=t||{};super({points:1/0,fill:e.fill,radius:e.radius,stroke:e.stroke,displacement:void 0!==e.displacement?e.displacement:[0,0]})}clone(){const t=new Gy({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),displacement:this.getDisplacement().slice()});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t}setRadius(t){this.radius_=t,this.render()}}var zy=Gy;class By{constructor(t){const e=t||{};this.color_=void 0!==e.color?e.color:null}clone(){const t=this.getColor();return new By({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(t){this.color_=t}}var Uy=By,Yy="Point",Wy="LineString",Vy="LinearRing",Xy="Polygon",qy="MultiPoint",Zy="MultiLineString",Ky="MultiPolygon",Hy="GeometryCollection",Jy="Circle";class $y{constructor(t){const e=t||{};this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}clone(){const t=this.getColor();return new $y({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(t){this.color_=t}setLineCap(t){this.lineCap_=t}setLineDash(t){this.lineDash_=t}setLineDashOffset(t){this.lineDashOffset_=t}setLineJoin(t){this.lineJoin_=t}setMiterLimit(t){this.miterLimit_=t}setWidth(t){this.width_=t}}var Qy=$y;class tm{constructor(t){const e=t||{};this.geometry_=null,this.geometryFunction_=im,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}clone(){let t=this.getGeometry();return t&&"object"==typeof t&&(t=t.clone()),new tm({geometry:t,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(t){this.renderer_=t}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(t){this.fill_=t}getImage(){return this.image_}setImage(t){this.image_=t}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t}getText(){return this.text_}setText(t){this.text_=t}getZIndex(){return this.zIndex_}setGeometry(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=im,this.geometry_=t}setZIndex(t){this.zIndex_=t}}let em=null;function rm(t,e){if(!em){const t=new Uy({color:"rgba(255,255,255,0.4)"}),e=new Qy({color:"#3399CC",width:1.25});em=[new tm({image:new zy({fill:t,stroke:e,radius:5}),fill:t,stroke:e})]}return em}function im(t){return t.getGeometry()}var nm=tm,om="fraction",sm="pixels",am="bottom-left",lm="bottom-right",um="top-left",hm="top-right";class cm{constructor(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(const e in this.cache_){const r=this.cache_[e];0!=(3&t++)||r.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}}get(t,e,r){const i=pm(t,e,r);return i in this.cache_?this.cache_[i]:null}set(t,e,r,i){const n=pm(t,e,r);this.cache_[n]=i,++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}function pm(t,e,r){return e+":"+t+":"+(r?function(t){return"string"==typeof t?t:Fg(t)}(r):"null")}const dm=new cm;var fm=0,gm=1,ym=2,mm=4,_m=8,vm=16;function xm(t,e,r){return r?(r[0]=t[0]-e,r[1]=t[1]-e,r[2]=t[2]+e,r[3]=t[3]+e,r):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function wm(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function bm(t,e,r){let i,n;return i=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0,n=r<t[1]?t[1]-r:t[3]<r?r-t[3]:0,i*i+n*n}function Sm(t,e){return Cm(t,e[0],e[1])}function Tm(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function Cm(t,e,r){return t[0]<=e&&e<=t[2]&&t[1]<=r&&r<=t[3]}function Em(t,e){const r=t[0],i=t[1],n=t[2],o=t[3],s=e[0],a=e[1];let l=fm;return s<r?l|=vm:s>n&&(l|=mm),a<i?l|=_m:a>o&&(l|=ym),l===fm&&(l=gm),l}function Rm(t,e,r,i,n){return n?(n[0]=t,n[1]=e,n[2]=r,n[3]=i,n):[t,e,r,i]}function Pm(t){return Rm(1/0,1/0,-1/0,-1/0,t)}function Im(t,e){const r=t[0],i=t[1];return Rm(r,i,r,i,e)}function Om(t,e,r,i,n){return Am(Pm(n),t,e,r,i)}function Lm(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Mm(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function Fm(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function Am(t,e,r,i,n){for(;r<i;r+=n)km(t,e[r],e[r+1]);return t}function km(t,e,r){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],r),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],r)}function Nm(t,e){let r;return r=e(jm(t)),r||(r=e(Dm(t)),r||(r=e(Ym(t)),r||(r=e(Um(t)),r||!1)))}function jm(t){return[t[0],t[1]]}function Dm(t){return[t[2],t[1]]}function Gm(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function zm(t){return t[3]-t[1]}function Bm(t,e,r){const i=r||[1/0,1/0,-1/0,-1/0];return Vm(t,e)?(t[0]>e[0]?i[0]=t[0]:i[0]=e[0],t[1]>e[1]?i[1]=t[1]:i[1]=e[1],t[2]<e[2]?i[2]=t[2]:i[2]=e[2],t[3]<e[3]?i[3]=t[3]:i[3]=e[3]):Pm(i),i}function Um(t){return[t[0],t[3]]}function Ym(t){return[t[2],t[3]]}function Wm(t){return t[2]-t[0]}function Vm(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Xm(t,e,r,i){let n=[];if(i>1){const e=t[2]-t[0],r=t[3]-t[1];for(let o=0;o<i;++o)n.push(t[0]+e*o/i,t[1],t[2],t[1]+r*o/i,t[2]-e*o/i,t[3],t[0],t[3]-r*o/i)}else n=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(n,n,2);const o=[],s=[];for(let t=0,e=n.length;t<e;t+=2)o.push(n[t]),s.push(n[t+1]);return function(t,e,r){return Rm(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),r)}(o,s,r)}function qm(t,e,r){const i=t;if(i.src&&jg){const t=i.decode();let n=!0;const o=function(){n=!1};return t.then((function(){n&&e()})).catch((function(t){n&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():r())})),o}const n=[ry(i,ty,e),ry(i,$g,r)];return function(){n.forEach(iy)}}let Zm=null;class Km extends Hg{constructor(t,e,r,i,n,o){super(),this.hitDetectionImage_={},this.image_=t||new Image,null!==i&&(this.image_.crossOrigin=i),this.canvas_={},this.color_=o,this.unlisten_=null,this.imageState_=n,this.size_=r,this.src_=e,this.tainted_}isTainted_(){if(void 0===this.tainted_&&this.imageState_===cg){Zm||(Zm=Dg(1,1)),Zm.drawImage(this.image_,0,0);try{Zm.getImageData(0,0,1,1),this.tainted_=!1}catch(t){Zm=null,this.tainted_=!0}}return!0===this.tainted_}dispatchChangeEvent_(){this.dispatchEvent(Jg)}handleImageError_(){this.imageState_=pg,this.unlistenImage_(),this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=cg,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()}getImage(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(t){if(!this.hitDetectionImage_[t])if(this.isTainted_()){const e=this.color_?t:1,r=this.size_[0],i=this.size_[1],n=Dg(Math.ceil(r*e),Math.ceil(i*e));n.scale(e,e),n.fillRect(0,0,r,i),this.hitDetectionImage_[t]=n.canvas}else this.hitDetectionImage_[t]=this.image_;return this.hitDetectionImage_[t]}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_==ug){this.imageState_=hg;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=qm(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t])return;const e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);const r=e.getContext("2d");if(r.scale(t,t),r.drawImage(this.image_,0,0),this.isTainted_()){const t=this.color_;return r.globalCompositeOperation="multiply",r.fillStyle="rgb("+t[0]+","+t[1]+","+t[2]+")",r.fillRect(0,0,e.width,e.height),r.globalCompositeOperation="destination-in",void r.drawImage(this.image_,0,0)}const i=r.getImageData(0,0,e.width,e.height),n=i.data,o=this.color_[0]/255,s=this.color_[1]/255,a=this.color_[2]/255;for(let t=0,e=n.length;t<e;t+=4)n[t]*=o,n[t+1]*=s,n[t+2]*=a;r.putImageData(i,0,0)}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}class Hm extends _g{constructor(t){const e=t||{},r=void 0!==e.opacity?e.opacity:1,i=void 0!==e.rotation?e.rotation:0,n=void 0!==e.scale?e.scale:1,o=void 0!==e.rotateWithView&&e.rotateWithView;super({opacity:r,rotation:i,scale:n,displacement:void 0!==e.displacement?e.displacement:[0,0],rotateWithView:o}),this.anchor_=void 0!==e.anchor?e.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=void 0!==e.anchorOrigin?e.anchorOrigin:um,this.anchorXUnits_=void 0!==e.anchorXUnits?e.anchorXUnits:om,this.anchorYUnits_=void 0!==e.anchorYUnits?e.anchorYUnits:om,this.crossOrigin_=void 0!==e.crossOrigin?e.crossOrigin:null;const s=void 0!==e.img?e.img:null,a=void 0!==e.imgSize?e.imgSize:null;let l=e.src;wg(!(void 0!==l&&s),4),wg(!s||s&&a,5),void 0!==l&&0!==l.length||!s||(l=s.src||gg(s)),wg(void 0!==l&&l.length>0,6);const u=void 0!==e.src?ug:cg;this.color_=void 0!==e.color?Lg(e.color):null,this.iconImage_=function(t,e,r,i,n,o){let s=dm.get(e,i,o);return s||(s=new Km(t,e,r,i,n,o),dm.set(e,i,o,s)),s}(s,l,a,this.crossOrigin_,u,this.color_),this.offset_=void 0!==e.offset?e.offset:[0,0],this.offsetOrigin_=void 0!==e.offsetOrigin?e.offsetOrigin:um,this.origin_=null,this.size_=void 0!==e.size?e.size:null}clone(){const t=this.getScale();return new Hm({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})}getAnchor(){if(this.normalizedAnchor_)return this.normalizedAnchor_;let t=this.anchor_;const e=this.getSize();if(this.anchorXUnits_==om||this.anchorYUnits_==om){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==om&&(t[0]*=e[0]),this.anchorYUnits_==om&&(t[1]*=e[1])}if(this.anchorOrigin_!=um){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=hm&&this.anchorOrigin_!=lm||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=am&&this.anchorOrigin_!=lm||(t[1]=-t[1]+e[1])}return this.normalizedAnchor_=t,this.normalizedAnchor_}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getHitDetectionImageSize(){return this.getImageSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(t){return this.iconImage_.getHitDetectionImage(t)}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;const e=this.getDisplacement();if(this.offsetOrigin_!=um){const e=this.getSize(),r=this.iconImage_.getSize();if(!e||!r)return null;t=t.slice(),this.offsetOrigin_!=hm&&this.offsetOrigin_!=lm||(t[0]=r[0]-e[0]-t[0]),this.offsetOrigin_!=am&&this.offsetOrigin_!=lm||(t[1]=r[1]-e[1]-t[1])}return t[0]+=e[0],t[1]+=e[1],this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}listenImageChange(t){this.iconImage_.addEventListener(Jg,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(Jg,t)}}var Jm=Hm,$m="point",Qm="line";class t_{constructor(t){const e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=yg(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new Uy({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:$m,this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}clone(){const t=this.getScale();return new t_({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}setOverflow(t){this.overflow_=t}setFont(t){this.font_=t}setMaxAngle(t){this.maxAngle_=t}setOffsetX(t){this.offsetX_=t}setOffsetY(t){this.offsetY_=t}setPlacement(t){this.placement_=t}setRotateWithView(t){this.rotateWithView_=t}setFill(t){this.fill_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=yg(void 0!==t?t:1)}setStroke(t){this.stroke_=t}setText(t){this.text_=t}setTextAlign(t){this.textAlign_=t}setTextBaseline(t){this.textBaseline_=t}setBackgroundFill(t){this.backgroundFill_=t}setBackgroundStroke(t){this.backgroundStroke_=t}setPadding(t){this.padding_=t}}var e_=t_;function r_(t,e,r,i,n){return!Nm(n,(function(n){return!i_(t,e,r,i,n[0],n[1])}))}function i_(t,e,r,i,n,o){let s=0,a=t[r-i],l=t[r-i+1];for(;e<r;e+=i){const r=t[e],i=t[e+1];l<=o?i>o&&(r-a)*(o-l)-(n-a)*(i-l)>0&&s++:i<=o&&(r-a)*(o-l)-(n-a)*(i-l)<0&&s--,a=r,l=i}return 0!==s}function n_(t,e,r,i,n,o){if(0===r.length)return!1;if(!i_(t,e,r[0],i,n,o))return!1;for(let e=1,s=r.length;e<s;++e)if(i_(t,r[e-1],r[e],i,n,o))return!1;return!0}function o_(t,e,r,i,n,o,s){let a,l,u,h,c,p,d;const f=n[o+1],g=[];for(let n=0,o=r.length;n<o;++n){const o=r[n];for(h=t[o-i],p=t[o-i+1],a=e;a<o;a+=i)c=t[a],d=t[a+1],(f<=p&&d<=f||p<=f&&f<=d)&&(u=(f-p)/(d-p)*(c-h)+h,g.push(u)),h=c,p=d}let y=NaN,m=-1/0;for(g.sort(Ug),h=g[0],a=1,l=g.length;a<l;++a){c=g[a];const n=Math.abs(c-h);n>m&&(u=(h+c)/2,n_(t,e,r,i,u,f)&&(y=u,m=n)),h=c}return isNaN(y)&&(y=n[o]),s?(s.push(y,f,m),s):[y,f,m]}function s_(t,e,r,i,n){let o=[];for(let s=0,a=r.length;s<a;++s){const a=r[s];o=o_(t,e,a,i,n,2*s,o),e=a[a.length-1]}return o}const a_={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},l_={};l_[a_.DEGREES]=2*Math.PI*6370997/360,l_[a_.FEET]=.3048,l_[a_.METERS]=1,l_[a_.USFEET]=1200/3937;var u_=a_;var h_=class{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||l_[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}};const c_=6378137*Math.PI,p_=[-c_,-c_,c_,c_],d_=[-180,-85,180,85];class f_ extends h_{constructor(t){super({code:t,units:u_.METERS,extent:p_,global:!0,worldExtent:d_,getPointResolution:function(t,e){return t/Sg(e[1]/6378137)}})}}const g_=[new f_("EPSG:3857"),new f_("EPSG:102100"),new f_("EPSG:102113"),new f_("EPSG:900913"),new f_("urn:ogc:def:crs:EPSG:6.18:3:3857"),new f_("urn:ogc:def:crs:EPSG::3857"),new f_("http://www.opengis.net/gml/srs/epsg.xml#3857")];function y_(t,e,r){const i=t.length,n=r>1?r:2;let o=e;void 0===o&&(o=n>2?t.slice():new Array(i));const s=c_;for(let e=0;e<i;e+=n){o[e]=s*t[e]/180;let r=6378137*Math.log(Math.tan(Math.PI*(+t[e+1]+90)/360));r>s?r=s:r<-s&&(r=-s),o[e+1]=r}return o}function m_(t,e,r){const i=t.length,n=r>1?r:2;let o=e;void 0===o&&(o=n>2?t.slice():new Array(i));for(let e=0;e<i;e+=n)o[e]=180*t[e]/c_,o[e+1]=360*Math.atan(Math.exp(t[e+1]/6378137))/Math.PI-90;return o}const __=[-180,-90,180,90],v_=6378137*Math.PI/180;class x_ extends h_{constructor(t,e){super({code:t,units:u_.DEGREES,extent:__,axisOrientation:e,global:!0,metersPerUnit:v_,worldExtent:__})}}const w_=[new x_("CRS:84"),new x_("EPSG:4326","neu"),new x_("urn:ogc:def:crs:EPSG::4326","neu"),new x_("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new x_("urn:ogc:def:crs:OGC:1.3:CRS84"),new x_("urn:ogc:def:crs:OGC:2:84"),new x_("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new x_("urn:x-ogc:def:crs:EPSG:4326","neu")];let b_={};let S_={};function T_(t,e,r){const i=t.getCode(),n=e.getCode();i in S_||(S_[i]={}),S_[i][n]=r}function C_(t,e){const r=Wm(e.getExtent()),i=E_(t,e,r);return i&&(t[0]-=i*r),t}function E_(t,e,r){const i=e.getExtent();let n=0;if(e.canWrapX()&&(t[0]<i[0]||t[0]>i[2])){const e=r||Wm(i);n=Math.floor((t[0]-i[0])/e)}return n}function R_(t,e,r){let i;if(void 0!==e){for(let r=0,i=t.length;r<i;++r)e[r]=t[r];i=e}else i=t.slice();return i}function P_(t,e,r){if(void 0!==e&&t!==e){for(let r=0,i=t.length;r<i;++r)e[r]=t[r];t=e}return t}function I_(t){!function(t,e){b_[t]=e}(t.getCode(),t),T_(t,t,R_)}function O_(t){return"string"==typeof t?b_[t]||null:t||null}function L_(t){!function(t){t.forEach(I_)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&T_(e,t,R_)}))}))}function M_(t,e){if(t===e)return!0;const r=t.getUnits()===e.getUnits();if(t.getCode()===e.getCode())return r;return F_(t,e)===R_&&r}function F_(t,e){let r=function(t,e){let r;return t in S_&&e in S_[t]&&(r=S_[t][e]),r}(t.getCode(),e.getCode());return r||(r=P_),r}function A_(t,e){return F_(O_(t),O_(e))}function k_(t,e,r,i){return Xm(t,A_(e,r),void 0,i)}let N_=null;function j_(){return N_}function D_(t,e){return N_?k_(t,e,N_):t}function G_(t,e){return N_?k_(t,N_,e):t}function z_(t,e,r,i,n,o,s){let a,l;const u=(r-e)/i;if(1===u)a=e;else if(2===u)a=e,l=n;else if(0!==u){let o=t[e],s=t[e+1],u=0;const h=[0];for(let n=e+i;n<r;n+=i){const e=t[n],r=t[n+1];u+=Math.sqrt((e-o)*(e-o)+(r-s)*(r-s)),h.push(u),o=e,s=r}const c=n*u,p=function(t,e,r){let i,n;const o=r||Ug;let s=0,a=t.length,l=!1;for(;s<a;)i=s+(a-s>>1),n=+o(t[i],e),n<0?s=i+1:(a=i,l=!n);return l?s:~s}(h,c);p<0?(l=(c-h[-p-2])/(h[-p-1]-h[-p-2]),a=e+(-p-2)*i):a=e+p*i}const h=s>1?s:2,c=o||new Array(h);for(let e=0;e<h;++e)c[e]=void 0===a?NaN:void 0===l?t[a+e]:Eg(t[a+e],t[a+i+e],l);return c}function B_(t,e,r,i,n,o){if(r==e)return null;let s;if(n<t[e+i-1])return o?(s=t.slice(e,e+i),s[i-1]=n,s):null;if(t[r-1]<n)return o?(s=t.slice(r-i,r),s[i-1]=n,s):null;if(n==t[e+i-1])return t.slice(e,e+i);let a=e/i,l=r/i;for(;a<l;){const e=a+l>>1;n<t[(e+1)*i-1]?l=e:a=e+1}const u=t[a*i-1];if(n==u)return t.slice((a-1)*i,(a-1)*i+i);const h=(n-u)/(t[(a+1)*i-1]-u);s=[];for(let e=0;e<i-1;++e)s.push(Eg(t[(a-1)*i+e],t[a*i+e],h));return s.push(n),s}function U_(t,e,r,i){const n=[];let o=[1/0,1/0,-1/0,-1/0];for(let s=0,a=r.length;s<a;++s){const a=r[s];o=Om(t,e,a[0],i),n.push((o[0]+o[2])/2,(o[1]+o[3])/2),e=a[a.length-1]}return n}function Y_(t,e,r,i,n,o){const s=o||[];let a=0;for(let o=e;o<r;o+=i){const e=t[o],r=t[o+1];s[a++]=n[0]*e+n[2]*r+n[4],s[a++]=n[1]*e+n[3]*r+n[5]}return o&&s.length!=a&&(s.length=a),s}function W_(t,e,r,i,n,o,s){const a=s||[],l=Math.cos(n),u=Math.sin(n),h=o[0],c=o[1];let p=0;for(let n=e;n<r;n+=i){const e=t[n]-h,r=t[n+1]-c;a[p++]=h+e*l-r*u,a[p++]=c+e*u+r*l;for(let e=n+2;e<n+i;++e)a[p++]=t[e]}return s&&a.length!=p&&(a.length=p),a}L_(g_),L_(w_),function(t,e,r,i){t.forEach((function(t){e.forEach((function(e){T_(t,e,r),T_(e,t,i)}))}))}(w_,g_,y_,m_);const V_=[1,0,0,1,0,0];class X_{constructor(t,e,r,i,n){this.extent_,this.id_=n,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=r,this.properties_=i}get(t){return this.properties_[t]}getExtent(){return this.extent_||(this.extent_=this.type_===Yy?Im(this.flatCoordinates_):Om(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const t=Gm(this.getExtent());this.flatInteriorPoints_=o_(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const t=U_(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=s_(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=z_(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];const t=this.flatCoordinates_;let e=0;const r=this.ends_;for(let i=0,n=r.length;i<n;++i){const n=r[i],o=z_(t,e,n,2,.5);Wg(this.flatMidpoints_,o),e=n}}return this.flatMidpoints_}getId(){return this.id_}getOrientedFlatCoordinates(){return this.flatCoordinates_}getGeometry(){return this}getSimplifiedGeometry(t){return this}simplifyTransformed(t,e){return this}getProperties(){return this.properties_}getStride(){return 2}getStyleFunction(){}getType(){return this.type_}transform(t,e){const r=(t=O_(t)).getExtent(),i=t.getWorldExtent(),n=zm(i)/zm(r);vy(V_,i[0],i[3],n,-n,0,0,0),Y_(this.flatCoordinates_,0,this.flatCoordinates_.length,2,V_,this.flatCoordinates_)}getEnds(){return this.ends_}}X_.prototype.getEndss=X_.prototype.getEnds,X_.prototype.getFlatCoordinates=X_.prototype.getOrientedFlatCoordinates;var q_=X_,Z_=r(0);function K_(t){return t*Math.PI/180}var H_=function(){for(var t=[],e=78271.51696402048;t.length<=24;e/=2)t.push(e);return t}();function J_(t,e){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(t,e);var r=document.createElement("canvas");return r.width=t,r.height=e,r}var $_,Q_=Array(256).join(" ");function tv(t,e){if(e>=.05){for(var r="",i=t.split("\n"),n=Q_.slice(0,Math.round(e/.1)),o=0,s=i.length;o<s;++o)o>0&&(r+="\n"),r+=i[o].split("").join(n);return r}return t}function ev(){return $_||($_=J_(1,1).getContext("2d")),$_}function rv(t,e){return ev().measureText(t).width+(t.length-1)*e}var iv={};Cy&&ey(Cy,Qg,(function(){iv={}}));var nv,ov,sv=Z_.e.isFunction,av=Z_.e.convertFunction,lv=Z_.c.isExpression,uv=Z_.c.createPropertyExpression,hv={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},cv={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},pv={},dv={zoom:0},fv={};function gv(t,e,r,i,n){var o=t.id;fv[o]||(fv[o]={});var s=fv[o];if(!s[r]){var a=(t[e]||pv)[r],l=Z_.f[e+"_"+t.type][r];void 0===a&&(a=l.default);var u=lv(a);if(!u&&sv(a)&&(a=av(a,l),u=!0),u){var h=function(t,e){var r=uv(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}(a,l);s[r]=h.evaluate.bind(h)}else"color"==l.type&&(a=Z_.a.parse(a)),s[r]=function(){return a}}return dv.zoom=i,s[r](dv,n)}var yv={};function mv(t,e){if(t){if(0===t.a||0===e)return;var r=t.a;return e=void 0===e?1:e,"rgba("+Math.round(255*t.r/r)+","+Math.round(255*t.g/r)+","+Math.round(255*t.b/r)+","+r*e+")"}return t}var _v=/^([^]*)\{(.*)\}([^]*)$/;function vv(t,e){var r;do{if(r=t.match(_v)){var i=e[r[2]]||"";t=r[1]+i+r[3]}}while(r);return t}var xv=function(t,e,r,i,n,o,s){if(void 0===i&&(i=H_),"string"==typeof e&&(e=JSON.parse(e)),8!=e.version)throw new Error("glStyle version 8 required.");var a,l;if(o)if("undefined"!=typeof Image){var u=new Image;u.crossOrigin="anonymous",u.onload=function(){a=u,l=[u.width,u.height],t.changed(),u.onload=null},u.src=o}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){var h=self;h.postMessage({action:"loadImage",src:o}),h.addEventListener("message",(function(t){"imageLoaded"===t.data.action&&t.data.src===o&&(a=t.data.image,l=[a.width,a.height])}))}for(var c,p=Object(Z_.b)(e.layers),d={},f=[],g=0,y=p.length;g<y;++g){var m=p[g],_=m.id;if("string"==typeof r&&m.source==r||-1!==r.indexOf(_)){var v=m["source-layer"];if(!c){c=m.source;var x=e.sources[c];if(!x)throw new Error('Source "'+c+'" is not defined');var w=x.type;if("vector"!==w&&"geojson"!==w)throw new Error('Source "'+c+'" is not of type "vector" or "geojson", but "'+w+'"')}var b=d[v];b||(b=d[v]=[]),b.push({layer:m,index:g}),f.push(_)}delete fv[_],delete yv[_]}var S=new Qy,T=new Uy,C={},E={},R=[],P=function(t,e){var r=t.getProperties(),o=d[r.layer];if(o){var u=i.indexOf(e);-1==u&&(u=function(t,e){for(var r=0,i=e.length;r<i;++r){if(e[r]<t&&r+1<i){var n=e[r]/e[r+1];return r+Math.log(e[r]/t)/Math.log(n)}}return i-1}(e,i));for(var h=hv[t.getGeometry().getType()],c={properties:r,type:h},p=-1,f=function(i,d){var f=o[i],g=f.layer,y=g.id,m=g.layout||pv,_=g.paint||pv;if("none"===m.visibility||"minzoom"in g&&u<g.minzoom||"maxzoom"in g&&u>=g.maxzoom)return"continue";var v=g.filter;if(!v||function(t,e,r,i){return t in yv||(yv[t]=Object(Z_.d)(e).filter),dv.zoom=i,yv[t](dv,r)}(y,v,c,u)){var x=void 0,w=void 0,b=void 0,P=void 0,I=void 0,O=void 0,L=f.index;if(3==h&&"fill"==g.type)if(w=gv(g,"paint","fill-opacity",u,c),"fill-pattern"in _){var M=gv(g,"paint","fill-pattern",u,c);if(M){var F="string"==typeof M?vv(M,r):M.toString();if(a&&n&&n[F]){++p,(O=R[p])&&O.getFill()&&!O.getStroke()&&!O.getText()||(O=R[p]=new nm({fill:new Uy})),b=O.getFill(),O.setZIndex(L);var A=E[lt=F+"."+w];if(!A)(ct=(ht=J_((ut=n[F]).width,ut.height)).getContext("2d")).globalAlpha=w,ct.drawImage(a,ut.x,ut.y,ut.width,ut.height,0,0,ut.width,ut.height),A=ct.createPattern(ht,"repeat"),E[lt]=A;b.setColor(A)}}}else(x=mv(gv(g,"paint","fill-color",u,c),w))&&("fill-outline-color"in _&&(I=mv(gv(g,"paint","fill-outline-color",u,c),w)),I||(I=x),++p,(O=R[p])&&O.getFill()&&O.getStroke()&&!O.getText()||(O=R[p]=new nm({fill:new Uy,stroke:new Qy})),(b=O.getFill()).setColor(x),(P=O.getStroke()).setColor(I),P.setWidth(1),O.setZIndex(L));if(1!=h&&"line"==g.type){x=!("line-pattern"in _)&&"line-color"in _?mv(gv(g,"paint","line-color",u,c),gv(g,"paint","line-opacity",u,c)):void 0;var k=gv(g,"paint","line-width",u,c);x&&k>0&&(++p,(O=R[p])&&O.getStroke()&&!O.getFill()&&!O.getText()||(O=R[p]=new nm({stroke:new Qy})),(P=O.getStroke()).setLineCap(gv(g,"layout","line-cap",u,c)),P.setLineJoin(gv(g,"layout","line-join",u,c)),P.setMiterLimit(gv(g,"layout","line-miter-limit",u,c)),P.setColor(x),P.setWidth(k),P.setLineDash(_["line-dasharray"]?gv(g,"paint","line-dasharray",u,c).map((function(t){return t*k})):null),O.setZIndex(L))}var N=!1,j=null,D=0,G=void 0,z=void 0,B=void 0;if((1==h||2==h)&&"icon-image"in m){var U=gv(g,"layout","icon-image",u,c);if(U){G="string"==typeof U?vv(U,r):U.toString();var Y=void 0;if(a&&n&&n[G]){var W=gv(g,"layout","icon-rotation-alignment",u,c);if(2==h){var V=t.getGeometry();if(V.getFlatMidpoint||V.getFlatMidpoints){var X=V.getExtent();if(Math.sqrt(Math.max(Math.pow((X[2]-X[0])/e,2),Math.pow((X[3]-X[1])/e,2)))>150){var q="MultiLineString"===V.getType()?V.getFlatMidpoints():V.getFlatMidpoint();if(ov||(ov=new q_("Point",nv=[NaN,NaN],[],{},null)),Y=ov,nv[0]=q[0],nv[1]=q[1],"line"===(Lt=gv(g,"layout","symbol-placement",u,c))&&"map"===W)for(var Z=V.getStride(),K=V.getFlatCoordinates(),H=0,J=K.length-Z;H<J;H+=Z){var $=K[H],Q=K[H+1],tt=K[H+Z],et=K[H+Z+1],rt=Math.min($,tt),it=Math.min(Q,et),nt=Math.max($,tt),ot=Math.max(Q,et);if(q[0]>=rt&&q[0]<=nt&&q[1]>=it&&q[1]<=ot){D=Math.atan2(Q-et,tt-$);break}}}}}if(2!==h||Y){++p,(O=R[p])&&O.getImage()&&!O.getFill()&&!O.getStroke()||(O=R[p]=new nm),O.setGeometry(Y);var st=gv(g,"layout","icon-size",u,c),at=void 0!==_["icon-color"]?gv(g,"paint","icon-color",u,c):null,lt=G+"."+st;if(null!==at&&(lt+="."+at),!(z=C[lt])){var ut=n[G];if(null!==at){var ht,ct;(ct=(ht=J_(ut.width,ut.height)).getContext("2d")).drawImage(a,ut.x,ut.y,ut.width,ut.height,0,0,ut.width,ut.height);for(var pt=ct.getImageData(0,0,ht.width,ht.height),dt=0,ft=pt.data.length;dt<ft;dt+=4){var gt=at.a;0!==gt&&(pt.data[dt]=255*at.r/gt,pt.data[dt+1]=255*at.g/gt,pt.data[dt+2]=255*at.b/gt),pt.data[dt+3]=gt}ct.putImageData(pt,0,0),z=C[lt]=new Jm({img:ht,imgSize:[ht.width,ht.height],scale:st/ut.pixelRatio})}else z=C[lt]=new Jm({img:a,imgSize:l,size:[ut.width,ut.height],offset:[ut.x,ut.y],rotateWithView:"map"===W,scale:st/ut.pixelRatio})}z.setRotation(D+K_(gv(g,"layout","icon-rotate",u,c))),z.setOpacity(gv(g,"paint","icon-opacity",u,c)),z.setAnchor(cv[gv(g,"layout","icon-anchor",u,c)]),O.setImage(z),j=O.getText(),O.setText(void 0),O.setZIndex(L),N=!0,B=!1}else B=!0}}}if(1==h&&"circle-radius"in _){++p,(O=R[p])&&O.getImage()&&!O.getFill()&&!O.getStroke()||(O=R[p]=new nm);var yt=gv(g,"paint","circle-radius",u,c),mt=mv(gv(g,"paint","circle-stroke-color",u,c),gv(g,"paint","circle-stroke-opacity",u,c)),_t=mv(gv(g,"paint","circle-color",u,c),gv(g,"paint","circle-opacity",u,c)),vt=gv(g,"paint","circle-stroke-width",u,c),xt=yt+"."+mt+"."+_t+"."+vt;(z=C[xt])||(z=C[xt]=new zy({radius:yt,stroke:mt&&vt>0?new Qy({width:vt,color:mt}):void 0,fill:_t?new Uy({color:_t}):void 0})),O.setImage(z),j=O.getText(),O.setText(void 0),O.setGeometry(void 0),O.setZIndex(L),N=!0}var wt=void 0;if("text-field"in m)wt=vv(gv(g,"layout","text-field",u,c).toString(),r).trim(),w=gv(g,"paint","text-opacity",u,c);if(wt&&w&&!B){N||(++p,(O=R[p])&&O.getText()&&!O.getFill()&&!O.getStroke()||(O=R[p]=new nm),O.setImage(void 0),O.setGeometry(void 0)),O.getText()||O.setText(j||new e_({padding:[2,2,2,2]})),j=O.getText();var bt=Math.round(gv(g,"layout","text-size",u,c)),St=gv(g,"layout","text-font",u,c),Tt=gv(g,"layout","text-line-height",u,c),Ct=lg()(s?s(St):St,bt,Tt),Et=m["text-transform"];"uppercase"==Et?wt=wt.toUpperCase():"lowercase"==Et&&(wt=wt.toLowerCase());var Rt=gv(g,"layout","text-max-width",u,c),Pt=gv(g,"layout","text-letter-spacing",u,c),It=2==h?tv(wt,Pt):function t(e,r,i,n){if(-1!==e.indexOf("\n")){for(var o=e.split("\n"),s=[],a=0,l=o.length;a<l;++a)s.push(t(o[a],r,i,n));return s.join("\n")}var u=i+","+r+","+e+","+n,h=iv[u];if(!h){var c=e.split(" ");if(c.length>1){var p=ev();p.font=r;var d=p.measureText("M").width*i,f="";for(s=[],a=0,l=c.length;a<l;++a){var g=c[a],y=f+(f?" ":"")+g;rv(y,n)<=d?f=y:(f&&s.push(f),f=g)}f&&s.push(f);for(a=0;a<s.length;++a){var m=s[a];if(rv(m,n)<.35*d){var _=a>0?rv(s[a-1],n):1/0,v=a<s.length-1?rv(s[a+1],n):1/0;s.splice(a,1),_<v?(s[a-1]+=" "+m,a-=1):s[a]=m+" "+s[a]}}for(a=0,l=s.length-1;a<l;++a){var x=s[a],w=s[a+1];if(rv(x,n)>.7*d&&rv(w,n)<.6*d){var b=x.split(" "),S=b.pop();rv(S,n)<.2*d&&(s[a]=b.join(" "),s[a+1]=S+" "+w),l-=1}}h=s.join("\n")}else h=e;h=tv(h,n),iv[u]=h}return h}(wt,Ct,Rt,Pt);j.setText(It),j.setFont(Ct),j.setRotation(K_(gv(g,"layout","text-rotate",u,c)));var Ot=gv(g,"layout","text-anchor",u,c),Lt=N||1==h?"point":gv(g,"layout","symbol-placement",u,c);j.setPlacement(Lt);var Mt=gv(g,"paint","text-halo-width",u,c),Ft=gv(g,"layout","text-offset",u,c),At=gv(g,"paint","text-translate",u,c),kt=0,Nt=0;if("point"==Lt){var jt="center";-1!==Ot.indexOf("left")?(jt="left",Nt=Mt):-1!==Ot.indexOf("right")&&(jt="right",Nt=-Mt),j.setTextAlign(jt);var Dt=gv(g,"layout","text-rotation-alignment",u,c);j.setRotateWithView("map"==Dt)}else j.setMaxAngle(K_(gv(g,"layout","text-max-angle",u,c))*wt.length/It.length),j.setTextAlign(),j.setRotateWithView(!1);var Gt="middle";0==Ot.indexOf("bottom")?(Gt="bottom",kt=-Mt-.5*(Tt-1)*bt):0==Ot.indexOf("top")&&(Gt="top",kt=Mt+.5*(Tt-1)*bt),j.setTextBaseline(Gt),j.setOffsetX(Ft[0]*bt+Nt+At[0]),j.setOffsetY(Ft[1]*bt+kt+At[1]),T.setColor(mv(gv(g,"paint","text-color",u,c),w)),j.setFill(T);var zt=mv(gv(g,"paint","text-halo-color",u,c),w);if(zt){S.setColor(zt),Mt*=2;var Bt=.5*bt;S.setWidth(Mt<=Bt?Mt:Bt),j.setStroke(S)}else j.setStroke(void 0);var Ut=gv(g,"layout","text-padding",u,c),Yt=j.getPadding();Ut!==Yt[0]&&(Yt[0]=Yt[1]=Yt[2]=Yt[3]=Ut),O.setZIndex(L)}}},g=0,y=o.length;g<y;++g)f(g);return p>-1?(R.length=p+1,R):void 0}};return t.setStyle(P),t.set("mapbox-source",c),t.set("mapbox-layers",f),P},wv=r(6),bv=r.n(wv);class Sv{constructor(t,e,r,i){this.minX=t,this.maxX=e,this.minY=r,this.maxY=i}contains(t){return this.containsXY(t[1],t[2])}containsTileRange(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY}containsXY(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY}equals(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY}extend(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY}}var Tv=Sv;var Cv="opacity",Ev="visible",Rv="extent",Pv="zIndex",Iv="maxResolution",Ov="minResolution",Lv="maxZoom",Mv="minZoom",Fv="source";var Av=class extends uy{constructor(t){super();const e=qg({},t);e[Cv]=void 0!==t.opacity?t.opacity:1,wg("number"==typeof e[Cv],64),e[Ev]=void 0===t.visible||t.visible,e[Pv]=t.zIndex,e[Iv]=void 0!==t.maxResolution?t.maxResolution:1/0,e[Ov]=void 0!==t.minResolution?t.minResolution:0,e[Mv]=void 0!==t.minZoom?t.minZoom:-1/0,e[Lv]=void 0!==t.maxZoom?t.maxZoom:1/0,this.className_=void 0!==e.className?t.className:"ol-layer",delete e.className,this.setProperties(e),this.state_=null}getClassName(){return this.className_}getLayerState(t){const e=this.state_||{layer:this,managed:void 0===t||t},r=this.getZIndex();return e.opacity=bg(Math.round(100*this.getOpacity())/100,0,1),e.sourceState=this.getSourceState(),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==r?r:!1===e.managed?1/0:0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e}getLayersArray(t){return dg()}getLayerStatesArray(t){return dg()}getExtent(){return this.get(Rv)}getMaxResolution(){return this.get(Iv)}getMinResolution(){return this.get(Ov)}getMinZoom(){return this.get(Mv)}getMaxZoom(){return this.get(Lv)}getOpacity(){return this.get(Cv)}getSourceState(){return dg()}getVisible(){return this.get(Ev)}getZIndex(){return this.get(Pv)}setExtent(t){this.set(Rv,t)}setMaxResolution(t){this.set(Iv,t)}setMinResolution(t){this.set(Ov,t)}setMaxZoom(t){this.set(Lv,t)}setMinZoom(t){this.set(Mv,t)}setOpacity(t){wg("number"==typeof t,64),this.set(Cv,t)}setVisible(t){this.set(Ev,t)}setZIndex(t){this.set(Pv,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}},kv="prerender",Nv="postrender",jv="precompose",Dv="undefined",Gv="ready";var zv=class extends Av{constructor(t){const e=qg({},t);delete e.source,super(e),this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,t.render&&(this.render=t.render),t.map&&this.setMap(t.map),this.addEventListener(ly(Fv),this.handleSourcePropertyChange_);const r=t.source?t.source:null;this.setSource(r)}getLayersArray(t){const e=t||[];return e.push(this),e}getLayerStatesArray(t){const e=t||[];return e.push(this.getLayerState()),e}getSource(){return this.get(Fv)||null}getSourceState(){const t=this.getSource();return t?t.getState():Dv}handleSourceChange_(){this.changed()}handleSourcePropertyChange_(){this.sourceChangeKey_&&(iy(this.sourceChangeKey_),this.sourceChangeKey_=null);const t=this.getSource();t&&(this.sourceChangeKey_=ey(t,Jg,this.handleSourceChange_,this)),this.changed()}getFeatures(t){return this.renderer_.getFeatures(t)}render(t,e){const r=this.getRenderer();if(r.prepareFrame(t))return r.renderFrame(t,e)}setMap(t){this.mapPrecomposeKey_&&(iy(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(iy(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=ey(t,jv,(function(t){const e=t.frameState.layerStatesArray,r=this.getLayerState(!1);wg(!e.some((function(t){return t.layer===r.layer})),67),e.push(r)}),this),this.mapRenderKey_=ey(this,Jg,t.render,t),this.changed())}setSource(t){this.set(Fv,t)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){this.setSource(null),super.disposeInternal()}};var Bv=class{drawCustom(t,e,r){}drawGeometry(t){}setStyle(t){}drawCircle(t,e){}drawFeature(t,e){}drawGeometryCollection(t,e){}drawLineString(t,e){}drawMultiLineString(t,e){}drawMultiPoint(t,e){}drawMultiPolygon(t,e){}drawPoint(t,e){}drawPolygon(t,e){}drawText(t,e){}setFillStrokeStyle(t,e){}setImageStyle(t,e){}setTextStyle(t,e){}};const Uv=[1,0,0,1,0,0];var Yv=class extends uy{constructor(){super(),this.extent_=[1/0,1/0,-1/0,-1/0],this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=function(t){let e,r,i,n=!1;return function(){const o=Array.prototype.slice.call(arguments);return n&&this===i&&Vg(o,r)||(n=!0,i=this,r=o,e=t.apply(this,arguments)),e}}((function(t,e,r){if(!r)return this.getSimplifiedGeometry(e);const i=this.clone();return i.applyTransform(r),i.getSimplifiedGeometry(e)}))}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return dg()}closestPointXY(t,e,r,i){return dg()}containsXY(t,e){const r=this.getClosestPoint([t,e]);return r[0]===t&&r[1]===e}getClosestPoint(t,e){const r=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],r,1/0),r}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return dg()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const t=this.computeExtent(this.extent_);(isNaN(t[0])||isNaN(t[1]))&&Pm(t),this.extentRevision_=this.getRevision()}return function(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}(this.extent_,t)}rotate(t,e){dg()}scale(t,e,r){dg()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return dg()}getType(){return dg()}applyTransform(t){dg()}intersectsExtent(t){return dg()}translate(t,e){dg()}transform(t,e){const r=O_(t),i=r.getUnits()==u_.TILE_PIXELS?function(t,i,n){const o=r.getExtent(),s=r.getWorldExtent(),a=zm(s)/zm(o);return vy(Uv,s[0],s[3],a,-a,0,0,0),Y_(t,0,t.length,n,Uv,i),A_(r,e)(t,i,n)}:A_(r,e);return this.applyTransform(i),this}},Wv="XY",Vv="XYZ",Xv="XYM",qv="XYZM";function Zv(t){let e;return t==Wv?e=2:t==Vv||t==Xv?e=3:t==qv&&(e=4),e}var Kv=class extends Yv{constructor(){super(),this.layout=Wv,this.stride=2,this.flatCoordinates=null}computeExtent(t){return Om(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return dg()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getSimplifiedGeometryInternal(t){return this}getStride(){return this.stride}setFlatCoordinates(t,e){this.stride=Zv(t),this.layout=t,this.flatCoordinates=e}setCoordinates(t,e){dg()}setLayout(t,e,r){let i;if(t)i=Zv(t);else{for(let t=0;t<r;++t){if(0===e.length)return this.layout=Wv,void(this.stride=2);e=e[0]}i=e.length,t=function(t){let e;2==t?e=Wv:3==t?e=Vv:4==t&&(e=qv);return(e)}(i)}this.layout=t,this.stride=i}applyTransform(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())}rotate(t,e){const r=this.getFlatCoordinates();if(r){const i=this.getStride();W_(r,0,r.length,i,t,e,r),this.changed()}}scale(t,e,r){let i=e;void 0===i&&(i=t);let n=r;n||(n=Gm(this.getExtent()));const o=this.getFlatCoordinates();if(o){const e=this.getStride();!function(t,e,r,i,n,o,s,a){const l=a||[],u=s[0],h=s[1];let c=0;for(let s=e;s<r;s+=i){const e=t[s]-u,r=t[s+1]-h;l[c++]=u+n*e,l[c++]=h+o*r;for(let e=s+2;e<s+i;++e)l[c++]=t[e]}a&&l.length!=c&&(l.length=c)}(o,0,o.length,e,t,i,n,o),this.changed()}}translate(t,e){const r=this.getFlatCoordinates();if(r){const i=this.getStride();!function(t,e,r,i,n,o,s){const a=s||[];let l=0;for(let s=e;s<r;s+=i){a[l++]=t[s]+n,a[l++]=t[s+1]+o;for(let e=s+2;e<s+i;++e)a[l++]=t[e]}s&&a.length!=l&&(a.length=l)}(r,0,r.length,i,t,e,r),this.changed()}}};var Hv=class extends Bv{constructor(t,e,r,i,n,o,s){super(),this.context_=t,this.pixelRatio_=e,this.extent_=r,this.transform_=i,this.viewRotation_=n,this.squaredTolerance_=o,this.userTransform_=s,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=[0,0],this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=[0,0],this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=[1,0,0,1,0,0]}drawImages_(t,e,r,i){if(!this.image_)return;const n=Y_(t,e,r,2,this.transform_,this.pixelCoordinates_),o=this.context_,s=this.tmpLocalTransform_,a=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=a*this.imageOpacity_);let l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(let t=0,e=n.length;t<e;t+=2){const e=n[t]-this.imageAnchorX_,r=n[t+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){const t=e+this.imageAnchorX_,i=r+this.imageAnchorY_;vy(s,t,i,1,1,l,-t,-i),o.setTransform.apply(o,s),o.translate(t,i),o.scale(this.imageScale_[0],this.imageScale_[1]),o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),o.setTransform(1,0,0,1,0,0)}else o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,e,r,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(o.globalAlpha=a)}drawText_(t,e,r,i){if(!this.textState_||""===this.text_)return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);const n=Y_(t,e,r,i,this.transform_,this.pixelCoordinates_),o=this.context_;let s=this.textRotation_;for(this.textRotateWithView_&&(s+=this.viewRotation_);e<r;e+=i){const t=n[e]+this.textOffsetX_,r=n[e+1]+this.textOffsetY_;if(0!==s||1!=this.textScale_[0]||1!=this.textScale_[1]){const e=vy(this.tmpLocalTransform_,t,r,1,1,s,-t,-r);o.setTransform.apply(o,e),o.translate(t,r),o.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&o.strokeText(this.text_,0,0),this.textFillState_&&o.fillText(this.text_,0,0),o.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&o.strokeText(this.text_,t,r),this.textFillState_&&o.fillText(this.text_,t,r)}}moveToLineTo_(t,e,r,i,n){const o=this.context_,s=Y_(t,e,r,i,this.transform_,this.pixelCoordinates_);o.moveTo(s[0],s[1]);let a=s.length;n&&(a-=2);for(let t=2;t<a;t+=2)o.lineTo(s[t],s[t+1]);return n&&o.closePath(),r}drawRings_(t,e,r,i){for(let n=0,o=r.length;n<o;++n)e=this.moveToLineTo_(t,e,r[n],i,!0);return e}drawCircle(t){if(Vm(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=function(t,e,r){const i=t.getFlatCoordinates();if(i){const n=t.getStride();return Y_(i,0,i.length,n,e,r)}return null}(t,this.transform_,this.pixelCoordinates_),r=e[2]-e[0],i=e[3]-e[1],n=Math.sqrt(r*r+i*i),o=this.context_;o.beginPath(),o.arc(e[0],e[1],n,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}}setStyle(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())}setTransform(t){this.transform_=t}drawGeometry(t){switch(t.getType()){case Yy:this.drawPoint(t);break;case Wy:this.drawLineString(t);break;case Xy:this.drawPolygon(t);break;case qy:this.drawMultiPoint(t);break;case Zy:this.drawMultiLineString(t);break;case Ky:this.drawMultiPolygon(t);break;case Hy:this.drawGeometryCollection(t);break;case Jy:this.drawCircle(t)}}drawFeature(t,e){const r=e.getGeometryFunction()(t);r&&Vm(this.extent_,r.getExtent())&&(this.setStyle(e),this.drawGeometry(r))}drawGeometryCollection(t){const e=t.getGeometriesArray();for(let t=0,r=e.length;t<r;++t)this.drawGeometry(e[t])}drawPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),r=t.getStride();this.image_&&this.drawImages_(e,0,e.length,r),""!==this.text_&&this.drawText_(e,0,e.length,r)}drawMultiPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),r=t.getStride();this.image_&&this.drawImages_(e,0,e.length,r),""!==this.text_&&this.drawText_(e,0,e.length,r)}drawLineString(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Vm(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const e=this.context_,r=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(r,0,r.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){const e=t.getFlatMidpoint();this.drawText_(e,0,2,2)}}}drawMultiLineString(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getExtent();if(Vm(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const e=this.context_,r=t.getFlatCoordinates();let i=0;const n=t.getEnds(),o=t.getStride();e.beginPath();for(let t=0,e=n.length;t<e;++t)i=this.moveToLineTo_(r,i,n[t],o,!1);e.stroke()}if(""!==this.text_){const e=t.getFlatMidpoints();this.drawText_(e,0,e.length,2)}}}drawPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Vm(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){const e=t.getFlatInteriorPoint();this.drawText_(e,0,2,2)}}}drawMultiPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Vm(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=this.context_,r=t.getOrientedFlatCoordinates();let i=0;const n=t.getEndss(),o=t.getStride();e.beginPath();for(let t=0,e=n.length;t<e;++t){const e=n[t];i=this.drawRings_(r,i,e,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){const e=t.getFlatInteriorPoints();this.drawText_(e,0,e.length,2)}}}setContextFillState_(t){const e=this.context_,r=this.contextFillState_;r?r.fillStyle!=t.fillStyle&&(r.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})}setContextStrokeState_(t){const e=this.context_,r=this.contextStrokeState_;r?(r.lineCap!=t.lineCap&&(r.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(Vg(r.lineDash,t.lineDash)||e.setLineDash(r.lineDash=t.lineDash),r.lineDashOffset!=t.lineDashOffset&&(r.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),r.lineJoin!=t.lineJoin&&(r.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),r.lineWidth!=t.lineWidth&&(r.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),r.miterLimit!=t.miterLimit&&(r.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),r.strokeStyle!=t.strokeStyle&&(r.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})}setContextTextState_(t){const e=this.context_,r=this.contextTextState_,i=t.textAlign?t.textAlign:"center";r?(r.font!=t.font&&(r.font=t.font,e.font=t.font),r.textAlign!=i&&(r.textAlign=i,e.textAlign=i),r.textBaseline!=t.textBaseline&&(r.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=i,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:i,textBaseline:t.textBaseline})}setFillStrokeStyle(t,e){if(t){const e=t.getColor();this.fillState_={fillStyle:Ag(e||"#000")}}else this.fillState_=null;if(e){const t=e.getColor(),r=e.getLineCap(),i=e.getLineDash(),n=e.getLineDashOffset(),o=e.getLineJoin(),s=e.getWidth(),a=e.getMiterLimit();this.strokeState_={lineCap:void 0!==r?r:"round",lineDash:i||by,lineDashOffset:n||0,lineJoin:void 0!==o?o:"round",lineWidth:this.pixelRatio_*(void 0!==s?s:1),miterLimit:void 0!==a?a:10,strokeStyle:Ag(t||"#000")}}else this.strokeState_=null}setImageStyle(t){if(t){const e=t.getSize();if(e){const r=t.getAnchor(),i=t.getImage(1),n=t.getOrigin(),o=t.getScaleArray();this.imageAnchorX_=r[0],this.imageAnchorY_=r[1],this.imageHeight_=e[1],this.image_=i,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=n[0],this.imageOriginY_=n[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=[this.pixelRatio_*o[0],this.pixelRatio_*o[1]],this.imageWidth_=e[0]}else this.image_=null}else this.image_=null}setTextStyle(t){if(t){const e=t.getFill();if(e){const t=e.getColor();this.textFillState_={fillStyle:Ag(t||"#000")}}else this.textFillState_=null;const r=t.getStroke();if(r){const t=r.getColor(),e=r.getLineCap(),i=r.getLineDash(),n=r.getLineDashOffset(),o=r.getLineJoin(),s=r.getWidth(),a=r.getMiterLimit();this.textStrokeState_={lineCap:void 0!==e?e:"round",lineDash:i||by,lineDashOffset:n||0,lineJoin:void 0!==o?o:"round",lineWidth:void 0!==s?s:1,miterLimit:void 0!==a?a:10,strokeStyle:Ag(t||"#000")}}else this.textStrokeState_=null;const i=t.getFont(),n=t.getOffsetX(),o=t.getOffsetY(),s=t.getRotateWithView(),a=t.getRotation(),l=t.getScaleArray(),u=t.getText(),h=t.getTextAlign(),c=t.getTextBaseline();this.textState_={font:void 0!==i?i:"10px sans-serif",textAlign:void 0!==h?h:"center",textBaseline:void 0!==c?c:"middle"},this.text_=void 0!==u?u:"",this.textOffsetX_=void 0!==n?this.pixelRatio_*n:0,this.textOffsetY_=void 0!==o?this.pixelRatio_*o:0,this.textRotateWithView_=void 0!==s&&s,this.textRotation_=void 0!==a?a:0,this.textScale_=[this.pixelRatio_*l[0],this.pixelRatio_*l[1]]}else this.text_=""}},Jv="Circle",$v="Default",Qv="Image",tx="LineString",ex="Polygon",rx="Text";const ix={Point:function(t,e,r,i){const n=r.getImage();if(n){if(n.getImageState()!=cg)return;const o=t.getBuilder(r.getZIndex(),Qv);o.setImageStyle(n,t.addDeclutter(!1)),o.drawPoint(e,i)}const o=r.getText();if(o){const s=t.getBuilder(r.getZIndex(),rx);s.setTextStyle(o,t.addDeclutter(!!n)),s.drawText(e,i)}},LineString:function(t,e,r,i){const n=r.getStroke();if(n){const o=t.getBuilder(r.getZIndex(),tx);o.setFillStrokeStyle(null,n),o.drawLineString(e,i)}const o=r.getText();if(o){const n=t.getBuilder(r.getZIndex(),rx);n.setTextStyle(o,t.addDeclutter(!1)),n.drawText(e,i)}},Polygon:function(t,e,r,i){const n=r.getFill(),o=r.getStroke();if(n||o){const s=t.getBuilder(r.getZIndex(),ex);s.setFillStrokeStyle(n,o),s.drawPolygon(e,i)}const s=r.getText();if(s){const n=t.getBuilder(r.getZIndex(),rx);n.setTextStyle(s,t.addDeclutter(!1)),n.drawText(e,i)}},MultiPoint:function(t,e,r,i){const n=r.getImage();if(n){if(n.getImageState()!=cg)return;const o=t.getBuilder(r.getZIndex(),Qv);o.setImageStyle(n,t.addDeclutter(!1)),o.drawMultiPoint(e,i)}const o=r.getText();if(o){const s=t.getBuilder(r.getZIndex(),rx);s.setTextStyle(o,t.addDeclutter(!!n)),s.drawText(e,i)}},MultiLineString:function(t,e,r,i){const n=r.getStroke();if(n){const o=t.getBuilder(r.getZIndex(),tx);o.setFillStrokeStyle(null,n),o.drawMultiLineString(e,i)}const o=r.getText();if(o){const n=t.getBuilder(r.getZIndex(),rx);n.setTextStyle(o,t.addDeclutter(!1)),n.drawText(e,i)}},MultiPolygon:function(t,e,r,i){const n=r.getFill(),o=r.getStroke();if(o||n){const s=t.getBuilder(r.getZIndex(),ex);s.setFillStrokeStyle(n,o),s.drawMultiPolygon(e,i)}const s=r.getText();if(s){const n=t.getBuilder(r.getZIndex(),rx);n.setTextStyle(s,t.addDeclutter(!1)),n.drawText(e,i)}},GeometryCollection:function(t,e,r,i){const n=e.getGeometriesArray();let o,s;for(o=0,s=n.length;o<s;++o){(0,ix[n[o].getType()])(t,n[o],r,i)}},Circle:function(t,e,r,i){const n=r.getFill(),o=r.getStroke();if(n||o){const s=t.getBuilder(r.getZIndex(),Jv);s.setFillStrokeStyle(n,o),s.drawCircle(e,i)}const s=r.getText();if(s){const n=t.getBuilder(r.getZIndex(),rx);n.setTextStyle(s,t.addDeclutter(!1)),n.drawText(e,i)}}};function nx(t,e){return parseInt(gg(t),10)-parseInt(gg(e),10)}function ox(t,e){const r=sx(t,e);return r*r}function sx(t,e){return.5*t/e}function ax(t,e,r,i,n,o){let s=!1;const a=r.getImage();if(a){let t=a.getImageState();t==cg||t==pg?a.unlistenImageChange(n):(t==ug&&a.load(),t=a.getImageState(),a.listenImageChange(n),s=!0)}return function(t,e,r,i,n){const o=r.getGeometryFunction()(e);if(!o)return;const s=o.simplifyTransformed(i,n);if(r.getRenderer())!function t(e,r,i,n){if(r.getType()==Hy){const o=r.getGeometries();for(let r=0,s=o.length;r<s;++r)t(e,o[r],i,n);return}e.getBuilder(i.getZIndex(),$v).drawCustom(r,n,i.getRenderer())}(t,s,r,e);else{(0,ix[s.getType()])(t,s,r,e)}}(t,e,r,i,o),s}var lx=class extends Gg{constructor(t,e,r,i){super(t),this.inversePixelTransform=e,this.frameState=r,this.context=i}};var ux=0,hx=2,cx=3,px=4;var dx=0,fx=1;function gx(t,e,r,i,n,o,s){const a=t[e],l=t[e+1],u=t[r]-a,h=t[r+1]-l;let c;if(0===u&&0===h)c=e;else{const p=((n-a)*u+(o-l)*h)/(u*u+h*h);if(p>1)c=r;else{if(p>0){for(let n=0;n<i;++n)s[n]=Eg(t[e+n],t[r+n],p);return void(s.length=i)}c=e}}for(let e=0;e<i;++e)s[e]=t[c+e];s.length=i}function yx(t,e,r,i,n){let o=t[e],s=t[e+1];for(e+=i;e<r;e+=i){const r=t[e],i=t[e+1],a=Cg(o,s,r,i);a>n&&(n=a),o=r,s=i}return n}function mx(t,e,r,i,n){for(let o=0,s=r.length;o<s;++o){const s=r[o];n=yx(t,e,s,i,n),e=s}return n}function _x(t,e,r,i,n,o,s,a,l,u,h){if(e==r)return u;let c,p;if(0===n){if(p=Cg(s,a,t[e],t[e+1]),p<u){for(c=0;c<i;++c)l[c]=t[e+c];return l.length=i,p}return u}const d=h||[NaN,NaN];let f=e+i;for(;f<r;)if(gx(t,f-i,f,i,s,a,d),p=Cg(s,a,d[0],d[1]),p<u){for(u=p,c=0;c<i;++c)l[c]=d[c];l.length=i,f+=i}else f+=i*Math.max((Math.sqrt(p)-Math.sqrt(u))/n|0,1);if(o&&(gx(t,r-i,e,i,s,a,d),p=Cg(s,a,d[0],d[1]),p<u)){for(u=p,c=0;c<i;++c)l[c]=d[c];l.length=i}return u}function vx(t,e,r,i,n,o,s,a,l,u,h){const c=h||[NaN,NaN];for(let h=0,p=r.length;h<p;++h){const p=r[h];u=_x(t,e,p,i,n,o,s,a,l,u,c),e=p}return u}function xx(t,e,r,i){for(let n=0,o=r.length;n<o;++n){const o=r[n];for(let r=0;r<i;++r)t[e++]=o[r]}return e}function wx(t,e,r,i,n){const o=n||[];let s=0;for(let n=0,a=r.length;n<a;++n){const a=xx(t,e,r[n],i);o[s++]=a,e=a}return o.length=s,o}function bx(t,e,r,i,n,o,s){const a=(r-e)/i;if(a<3){for(;e<r;e+=i)o[s++]=t[e],o[s++]=t[e+1];return s}const l=new Array(a);l[0]=1,l[a-1]=1;const u=[e,r-i];let h=0;for(;u.length>0;){const r=u.pop(),o=u.pop();let s=0;const a=t[o],c=t[o+1],p=t[r],d=t[r+1];for(let e=o+i;e<r;e+=i){const r=Tg(t[e],t[e+1],a,c,p,d);r>s&&(h=e,s=r)}s>n&&(l[(h-e)/i]=1,o+i<h&&u.push(o,h),h+i<r&&u.push(h,r))}for(let r=0;r<a;++r)l[r]&&(o[s++]=t[e+r*i],o[s++]=t[e+r*i+1]);return s}function Sx(t,e,r,i,n,o,s,a){for(let l=0,u=r.length;l<u;++l){const u=r[l];s=bx(t,e,u,i,n,o,s),a.push(s),e=u}return s}function Tx(t,e){return e*Math.round(t/e)}function Cx(t,e,r,i,n,o,s){if(e==r)return s;let a,l,u=Tx(t[e],n),h=Tx(t[e+1],n);e+=i,o[s++]=u,o[s++]=h;do{if(a=Tx(t[e],n),l=Tx(t[e+1],n),(e+=i)==r)return o[s++]=a,o[s++]=l,s}while(a==u&&l==h);for(;e<r;){const r=Tx(t[e],n),c=Tx(t[e+1],n);if(e+=i,r==a&&c==l)continue;const p=a-u,d=l-h,f=r-u,g=c-h;p*g==d*f&&(p<0&&f<p||p==f||p>0&&f>p)&&(d<0&&g<d||d==g||d>0&&g>d)?(a=r,l=c):(o[s++]=a,o[s++]=l,u=a,h=l,a=r,l=c)}return o[s++]=a,o[s++]=l,s}function Ex(t,e,r,i,n,o,s,a){for(let l=0,u=r.length;l<u;++l){const u=r[l];s=Cx(t,e,u,i,n,o,s),a.push(s),e=u}return s}function Rx(t,e,r,i,n){const o=void 0!==n?n:[];let s=0;for(let n=e;n<r;n+=i)o[s++]=t.slice(n,n+i);return o.length=s,o}function Px(t,e,r,i,n){const o=void 0!==n?n:[];let s=0;for(let n=0,a=r.length;n<a;++n){const a=r[n];o[s++]=Rx(t,e,a,i,o[s]),e=a}return o.length=s,o}function Ix(t,e,r,i,n){const o=void 0!==n?n:[];let s=0;for(let n=0,a=r.length;n<a;++n){const a=r[n];o[s++]=Px(t,e,a,i,o[s]),e=a[a.length-1]}return o.length=s,o}function Ox(t,e,r,i){let n=0,o=t[r-i],s=t[r-i+1];for(;e<r;e+=i){const r=t[e],i=t[e+1];n+=s*r-o*i,o=r,s=i}return n/2}function Lx(t,e,r,i){let n=0;for(let o=0,s=r.length;o<s;++o){const s=r[o];n+=Ox(t,e,s,i),e=s}return n}class Mx extends Kv{constructor(t,e){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===e||Array.isArray(t[0])?this.setCoordinates(t,e):this.setFlatCoordinates(e,t)}clone(){return new Mx(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,r,i){return i<bm(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(yx(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),_x(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,r,i))}getArea(){return Ox(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return Rx(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const e=[];return e.length=bx(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new Mx(e,Wv)}getType(){return Vy}intersectsExtent(t){return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=xx(this.flatCoordinates,0,t,this.stride),this.changed()}}var Fx=Mx;class Ax extends Kv{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){return new Ax(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,r,i){const n=this.flatCoordinates,o=Cg(t,e,n[0],n[1]);if(o<i){const t=this.stride;for(let e=0;e<t;++e)r[e]=n[e];return r.length=t,o}return i}getCoordinates(){return this.flatCoordinates?this.flatCoordinates.slice():[]}computeExtent(t){return Im(this.flatCoordinates,t)}getType(){return Yy}intersectsExtent(t){return Cm(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=function(t,e,r,i){for(let i=0,n=r.length;i<n;++i)t[e++]=r[i];return e}(this.flatCoordinates,0,t,this.stride),this.changed()}}var kx=Ax;function Nx(t,e,r,i,n){const o=[t[e],t[e+1]],s=[];let a;for(;e+i<r;e+=i){if(s[0]=t[e+i],s[1]=t[e+i+1],a=n(o,s),a)return a;o[0]=s[0],o[1]=s[1]}return!1}function jx(t,e,r,i,n){const o=Am([1/0,1/0,-1/0,-1/0],t,e,r,i);return!!Vm(n,o)&&(!!Tm(n,o)||(o[0]>=n[0]&&o[2]<=n[2]||(o[1]>=n[1]&&o[3]<=n[3]||Nx(t,e,r,i,(function(t,e){return function(t,e,r){let i=!1;const n=Em(t,e),o=Em(t,r);if(n===gm||o===gm)i=!0;else{const s=t[0],a=t[1],l=t[2],u=t[3],h=e[0],c=e[1],p=r[0],d=r[1],f=(d-c)/(p-h);let g,y;o&ym&&!(n&ym)&&(g=p-(d-u)/f,i=g>=s&&g<=l),i||!(o&mm)||n&mm||(y=d-(p-l)*f,i=y>=a&&y<=u),i||!(o&_m)||n&_m||(g=p-(d-a)/f,i=g>=s&&g<=l),i||!(o&vm)||n&vm||(y=d-(p-s)*f,i=y>=a&&y<=u)}return i}(n,t,e)})))))}function Dx(t,e,r,i,n){if(!function(t,e,r,i,n){return!!jx(t,e,r,i,n)||(!!i_(t,e,r,i,n[0],n[1])||(!!i_(t,e,r,i,n[0],n[3])||(!!i_(t,e,r,i,n[2],n[1])||!!i_(t,e,r,i,n[2],n[3]))))}(t,e,r[0],i,n))return!1;if(1===r.length)return!0;for(let e=1,o=r.length;e<o;++e)if(r_(t,r[e-1],r[e],i,n)&&!jx(t,r[e-1],r[e],i,n))return!1;return!0}function Gx(t,e,r,i){for(;e<r-i;){for(let n=0;n<i;++n){const o=t[e+n];t[e+n]=t[r-i+n],t[r-i+n]=o}e+=i,r-=i}}function zx(t,e,r,i){let n=!0;for(let o=0;o<i;++o)if(t[e+o]!==t[r-i+o]){n=!1;break}n&&(r-=i);const o=function(t,e,r,i){let n=-1,o=1/0,s=1/0;for(let a=e;a<r;a+=i){const e=t[a],r=t[a+1];r>o||(r==o&&e>=s||(n=a,o=r,s=e))}return n}(t,e,r,i);let s=o-i;s<e&&(s=r-i);let a=o+i;a>=r&&(a=e);const l=t[s],u=t[s+1],h=t[o],c=t[o+1],p=t[a],d=t[a+1];return h*d+l*c+u*p-(u*h+c*p+l*d)<0}function Bx(t,e,r,i,n){const o=void 0!==n&&n;for(let n=0,s=r.length;n<s;++n){const s=r[n],a=zx(t,e,s,i);if(0===n){if(o&&a||!o&&!a)return!1}else if(o&&!a||!o&&a)return!1;e=s}return!0}function Ux(t,e,r,i,n){const o=void 0!==n&&n;for(let n=0,s=r.length;n<s;++n){const s=r[n],a=zx(t,e,s,i);(0===n?o&&a||!o&&!a:o&&!a||!o&&a)&&Gx(t,e,s,i),e=s}return e}function Yx(t,e,r,i,n){for(let o=0,s=r.length;o<s;++o)e=Ux(t,e,r[o],i,n);return e}class Wx extends Kv{constructor(t,e,r){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,void 0!==e&&r?(this.setFlatCoordinates(e,t),this.ends_=r):this.setCoordinates(t,e)}appendLinearRing(t){this.flatCoordinates?Wg(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){return new Wx(this.flatCoordinates.slice(),this.layout,this.ends_.slice())}closestPointXY(t,e,r,i){return i<bm(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(mx(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),vx(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,r,i))}containsXY(t,e){return n_(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)}getArea(){return Lx(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let e;return void 0!==t?(e=this.getOrientedFlatCoordinates().slice(),Ux(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,Px(e,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=Gm(this.getExtent());this.flatInteriorPoint_=o_(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new kx(this.getFlatInteriorPoint(),Xv)}getLinearRingCount(){return this.ends_.length}getLinearRing(t){return t<0||this.ends_.length<=t?null:new Fx(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLinearRings(){const t=this.layout,e=this.flatCoordinates,r=this.ends_,i=[];let n=0;for(let o=0,s=r.length;o<s;++o){const s=r[o],a=new Fx(e.slice(n,s),t);i.push(a),n=s}return i}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;Bx(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Ux(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],r=[];return e.length=Ex(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,r),new Wx(e,Wv,r)}getType(){return Xy}intersectsExtent(t){return Dx(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const r=wx(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===r.length?0:r[r.length-1],this.changed()}}var Vx=Wx;class Xx extends uy{constructor(t){if(super(),this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addEventListener(ly(this.geometryName_),this.handleGeometryChanged_),t)if("function"==typeof t.getSimplifiedGeometry){const e=t;this.setGeometry(e)}else{const e=t;this.setProperties(e)}}clone(){const t=new Xx(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());const e=this.getGeometry();e&&t.setGeometry(e.clone());const r=this.getStyle();return r&&t.setStyle(r),t}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(iy(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=ey(t,Jg,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?function(t){if("function"==typeof t)return t;{let e;if(Array.isArray(t))e=t;else{wg("function"==typeof t.getZIndex,41),e=[t]}return function(){return e}}}(t):void 0,this.changed()}setId(t){this.id_=t,this.changed()}setGeometryName(t){this.removeEventListener(ly(this.geometryName_),this.handleGeometryChanged_),this.geometryName_=t,this.addEventListener(ly(this.geometryName_),this.handleGeometryChanged_),this.handleGeometryChanged_()}}var qx=Xx;class Zx extends Yv{constructor(t){super(),this.geometries_=t||null,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(iy),this.changeEventsKeys_.length=0}listenGeometriesChange_(){if(this.geometries_)for(let t=0,e=this.geometries_.length;t<e;++t)this.changeEventsKeys_.push(ey(this.geometries_[t],Jg,this.changed,this))}clone(){const t=new Zx(null);return t.setGeometries(this.geometries_),t}closestPointXY(t,e,r,i){if(i<bm(this.getExtent(),t,e))return i;const n=this.geometries_;for(let o=0,s=n.length;o<s;++o)i=n[o].closestPointXY(t,e,r,i);return i}containsXY(t,e){const r=this.geometries_;for(let i=0,n=r.length;i<n;++i)if(r[i].containsXY(t,e))return!0;return!1}computeExtent(t){Pm(t);const e=this.geometries_;for(let r=0,i=e.length;r<i;++r)Mm(t,e[r].getExtent());return t}getGeometries(){return Kx(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let t=[];const e=this.geometries_;for(let r=0,i=e.length;r<i;++r)e[r].getType()===this.getType()?t=t.concat(e[r].getGeometriesArrayRecursive()):t.push(e[r]);return t}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=[],r=this.geometries_;let i=!1;for(let n=0,o=r.length;n<o;++n){const o=r[n],s=o.getSimplifiedGeometry(t);e.push(s),s!==o&&(i=!0)}if(i){const t=new Zx(null);return t.setGeometriesArray(e),t}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this}getType(){return Hy}intersectsExtent(t){const e=this.geometries_;for(let r=0,i=e.length;r<i;++r)if(e[r].intersectsExtent(t))return!0;return!1}isEmpty(){return 0===this.geometries_.length}rotate(t,e){const r=this.geometries_;for(let i=0,n=r.length;i<n;++i)r[i].rotate(t,e);this.changed()}scale(t,e,r){let i=r;i||(i=Gm(this.getExtent()));const n=this.geometries_;for(let r=0,o=n.length;r<o;++r)n[r].scale(t,e,i);this.changed()}setGeometries(t){this.setGeometriesArray(Kx(t))}setGeometriesArray(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()}applyTransform(t){const e=this.geometries_;for(let r=0,i=e.length;r<i;++r)e[r].applyTransform(t);this.changed()}translate(t,e){const r=this.geometries_;for(let i=0,n=r.length;i<n;++i)r[i].translate(t,e);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}}function Kx(t){const e=[];for(let r=0,i=t.length;r<i;++r)e.push(t[r].clone());return e}var Hx=Zx;var Jx=class{constructor(){this.dataProjection=null,this.defaultFeatureProjection=null}getReadOptions(t,e){let r;if(e){let i=e.dataProjection?O_(e.dataProjection):this.readProjection(t);e.extent&&i&&i.getUnits()===u_.TILE_PIXELS&&(i=O_(i),i.setWorldExtent(e.extent)),r={dataProjection:i,featureProjection:e.featureProjection}}return this.adaptOptions(r)}adaptOptions(t){return qg({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)}getType(){return dg()}readFeature(t,e){return dg()}readFeatures(t,e){return dg()}readGeometry(t,e){return dg()}readProjection(t){return dg()}writeFeature(t,e){return dg()}writeFeatures(t,e){return dg()}writeGeometry(t,e){return dg()}};function $x(t,e,r){const i=r?O_(r.featureProjection):null,n=r?O_(r.dataProjection):null;let o;if(o=i&&n&&!M_(i,n)?(e?t.clone():t).transform(e?i:n,e?n:i):t,e&&r&&void 0!==r.decimals){const e=Math.pow(10,r.decimals),i=function(t){for(let r=0,i=t.length;r<i;++r)t[r]=Math.round(t[r]*e)/e;return t};o===t&&(o=t.clone()),o.applyTransform(i)}return o}var Qx="json";function tw(t){if("string"==typeof t){const e=JSON.parse(t);return e||null}return null!==t?t:null}var ew=class extends Jx{constructor(){super()}getType(){return Qx}readFeature(t,e){return this.readFeatureFromObject(tw(t),this.getReadOptions(t,e))}readFeatures(t,e){return this.readFeaturesFromObject(tw(t),this.getReadOptions(t,e))}readFeatureFromObject(t,e){return dg()}readFeaturesFromObject(t,e){return dg()}readGeometry(t,e){return this.readGeometryFromObject(tw(t),this.getReadOptions(t,e))}readGeometryFromObject(t,e){return dg()}readProjection(t){return this.readProjectionFromObject(tw(t))}readProjectionFromObject(t){return dg()}writeFeature(t,e){return JSON.stringify(this.writeFeatureObject(t,e))}writeFeatureObject(t,e){return dg()}writeFeatures(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))}writeFeaturesObject(t,e){return dg()}writeGeometry(t,e){return JSON.stringify(this.writeGeometryObject(t,e))}writeGeometryObject(t,e){return dg()}};function rw(t,e,r,i){let n=t[e],o=t[e+1],s=0;for(let a=e+i;a<r;a+=i){const e=t[a],r=t[a+1];s+=Math.sqrt((e-n)*(e-n)+(r-o)*(r-o)),n=e,o=r}return s}class iw extends Kv{constructor(t,e){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===e||Array.isArray(t[0])?this.setCoordinates(t,e):this.setFlatCoordinates(e,t)}appendCoordinate(t){this.flatCoordinates?Wg(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()}clone(){return new iw(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,r,i){return i<bm(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(yx(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),_x(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,r,i))}forEachSegment(t){return Nx(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinateAtM(t,e){if(this.layout!=Xv&&this.layout!=qv)return null;const r=void 0!==e&&e;return B_(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r)}getCoordinates(){return Rx(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(t,e){return z_(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)}getLength(){return rw(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(t){const e=[];return e.length=bx(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new iw(e,Wv)}getType(){return Wy}intersectsExtent(t){return jx(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=xx(this.flatCoordinates,0,t,this.stride),this.changed()}}var nw=iw;class ow extends Kv{constructor(t,e,r){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(t[0]))this.setCoordinates(t,e);else if(void 0!==e&&r)this.setFlatCoordinates(e,t),this.ends_=r;else{let e=this.getLayout();const r=t,i=[],n=[];for(let t=0,o=r.length;t<o;++t){const o=r[t];0===t&&(e=o.getLayout()),Wg(i,o.getFlatCoordinates()),n.push(i.length)}this.setFlatCoordinates(e,i),this.ends_=n}}appendLineString(t){this.flatCoordinates?Wg(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){return new ow(this.flatCoordinates.slice(),this.layout,this.ends_.slice())}closestPointXY(t,e,r,i){return i<bm(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(mx(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),vx(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,r,i))}getCoordinateAtM(t,e,r){if(this.layout!=Xv&&this.layout!=qv||0===this.flatCoordinates.length)return null;const i=void 0!==e&&e,n=void 0!==r&&r;return function(t,e,r,i,n,o,s){if(s)return B_(t,e,r[r.length-1],i,n,o);let a;if(n<t[i-1])return o?(a=t.slice(0,i),a[i-1]=n,a):null;if(t[t.length-1]<n)return o?(a=t.slice(t.length-i),a[i-1]=n,a):null;for(let o=0,s=r.length;o<s;++o){const s=r[o];if(e!=s){if(n<t[e+i-1])return null;if(n<=t[s-1])return B_(t,e,s,i,n,!1);e=s}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,i,n)}getCoordinates(){return Px(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(t){return t<0||this.ends_.length<=t?null:new nw(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLineStrings(){const t=this.flatCoordinates,e=this.ends_,r=this.layout,i=[];let n=0;for(let o=0,s=e.length;o<s;++o){const s=e[o],a=new nw(t.slice(n,s),r);i.push(a),n=s}return i}getFlatMidpoints(){const t=[],e=this.flatCoordinates;let r=0;const i=this.ends_,n=this.stride;for(let o=0,s=i.length;o<s;++o){const s=i[o];Wg(t,z_(e,r,s,n,.5)),r=s}return t}getSimplifiedGeometryInternal(t){const e=[],r=[];return e.length=Sx(this.flatCoordinates,0,this.ends_,this.stride,t,e,0,r),new ow(e,Wv,r)}getType(){return Zy}intersectsExtent(t){return function(t,e,r,i,n){for(let o=0,s=r.length;o<s;++o){if(jx(t,e,r[o],i,n))return!0;e=r[o]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const r=wx(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===r.length?0:r[r.length-1],this.changed()}}var sw=ow;class aw extends Kv{constructor(t,e){super(),e&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendPoint(t){this.flatCoordinates?Wg(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()}clone(){return new aw(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,r,i){if(i<bm(this.getExtent(),t,e))return i;const n=this.flatCoordinates,o=this.stride;for(let s=0,a=n.length;s<a;s+=o){const a=Cg(t,e,n[s],n[s+1]);if(a<i){i=a;for(let t=0;t<o;++t)r[t]=n[s+t];r.length=o}}return i}getCoordinates(){return Rx(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(t){const e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new kx(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)}getPoints(){const t=this.flatCoordinates,e=this.layout,r=this.stride,i=[];for(let n=0,o=t.length;n<o;n+=r){const o=new kx(t.slice(n,n+r),e);i.push(o)}return i}getType(){return qy}intersectsExtent(t){const e=this.flatCoordinates,r=this.stride;for(let i=0,n=e.length;i<n;i+=r){if(Cm(t,e[i],e[i+1]))return!0}return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=xx(this.flatCoordinates,0,t,this.stride),this.changed()}}var lw=aw;class uw extends Kv{constructor(t,e,r){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!r&&!Array.isArray(t[0])){let i=this.getLayout();const n=t,o=[],s=[];for(let t=0,e=n.length;t<e;++t){const e=n[t];0===t&&(i=e.getLayout());const r=o.length,a=e.getEnds();for(let t=0,e=a.length;t<e;++t)a[t]+=r;Wg(o,e.getFlatCoordinates()),s.push(a)}e=i,t=o,r=s}void 0!==e&&r?(this.setFlatCoordinates(e,t),this.endss_=r):this.setCoordinates(t,e)}appendPolygon(t){let e;if(this.flatCoordinates){const r=this.flatCoordinates.length;Wg(this.flatCoordinates,t.getFlatCoordinates()),e=t.getEnds().slice();for(let t=0,i=e.length;t<i;++t)e[t]+=r}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()}clone(){const t=this.endss_.length,e=new Array(t);for(let r=0;r<t;++r)e[r]=this.endss_[r].slice();return new uw(this.flatCoordinates.slice(),this.layout,e)}closestPointXY(t,e,r,i){return i<bm(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,r,i,n){for(let o=0,s=r.length;o<s;++o){const s=r[o];n=mx(t,e,s,i,n),e=s[s.length-1]}return n}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,r,i,n,o,s,a,l,u,h){const c=h||[NaN,NaN];for(let h=0,p=r.length;h<p;++h){const p=r[h];u=vx(t,e,p,i,n,o,s,a,l,u,c),e=p[p.length-1]}return u}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,r,i))}containsXY(t,e){return function(t,e,r,i,n,o){if(0===r.length)return!1;for(let s=0,a=r.length;s<a;++s){const a=r[s];if(n_(t,e,a,i,n,o))return!0;e=a[a.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)}getArea(){return function(t,e,r,i){let n=0;for(let o=0,s=r.length;o<s;++o){const s=r[o];n+=Lx(t,e,s,i),e=s[s.length-1]}return n}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(t){let e;return void 0!==t?(e=this.getOrientedFlatCoordinates().slice(),Yx(e,0,this.endss_,this.stride,t)):e=this.flatCoordinates,Ix(e,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const t=U_(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=s_(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new lw(this.getFlatInteriorPoints().slice(),Xv)}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;!function(t,e,r,i,n){for(let o=0,s=r.length;o<s;++o){const s=r[o];if(!Bx(t,e,s,i,n))return!1;s.length&&(e=s[s.length-1])}return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Yx(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],r=[];return e.length=function(t,e,r,i,n,o,s,a){for(let l=0,u=r.length;l<u;++l){const u=r[l],h=[];s=Ex(t,e,u,i,n,o,s,h),a.push(h),e=u[u.length-1]}return s}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),e,0,r),new uw(e,Wv,r)}getPolygon(t){if(t<0||this.endss_.length<=t)return null;let e;if(0===t)e=0;else{const r=this.endss_[t-1];e=r[r.length-1]}const r=this.endss_[t].slice(),i=r[r.length-1];if(0!==e)for(let t=0,i=r.length;t<i;++t)r[t]-=e;return new Vx(this.flatCoordinates.slice(e,i),this.layout,r)}getPolygons(){const t=this.layout,e=this.flatCoordinates,r=this.endss_,i=[];let n=0;for(let o=0,s=r.length;o<s;++o){const s=r[o].slice(),a=s[s.length-1];if(0!==n)for(let t=0,e=s.length;t<e;++t)s[t]-=n;const l=new Vx(e.slice(n,a),t,s);i.push(l),n=a}return i}getType(){return Ky}intersectsExtent(t){return function(t,e,r,i,n){for(let o=0,s=r.length;o<s;++o){const s=r[o];if(Dx(t,e,s,i,n))return!0;e=s[s.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);const r=function(t,e,r,i,n){const o=n||[];let s=0;for(let n=0,a=r.length;n<a;++n){const a=wx(t,e,r[n],i,o[s]);o[s++]=a,e=a[a.length-1]}return o.length=s,o}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===r.length)this.flatCoordinates.length=0;else{const t=r[r.length-1];this.flatCoordinates.length=0===t.length?0:t[t.length-1]}this.changed()}}var hw=uw;function cw(t,e){if(!t)return null;let r;switch(t.type){case Yy:r=function(t){return new kx(t.coordinates)}(t);break;case Wy:r=function(t){return new nw(t.coordinates)}(t);break;case Xy:r=function(t){return new Vx(t.coordinates)}(t);break;case qy:r=function(t){return new lw(t.coordinates)}(t);break;case Zy:r=function(t){return new sw(t.coordinates)}(t);break;case Ky:r=function(t){return new hw(t.coordinates)}(t);break;case Hy:r=function(t,e){const r=t.geometries.map((function(t){return cw(t,e)}));return new Hx(r)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return $x(r,!1,e)}function pw(t,e){const r=(t=$x(t,!0,e)).getType();let i;switch(r){case Yy:i=function(t,e){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case Wy:i=function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case Xy:i=function(t,e){let r;e&&(r=e.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(r)}}(t,e);break;case qy:i=function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case Zy:i=function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case Ky:i=function(t,e){let r;e&&(r=e.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(r)}}(t,e);break;case Hy:i=function(t,e){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){const r=qg({},e);return delete r.featureProjection,pw(t,r)}))}}(t,e);break;case Jy:i={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+r)}return i}var dw=class extends ew{constructor(t){const e=t||{};super(),this.dataProjection=O_(e.dataProjection?e.dataProjection:"EPSG:4326"),e.featureProjection&&(this.defaultFeatureProjection=O_(e.featureProjection)),this.geometryName_=e.geometryName,this.extractGeometryName_=e.extractGeometryName}readFeatureFromObject(t,e){let r=null;r="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null};const i=cw(r.geometry,e),n=new qx;return this.geometryName_?n.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in r!==void 0&&n.setGeometryName(r.geometry_name),n.setGeometry(i),"id"in r&&n.setId(r.id),r.properties&&n.setProperties(r.properties,!0),n}readFeaturesFromObject(t,e){let r=null;if("FeatureCollection"===t.type){r=[];const i=t.features;for(let t=0,n=i.length;t<n;++t)r.push(this.readFeatureFromObject(i[t],e))}else r=[this.readFeatureFromObject(t,e)];return r}readGeometryFromObject(t,e){return cw(t,e)}readProjectionFromObject(t){const e=t.crs;let r;return e?"name"==e.type?r=O_(e.properties.name):"EPSG"===e.type?r=O_("EPSG:"+e.properties.code):wg(!1,36):r=this.dataProjection,r}writeFeatureObject(t,e){e=this.adaptOptions(e);const r={type:"Feature",geometry:null,properties:null},i=t.getId();if(void 0!==i&&(r.id=i),!t.hasProperties())return r;const n=t.getProperties(),o=t.getGeometry();return o&&(r.geometry=pw(o,e),delete n[t.getGeometryName()]),Kg(n)||(r.properties=n),r}writeFeaturesObject(t,e){e=this.adaptOptions(e);const r=[];for(let i=0,n=t.length;i<n;++i)r.push(this.writeFeatureObject(t[i],e));return{type:"FeatureCollection",features:r}}writeGeometryObject(t,e){return pw(t,this.adaptOptions(e))}};var fw="preload",gw="useInterimTilesOnError";var yw=class extends oy{constructor(t){super(),this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t}getFeatures(t){return dg()}prepareFrame(t){return dg()}renderFrame(t,e){return dg()}loadedTileCallback(t,e,r){t[e]||(t[e]={}),t[e][r.tileCoord.toString()]=r}createLoadedTileFinder(t,e,r){return function(i,n){const o=this.loadedTileCallback.bind(this,r,i);return t.forEachLoadedTile(e,i,n,o)}.bind(this)}forEachFeatureAtCoordinate(t,e,r,i,n){}getDataAtPixel(t,e,r){return dg()}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){t.target.getState()===cg&&this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=cg&&e!=pg&&t.addEventListener(Jg,this.boundHandleImageChange_),e==ug&&(t.load(),e=t.getState()),e==cg}renderIfReadyAndVisible(){const t=this.getLayer();t.getVisible()&&t.getSourceState()==Gv&&t.changed()}};var mw=class extends yw{constructor(t){super(t),this.container=null,this.renderedResolution,this.tempTransform=[1,0,0,1,0,0],this.pixelTransform=[1,0,0,1,0,0],this.inversePixelTransform=[1,0,0,1,0,0],this.context=null,this.containerReused=!1}useContainer(t,e,r){const i=this.getLayer().getClassName();let n,o;if(t&&""===t.style.opacity&&t.className===i){const e=t.firstElementChild;e instanceof HTMLCanvasElement&&(o=e.getContext("2d"))}if(!o||0!==o.canvas.width&&o.canvas.style.transform!==e?this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1):(this.container=t,this.context=o,this.containerReused=!0),!this.container){n=document.createElement("div"),n.className=i;let t=n.style;t.position="absolute",t.width="100%",t.height="100%",o=Dg();const e=o.canvas;n.appendChild(e),t=e.style,t.position="absolute",t.left="0",t.transformOrigin="top left",this.container=n,this.context=o}}clip(t,e,r){const i=e.pixelRatio,n=e.size[0]*i/2,o=e.size[1]*i/2,s=e.viewState.rotation,a=Um(r),l=Ym(r),u=Dm(r),h=jm(r);my(e.coordinateToPixelTransform,a),my(e.coordinateToPixelTransform,l),my(e.coordinateToPixelTransform,u),my(e.coordinateToPixelTransform,h),t.save(),Ay(t,-s,n,o),t.beginPath(),t.moveTo(a[0]*i,a[1]*i),t.lineTo(l[0]*i,l[1]*i),t.lineTo(u[0]*i,u[1]*i),t.lineTo(h[0]*i,h[1]*i),t.clip(),Ay(t,s,n,o)}clipUnrotated(t,e,r){const i=Um(r),n=Ym(r),o=Dm(r),s=jm(r);my(e.coordinateToPixelTransform,i),my(e.coordinateToPixelTransform,n),my(e.coordinateToPixelTransform,o),my(e.coordinateToPixelTransform,s);const a=this.inversePixelTransform;my(a,i),my(a,n),my(a,o),my(a,s),t.save(),t.beginPath(),t.moveTo(Math.round(i[0]),Math.round(i[1])),t.lineTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.clip()}dispatchRenderEvent_(t,e,r){const i=this.getLayer();if(i.hasListener(t)){const n=new lx(t,this.inversePixelTransform,r,e);i.dispatchEvent(n)}}preRender(t,e){this.dispatchRenderEvent_(kv,t,e)}postRender(t,e){this.dispatchRenderEvent_(Nv,t,e)}getRenderTransform(t,e,r,i,n,o,s){const a=n/2,l=o/2,u=i/e,h=-u,c=-t[0]+s,p=-t[1];return vy(this.tempTransform,a,l,u,h,-r,c,p)}getDataAtPixel(t,e,r){const i=my(this.inversePixelTransform,t.slice()),n=this.context;let o;try{const t=Math.round(i[0]),e=Math.round(i[1]),r=document.createElement("canvas"),s=r.getContext("2d");r.width=1,r.height=1,s.clearRect(0,0,1,1),s.drawImage(n.canvas,t,e,1,1,0,0,1,1),o=s.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?new Uint8Array:o}return 0===o[3]?null:o}};class _w extends mw{constructor(t){super(t),this.extentChanged=!0,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.newTiles_=!1,this.tmpExtent=[1/0,1/0,-1/0,-1/0],this.tmpTileRange_=new Tv(0,0,0,0)}isDrawableTile(t){const e=this.getLayer(),r=t.getState(),i=e.getUseInterimTilesOnError();return r==hx||r==px||r==cx&&!i}getTile(t,e,r,i){const n=i.pixelRatio,o=i.viewState.projection,s=this.getLayer();let a=s.getSource().getTile(t,e,r,n,o);return a.getState()==cx&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):a.setState(hx)),this.isDrawableTile(a)||(a=a.getInterimTile()),a}loadedTileCallback(t,e,r){return!!this.isDrawableTile(r)&&super.loadedTileCallback(t,e,r)}prepareFrame(t){return!!this.getLayer().getSource()}renderFrame(t,e){const r=t.layerStatesArray[t.layerIndex],i=t.viewState,n=i.projection,o=i.resolution,s=i.center,a=i.rotation,l=t.pixelRatio,u=this.getLayer(),h=u.getSource(),c=h.getRevision(),p=h.getTileGridForProjection(n),d=p.getZForResolution(o,h.zDirection),f=p.getResolution(d);let g=t.extent;const y=r.extent&&G_(r.extent,n);y&&(g=Bm(g,G_(r.extent,n)));const m=h.getTilePixelRatio(l);let _=Math.round(t.size[0]*m),v=Math.round(t.size[1]*m);if(a){const t=Math.round(Math.sqrt(_*_+v*v));_=t,v=t}const x=f*_/2/m,w=f*v/2/m,b=[s[0]-x,s[1]-w,s[0]+x,s[1]+w],S=p.getTileRangeForExtentAndZ(g,d),T={};T[d]={};const C=this.createLoadedTileFinder(h,n,T),E=this.tmpExtent,R=this.tmpTileRange_;this.newTiles_=!1;for(let e=S.minX;e<=S.maxX;++e)for(let r=S.minY;r<=S.maxY;++r){const i=this.getTile(d,e,r,t);if(this.isDrawableTile(i)){const e=gg(this);if(i.getState()==hx){T[d][i.tileCoord.toString()]=i;const t=i.inTransition(e);this.newTiles_||!t&&-1!==this.renderedTiles.indexOf(i)||(this.newTiles_=!0)}if(1===i.getAlpha(e,t.time))continue}const n=p.getTileCoordChildTileRange(i.tileCoord,R,E);let o=!1;n&&(o=C(d+1,n)),o||p.forEachTileCoordParentTileRange(i.tileCoord,C,R,E)}const P=f/o;vy(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/m,1/m,a,-_/2,-v/2);const I=(O=this.pixelTransform,Ng?wy(O):(Ny||(Ny=Dg(1,1).canvas),Ny.style.transform=wy(O),Ny.style.transform));var O;this.useContainer(e,I,r.opacity);const L=this.context,M=L.canvas;xy(this.inversePixelTransform,this.pixelTransform),vy(this.tempTransform,_/2,v/2,P,P,0,-_/2,-v/2),M.width!=_||M.height!=v?(M.width=_,M.height=v):this.containerReused||L.clearRect(0,0,_,v),y&&this.clipUnrotated(L,t,y),qg(L,h.getContextOptions()),this.preRender(L,t),this.renderedTiles.length=0;let F,A,k,N=Object.keys(T).map(Number);N.sort(Ug),1!==r.opacity||this.containerReused&&!h.getOpaque(t.viewState.projection)?(F=[],A=[]):N=N.reverse();for(let e=N.length-1;e>=0;--e){const i=N[e],o=h.getTilePixelSize(i,l,n),s=p.getResolution(i)/f,a=o[0]*s*P,u=o[1]*s*P,c=p.getTileCoordForCoordAndZ(Um(b),i),g=p.getTileCoordExtent(c),y=my(this.tempTransform,[m*(g[0]-b[0])/f,m*(b[3]-g[3])/f]),_=m*h.getGutterForProjection(n),v=T[i];for(const e in v){const n=v[e],o=n.tileCoord,s=y[0]-(c[1]-o[1])*a,l=Math.round(s+a),p=y[1]-(c[2]-o[2])*u,f=Math.round(p+u),g=Math.round(s),m=Math.round(p),x=l-g,w=f-m,b=d===i,S=b&&1!==n.getAlpha(gg(this),t.time);if(!S)if(F){L.save(),k=[g,m,g+x,m,g+x,m+w,g,m+w];for(let t=0,e=F.length;t<e;++t)if(d!==i&&i<A[t]){const e=F[t];L.beginPath(),L.moveTo(k[0],k[1]),L.lineTo(k[2],k[3]),L.lineTo(k[4],k[5]),L.lineTo(k[6],k[7]),L.moveTo(e[6],e[7]),L.lineTo(e[4],e[5]),L.lineTo(e[2],e[3]),L.lineTo(e[0],e[1]),L.clip()}F.push(k),A.push(i)}else L.clearRect(g,m,x,w);this.drawTileImage(n,t,g,m,x,w,_,b,r.opacity),F&&!S&&L.restore(),this.renderedTiles.push(n),this.updateUsedTiles(t.usedTiles,h,n)}}return this.renderedRevision=c,this.renderedResolution=f,this.extentChanged=!this.renderedExtent_||!Lm(this.renderedExtent_,b),this.renderedExtent_=b,this.renderedPixelRatio=l,this.renderedProjection=n,this.manageTilePyramid(t,h,p,l,n,g,d,u.getPreload()),this.scheduleExpireCache(t,h),this.postRender(L,t),r.extent&&L.restore(),I!==M.style.transform&&(M.style.transform=I),this.container}drawTileImage(t,e,r,i,n,o,s,a,l){const u=this.getTileImage(t);if(!u)return;const h=gg(this),c=a?t.getAlpha(h,e.time):1,p=l*c,d=p!==this.context.globalAlpha;d&&(this.context.save(),this.context.globalAlpha=p),this.context.drawImage(u,s,s,u.width-2*s,u.height-2*s,r,i,n,o),d&&this.context.restore(),1!==c?e.animate=!0:a&&t.endTransition(h)}getImage(){const t=this.context;return t?t.canvas:null}getTileImage(t){return t.getImage()}scheduleExpireCache(t,e){if(e.canExpireCache()){const r=function(t,e,r){const i=gg(t);i in r.usedTiles&&t.expireCache(r.viewState.projection,r.usedTiles[i])}.bind(null,e);t.postRenderFunctions.push(r)}}updateUsedTiles(t,e,r){const i=gg(e);i in t||(t[i]={}),t[i][r.getKey()]=!0}manageTilePyramid(t,e,r,i,n,o,s,a,l){const u=gg(e);u in t.wantedTiles||(t.wantedTiles[u]={});const h=t.wantedTiles[u],c=t.tileQueue;let p,d,f,g,y,m,_=0;for(m=r.getMinZoom();m<=s;++m)for(d=r.getTileRangeForExtentAndZ(o,m,d),f=r.getResolution(m),g=d.minX;g<=d.maxX;++g)for(y=d.minY;y<=d.maxY;++y)s-m<=a?(++_,p=e.getTile(m,g,y,i,n),p.getState()==ux&&(h[p.getKey()]=!0,c.isKeyQueued(p.getKey())||c.enqueue([p,u,r.getTileCoordCenter(p.tileCoord),f])),void 0!==l&&l(p)):e.useTile(m,g,y,n);e.updateCacheSize(_,n)}}_w.prototype.getLayer;var vw=_w;const xw="renderOrder";var ww=class extends zv{constructor(t){const e=t||{},r=qg({},e);delete r.style,delete r.renderBuffer,delete r.updateWhileAnimating,delete r.updateWhileInteracting,super(r),this.declutter_=void 0!==e.declutter&&e.declutter,this.renderBuffer_=void 0!==e.renderBuffer?e.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(e.style),this.updateWhileAnimating_=void 0!==e.updateWhileAnimating&&e.updateWhileAnimating,this.updateWhileInteracting_=void 0!==e.updateWhileInteracting&&e.updateWhileInteracting}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(xw)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}setRenderOrder(t){this.set(xw,t)}setStyle(t){this.style_=void 0!==t?t:rm,this.styleFunction_=null===t?void 0:function(t){let e;if("function"==typeof t)e=t;else{let r;if(Array.isArray(t))r=t;else{wg("function"==typeof t.getZIndex,41),r=[t]}e=function(){return r}}return e}(this.style_),this.changed()}};const bw={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},Sw=[bw.FILL],Tw=[bw.STROKE],Cw=[bw.BEGIN_PATH],Ew=[bw.CLOSE_PATH];var Rw=bw;var Pw=class extends Bv{constructor(t,e,r,i){super(),this.tolerance=t,this.maxExtent=e,this.pixelRatio=i,this.maxLineWidth=0,this.resolution=r,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(t){const e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))}appendFlatCoordinates(t,e,r,i,n,o){let s=this.coordinates.length;const a=this.getBufferedMaxExtent();o&&(e+=i);let l=t[e],u=t[e+1];const h=this.tmpCoordinate_;let c,p,d,f=!0;for(c=e+i;c<r;c+=i)h[0]=t[c],h[1]=t[c+1],d=Em(a,h),d!==p?(f&&(this.coordinates[s++]=l,this.coordinates[s++]=u),this.coordinates[s++]=h[0],this.coordinates[s++]=h[1],f=!1):d===gm?(this.coordinates[s++]=h[0],this.coordinates[s++]=h[1],f=!1):f=!0,l=h[0],u=h[1],p=d;return(n&&f||c===e+i)&&(this.coordinates[s++]=l,this.coordinates[s++]=u),s}drawCustomCoordinates_(t,e,r,i,n){for(let o=0,s=r.length;o<s;++o){const s=r[o],a=this.appendFlatCoordinates(t,e,s,i,!1,!1);n.push(a),e=s}return e}drawCustom(t,e,r){this.beginGeometry(t,e);const i=t.getType(),n=t.getStride(),o=this.coordinates.length;let s,a,l,u,h;if(i==Ky){s=t.getOrientedFlatCoordinates(),u=[];const e=t.getEndss();h=0;for(let t=0,r=e.length;t<r;++t){const r=[];h=this.drawCustomCoordinates_(s,h,e[t],n,r),u.push(r)}this.instructions.push([Rw.CUSTOM,o,u,t,r,Ix])}else i==Xy||i==Zy?(l=[],s=i==Xy?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),h=this.drawCustomCoordinates_(s,0,t.getEnds(),n,l),this.instructions.push([Rw.CUSTOM,o,l,t,r,Px])):i==Wy||i==qy?(s=t.getFlatCoordinates(),a=this.appendFlatCoordinates(s,0,s.length,n,!1,!1),this.instructions.push([Rw.CUSTOM,o,a,t,r,Rx])):i==Yy&&(s=t.getFlatCoordinates(),this.coordinates.push(s[0],s[1]),a=this.coordinates.length,this.instructions.push([Rw.CUSTOM,o,a,t,r]));this.endGeometry(e)}beginGeometry(t,e){const r=t.getExtent();this.beginGeometryInstruction1_=[Rw.BEGIN_GEOMETRY,e,0,r],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Rw.BEGIN_GEOMETRY,e,0,r],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const t=this.hitDetectionInstructions;let e;t.reverse();const r=t.length;let i,n,o=-1;for(e=0;e<r;++e)i=t[e],n=i[0],n==Rw.END_GEOMETRY?o=e:n==Rw.BEGIN_GEOMETRY&&(i[2]=e,Yg(this.hitDetectionInstructions,o,e),o=-1)}setFillStrokeStyle(t,e){const r=this.state;if(t){const e=t.getColor();r.fillStyle=Ag(e||"#000")}else r.fillStyle=void 0;if(e){const t=e.getColor();r.strokeStyle=Ag(t||"#000");const i=e.getLineCap();r.lineCap=void 0!==i?i:"round";const n=e.getLineDash();r.lineDash=n?n.slice():by;const o=e.getLineDashOffset();r.lineDashOffset=o||0;const s=e.getLineJoin();r.lineJoin=void 0!==s?s:"round";const a=e.getWidth();r.lineWidth=void 0!==a?a:1;const l=e.getMiterLimit();r.miterLimit=void 0!==l?l:10,r.lineWidth>this.maxLineWidth&&(this.maxLineWidth=r.lineWidth,this.bufferedMaxExtent_=null)}else r.strokeStyle=void 0,r.lineCap=void 0,r.lineDash=null,r.lineDashOffset=void 0,r.lineJoin=void 0,r.lineWidth=void 0,r.miterLimit=void 0}createFill(t){const e=t.fillStyle,r=[Rw.SET_FILL_STYLE,e];return"string"!=typeof e&&r.push(!0),r}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[Rw.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){const r=t.fillStyle;"string"==typeof r&&t.currentFillStyle==r||(void 0!==r&&this.instructions.push(e.call(this,t)),t.currentFillStyle=r)}updateStrokeStyle(t,e){const r=t.strokeStyle,i=t.lineCap,n=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=r||t.currentLineCap!=i||n!=t.currentLineDash&&!Vg(t.currentLineDash,n)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(void 0!==r&&e.call(this,t),t.currentStrokeStyle=r,t.currentLineCap=i,t.currentLineDash=n,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=l)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const e=[Rw.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=wm(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;xm(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}};var Iw=class extends Pw{constructor(t,e,r,i){super(t,e,r,i)}drawFlatCoordinatess_(t,e,r,i){const n=this.state,o=void 0!==n.fillStyle,s=void 0!==n.strokeStyle,a=r.length;this.instructions.push(Cw),this.hitDetectionInstructions.push(Cw);for(let n=0;n<a;++n){const o=r[n],a=this.coordinates.length,l=this.appendFlatCoordinates(t,e,o,i,!0,!s),u=[Rw.MOVE_TO_LINE_TO,a,l];this.instructions.push(u),this.hitDetectionInstructions.push(u),s&&(this.instructions.push(Ew),this.hitDetectionInstructions.push(Ew)),e=o}return o&&(this.instructions.push(Sw),this.hitDetectionInstructions.push(Sw)),s&&(this.instructions.push(Tw),this.hitDetectionInstructions.push(Tw)),e}drawCircle(t,e){const r=this.state,i=r.fillStyle,n=r.strokeStyle;if(void 0===i&&void 0===n)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==r.fillStyle&&this.hitDetectionInstructions.push([Rw.SET_FILL_STYLE,"#000"]),void 0!==r.strokeStyle&&this.hitDetectionInstructions.push([Rw.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);const o=t.getFlatCoordinates(),s=t.getStride(),a=this.coordinates.length;this.appendFlatCoordinates(o,0,o.length,s,!1,!1);const l=[Rw.CIRCLE,a];this.instructions.push(Cw,l),this.hitDetectionInstructions.push(Cw,l),void 0!==r.fillStyle&&(this.instructions.push(Sw),this.hitDetectionInstructions.push(Sw)),void 0!==r.strokeStyle&&(this.instructions.push(Tw),this.hitDetectionInstructions.push(Tw)),this.endGeometry(e)}drawPolygon(t,e){const r=this.state,i=r.fillStyle,n=r.strokeStyle;if(void 0===i&&void 0===n)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==r.fillStyle&&this.hitDetectionInstructions.push([Rw.SET_FILL_STYLE,"#000"]),void 0!==r.strokeStyle&&this.hitDetectionInstructions.push([Rw.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);const o=t.getEnds(),s=t.getOrientedFlatCoordinates(),a=t.getStride();this.drawFlatCoordinatess_(s,0,o,a),this.endGeometry(e)}drawMultiPolygon(t,e){const r=this.state,i=r.fillStyle,n=r.strokeStyle;if(void 0===i&&void 0===n)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==r.fillStyle&&this.hitDetectionInstructions.push([Rw.SET_FILL_STYLE,"#000"]),void 0!==r.strokeStyle&&this.hitDetectionInstructions.push([Rw.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);const o=t.getEndss(),s=t.getOrientedFlatCoordinates(),a=t.getStride();let l=0;for(let t=0,e=o.length;t<e;++t)l=this.drawFlatCoordinatess_(s,l,o[t],a);this.endGeometry(e)}finish(){this.reverseHitDetectionInstructions(),this.state=null;const t=this.tolerance;if(0!==t){const e=this.coordinates;for(let r=0,i=e.length;r<i;++r)e[r]=Tx(e[r],t)}return super.finish()}setFillStrokeStyles_(){const t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)}};function Ow(t,e,r,i,n){let o,s,a,l,u,h,c,p,d,f,g=r,y=r,m=0,_=0,v=r;for(s=r;s<i;s+=n){const r=e[s],i=e[s+1];void 0!==u&&(d=r-u,f=i-h,l=Math.sqrt(d*d+f*f),void 0!==c&&(_+=a,o=Math.acos((c*d+p*f)/(a*l)),o>t&&(_>m&&(m=_,g=v,y=s),_=0,v=s-n)),a=l,c=d,p=f),u=r,h=i}return _+=l,_>m?[v,s]:[g,y]}const Lw={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};const Mw={Circle:Iw,Default:Pw,Image:class extends Pw{constructor(t,e,r,i){super(t,e,r,i),this.declutterGroups_=null,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0}drawCoordinates_(t,e,r,i){return this.appendFlatCoordinates(t,e,r,i,!1,!1)}drawPoint(t,e){if(!this.image_)return;this.beginGeometry(t,e);const r=t.getFlatCoordinates(),i=t.getStride(),n=this.coordinates.length,o=this.drawCoordinates_(r,0,r.length,i);this.instructions.push([Rw.DRAW_IMAGE,n,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,this.declutterGroups_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_)]),this.hitDetectionInstructions.push([Rw.DRAW_IMAGE,n,o,this.hitDetectionImage_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,this.declutterGroups_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_)]),this.endGeometry(e)}drawMultiPoint(t,e){if(!this.image_)return;this.beginGeometry(t,e);const r=t.getFlatCoordinates(),i=t.getStride(),n=this.coordinates.length,o=this.drawCoordinates_(r,0,r.length,i);this.instructions.push([Rw.DRAW_IMAGE,n,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,this.declutterGroups_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_)]),this.hitDetectionInstructions.push([Rw.DRAW_IMAGE,n,o,this.hitDetectionImage_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,this.declutterGroups_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_)]),this.endGeometry(e)}finish(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,super.finish()}setImageStyle(t,e){const r=t.getAnchor(),i=t.getSize(),n=t.getHitDetectionImage(this.pixelRatio),o=t.getImage(this.pixelRatio),s=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=r[0],this.anchorY_=r[1],this.declutterGroups_=e,this.hitDetectionImage_=n,this.image_=o,this.height_=i[1],this.opacity_=t.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=i[0]}},LineString:class extends Pw{constructor(t,e,r,i){super(t,e,r,i)}drawFlatCoordinates_(t,e,r,i){const n=this.coordinates.length,o=this.appendFlatCoordinates(t,e,r,i,!1,!1),s=[Rw.MOVE_TO_LINE_TO,n,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),r}drawLineString(t,e){const r=this.state,i=r.strokeStyle,n=r.lineWidth;if(void 0===i||void 0===n)return;this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Rw.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset],Cw);const o=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(o,0,o.length,s),this.hitDetectionInstructions.push(Tw),this.endGeometry(e)}drawMultiLineString(t,e){const r=this.state,i=r.strokeStyle,n=r.lineWidth;if(void 0===i||void 0===n)return;this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Rw.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset],Cw);const o=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride();let l=0;for(let t=0,e=o.length;t<e;++t)l=this.drawFlatCoordinates_(s,l,o[t],a);this.hitDetectionInstructions.push(Tw),this.endGeometry(e)}finish(){const t=this.state;return null!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&this.instructions.push(Tw),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(t){null!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(Tw),t.lastStroke=this.coordinates.length),t.lastStroke=0,super.applyStroke(t),this.instructions.push(Cw)}},Polygon:Iw,Text:class extends Pw{constructor(t,e,r,i){super(t,e,r,i),this.declutterGroups_,this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_=""}finish(){const t=super.finish();return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t}drawText(t,e){const r=this.textFillState_,i=this.textStrokeState_,n=this.textState_;if(""===this.text_||!n||!r&&!i)return;let o=this.coordinates.length;const s=t.getType();let a,l,u=null,h=2,c=2;if(n.placement===Qm){if(!Vm(this.getBufferedMaxExtent(),t.getExtent()))return;let r;if(u=t.getFlatCoordinates(),c=t.getStride(),s==Wy)r=[u.length];else if(s==Zy)r=t.getEnds();else if(s==Xy)r=t.getEnds().slice(0,1);else if(s==Ky){const e=t.getEndss();for(r=[],a=0,l=e.length;a<l;++a)r.push(e[a][0])}this.beginGeometry(t,e);const i=n.textAlign;let p,d=0;for(let t=0,e=r.length;t<e;++t){if(null==i){const e=Ow(n.maxAngle,u,d,r[t],c);d=e[0],p=e[1]}else p=r[t];for(a=d;a<p;a+=c)this.coordinates.push(u[a],u[a+1]);h=this.coordinates.length,d=r[t];const e=this.declutterGroups_?0===t?this.declutterGroups_[0]:[].concat(this.declutterGroups_[0]):null;this.drawChars_(o,h,e),o=h}this.endGeometry(e)}else{let r=null;switch(n.overflow||(r=[]),s){case Yy:case qy:u=t.getFlatCoordinates(),h=u.length;break;case Wy:u=t.getFlatMidpoint();break;case Jy:u=t.getCenter();break;case Zy:u=t.getFlatMidpoints(),h=u.length;break;case Xy:u=t.getFlatInteriorPoint(),n.overflow||r.push(u[2]/this.resolution),c=3;break;case Ky:const e=t.getFlatInteriorPoints();for(u=[],a=0,l=e.length;a<l;a+=3)n.overflow||r.push(e[a+2]/this.resolution),u.push(e[a],e[a+1]);if(h=u.length,0==h)return}h=this.appendFlatCoordinates(u,0,h,c,!1,!1),this.saveTextStates_(),(n.backgroundFill||n.backgroundStroke)&&(this.setFillStrokeStyle(n.backgroundFill,n.backgroundStroke),n.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),n.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);let i=n.padding;if(i!=Sy&&(n.scale[0]<0||n.scale[1]<0)){let t=n.padding[0],e=n.padding[1],r=n.padding[2],o=n.padding[3];n.scale[0]<0&&(e=-e,o=-o),n.scale[1]<0&&(t=-t,r=-r),i=[t,e,r,o]}const p=this.pixelRatio;this.instructions.push([Rw.DRAW_IMAGE,o,h,null,NaN,NaN,this.declutterGroups_,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,i==Sy?Sy:i.map((function(t){return t*p})),!!n.backgroundFill,!!n.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,r]);const d=1/p;this.hitDetectionInstructions.push([Rw.DRAW_IMAGE,o,h,null,NaN,NaN,this.declutterGroups_,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[d,d],NaN,i,!!n.backgroundFill,!!n.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,r]),this.endGeometry(e)}}saveTextStates_(){const t=this.textStrokeState_,e=this.textState_,r=this.textFillState_,i=this.strokeKey_;t&&(i in this.strokeStates||(this.strokeStates[i]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));const n=this.textKey_;n in this.textStates||(this.textStates[n]={font:e.font,textAlign:e.textAlign||"center",textBaseline:e.textBaseline||"middle",scale:e.scale});const o=this.fillKey_;r&&(o in this.fillStates||(this.fillStates[o]={fillStyle:r.fillStyle}))}drawChars_(t,e,r){const i=this.textStrokeState_,n=this.textState_,o=this.strokeKey_,s=this.textKey_,a=this.fillKey_;this.saveTextStates_();const l=this.pixelRatio,u=Lw[n.textBaseline],h=this.textOffsetY_*l,c=this.text_,p=i?i.lineWidth*Math.abs(n.scale[0])/2:0;this.instructions.push([Rw.DRAW_CHARS,t,e,u,r,n.overflow,a,n.maxAngle,l,h,o,p*l,c,s,1]),this.hitDetectionInstructions.push([Rw.DRAW_CHARS,t,e,u,r,n.overflow,a,n.maxAngle,1,h,o,p,c,s,1/l])}setTextStyle(t,e){let r,i,n;if(t){this.declutterGroups_=e;const o=t.getFill();o?(i=this.textFillState_,i||(i={},this.textFillState_=i),i.fillStyle=Ag(o.getColor()||"#000")):(i=null,this.textFillState_=i);const s=t.getStroke();if(s){n=this.textStrokeState_,n||(n={},this.textStrokeState_=n);const t=s.getLineDash(),e=s.getLineDashOffset(),r=s.getWidth(),i=s.getMiterLimit();n.lineCap=s.getLineCap()||"round",n.lineDash=t?t.slice():by,n.lineDashOffset=void 0===e?0:e,n.lineJoin=s.getLineJoin()||"round",n.lineWidth=void 0===r?1:r,n.miterLimit=void 0===i?10:i,n.strokeStyle=Ag(s.getColor()||"#000")}else n=null,this.textStrokeState_=n;r=this.textState_;const a=t.getFont()||"10px sans-serif";Iy(a);const l=t.getScaleArray();r.overflow=t.getOverflow(),r.font=a,r.maxAngle=t.getMaxAngle(),r.placement=t.getPlacement(),r.textAlign=t.getTextAlign(),r.textBaseline=t.getTextBaseline()||"middle",r.backgroundFill=t.getBackgroundFill(),r.backgroundStroke=t.getBackgroundStroke(),r.padding=t.getPadding()||Sy,r.scale=void 0===l?[1,1]:l;const u=t.getOffsetX(),h=t.getOffsetY(),c=t.getRotateWithView(),p=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===u?0:u,this.textOffsetY_=void 0===h?0:h,this.textRotateWithView_=void 0!==c&&c,this.textRotation_=void 0===p?0:p,this.strokeKey_=n?("string"==typeof n.strokeStyle?n.strokeStyle:gg(n.strokeStyle))+n.lineCap+n.lineDashOffset+"|"+n.lineWidth+n.lineJoin+n.miterLimit+"["+n.lineDash.join()+"]":"",this.textKey_=r.font+r.scale+(r.textAlign||"?")+(r.textBaseline||"?"),this.fillKey_=i?"string"==typeof i.fillStyle?i.fillStyle:"|"+gg(i.fillStyle):""}else this.text_=""}}};var Fw=class{constructor(t,e,r,i,n){this.declutter_=n,this.declutterGroups_=null,this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=i,this.resolution_=r,this.buildersByZIndex_={}}addDeclutter(t){let e=null;return this.declutter_&&(t?(e=this.declutterGroups_,e[0][0]++):(e=[[1]],this.declutterGroups_=e)),e}finish(){const t={};for(const e in this.buildersByZIndex_){t[e]=t[e]||{};const r=this.buildersByZIndex_[e];for(const i in r){const n=r[i].finish();t[e][i]=n}}return t}getBuilder(t,e){const r=void 0!==t?t.toString():"0";let i=this.buildersByZIndex_[r];void 0===i&&(i={},this.buildersByZIndex_[r]=i);let n=i[e];if(void 0===n){n=new(0,Mw[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),i[e]=n}return n}};function Aw(t,e,r,i,n,o,s,a,l,u,h,c){const p=[];let d;if(c){const n=W_(t,e,r,i,c,[t[e],t[e+1]]);d=n[0]>n[n.length-i]}else d=t[e]>t[r-i];const f=n.length;let g,y,m=t[e],_=t[e+1],v=t[e+=i],x=t[e+1],w=0,b=Math.sqrt(Math.pow(v-m,2)+Math.pow(x-_,2)),S=!1;for(let c=0;c<f;++c){g=d?f-c-1:c;const T=n[g],C=a*l(u,T,h),E=o+C/2;for(;e<r-i&&w+b<E;)m=v,_=x,v=t[e+=i],x=t[e+1],w+=b,b=Math.sqrt(Math.pow(v-m,2)+Math.pow(x-_,2));const R=E-w;let P=Math.atan2(x-_,v-m);if(d&&(P+=P>0?-Math.PI:Math.PI),void 0!==y){let t=P-y;if(S=S||0!==t,t+=t>Math.PI?-2*Math.PI:t<-Math.PI?2*Math.PI:0,Math.abs(t)>s)return null}y=P;const I=R/b,O=Eg(m,v,I),L=Eg(_,x,I);p[g]=[O,L,C/2,P,T],o+=C}return S?p:[[p[0][0],p[0][1],p[0][2],p[0][3],n]]}const kw=[1/0,1/0,-1/0,-1/0],Nw=[1,0,0,1,0,0],jw=[],Dw=[],Gw=[],zw=[];var Bw=class{constructor(t,e,r,i,n){this.overlaps=r,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.declutterItems=[],this.instructions=i.instructions,this.coordinates=i.coordinates,this.coordinateCache_={},this.renderBuffer_=n,this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=i.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=i.fillStates||{},this.strokeStates=i.strokeStates||{},this.textStates=i.textStates||{},this.widths_={},this.labels_={}}createLabel(t,e,r,i){const n=t+e+r+i;if(this.labels_[n])return this.labels_[n];const o=i?this.strokeStates[i]:null,s=r?this.fillStates[r]:null,a=this.textStates[e],l=this.pixelRatio,u=[a.scale[0]*l,a.scale[1]*l],h=Lw[a.textAlign||"center"],c=i&&o.lineWidth?o.lineWidth:0,p=t.split("\n"),d=p.length,f=[],g=function(t,e,r){const i=e.length;let n=0;for(let o=0;o<i;++o){const i=My(t,e[o]);n=Math.max(n,i),r.push(i)}return n}(a.font,p,f),y=Oy(a.font),m=g+c,_=[],v=(m+2)*u[0],x=(y*d+c)*u[1],w={width:v<0?Math.floor(v):Math.ceil(v),height:x<0?Math.floor(x):Math.ceil(x),contextInstructions:_};if(1==u[0]&&1==u[1]||_.push("scale",u),_.push("font",a.font),i){_.push("strokeStyle",o.strokeStyle),_.push("lineWidth",c),_.push("lineCap",o.lineCap),_.push("lineJoin",o.lineJoin),_.push("miterLimit",o.miterLimit),(Ng?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(_.push("setLineDash",[o.lineDash]),_.push("lineDashOffset",o.lineDashOffset))}r&&_.push("fillStyle",s.fillStyle),_.push("textBaseline","middle"),_.push("textAlign","center");const b=.5-h,S=h*m+b*c;let T;if(i)for(T=0;T<d;++T)_.push("strokeText",[p[T],S+b*f[T],.5*(c+y)+T*y]);if(r)for(T=0;T<d;++T)_.push("fillText",[p[T],S+b*f[T],.5*(c+y)+T*y]);return this.labels_[n]=w,w}replayTextBackground_(t,e,r,i,n,o,s,a){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,r),t.lineTo.apply(t,i),t.lineTo.apply(t,n),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],a&&(t.fillStyle=o[1]),this.fill_(t)),s&&(this.setStrokeStyle_(t,s),t.stroke())}replayImageOrLabel_(t,e,r,i,n,o,s,a,l,u,h,c,p,d,f,g,y,m,_){const v=m||_;r-=o*=d[0],i-=s*=d[1];const x=g+h>n.width?n.width-h:g,w=l+c>n.height?n.height-c:l,b=y[3]+x*d[0]+y[1],S=y[0]+w*d[1]+y[2],T=r-y[3],C=i-y[0];(v||0!==p)&&(jw[0]=T,zw[0]=T,jw[1]=C,Dw[1]=C,Dw[0]=T+b,Gw[0]=Dw[0],Gw[1]=C+S,zw[1]=Gw[1]);let E=null;if(0!==p){const t=r+o,e=i+s;E=vy(Nw,t,e,1,1,p,-t,-e),my(Nw,jw),my(Nw,Dw),my(Nw,Gw),my(Nw,zw),Rm(Math.min(jw[0],Dw[0],Gw[0],zw[0]),Math.min(jw[1],Dw[1],Gw[1],zw[1]),Math.max(jw[0],Dw[0],Gw[0],zw[0]),Math.max(jw[1],Dw[1],Gw[1],zw[1]),kw)}else Rm(T,C,T+b,C+S,kw);this.renderBuffer_[0]=Math.max(this.renderBuffer_[0],Wm(kw)),this.renderBuffer_[1]=Math.max(this.renderBuffer_[1],zm(kw));const R=t.canvas,P=_?_[2]*d[0]/2:0,I=this.renderBuffer_,O=kw[0]-P<=(R.width+I[0])/e&&kw[2]+P>=-I[0]/e&&kw[1]-P<=(R.height+I[1])/e&&kw[3]+P>=-I[1]/e;if(f&&(r=Math.round(r),i=Math.round(i)),a){if(!O&&1==a[0])return!1;const e=O?[t,E?E.slice(0):null,u,n,h,c,x,w,r,i,d,kw.slice()]:null;e&&(v&&e.push(m,_,jw.slice(0),Dw.slice(0),Gw.slice(0),zw.slice(0)),a.push(e))}else O&&(v&&this.replayTextBackground_(t,jw,Dw,Gw,zw,m,_,!1),ky(t,E,u,n,h,c,x,w,r,i,d));return!0}fill_(t){if(this.alignFill_){const e=my(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;t.save(),t.translate(e[0]%r,e[1]%r),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))}renderDeclutter(t,e,r,i){const n=[];for(let r=1,i=t.length;r<i;++r){const i=t[r][11];n.push({minX:i[0],minY:i[1],maxX:i[2],maxY:i[3],value:e})}i||(i=new ec.a(9));let o=!1;for(let t=0,e=n.length;t<e;++t)if(i.collides(n[t])){o=!0;break}if(!o){i.load(n);for(let e=1,i=t.length;e<i;++e){const i=t[e],n=i[0],o=n.globalAlpha;o!==r&&(n.globalAlpha=r),i.length>12&&this.replayTextBackground_(i[0],i[14],i[15],i[16],i[17],i[12],i[13],!0),ky.apply(void 0,i),o!==r&&(n.globalAlpha=o)}}return t.length=1,i}drawLabelWithPointPlacement_(t,e,r,i){const n=this.textStates[e],o=this.createLabel(t,e,i,r),s=this.strokeStates[r],a=this.pixelRatio,l=Lw[n.textAlign||"center"],u=Lw[n.textBaseline||"middle"],h=s&&s.lineWidth?s.lineWidth:0;return{label:o,anchorX:l*(o.width/a-2*n.scale[0])+2*(.5-l)*h,anchorY:u*o.height/a+2*(.5-u)*h}}execute_(t,e,r,i,n,o,s){let a;var l,u;this.declutterItems.length=0,this.pixelCoordinates_&&Vg(r,this.renderedTransform_)?a=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),a=Y_(this.coordinates,0,this.coordinates.length,2,r,this.pixelCoordinates_),l=this.renderedTransform_,u=r,l[0]=u[0],l[1]=u[1],l[2]=u[2],l[3]=u[3],l[4]=u[4],l[5]=u[5]);let h=0;const c=i.length;let p,d,f,g,y,m,_,v,x,w,b,S,T,C,E=0,R=0,P=0,I=null,O=null;const L=this.coordinateCache_,M=this.viewRotation_,F=Math.round(1e12*Math.atan2(-r[1],r[0]))/1e12,A={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:M},k=this.instructions!=i||this.overlaps?0:200;let N,j,D;for(;h<c;){const r=i[h];switch(r[0]){case Rw.BEGIN_GEOMETRY:N=r[1],N.getGeometry()?void 0===s||Vm(s,r[3])?++h:h=r[2]+1:h=r[2];break;case Rw.BEGIN_PATH:R>k&&(this.fill_(t),R=0),P>k&&(t.stroke(),P=0),R||P||(t.beginPath(),g=NaN,y=NaN),++h;break;case Rw.CIRCLE:E=r[1];const i=a[E],l=a[E+1],u=a[E+2]-i,c=a[E+3]-l,G=Math.sqrt(u*u+c*c);t.moveTo(i+G,l),t.arc(i,l,G,0,2*Math.PI,!0),++h;break;case Rw.CLOSE_PATH:t.closePath(),++h;break;case Rw.CUSTOM:E=r[1],p=r[2];const z=r[3],B=r[4],U=6==r.length?r[5]:void 0;A.geometry=z,A.feature=N,h in L||(L[h]=[]);const Y=L[h];U?U(a,E,p,2,Y):(Y[0]=a[E],Y[1]=a[E+1],Y.length=2),B(Y,A),++h;break;case Rw.DRAW_IMAGE:E=r[1],p=r[2],w=r[3],d=r[4],f=r[5],x=o?null:r[6];let W=r[7];const V=r[8],X=r[9],q=r[10],Z=r[11];let K=r[12];const H=r[13];let J,$,Q,tt,et=r[14];if(!w&&r.length>=19){b=r[18],S=r[19],T=r[20],C=r[21];const t=this.drawLabelWithPointPlacement_(b,S,T,C);w=t.label,r[3]=w;const e=r[22];d=(t.anchorX-e)*this.pixelRatio,r[4]=d;const i=r[23];f=(t.anchorY-i)*this.pixelRatio,r[5]=f,W=w.height,r[7]=W,et=w.width,r[14]=et}r.length>24&&(J=r[24]),r.length>16?($=r[15],Q=r[16],tt=r[17]):($=Sy,Q=!1,tt=!1),Z&&F?K+=M:Z||F||(K-=M);let rt=0,it=0;for(;E<p;E+=2){if(J&&J[rt++]<et/this.pixelRatio)continue;if(x){const t=Math.floor(it);v=x.length<t+1?[x[0][0]]:x[t]}this.replayImageOrLabel_(t,e,a[E],a[E+1],w,d,f,v,W,V,X,q,K,H,n,et,$,Q?I:null,tt?O:null)&&v&&x[x.length-1]!==v&&x.push(v),v&&(v.length-1===v[0]&&this.declutterItems.push(this,v,N),it+=1/v[0])}++h;break;case Rw.DRAW_CHARS:const nt=r[1],ot=r[2],st=r[3];v=o?null:r[4];const at=r[5];C=r[6];const lt=r[7],ut=r[8],ht=r[9];T=r[10];const ct=r[11];b=r[12],S=r[13];const pt=[r[14],r[14]],dt=this.textStates[S],ft=dt.font,gt=[dt.scale[0]*ut,dt.scale[1]*ut];let yt;ft in this.widths_?yt=this.widths_[ft]:(yt={},this.widths_[ft]=yt);const mt=rw(a,nt,ot,2),_t=Math.abs(gt[0])*Fy(ft,b,yt);if(at||_t<=mt){const r=this.textStates[S].textAlign,i=Aw(a,nt,ot,2,b,(mt-_t)*Lw[r],lt,Math.abs(gt[0]),Fy,ft,yt,F?0:this.viewRotation_);if(i){let r,n,o,s,a,l=!1;if(T)for(r=0,n=i.length;r<n;++r)a=i[r],o=a[4],s=this.createLabel(o,S,"",T),d=a[2]+ct,f=st*s.height+2*(.5-st)*ct*gt[1]/gt[0]-ht,l=this.replayImageOrLabel_(t,e,a[0],a[1],s,d,f,v,s.height,1,0,0,a[3],pt,!1,s.width,Sy,null,null)||l;if(C)for(r=0,n=i.length;r<n;++r)a=i[r],o=a[4],s=this.createLabel(o,S,C,""),d=a[2],f=st*s.height-ht,l=this.replayImageOrLabel_(t,e,a[0],a[1],s,d,f,v,s.height,1,0,0,a[3],pt,!1,s.width,Sy,null,null)||l;l&&this.declutterItems.push(this,v,N)}}++h;break;case Rw.END_GEOMETRY:if(void 0!==o){N=r[1];const t=o(N);if(t)return t}++h;break;case Rw.FILL:k?R++:this.fill_(t),++h;break;case Rw.MOVE_TO_LINE_TO:for(E=r[1],p=r[2],j=a[E],D=a[E+1],m=j+.5|0,_=D+.5|0,m===g&&_===y||(t.moveTo(j,D),g=m,y=_),E+=2;E<p;E+=2)j=a[E],D=a[E+1],m=j+.5|0,_=D+.5|0,E!=p-2&&m===g&&_===y||(t.lineTo(j,D),g=m,y=_);++h;break;case Rw.SET_FILL_STYLE:I=r,this.alignFill_=r[2],R&&(this.fill_(t),R=0,P&&(t.stroke(),P=0)),t.fillStyle=r[1],++h;break;case Rw.SET_STROKE_STYLE:O=r,P&&(t.stroke(),P=0),this.setStrokeStyle_(t,r),++h;break;case Rw.STROKE:k?P++:t.stroke(),++h;break;default:++h}}R&&this.fill_(t),P&&t.stroke()}execute(t,e,r,i,n){this.viewRotation_=i,this.execute_(t,e,r,this.instructions,n,void 0,void 0)}executeHitDetection(t,e,r,i,n){return this.viewRotation_=r,this.execute_(t,1,e,this.hitDetectionInstructions,!0,i,n)}};const Uw=[ex,Jv,tx,Qv,rx,$v];const Yw={0:[[!0]]};function Ww(t,e,r){let i;const n=Math.floor(t.length/2);if(e>=n)for(i=n;i<e;i++)t[i][r]=!0;else if(e<n)for(i=e+1;i<n;i++)t[i][r]=!0}function Vw(t,e,r,i,n,o){const s=Object.keys(t).map(Number).sort(Ug);for(let a=0,l=s.length;a<l;++a){const l=t[s[a].toString()];let u;for(let t=0,s=l.length;t<s;){const s=l[t++],a=l[t++];s.execute(e,1,a,r,n),s!==u&&s.declutterItems.length>0&&(u=s,o.push({items:s.declutterItems,opacity:i}))}}}var Xw=class{constructor(t,e,r,i,n,o){this.maxExtent_=t,this.overlaps_=i,this.pixelRatio_=r,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(n)}clip(t,e){const r=this.getClipCoords(e);t.beginPath(),t.moveTo(r[0],r[1]),t.lineTo(r[2],r[3]),t.lineTo(r[4],r[5]),t.lineTo(r[6],r[7]),t.clip()}createExecutors_(t){for(const e in t){let r=this.executorsByZIndex_[e];void 0===r&&(r={},this.executorsByZIndex_[e]=r);const i=t[e],n=[this.renderBuffer_||0,this.renderBuffer_||0];for(const t in i){const e=i[t];r[t]=new Bw(this.resolution_,this.pixelRatio_,this.overlaps_,e,n)}}}hasExecutors(t){for(const e in this.executorsByZIndex_){const r=this.executorsByZIndex_[e];for(let e=0,i=t.length;e<i;++e)if(t[e]in r)return!0}return!1}forEachFeatureAtCoordinate(t,e,r,i,n,o){const s=2*(i=Math.round(i))+1,a=vy(this.hitDetectionTransform_,i+.5,i+.5,1/e,-1/e,-r,-t[0],-t[1]);this.hitDetectionContext_||(this.hitDetectionContext_=Dg(s,s));const l=this.hitDetectionContext_;let u;l.canvas.width!==s||l.canvas.height!==s?(l.canvas.width=s,l.canvas.height=s):l.clearRect(0,0,s,s),void 0!==this.renderBuffer_&&(u=[1/0,1/0,-1/0,-1/0],Fm(u,t),xm(u,e*(this.renderBuffer_+i),u));const h=function(t){if(void 0!==Yw[t])return Yw[t];const e=2*t+1,r=new Array(e);for(let t=0;t<e;t++)r[t]=new Array(e);let i=t,n=0,o=0;for(;i>=n;)Ww(r,t+i,t+n),Ww(r,t+n,t+i),Ww(r,t-n,t+i),Ww(r,t-i,t+n),Ww(r,t-i,t-n),Ww(r,t-n,t-i),Ww(r,t+n,t-i),Ww(r,t+i,t-n),n++,o+=1+2*n,2*(o-i)+1>0&&(i-=1,o+=1-2*i);return Yw[t]=r,r}(i);let c;function p(t){const e=l.getImageData(0,0,s,s).data;for(let r=0;r<s;r++)for(let i=0;i<s;i++)if(h[r][i]&&e[4*(i*s+r)+3]>0){let e;return(!o||c!=Qv&&c!=rx||-1!==o.indexOf(t))&&(e=n(t)),e||void l.clearRect(0,0,s,s)}}const d=Object.keys(this.executorsByZIndex_).map(Number);let f,g,y,m,_;for(d.sort(Ug),f=d.length-1;f>=0;--f){const t=d[f].toString();for(y=this.executorsByZIndex_[t],g=Uw.length-1;g>=0;--g)if(c=Uw[g],m=y[c],void 0!==m&&(_=m.executeHitDetection(l,a,r,p,u),_))return _}}getClipCoords(t){const e=this.maxExtent_;if(!e)return null;const r=e[0],i=e[1],n=e[2],o=e[3],s=[r,i,r,o,n,o,n,i];return Y_(s,0,8,2,t,s),s}isEmpty(){return Kg(this.executorsByZIndex_)}execute(t,e,r,i,n,o,s){const a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(Ug),this.maxExtent_&&(t.save(),this.clip(t,r));const l=o||Uw;let u,h,c,p,d,f;for(u=0,h=a.length;u<h;++u){const o=a[u].toString();for(d=this.executorsByZIndex_[o],c=0,p=l.length;c<p;++c){const a=l[c];if(f=d[a],void 0!==f)if(!s||a!=Qv&&a!=rx)f.execute(t,e,r,i,n);else{const t=s[o];t?t.push(f,r.slice(0)):s[o]=[f,r.slice(0)]}}}this.maxExtent_&&t.restore()}};function qw(t,e,r,i,n,o,s){const a=Dg(t[0]/2,t[1]/2);a.imageSmoothingEnabled=!1;const l=a.canvas,u=new Hv(a,.5,n,null,s),h=r.length,c=Math.floor(16777215/h),p={};for(let t=1;t<=h;++t){const e=r[t-1],s=e.getStyleFunction()||i;if(!i)continue;let a=s(e,o);if(!a)continue;Array.isArray(a)||(a=[a]);const l="#"+("000000"+(t*c).toString(16)).slice(-6);for(let t=0,r=a.length;t<r;++t){const r=a[t],i=r.clone(),o=i.getFill();o&&o.setColor(l);const s=i.getStroke();s&&s.setColor(l),i.setText(void 0);const u=r.getImage();if(u){const t=u.getImageSize();if(!t)continue;const e=document.createElement("canvas");e.width=t[0],e.height=t[1];const r=e.getContext("2d",{alpha:!1});r.fillStyle=l;const n=r.canvas;r.fillRect(0,0,n.width,n.height),Dg(t?t[0]:n.width,t?t[1]:n.height).drawImage(n,0,0),i.setImage(new Jm({img:n,imgSize:t,anchor:u.getAnchor(),anchorXUnits:sm,anchorYUnits:sm,offset:u.getOrigin(),size:u.getSize(),opacity:u.getOpacity(),scale:u.getScale(),rotation:u.getRotation(),rotateWithView:u.getRotateWithView()}))}const h=Number(i.getZIndex());let c=p[h];c||(c={},p[h]=c,c[Xy]=[],c[Jy]=[],c[Wy]=[],c[Yy]=[]);const d=i.getGeometryFunction()(e);d&&Vm(n,d.getExtent())&&c[d.getType().replace("Multi","")].push(d,i)}}const d=Object.keys(p).map(Number).sort(Ug);for(let t=0,r=d.length;t<r;++t){const r=p[d[t]];for(const t in r){const i=r[t];for(let t=0,r=i.length;t<r;t+=2){u.setStyle(i[t+1]);for(let r=0,n=e.length;r<n;++r)u.setTransform(e[r]),u.drawGeometry(i[t])}}}return a.getImageData(0,0,l.width,l.height)}function Zw(t,e,r){const i=[];if(r){const n=4*(Math.round(t[0]/2)+Math.round(t[1]/2)*r.width),o=r.data[n],s=r.data[n+1],a=r.data[n+2]+256*(s+256*o),l=Math.floor(16777215/e.length);a&&a%l==0&&i.push(e[a/l-1])}return i}var Kw=class extends mw{constructor(t){super(t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.dirty_=!1,this.hitDetectionImageData_=null,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=[1/0,1/0,-1/0,-1/0],this.renderedRotation_,this.renderedCenter_=null,this.renderedProjection_=null,this.renderedRenderOrder_=null,this.replayGroup_=null,this.replayGroupChanged=!0}useContainer(t,e,r){r<1&&(t=null),super.useContainer(t,e,r)}renderFrame(t,e){const r=t.pixelRatio,i=t.layerStatesArray[t.layerIndex];!function(t,e,r){yy(t,e,0,0,r,0,0)}(this.pixelTransform,1/r,1/r),xy(this.inversePixelTransform,this.pixelTransform);const n=wy(this.pixelTransform);this.useContainer(e,n,i.opacity);const o=this.context,s=o.canvas,a=this.replayGroup_;if(!a||a.isEmpty())return!this.containerReused&&s.width>0&&(s.width=0),this.container;const l=Math.round(t.size[0]*r),u=Math.round(t.size[1]*r);s.width!=l||s.height!=u?(s.width=l,s.height=u,s.style.transform!==n&&(s.style.transform=n)):this.containerReused||o.clearRect(0,0,l,u),this.preRender(o,t);const h=t.extent,c=t.viewState,p=c.center,d=c.resolution,f=c.projection,g=c.rotation,y=f.getExtent(),m=this.getLayer().getSource();let _=!1;if(i.extent){const e=G_(i.extent,f);_=!Tm(e,t.extent)&&Vm(e,t.extent),_&&this.clipUnrotated(o,t,e)}const v=t.viewHints,x=!(v[dx]||v[fx]),w=this.getRenderTransform(p,d,g,r,l,u,0),b=this.getLayer().getDeclutter()?{}:null;if(a.execute(o,1,w,g,x,void 0,b),m.getWrapX()&&f.canWrapX()&&!Tm(y,h)){let t=h[0];const e=Wm(y);let i,n=0;for(;t<y[0];){--n,i=e*n;const s=this.getRenderTransform(p,d,g,r,l,u,i);a.execute(o,1,s,g,x,void 0,b),t+=e}for(n=0,t=h[2];t>y[2];){++n,i=e*n;const s=this.getRenderTransform(p,d,g,r,l,u,i);a.execute(o,1,s,g,x,void 0,b),t-=e}}if(b){const e=t.viewHints;Vw(b,o,g,1,!(e[dx]||e[fx]),t.declutterItems)}_&&o.restore(),this.postRender(o,t);const S=i.opacity,T=this.container;return S!==parseFloat(T.style.opacity)&&(T.style.opacity=1===S?"":String(S)),this.renderedRotation_!==c.rotation&&(this.renderedRotation_=c.rotation,this.hitDetectionImageData_=null),this.container}getFeatures(t){return new Promise(function(e,r){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const t=[this.context.canvas.width,this.context.canvas.height];my(this.pixelTransform,t);const e=this.renderedCenter_,r=this.renderedResolution_,i=this.renderedRotation_,n=this.renderedProjection_,o=this.renderedExtent_,s=this.getLayer(),a=[],l=t[0]/2,u=t[1]/2;a.push(this.getRenderTransform(e,r,i,.5,l,u,0).slice());const h=s.getSource(),c=n.getExtent();if(h.getWrapX()&&n.canWrapX()&&!Tm(c,o)){let t=o[0];const n=Wm(c);let s,h=0;for(;t<c[0];)--h,s=n*h,a.push(this.getRenderTransform(e,r,i,.5,l,u,s).slice()),t+=n;for(h=0,t=o[2];t>c[2];)++h,s=n*h,a.push(this.getRenderTransform(e,r,i,.5,l,u,s).slice()),t-=n}this.hitDetectionImageData_=qw(t,a,this.renderedFeatures_,s.getStyleFunction(),o,r,i)}e(Zw(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))}forEachFeatureAtCoordinate(t,e,r,i,n){if(this.replayGroup_){const o=e.viewState.resolution,s=e.viewState.rotation,a=this.getLayer(),l={};return this.replayGroup_.forEachFeatureAtCoordinate(t,o,s,r,(function(t){const e=gg(t);if(!(e in l))return l[e]=!0,i(t,a)}),a.getDeclutter()?n:null)}}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){const e=this.getLayer(),r=e.getSource();if(!r)return!1;const i=t.viewHints[dx],n=t.viewHints[fx],o=e.getUpdateWhileAnimating(),s=e.getUpdateWhileInteracting();if(!this.dirty_&&!o&&i||!s&&n)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const a=t.extent,l=t.viewState,u=l.projection,h=l.resolution,c=t.pixelRatio,p=e.getRevision(),d=e.getRenderBuffer();let f=e.getRenderOrder();void 0===f&&(f=nx);const g=l.center.slice(),y=xm(a,d*h),m=[y.slice()],_=u.getExtent();if(r.getWrapX()&&u.canWrapX()&&!Tm(_,t.extent)){const t=Wm(_),e=Math.max(Wm(y)/2,t);y[0]=_[0]-e,y[2]=_[2]+e,C_(g,u);const r=function(t,e){const r=e.getExtent(),i=Gm(t);if(e.canWrapX()&&(i[0]<r[0]||i[0]>=r[2])){const e=Wm(r),n=Math.floor((i[0]-r[0])/e)*e;t[0]-=n,t[2]-=n}return t}(m[0],u);r[0]<_[0]&&r[2]<_[2]?m.push([r[0]+t,r[1],r[2]+t,r[3]]):r[0]>_[0]&&r[2]>_[2]&&m.push([r[0]-t,r[1],r[2]-t,r[3]])}if(!this.dirty_&&this.renderedResolution_==h&&this.renderedRevision_==p&&this.renderedRenderOrder_==f&&Tm(this.renderedExtent_,y))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;const v=new Fw(sx(h,c),y,h,c,e.getDeclutter()),x=j_();let w;if(x){for(let t=0,e=m.length;t<e;++t)r.loadFeatures(D_(m[t],u),h,x);w=F_(x,u)}else for(let t=0,e=m.length;t<e;++t)r.loadFeatures(m[t],h,u);const b=ox(h,c),S=function(t){let r;const i=t.getStyleFunction()||e.getStyleFunction();if(i&&(r=i(t,h)),r){const e=this.renderFeature(t,b,r,v,w);this.dirty_=this.dirty_||e}}.bind(this),T=D_(y,u),C=r.getFeaturesInExtent(T);f&&C.sort(f);for(let t=0,e=C.length;t<e;++t)S(C[t]);this.renderedFeatures_=C;const E=v.finish(),R=new Xw(y,h,c,r.getOverlaps(),E,e.getRenderBuffer());return this.renderedResolution_=h,this.renderedRevision_=p,this.renderedRenderOrder_=f,this.renderedExtent_=y,this.renderedCenter_=g,this.renderedProjection_=u,this.replayGroup_=R,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(t,e,r,i,n){if(!r)return!1;let o=!1;if(Array.isArray(r))for(let s=0,a=r.length;s<a;++s)o=ax(i,t,r[s],e,this.boundHandleStyleImageChange_,n)||o;else o=ax(i,t,r,e,this.boundHandleStyleImageChange_,n);return o}};var Hw=class extends ww{constructor(t){super(t)}createRenderer(){return new Kw(this)}},Jw="image",$w="hybrid",Qw="vector";const tb={image:[ex,Jv,tx,Qv,rx],hybrid:[ex,tx],vector:[]},eb={image:[$v],hybrid:[Qv,rx,$v],vector:[ex,Jv,tx,Qv,rx,$v]};var rb=class extends vw{constructor(t){super(t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.dirty_=!1,this.renderedLayerRevision_,this.renderedPixelToCoordinateTransform_=null,this.renderedRotation_,this.renderTileImageQueue_={},this.tileListenerKeys_={},this.tmpTransform_=[1,0,0,1,0,0]}prepareTile(t,e,r,i){let n;const o=gg(t),s=t.getState();return(s===hx&&t.hifi||s===cx)&&o in this.tileListenerKeys_&&(iy(this.tileListenerKeys_[o]),delete this.tileListenerKeys_[o]),s!==hx&&s!==cx||(this.updateExecutorGroup_(t,e,r),this.tileImageNeedsRender_(t,e,r)&&(n=!0,i&&(this.renderTileImageQueue_[o]=t))),n}getTile(t,e,r,i){const n=i.pixelRatio,o=i.viewState,s=o.resolution,a=o.projection,l=this.getLayer(),u=l.getSource().getTile(t,e,r,n,a);if(u.getState()<hx){u.wantedResolution=s;const t=gg(u);if(!(t in this.tileListenerKeys_)){const e=ey(u,Jg,this.prepareTile.bind(this,u,n,a,!0));this.tileListenerKeys_[t]=e}}else{const t=i.viewHints;!!(t[dx]||t[fx])&&u.wantedResolution||(u.wantedResolution=s),this.prepareTile(u,n,a,!1)&&l.getRenderMode()!==Qw&&this.renderTileImage_(u,i)}return super.getTile(t,e,r,i)}isDrawableTile(t){const e=this.getLayer();return super.isDrawableTile(t)&&(e.getRenderMode()===Qw?gg(e)in t.executorGroups:t.hasContext(e))}getTileImage(t){return t.getImage(this.getLayer())}prepareFrame(t){const e=this.getLayer().getRevision();return this.renderedLayerRevision_!=e&&(this.renderedTiles.length=0),this.renderedLayerRevision_=e,super.prepareFrame(t)}updateExecutorGroup_(t,e,r){const i=this.getLayer(),n=i.getRevision(),o=i.getRenderOrder()||null,s=t.wantedResolution,a=t.getReplayState(i);if(!a.dirty&&a.renderedResolution===s&&a.renderedRevision==n&&a.renderedRenderOrder==o&&a.renderedZ===t.sourceZ)return;const l=i.getSource(),u=l.getTileGrid(),h=l.getTileGridForProjection(r).getTileCoordExtent(t.wrappedTileCoord),c=l.getSourceTiles(e,r,t),p=gg(i);delete t.hitDetectionImageData[p],t.executorGroups[p]=[];for(let r=0,n=c.length;r<n;++r){const n=c[r];if(n.getState()!=hx)continue;const d=n.tileCoord,f=u.getTileCoordExtent(d),g=Bm(h,f),y=Lm(f,g)?null:xm(g,i.getRenderBuffer()*s,this.tmpExtent);a.dirty=!1;const m=new Fw(0,g,s,e,i.getDeclutter()),_=ox(s,e),v=function(t){let e;const r=t.getStyleFunction()||i.getStyleFunction();if(r&&(e=r(t,s)),e){const r=this.renderFeature(t,_,e,m);this.dirty_=this.dirty_||r,a.dirty=a.dirty||r}},x=n.getFeatures();o&&o!==a.renderedRenderOrder&&x.sort(o);for(let t=0,e=x.length;t<e;++t){const e=x[t];y&&!Vm(y,e.getGeometry().getExtent())||v.call(this,e)}const w=m.finish(),b=i.getRenderMode()!==Qw&&i.getDeclutter()&&1===c.length?null:g,S=new Xw(b,s,e,l.getOverlaps(),w,i.getRenderBuffer());t.executorGroups[p].push(S)}a.renderedRevision=n,a.renderedZ=t.sourceZ,a.renderedRenderOrder=o,a.renderedResolution=s}forEachFeatureAtCoordinate(t,e,r,i,n){const o=e.viewState.resolution,s=e.viewState.rotation;r=null==r?0:r;const a=this.getLayer(),l=a.getDeclutter(),u=a.getSource().getTileGridForProjection(e.viewState.projection),h={},c=this.renderedTiles;let p,d,f;for(d=0,f=c.length;d<f;++d){const e=c[d],f=Sm(u.getTileCoordExtent(e.wrappedTileCoord),t);if(!l&&!f)continue;const g=e.executorGroups[gg(a)];for(let e=0,l=g.length;e<l;++e){const l=g[e];p=p||l.forEachFeatureAtCoordinate(t,o,s,r,(function(t){if(f||n&&-1!==n.indexOf(t)){let e=t.getId();if(void 0===e&&(e=gg(t)),!(e in h))return h[e]=!0,i(t,a)}}),a.getDeclutter()?n:null)}}return p}getFeatures(t){return new Promise(function(e,r){const i=this.getLayer(),n=gg(i),o=i.getSource(),s=this.renderedProjection,a=s.getExtent(),l=this.renderedResolution,u=o.getTileGridForProjection(s),h=my(this.renderedPixelToCoordinateTransform_,t.slice()),c=u.getTileCoordForCoordAndResolution(h,l);let p;for(let t=0,e=this.renderedTiles.length;t<e;++t)if(c.toString()===this.renderedTiles[t].tileCoord.toString()){if(p=this.renderedTiles[t],p.getState()===hx&&p.hifi){const t=u.getTileCoordExtent(p.tileCoord);o.getWrapX()&&s.canWrapX()&&!Tm(a,t)&&C_(h,s);break}p=void 0}if(!p||p.loadingSourceTiles>0)return void e([]);const d=Um(u.getTileCoordExtent(p.wrappedTileCoord)),f=[(h[0]-d[0])/l,(d[1]-h[1])/l],g=p.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]);let y=p.hitDetectionImageData[n];if(!y&&!this.animatingOrInteracting_){const t=yg(u.getTileSize(u.getZForResolution(l))),e=[t[0]/2,t[1]/2],r=this.renderedRotation_;y=qw(t,[this.getRenderTransform(u.getTileCoordCenter(p.wrappedTileCoord),l,0,.5,e[0],e[1],0)],g,i.getStyleFunction(),u.getTileCoordExtent(p.wrappedTileCoord),p.getReplayState(i).renderedResolution,r),p.hitDetectionImageData[n]=y}e(Zw(f,g,y))}.bind(this))}handleFontsChanged(){Zg(this.renderTileImageQueue_);const t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}renderFrame(t,e){const r=t.viewHints,i=!(r[dx]||r[fx]);this.renderQueuedTileImages_(i,t),super.renderFrame(t,e),this.renderedPixelToCoordinateTransform_=t.pixelToCoordinateTransform.slice(),this.renderedRotation_=t.viewState.rotation;const n=this.getLayer(),o=n.getRenderMode();if(o===Jw)return this.container;const s=n.getSource(),a=t.usedTiles[gg(s)];for(const t in this.renderTileImageQueue_)a&&t in a||delete this.renderTileImageQueue_[t];const l=this.context,u=n.getDeclutter()?{}:null,h=eb[o],c=t.pixelRatio,p=t.viewState,d=p.center,f=p.resolution,g=p.rotation,y=t.size,m=Math.round(y[0]*c),_=Math.round(y[1]*c),v=this.renderedTiles,x=s.getTileGridForProjection(t.viewState.projection),w=[],b=[];for(let t=v.length-1;t>=0;--t){const e=v[t],r=e.tileCoord,o=x.getTileCoordExtent(e.wrappedTileCoord),s=x.getTileCoordExtent(r,this.tmpExtent)[0]-o[0],a=gy(_y(this.inversePixelTransform.slice(),1/c,1/c),this.getRenderTransform(d,f,g,c,m,_,s)),p=e.executorGroups[gg(n)];let y=!1;for(let t=0,r=p.length;t<r;++t){const r=p[t];if(!r.hasExecutors(h))continue;const n=e.tileCoord[0];let o;if(!u&&!y){o=r.getClipCoords(a),l.save();for(let t=0,e=w.length;t<e;++t){const e=w[t];n<b[t]&&(l.beginPath(),l.moveTo(o[0],o[1]),l.lineTo(o[2],o[3]),l.lineTo(o[4],o[5]),l.lineTo(o[6],o[7]),l.moveTo(e[6],e[7]),l.lineTo(e[4],e[5]),l.lineTo(e[2],e[3]),l.lineTo(e[0],e[1]),l.clip())}}r.execute(l,1,a,g,i,h,u),u||y||(l.restore(),w.push(o),b.push(n),y=!0)}}if(u){Vw(u,l,g,t.layerStatesArray[t.layerIndex].opacity,i,t.declutterItems)}return this.container}renderQueuedTileImages_(t,e){for(const r in this.renderTileImageQueue_){if(!t&&Date.now()-e.time>8){e.animate=!0;break}const i=this.renderTileImageQueue_[r];delete this.renderTileImageQueue_[r],this.renderTileImage_(i,e)}}renderFeature(t,e,r,i){if(!r)return!1;let n=!1;if(Array.isArray(r))for(let o=0,s=r.length;o<s;++o)n=ax(i,t,r[o],e,this.boundHandleStyleImageChange_)||n;else n=ax(i,t,r,e,this.boundHandleStyleImageChange_);return n}tileImageNeedsRender_(t,e,r){const i=this.getLayer(),n=t.getReplayState(i),o=i.getRevision(),s=t.sourceZ,a=t.wantedResolution;return n.renderedTileResolution!==a||n.renderedTileRevision!==o||n.renderedTileZ!==s}renderTileImage_(t,e){const r=this.getLayer(),i=t.getReplayState(r),n=r.getRevision(),o=t.executorGroups[gg(r)];i.renderedTileRevision=n,i.renderedTileZ=t.sourceZ;const s=t.wrappedTileCoord,a=s[0],l=r.getSource();let u=e.pixelRatio;const h=e.viewState.projection,c=l.getTileGridForProjection(h),p=c.getResolution(t.tileCoord[0]),d=e.pixelRatio/t.wantedResolution*p,f=c.getResolution(a),g=t.getContext(r);u=Math.max(u,d/u);const y=l.getTilePixelSize(a,u,h);g.canvas.width=y[0],g.canvas.height=y[1];const m=u/d;if(1!==m){const t=fy(this.tmpTransform_);_y(t,m,m),g.setTransform.apply(g,t)}const _=c.getTileCoordExtent(s,this.tmpExtent),v=d/f,x=fy(this.tmpTransform_);_y(x,v,-v),function(t,e,r){gy(t,yy(dy,1,0,0,1,e,r))}(x,-_[0],-_[3]);for(let t=0,e=o.length;t<e;++t){o[t].execute(g,m,x,0,!0,tb[r.getRenderMode()])}i.renderedTileResolution=t.wantedResolution}};var ib=class extends ww{constructor(t){const e=t||{},r=qg({},e);delete r.preload,delete r.useInterimTilesOnError,super(r);const i=e.renderMode||$w;wg(null==i||i==Jw||i==$w||i==Qw,28),this.renderMode_=i,this.setPreload(e.preload?e.preload:0),this.setUseInterimTilesOnError(void 0===e.useInterimTilesOnError||e.useInterimTilesOnError)}createRenderer(){return new rb(this)}getFeatures(t){return super.getFeatures(t)}getRenderMode(){return this.renderMode_}getPreload(){return this.get(fw)}getUseInterimTilesOnError(){return this.get(gw)}setPreload(t){this.set(fw,t)}setUseInterimTilesOnError(t){this.set(gw,t)}};var nb,ob=/font-family: ?([^;]*);/,sb=/("|')/g;function ab(t){if(!nb){nb={};for(var e=document.styleSheets,r=0,i=e.length;r<i;++r){var n=e[r];try{var o=n.rules||n.cssRules;if(o)for(var s=0,a=o.length;s<a;++s){var l=o[s];if(5==l.type){var u=l.cssText.match(ob);nb[u[1].replace(sb,"")]=!0}}}catch(t){}}}return t in nb}var lb={},ub=bv.a.getNames();function hb(t){var e=t.toString();if(e in lb)return t;for(var r=t.map((function(t){var e=lg()(t,1).split(" ");return[e.slice(3).join(" ").replace(/"/g,""),e[1]+e[0]]})),i=0,n=r.length;i<n;++i){var o=r[i],s=o[0];if(!ab(s)&&-1!==ub.indexOf(s)){var a="https://fonts.googleapis.com/css?family="+s.replace(/ /g,"+")+":"+o[1];if(!document.querySelector('link[href="'+a+'"]')){var l=document.createElement("link");l.href=a,l.rel="stylesheet",document.head.appendChild(l)}}}return lb[e]=!0,t}var cb=/^(.*)(\?.*)$/;function pb(t,e){return e&&0===t.indexOf(".")&&(t=e+t),t}function db(t,e,r){var i=(t=pb(t,e)).match(cb);return i?i[1]+r+(i.length>2?i[2]:""):t+r}function fb(t,e,r,i,n){return new Promise((function(o,s){if("object"!=typeof e&&(e=JSON.parse(e)),8!=e.version)return s(new Error("glStyle version 8 required."));if(!(t instanceof Hw||t instanceof ib))return s(new Error("Can only apply to VectorLayer or VectorTileLayer"));var a,l,u;function h(){u||e.sprite&&!a?u?(t.setStyle(u),o()):s(new Error("Something went wrong trying to apply style.")):(u=xv(t,e,r,n,a,l,hb),t.getStyle()?o():s(new Error("Nothing to show for source ["+r+"]")))}if(e.sprite){var c=.5==(window.devicePixelRatio>=1.5?.5:1)?"@2x":"",p=db(e.sprite,i,c+".json");fetch(p,{credentials:"same-origin"}).then((function(t){return t.ok||""===c?t:(p=db(e.sprite,i,".json"),fetch(p,{credentials:"same-origin"}))})).then((function(t){if(t.ok)return t.json();s(new Error("Problem fetching sprite from "+p+": "+t.statusText))})).then((function(t){if(void 0===t||0===Object.keys(t).length)return s(new Error("No sprites found."));a=t,l=db(e.sprite,i,c+".png"),h()})).catch((function(t){s(new Error("Sprites cannot be loaded: "+p+": "+t.message))}))}else h()}))}new dw;var gb=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function yb(t){return 0!==t.indexOf("mapbox://")?"":t.slice("mapbox://".length)}var mb=function(t){function e(e){var r=t.call(this,L)||this;return r.error=e,r}return gb(e,t),e}(h),_b="vector",vb=function(t){function e(e){var r=this,i=!("declutter"in e)||e.declutter,n=new hd({state:Tn,format:new ng});return(r=t.call(this,{source:n,declutter:i,className:e.className,opacity:e.opacity,visible:e.visible,zIndex:e.zIndex,minResolution:e.minResolution,maxResolution:e.maxResolution,minZoom:e.minZoom,maxZoom:e.maxZoom,renderOrder:e.renderOrder,renderBuffer:e.renderBuffer,renderMode:e.renderMode,map:e.map,updateWhileAnimating:e.updateWhileAnimating,updateWhileInteracting:e.updateWhileInteracting,preload:e.preload,useInterimTilesOnError:e.useInterimTilesOnError})||this).sourceId=e.source,r.layers=e.layers,r.accessToken=e.accessToken,r.fetchStyle(e.styleUrl),r}return gb(e,t),e.prototype.fetchStyle=function(t){var e=this,r=function(t,e){var r=yb(t);if(!r)return t;if(0!==r.indexOf("styles/"))throw new Error("unexpected style url: "+t);return"https://api.mapbox.com/styles/v1/"+r.slice("styles/".length)+"?&access_token="+e}(t,this.accessToken);fetch(r).then((function(t){if(!t.ok)throw new Error("unexpected response when fetching style: "+t.status);return t.json()})).then((function(t){e.onStyleLoad(t)})).catch((function(t){e.handleError(t)}))},e.prototype.onStyleLoad=function(t){var e,r,i=this;if(this.layers){for(var n={},o=0;o<t.layers.length;++o){var s=t.layers[o];s.source&&(n[s.id]=s.source)}var a=void 0;for(o=0;o<this.layers.length;++o){var l=n[this.layers[o]];if(!l)return void this.handleError(new Error("could not find source for "+this.layers[o]));if(a){if(a!==l)return void this.handleError(new Error("layers can only use a single source, found "+a+" and "+l))}else a=l}e=a,r=this.layers}else r=e=this.sourceId;r||(r=e=Object.keys(t.sources)[0]),t.sprite&&(t.sprite=function(t,e){var r=yb(t);if(!r)return t;if(0!==r.indexOf("sprites/"))throw new Error("unexpected sprites url: "+t);return"https://api.mapbox.com/styles/v1/"+r.slice("sprites/".length)+"/sprite?access_token="+e}(t.sprite,this.accessToken)),t.glyphs&&(t.glyphs=function(t,e){var r=yb(t);if(!r)return t;if(0!==r.indexOf("fonts/"))throw new Error("unexpected fonts url: "+t);return"https://api.mapbox.com/fonts/v1/"+r.slice("fonts/".length)+"/0-255.pbf?access_token="+e}(t.glyphs,this.accessToken));var u=t.sources[e];if(u.type===_b){var h,c,p,d=this.getSource();d.setUrl((h=u.url,c=this.accessToken,(p=yb(h))?"https://{a-d}.tiles.mapbox.com/v4/"+p+"/{z}/{x}/{y}.vector.pbf?access_token="+c:h)),fb(this,t,r).then((function(){d.setState(Cn)})).catch((function(t){i.handleError(t)}))}else this.handleError(new Error("only works for vector sources, found "+u.type))},e.prototype.handleError=function(t){this.dispatchEvent(new mb(t)),this.getSource().setState(En)},e}(sg),xb=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),wb=function(t){function e(e){var r=this,i=e||{},n=T({},i);return delete n.imageRatio,(r=t.call(this,n)||this).imageRatio_=void 0!==i.imageRatio?i.imageRatio:1,r}return xb(e,t),e.prototype.getImageRatio=function(){return this.imageRatio_},e.prototype.createRenderer=function(){return new df(this)},e}(_d),bb=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Sb="addfeatures",Tb=function(t){function e(e,r,i,n){var o=t.call(this,e)||this;return o.features=i,o.file=r,o.projection=n,o}return bb(e,t),e}(h),Cb=function(t){function e(e){var r=this,i=e||{};return(r=t.call(this,{handleEvent:w})||this).formatConstructors_=i.formatConstructors?i.formatConstructors:[],r.projection_=i.projection?gr(i.projection):null,r.dropListenKeys_=null,r.source_=i.source||null,r.target=i.target?i.target:null,r}return bb(e,t),e.prototype.handleResult_=function(t,e){var r=e.target.result,i=this.getMap(),n=this.projection_;n||(n=i.getView().getProjection());for(var o=this.formatConstructors_,s=0,a=o.length;s<a;++s){var l=new o[s],u=this.tryReadFeatures_(l,r,{featureProjection:n});if(u&&u.length>0){this.source_&&(this.source_.clear(),this.source_.addFeatures(u)),this.dispatchEvent(new Tb(Sb,t,u,n));break}}},e.prototype.registerListeners_=function(){var t=this.getMap();if(t){var e=this.target?this.target:t.getViewport();this.dropListenKeys_=[W(e,j,this.handleDrop,this),W(e,k,this.handleStop,this),W(e,N,this.handleStop,this),W(e,j,this.handleStop,this)]}},e.prototype.setActive=function(e){!this.getActive()&&e&&this.registerListeners_(),this.getActive()&&!e&&this.unregisterListeners_(),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.unregisterListeners_(),t.prototype.setMap.call(this,e),this.getActive()&&this.registerListeners_()},e.prototype.tryReadFeatures_=function(t,e,r){try{return t.readFeatures(e,r)}catch(t){return null}},e.prototype.unregisterListeners_=function(){this.dropListenKeys_&&(this.dropListenKeys_.forEach(X),this.dropListenKeys_=null)},e.prototype.handleDrop=function(t){for(var e=t.dataTransfer.files,r=0,i=e.length;r<i;++r){var n=e.item(r),o=new FileReader;o.addEventListener(z,this.handleResult_.bind(this,n)),o.readAsText(n)}},e.prototype.handleStop=function(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"},e}(Qs),Eb=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Rb=function(t){function e(e){var r=this,i=e||{};return(r=t.call(this,i)||this).condition_=i.condition?i.condition:ga,r.lastAngle_=void 0,r.lastMagnitude_=void 0,r.lastScaleDelta_=0,r.duration_=void 0!==i.duration?i.duration:400,r}return Eb(e,t),e.prototype.handleDragEvent=function(t){if(ma(t)){var e=t.map,r=e.getSize(),i=t.pixel,n=i[0]-r[0]/2,o=r[1]/2-i[1],s=Math.atan2(o,n),a=Math.sqrt(n*n+o*o),l=e.getView();if(void 0!==this.lastAngle_){var u=this.lastAngle_-s;l.adjustRotationInternal(u)}this.lastAngle_=s,void 0!==this.lastMagnitude_&&l.adjustResolutionInternal(this.lastMagnitude_/a),void 0!==this.lastMagnitude_&&(this.lastScaleDelta_=this.lastMagnitude_/a),this.lastMagnitude_=a}},e.prototype.handleUpEvent=function(t){if(!ma(t))return!0;var e=t.map.getView(),r=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,r),this.lastScaleDelta_=0,!1},e.prototype.handleDownEvent=function(t){return!!ma(t)&&(!!this.condition_(t)&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0))},e}(na),Pb=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ib=function(t){function e(e,r,i){var n=t.call(this)||this;if(void 0!==i&&void 0===r)n.setFlatCoordinates(i,e);else{var o=r||0;n.setCenterAndRadius(e,o,i)}return n}return Pb(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),void 0,this.layout)},e.prototype.closestPointXY=function(t,e,r,i){var n=this.flatCoordinates,o=t-n[0],s=e-n[1],a=o*o+s*s;if(a<i){if(0===a)for(var l=0;l<this.stride;++l)r[l]=n[l];else{var u=this.getRadius()/Math.sqrt(a);r[0]=n[0]+u*o,r[1]=n[1]+u*s;for(l=2;l<this.stride;++l)r[l]=n[l]}return r.length=this.stride,a}return i},e.prototype.containsXY=function(t,e){var r=this.flatCoordinates,i=t-r[0],n=e-r[1];return i*i+n*n<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,r=e[this.stride]-e[0];return qt(e[0]-r,e[1]-r,e[0]+r,e[1]+r,t)},e.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},e.prototype.getRadiusSquared_=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e},e.prototype.getType=function(){return gt.CIRCLE},e.prototype.intersectsExtent=function(t){if(ge(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||ie(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,r=this.flatCoordinates[e]-this.flatCoordinates[0],i=t.slice();i[e]=i[0]+r;for(var n=1;n<e;++n)i[e+n]=t[n];this.setFlatCoordinates(this.layout,i),this.changed()},e.prototype.setCenterAndRadius=function(t,e,r){this.setLayout(r,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var i=this.flatCoordinates,n=Hr(i,0,t,this.stride);i[n++]=i[0]+e;for(var o=1,s=this.stride;o<s;++o)i[n++]=i[o];i.length=n,this.changed()},e.prototype.getCoordinates=function(){return null},e.prototype.setCoordinates=function(t,e){},e.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},e.prototype.rotate=function(t,e){var r=this.getCenter(),i=this.getStride();this.setCenter(jr(r,0,r.length,i,t,e,r)),this.changed()},e.prototype.translate=function(t,e){var r=this.getCenter(),i=this.getStride();this.setCenter(Dr(r,0,r.length,i,t,e,r)),this.changed()},e}(Wr);Ib.prototype.transform;var Ob=Ib,Lb=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Mb="Point",Fb="LineString",Ab="Polygon",kb="Circle",Nb="drawstart",jb="drawend",Db="drawabort",Gb=function(t){function e(e,r){var i=t.call(this,e)||this;return i.feature=r,i}return Lb(e,t),e}(h);var zb=function(t){function e(e){var r=this,i=e;i.stopDown||(i.stopDown=b),(r=t.call(this,i)||this).shouldHandle_=!1,r.downPx_=null,r.downTimeout_,r.lastDragTime_,r.freehand_=!1,r.source_=e.source?e.source:null,r.features_=e.features?e.features:null,r.snapTolerance_=e.snapTolerance?e.snapTolerance:12,r.type_=e.type,r.mode_=function(t){var e;t===gt.POINT||t===gt.MULTI_POINT?e=Mb:t===gt.LINE_STRING||t===gt.MULTI_LINE_STRING?e=Fb:t===gt.POLYGON||t===gt.MULTI_POLYGON?e=Ab:t===gt.CIRCLE&&(e=kb);return(e)}(r.type_),r.stopClick_=!!e.stopClick,r.minPoints_=e.minPoints?e.minPoints:r.mode_===Ab?3:2,r.maxPoints_=e.maxPoints?e.maxPoints:1/0,r.finishCondition_=e.finishCondition?e.finishCondition:w;var n,o=e.geometryFunction;if(!o)if(r.type_===gt.CIRCLE)o=function(t,e,r){var i=e||new Ob([NaN,NaN]),n=Mr(t[0],r),o=sr(n,Mr(t[1],r));i.setCenterAndRadius(n,Math.sqrt(o));var s=Or();return s&&i.transform(r,s),i};else{var s,a=r.mode_;a===Mb?s=pi:a===Fb?s=Tf:a===Ab&&(s=Pi),o=function(t,e,r){var i=e;return i?a===Ab?t[0].length?i.setCoordinates([t[0].concat([t[0][0]])]):i.setCoordinates([]):i.setCoordinates(t):i=new s(t),i}}return r.geometryFunction_=o,r.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,r.finishCoordinate_=null,r.sketchFeature_=null,r.sketchPoint_=null,r.sketchCoords_=null,r.sketchLine_=null,r.sketchLineCoords_=null,r.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,r.overlay_=new Ef({source:new uc({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(n=oh(),function(t,e){return n[t.getGeometry().getType()]}),updateWhileInteracting:!0}),r.geometryName_=e.geometryName,r.condition_=e.condition?e.condition:fa,r.freehandCondition_,e.freehand?r.freehandCondition_=ha:r.freehandCondition_=e.freehandCondition?e.freehandCondition:ga,r.addEventListener(tt(Hs),r.updateState_),r}return Lb(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),this.updateState_()},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleEvent=function(e){e.originalEvent.type===M&&e.preventDefault(),this.freehand_=this.mode_!==Mb&&this.freehandCondition_(e);var r=e.type===Zo.POINTERMOVE,i=!0;!this.freehand_&&this.lastDragTime_&&e.type===Zo.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,r=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===Zo.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),i=!1):this.freehand_&&e.type===Zo.POINTERDOWN?i=!1:r?(i=e.type===Zo.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.preventDefault()):("mouse"==e.originalEvent.pointerType||e.type===Zo.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===Zo.DBLCLICK&&(i=!1),t.prototype.handleEvent.call(this,e)&&i},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new qo(Zo.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var e=!0;this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t);var r=this.mode_===kb;return this.shouldHandle_?(this.finishCoordinate_?this.freehand_||r?this.finishDrawing():this.atFinish_(t)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate):(this.startDrawing_(t),this.mode_===Mb&&this.finishDrawing()),e=!1):this.freehand_&&this.abortDrawing(),!e&&this.stopClick_&&t.stopPropagation(),e},e.prototype.handlePointerMove_=function(t){if(this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,r=t.pixel,i=e[0]-r[0],n=e[1]-r[1],o=i*i+n*n;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t):this.createOrUpdateSketchPoint_(t)},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var r=!1,i=[this.finishCoordinate_];if(this.mode_===Fb)r=this.sketchCoords_.length>this.minPoints_;else if(this.mode_===Ab){var n=this.sketchCoords_;r=n[0].length>this.minPoints_,i=[n[0][0],n[0][n[0].length-2]]}if(r)for(var o=t.map,s=0,a=i.length;s<a;s++){var l=i[s],u=o.getPixelFromCoordinate(l),h=t.pixel,c=h[0]-u[0],p=h[1]-u[1],d=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(c*c+p*p)<=d){this.finishCoordinate_=l;break}}}return e},e.prototype.createOrUpdateSketchPoint_=function(t){var e=t.coordinate.slice();this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(e):(this.sketchPoint_=new ht(new pi(e)),this.updateSketchFeatures_())},e.prototype.startDrawing_=function(t){var e=t.coordinate,r=t.map.getView().getProjection();this.finishCoordinate_=e,this.mode_===Mb?this.sketchCoords_=e.slice():this.mode_===Ab?(this.sketchCoords_=[[e.slice(),e.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[e.slice(),e.slice()],this.sketchLineCoords_&&(this.sketchLine_=new ht(new Tf(this.sketchLineCoords_)));var i=this.geometryFunction_(this.sketchCoords_,void 0,r);this.sketchFeature_=new ht,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(i),this.updateSketchFeatures_(),this.dispatchEvent(new Gb(Nb,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){var e,r,i,n=t.coordinate,o=this.sketchFeature_.getGeometry(),s=t.map.getView().getProjection();(this.mode_===Mb?r=this.sketchCoords_:this.mode_===Ab?(r=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(t)&&(n=this.finishCoordinate_.slice())):r=(e=this.sketchCoords_)[e.length-1],r[0]=n[0],r[1]=n[1],this.geometryFunction_(this.sketchCoords_,o,s),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(n);if(o.getType()==gt.POLYGON&&this.mode_!==Ab){this.sketchLine_||(this.sketchLine_=new ht);var a=o.getLinearRing(0);(i=this.sketchLine_.getGeometry())?(i.setFlatCoordinates(a.getLayout(),a.getFlatCoordinates()),i.changed()):(i=new Tf(a.getFlatCoordinates(),a.getLayout()),this.sketchLine_.setGeometry(i))}else this.sketchLineCoords_&&(i=this.sketchLine_.getGeometry()).setCoordinates(this.sketchLineCoords_);this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,r,i=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection();this.mode_===Fb?(this.finishCoordinate_=t.slice(),(r=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?r.pop():e=!0),r.push(t.slice()),this.geometryFunction_(r,i,n)):this.mode_===Ab&&((r=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?r.pop():e=!0),r.push(t.slice()),e&&(this.finishCoordinate_=r[0]),this.geometryFunction_(this.sketchCoords_,i,n)),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection();this.mode_===Fb?((t=this.sketchCoords_).splice(-2,1),this.geometryFunction_(t,e,r),t.length>=2&&(this.finishCoordinate_=t[t.length-2].slice())):this.mode_===Ab&&((t=this.sketchCoords_[0]).splice(-2,1),this.sketchLine_.getGeometry().setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,r)),0===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,r=t.getGeometry(),i=this.getMap().getView().getProjection();this.mode_===Fb?(e.pop(),this.geometryFunction_(e,r,i)):this.mode_===Ab&&(e[0].pop(),this.geometryFunction_(e,r,i),e=r.getCoordinates()),this.type_===gt.MULTI_POINT?t.setGeometry(new Wf([e])):this.type_===gt.MULTI_LINE_STRING?t.setGeometry(new Uf([e])):this.type_===gt.MULTI_POLYGON&&t.setGeometry(new qf([e])),this.dispatchEvent(new Gb(jb,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},e.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new Gb(Db,t))},e.prototype.appendCoordinates=function(t){var e=this.mode_,r=[];e===Fb?r=this.sketchCoords_:e===Ab&&(r=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]);for(var i=r.pop(),n=0;n<t.length;n++)this.addToDrawing_(t[n]);this.addToDrawing_(i)},e.prototype.extend=function(t){var e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();var r=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=r.slice(),this.sketchCoords_.push(r.slice()),this.updateSketchFeatures_(),this.dispatchEvent(new Gb(Nb,this.sketchFeature_))},e.prototype.updateSketchFeatures_=function(){var t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);var e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)},e.prototype.updateState_=function(){var t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing(),this.overlay_.setMap(e?t:null)},e}(na),Bb=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ub="extentchanged",Yb=function(t){function e(e){var r=t.call(this,Ub)||this;return r.extent=e,r}return Bb(e,t),e}(h);function Wb(){var t=oh();return function(e,r){return t[gt.POINT]}}function Vb(t){return function(e){return Dt([t,e])}}function Xb(t,e){return t[0]==e[0]?function(r){return Dt([t,[r[0],e[1]]])}:t[1]==e[1]?function(r){return Dt([t,[e[0],r[1]]])}:null}var qb=function(t){function e(e){var r,i=this,n=e||{};return(i=t.call(this,n)||this).condition_=n.condition?n.condition:ha,i.extent_=null,i.pointerHandler_=null,i.pixelTolerance_=void 0!==n.pixelTolerance?n.pixelTolerance:10,i.snappedToVertex_=!1,i.extentFeature_=null,i.vertexFeature_=null,e||(e={}),i.extentOverlay_=new Ef({source:new uc({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.boxStyle?e.boxStyle:(r=oh(),function(t,e){return r[gt.POLYGON]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),i.vertexOverlay_=new Ef({source:new uc({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.pointerStyle?e.pointerStyle:Wb(),updateWhileAnimating:!0,updateWhileInteracting:!0}),e.extent&&i.setExtent(e.extent),i}return Bb(e,t),e.prototype.snapToVertex_=function(t,e){var r=e.getCoordinateFromPixelInternal(t),i=this.getExtentInternal();if(i){var n=function(t){return[[[t[0],t[1]],[t[0],t[3]]],[[t[0],t[3]],[t[2],t[3]]],[[t[2],t[3]],[t[2],t[1]]],[[t[2],t[1]],[t[0],t[1]]]]}(i);n.sort((function(t,e){return lr(r,t)-lr(r,e)}));var o=n[0],s=tr(r,o),a=e.getPixelFromCoordinateInternal(s);if(ar(t,a)<=this.pixelTolerance_){var l=e.getPixelFromCoordinateInternal(o[0]),u=e.getPixelFromCoordinateInternal(o[1]),h=sr(a,l),c=sr(a,u),p=Math.sqrt(Math.min(h,c));return this.snappedToVertex_=p<=this.pixelTolerance_,this.snappedToVertex_&&(s=h>c?o[1]:o[0]),s}}return null},e.prototype.handlePointerMove_=function(t){var e=t.pixel,r=t.map,i=this.snapToVertex_(e,r);i||(i=r.getCoordinateFromPixelInternal(e)),this.createOrUpdatePointerFeature_(i)},e.prototype.createOrUpdateExtentFeature_=function(t){var e=this.extentFeature_;return e?t?e.setGeometry(Oi(t)):e.setGeometry(void 0):(e=new ht(t?Oi(t):{}),this.extentFeature_=e,this.extentOverlay_.getSource().addFeature(e)),e},e.prototype.createOrUpdatePointerFeature_=function(t){var e=this.vertexFeature_;e?e.getGeometry().setCoordinates(t):(e=new ht(new pi(t)),this.vertexFeature_=e,this.vertexOverlay_.getSource().addFeature(e));return e},e.prototype.handleEvent=function(e){return!e.originalEvent||!this.condition_(e)||(e.type!=Zo.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),t.prototype.handleEvent.call(this,e),!1)},e.prototype.handleDownEvent=function(t){var e=t.pixel,r=t.map,i=this.getExtentInternal(),n=this.snapToVertex_(e,r),o=function(t){var e=null,r=null;return t[0]==i[0]?e=i[2]:t[0]==i[2]&&(e=i[0]),t[1]==i[1]?r=i[3]:t[1]==i[3]&&(r=i[1]),null!==e&&null!==r?[e,r]:null};if(n&&i){var s=n[0]==i[0]||n[0]==i[2]?n[0]:null,a=n[1]==i[1]||n[1]==i[3]?n[1]:null;null!==s&&null!==a?this.pointerHandler_=Vb(o(n)):null!==s?this.pointerHandler_=Xb(o([s,i[1]]),o([s,i[3]])):null!==a&&(this.pointerHandler_=Xb(o([i[0],a]),o([i[2],a])))}else n=r.getCoordinateFromPixelInternal(e),this.setExtent([n[0],n[1],n[0],n[1]]),this.pointerHandler_=Vb(n);return!0},e.prototype.handleDragEvent=function(t){if(this.pointerHandler_){var e=t.coordinate;this.setExtent(this.pointerHandler_(e)),this.createOrUpdatePointerFeature_(e)}},e.prototype.handleUpEvent=function(t){this.pointerHandler_=null;var e=this.getExtentInternal();return e&&0!==ne(e)||this.setExtent(null),!1},e.prototype.setMap=function(e){this.extentOverlay_.setMap(e),this.vertexOverlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getExtent=function(){return Fr(this.getExtentInternal(),this.getMap().getView().getProjection())},e.prototype.getExtentInternal=function(){return this.extent_},e.prototype.setExtent=function(t){this.extent_=t||null,this.createOrUpdateExtentFeature_(t),this.dispatchEvent(new Yb(this.extent_))},e}(na),Zb=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Kb=[0,0,0,0],Hb=[],Jb="modifystart",$b="modifyend",Qb=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.features=r,n.mapBrowserEvent=i,n}return Zb(e,t),e}(h);function tS(t,e){return t.index-e.index}function eS(t,e,r){var i=e.geometry;if(i.getType()===gt.CIRCLE){var n=i;if(1===e.index){var o=Or();o&&(n=n.clone().transform(o,r));var s=sr(n.getCenter(),Mr(t,r)),a=Math.sqrt(s)-n.getRadius();return a*a}}var l=Mr(t,r);return Hb[0]=Mr(e.segment[0],r),Hb[1]=Mr(e.segment[1],r),lr(l,Hb)}function rS(t,e,r){var i=e.geometry;if(i.getType()===gt.CIRCLE&&1===e.index){var n=i,o=Or();return o&&(n=n.clone().transform(o,r)),Lr(n.getClosestPoint(Mr(t,r)),r)}var s=Mr(t,r);return Hb[0]=Mr(e.segment[0],r),Hb[1]=Mr(e.segment[1],r),Lr(tr(s,Hb),r)}var iS=function(t){function e(e){var r,i,n=t.call(this,e)||this;if(n.boundHandleFeatureChange_=n.handleFeatureChange_.bind(n),n.condition_=e.condition?e.condition:_a,n.defaultDeleteCondition_=function(t){return sa(t)&&da(t)},n.deleteCondition_=e.deleteCondition?e.deleteCondition:n.defaultDeleteCondition_,n.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:ha,n.vertexFeature_=null,n.vertexSegments_=null,n.lastPixel_=[0,0],n.ignoreNextSingleClick_=!1,n.modified_=!1,n.rBush_=new rc,n.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,n.snappedToVertex_=!1,n.changingFeature_=!1,n.dragSegments_=[],n.overlay_=new Ef({source:new uc({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:(r=oh(),function(t,e){return r[gt.POINT]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),n.SEGMENT_WRITERS_={Point:n.writePointGeometry_.bind(n),LineString:n.writeLineStringGeometry_.bind(n),LinearRing:n.writeLineStringGeometry_.bind(n),Polygon:n.writePolygonGeometry_.bind(n),MultiPoint:n.writeMultiPointGeometry_.bind(n),MultiLineString:n.writeMultiLineStringGeometry_.bind(n),MultiPolygon:n.writeMultiPolygonGeometry_.bind(n),Circle:n.writeCircleGeometry_.bind(n),GeometryCollection:n.writeGeometryCollectionGeometry_.bind(n)},n.source_=null,e.source?(n.source_=e.source,i=new at(n.source_.getFeatures()),n.source_.addEventListener(ic,n.handleSourceAdd_.bind(n)),n.source_.addEventListener(sc,n.handleSourceRemove_.bind(n))):i=e.features,!i)throw new Error("The modify interaction requires features or a source");return n.features_=i,n.features_.forEach(n.addFeature_.bind(n)),n.features_.addEventListener(rt,n.handleFeatureAdd_.bind(n)),n.features_.addEventListener(it,n.handleFeatureRemove_.bind(n)),n.lastPointerEvent_=null,n}return Zb(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var r=this.SEGMENT_WRITERS_[e.getType()];r&&r(t,e)}var i=this.getMap();i&&i.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,i),t.addEventListener(O,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t){this.modified_||(this.modified_=!0,this.dispatchEvent(new Qb(Jb,this.features_,t)))},e.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(O,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,r=[];e.forEach((function(e){t===e.feature&&r.push(e)}));for(var i=r.length-1;i>=0;--i){for(var n=r[i],o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===n&&this.dragSegments_.splice(o,1);e.remove(n)}},e.prototype.setActive=function(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.overlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},e.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},e.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},e.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e),this.addFeature_(e)}},e.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},e.prototype.writePointGeometry_=function(t,e){var r=e.getCoordinates(),i={feature:t,geometry:e,segment:[r,r]};this.rBush_.insert(e.getExtent(),i)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var r=e.getCoordinates(),i=0,n=r.length;i<n;++i){var o=r[i],s={feature:t,geometry:e,depth:[i],index:i,segment:[o,o]};this.rBush_.insert(e.getExtent(),s)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var r=e.getCoordinates(),i=0,n=r.length-1;i<n;++i){var o=r.slice(i,i+2),s={feature:t,geometry:e,index:i,segment:o};this.rBush_.insert(Dt(o),s)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var r=e.getCoordinates(),i=0,n=r.length;i<n;++i)for(var o=r[i],s=0,a=o.length-1;s<a;++s){var l=o.slice(s,s+2),u={feature:t,geometry:e,depth:[i],index:s,segment:l};this.rBush_.insert(Dt(l),u)}},e.prototype.writePolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),i=0,n=r.length;i<n;++i)for(var o=r[i],s=0,a=o.length-1;s<a;++s){var l=o.slice(s,s+2),u={feature:t,geometry:e,depth:[i],index:s,segment:l};this.rBush_.insert(Dt(l),u)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),i=0,n=r.length;i<n;++i)for(var o=r[i],s=0,a=o.length;s<a;++s)for(var l=o[s],u=0,h=l.length-1;u<h;++u){var c=l.slice(u,u+2),p={feature:t,geometry:e,depth:[s,i],index:u,segment:c};this.rBush_.insert(Dt(c),p)}},e.prototype.writeCircleGeometry_=function(t,e){var r=e.getCenter(),i={feature:t,geometry:e,index:0,segment:[r,r]},n={feature:t,geometry:e,index:1,segment:[r,r]},o=[i,n];i.featureSegments=o,n.featureSegments=o,this.rBush_.insert(Kt(r),i);var s=e,a=Or();if(a&&this.getMap()){var l=this.getMap().getView().getProjection();s=Li(s=s.clone().transform(a,l)).transform(l,a)}this.rBush_.insert(s.getExtent(),n)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var r=e.getGeometriesArray(),i=0;i<r.length;++i){var n=r[i];(0,this.SEGMENT_WRITERS_[n.getType()])(t,n)}},e.prototype.createOrUpdateVertexFeature_=function(t){var e=this.vertexFeature_;e?e.getGeometry().setCoordinates(t):(e=new ht(new pi(t)),this.vertexFeature_=e,this.overlay_.getSource().addFeature(e));return e},e.prototype.handleEvent=function(e){return!e.originalEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=Zo.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(r=!(e.type!=Zo.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==Zo.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!r);var r},e.prototype.handleDragEvent=function(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t);for(var e=t.coordinate,r=0,i=this.dragSegments_.length;r<i;++r){for(var n=this.dragSegments_[r],o=n[0],s=o.depth,a=o.geometry,l=void 0,u=o.segment,h=n[1];e.length<a.getStride();)e.push(u[h][e.length]);switch(a.getType()){case gt.POINT:l=e,u[0]=e,u[1]=e;break;case gt.MULTI_POINT:(l=a.getCoordinates())[o.index]=e,u[0]=e,u[1]=e;break;case gt.LINE_STRING:(l=a.getCoordinates())[o.index+h]=e,u[h]=e;break;case gt.MULTI_LINE_STRING:case gt.POLYGON:(l=a.getCoordinates())[s[0]][o.index+h]=e,u[h]=e;break;case gt.MULTI_POLYGON:(l=a.getCoordinates())[s[1]][s[0]][o.index+h]=e,u[h]=e;break;case gt.CIRCLE:if(u[0]=e,u[1]=e,0===o.index)this.changingFeature_=!0,a.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;var c=t.map.getView().getProjection(),p=ar(Mr(a.getCenter(),c),Mr(e,c)),d=Or();if(d){var f=a.clone().transform(d,c);f.setRadius(p),p=f.transform(c,d).getRadius()}a.setRadius(p),this.changingFeature_=!1}}l&&this.setGeometryCoordinates_(a,l)}this.createOrUpdateVertexFeature_(e)},e.prototype.handleDownEvent=function(t){if(!this.condition_(t))return!1;var e=t.coordinate;this.handlePointerAtPixel_(t.pixel,t.map,e),this.dragSegments_.length=0,this.modified_=!1;var r=this.vertexFeature_;if(r){var i=t.map.getView().getProjection(),n=[],s=r.getGeometry().getCoordinates(),a=Dt([s]),l=this.rBush_.getInExtent(a),u={};l.sort(tS);for(var h=0,c=l.length;h<c;++h){var p=l[h],d=p.segment,f=o(p.geometry),g=p.depth;if(g&&(f+="-"+g.join("-")),u[f]||(u[f]=new Array(2)),p.geometry.getType()!==gt.CIRCLE||1!==p.index)if(!ir(d[0],s)||u[f][0])if(!ir(d[1],s)||u[f][1])o(d)in this.vertexSegments_&&!u[f][0]&&!u[f][1]&&this.insertVertexCondition_(t)&&n.push([p,s]);else{if((p.geometry.getType()===gt.LINE_STRING||p.geometry.getType()===gt.MULTI_LINE_STRING)&&u[f][0]&&0===u[f][0].index)continue;this.dragSegments_.push([p,1]),u[f][1]=p}else this.dragSegments_.push([p,0]),u[f][0]=p;else ir(rS(e,p,i),s)&&!u[f][0]&&(this.dragSegments_.push([p,0]),u[f][0]=p)}n.length&&this.willModifyFeatures_(t);for(var y=n.length-1;y>=0;--y)this.insertVertex_.apply(this,n[y])}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var r=this.dragSegments_[e][0],i=r.geometry;if(i.getType()===gt.CIRCLE){var n=i.getCenter(),o=r.featureSegments[0],s=r.featureSegments[1];o.segment[0]=n,o.segment[1]=n,s.segment[0]=n,s.segment[1]=n,this.rBush_.update(Kt(n),o);var a=i,l=Or();if(l){var u=t.map.getView().getProjection();a=Li(a=a.clone().transform(l,u)).transform(u,l)}this.rBush_.update(a.getExtent(),s)}else this.rBush_.update(Dt(r.segment),r)}return this.modified_&&(this.dispatchEvent(new Qb($b,this.features_,t)),this.modified_=!1),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)},e.prototype.handlePointerAtPixel_=function(t,e,r){var i=r||e.getCoordinateFromPixel(t),n=e.getView().getProjection(),s=Fr(Gt(Ar(Kt(i,Kb),n),e.getView().getResolution()*this.pixelTolerance_,Kb),n),a=this.rBush_.getInExtent(s);if(a.length>0){a.sort((function(t,e){return eS(i,t,n)-eS(i,e,n)}));var l=a[0],u=l.segment,h=rS(i,l,n),c=e.getPixelFromCoordinate(h),p=ar(t,c);if(p<=this.pixelTolerance_){var d={};if(l.geometry.getType()===gt.CIRCLE&&1===l.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(h);else{var f=e.getPixelFromCoordinate(u[0]),g=e.getPixelFromCoordinate(u[1]),y=sr(c,f),m=sr(c,g);p=Math.sqrt(Math.min(y,m)),this.snappedToVertex_=p<=this.pixelTolerance_,this.snappedToVertex_&&(h=y>m?u[1]:u[0]),this.createOrUpdateVertexFeature_(h);for(var _=1,v=a.length;_<v;++_){var x=a[_].segment;if(!(ir(u[0],x[0])&&ir(u[1],x[1])||ir(u[0],x[1])&&ir(u[1],x[0])))break;d[o(x)]=!0}}return d[o(u)]=!0,void(this.vertexSegments_=d)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},e.prototype.insertVertex_=function(t,e){for(var r,i=t.segment,n=t.feature,o=t.geometry,s=t.depth,a=t.index;e.length<o.getStride();)e.push(0);switch(o.getType()){case gt.MULTI_LINE_STRING:case gt.POLYGON:(r=o.getCoordinates())[s[0]].splice(a+1,0,e);break;case gt.MULTI_POLYGON:(r=o.getCoordinates())[s[1]][s[0]].splice(a+1,0,e);break;case gt.LINE_STRING:(r=o.getCoordinates()).splice(a+1,0,e);break;default:return}this.setGeometryCoordinates_(o,r);var l=this.rBush_;l.remove(t),this.updateSegmentIndices_(o,a,s,1);var u={segment:[i[0],e],feature:n,geometry:o,depth:s,index:a};l.insert(Dt(u.segment),u),this.dragSegments_.push([u,1]);var h={segment:[e,i[1]],feature:n,geometry:o,depth:s,index:a+1};l.insert(Dt(h.segment),h),this.dragSegments_.push([h,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=Zo.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t);var e=this.removeVertex_();return this.dispatchEvent(new Qb($b,this.features_,t)),this.modified_=!1,e}return!1},e.prototype.removeVertex_=function(){var t,e,r,i,n,s,a,l,u,h,c,p=this.dragSegments_,d={},f=!1;for(n=p.length-1;n>=0;--n)c=o((h=(r=p[n])[0]).feature),h.depth&&(c+="-"+h.depth.join("-")),c in d||(d[c]={}),0===r[1]?(d[c].right=h,d[c].index=h.index):1==r[1]&&(d[c].left=h,d[c].index=h.index+1);for(c in d){switch(u=d[c].right,a=d[c].left,(l=(s=d[c].index)-1)<0&&(l=0),t=e=(i=(h=void 0!==a?a:u).geometry).getCoordinates(),f=!1,i.getType()){case gt.MULTI_LINE_STRING:e[h.depth[0]].length>2&&(e[h.depth[0]].splice(s,1),f=!0);break;case gt.LINE_STRING:e.length>2&&(e.splice(s,1),f=!0);break;case gt.MULTI_POLYGON:t=t[h.depth[1]];case gt.POLYGON:(t=t[h.depth[0]]).length>4&&(s==t.length-1&&(s=0),t.splice(s,1),f=!0,0===s&&(t.pop(),t.push(t[0]),l=t.length-1))}if(f){this.setGeometryCoordinates_(i,e);var g=[];if(void 0!==a&&(this.rBush_.remove(a),g.push(a.segment[0])),void 0!==u&&(this.rBush_.remove(u),g.push(u.segment[1])),void 0!==a&&void 0!==u){var y={depth:h.depth,feature:h.feature,geometry:h.geometry,index:l,segment:g};this.rBush_.insert(Dt(y.segment),y)}this.updateSegmentIndices_(i,s,h.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),p.length=0}}return f},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,r,i){this.rBush_.forEachInExtent(t.getExtent(),(function(n){n.geometry===t&&(void 0===r||void 0===n.depth||v(n.depth,r))&&n.index>e&&(n.index+=i)}))},e}(na),nS=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),oS="select",sS=function(t){function e(e,r,i,n){var o=t.call(this,e)||this;return o.selected=r,o.deselected=i,o.mapBrowserEvent=n,o}return nS(e,t),e}(h),aS={};var lS=function(t){function e(e){var r,i,n=t.call(this)||this,o=e||{};if(n.boundAddFeature_=n.addFeature_.bind(n),n.boundRemoveFeature_=n.removeFeature_.bind(n),n.condition_=o.condition?o.condition:da,n.addCondition_=o.addCondition?o.addCondition:pa,n.removeCondition_=o.removeCondition?o.removeCondition:pa,n.toggleCondition_=o.toggleCondition?o.toggleCondition:ga,n.multi_=!!o.multi&&o.multi,n.filter_=o.filter?o.filter:w,n.hitTolerance_=o.hitTolerance?o.hitTolerance:0,n.style_=void 0!==o.style?o.style:(m((r=oh())[gt.POLYGON],r[gt.LINE_STRING]),m(r[gt.GEOMETRY_COLLECTION],r[gt.LINE_STRING]),function(t){return t.getGeometry()?r[t.getGeometry().getType()]:null}),n.features_=o.features||new at,o.layers)if("function"==typeof o.layers)i=o.layers;else{var s=o.layers;i=function(t){return f(s,t)}}else i=w;return n.layerFilter_=i,n.featureLayerAssociation_={},n}return nS(e,t),e.prototype.addFeatureLayerAssociation_=function(t,e){this.featureLayerAssociation_[o(t)]=e},e.prototype.getFeatures=function(){return this.features_},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.getLayer=function(t){return this.featureLayerAssociation_[o(t)]},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){this.getMap()&&this.style_&&this.features_.forEach(this.restorePreviousStyle_.bind(this)),t.prototype.setMap.call(this,e),e?(this.features_.addEventListener(rt,this.boundAddFeature_),this.features_.addEventListener(it,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(rt,this.boundAddFeature_),this.features_.removeEventListener(it,this.boundRemoveFeature_))},e.prototype.addFeature_=function(t){var e=t.element;this.style_&&this.applySelectedStyle_(e)},e.prototype.removeFeature_=function(t){var e=t.element;this.style_&&this.restorePreviousStyle_(e)},e.prototype.getStyle=function(){return this.style_},e.prototype.applySelectedStyle_=function(t){var e=o(t);e in aS||(aS[e]=t.getStyle()),t.setStyle(this.style_)},e.prototype.restorePreviousStyle_=function(t){var r=o(t),i=this.getMap().getInteractions().getArray().filter((function(r){return r instanceof e&&r.getStyle()&&-1!==r.getFeatures().getArray().indexOf(t)}));i.length>0?t.setStyle(i[i.length-1].getStyle()):(t.setStyle(aS[r]),delete aS[r])},e.prototype.removeFeatureLayerAssociation_=function(t){delete this.featureLayerAssociation_[o(t)]},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;var e=this.addCondition_(t),r=this.removeCondition_(t),i=this.toggleCondition_(t),n=!e&&!r&&!i,o=t.map,s=this.getFeatures(),a=[],l=[];if(n){C(this.featureLayerAssociation_),o.forEachFeatureAtPixel(t.pixel,function(t,e){if(this.filter_(t,e))return l.push(t),this.addFeatureLayerAssociation_(t,e),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var u=s.getLength()-1;u>=0;--u){var h=s.item(u),c=l.indexOf(h);c>-1?l.splice(c,1):(s.remove(h),a.push(h))}0!==l.length&&s.extend(l)}else{o.forEachFeatureAtPixel(t.pixel,function(t,n){if(this.filter_(t,n))return!e&&!i||f(s.getArray(),t)?(r||i)&&f(s.getArray(),t)&&(a.push(t),this.removeFeatureLayerAssociation_(t)):(l.push(t),this.addFeatureLayerAssociation_(t,n)),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var p=a.length-1;p>=0;--p)s.remove(a[p]);s.extend(l)}return(l.length>0||a.length>0)&&this.dispatchEvent(new sS(oS,l,a,t)),!0},e}(Qs),uS=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function hS(t){return t.feature?t.feature:t.element?t.element:void 0}var cS=[],pS=function(t){function e(e){var r=this,i=e||{},n=i;return n.handleDownEvent||(n.handleDownEvent=w),n.stopDown||(n.stopDown=b),(r=t.call(this,n)||this).source_=i.source?i.source:null,r.vertex_=void 0===i.vertex||i.vertex,r.edge_=void 0===i.edge||i.edge,r.features_=i.features?i.features:null,r.featuresListenerKeys_=[],r.featureChangeListenerKeys_={},r.indexedFeaturesExtents_={},r.pendingFeatures_={},r.pixelTolerance_=void 0!==i.pixelTolerance?i.pixelTolerance:10,r.rBush_=new rc,r.SEGMENT_WRITERS_={Point:r.writePointGeometry_.bind(r),LineString:r.writeLineStringGeometry_.bind(r),LinearRing:r.writeLineStringGeometry_.bind(r),Polygon:r.writePolygonGeometry_.bind(r),MultiPoint:r.writeMultiPointGeometry_.bind(r),MultiLineString:r.writeMultiLineStringGeometry_.bind(r),MultiPolygon:r.writeMultiPolygonGeometry_.bind(r),GeometryCollection:r.writeGeometryCollectionGeometry_.bind(r),Circle:r.writeCircleGeometry_.bind(r)},r}return uS(e,t),e.prototype.addFeature=function(t,e){var r=void 0===e||e,i=o(t),n=t.getGeometry();if(n){var s=this.SEGMENT_WRITERS_[n.getType()];s&&(this.indexedFeaturesExtents_[i]=n.getExtent([1/0,1/0,-1/0,-1/0]),s(t,n))}r&&(this.featureChangeListenerKeys_[i]=W(t,O,this.handleFeatureChange_,this))},e.prototype.forEachFeatureAdd_=function(t){this.addFeature(t)},e.prototype.forEachFeatureRemove_=function(t){this.removeFeature(t)},e.prototype.getFeatures_=function(){var t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t},e.prototype.handleEvent=function(e){var r=this.snapTo(e.pixel,e.coordinate,e.map);return r.snapped&&(e.coordinate=r.vertex.slice(0,2),e.pixel=r.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=hS(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=hS(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var r=o(e);r in this.pendingFeatures_||(this.pendingFeatures_[r]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=E(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var r=void 0===e||e,i=o(t),n=this.indexedFeaturesExtents_[i];if(n){var s=this.rBush_,a=[];s.forEachInExtent(n,(function(e){t===e.feature&&a.push(e)}));for(var l=a.length-1;l>=0;--l)s.remove(a[l])}r&&(X(this.featureChangeListenerKeys_[i]),delete this.featureChangeListenerKeys_[i])},e.prototype.setMap=function(e){var r=this.getMap(),i=this.featuresListenerKeys_,n=this.getFeatures_();r&&(i.forEach(X),i.length=0,n.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?i.push(W(this.features_,rt,this.handleFeatureAdd_,this),W(this.features_,it,this.handleFeatureRemove_,this)):this.source_&&i.push(W(this.source_,ic,this.handleFeatureAdd_,this),W(this.source_,sc,this.handleFeatureRemove_,this)),n.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,r){var i=Dt([r.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),r.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),n=this.rBush_.getInExtent(i);this.vertex_&&!this.edge_&&(n=n.filter((function(t){return t.feature.getGeometry().getType()!==gt.CIRCLE})));var o=!1,s=null,a=null;if(0===n.length)return{snapped:o,vertex:s,vertexPixel:a};for(var l,u=r.getView().getProjection(),h=Mr(e,u),c=1/0,p=0;p<n.length;++p){var d=n[p];cS[0]=Mr(d.segment[0],u),cS[1]=Mr(d.segment[1],u);var f=lr(h,cS);f<c&&(l=d,c=f)}var g=l.segment;if(this.vertex_&&!this.edge_){var y=r.getPixelFromCoordinate(g[0]),m=r.getPixelFromCoordinate(g[1]),_=sr(t,y),v=sr(t,m);Math.sqrt(Math.min(_,v))<=this.pixelTolerance_&&(o=!0,s=_>v?g[1]:g[0],a=r.getPixelFromCoordinate(s))}else if(this.edge_){var x=l.feature.getGeometry().getType()===gt.CIRCLE;if(x){var w=l.feature.getGeometry(),b=Or();b&&(w=w.clone().transform(b,u)),s=Lr(function(t,e){var r=e.getRadius(),i=e.getCenter(),n=i[0],o=i[1],s=t[0]-n,a=t[1]-o;0===s&&0===a&&(s=1);var l=Math.sqrt(s*s+a*a);return[n+r*s/l,o+r*a/l]}(h,w),u)}else cS[0]=Mr(g[0],u),cS[1]=Mr(g[1],u),s=Lr(tr(h,cS),u);if(ar(t,a=r.getPixelFromCoordinate(s))<=this.pixelTolerance_&&(o=!0,this.vertex_&&!x)){y=r.getPixelFromCoordinate(g[0]),m=r.getPixelFromCoordinate(g[1]),_=sr(a,y),v=sr(a,m);Math.sqrt(Math.min(_,v))<=this.pixelTolerance_&&(s=_>v?g[1]:g[0],a=r.getPixelFromCoordinate(s))}}return o&&(a=[Math.round(a[0]),Math.round(a[1])]),{snapped:o,vertex:s,vertexPixel:a}},e.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},e.prototype.writeCircleGeometry_=function(t,e){var r=this.getMap().getView().getProjection(),i=e,n=Or();n&&(i=i.clone().transform(n,r));var o=Li(i);n&&o.transform(r,n);for(var s=o.getCoordinates()[0],a=0,l=s.length-1;a<l;++a){var u=s.slice(a,a+2),h={feature:t,segment:u};this.rBush_.insert(Dt(u),h)}},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var r=e.getGeometriesArray(),i=0;i<r.length;++i){var n=this.SEGMENT_WRITERS_[r[i].getType()];n&&n(t,r[i])}},e.prototype.writeLineStringGeometry_=function(t,e){for(var r=e.getCoordinates(),i=0,n=r.length-1;i<n;++i){var o=r.slice(i,i+2),s={feature:t,segment:o};this.rBush_.insert(Dt(o),s)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var r=e.getCoordinates(),i=0,n=r.length;i<n;++i)for(var o=r[i],s=0,a=o.length-1;s<a;++s){var l=o.slice(s,s+2),u={feature:t,segment:l};this.rBush_.insert(Dt(l),u)}},e.prototype.writeMultiPointGeometry_=function(t,e){for(var r=e.getCoordinates(),i=0,n=r.length;i<n;++i){var o=r[i],s={feature:t,segment:[o,o]};this.rBush_.insert(e.getExtent(),s)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),i=0,n=r.length;i<n;++i)for(var o=r[i],s=0,a=o.length;s<a;++s)for(var l=o[s],u=0,h=l.length-1;u<h;++u){var c=l.slice(u,u+2),p={feature:t,segment:c};this.rBush_.insert(Dt(c),p)}},e.prototype.writePointGeometry_=function(t,e){var r=e.getCoordinates(),i={feature:t,segment:[r,r]};this.rBush_.insert(e.getExtent(),i)},e.prototype.writePolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),i=0,n=r.length;i<n;++i)for(var o=r[i],s=0,a=o.length-1;s<a;++s){var l=o.slice(s,s+2),u={feature:t,segment:l};this.rBush_.insert(Dt(l),u)}},e}(na),dS=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),fS="translatestart",gS="translating",yS="translateend",mS=function(t){function e(e,r,i,n,o){var s=t.call(this,e)||this;return s.features=r,s.coordinate=i,s.startCoordinate=n,s.mapBrowserEvent=o,s}return dS(e,t),e}(h),_S=function(t){function e(e){var r,i=this,n=e||{};if((i=t.call(this,n)||this).lastCoordinate_=null,i.startCoordinate_=null,i.features_=void 0!==n.features?n.features:null,n.layers)if("function"==typeof n.layers)r=n.layers;else{var o=n.layers;r=function(t){return f(o,t)}}else r=w;return i.layerFilter_=r,i.filter_=n.filter?n.filter:w,i.hitTolerance_=n.hitTolerance?n.hitTolerance:0,i.lastFeature_=null,i.addEventListener(tt(Hs),i.handleActiveChanged_),i}return dS(e,t),e.prototype.handleDownEvent=function(t){if(this.lastFeature_=this.featuresAtPixel_(t.pixel,t.map),!this.lastCoordinate_&&this.lastFeature_){this.startCoordinate_=t.coordinate,this.lastCoordinate_=t.coordinate,this.handleMoveEvent(t);var e=this.features_||new at([this.lastFeature_]);return this.dispatchEvent(new mS(fS,e,t.coordinate,this.startCoordinate_,t)),!0}return!1},e.prototype.handleUpEvent=function(t){if(this.lastCoordinate_){this.lastCoordinate_=null,this.handleMoveEvent(t);var e=this.features_||new at([this.lastFeature_]);return this.dispatchEvent(new mS(yS,e,t.coordinate,this.startCoordinate_,t)),this.startCoordinate_=null,!0}return!1},e.prototype.handleDragEvent=function(t){if(this.lastCoordinate_){var e=t.coordinate,r=e[0]-this.lastCoordinate_[0],i=e[1]-this.lastCoordinate_[1],n=this.features_||new at([this.lastFeature_]);n.forEach((function(t){var e=t.getGeometry();e.translate(r,i),t.setGeometry(e)})),this.lastCoordinate_=e,this.dispatchEvent(new mS(gS,n,e,this.startCoordinate_,t))}},e.prototype.handleMoveEvent=function(t){var e=t.map.getViewport();this.featuresAtPixel_(t.pixel,t.map)?(e.classList.remove(this.lastCoordinate_?"ol-grab":"ol-grabbing"),e.classList.add(this.lastCoordinate_?"ol-grabbing":"ol-grab")):e.classList.remove("ol-grab","ol-grabbing")},e.prototype.featuresAtPixel_=function(t,e){return e.forEachFeatureAtPixel(t,function(t,e){if(this.filter_(t,e)&&(!this.features_||f(this.features_.getArray(),t)))return t}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){var r=this.getMap();t.prototype.setMap.call(this,e),this.updateState_(r)},e.prototype.handleActiveChanged_=function(){this.updateState_(null)},e.prototype.updateState_=function(t){var e=this.getMap(),r=this.getActive();e&&r||(e=e||t)&&e.getViewport().classList.remove("ol-grab","ol-grabbing")},e}(na),vS=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function xS(t){for(var e=[],r=0,i=t.length;r<i;++r)e.push(t[r].clone());return e}var wS=function(t){function e(e){var r=t.call(this)||this;return r.geometries_=e||null,r.changeEventsKeys_=[],r.listenGeometriesChange_(),r}return vS(e,t),e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(X),this.changeEventsKeys_.length=0},e.prototype.listenGeometriesChange_=function(){if(this.geometries_)for(var t=0,e=this.geometries_.length;t<e;++t)this.changeEventsKeys_.push(W(this.geometries_[t],O,this.changed,this))},e.prototype.clone=function(){var t=new e(null);return t.setGeometries(this.geometries_),t},e.prototype.closestPointXY=function(t,e,r,i){if(i<Bt(this.getExtent(),t,e))return i;for(var n=this.geometries_,o=0,s=n.length;o<s;++o)i=n[o].closestPointXY(t,e,r,i);return i},e.prototype.containsXY=function(t,e){for(var r=this.geometries_,i=0,n=r.length;i<n;++i)if(r[i].containsXY(t,e))return!0;return!1},e.prototype.computeExtent=function(t){Zt(t);for(var e=this.geometries_,r=0,i=e.length;r<i;++r)$t(t,e[r].getExtent());return t},e.prototype.getGeometries=function(){return xS(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getGeometriesArrayRecursive=function(){for(var t=[],e=this.geometries_,r=0,i=e.length;r<i;++r)e[r].getType()===this.getType()?t=t.concat(e[r].getGeometriesArrayRecursive()):t.push(e[r]);return t},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;for(var r=[],i=this.geometries_,n=!1,o=0,s=i.length;o<s;++o){var a=i[o],l=a.getSimplifiedGeometry(t);r.push(l),l!==a&&(n=!0)}if(n){var u=new e(null);return u.setGeometriesArray(r),u}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return gt.GEOMETRY_COLLECTION},e.prototype.intersectsExtent=function(t){for(var e=this.geometries_,r=0,i=e.length;r<i;++r)if(e[r].intersectsExtent(t))return!0;return!1},e.prototype.isEmpty=function(){return 0===this.geometries_.length},e.prototype.rotate=function(t,e){for(var r=this.geometries_,i=0,n=r.length;i<n;++i)r[i].rotate(t,e);this.changed()},e.prototype.scale=function(t,e,r){var i=r;i||(i=ae(this.getExtent()));for(var n=this.geometries_,o=0,s=n.length;o<s;++o)n[o].scale(t,e,i);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(xS(t))},e.prototype.setGeometriesArray=function(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()},e.prototype.applyTransform=function(t){for(var e=this.geometries_,r=0,i=e.length;r<i;++r)e[r].applyTransform(t);this.changed()},e.prototype.translate=function(t,e){for(var r=this.geometries_,i=0,n=r.length;i<n;++i)r[i].translate(t,e);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),t.prototype.disposeInternal.call(this)},e}(Br),bS=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function SS(t){if("string"==typeof t){var e=JSON.parse(t);return e||null}return null!==t?t:null}var TS=function(t){function e(){return t.call(this)||this}return bS(e,t),e.prototype.getType=function(){return gl},e.prototype.readFeature=function(t,e){return this.readFeatureFromObject(SS(t),this.getReadOptions(t,e))},e.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(SS(t),this.getReadOptions(t,e))},e.prototype.readFeatureFromObject=function(t,e){return i()},e.prototype.readFeaturesFromObject=function(t,e){return i()},e.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(SS(t),this.getReadOptions(t,e))},e.prototype.readGeometryFromObject=function(t,e){return i()},e.prototype.readProjection=function(t){return this.readProjectionFromObject(SS(t))},e.prototype.readProjectionFromObject=function(t){return i()},e.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},e.prototype.writeFeatureObject=function(t,e){return i()},e.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},e.prototype.writeFeaturesObject=function(t,e){return i()},e.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},e.prototype.writeGeometryObject=function(t,e){return i()},e}(Df),CS=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),ES={};ES[gt.POINT]=function(t){var e;e=void 0!==t.m&&void 0!==t.z?new pi([t.x,t.y,t.z,t.m],ft):void 0!==t.z?new pi([t.x,t.y,t.z],pt):void 0!==t.m?new pi([t.x,t.y,t.m],dt):new pi([t.x,t.y]);return e},ES[gt.LINE_STRING]=function(t){var e=IS(t);return new Tf(t.paths[0],e)},ES[gt.POLYGON]=function(t){var e=IS(t);return new Pi(t.rings,e)},ES[gt.MULTI_POINT]=function(t){var e=IS(t);return new Wf(t.points,e)},ES[gt.MULTI_LINE_STRING]=function(t){var e=IS(t);return new Uf(t.paths,e)},ES[gt.MULTI_POLYGON]=function(t){var e=IS(t);return new qf(t.rings,e)};var RS={};function PS(t,e){var r,i,n;if(!t)return null;if("number"==typeof t.x&&"number"==typeof t.y)n=gt.POINT;else if(t.points)n=gt.MULTI_POINT;else if(t.paths){n=1===t.paths.length?gt.LINE_STRING:gt.MULTI_LINE_STRING}else if(t.rings){var o=t,s=IS(o),a=function(t,e){var r,i,n=[],o=[],s=[];for(r=0,i=t.length;r<i;++r){n.length=0,Jr(n,0,t[r],e.length),bi(n,0,n.length,e.length)?o.push([t[r]]):s.push(t[r])}for(;s.length;){var a=s.shift(),l=!1;for(r=o.length-1;r>=0;r--){var u=o[r][0];if(Yt(new hi(u).getExtent(),new hi(a).getExtent())){o[r].push(a),l=!0;break}}l||o.push([a.reverse()])}return o}(o.rings,s);1===a.length?(n=gt.POLYGON,t=T({},t,((r={}).rings=a[0],r))):(n=gt.MULTI_POLYGON,t=T({},t,((i={}).rings=a,i)))}return Gf((0,ES[n])(t),!1,e)}function IS(t){var e=ct;return!0===t.hasZ&&!0===t.hasM?e=ft:!0===t.hasZ?e=pt:!0===t.hasM&&(e=dt),e}function OS(t){var e=t.getLayout();return{hasZ:e===pt||e===ft,hasM:e===dt||e===ft}}function LS(t,e){return(0,RS[t.getType()])(Gf(t,!0,e),e)}RS[gt.POINT]=function(t,e){var r,i=t.getCoordinates(),n=t.getLayout();n===pt?r={x:i[0],y:i[1],z:i[2]}:n===dt?r={x:i[0],y:i[1],m:i[2]}:n===ft?r={x:i[0],y:i[1],z:i[2],m:i[3]}:n===ct?r={x:i[0],y:i[1]}:lt(!1,34);return r},RS[gt.LINE_STRING]=function(t,e){var r=OS(t);return{hasZ:r.hasZ,hasM:r.hasM,paths:[t.getCoordinates()]}},RS[gt.POLYGON]=function(t,e){var r=OS(t);return{hasZ:r.hasZ,hasM:r.hasM,rings:t.getCoordinates(!1)}},RS[gt.MULTI_POINT]=function(t,e){var r=OS(t);return{hasZ:r.hasZ,hasM:r.hasM,points:t.getCoordinates()}},RS[gt.MULTI_LINE_STRING]=function(t,e){var r=OS(t);return{hasZ:r.hasZ,hasM:r.hasM,paths:t.getCoordinates()}},RS[gt.MULTI_POLYGON]=function(t,e){for(var r=OS(t),i=t.getCoordinates(!1),n=[],o=0;o<i.length;o++)for(var s=i[o].length-1;s>=0;s--)n.push(i[o][s]);return{hasZ:r.hasZ,hasM:r.hasM,rings:n}};var MS=function(t){function e(e){var r=this,i=e||{};return(r=t.call(this)||this).geometryName_=i.geometryName,r}return CS(e,t),e.prototype.readFeatureFromObject=function(t,e,r){var i=t,n=PS(i.geometry,e),o=new ht;if(this.geometryName_&&o.setGeometryName(this.geometryName_),o.setGeometry(n),i.attributes){o.setProperties(i.attributes,!0);var s=i.attributes[r];void 0!==s&&o.setId(s)}return o},e.prototype.readFeaturesFromObject=function(t,e){var r=e||{};if(t.features){for(var i=[],n=t.features,o=0,s=n.length;o<s;++o)i.push(this.readFeatureFromObject(n[o],r,t.objectIdFieldName));return i}return[this.readFeatureFromObject(t,r)]},e.prototype.readGeometryFromObject=function(t,e){return PS(t,e)},e.prototype.readProjectionFromObject=function(t){return t.spatialReference&&void 0!==t.spatialReference.wkid?gr("EPSG:"+t.spatialReference.wkid):null},e.prototype.writeGeometryObject=function(t,e){return LS(t,this.adaptOptions(e))},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var r={};if(!t.hasProperties())return r.attributes={},r;var i=t.getProperties(),n=t.getGeometry();return n&&(r.geometry=LS(n,e),e&&e.featureProjection&&(r.geometry.spatialReference={wkid:Number(gr(e.featureProjection).getCode().split(":").pop())}),delete i[t.getGeometryName()]),R(i)?r.attributes={}:r.attributes=i,r},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var r=[],i=0,n=t.length;i<n;++i)r.push(this.writeFeatureObject(t[i],e));return{features:r}},e}(TS),FS=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),AS=function(t){function e(){var e=t.call(this)||this;return e.xmlSerializer_=(void 0===su&&"undefined"!=typeof XMLSerializer&&(su=new XMLSerializer),su),e}return FS(e,t),e.prototype.getType=function(){return ml},e.prototype.readFeature=function(t,e){if(t){if("string"==typeof t){var r=Wl(t);return this.readFeatureFromDocument(r,e)}return Yl(t)?this.readFeatureFromDocument(t,e):this.readFeatureFromNode(t,e)}return null},e.prototype.readFeatureFromDocument=function(t,e){var r=this.readFeaturesFromDocument(t,e);return r.length>0?r[0]:null},e.prototype.readFeatureFromNode=function(t,e){return null},e.prototype.readFeatures=function(t,e){if(t){if("string"==typeof t){var r=Wl(t);return this.readFeaturesFromDocument(r,e)}return Yl(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}return[]},e.prototype.readFeaturesFromDocument=function(t,e){for(var r=[],i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&m(r,this.readFeaturesFromNode(i,e));return r},e.prototype.readFeaturesFromNode=function(t,e){return i()},e.prototype.readGeometry=function(t,e){if(t){if("string"==typeof t){var r=Wl(t);return this.readGeometryFromDocument(r,e)}return Yl(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}return null},e.prototype.readGeometryFromDocument=function(t,e){return null},e.prototype.readGeometryFromNode=function(t,e){return null},e.prototype.readProjection=function(t){if(t){if("string"==typeof t){var e=Wl(t);return this.readProjectionFromDocument(e)}return Yl(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},e.prototype.readProjectionFromDocument=function(t){return this.dataProjection},e.prototype.readProjectionFromNode=function(t){return this.dataProjection},e.prototype.writeFeature=function(t,e){var r=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeFeatureNode=function(t,e){return null},e.prototype.writeFeatures=function(t,e){var r=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeFeaturesNode=function(t,e){return null},e.prototype.writeGeometry=function(t,e){var r=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeGeometryNode=function(t,e){return null},e}(Df),kS=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),NS="http://www.opengis.net/gml",jS=/^[\s\xa0]*$/,DS=function(t){function e(e){var r=t.call(this)||this,i=e||{};return r.featureType=i.featureType,r.featureNS=i.featureNS,r.srsName=i.srsName,r.schemaLocation="",r.FEATURE_COLLECTION_PARSERS={},r.FEATURE_COLLECTION_PARSERS[r.namespace]={featureMember:Xl(r.readFeaturesInternal),featureMembers:ql(r.readFeaturesInternal)},r}return kS(e,t),e.prototype.readFeaturesInternal=function(t,e){var r=t.localName,i=null;if("FeatureCollection"==r)i=iu([],this.FEATURE_COLLECTION_PARSERS,t,e,this);else if("featureMembers"==r||"featureMember"==r){var n=e[0],o=n.featureType,s=n.featureNS;if(!o&&t.childNodes){o=[],s={};for(var a=0,l=t.childNodes.length;a<l;++a){var u=t.childNodes[a];if(1===u.nodeType){var h=u.nodeName.split(":").pop();if(-1===o.indexOf(h)){var c="",p=0,d=u.namespaceURI;for(var f in s){if(s[f]===d){c=f;break}++p}c||(s[c="p"+p]=d),o.push(c+":"+h)}}}"featureMember"!=r&&(n.featureType=o,n.featureNS=s)}if("string"==typeof s){var g=s;(s={}).p0=g}var y={},m=Array.isArray(o)?o:[o];for(var _ in s){var v={};for(a=0,l=m.length;a<l;++a){(-1===m[a].indexOf(":")?"p0":m[a].split(":")[0])===_&&(v[m[a].split(":").pop()]="featureMembers"==r?Xl(this.readFeatureElement,this):ql(this.readFeatureElement,this))}y[s[_]]=v}i=iu("featureMember"==r?void 0:[],y,t,e)}return null===i&&(i=[]),i},e.prototype.readGeometryElement=function(t,e){var r=e[0];r.srsName=t.firstElementChild.getAttribute("srsName"),r.srsDimension=t.firstElementChild.getAttribute("srsDimension");var i=iu(null,this.GEOMETRY_PARSERS,t,e,this);return i?Array.isArray(i)?zf(i,r):Gf(i,!1,r):void 0},e.prototype.readFeatureElementInternal=function(t,e,r){for(var i,n={},o=t.firstElementChild;o;o=o.nextElementSibling){var s=void 0,a=o.localName;0===o.childNodes.length||1===o.childNodes.length&&(3===o.firstChild.nodeType||4===o.firstChild.nodeType)?(s=Ul(o,!1),jS.test(s)&&(s=void 0)):(r&&(s=this.readGeometryElement(o,e)),s?"boundedBy"!==a&&(i=a):s=this.readFeatureElementInternal(o,e,!1)),n[a]?(n[a]instanceof Array||(n[a]=[n[a]]),n[a].push(s)):n[a]=s;var l=o.attributes.length;if(l>0){n[a]={_content_:n[a]};for(var u=0;u<l;u++){var h=o.attributes[u].name;n[a][h]=o.attributes[u].value}}}if(r){var c=new ht(n);i&&c.setGeometryName(i);var p=t.getAttribute("fid")||function(t,e,r){return t.getAttributeNS(e,r)||""}(t,this.namespace,"id");return p&&c.setId(p),c}return n},e.prototype.readFeatureElement=function(t,e){return this.readFeatureElementInternal(t,e,!0)},e.prototype.readPoint=function(t,e){var r=this.readFlatCoordinatesFromNode(t,e);if(r)return new pi(r,pt)},e.prototype.readMultiPoint=function(t,e){var r=iu([],this.MULTIPOINT_PARSERS,t,e,this);return r?new Wf(r):void 0},e.prototype.readMultiLineString=function(t,e){var r=iu([],this.MULTILINESTRING_PARSERS,t,e,this);if(r)return new Uf(r)},e.prototype.readMultiPolygon=function(t,e){var r=iu([],this.MULTIPOLYGON_PARSERS,t,e,this);if(r)return new qf(r)},e.prototype.pointMemberParser=function(t,e){ru(this.POINTMEMBER_PARSERS,t,e,this)},e.prototype.lineStringMemberParser=function(t,e){ru(this.LINESTRINGMEMBER_PARSERS,t,e,this)},e.prototype.polygonMemberParser=function(t,e){ru(this.POLYGONMEMBER_PARSERS,t,e,this)},e.prototype.readLineString=function(t,e){var r=this.readFlatCoordinatesFromNode(t,e);return r?new Tf(r,pt):void 0},e.prototype.readFlatLinearRing=function(t,e){var r=iu(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,e,this);return r||void 0},e.prototype.readLinearRing=function(t,e){var r=this.readFlatCoordinatesFromNode(t,e);if(r)return new hi(r,pt)},e.prototype.readPolygon=function(t,e){var r=iu([null],this.FLAT_LINEAR_RINGS_PARSERS,t,e,this);if(r&&r[0]){var i,n=r[0],o=[n.length],s=void 0;for(s=1,i=r.length;s<i;++s)m(n,r[s]),o.push(n.length);return new Pi(n,pt,o)}},e.prototype.readFlatCoordinatesFromNode=function(t,e){return iu(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,e,this)},e.prototype.readGeometryFromNode=function(t,e){var r=this.readGeometryElement(t,[this.getReadOptions(t,e||{})]);return r||null},e.prototype.readFeaturesFromNode=function(t,e){var r={featureType:this.featureType,featureNS:this.featureNS};return e&&T(r,this.getReadOptions(t,e)),this.readFeaturesInternal(t,[r])||[]},e.prototype.readProjectionFromNode=function(t){return gr(this.srsName?this.srsName:t.firstElementChild.getAttribute("srsName"))},e}(AS);DS.prototype.namespace=NS,DS.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{}},DS.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{}},DS.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{}},DS.prototype.MULTIPOINT_PARSERS={"http://www.opengis.net/gml":{pointMember:Xl(DS.prototype.pointMemberParser),pointMembers:Xl(DS.prototype.pointMemberParser)}},DS.prototype.MULTILINESTRING_PARSERS={"http://www.opengis.net/gml":{lineStringMember:Xl(DS.prototype.lineStringMemberParser),lineStringMembers:Xl(DS.prototype.lineStringMemberParser)}},DS.prototype.MULTIPOLYGON_PARSERS={"http://www.opengis.net/gml":{polygonMember:Xl(DS.prototype.polygonMemberParser),polygonMembers:Xl(DS.prototype.polygonMemberParser)}},DS.prototype.POINTMEMBER_PARSERS={"http://www.opengis.net/gml":{Point:Xl(DS.prototype.readFlatCoordinatesFromNode)}},DS.prototype.LINESTRINGMEMBER_PARSERS={"http://www.opengis.net/gml":{LineString:Xl(DS.prototype.readLineString)}},DS.prototype.POLYGONMEMBER_PARSERS={"http://www.opengis.net/gml":{Polygon:Xl(DS.prototype.readPolygon)}},DS.prototype.RING_PARSERS={"http://www.opengis.net/gml":{LinearRing:ql(DS.prototype.readFlatLinearRing)}};var GS=DS;function zS(t){return BS(Ul(t,!1))}function BS(t){var e=/^\s*(true|1)|(false|0)\s*$/.exec(t);return e?void 0!==e[1]||!1:void 0}function US(t){var e=Ul(t,!1),r=Date.parse(e);return isNaN(r)?void 0:r/1e3}function YS(t){return WS(Ul(t,!1))}function WS(t){var e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(t);return e?parseFloat(e[1]):void 0}function VS(t){return XS(Ul(t,!1))}function XS(t){var e=/^\s*(\d+)\s*$/.exec(t);return e?parseInt(e[1],10):void 0}function qS(t){return Ul(t,!1).trim()}function ZS(t,e){JS(t,e?"1":"0")}function KS(t,e){var r=e.toPrecision();t.appendChild(lu().createTextNode(r))}function HS(t,e){var r=e.toString();t.appendChild(lu().createTextNode(r))}function JS(t,e){t.appendChild(lu().createTextNode(e))}var $S=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),QS={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"},tT=function(t){function e(e){var r=this,i=e||{};return(r=t.call(this,i)||this).surface_=void 0!==i.surface&&i.surface,r.curve_=void 0!==i.curve&&i.curve,r.multiCurve_=void 0===i.multiCurve||i.multiCurve,r.multiSurface_=void 0===i.multiSurface||i.multiSurface,r.schemaLocation=i.schemaLocation?i.schemaLocation:"http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd",r.hasZ=void 0!==i.hasZ&&i.hasZ,r}return $S(e,t),e.prototype.readMultiCurve=function(t,e){var r=iu([],this.MULTICURVE_PARSERS,t,e,this);return r?new Uf(r):void 0},e.prototype.readMultiSurface=function(t,e){var r=iu([],this.MULTISURFACE_PARSERS,t,e,this);if(r)return new qf(r)},e.prototype.curveMemberParser=function(t,e){ru(this.CURVEMEMBER_PARSERS,t,e,this)},e.prototype.surfaceMemberParser=function(t,e){ru(this.SURFACEMEMBER_PARSERS,t,e,this)},e.prototype.readPatch=function(t,e){return iu([null],this.PATCHES_PARSERS,t,e,this)},e.prototype.readSegment=function(t,e){return iu([null],this.SEGMENTS_PARSERS,t,e,this)},e.prototype.readPolygonPatch=function(t,e){return iu([null],this.FLAT_LINEAR_RINGS_PARSERS,t,e,this)},e.prototype.readLineStringSegment=function(t,e){return iu([null],this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,e,this)},e.prototype.interiorParser=function(t,e){var r=iu(void 0,this.RING_PARSERS,t,e,this);r&&e[e.length-1].push(r)},e.prototype.exteriorParser=function(t,e){var r=iu(void 0,this.RING_PARSERS,t,e,this);r&&(e[e.length-1][0]=r)},e.prototype.readSurface=function(t,e){var r=iu([null],this.SURFACE_PARSERS,t,e,this);if(r&&r[0]){var i,n=r[0],o=[n.length],s=void 0;for(s=1,i=r.length;s<i;++s)m(n,r[s]),o.push(n.length);return new Pi(n,pt,o)}},e.prototype.readCurve=function(t,e){var r=iu([null],this.CURVE_PARSERS,t,e,this);return r?new Tf(r,pt):void 0},e.prototype.readEnvelope=function(t,e){var r=iu([null],this.ENVELOPE_PARSERS,t,e,this);return qt(r[1][0],r[1][1],r[2][0],r[2][1])},e.prototype.readFlatPos=function(t,e){for(var r,i=Ul(t,!1),n=/^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/,o=[];r=n.exec(i);)o.push(parseFloat(r[1])),i=i.substr(r[0].length);if(""===i){var s=e[0].srsName,a="enu";if(s)a=gr(s).getAxisOrientation();if("neu"===a){var l,u=void 0;for(u=0,l=o.length;u<l;u+=3){var h=o[u],c=o[u+1];o[u]=c,o[u+1]=h}}var p=o.length;if(2==p&&o.push(0),0!==p)return o}},e.prototype.readFlatPosList=function(t,e){var r=Ul(t,!1).replace(/^\s*|\s*$/g,""),i=e[0],n=i.srsName,o=i.srsDimension,s="enu";n&&(s=gr(n).getAxisOrientation());var a,l,u,h=r.split(/\s+/),c=2;t.getAttribute("srsDimension")?c=XS(t.getAttribute("srsDimension")):t.getAttribute("dimension")?c=XS(t.getAttribute("dimension")):t.parentNode.getAttribute("srsDimension")?c=XS(t.parentNode.getAttribute("srsDimension")):o&&(c=XS(o));for(var p=[],d=0,f=h.length;d<f;d+=c)a=parseFloat(h[d]),l=parseFloat(h[d+1]),u=3===c?parseFloat(h[d+2]):0,"en"===s.substr(0,2)?p.push(a,l,u):p.push(l,a,u);return p},e.prototype.writePos_=function(t,e,r){var i=r[r.length-1],n=i.hasZ,o=n?"3":"2";t.setAttribute("srsDimension",o);var s=i.srsName,a="enu";s&&(a=gr(s).getAxisOrientation());var l,u=e.getCoordinates();(l="en"===a.substr(0,2)?u[0]+" "+u[1]:u[1]+" "+u[0],n)&&(l+=" "+(u[2]||0));JS(t,l)},e.prototype.getCoords_=function(t,e,r){var i="enu";e&&(i=gr(e).getAxisOrientation());var n="en"===i.substr(0,2)?t[0]+" "+t[1]:t[1]+" "+t[0];r&&(n+=" "+(t[2]||0));return n},e.prototype.writePosList_=function(t,e,r){var i=r[r.length-1],n=i.hasZ,o=n?"3":"2";t.setAttribute("srsDimension",o);for(var s,a=i.srsName,l=e.getCoordinates(),u=l.length,h=new Array(u),c=0;c<u;++c)s=l[c],h[c]=this.getCoords_(s,a,n);JS(t,h.join(" "))},e.prototype.writePoint=function(t,e,r){var i=r[r.length-1].srsName;i&&t.setAttribute("srsName",i);var n=Bl(t.namespaceURI,"pos");t.appendChild(n),this.writePos_(n,e,r)},e.prototype.writeEnvelope=function(t,e,r){var i=r[r.length-1].srsName;i&&t.setAttribute("srsName",i);var n=[e[0]+" "+e[1],e[2]+" "+e[3]];ou({node:t},this.ENVELOPE_SERIALIZERS,Ql,n,r,["lowerCorner","upperCorner"],this)},e.prototype.writeLinearRing=function(t,e,r){var i=r[r.length-1].srsName;i&&t.setAttribute("srsName",i);var n=Bl(t.namespaceURI,"posList");t.appendChild(n),this.writePosList_(n,e,r)},e.prototype.RING_NODE_FACTORY_=function(t,e,r){var i=e[e.length-1],n=i.node,o=i.exteriorWritten;return void 0===o&&(i.exteriorWritten=!0),Bl(n.namespaceURI,void 0!==o?"interior":"exterior")},e.prototype.writeSurfaceOrPolygon=function(t,e,r){var i=r[r.length-1],n=i.hasZ,o=i.srsName;if("PolygonPatch"!==t.nodeName&&o&&t.setAttribute("srsName",o),"Polygon"===t.nodeName||"PolygonPatch"===t.nodeName){var s=e.getLinearRings();ou({node:t,hasZ:n,srsName:o},this.RING_SERIALIZERS,this.RING_NODE_FACTORY_,s,r,void 0,this)}else if("Surface"===t.nodeName){var a=Bl(t.namespaceURI,"patches");t.appendChild(a),this.writeSurfacePatches_(a,e,r)}},e.prototype.writeCurveOrLineString=function(t,e,r){var i=r[r.length-1].srsName;if("LineStringSegment"!==t.nodeName&&i&&t.setAttribute("srsName",i),"LineString"===t.nodeName||"LineStringSegment"===t.nodeName){var n=Bl(t.namespaceURI,"posList");t.appendChild(n),this.writePosList_(n,e,r)}else if("Curve"===t.nodeName){var o=Bl(t.namespaceURI,"segments");t.appendChild(o),this.writeCurveSegments_(o,e,r)}},e.prototype.writeMultiSurfaceOrPolygon=function(t,e,r){var i=r[r.length-1],n=i.hasZ,o=i.srsName,s=i.surface;o&&t.setAttribute("srsName",o);var a=e.getPolygons();ou({node:t,hasZ:n,srsName:o,surface:s},this.SURFACEORPOLYGONMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,a,r,void 0,this)},e.prototype.writeMultiPoint=function(t,e,r){var i=r[r.length-1],n=i.srsName,o=i.hasZ;n&&t.setAttribute("srsName",n);var s=e.getPoints();ou({node:t,hasZ:o,srsName:n},this.POINTMEMBER_SERIALIZERS,$l("pointMember"),s,r,void 0,this)},e.prototype.writeMultiCurveOrLineString=function(t,e,r){var i=r[r.length-1],n=i.hasZ,o=i.srsName,s=i.curve;o&&t.setAttribute("srsName",o);var a=e.getLineStrings();ou({node:t,hasZ:n,srsName:o,curve:s},this.LINESTRINGORCURVEMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,a,r,void 0,this)},e.prototype.writeRing=function(t,e,r){var i=Bl(t.namespaceURI,"LinearRing");t.appendChild(i),this.writeLinearRing(i,e,r)},e.prototype.writeSurfaceOrPolygonMember=function(t,e,r){var i=this.GEOMETRY_NODE_FACTORY_(e,r);i&&(t.appendChild(i),this.writeSurfaceOrPolygon(i,e,r))},e.prototype.writePointMember=function(t,e,r){var i=Bl(t.namespaceURI,"Point");t.appendChild(i),this.writePoint(i,e,r)},e.prototype.writeLineStringOrCurveMember=function(t,e,r){var i=this.GEOMETRY_NODE_FACTORY_(e,r);i&&(t.appendChild(i),this.writeCurveOrLineString(i,e,r))},e.prototype.writeSurfacePatches_=function(t,e,r){var i=Bl(t.namespaceURI,"PolygonPatch");t.appendChild(i),this.writeSurfaceOrPolygon(i,e,r)},e.prototype.writeCurveSegments_=function(t,e,r){var i=Bl(t.namespaceURI,"LineStringSegment");t.appendChild(i),this.writeCurveOrLineString(i,e,r)},e.prototype.writeGeometryElement=function(t,e,r){var i,n=r[r.length-1],o=T({},n);o.node=t,i=Array.isArray(e)?zf(e,n):Gf(e,!0,n),ou(o,this.GEOMETRY_SERIALIZERS,this.GEOMETRY_NODE_FACTORY_,[i],r,void 0,this)},e.prototype.writeFeatureElement=function(t,e,r){var i=e.getId();i&&t.setAttribute("fid",i);var n=r[r.length-1],o=n.featureNS,s=e.getGeometryName();n.serializers||(n.serializers={},n.serializers[o]={});var a=[],l=[];if(e.hasProperties()){var u=e.getProperties();for(var h in u){var c=u[h];null!==c&&(a.push(h),l.push(c),h==s||"function"==typeof c.getSimplifiedGeometry?h in n.serializers[o]||(n.serializers[o][h]=Hl(this.writeGeometryElement,this)):h in n.serializers[o]||(n.serializers[o][h]=Hl(JS)))}}var p=T({},n);p.node=t,ou(p,n.serializers,$l(void 0,o),l,r,a)},e.prototype.writeFeatureMembers_=function(t,e,r){var i=r[r.length-1],n=i.featureType,o=i.featureNS,s={};s[o]={},s[o][n]=Hl(this.writeFeatureElement,this);var a=T({},i);a.node=t,ou(a,s,$l(n,o),e,r)},e.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_=function(t,e,r){var i=e[e.length-1].node;return Bl(this.namespace,QS[i.nodeName])},e.prototype.GEOMETRY_NODE_FACTORY_=function(t,e,r){var i,n=e[e.length-1],o=n.multiSurface,s=n.surface,a=n.curve,l=n.multiCurve;return Array.isArray(t)?i="Envelope":"MultiPolygon"===(i=t.getType())&&!0===o?i="MultiSurface":"Polygon"===i&&!0===s?i="Surface":"LineString"===i&&!0===a?i="Curve":"MultiLineString"===i&&!0===l&&(i="MultiCurve"),Bl(this.namespace,i)},e.prototype.writeGeometryNode=function(t,e){e=this.adaptOptions(e);var r=Bl(this.namespace,"geom"),i={node:r,hasZ:this.hasZ,srsName:this.srsName,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_};return e&&T(i,e),this.writeGeometryElement(r,t,[i]),r},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var r=Bl(this.namespace,"featureMembers");r.setAttributeNS(zl,"xsi:schemaLocation",this.schemaLocation);var i={srsName:this.srsName,hasZ:this.hasZ,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_,featureNS:this.featureNS,featureType:this.featureType};return e&&T(i,e),this.writeFeatureMembers_(r,t,[i]),r},e}(GS);tT.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{pos:ql(tT.prototype.readFlatPos),posList:ql(tT.prototype.readFlatPosList)}},tT.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{interior:tT.prototype.interiorParser,exterior:tT.prototype.exteriorParser}},tT.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:ql(GS.prototype.readPoint),MultiPoint:ql(GS.prototype.readMultiPoint),LineString:ql(GS.prototype.readLineString),MultiLineString:ql(GS.prototype.readMultiLineString),LinearRing:ql(GS.prototype.readLinearRing),Polygon:ql(GS.prototype.readPolygon),MultiPolygon:ql(GS.prototype.readMultiPolygon),Surface:ql(tT.prototype.readSurface),MultiSurface:ql(tT.prototype.readMultiSurface),Curve:ql(tT.prototype.readCurve),MultiCurve:ql(tT.prototype.readMultiCurve),Envelope:ql(tT.prototype.readEnvelope)}},tT.prototype.MULTICURVE_PARSERS={"http://www.opengis.net/gml":{curveMember:Xl(tT.prototype.curveMemberParser),curveMembers:Xl(tT.prototype.curveMemberParser)}},tT.prototype.MULTISURFACE_PARSERS={"http://www.opengis.net/gml":{surfaceMember:Xl(tT.prototype.surfaceMemberParser),surfaceMembers:Xl(tT.prototype.surfaceMemberParser)}},tT.prototype.CURVEMEMBER_PARSERS={"http://www.opengis.net/gml":{LineString:Xl(GS.prototype.readLineString),Curve:Xl(tT.prototype.readCurve)}},tT.prototype.SURFACEMEMBER_PARSERS={"http://www.opengis.net/gml":{Polygon:Xl(GS.prototype.readPolygon),Surface:Xl(tT.prototype.readSurface)}},tT.prototype.SURFACE_PARSERS={"http://www.opengis.net/gml":{patches:ql(tT.prototype.readPatch)}},tT.prototype.CURVE_PARSERS={"http://www.opengis.net/gml":{segments:ql(tT.prototype.readSegment)}},tT.prototype.ENVELOPE_PARSERS={"http://www.opengis.net/gml":{lowerCorner:Xl(tT.prototype.readFlatPosList),upperCorner:Xl(tT.prototype.readFlatPosList)}},tT.prototype.PATCHES_PARSERS={"http://www.opengis.net/gml":{PolygonPatch:ql(tT.prototype.readPolygonPatch)}},tT.prototype.SEGMENTS_PARSERS={"http://www.opengis.net/gml":{LineStringSegment:ql(tT.prototype.readLineStringSegment)}},tT.prototype.writeFeatures,tT.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml":{exterior:Hl(tT.prototype.writeRing),interior:Hl(tT.prototype.writeRing)}},tT.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml":{lowerCorner:Hl(JS),upperCorner:Hl(JS)}},tT.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{surfaceMember:Hl(tT.prototype.writeSurfaceOrPolygonMember),polygonMember:Hl(tT.prototype.writeSurfaceOrPolygonMember)}},tT.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{pointMember:Hl(tT.prototype.writePointMember)}},tT.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{lineStringMember:Hl(tT.prototype.writeLineStringOrCurveMember),curveMember:Hl(tT.prototype.writeLineStringOrCurveMember)}},tT.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml":{Curve:Hl(tT.prototype.writeCurveOrLineString),MultiCurve:Hl(tT.prototype.writeMultiCurveOrLineString),Point:Hl(tT.prototype.writePoint),MultiPoint:Hl(tT.prototype.writeMultiPoint),LineString:Hl(tT.prototype.writeCurveOrLineString),MultiLineString:Hl(tT.prototype.writeMultiCurveOrLineString),LinearRing:Hl(tT.prototype.writeLinearRing),Polygon:Hl(tT.prototype.writeSurfaceOrPolygon),MultiPolygon:Hl(tT.prototype.writeMultiSurfaceOrPolygon),Surface:Hl(tT.prototype.writeSurfaceOrPolygon),MultiSurface:Hl(tT.prototype.writeMultiSurfaceOrPolygon),Envelope:Hl(tT.prototype.writeEnvelope)}};var eT=tT,rT=eT;rT.prototype.writeFeatures,rT.prototype.writeFeaturesNode;var iT=rT,nT=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),oT={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"},sT=function(t){function e(e){var r=this,i=e||{};return(r=t.call(this,i)||this).FEATURE_COLLECTION_PARSERS[NS].featureMember=Xl(r.readFeaturesInternal),r.schemaLocation=i.schemaLocation?i.schemaLocation:"http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd",r}return nT(e,t),e.prototype.readFlatCoordinates=function(t,e){var r=Ul(t,!1).replace(/^\s*|\s*$/g,""),i=e[0].srsName,n="enu";if(i){var o=gr(i);o&&(n=o.getAxisOrientation())}for(var s=r.trim().split(/\s+/),a=[],l=0,u=s.length;l<u;l++){var h=s[l].split(/,+/),c=parseFloat(h[0]),p=parseFloat(h[1]),d=3===h.length?parseFloat(h[2]):0;"en"===n.substr(0,2)?a.push(c,p,d):a.push(p,c,d)}return a},e.prototype.readBox=function(t,e){var r=iu([null],this.BOX_PARSERS_,t,e,this);return qt(r[1][0],r[1][1],r[1][3],r[1][4])},e.prototype.innerBoundaryIsParser=function(t,e){var r=iu(void 0,this.RING_PARSERS,t,e,this);r&&e[e.length-1].push(r)},e.prototype.outerBoundaryIsParser=function(t,e){var r=iu(void 0,this.RING_PARSERS,t,e,this);r&&(e[e.length-1][0]=r)},e.prototype.GEOMETRY_NODE_FACTORY_=function(t,e,r){var i,n=e[e.length-1],o=n.multiSurface,s=n.surface,a=n.multiCurve;return Array.isArray(t)?i="Envelope":"MultiPolygon"===(i=t.getType())&&!0===o?i="MultiSurface":"Polygon"===i&&!0===s?i="Surface":"MultiLineString"===i&&!0===a&&(i="MultiCurve"),Bl("http://www.opengis.net/gml",i)},e.prototype.writeFeatureElement=function(t,e,r){var i=e.getId();i&&t.setAttribute("fid",i);var n=r[r.length-1],o=n.featureNS,s=e.getGeometryName();n.serializers||(n.serializers={},n.serializers[o]={});var a=[],l=[];if(e.hasProperties()){var u=e.getProperties();for(var h in u){var c=u[h];null!==c&&(a.push(h),l.push(c),h==s||"function"==typeof c.getSimplifiedGeometry?h in n.serializers[o]||(n.serializers[o][h]=Hl(this.writeGeometryElement,this)):h in n.serializers[o]||(n.serializers[o][h]=Hl(JS)))}}var p=T({},n);p.node=t,ou(p,n.serializers,$l(void 0,o),l,r,a)},e.prototype.writeCurveOrLineString=function(t,e,r){var i=r[r.length-1].srsName;if("LineStringSegment"!==t.nodeName&&i&&t.setAttribute("srsName",i),"LineString"===t.nodeName||"LineStringSegment"===t.nodeName){var n=this.createCoordinatesNode_(t.namespaceURI);t.appendChild(n),this.writeCoordinates_(n,e,r)}else if("Curve"===t.nodeName){var o=Bl(t.namespaceURI,"segments");t.appendChild(o),this.writeCurveSegments_(o,e,r)}},e.prototype.writeLineStringOrCurveMember=function(t,e,r){var i=this.GEOMETRY_NODE_FACTORY_(e,r);i&&(t.appendChild(i),this.writeCurveOrLineString(i,e,r))},e.prototype.writeMultiCurveOrLineString=function(t,e,r){var i=r[r.length-1],n=i.hasZ,o=i.srsName,s=i.curve;o&&t.setAttribute("srsName",o);var a=e.getLineStrings();ou({node:t,hasZ:n,srsName:o,curve:s},this.LINESTRINGORCURVEMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,a,r,void 0,this)},e.prototype.writeGeometryElement=function(t,e,r){var i,n=r[r.length-1],o=T({},n);o.node=t,i=Array.isArray(e)?zf(e,n):Gf(e,!0,n),ou(o,this.GEOMETRY_SERIALIZERS,this.GEOMETRY_NODE_FACTORY_,[i],r,void 0,this)},e.prototype.createCoordinatesNode_=function(t){var e=Bl(t,"coordinates");return e.setAttribute("decimal","."),e.setAttribute("cs",","),e.setAttribute("ts"," "),e},e.prototype.writeCoordinates_=function(t,e,r){for(var i=r[r.length-1],n=i.hasZ,o=i.srsName,s=e.getCoordinates(),a=s.length,l=new Array(a),u=0;u<a;++u){var h=s[u];l[u]=this.getCoords_(h,o,n)}JS(t,l.join(" "))},e.prototype.writeCurveSegments_=function(t,e,r){var i=Bl(t.namespaceURI,"LineStringSegment");t.appendChild(i),this.writeCurveOrLineString(i,e,r)},e.prototype.writeSurfaceOrPolygon=function(t,e,r){var i=r[r.length-1],n=i.hasZ,o=i.srsName;if("PolygonPatch"!==t.nodeName&&o&&t.setAttribute("srsName",o),"Polygon"===t.nodeName||"PolygonPatch"===t.nodeName){var s=e.getLinearRings();ou({node:t,hasZ:n,srsName:o},this.RING_SERIALIZERS,this.RING_NODE_FACTORY_,s,r,void 0,this)}else if("Surface"===t.nodeName){var a=Bl(t.namespaceURI,"patches");t.appendChild(a),this.writeSurfacePatches_(a,e,r)}},e.prototype.RING_NODE_FACTORY_=function(t,e,r){var i=e[e.length-1],n=i.node,o=i.exteriorWritten;return void 0===o&&(i.exteriorWritten=!0),Bl(n.namespaceURI,void 0!==o?"innerBoundaryIs":"outerBoundaryIs")},e.prototype.writeSurfacePatches_=function(t,e,r){var i=Bl(t.namespaceURI,"PolygonPatch");t.appendChild(i),this.writeSurfaceOrPolygon(i,e,r)},e.prototype.writeRing=function(t,e,r){var i=Bl(t.namespaceURI,"LinearRing");t.appendChild(i),this.writeLinearRing(i,e,r)},e.prototype.getCoords_=function(t,e,r){var i="enu";e&&(i=gr(e).getAxisOrientation());var n="en"===i.substr(0,2)?t[0]+","+t[1]:t[1]+","+t[0];r&&(n+=","+(t[2]||0));return n},e.prototype.writePoint=function(t,e,r){var i=r[r.length-1],n=i.hasZ,o=i.srsName;o&&t.setAttribute("srsName",o);var s=this.createCoordinatesNode_(t.namespaceURI);t.appendChild(s);var a=e.getCoordinates();JS(s,this.getCoords_(a,o,n))},e.prototype.writeMultiPoint=function(t,e,r){var i=r[r.length-1],n=i.hasZ,o=i.srsName;o&&t.setAttribute("srsName",o);var s=e.getPoints();ou({node:t,hasZ:n,srsName:o},this.POINTMEMBER_SERIALIZERS,$l("pointMember"),s,r,void 0,this)},e.prototype.writePointMember=function(t,e,r){var i=Bl(t.namespaceURI,"Point");t.appendChild(i),this.writePoint(i,e,r)},e.prototype.writeLinearRing=function(t,e,r){var i=r[r.length-1].srsName;i&&t.setAttribute("srsName",i);var n=this.createCoordinatesNode_(t.namespaceURI);t.appendChild(n),this.writeCoordinates_(n,e,r)},e.prototype.writeMultiSurfaceOrPolygon=function(t,e,r){var i=r[r.length-1],n=i.hasZ,o=i.srsName,s=i.surface;o&&t.setAttribute("srsName",o);var a=e.getPolygons();ou({node:t,hasZ:n,srsName:o,surface:s},this.SURFACEORPOLYGONMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,a,r,void 0,this)},e.prototype.writeSurfaceOrPolygonMember=function(t,e,r){var i=this.GEOMETRY_NODE_FACTORY_(e,r);i&&(t.appendChild(i),this.writeSurfaceOrPolygon(i,e,r))},e.prototype.writeEnvelope=function(t,e,r){var i=r[r.length-1].srsName;i&&t.setAttribute("srsName",i);var n=[e[0]+" "+e[1],e[2]+" "+e[3]];ou({node:t},this.ENVELOPE_SERIALIZERS,Ql,n,r,["lowerCorner","upperCorner"],this)},e.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_=function(t,e,r){var i=e[e.length-1].node;return Bl("http://www.opengis.net/gml",oT[i.nodeName])},e}(GS);sT.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{coordinates:ql(sT.prototype.readFlatCoordinates)}},sT.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{innerBoundaryIs:sT.prototype.innerBoundaryIsParser,outerBoundaryIs:sT.prototype.outerBoundaryIsParser}},sT.prototype.BOX_PARSERS_={"http://www.opengis.net/gml":{coordinates:Xl(sT.prototype.readFlatCoordinates)}},sT.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:ql(GS.prototype.readPoint),MultiPoint:ql(GS.prototype.readMultiPoint),LineString:ql(GS.prototype.readLineString),MultiLineString:ql(GS.prototype.readMultiLineString),LinearRing:ql(GS.prototype.readLinearRing),Polygon:ql(GS.prototype.readPolygon),MultiPolygon:ql(GS.prototype.readMultiPolygon),Box:ql(sT.prototype.readBox)}},sT.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml":{Curve:Hl(sT.prototype.writeCurveOrLineString),MultiCurve:Hl(sT.prototype.writeMultiCurveOrLineString),Point:Hl(sT.prototype.writePoint),MultiPoint:Hl(sT.prototype.writeMultiPoint),LineString:Hl(sT.prototype.writeCurveOrLineString),MultiLineString:Hl(sT.prototype.writeMultiCurveOrLineString),LinearRing:Hl(sT.prototype.writeLinearRing),Polygon:Hl(sT.prototype.writeSurfaceOrPolygon),MultiPolygon:Hl(sT.prototype.writeMultiSurfaceOrPolygon),Surface:Hl(sT.prototype.writeSurfaceOrPolygon),MultiSurface:Hl(sT.prototype.writeMultiSurfaceOrPolygon),Envelope:Hl(sT.prototype.writeEnvelope)}},sT.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{lineStringMember:Hl(sT.prototype.writeLineStringOrCurveMember),curveMember:Hl(sT.prototype.writeLineStringOrCurveMember)}},sT.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml":{outerBoundaryIs:Hl(sT.prototype.writeRing),innerBoundaryIs:Hl(sT.prototype.writeRing)}},sT.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{pointMember:Hl(sT.prototype.writePointMember)}},sT.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{surfaceMember:Hl(sT.prototype.writeSurfaceOrPolygonMember),polygonMember:Hl(sT.prototype.writeSurfaceOrPolygonMember)}},sT.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml":{lowerCorner:Hl(JS),upperCorner:Hl(JS)}};var aT=sT,lT=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),uT=function(t){function e(e){var r=this,i=e||{};return(r=t.call(this,i)||this).schemaLocation=i.schemaLocation?i.schemaLocation:r.namespace+" http://schemas.opengis.net/gml/3.2.1/gml.xsd",r}return lT(e,t),e}(eT);uT.prototype.namespace="http://www.opengis.net/gml/3.2",uT.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml/3.2":{pos:ql(eT.prototype.readFlatPos),posList:ql(eT.prototype.readFlatPosList)}},uT.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml/3.2":{interior:eT.prototype.interiorParser,exterior:eT.prototype.exteriorParser}},uT.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml/3.2":{Point:ql(GS.prototype.readPoint),MultiPoint:ql(GS.prototype.readMultiPoint),LineString:ql(GS.prototype.readLineString),MultiLineString:ql(GS.prototype.readMultiLineString),LinearRing:ql(GS.prototype.readLinearRing),Polygon:ql(GS.prototype.readPolygon),MultiPolygon:ql(GS.prototype.readMultiPolygon),Surface:ql(uT.prototype.readSurface),MultiSurface:ql(eT.prototype.readMultiSurface),Curve:ql(uT.prototype.readCurve),MultiCurve:ql(eT.prototype.readMultiCurve),Envelope:ql(uT.prototype.readEnvelope)}},uT.prototype.MULTICURVE_PARSERS={"http://www.opengis.net/gml/3.2":{curveMember:Xl(eT.prototype.curveMemberParser),curveMembers:Xl(eT.prototype.curveMemberParser)}},uT.prototype.MULTISURFACE_PARSERS={"http://www.opengis.net/gml/3.2":{surfaceMember:Xl(eT.prototype.surfaceMemberParser),surfaceMembers:Xl(eT.prototype.surfaceMemberParser)}},uT.prototype.CURVEMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{LineString:Xl(GS.prototype.readLineString),Curve:Xl(eT.prototype.readCurve)}},uT.prototype.SURFACEMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Polygon:Xl(GS.prototype.readPolygon),Surface:Xl(eT.prototype.readSurface)}},uT.prototype.SURFACE_PARSERS={"http://www.opengis.net/gml/3.2":{patches:ql(eT.prototype.readPatch)}},uT.prototype.CURVE_PARSERS={"http://www.opengis.net/gml/3.2":{segments:ql(eT.prototype.readSegment)}},uT.prototype.ENVELOPE_PARSERS={"http://www.opengis.net/gml/3.2":{lowerCorner:Xl(eT.prototype.readFlatPosList),upperCorner:Xl(eT.prototype.readFlatPosList)}},uT.prototype.PATCHES_PARSERS={"http://www.opengis.net/gml/3.2":{PolygonPatch:ql(eT.prototype.readPolygonPatch)}},uT.prototype.SEGMENTS_PARSERS={"http://www.opengis.net/gml/3.2":{LineStringSegment:ql(eT.prototype.readLineStringSegment)}},uT.prototype.MULTIPOINT_PARSERS={"http://www.opengis.net/gml/3.2":{pointMember:Xl(GS.prototype.pointMemberParser),pointMembers:Xl(GS.prototype.pointMemberParser)}},uT.prototype.MULTILINESTRING_PARSERS={"http://www.opengis.net/gml/3.2":{lineStringMember:Xl(GS.prototype.lineStringMemberParser),lineStringMembers:Xl(GS.prototype.lineStringMemberParser)}},uT.prototype.MULTIPOLYGON_PARSERS={"http://www.opengis.net/gml/3.2":{polygonMember:Xl(GS.prototype.polygonMemberParser),polygonMembers:Xl(GS.prototype.polygonMemberParser)}},uT.prototype.POINTMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Point:Xl(GS.prototype.readFlatCoordinatesFromNode)}},uT.prototype.LINESTRINGMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{LineString:Xl(GS.prototype.readLineString)}},uT.prototype.POLYGONMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Polygon:Xl(GS.prototype.readPolygon)}},uT.prototype.RING_PARSERS={"http://www.opengis.net/gml/3.2":{LinearRing:ql(GS.prototype.readFlatLinearRing)}},uT.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml/3.2":{exterior:Hl(eT.prototype.writeRing),interior:Hl(eT.prototype.writeRing)}},uT.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml/3.2":{lowerCorner:Hl(JS),upperCorner:Hl(JS)}},uT.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{surfaceMember:Hl(eT.prototype.writeSurfaceOrPolygonMember),polygonMember:Hl(eT.prototype.writeSurfaceOrPolygonMember)}},uT.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{pointMember:Hl(eT.prototype.writePointMember)}},uT.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{lineStringMember:Hl(eT.prototype.writeLineStringOrCurveMember),curveMember:Hl(eT.prototype.writeLineStringOrCurveMember)}},uT.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml/3.2":{Curve:Hl(eT.prototype.writeCurveOrLineString),MultiCurve:Hl(eT.prototype.writeMultiCurveOrLineString),Point:Hl(uT.prototype.writePoint),MultiPoint:Hl(eT.prototype.writeMultiPoint),LineString:Hl(eT.prototype.writeCurveOrLineString),MultiLineString:Hl(eT.prototype.writeMultiCurveOrLineString),LinearRing:Hl(eT.prototype.writeLinearRing),Polygon:Hl(eT.prototype.writeSurfaceOrPolygon),MultiPolygon:Hl(eT.prototype.writeMultiSurfaceOrPolygon),Surface:Hl(eT.prototype.writeSurfaceOrPolygon),MultiSurface:Hl(eT.prototype.writeMultiSurfaceOrPolygon),Envelope:Hl(eT.prototype.writeEnvelope)}};var hT=uT,cT=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),pT=[null,"http://www.topografix.com/GPX/1/0","http://www.topografix.com/GPX/1/1"],dT={rte:BT,trk:UT,wpt:YT},fT=eu(pT,{rte:Xl(BT),trk:Xl(UT),wpt:Xl(YT)}),gT=eu(pT,{text:Kl(qS,"linkText"),type:Kl(qS,"linkType")}),yT=eu(pT,{rte:Hl((function(t,e,r){var i=r[0],n=e.getProperties(),o={node:t};o.properties=n;var s=e.getGeometry();if(s.getType()==gt.LINE_STRING){var a=Gf(s,!0,i);o.geometryLayout=a.getLayout(),n.rtept=a.getCoordinates()}var l=r[r.length-1].node,u=ET[l.namespaceURI],h=tu(n,u);ou(o,RT,Ql,h,r,u)})),trk:Hl((function(t,e,r){var i=r[0],n=e.getProperties(),o={node:t};o.properties=n;var s=e.getGeometry();if(s.getType()==gt.MULTI_LINE_STRING){var a=Gf(s,!0,i);n.trkseg=a.getLineStrings()}var l=r[r.length-1].node,u=IT[l.namespaceURI],h=tu(n,u);ou(o,OT,Ql,h,r,u)})),wpt:Hl((function(t,e,r){var i=r[0],n=r[r.length-1];n.properties=e.getProperties();var o=e.getGeometry();if(o.getType()==gt.POINT){var s=Gf(o,!0,i);n.geometryLayout=s.getLayout(),VT(t,s.getCoordinates(),r)}}))}),mT=function(t){function e(e){var r=t.call(this)||this,i=e||{};return r.dataProjection=gr("EPSG:4326"),r.readExtensions_=i.readExtensions,r}return cT(e,t),e.prototype.handleReadExtensions_=function(t){t||(t=[]);for(var e=0,r=t.length;e<r;++e){var i=t[e];if(this.readExtensions_){var n=i.get("extensionsNode_")||null;this.readExtensions_(i,n)}i.set("extensionsNode_",void 0)}},e.prototype.readFeatureFromNode=function(t,e){if(!f(pT,t.namespaceURI))return null;var r=dT[t.localName];if(!r)return null;var i=r(t,[this.getReadOptions(t,e)]);return i?(this.handleReadExtensions_([i]),i):null},e.prototype.readFeaturesFromNode=function(t,e){if(!f(pT,t.namespaceURI))return[];if("gpx"==t.localName){var r=iu([],fT,t,[this.getReadOptions(t,e)]);return r?(this.handleReadExtensions_(r),r):[]}return[]},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var r=Bl("http://www.topografix.com/GPX/1/1","gpx");return r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xsi",zl),r.setAttributeNS(zl,"xsi:schemaLocation","http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"),r.setAttribute("version","1.1"),r.setAttribute("creator","OpenLayers"),ou({node:r},yT,NT,t,[e]),r},e}(AS),_T=eu(pT,{name:Kl(qS),cmt:Kl(qS),desc:Kl(qS),src:Kl(qS),link:GT,number:Kl(VS),extensions:zT,type:Kl(qS),rtept:function(t,e){var r=iu({},vT,t,e);if(r){var i=e[e.length-1],n=i.flatCoordinates,o=i.layoutOptions;jT(n,o,t,r)}}}),vT=eu(pT,{ele:Kl(YS),time:Kl(US)}),xT=eu(pT,{name:Kl(qS),cmt:Kl(qS),desc:Kl(qS),src:Kl(qS),link:GT,number:Kl(VS),type:Kl(qS),extensions:zT,trkseg:function(t,e){var r=e[e.length-1];ru(wT,t,e);var i=r.flatCoordinates;r.ends.push(i.length)}}),wT=eu(pT,{trkpt:function(t,e){var r=iu({},bT,t,e);if(r){var i=e[e.length-1],n=i.flatCoordinates,o=i.layoutOptions;jT(n,o,t,r)}}}),bT=eu(pT,{ele:Kl(YS),time:Kl(US)}),ST=eu(pT,{ele:Kl(YS),time:Kl(US),magvar:Kl(YS),geoidheight:Kl(YS),name:Kl(qS),cmt:Kl(qS),desc:Kl(qS),src:Kl(qS),link:GT,sym:Kl(qS),type:Kl(qS),fix:Kl(qS),sat:Kl(VS),hdop:Kl(YS),vdop:Kl(YS),pdop:Kl(YS),ageofdgpsdata:Kl(YS),dgpsid:Kl(VS),extensions:zT}),TT=["text","type"],CT=eu(pT,{text:Hl(JS),type:Hl(JS)}),ET=eu(pT,["name","cmt","desc","src","link","number","type","rtept"]),RT=eu(pT,{name:Hl(JS),cmt:Hl(JS),desc:Hl(JS),src:Hl(JS),link:Hl(WT),number:Hl(HS),type:Hl(JS),rtept:Jl(Hl(VT))}),PT=eu(pT,["ele","time"]),IT=eu(pT,["name","cmt","desc","src","link","number","type","trkseg"]),OT=eu(pT,{name:Hl(JS),cmt:Hl(JS),desc:Hl(JS),src:Hl(JS),link:Hl(WT),number:Hl(HS),type:Hl(JS),trkseg:Jl(Hl((function(t,e,r){var i={node:t};i.geometryLayout=e.getLayout(),i.properties={},ou(i,MT,LT,e.getCoordinates(),r)})))}),LT=$l("trkpt"),MT=eu(pT,{trkpt:Hl(VT)}),FT=eu(pT,["ele","time","magvar","geoidheight","name","cmt","desc","src","link","sym","type","fix","sat","hdop","vdop","pdop","ageofdgpsdata","dgpsid"]),AT=eu(pT,{ele:Hl(KS),time:Hl((function(t,e){var r=new Date(1e3*e),i=r.getUTCFullYear()+"-"+Je(r.getUTCMonth()+1,2)+"-"+Je(r.getUTCDate(),2)+"T"+Je(r.getUTCHours(),2)+":"+Je(r.getUTCMinutes(),2)+":"+Je(r.getUTCSeconds(),2)+"Z";t.appendChild(lu().createTextNode(i))})),magvar:Hl(KS),geoidheight:Hl(KS),name:Hl(JS),cmt:Hl(JS),desc:Hl(JS),src:Hl(JS),link:Hl(WT),sym:Hl(JS),type:Hl(JS),fix:Hl(JS),sat:Hl(HS),hdop:Hl(KS),vdop:Hl(KS),pdop:Hl(KS),ageofdgpsdata:Hl(KS),dgpsid:Hl(HS)}),kT={Point:"wpt",LineString:"rte",MultiLineString:"trk"};function NT(t,e,r){var i=t.getGeometry();if(i){var n=kT[i.getType()];if(n)return Bl(e[e.length-1].node.namespaceURI,n)}}function jT(t,e,r,i){return t.push(parseFloat(r.getAttribute("lon")),parseFloat(r.getAttribute("lat"))),"ele"in i?(t.push(i.ele),delete i.ele,e.hasZ=!0):t.push(0),"time"in i?(t.push(i.time),delete i.time,e.hasM=!0):t.push(0),t}function DT(t,e,r){var i=ct,n=2;if(t.hasZ&&t.hasM?(i=ft,n=4):t.hasZ?(i=pt,n=3):t.hasM&&(i=dt,n=3),4!==n){for(var o=0,s=e.length/4;o<s;o++)e[o*n]=e[4*o],e[o*n+1]=e[4*o+1],t.hasZ&&(e[o*n+2]=e[4*o+2]),t.hasM&&(e[o*n+2]=e[4*o+3]);if(e.length=e.length/4*n,r)for(o=0,s=r.length;o<s;o++)r[o]=r[o]/4*n}return i}function GT(t,e){var r=e[e.length-1],i=t.getAttribute("href");null!==i&&(r.link=i),ru(gT,t,e)}function zT(t,e){e[e.length-1].extensionsNode_=t}function BT(t,e){var r=e[0],i=iu({flatCoordinates:[],layoutOptions:{}},_T,t,e);if(i){var n=i.flatCoordinates;delete i.flatCoordinates;var o=i.layoutOptions;delete i.layoutOptions;var s=DT(o,n),a=new Tf(n,s);Gf(a,!1,r);var l=new ht(a);return l.setProperties(i,!0),l}}function UT(t,e){var r=e[0],i=iu({flatCoordinates:[],ends:[],layoutOptions:{}},xT,t,e);if(i){var n=i.flatCoordinates;delete i.flatCoordinates;var o=i.ends;delete i.ends;var s=i.layoutOptions;delete i.layoutOptions;var a=DT(s,n,o),l=new Uf(n,a,o);Gf(l,!1,r);var u=new ht(l);return u.setProperties(i,!0),u}}function YT(t,e){var r=e[0],i=iu({},ST,t,e);if(i){var n={},o=jT([],n,t,i),s=DT(n,o),a=new pi(o,s);Gf(a,!1,r);var l=new ht(a);return l.setProperties(i,!0),l}}function WT(t,e,r){t.setAttribute("href",e);var i=r[r.length-1].properties,n=[i.linkText,i.linkType];ou({node:t},CT,Ql,n,r,TT)}function VT(t,e,r){var i=r[r.length-1],n=i.node.namespaceURI,o=i.properties;switch(t.setAttributeNS(null,"lat",String(e[1])),t.setAttributeNS(null,"lon",String(e[0])),i.geometryLayout){case ft:0!==e[3]&&(o.time=e[3]);case pt:0!==e[2]&&(o.ele=e[2]);break;case dt:0!==e[2]&&(o.time=e[2])}var s="rtept"==t.nodeName?PT[n]:FT[n],a=tu(o,s);ou({node:t,properties:o},AT,Ql,a,r,s)}var XT=mT,qT=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function ZT(t,e){if(!t)return null;var r;switch(t.type){case gt.POINT:r=function(t){return new pi(t.coordinates)}(t);break;case gt.LINE_STRING:r=function(t){return new Tf(t.coordinates)}(t);break;case gt.POLYGON:r=function(t){return new Pi(t.coordinates)}(t);break;case gt.MULTI_POINT:r=function(t){return new Wf(t.coordinates)}(t);break;case gt.MULTI_LINE_STRING:r=function(t){return new Uf(t.coordinates)}(t);break;case gt.MULTI_POLYGON:r=function(t){return new qf(t.coordinates)}(t);break;case gt.GEOMETRY_COLLECTION:r=function(t,e){var r=t.geometries.map((function(t){return ZT(t,e)}));return new wS(r)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return Gf(r,!1,e)}function KT(t,e){var r,i=(t=Gf(t,!0,e)).getType();switch(i){case gt.POINT:r=function(t,e){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case gt.LINE_STRING:r=function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case gt.POLYGON:r=function(t,e){var r;e&&(r=e.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(r)}}(t,e);break;case gt.MULTI_POINT:r=function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case gt.MULTI_LINE_STRING:r=function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case gt.MULTI_POLYGON:r=function(t,e){var r;e&&(r=e.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(r)}}(t,e);break;case gt.GEOMETRY_COLLECTION:r=function(t,e){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){var r=T({},e);return delete r.featureProjection,KT(t,r)}))}}(t,e);break;case gt.CIRCLE:r={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+i)}return r}var HT=function(t){function e(e){var r=this,i=e||{};return(r=t.call(this)||this).dataProjection=gr(i.dataProjection?i.dataProjection:"EPSG:4326"),i.featureProjection&&(r.defaultFeatureProjection=gr(i.featureProjection)),r.geometryName_=i.geometryName,r.extractGeometryName_=i.extractGeometryName,r}return qT(e,t),e.prototype.readFeatureFromObject=function(t,e){var r=null,i=ZT((r="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,e),n=new ht;return this.geometryName_?n.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in r!==void 0&&n.setGeometryName(r.geometry_name),n.setGeometry(i),"id"in r&&n.setId(r.id),r.properties&&n.setProperties(r.properties,!0),n},e.prototype.readFeaturesFromObject=function(t,e){var r=null;if("FeatureCollection"===t.type){r=[];for(var i=t.features,n=0,o=i.length;n<o;++n)r.push(this.readFeatureFromObject(i[n],e))}else r=[this.readFeatureFromObject(t,e)];return r},e.prototype.readGeometryFromObject=function(t,e){return ZT(t,e)},e.prototype.readProjectionFromObject=function(t){var e,r=t.crs;return r?"name"==r.type?e=gr(r.properties.name):"EPSG"===r.type?e=gr("EPSG:"+r.properties.code):lt(!1,36):e=this.dataProjection,e},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var r={type:"Feature",geometry:null,properties:null},i=t.getId();if(void 0!==i&&(r.id=i),!t.hasProperties())return r;var n=t.getProperties(),o=t.getGeometry();return o&&(r.geometry=KT(o,e),delete n[t.getGeometryName()]),R(n)||(r.properties=n),r},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var r=[],i=0,n=t.length;i<n;++i)r.push(this.writeFeatureObject(t[i],e));return{type:"FeatureCollection",features:r}},e.prototype.writeGeometryObject=function(t,e){return KT(t,this.adaptOptions(e))},e}(TS),JT=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function $T(t){return"string"==typeof t?t:""}var QT,tC,eC,rC,iC,nC,oC,sC=function(t){function e(){return t.call(this)||this}return JT(e,t),e.prototype.getType=function(){return yl},e.prototype.readFeature=function(t,e){return this.readFeatureFromText($T(t),this.adaptOptions(e))},e.prototype.readFeatureFromText=function(t,e){return i()},e.prototype.readFeatures=function(t,e){return this.readFeaturesFromText($T(t),this.adaptOptions(e))},e.prototype.readFeaturesFromText=function(t,e){return i()},e.prototype.readGeometry=function(t,e){return this.readGeometryFromText($T(t),this.adaptOptions(e))},e.prototype.readGeometryFromText=function(t,e){return i()},e.prototype.readProjection=function(t){return this.readProjectionFromText($T(t))},e.prototype.readProjectionFromText=function(t){return this.dataProjection},e.prototype.writeFeature=function(t,e){return this.writeFeatureText(t,this.adaptOptions(e))},e.prototype.writeFeatureText=function(t,e){return i()},e.prototype.writeFeatures=function(t,e){return this.writeFeaturesText(t,this.adaptOptions(e))},e.prototype.writeFeaturesText=function(t,e){return i()},e.prototype.writeGeometry=function(t,e){return this.writeGeometryText(t,this.adaptOptions(e))},e.prototype.writeGeometryText=function(t,e){return i()},e}(Df),aC=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),lC="barometric",uC="gps",hC="none",cC=/^B(\d{2})(\d{2})(\d{2})(\d{2})(\d{5})([NS])(\d{3})(\d{5})([EW])([AV])(\d{5})(\d{5})/,pC=/^H.([A-Z]{3}).*?:(.*)/,dC=/^HFDTE(\d{2})(\d{2})(\d{2})/,fC=/\r\n|\r|\n/,gC=function(t){function e(e){var r=t.call(this)||this,i=e||{};return r.dataProjection=gr("EPSG:4326"),r.altitudeMode_=i.altitudeMode?i.altitudeMode:hC,r}return aC(e,t),e.prototype.readFeatureFromText=function(t,e){var r,i,n=this.altitudeMode_,o=t.split(fC),s={},a=[],l=2e3,u=0,h=1,c=-1;for(r=0,i=o.length;r<i;++r){var p=o[r],d=void 0;if("B"==p.charAt(0)){if(d=cC.exec(p)){var f=parseInt(d[1],10),g=parseInt(d[2],10),y=parseInt(d[3],10),m=parseInt(d[4],10)+parseInt(d[5],10)/6e4;"S"==d[6]&&(m=-m);var _=parseInt(d[7],10)+parseInt(d[8],10)/6e4;if("W"==d[9]&&(_=-_),a.push(_,m),n!=hC){var v=void 0;v=n==uC?parseInt(d[11],10):n==lC?parseInt(d[12],10):0,a.push(v)}var x=Date.UTC(l,u,h,f,g,y);x<c&&(x=Date.UTC(l,u,h+1,f,g,y)),a.push(x/1e3),c=x}}else"H"==p.charAt(0)&&((d=dC.exec(p))?(h=parseInt(d[1],10),u=parseInt(d[2],10)-1,l=2e3+parseInt(d[3],10)):(d=pC.exec(p))&&(s[d[1]]=d[2].trim()))}if(0===a.length)return null;var w=new Tf(a,n==hC?dt:ft),b=new ht(Gf(w,!1,e));return b.setProperties(s,!0),b},e.prototype.readFeaturesFromText=function(t,e){var r=this.readFeatureFromText(t,e);return r?[r]:[]},e}(sC),yC=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),mC=["http://www.google.com/kml/ext/2.2"],_C=[null,"http://earth.google.com/kml/2.0","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.2","http://www.opengis.net/kml/2.2"],vC={fraction:Gu,pixels:zu,insetPixels:zu},xC=eu(_C,{ExtendedData:dE,Region:fE,MultiGeometry:Kl(nE,"geometry"),LineString:Kl(eE,"geometry"),LinearRing:Kl(rE,"geometry"),Point:Kl(oE,"geometry"),Polygon:Kl(aE,"geometry"),Style:Kl(uE),StyleMap:function(t,e){var r=BC.call(this,t,e);if(!r)return;var i=e[e.length-1];Array.isArray(r)?i.Style=r:"string"==typeof r?i.styleUrl=r:lt(!1,38)},address:Kl(qS),description:Kl(qS),name:Kl(qS),open:Kl(zS),phoneNumber:Kl(qS),styleUrl:Kl(DC),visibility:Kl(zS)},eu(mC,{MultiTrack:Kl((function(t,e){var r=iu([],ZC,t,e);if(!r)return;return new Uf(r)}),"geometry"),Track:Kl(HC,"geometry")})),wC=eu(_C,{ExtendedData:dE,Region:fE,Link:function(t,e){ru(bC,t,e)},address:Kl(qS),description:Kl(qS),name:Kl(qS),open:Kl(zS),phoneNumber:Kl(qS),visibility:Kl(zS)}),bC=eu(_C,{href:Kl(DC)}),SC=eu(_C,{LatLonAltBox:function(t,e){var r=iu({},mE,t,e);if(!r)return;var i=e[e.length-1],n=[parseFloat(r.west),parseFloat(r.south),parseFloat(r.east),parseFloat(r.north)];i.extent=n,i.altitudeMode=r.altitudeMode,i.minAltitude=parseFloat(r.minAltitude),i.maxAltitude=parseFloat(r.maxAltitude)},Lod:function(t,e){var r=iu({},_E,t,e);if(!r)return;var i=e[e.length-1];i.minLodPixels=parseFloat(r.minLodPixels),i.maxLodPixels=parseFloat(r.maxLodPixels),i.minFadeExtent=parseFloat(r.minFadeExtent),i.maxFadeExtent=parseFloat(r.maxFadeExtent)}}),TC=eu(_C,["Document","Placemark"]),CC=eu(_C,{Document:Hl((function(t,e,r){ou({node:t},SE,TE,e,r,void 0,this)})),Placemark:Hl(ZE)}),EC=null;var RC,PC=null;var IC,OC=null;var LC=null;var MC=null;var FC,AC=null;var kC=function(t){function e(e){var r=t.call(this)||this,i=e||{};return AC||(EC=new Du({color:QT=[255,255,255,1]}),PC=new th({anchor:tC=[20,2],anchorOrigin:Bu,anchorXUnits:eC=zu,anchorYUnits:rC=zu,crossOrigin:"anonymous",rotation:0,scale:oC=.5,size:iC=[64,64],src:nC="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png"}),RC="NO_IMAGE",OC=new eh({color:QT,width:1}),IC=new eh({color:[51,51,51,1],width:2}),LC=new hh({font:"bold 16px Helvetica",fill:EC,stroke:IC,scale:.8}),MC=new ah({fill:EC,image:PC,text:LC,stroke:OC,zIndex:0}),AC=[MC]),r.dataProjection=gr("EPSG:4326"),r.defaultStyle_=i.defaultStyle?i.defaultStyle:AC,r.extractStyles_=void 0===i.extractStyles||i.extractStyles,r.writeStyles_=void 0===i.writeStyles||i.writeStyles,r.sharedStyles_={},r.showPointNames_=void 0===i.showPointNames||i.showPointNames,r.crossOrigin_=void 0!==i.crossOrigin?i.crossOrigin:"anonymous",r}return yC(e,t),e.prototype.readDocumentOrFolder_=function(t,e){var r=iu([],eu(_C,{Document:Vl(this.readDocumentOrFolder_,this),Folder:Vl(this.readDocumentOrFolder_,this),Placemark:Xl(this.readPlacemark_,this),Style:this.readSharedStyle_.bind(this),StyleMap:this.readSharedStyleMap_.bind(this)}),t,e,this);return r||void 0},e.prototype.readPlacemark_=function(t,e){var r=iu({geometry:null},xC,t,e,this);if(r){var i=new ht,n=t.getAttribute("id");null!==n&&i.setId(n);var o=e[0],s=r.geometry;if(s&&Gf(s,!1,o),i.setGeometry(s),delete r.geometry,this.extractStyles_){var a=function(t,e,r,i,n){return function(o,s){var a=n,l="",u=[];if(a){var h=o.getGeometry();if(h){var c=h.getType();a=c===gt.GEOMETRY_COLLECTION?(u=h.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===gt.POINT||e===gt.MULTI_POINT}))).length>0:c===gt.POINT||c===gt.MULTI_POINT}}a&&(l=o.get("name"),(a=a&&!!l)&&l.search(/&[^&]+;/)>-1&&(FC||(FC=document.createElement("textarea")),FC.innerHTML=l,l=FC.value));var p=r;if(t?p=t:e&&(p=function t(e,r,i){return Array.isArray(e)?e:"string"==typeof e?(!(e in i)&&"#"+e in i&&(e="#"+e),t(i[e],r,i)):r}(e,r,i)),a){var d=function(t,e){var r=[0,0],i="start",n=t.getImage();if(n){var o=n.getImageSize();if(null===o&&(o=iC),2==o.length){var s=n.getScaleArray();r[0]=s[0]*o[0]/2,r[1]=-s[1]*o[1]/2,i="left"}}var a=t.getText();a?((a=a.clone()).setFont(a.getFont()||LC.getFont()),a.setScale(a.getScale()||LC.getScale()),a.setFill(a.getFill()||LC.getFill()),a.setStroke(a.getStroke()||IC)):a=LC.clone();return a.setText(e),a.setOffsetX(r[0]),a.setOffsetY(r[1]),a.setTextAlign(i),new ah({image:n,text:a})}(p[0],l);return u.length>0?(d.setGeometry(new wS(u)),[d,new ah({geometry:p[0].getGeometry(),image:null,fill:p[0].getFill(),stroke:p[0].getStroke(),text:null})].concat(p.slice(1))):d}return p}}(r.Style,r.styleUrl,this.defaultStyle_,this.sharedStyles_,this.showPointNames_);i.setStyle(a)}return delete r.Style,i.setProperties(r,!0),i}},e.prototype.readSharedStyle_=function(t,e){var r=t.getAttribute("id");if(null!==r){var i=uE.call(this,t,e);if(i){var n=void 0,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)n=new URL("#"+r,o).href;else n="#"+r;this.sharedStyles_[n]=i}}},e.prototype.readSharedStyleMap_=function(t,e){var r=t.getAttribute("id");if(null!==r){var i=BC.call(this,t,e);if(i){var n,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)n=new URL("#"+r,o).href;else n="#"+r;this.sharedStyles_[n]=i}}},e.prototype.readFeatureFromNode=function(t,e){if(!f(_C,t.namespaceURI))return null;var r=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return r||null},e.prototype.readFeaturesFromNode=function(t,e){if(!f(_C,t.namespaceURI))return[];var r,i=t.localName;if("Document"==i||"Folder"==i)return(r=this.readDocumentOrFolder_(t,[this.getReadOptions(t,e)]))||[];if("Placemark"==i){var n=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return n?[n]:[]}if("kml"==i){r=[];for(var o=t.firstElementChild;o;o=o.nextElementSibling){var s=this.readFeaturesFromNode(o,e);s&&m(r,s)}return r}return[]},e.prototype.readName=function(t){if(t){if("string"==typeof t){var e=Wl(t);return this.readNameFromDocument(e)}return Yl(t)?this.readNameFromDocument(t):this.readNameFromNode(t)}},e.prototype.readNameFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE){var r=this.readNameFromNode(e);if(r)return r}},e.prototype.readNameFromNode=function(t){for(var e=t.firstElementChild;e;e=e.nextElementSibling)if(f(_C,e.namespaceURI)&&"name"==e.localName)return qS(e);for(e=t.firstElementChild;e;e=e.nextElementSibling){var r=e.localName;if(f(_C,e.namespaceURI)&&("Document"==r||"Folder"==r||"Placemark"==r||"kml"==r)){var i=this.readNameFromNode(e);if(i)return i}}},e.prototype.readNetworkLinks=function(t){var e=[];if("string"==typeof t){var r=Wl(t);m(e,this.readNetworkLinksFromDocument(r))}else Yl(t)?m(e,this.readNetworkLinksFromDocument(t)):m(e,this.readNetworkLinksFromNode(t));return e},e.prototype.readNetworkLinksFromDocument=function(t){for(var e=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&m(e,this.readNetworkLinksFromNode(r));return e},e.prototype.readNetworkLinksFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(f(_C,r.namespaceURI)&&"NetworkLink"==r.localName){var i=iu({},wC,r,[]);e.push(i)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var n=r.localName;!f(_C,r.namespaceURI)||"Document"!=n&&"Folder"!=n&&"kml"!=n||m(e,this.readNetworkLinksFromNode(r))}return e},e.prototype.readRegion=function(t){var e=[];if("string"==typeof t){var r=Wl(t);m(e,this.readRegionFromDocument(r))}else Yl(t)?m(e,this.readRegionFromDocument(t)):m(e,this.readRegionFromNode(t));return e},e.prototype.readRegionFromDocument=function(t){for(var e=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&m(e,this.readRegionFromNode(r));return e},e.prototype.readRegionFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(f(_C,r.namespaceURI)&&"Region"==r.localName){var i=iu({},SC,r,[]);e.push(i)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var n=r.localName;!f(_C,r.namespaceURI)||"Document"!=n&&"Folder"!=n&&"kml"!=n||m(e,this.readRegionFromNode(r))}return e},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var r=Bl(_C[4],"kml"),i="http://www.w3.org/2000/xmlns/";r.setAttributeNS(i,"xmlns:gx",mC[0]),r.setAttributeNS(i,"xmlns:xsi",zl),r.setAttributeNS(zl,"xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");var n={node:r},o={};t.length>1?o.Document=t:1==t.length&&(o.Placemark=t[0]);var s=TC[r.namespaceURI],a=tu(o,s);return ou(n,CC,Ql,a,[e],s,this),r},e}(AS);function NC(t){var e=Ul(t,!1),r=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(e);if(r){var i=r[1];return[parseInt(i.substr(6,2),16),parseInt(i.substr(4,2),16),parseInt(i.substr(2,2),16),parseInt(i.substr(0,2),16)/255]}}function jC(t){for(var e,r=Ul(t,!1),i=[],n=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?))?\s*/i;e=n.exec(r);){var o=parseFloat(e[1]),s=parseFloat(e[2]),a=e[3]?parseFloat(e[3]):0;i.push(o,s,a),r=r.substr(e[0].length)}if(""===r)return i}function DC(t){var e=Ul(t,!1).trim(),r=t.baseURI;return r&&"about:blank"!=r||(r=window.location.href),r?new URL(e,r).href:e}function GC(t){return YS(t)}var zC=eu(_C,{Pair:function(t,e){var r=iu({},gE,t,e,this);if(!r)return;var i=r.key;if(i&&"normal"==i){var n=r.styleUrl;n&&(e[e.length-1]=n);var o=r.Style;o&&(e[e.length-1]=o)}}});function BC(t,e){return iu(void 0,zC,t,e,this)}var UC=eu(_C,{Icon:Kl((function(t,e){var r=iu({},JC,t,e);return r||null})),color:Kl(NC),heading:Kl(YS),hotSpot:Kl((function(t){var e,r=t.getAttribute("xunits"),i=t.getAttribute("yunits");return e="insetPixels"!==r?"insetPixels"!==i?Bu:Yu:"insetPixels"!==i?Uu:Wu,{x:parseFloat(t.getAttribute("x")),xunits:vC[r],y:parseFloat(t.getAttribute("y")),yunits:vC[i],origin:e}})),scale:Kl(GC)});var YC=eu(_C,{color:Kl(NC),scale:Kl(GC)});var WC=eu(_C,{color:Kl(NC),width:Kl(YS)});var VC=eu(_C,{color:Kl(NC),fill:Kl(zS),outline:Kl(zS)});var XC=eu(_C,{coordinates:ql(jC)});function qC(t,e){return iu(null,XC,t,e)}var ZC=eu(mC,{Track:Xl(HC)});var KC=eu(_C,{when:function(t,e){var r=e[e.length-1].whens,i=Ul(t,!1),n=Date.parse(i);r.push(isNaN(n)?0:n)}},eu(mC,{coord:function(t,e){var r=e[e.length-1].flatCoordinates,i=Ul(t,!1),n=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(i);if(n){var o=parseFloat(n[1]),s=parseFloat(n[2]),a=parseFloat(n[3]);r.push(o,s,a,0)}else r.push(0,0,0,0)}}));function HC(t,e){var r=iu({flatCoordinates:[],whens:[]},KC,t,e);if(r){for(var i=r.flatCoordinates,n=r.whens,o=0,s=Math.min(i.length,n.length);o<s;++o)i[4*o+3]=n[o];return new Tf(i,ft)}}var JC=eu(_C,{href:Kl(DC)},eu(mC,{x:Kl(YS),y:Kl(YS),w:Kl(YS),h:Kl(YS)}));var $C=eu(_C,{coordinates:ql(jC)});function QC(t,e){return iu(null,$C,t,e)}var tE=eu(_C,{extrude:Kl(zS),tessellate:Kl(zS),altitudeMode:Kl(qS)});function eE(t,e){var r=iu({},tE,t,e),i=QC(t,e);if(i){var n=new Tf(i,pt);return n.setProperties(r,!0),n}}function rE(t,e){var r=iu({},tE,t,e),i=QC(t,e);if(i){var n=new Pi(i,pt,[i.length]);return n.setProperties(r,!0),n}}var iE=eu(_C,{LineString:Xl(eE),LinearRing:Xl(rE),MultiGeometry:Xl(nE),Point:Xl(oE),Polygon:Xl(aE)});function nE(t,e){var r,i=iu([],iE,t,e);if(!i)return null;if(0===i.length)return new wS(i);for(var n=!0,o=i[0].getType(),s=1,a=i.length;s<a;++s)if(i[s].getType()!=o){n=!1;break}if(n){var l=void 0,u=void 0;if(o==gt.POINT){var h=i[0];l=h.getLayout(),u=h.getFlatCoordinates();for(s=1,a=i.length;s<a;++s)m(u,i[s].getFlatCoordinates());hE(r=new Wf(u,l),i)}else o==gt.LINE_STRING?hE(r=new Uf(i),i):o==gt.POLYGON?hE(r=new qf(i),i):o==gt.GEOMETRY_COLLECTION?r=new wS(i):lt(!1,37)}else r=new wS(i);return(r)}function oE(t,e){var r=iu({},tE,t,e),i=QC(t,e);if(i){var n=new pi(i,pt);return n.setProperties(r,!0),n}}var sE=eu(_C,{innerBoundaryIs:function(t,e){var r=iu(void 0,vE,t,e);if(r){e[e.length-1].push(r)}},outerBoundaryIs:function(t,e){var r=iu(void 0,xE,t,e);if(r){e[e.length-1][0]=r}}});function aE(t,e){var r=iu({},tE,t,e),i=iu([null],sE,t,e);if(i&&i[0]){for(var n=i[0],o=[n.length],s=1,a=i.length;s<a;++s)m(n,i[s]),o.push(n.length);var l=new Pi(n,pt,o);return l.setProperties(r,!0),l}}var lE=eu(_C,{IconStyle:function(t,e){var r=iu({},UC,t,e);if(r){var i,n,o,s,a=e[e.length-1],l="Icon"in r?r.Icon:{},u=!("Icon"in r)||Object.keys(l).length>0,h=l.href;h?i=h:u&&(i=nC);var c,p=Bu,d=r.hotSpot;d?(n=[d.x,d.y],o=d.xunits,s=d.yunits,p=d.origin):i===nC?(n=tC,o=eC,s=rC):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(i)&&(n=[.5,0],o=Gu,s=Gu);var f,g=l.x,y=l.y;void 0!==g&&void 0!==y&&(c=[g,y]);var m,_=l.w,v=l.h;void 0!==_&&void 0!==v&&(f=[_,v]);var x=r.heading;void 0!==x&&(m=Re(x));var w=r.scale,b=r.color;if(u){i==nC&&(f=iC,void 0===w&&(w=oC));var S=new th({anchor:n,anchorOrigin:p,anchorXUnits:o,anchorYUnits:s,crossOrigin:this.crossOrigin_,offset:c,offsetOrigin:Bu,rotation:m,scale:w,size:f,src:i,color:b});a.imageStyle=S}else a.imageStyle=RC}},LabelStyle:function(t,e){var r=iu({},YC,t,e);if(r){var i=e[e.length-1],n=new hh({fill:new Du({color:"color"in r?r.color:QT}),scale:r.scale});i.textStyle=n}},LineStyle:function(t,e){var r=iu({},WC,t,e);if(r){var i=e[e.length-1],n=new eh({color:"color"in r?r.color:QT,width:"width"in r?r.width:1});i.strokeStyle=n}},PolyStyle:function(t,e){var r=iu({},VC,t,e);if(r){var i=e[e.length-1],n=new Du({color:"color"in r?r.color:QT});i.fillStyle=n;var o=r.fill;void 0!==o&&(i.fill=o);var s=r.outline;void 0!==s&&(i.outline=s)}}});function uE(t,e){var r=iu({},lE,t,e,this);if(!r)return null;var i,n="fillStyle"in r?r.fillStyle:EC,o=r.fill;void 0===o||o||(n=null),"imageStyle"in r?r.imageStyle!=RC&&(i=r.imageStyle):i=PC;var s="textStyle"in r?r.textStyle:LC,a="strokeStyle"in r?r.strokeStyle:OC,l=r.outline;return void 0===l||l?[new ah({fill:n,image:i,stroke:a,text:s,zIndex:void 0})]:[new ah({geometry:function(t){var e=t.getGeometry(),r=e.getType();return r===gt.GEOMETRY_COLLECTION?new wS(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e!==gt.POLYGON&&e!==gt.MULTI_POLYGON}))):r!==gt.POLYGON&&r!==gt.MULTI_POLYGON?e:void 0},fill:n,image:i,stroke:a,text:s,zIndex:void 0}),new ah({geometry:function(t){var e=t.getGeometry(),r=e.getType();return r===gt.GEOMETRY_COLLECTION?new wS(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===gt.POLYGON||e===gt.MULTI_POLYGON}))):r===gt.POLYGON||r===gt.MULTI_POLYGON?e:void 0},fill:n,stroke:null,zIndex:void 0})]}function hE(t,e){var r,i,n,o=e.length,s=new Array(e.length),a=new Array(e.length),l=new Array(e.length);r=!1,i=!1,n=!1;for(var u=0;u<o;++u){var h=e[u];s[u]=h.get("extrude"),a[u]=h.get("tessellate"),l[u]=h.get("altitudeMode"),r=r||void 0!==s[u],i=i||void 0!==a[u],n=n||l[u]}r&&t.set("extrude",s),i&&t.set("tessellate",a),n&&t.set("altitudeMode",l)}var cE=eu(_C,{displayName:Kl(qS),value:Kl(qS)});var pE=eu(_C,{Data:function(t,e){var r=t.getAttribute("name");ru(cE,t,e);var i=e[e.length-1];r&&i.displayName?i[r]={value:i.value,displayName:i.displayName,toString:function(){return i.value}}:null!==r?i[r]=i.value:null!==i.displayName&&(i[i.displayName]=i.value),delete i.value},SchemaData:function(t,e){ru(yE,t,e)}});function dE(t,e){ru(pE,t,e)}function fE(t,e){ru(SC,t,e)}var gE=eu(_C,{Style:Kl(uE),key:Kl(qS),styleUrl:Kl(DC)});var yE=eu(_C,{SimpleData:function(t,e){var r=t.getAttribute("name");if(null!==r){var i=qS(t);e[e.length-1][r]=i}}});var mE=eu(_C,{altitudeMode:Kl(qS),minAltitude:Kl(YS),maxAltitude:Kl(YS),north:Kl(YS),south:Kl(YS),east:Kl(YS),west:Kl(YS)});var _E=eu(_C,{minLodPixels:Kl(YS),maxLodPixels:Kl(YS),minFadeExtent:Kl(YS),maxFadeExtent:Kl(YS)});var vE=eu(_C,{LinearRing:ql(qC)});var xE=eu(_C,{LinearRing:ql(qC)});function wE(t,e){for(var r=tn(e),i=[255*(4==r.length?r[3]:1),r[2],r[1],r[0]],n=0;n<4;++n){var o=Math.floor(i[n]).toString(16);i[n]=1==o.length?"0"+o:o}JS(t,i.join(""))}var bE=eu(_C,{Data:Hl((function(t,e,r){t.setAttribute("name",e.name);var i={node:t},n=e.value;"object"==typeof n?(null!==n&&n.displayName&&ou(i,bE,Ql,[n.displayName],r,["displayName"]),null!==n&&n.value&&ou(i,bE,Ql,[n.value],r,["value"])):ou(i,bE,Ql,[n],r,["value"])})),value:Hl((function(t,e){JS(t,e)})),displayName:Hl((function(t,e){!function(t,e){t.appendChild(lu().createCDATASection(e))}(t,e)}))});var SE=eu(_C,{Placemark:Hl(ZE)}),TE=function(t,e,r){return Bl(e[e.length-1].node.namespaceURI,"Placemark")};var CE=$l("Data");var EE=eu(_C,["href"],eu(mC,["x","y","w","h"])),RE=eu(_C,{href:Hl(JS)},eu(mC,{x:Hl(KS),y:Hl(KS),w:Hl(KS),h:Hl(KS)})),PE=function(t,e,r){return Bl(mC[0],"gx:"+r)};var IE=eu(_C,["scale","heading","Icon","color","hotSpot"]),OE=eu(_C,{Icon:Hl((function(t,e,r){var i={node:t},n=r[r.length-1].node,o=EE[n.namespaceURI],s=tu(e,o);ou(i,RE,Ql,s,r,o),s=tu(e,o=EE[mC[0]]),ou(i,RE,PE,s,r,o)})),color:Hl(wE),heading:Hl(KS),hotSpot:Hl((function(t,e){t.setAttribute("x",String(e.x)),t.setAttribute("y",String(e.y)),t.setAttribute("xunits",e.xunits),t.setAttribute("yunits",e.yunits)})),scale:Hl(nR)});var LE=eu(_C,["color","scale"]),ME=eu(_C,{color:Hl(wE),scale:Hl(nR)});var FE=eu(_C,["color","width"]),AE=eu(_C,{color:Hl(wE),width:Hl(KS)});var kE={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},NE=function(t,e,r){if(t)return Bl(e[e.length-1].node.namespaceURI,kE[t.getType()])},jE=$l("Point"),DE=$l("LineString"),GE=$l("LinearRing"),zE=$l("Polygon"),BE=eu(_C,{LineString:Hl(JE),Point:Hl(JE),Polygon:Hl(rR),GeometryCollection:Hl(UE)});function UE(t,e,r){var i,n={node:t},o=e.getType(),s=[];o===gt.GEOMETRY_COLLECTION?(e.getGeometriesArrayRecursive().forEach((function(t){var e=t.getType();e===gt.MULTI_POINT?s=s.concat(t.getPoints()):e===gt.MULTI_LINE_STRING?s=s.concat(t.getLineStrings()):e===gt.MULTI_POLYGON?s=s.concat(t.getPolygons()):e===gt.POINT||e===gt.LINE_STRING||e===gt.POLYGON?s.push(t):lt(!1,39)})),i=NE):o===gt.MULTI_POINT?(s=e.getPoints(),i=jE):o===gt.MULTI_LINE_STRING?(s=e.getLineStrings(),i=DE):o===gt.MULTI_POLYGON?(s=e.getPolygons(),i=zE):lt(!1,39),ou(n,BE,i,s,r)}var YE=eu(_C,{LinearRing:Hl(JE)});function WE(t,e,r){ou({node:t},YE,GE,[e],r)}var VE=eu(_C,{ExtendedData:Hl((function(t,e,r){for(var i={node:t},n=e.names,o=e.values,s=n.length,a=0;a<s;a++)ou(i,bE,CE,[{name:n[a],value:o[a]}],r)})),MultiGeometry:Hl(UE),LineString:Hl(JE),LinearRing:Hl(JE),Point:Hl(JE),Polygon:Hl(rR),Style:Hl((function(t,e,r){var i={node:t},n={};if(e.pointStyles.length){var o=e.pointStyles[0].getText();o&&(n.LabelStyle=o);var s=e.pointStyles[0].getImage();s&&"function"==typeof s.getSrc&&(n.IconStyle=s)}if(e.lineStyles.length){(a=e.lineStyles[0].getStroke())&&(n.LineStyle=a)}if(e.polyStyles.length){var a;(a=e.polyStyles[0].getStroke())&&!n.LineStyle&&(n.LineStyle=a),n.PolyStyle=e.polyStyles[0]}var l=r[r.length-1].node,u=oR[l.namespaceURI],h=tu(n,u);ou(i,sR,Ql,h,r,u)})),address:Hl(JS),description:Hl(JS),name:Hl(JS),open:Hl(ZS),phoneNumber:Hl(JS),styleUrl:Hl(JS),visibility:Hl(ZS)}),XE=eu(_C,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),qE=$l("ExtendedData");function ZE(t,e,r){var i={node:t};e.getId()&&t.setAttribute("id",e.getId());var n=e.getProperties(),o={address:1,description:1,name:1,open:1,phoneNumber:1,styleUrl:1,visibility:1};o[e.getGeometryName()]=1;var s=Object.keys(n||{}).sort().filter((function(t){return!o[t]})),a=e.getStyleFunction();if(a){var l=a(e,0);if(l){var u=Array.isArray(l)?l:[l],h=u;if(e.getGeometry()&&(h=u.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var i=r.getType();return i===gt.GEOMETRY_COLLECTION?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===gt.POINT||e===gt.MULTI_POINT})).length:i===gt.POINT||i===gt.MULTI_POINT}}))),this.writeStyles_){var c=u,p=u;e.getGeometry()&&(c=u.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var i=r.getType();return i===gt.GEOMETRY_COLLECTION?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===gt.LINE_STRING||e===gt.MULTI_LINE_STRING})).length:i===gt.LINE_STRING||i===gt.MULTI_LINE_STRING}})),p=u.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var i=r.getType();return i===gt.GEOMETRY_COLLECTION?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===gt.POLYGON||e===gt.MULTI_POLYGON})).length:i===gt.POLYGON||i===gt.MULTI_POLYGON}}))),n.Style={pointStyles:h,lineStyles:c,polyStyles:p}}if(h.length&&void 0===n.name){var d=h[0].getText();d&&(n.name=d.getText())}}}var f=r[r.length-1].node,g=XE[f.namespaceURI],y=tu(n,g);if(ou(i,VE,Ql,y,r,g),s.length>0){var m=tu(n,s);ou(i,VE,qE,[{names:s,values:m}],r)}var _=r[0],v=e.getGeometry();v&&(v=Gf(v,!0,_)),ou(i,VE,NE,[v],r)}var KE=eu(_C,["extrude","tessellate","altitudeMode","coordinates"]),HE=eu(_C,{extrude:Hl(ZS),tessellate:Hl(ZS),altitudeMode:Hl(JS),coordinates:Hl((function(t,e,r){var i,n=r[r.length-1],o=n.layout,s=n.stride;o==ct||o==dt?i=2:o==pt||o==ft?i=3:lt(!1,34);var a=e.length,l="";if(a>0){l+=e[0];for(var u=1;u<i;++u)l+=","+e[u];for(var h=s;h<a;h+=s){l+=" "+e[h];for(u=1;u<i;++u)l+=","+e[h+u]}}JS(t,l)}))});function JE(t,e,r){var i=e.getFlatCoordinates(),n={node:t};n.layout=e.getLayout(),n.stride=e.getStride();var o=e.getProperties();o.coordinates=i;var s=r[r.length-1].node,a=KE[s.namespaceURI],l=tu(o,a);ou(n,HE,Ql,l,r,a)}var $E=eu(_C,["color","fill","outline"]),QE=eu(_C,{outerBoundaryIs:Hl(WE),innerBoundaryIs:Hl(WE)}),tR=$l("innerBoundaryIs"),eR=$l("outerBoundaryIs");function rR(t,e,r){var i=e.getLinearRings(),n=i.shift(),o={node:t};ou(o,QE,tR,i,r),ou(o,QE,eR,[n],r)}var iR=eu(_C,{color:Hl(wE),fill:Hl(ZS),outline:Hl(ZS)});function nR(t,e){KS(t,Math.round(1e6*e)/1e6)}var oR=eu(_C,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),sR=eu(_C,{IconStyle:Hl((function(t,e,r){var i={node:t},n={},o=e.getSrc(),s=e.getSize(),a=e.getImageSize(),l={href:o};if(s){l.w=s[0],l.h=s[1];var u=e.getAnchor(),h=e.getOrigin();if(h&&a&&0!==h[0]&&h[1]!==s[1]&&(l.x=h[0],l.y=a[1]-(h[1]+s[1])),u&&(u[0]!==s[0]/2||u[1]!==s[1]/2)){var c={x:u[0],xunits:zu,y:s[1]-u[1],yunits:zu};n.hotSpot=c}}n.Icon=l;var p=e.getScale();1!==p&&(n.scale=p);var d=e.getRotation();0!==d&&(n.heading=d);var f=e.getColor();f&&(n.color=f);var g=r[r.length-1].node,y=IE[g.namespaceURI],m=tu(n,y);ou(i,OE,Ql,m,r,y)})),LabelStyle:Hl((function(t,e,r){var i={node:t},n={},o=e.getFill();o&&(n.color=o.getColor());var s=e.getScale();s&&1!==s&&(n.scale=s);var a=r[r.length-1].node,l=LE[a.namespaceURI],u=tu(n,l);ou(i,ME,Ql,u,r,l)})),LineStyle:Hl((function(t,e,r){var i={node:t},n={color:e.getColor(),width:Number(e.getWidth())||1},o=r[r.length-1].node,s=FE[o.namespaceURI],a=tu(n,s);ou(i,AE,Ql,a,r,s)})),PolyStyle:Hl((function(t,e,r){var i={node:t},n=e.getFill(),o=e.getStroke(),s={color:n?n.getColor():void 0,fill:!!n&&void 0,outline:!!o&&void 0},a=r[r.length-1].node,l=$E[a.namespaceURI],u=tu(s,l);ou(i,iR,Ql,u,r,l)}))});var aR=kC,lR=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),uR=[null],hR=eu(uR,{nd:function(t,e){e[e.length-1].ndrefs.push(t.getAttribute("ref"))},tag:fR}),cR=eu(uR,{node:function(t,e){var r=e[0],i=e[e.length-1],n=t.getAttribute("id"),o=[parseFloat(t.getAttribute("lon")),parseFloat(t.getAttribute("lat"))];i.nodes[n]=o;var s=iu({tags:{}},dR,t,e);if(!R(s.tags)){var a=new pi(o);Gf(a,!1,r);var l=new ht(a);l.setId(n),l.setProperties(s.tags,!0),i.features.push(l)}},way:function(t,e){var r=iu({id:t.getAttribute("id"),ndrefs:[],tags:{}},hR,t,e);e[e.length-1].ways.push(r)}}),pR=function(t){function e(){var e=t.call(this)||this;return e.dataProjection=gr("EPSG:4326"),e}return lR(e,t),e.prototype.readFeaturesFromNode=function(t,e){var r=this.getReadOptions(t,e);if("osm"==t.localName){for(var i=iu({nodes:{},ways:[],features:[]},cR,t,[r]),n=0;n<i.ways.length;n++){for(var o=i.ways[n],s=[],a=0,l=o.ndrefs.length;a<l;a++){m(s,i.nodes[o.ndrefs[a]])}var u=void 0;Gf(u=o.ndrefs[0]==o.ndrefs[o.ndrefs.length-1]?new Pi(s,ct,[s.length]):new Tf(s,ct),!1,r);var h=new ht(u);h.setId(o.id),h.setProperties(o.tags,!0),i.features.push(h)}if(i.features)return i.features}return[]},e}(AS),dR=eu(uR,{tag:fR});function fR(t,e){e[e.length-1].tags[t.getAttribute("k")]=t.getAttribute("v")}var gR=pR;function yR(t,e,r,i,n,o){var s,a;void 0!==n?(s=n,a=void 0!==o?o:0):(s=[],a=0);for(var l=e;l<r;){var u=t[l++];s[a++]=t[l++],s[a++]=u;for(var h=2;h<i;++h)s[a++]=t[l++]}return s.length=a,s}var mR=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function _R(t,e,r){var i,n=r||1e5,o=new Array(e);for(i=0;i<e;++i)o[i]=0;for(var s=0,a=t.length;s<a;)for(i=0;i<e;++i,++s){var l=t[s],u=l-o[i];o[i]=l,t[s]=u}return xR(t,n)}function vR(t,e,r){var i,n=r||1e5,o=new Array(e);for(i=0;i<e;++i)o[i]=0;for(var s=wR(t,n),a=0,l=s.length;a<l;)for(i=0;i<e;++i,++a)o[i]+=s[a],s[a]=o[i];return s}function xR(t,e){for(var r=e||1e5,i=0,n=t.length;i<n;++i)t[i]=Math.round(t[i]*r);return function(t){for(var e=0,r=t.length;e<r;++e){var i=t[e];t[e]=i<0?~(i<<1):i<<1}return function(t){for(var e="",r=0,i=t.length;r<i;++r)e+=bR(t[r]);return e}(t)}(t)}function wR(t,e){for(var r=e||1e5,i=function(t){for(var e=function(t){for(var e=[],r=0,i=0,n=0,o=t.length;n<o;++n){var s=t.charCodeAt(n)-63;r|=(31&s)<<i,s<32?(e.push(r),r=0,i=0):i+=5}return e}(t),r=0,i=e.length;r<i;++r){var n=e[r];e[r]=1&n?~(n>>1):n>>1}return e}(t),n=0,o=i.length;n<o;++n)i[n]/=r;return i}function bR(t){for(var e,r="";t>=32;)e=63+(32|31&t),r+=String.fromCharCode(e),t>>=5;return e=t+63,r+=String.fromCharCode(e)}var SR=function(t){function e(e){var r=t.call(this)||this,i=e||{};return r.dataProjection=gr("EPSG:4326"),r.factor_=i.factor?i.factor:1e5,r.geometryLayout_=i.geometryLayout?i.geometryLayout:ct,r}return mR(e,t),e.prototype.readFeatureFromText=function(t,e){var r=this.readGeometryFromText(t,e);return new ht(r)},e.prototype.readFeaturesFromText=function(t,e){return[this.readFeatureFromText(t,e)]},e.prototype.readGeometryFromText=function(t,e){var r=Yr(this.geometryLayout_),i=vR(t,r,this.factor_);yR(i,0,i.length,r,i);var n=ni(i,0,i.length,r);return Gf(new Tf(n,this.geometryLayout_),!1,this.adaptOptions(e))},e.prototype.writeFeatureText=function(t,e){var r=t.getGeometry();return r?this.writeGeometryText(r,e):(lt(!1,40),"")},e.prototype.writeFeaturesText=function(t,e){return this.writeFeatureText(t[0],e)},e.prototype.writeGeometryText=function(t,e){var r=(t=Gf(t,!0,this.adaptOptions(e))).getFlatCoordinates(),i=t.getStride();return yR(r,0,r.length,i,r),_R(r,i,this.factor_)},e}(sC),TR=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),CR=function(t){function e(e){var r=t.call(this)||this,i=e||{};return r.layerName_=i.layerName,r.layers_=i.layers?i.layers:null,r.dataProjection=gr(i.dataProjection?i.dataProjection:"EPSG:4326"),r}return TR(e,t),e.prototype.readFeaturesFromObject=function(t,e){if("Topology"==t.type){var r=t,i=void 0,n=null,o=null;r.transform&&(n=(i=r.transform).scale,o=i.translate);var s=r.arcs;i&&function(t,e,r){for(var i=0,n=t.length;i<n;++i)OR(t[i],e,r)}(s,n,o);var a=[],l=r.objects,u=this.layerName_,h=void 0;for(var c in l)this.layers_&&-1==this.layers_.indexOf(c)||("GeometryCollection"===l[c].type?(h=l[c],a.push.apply(a,PR(h,s,n,o,u,c,e))):(h=l[c],a.push(IR(h,s,n,o,u,c,e))));return a}return[]},e.prototype.readProjectionFromObject=function(t){return this.dataProjection},e}(TS),ER={Point:function(t,e,r){var i=t.coordinates;e&&r&&LR(i,e,r);return new pi(i)},LineString:function(t,e){var r=RR(t.arcs,e);return new Tf(r)},Polygon:function(t,e){for(var r=[],i=0,n=t.arcs.length;i<n;++i)r[i]=RR(t.arcs[i],e);return new Pi(r)},MultiPoint:function(t,e,r){var i=t.coordinates;if(e&&r)for(var n=0,o=i.length;n<o;++n)LR(i[n],e,r);return new Wf(i)},MultiLineString:function(t,e){for(var r=[],i=0,n=t.arcs.length;i<n;++i)r[i]=RR(t.arcs[i],e);return new Uf(r)},MultiPolygon:function(t,e){for(var r=[],i=0,n=t.arcs.length;i<n;++i){for(var o=t.arcs[i],s=[],a=0,l=o.length;a<l;++a)s[a]=RR(o[a],e);r[i]=s}return new qf(r)}};function RR(t,e){for(var r,i,n=[],o=0,s=t.length;o<s;++o)r=t[o],o>0&&n.pop(),i=r>=0?e[r]:e[~r].slice().reverse(),n.push.apply(n,i);for(var a=0,l=n.length;a<l;++a)n[a]=n[a].slice();return n}function PR(t,e,r,i,n,o,s){for(var a=t.geometries,l=[],u=0,h=a.length;u<h;++u)l[u]=IR(a[u],e,r,i,n,o,s);return l}function IR(t,e,r,i,n,o,s){var a,l=t.type,u=ER[l];a="Point"===l||"MultiPoint"===l?u(t,r,i):u(t,e);var h=new ht;h.setGeometry(Gf(a,!1,s)),void 0!==t.id&&h.setId(t.id);var c=t.properties;return n&&(c||(c={}),c[n]=o),c&&h.setProperties(c,!0),h}function OR(t,e,r){for(var i=0,n=0,o=0,s=t.length;o<s;++o){var a=t[o];i+=a[0],n+=a[1],a[0]=i,a[1]=n,LR(a,e,r)}}function LR(t,e,r){t[0]=t[0]*e[0]+r[0],t[1]=t[1]*e[1]+r[1]}var MR=CR,FR=function(){function t(t){this.tagName_=t}return t.prototype.getTagName=function(){return this.tagName_},t}(),AR=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),kR=function(t){function e(e,r){var i=t.call(this,e)||this;return i.conditions=r,lt(i.conditions.length>=2,57),i}return AR(e,t),e}(FR),NR=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),jR=function(t){function e(e){return t.call(this,"And",Array.prototype.slice.call(arguments))||this}return NR(e,t),e}(kR),DR=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),GR=function(t){function e(e,r,i){var n=t.call(this,"BBOX")||this;if(n.geometryName=e,n.extent=r,4!==r.length)throw new Error("Expected an extent with four values ([minX, minY, maxX, maxY])");return n.srsName=i,n}return DR(e,t),e}(FR),zR=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),BR=function(t){function e(e,r,i,n){var o=t.call(this,e)||this;return o.geometryName=r||"the_geom",o.geometry=i,o.srsName=n,o}return zR(e,t),e}(FR),UR=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),YR=function(t){function e(e,r,i){return t.call(this,"Contains",e,r,i)||this}return UR(e,t),e}(BR),WR=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),VR=function(t){function e(e,r){var i=t.call(this,e)||this;return i.propertyName=r,i}return WR(e,t),e}(FR),XR=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),qR=function(t){function e(e,r,i){var n=t.call(this,"During",e)||this;return n.begin=r,n.end=i,n}return XR(e,t),e}(VR),ZR=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),KR=function(t){function e(e,r,i,n){var o=t.call(this,e,r)||this;return o.expression=i,o.matchCase=n,o}return ZR(e,t),e}(VR),HR=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),JR=function(t){function e(e,r,i){return t.call(this,"PropertyIsEqualTo",e,r,i)||this}return HR(e,t),e}(KR),$R=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),QR=function(t){function e(e,r){return t.call(this,"PropertyIsGreaterThan",e,r)||this}return $R(e,t),e}(KR),tP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),eP=function(t){function e(e,r){return t.call(this,"PropertyIsGreaterThanOrEqualTo",e,r)||this}return tP(e,t),e}(KR),rP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),iP=function(t){function e(e,r,i){return t.call(this,"Intersects",e,r,i)||this}return rP(e,t),e}(BR),nP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),oP=function(t){function e(e,r,i){var n=t.call(this,"PropertyIsBetween",e)||this;return n.lowerBoundary=r,n.upperBoundary=i,n}return nP(e,t),e}(VR),sP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),aP=function(t){function e(e,r,i,n,o,s){var a=t.call(this,"PropertyIsLike",e)||this;return a.pattern=r,a.wildCard=void 0!==i?i:"*",a.singleChar=void 0!==n?n:".",a.escapeChar=void 0!==o?o:"!",a.matchCase=s,a}return sP(e,t),e}(VR),lP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),uP=function(t){function e(e){return t.call(this,"PropertyIsNull",e)||this}return lP(e,t),e}(VR),hP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),cP=function(t){function e(e,r){return t.call(this,"PropertyIsLessThan",e,r)||this}return hP(e,t),e}(KR),pP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),dP=function(t){function e(e,r){return t.call(this,"PropertyIsLessThanOrEqualTo",e,r)||this}return pP(e,t),e}(KR),fP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),gP=function(t){function e(e){var r=t.call(this,"Not")||this;return r.condition=e,r}return fP(e,t),e}(FR),yP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),mP=function(t){function e(e,r,i){return t.call(this,"PropertyIsNotEqualTo",e,r,i)||this}return yP(e,t),e}(KR),_P=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),vP=function(t){function e(e){return t.call(this,"Or",Array.prototype.slice.call(arguments))||this}return _P(e,t),e}(kR),xP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),wP=function(t){function e(e,r,i){return t.call(this,"Within",e,r,i)||this}return xP(e,t),e}(BR);function bP(t){var e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(jR,e))}function SP(t,e,r){return new GR(t,e,r)}var TP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),CP={"http://www.opengis.net/gml":{boundedBy:Kl(GS.prototype.readGeometryElement,"bounds")}},EP={"http://www.opengis.net/wfs":{totalInserted:Kl(VS),totalUpdated:Kl(VS),totalDeleted:Kl(VS)}},RP={"http://www.opengis.net/wfs":{TransactionSummary:Kl((function(t,e){return iu({},EP,t,e)}),"transactionSummary"),InsertResults:Kl((function(t,e){return iu([],NP,t,e)}),"insertIds")}},PP={"http://www.opengis.net/wfs":{PropertyName:Hl(JS)}},IP={"http://www.opengis.net/wfs":{Insert:Hl((function(t,e,r){var i=r[r.length-1],n=i.featureType,o=i.featureNS,s=i.gmlVersion,a=Bl(o,n);t.appendChild(a),2===s?aT.prototype.writeFeatureElement(a,e,r):eT.prototype.writeFeatureElement(a,e,r)})),Update:Hl((function(t,e,r){var i=r[r.length-1];lt(void 0!==e.getId(),27);var n=i.featureType,o=i.featurePrefix,s=i.featureNS,a=DP(o,n),l=e.getGeometryName();t.setAttribute("typeName",a),t.setAttributeNS(OP,"xmlns:"+o,s);var u=e.getId();if(void 0!==u){for(var h=e.getKeys(),c=[],p=0,d=h.length;p<d;p++){var f=e.get(h[p]);if(void 0!==f){var g=h[p];f&&"function"==typeof f.getSimplifiedGeometry&&(g=l),c.push({name:g,value:f})}}ou({gmlVersion:i.gmlVersion,node:t,hasZ:i.hasZ,srsName:i.srsName},IP,$l("Property"),c,r),jP(t,u,r)}})),Delete:Hl((function(t,e,r){var i=r[r.length-1];lt(void 0!==e.getId(),26);var n=i.featureType,o=i.featurePrefix,s=i.featureNS,a=DP(o,n);t.setAttribute("typeName",a),t.setAttributeNS(OP,"xmlns:"+o,s);var l=e.getId();void 0!==l&&jP(t,l,r)})),Property:Hl((function(t,e,r){var i=Bl(MP,"Name"),n=r[r.length-1].gmlVersion;if(t.appendChild(i),JS(i,e.name),void 0!==e.value&&null!==e.value){var o=Bl(MP,"Value");t.appendChild(o),e.value&&"function"==typeof e.value.getSimplifiedGeometry?2===n?aT.prototype.writeGeometryElement(o,e.value,r):eT.prototype.writeGeometryElement(o,e.value,r):JS(o,e.value)}})),Native:Hl((function(t,e,r){e.vendorId&&t.setAttribute("vendorId",e.vendorId);void 0!==e.safeToIgnore&&t.setAttribute("safeToIgnore",String(e.safeToIgnore));void 0!==e.value&&JS(t,e.value)}))}},OP="http://www.w3.org/2000/xmlns/",LP="http://www.opengis.net/ogc",MP="http://www.opengis.net/wfs",FP={"1.1.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd","1.0.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"},AP=function(t){function e(e){var r=t.call(this)||this,i=e||{};return r.featureType_=i.featureType,r.featureNS_=i.featureNS,r.gmlFormat_=i.gmlFormat?i.gmlFormat:new eT,r.schemaLocation_=i.schemaLocation?i.schemaLocation:FP["1.1.0"],r}return TP(e,t),e.prototype.getFeatureType=function(){return this.featureType_},e.prototype.setFeatureType=function(t){this.featureType_=t},e.prototype.readFeaturesFromNode=function(t,e){var r={node:t};T(r,{featureType:this.featureType_,featureNS:this.featureNS_}),T(r,this.getReadOptions(t,e||{}));var i=[r];this.gmlFormat_.FEATURE_COLLECTION_PARSERS[NS].featureMember=Xl(GS.prototype.readFeaturesInternal);var n=iu([],this.gmlFormat_.FEATURE_COLLECTION_PARSERS,t,i,this.gmlFormat_);return n||(n=[]),n},e.prototype.readTransactionResponse=function(t){if(t){if("string"==typeof t){var e=Wl(t);return this.readTransactionResponseFromDocument(e)}return Yl(t)?this.readTransactionResponseFromDocument(t):this.readTransactionResponseFromNode(t)}},e.prototype.readFeatureCollectionMetadata=function(t){if(t){if("string"==typeof t){var e=Wl(t);return this.readFeatureCollectionMetadataFromDocument(e)}return Yl(t)?this.readFeatureCollectionMetadataFromDocument(t):this.readFeatureCollectionMetadataFromNode(t)}},e.prototype.readFeatureCollectionMetadataFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFeatureCollectionMetadataFromNode(e)},e.prototype.readFeatureCollectionMetadataFromNode=function(t){var e={},r=XS(t.getAttribute("numberOfFeatures"));return e.numberOfFeatures=r,iu(e,CP,t,[],this.gmlFormat_)},e.prototype.readTransactionResponseFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readTransactionResponseFromNode(e)},e.prototype.readTransactionResponseFromNode=function(t){return iu({},RP,t,[])},e.prototype.writeGetFeature=function(t){var e,r=Bl(MP,"GetFeature");if(r.setAttribute("service","WFS"),r.setAttribute("version","1.1.0"),t&&(t.handle&&r.setAttribute("handle",t.handle),t.outputFormat&&r.setAttribute("outputFormat",t.outputFormat),void 0!==t.maxFeatures&&r.setAttribute("maxFeatures",String(t.maxFeatures)),t.resultType&&r.setAttribute("resultType",t.resultType),void 0!==t.startIndex&&r.setAttribute("startIndex",String(t.startIndex)),void 0!==t.count&&r.setAttribute("count",String(t.count)),void 0!==t.viewParams&&r.setAttribute("viewParams",t.viewParams),e=t.filter,t.bbox)){lt(t.geometryName,12);var i=SP(t.geometryName,t.bbox,t.srsName);e=e?bP(e,i):i}r.setAttributeNS(zl,"xsi:schemaLocation",this.schemaLocation_);var n={node:r};return T(n,{srsName:t.srsName,featureNS:t.featureNS?t.featureNS:this.featureNS_,featurePrefix:t.featurePrefix,geometryName:t.geometryName,filter:e,propertyNames:t.propertyNames?t.propertyNames:[]}),lt(Array.isArray(t.featureTypes),11),function(t,e,r){var i=r[r.length-1],n=T({},i);n.node=t,ou(n,GP,$l("Query"),e,r)}(r,t.featureTypes,[n]),r},e.prototype.writeTransaction=function(t,e,r,i){var n,o,s=[],a=Bl(MP,"Transaction"),l=i.version?i.version:"1.1.0",u="1.0.0"===l?2:3;a.setAttribute("service","WFS"),a.setAttribute("version",l),i&&(n=i.gmlOptions?i.gmlOptions:{},i.handle&&a.setAttribute("handle",i.handle));var h=FP[l];a.setAttributeNS(zl,"xsi:schemaLocation",h);var c=i.featurePrefix?i.featurePrefix:"feature";return t&&(o=T({node:a},{featureNS:i.featureNS,featureType:i.featureType,featurePrefix:c,gmlVersion:u,hasZ:i.hasZ,srsName:i.srsName}),T(o,n),ou(o,IP,$l("Insert"),t,s)),e&&(o=T({node:a},{featureNS:i.featureNS,featureType:i.featureType,featurePrefix:c,gmlVersion:u,hasZ:i.hasZ,srsName:i.srsName}),T(o,n),ou(o,IP,$l("Update"),e,s)),r&&ou({node:a,featureNS:i.featureNS,featureType:i.featureType,featurePrefix:c,gmlVersion:u,srsName:i.srsName},IP,$l("Delete"),r,s),i.nativeElements&&ou({node:a,featureNS:i.featureNS,featureType:i.featureType,featurePrefix:c,gmlVersion:u,srsName:i.srsName},IP,$l("Native"),i.nativeElements,s),a},e.prototype.readProjectionFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readProjectionFromNode(e);return null},e.prototype.readProjectionFromNode=function(t){if(t.firstElementChild&&t.firstElementChild.firstElementChild)for(var e=(t=t.firstElementChild.firstElementChild).firstElementChild;e;e=e.nextElementSibling)if(0!==e.childNodes.length&&(1!==e.childNodes.length||3!==e.firstChild.nodeType)){var r=[{}];return this.gmlFormat_.readGeometryElement(e,r),gr(r.pop().srsName)}return null},e}(AS);var kP={"http://www.opengis.net/ogc":{FeatureId:Xl((function(t,e){return t.getAttribute("fid")}))}};var NP={"http://www.opengis.net/wfs":{Feature:function(t,e){ru(kP,t,e)}}};function jP(t,e,r){var i=Bl(LP,"Filter"),n=Bl(LP,"FeatureId");i.appendChild(n),n.setAttribute("fid",e),t.appendChild(i)}function DP(t,e){var r=(t=t||"feature")+":";return 0===e.indexOf(r)?e:r+e}var GP={"http://www.opengis.net/wfs":{Query:Hl((function(t,e,r){var i,n=r[r.length-1],o=n.featurePrefix,s=n.featureNS,a=n.propertyNames,l=n.srsName;i=o?DP(o,e):e;t.setAttribute("typeName",i),l&&t.setAttribute("srsName",l);s&&t.setAttributeNS(OP,"xmlns:"+o,s);var u=T({},n);u.node=t,ou(u,PP,$l("PropertyName"),a,r);var h=n.filter;if(h){var c=Bl(LP,"Filter");t.appendChild(c),zP(c,h,r)}}))},"http://www.opengis.net/ogc":{During:Hl((function(t,e,r){var i=Bl("http://www.opengis.net/fes","ValueReference");JS(i,e.propertyName),t.appendChild(i);var n=Bl(NS,"TimePeriod");t.appendChild(n);var o=Bl(NS,"begin");n.appendChild(o),XP(o,e.begin);var s=Bl(NS,"end");n.appendChild(s),XP(s,e.end)})),And:Hl(BP),Or:Hl(BP),Not:Hl((function(t,e,r){var i={node:t},n=e.condition;ou(i,GP,$l(n.getTagName()),[n],r)})),BBOX:Hl((function(t,e,r){r[r.length-1].srsName=e.srsName,WP(t,e.geometryName),eT.prototype.writeGeometryElement(t,e.extent,r)})),Contains:Hl((function(t,e,r){r[r.length-1].srsName=e.srsName,WP(t,e.geometryName),eT.prototype.writeGeometryElement(t,e.geometry,r)})),Intersects:Hl((function(t,e,r){r[r.length-1].srsName=e.srsName,WP(t,e.geometryName),eT.prototype.writeGeometryElement(t,e.geometry,r)})),Within:Hl((function(t,e,r){r[r.length-1].srsName=e.srsName,WP(t,e.geometryName),eT.prototype.writeGeometryElement(t,e.geometry,r)})),PropertyIsEqualTo:Hl(UP),PropertyIsNotEqualTo:Hl(UP),PropertyIsLessThan:Hl(UP),PropertyIsLessThanOrEqualTo:Hl(UP),PropertyIsGreaterThan:Hl(UP),PropertyIsGreaterThanOrEqualTo:Hl(UP),PropertyIsNull:Hl((function(t,e,r){WP(t,e.propertyName)})),PropertyIsBetween:Hl((function(t,e,r){WP(t,e.propertyName);var i=Bl(LP,"LowerBoundary");t.appendChild(i),VP(i,""+e.lowerBoundary);var n=Bl(LP,"UpperBoundary");t.appendChild(n),VP(n,""+e.upperBoundary)})),PropertyIsLike:Hl((function(t,e,r){t.setAttribute("wildCard",e.wildCard),t.setAttribute("singleChar",e.singleChar),t.setAttribute("escapeChar",e.escapeChar),void 0!==e.matchCase&&t.setAttribute("matchCase",e.matchCase.toString());WP(t,e.propertyName),VP(t,""+e.pattern)}))}};function zP(t,e,r){ou({node:t},GP,$l(e.getTagName()),[e],r)}function BP(t,e,r){for(var i={node:t},n=e.conditions,o=0,s=n.length;o<s;++o){var a=n[o];ou(i,GP,$l(a.getTagName()),[a],r)}}function UP(t,e,r){void 0!==e.matchCase&&t.setAttribute("matchCase",e.matchCase.toString()),WP(t,e.propertyName),VP(t,""+e.expression)}function YP(t,e,r){var i=Bl(LP,t);JS(i,r),e.appendChild(i)}function WP(t,e){YP("PropertyName",t,e)}function VP(t,e){YP("Literal",t,e)}function XP(t,e){var r=Bl(NS,"TimeInstant");t.appendChild(r);var i=Bl(NS,"timePosition");r.appendChild(i),JS(i,e)}var qP=AP,ZP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),KP={POINT:pi,LINESTRING:Tf,POLYGON:Pi,MULTIPOINT:Wf,MULTILINESTRING:Uf,MULTIPOLYGON:qf},HP=1,JP=2,$P=3,QP=4,tI=5,eI=6,rI={};for(var iI in gt)rI[iI]=gt[iI].toUpperCase();var nI=function(){function t(t){this.wkt=t,this.index_=-1}return t.prototype.isAlpha_=function(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"},t.prototype.isNumeric_=function(t,e){return t>="0"&&t<="9"||"."==t&&!(void 0!==e&&e)},t.prototype.isWhiteSpace_=function(t){return" "==t||"\t"==t||"\r"==t||"\n"==t},t.prototype.nextChar_=function(){return this.wkt.charAt(++this.index_)},t.prototype.nextToken=function(){var t,e=this.nextChar_(),r=this.index_,i=e;if("("==e)t=JP;else if(","==e)t=tI;else if(")"==e)t=$P;else if(this.isNumeric_(e)||"-"==e)t=QP,i=this.readNumber_();else if(this.isAlpha_(e))t=HP,i=this.readText_();else{if(this.isWhiteSpace_(e))return this.nextToken();if(""!==e)throw new Error("Unexpected character: "+e);t=eI}return{position:r,value:i,type:t}},t.prototype.readNumber_=function(){var t,e=this.index_,r=!1,i=!1;do{"."==t?r=!0:"e"!=t&&"E"!=t||(i=!0),t=this.nextChar_()}while(this.isNumeric_(t,r)||!i&&("e"==t||"E"==t)||i&&("-"==t||"+"==t));return parseFloat(this.wkt.substring(e,this.index_--))},t.prototype.readText_=function(){var t,e=this.index_;do{t=this.nextChar_()}while(this.isAlpha_(t));return this.wkt.substring(e,this.index_--).toUpperCase()},t}(),oI=function(){function t(t){this.lexer_=t,this.token_,this.layout_=ct}return t.prototype.consume_=function(){this.token_=this.lexer_.nextToken()},t.prototype.isTokenType=function(t){return this.token_.type==t},t.prototype.match=function(t){var e=this.isTokenType(t);return e&&this.consume_(),e},t.prototype.parse=function(){return this.consume_(),this.parseGeometry_()},t.prototype.parseGeometryLayout_=function(){var t=ct,e=this.token_;if(this.isTokenType(HP)){var r=e.value;"Z"===r?t=pt:"M"===r?t=dt:"ZM"===r&&(t=ft),t!==ct&&this.consume_()}return t},t.prototype.parseGeometryCollectionText_=function(){if(this.match(JP)){var t=[];do{t.push(this.parseGeometry_())}while(this.match(tI));if(this.match($P))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parsePointText_=function(){if(this.match(JP)){var t=this.parsePoint_();if(this.match($P))return t}else if(this.isEmptyGeometry_())return null;throw new Error(this.formatErrorMessage_())},t.prototype.parseLineStringText_=function(){if(this.match(JP)){var t=this.parsePointList_();if(this.match($P))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parsePolygonText_=function(){if(this.match(JP)){var t=this.parseLineStringTextList_();if(this.match($P))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiPointText_=function(){if(this.match(JP)){var t=void 0;if(t=this.token_.type==JP?this.parsePointTextList_():this.parsePointList_(),this.match($P))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiLineStringText_=function(){if(this.match(JP)){var t=this.parseLineStringTextList_();if(this.match($P))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiPolygonText_=function(){if(this.match(JP)){var t=this.parsePolygonTextList_();if(this.match($P))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parsePoint_=function(){for(var t=[],e=this.layout_.length,r=0;r<e;++r){var i=this.token_;if(!this.match(QP))break;t.push(i.value)}if(t.length==e)return t;throw new Error(this.formatErrorMessage_())},t.prototype.parsePointList_=function(){for(var t=[this.parsePoint_()];this.match(tI);)t.push(this.parsePoint_());return t},t.prototype.parsePointTextList_=function(){for(var t=[this.parsePointText_()];this.match(tI);)t.push(this.parsePointText_());return t},t.prototype.parseLineStringTextList_=function(){for(var t=[this.parseLineStringText_()];this.match(tI);)t.push(this.parseLineStringText_());return t},t.prototype.parsePolygonTextList_=function(){for(var t=[this.parsePolygonText_()];this.match(tI);)t.push(this.parsePolygonText_());return t},t.prototype.isEmptyGeometry_=function(){var t=this.isTokenType(HP)&&"EMPTY"==this.token_.value;return t&&this.consume_(),t},t.prototype.formatErrorMessage_=function(){return"Unexpected `"+this.token_.value+"` at position "+this.token_.position+" in `"+this.lexer_.wkt+"`"},t.prototype.parseGeometry_=function(){var t=this.token_;if(this.match(HP)){var e=t.value;if(this.layout_=this.parseGeometryLayout_(),"GEOMETRYCOLLECTION"==e){var r=this.parseGeometryCollectionText_();return new wS(r)}var i=KP[e];if(!i)throw new Error("Invalid geometry type: "+e);var n=void 0;switch(e){case"POINT":n=this.parsePointText_();break;case"LINESTRING":n=this.parseLineStringText_();break;case"POLYGON":n=this.parsePolygonText_();break;case"MULTIPOINT":n=this.parseMultiPointText_();break;case"MULTILINESTRING":n=this.parseMultiLineStringText_();break;case"MULTIPOLYGON":n=this.parseMultiPolygonText_();break;default:throw new Error("Invalid geometry type: "+e)}return n||(n=i===KP.POINT?[NaN,NaN]:[]),new i(n,this.layout_)}throw new Error(this.formatErrorMessage_())},t}(),sI=function(t){function e(e){var r=t.call(this)||this,i=e||{};return r.splitCollection_=void 0!==i.splitCollection&&i.splitCollection,r}return ZP(e,t),e.prototype.parse_=function(t){var e=new nI(t);return new oI(e).parse()},e.prototype.readFeatureFromText=function(t,e){var r=this.readGeometryFromText(t,e);if(r){var i=new ht;return i.setGeometry(r),i}return null},e.prototype.readFeaturesFromText=function(t,e){for(var r=[],i=this.readGeometryFromText(t,e),n=[],o=0,s=(r=this.splitCollection_&&i.getType()==gt.GEOMETRY_COLLECTION?i.getGeometriesArray():[i]).length;o<s;++o){var a=new ht;a.setGeometry(r[o]),n.push(a)}return n},e.prototype.readGeometryFromText=function(t,e){var r=this.parse_(t);return r?Gf(r,!1,e):null},e.prototype.writeFeatureText=function(t,e){var r=t.getGeometry();return r?this.writeGeometryText(r,e):""},e.prototype.writeFeaturesText=function(t,e){if(1==t.length)return this.writeFeatureText(t[0],e);for(var r=[],i=0,n=t.length;i<n;++i)r.push(t[i].getGeometry());var o=new wS(r);return this.writeGeometryText(o,e)},e.prototype.writeGeometryText=function(t,e){return cI(Gf(t,!0,e))},e}(sC);function aI(t){var e=t.getCoordinates();return 0===e.length?"":e.join(" ")}function lI(t){for(var e=t.getCoordinates(),r=[],i=0,n=e.length;i<n;++i)r.push(e[i].join(" "));return r.join(",")}function uI(t){for(var e=[],r=t.getLinearRings(),i=0,n=r.length;i<n;++i)e.push("("+lI(r[i])+")");return e.join(",")}var hI={Point:aI,LineString:lI,Polygon:uI,MultiPoint:function(t){for(var e=[],r=t.getPoints(),i=0,n=r.length;i<n;++i)e.push("("+aI(r[i])+")");return e.join(",")},MultiLineString:function(t){for(var e=[],r=t.getLineStrings(),i=0,n=r.length;i<n;++i)e.push("("+lI(r[i])+")");return e.join(",")},MultiPolygon:function(t){for(var e=[],r=t.getPolygons(),i=0,n=r.length;i<n;++i)e.push("("+uI(r[i])+")");return e.join(",")},GeometryCollection:function(t){for(var e=[],r=t.getGeometries(),i=0,n=r.length;i<n;++i)e.push(cI(r[i]));return e.join(",")}};function cI(t){var e=t.getType(),r=(0,hI[e])(t);if(e=e.toUpperCase(),"function"==typeof t.getFlatCoordinates){var i=function(t){var e=t.getLayout(),r="";return e!==pt&&e!==ft||(r+="Z"),e!==dt&&e!==ft||(r+="M"),r}(t);i.length>0&&(e+=" "+i)}return 0===r.length?e+" EMPTY":e+"("+r+")"}var pI=sI,dI=function(){function t(){}return t.prototype.read=function(t){if(t){if("string"==typeof t){var e=Wl(t);return this.readFromDocument(e)}return Yl(t)?this.readFromDocument(t):this.readFromNode(t)}return null},t.prototype.readFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFromNode(e);return null},t.prototype.readFromNode=function(t){},t}();function fI(t){return t.getAttributeNS("http://www.w3.org/1999/xlink","href")}var gI=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),yI=[null,"http://www.opengis.net/wms"],mI=eu(yI,{Service:Kl((function(t,e){return iu({},xI,t,e)})),Capability:Kl((function(t,e){return iu({},_I,t,e)}))}),_I=eu(yI,{Request:Kl((function(t,e){return iu({},PI,t,e)})),Exception:Kl((function(t,e){return iu([],TI,t,e)})),Layer:Kl((function(t,e){return iu({},CI,t,e)}))}),vI=function(t){function e(){var e=t.call(this)||this;return e.version=void 0,e}return gI(e,t),e.prototype.readFromNode=function(t){this.version=t.getAttribute("version").trim();var e=iu({version:this.version},mI,t,[]);return e||null},e}(dI),xI=eu(yI,{Name:Kl(qS),Title:Kl(qS),Abstract:Kl(qS),KeywordList:Kl(DI),OnlineResource:Kl(fI),ContactInformation:Kl((function(t,e){return iu({},wI,t,e)})),Fees:Kl(qS),AccessConstraints:Kl(qS),LayerLimit:Kl(VS),MaxWidth:Kl(VS),MaxHeight:Kl(VS)}),wI=eu(yI,{ContactPersonPrimary:Kl((function(t,e){return iu({},bI,t,e)})),ContactPosition:Kl(qS),ContactAddress:Kl((function(t,e){return iu({},SI,t,e)})),ContactVoiceTelephone:Kl(qS),ContactFacsimileTelephone:Kl(qS),ContactElectronicMailAddress:Kl(qS)}),bI=eu(yI,{ContactPerson:Kl(qS),ContactOrganization:Kl(qS)}),SI=eu(yI,{AddressType:Kl(qS),Address:Kl(qS),City:Kl(qS),StateOrProvince:Kl(qS),PostCode:Kl(qS),Country:Kl(qS)}),TI=eu(yI,{Format:Xl(qS)}),CI=eu(yI,{Name:Kl(qS),Title:Kl(qS),Abstract:Kl(qS),KeywordList:Kl(DI),CRS:Zl(qS),EX_GeographicBoundingBox:Kl((function(t,e){var r=iu({},RI,t,e);if(!r)return;var i=r.westBoundLongitude,n=r.southBoundLatitude,o=r.eastBoundLongitude,s=r.northBoundLatitude;if(void 0===i||void 0===n||void 0===o||void 0===s)return;return[i,n,o,s]})),BoundingBox:Zl((function(t,e){var r=[WS(t.getAttribute("minx")),WS(t.getAttribute("miny")),WS(t.getAttribute("maxx")),WS(t.getAttribute("maxy"))],i=[WS(t.getAttribute("resx")),WS(t.getAttribute("resy"))];return{crs:t.getAttribute("CRS"),extent:r,res:i}})),Dimension:Zl((function(t,e){return{name:t.getAttribute("name"),units:t.getAttribute("units"),unitSymbol:t.getAttribute("unitSymbol"),default:t.getAttribute("default"),multipleValues:BS(t.getAttribute("multipleValues")),nearestValue:BS(t.getAttribute("nearestValue")),current:BS(t.getAttribute("current")),values:qS(t)}})),Attribution:Kl((function(t,e){return iu({},EI,t,e)})),AuthorityURL:Zl((function(t,e){var r=kI(t,e);if(r)return r.name=t.getAttribute("name"),r;return})),Identifier:Zl(qS),MetadataURL:Zl((function(t,e){var r=kI(t,e);if(r)return r.type=t.getAttribute("type"),r;return})),DataURL:Zl(kI),FeatureListURL:Zl(kI),Style:Zl((function(t,e){return iu({},MI,t,e)})),MinScaleDenominator:Kl(YS),MaxScaleDenominator:Kl(YS),Layer:Zl((function(t,e){var r=e[e.length-1],i=iu({},CI,t,e);if(!i)return;var n=BS(t.getAttribute("queryable"));void 0===n&&(n=r.queryable);i.queryable=void 0!==n&&n;var o=XS(t.getAttribute("cascaded"));void 0===o&&(o=r.cascaded);i.cascaded=o;var s=BS(t.getAttribute("opaque"));void 0===s&&(s=r.opaque);i.opaque=void 0!==s&&s;var a=BS(t.getAttribute("noSubsets"));void 0===a&&(a=r.noSubsets);i.noSubsets=void 0!==a&&a;var l=WS(t.getAttribute("fixedWidth"));l||(l=r.fixedWidth);i.fixedWidth=l;var u=WS(t.getAttribute("fixedHeight"));u||(u=r.fixedHeight);i.fixedHeight=u,["Style","CRS","AuthorityURL"].forEach((function(t){if(t in r){var e=i[t]||[];i[t]=e.concat(r[t])}}));return["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"].forEach((function(t){if(!(t in i)){var e=r[t];i[t]=e}})),i}))}),EI=eu(yI,{Title:Kl(qS),OnlineResource:Kl(fI),LogoURL:Kl(jI)}),RI=eu(yI,{westBoundLongitude:Kl(YS),eastBoundLongitude:Kl(YS),southBoundLatitude:Kl(YS),northBoundLatitude:Kl(YS)}),PI=eu(yI,{GetCapabilities:Kl(NI),GetMap:Kl(NI),GetFeatureInfo:Kl(NI)}),II=eu(yI,{Format:Zl(qS),DCPType:Zl((function(t,e){return iu({},OI,t,e)}))}),OI=eu(yI,{HTTP:Kl((function(t,e){return iu({},LI,t,e)}))}),LI=eu(yI,{Get:Kl(kI),Post:Kl(kI)}),MI=eu(yI,{Name:Kl(qS),Title:Kl(qS),Abstract:Kl(qS),LegendURL:Zl(jI),StyleSheetURL:Kl(kI),StyleURL:Kl(kI)}),FI=eu(yI,{Format:Kl(qS),OnlineResource:Kl(fI)}),AI=eu(yI,{Keyword:Xl(qS)});function kI(t,e){return iu({},FI,t,e)}function NI(t,e){return iu({},II,t,e)}function jI(t,e){var r=kI(t,e);if(r){var i=[XS(t.getAttribute("width")),XS(t.getAttribute("height"))];return r.size=i,r}}function DI(t,e){return iu([],AI,t,e)}var GI=vI,zI=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),BI=function(t){function e(e){var r=t.call(this)||this,i=e||{};return r.featureNS_="http://mapserver.gis.umn.edu/mapserver",r.gmlFormat_=new aT,r.layers_=i.layers?i.layers:null,r}return zI(e,t),e.prototype.getLayers=function(){return this.layers_},e.prototype.setLayers=function(t){this.layers_=t},e.prototype.readFeatures_=function(t,e){t.setAttribute("namespaceURI",this.featureNS_);var r=t.localName,i=[];if(0===t.childNodes.length)return i;if("msGMLOutput"==r)for(var n=0,o=t.childNodes.length;n<o;n++){var s=t.childNodes[n];if(s.nodeType===Node.ELEMENT_NODE){var a=s,l=e[0],u=a.localName.replace("_layer","");if(!this.layers_||f(this.layers_,u)){var h=u+"_feature";l.featureType=h,l.featureNS=this.featureNS_;var c={};c[h]=Xl(this.gmlFormat_.readFeatureElement,this.gmlFormat_);var p=eu([l.featureNS,null],c);a.setAttribute("namespaceURI",this.featureNS_);var d=iu([],p,a,e,this.gmlFormat_);d&&m(i,d)}}}if("FeatureCollection"==r){var g=iu([],this.gmlFormat_.FEATURE_COLLECTION_PARSERS,t,[{}],this.gmlFormat_);g&&(i=g)}return i},e.prototype.readFeaturesFromNode=function(t,e){var r={};return e&&T(r,this.getReadOptions(t,e)),this.readFeatures_(t,[r])},e}(AS),UI=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),YI=[null,"http://www.opengis.net/ows/1.1"],WI=eu(YI,{ServiceIdentification:Kl((function(t,e){return iu({},iO,t,e)})),ServiceProvider:Kl((function(t,e){return iu({},nO,t,e)})),OperationsMetadata:Kl((function(t,e){return iu({},QI,t,e)}))}),VI=function(t){function e(){return t.call(this)||this}return UI(e,t),e.prototype.readFromNode=function(t){var e=iu({},WI,t,[]);return e||null},e}(dI),XI=eu(YI,{DeliveryPoint:Kl(qS),City:Kl(qS),AdministrativeArea:Kl(qS),PostalCode:Kl(qS),Country:Kl(qS),ElectronicMailAddress:Kl(qS)}),qI=eu(YI,{Value:Zl((function(t,e){return qS(t)}))}),ZI=eu(YI,{AllowedValues:Kl((function(t,e){return iu({},qI,t,e)}))}),KI=eu(YI,{Phone:Kl((function(t,e){return iu({},tO,t,e)})),Address:Kl((function(t,e){return iu({},XI,t,e)}))}),HI=eu(YI,{HTTP:Kl((function(t,e){return iu({},JI,t,e)}))}),JI=eu(YI,{Get:Zl((function(t,e){var r=fI(t);if(!r)return;return iu({href:r},eO,t,e)})),Post:void 0}),$I=eu(YI,{DCP:Kl((function(t,e){return iu({},HI,t,e)}))}),QI=eu(YI,{Operation:function(t,e){var r=t.getAttribute("name"),i=iu({},$I,t,e);if(!i)return;e[e.length-1][r]=i}}),tO=eu(YI,{Voice:Kl(qS),Facsimile:Kl(qS)}),eO=eu(YI,{Constraint:Zl((function(t,e){var r=t.getAttribute("name");if(!r)return;return iu({name:r},ZI,t,e)}))}),rO=eu(YI,{IndividualName:Kl(qS),PositionName:Kl(qS),ContactInfo:Kl((function(t,e){return iu({},KI,t,e)}))}),iO=eu(YI,{Abstract:Kl(qS),AccessConstraints:Kl(qS),Fees:Kl(qS),Title:Kl(qS),ServiceTypeVersion:Kl(qS),ServiceType:Kl(qS)}),nO=eu(YI,{ProviderName:Kl(qS),ProviderSite:Kl(fI),ServiceContact:Kl((function(t,e){return iu({},rO,t,e)}))});var oO=VI,sO=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),aO=[null,"http://www.opengis.net/wmts/1.0"],lO=[null,"http://www.opengis.net/ows/1.1"],uO=eu(aO,{Contents:Kl((function(t,e){return iu({},cO,t,e)}))}),hO=function(t){function e(){var e=t.call(this)||this;return e.owsParser_=new oO,e}return sO(e,t),e.prototype.readFromNode=function(t){var e=t.getAttribute("version");e&&(e=e.trim());var r=this.owsParser_.readFromNode(t);return r?(r.version=e,(r=iu(r,uO,t,[]))||null):null},e}(dI),cO=eu(aO,{Layer:Zl((function(t,e){return iu({},pO,t,e)})),TileMatrixSet:Zl((function(t,e){return iu({},vO,t,e)}))}),pO=eu(aO,{Style:Zl((function(t,e){var r=iu({},dO,t,e);if(!r)return;var i="true"===t.getAttribute("isDefault");return r.isDefault=i,r})),Format:Zl(qS),TileMatrixSetLink:Zl((function(t,e){return iu({},fO,t,e)})),Dimension:Zl((function(t,e){return iu({},mO,t,e)})),ResourceURL:Zl((function(t,e){var r=t.getAttribute("format"),i=t.getAttribute("template"),n=t.getAttribute("resourceType"),o={};r&&(o.format=r);i&&(o.template=i);n&&(o.resourceType=n);return o}))},eu(lO,{Title:Kl(qS),Abstract:Kl(qS),WGS84BoundingBox:Kl((function(t,e){var r=iu([],_O,t,e);if(2!=r.length)return;return Dt(r)})),Identifier:Kl(qS)})),dO=eu(aO,{LegendURL:Zl((function(t,e){var r={};return r.format=t.getAttribute("format"),r.href=fI(t),r}))},eu(lO,{Title:Kl(qS),Identifier:Kl(qS)})),fO=eu(aO,{TileMatrixSet:Kl(qS),TileMatrixSetLimits:Kl((function(t,e){return iu([],gO,t,e)}))}),gO=eu(aO,{TileMatrixLimits:Xl((function(t,e){return iu({},yO,t,e)}))}),yO=eu(aO,{TileMatrix:Kl(qS),MinTileRow:Kl(VS),MaxTileRow:Kl(VS),MinTileCol:Kl(VS),MaxTileCol:Kl(VS)}),mO=eu(aO,{Default:Kl(qS),Value:Zl(qS)},eu(lO,{Identifier:Kl(qS)})),_O=eu(lO,{LowerCorner:Xl(wO),UpperCorner:Xl(wO)}),vO=eu(aO,{WellKnownScaleSet:Kl(qS),TileMatrix:Zl((function(t,e){return iu({},xO,t,e)}))},eu(lO,{SupportedCRS:Kl(qS),Identifier:Kl(qS)})),xO=eu(aO,{TopLeftCorner:Kl(wO),ScaleDenominator:Kl(YS),TileWidth:Kl(VS),TileHeight:Kl(VS),MatrixWidth:Kl(VS),MatrixHeight:Kl(VS)},eu(lO,{Identifier:Kl(qS)}));function wO(t,e){var r=qS(t).split(/\s+/);if(r&&2==r.length){var i=+r[0],n=+r[1];if(!isNaN(i)&&!isNaN(n))return[i,n]}}var bO=hO,SO=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),TO=["fullscreenchange","webkitfullscreenchange","MSFullscreenChange"],CO="enterfullscreen",EO="leavefullscreen";function RO(){var t=document.body;return!!(t.webkitRequestFullscreen||t.msRequestFullscreen&&document.msFullscreenEnabled||t.requestFullscreen&&document.fullscreenEnabled)}function PO(){return!!(document.webkitIsFullScreen||document.msFullscreenElement||document.fullscreenElement)}function IO(t){t.requestFullscreen?t.requestFullscreen():t.msRequestFullscreen?t.msRequestFullscreen():t.webkitRequestFullscreen&&t.webkitRequestFullscreen()}var OO=function(t){function e(e){var r=this,i=e||{};(r=t.call(this,{element:document.createElement("div"),target:i.target})||this).cssClassName_=void 0!==i.className?i.className:"ol-full-screen";var n=void 0!==i.label?i.label:"⤢";r.labelNode_="string"==typeof n?document.createTextNode(n):n;var o=void 0!==i.labelActive?i.labelActive:"×";r.labelActiveNode_="string"==typeof o?document.createTextNode(o):o,r.button_=document.createElement("button");var s=i.tipLabel?i.tipLabel:"Toggle full-screen";r.setClassName_(r.button_,PO()),r.button_.setAttribute("type","button"),r.button_.title=s,r.button_.appendChild(r.labelNode_),r.button_.addEventListener(F,r.handleClick_.bind(r),!1);var a=r.cssClassName_+" ol-unselectable ol-control "+(RO()?"":"ol-unsupported"),l=r.element;return l.className=a,l.appendChild(r.button_),r.keys_=void 0!==i.keys&&i.keys,r.source_=i.source,r}return SO(e,t),e.prototype.handleClick_=function(t){t.preventDefault(),this.handleFullScreen_()},e.prototype.handleFullScreen_=function(){if(RO()){var t=this.getMap();if(t)if(PO())document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.webkitExitFullscreen&&document.webkitExitFullscreen();else{var e=void 0;e=this.source_?"string"==typeof this.source_?document.getElementById(this.source_):this.source_:t.getTargetElement(),this.keys_?function(t){t.webkitRequestFullscreen?t.webkitRequestFullscreen():IO(t)}(e):IO(e)}}},e.prototype.handleFullScreenChange_=function(){var t=this.getMap();PO()?(this.setClassName_(this.button_,!0),Yn(this.labelActiveNode_,this.labelNode_),this.dispatchEvent(CO)):(this.setClassName_(this.button_,!1),Yn(this.labelNode_,this.labelActiveNode_),this.dispatchEvent(EO)),t&&t.updateSize()},e.prototype.setClassName_=function(t,e){var r=this.cssClassName_+"-true",i=this.cssClassName_+"-false",n=e?r:i;t.classList.remove(r),t.classList.remove(i),t.classList.add(n)},e.prototype.setMap=function(e){if(t.prototype.setMap.call(this,e),e)for(var r=0,i=TO.length;r<i;++r)this.listenerKeys.push(W(document,TO[r],this.handleFullScreenChange_,this))},e}(Us),LO=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),MO=function(t){function e(e){var r=this,i=e||{},n=document.createElement("div");return n.className=void 0!==i.className?i.className:"ol-mouse-position",(r=t.call(this,{element:n,render:i.render,target:i.target})||this).addEventListener(tt("projection"),r.handleProjectionChanged_),i.coordinateFormat&&r.setCoordinateFormat(i.coordinateFormat),i.projection&&r.setProjection(i.projection),r.undefinedHTML_=void 0!==i.undefinedHTML?i.undefinedHTML:"&#160;",r.renderOnMouseOut_=!!r.undefinedHTML_,r.renderedHTML_=n.innerHTML,r.mapProjection_=null,r.transform_=null,r}return LO(e,t),e.prototype.handleProjectionChanged_=function(){this.transform_=null},e.prototype.getCoordinateFormat=function(){return this.get("coordinateFormat")},e.prototype.getProjection=function(){return this.get("projection")},e.prototype.handleMouseMove=function(t){var e=this.getMap();this.updateHTML_(e.getEventPixel(t))},e.prototype.handleMouseOut=function(t){this.updateHTML_(null)},e.prototype.setMap=function(e){if(t.prototype.setMap.call(this,e),e){var r=e.getViewport();this.listenerKeys.push(W(r,Ko,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push(W(r,$o,this.handleMouseOut,this))}},e.prototype.setCoordinateFormat=function(t){this.set("coordinateFormat",t)},e.prototype.setProjection=function(t){this.set("projection",gr(t))},e.prototype.updateHTML_=function(t){var e=this.undefinedHTML_;if(t&&this.mapProjection_){if(!this.transform_){var r=this.getProjection();this.transform_=r?br(this.mapProjection_,r):dr}var i=this.getMap().getCoordinateFromPixelInternal(t);if(i){var n=Or();n&&(this.transform_=br(this.mapProjection_,n)),this.transform_(i,i);var o=this.getCoordinateFormat();e=o?o(i):i.toString()}}this.renderedHTML_&&e===this.renderedHTML_||(this.element.innerHTML=e,this.renderedHTML_=e)},e.prototype.render=function(t){var e=t.frameState;e?this.mapProjection_!=e.viewState.projection&&(this.mapProjection_=e.viewState.projection,this.transform_=null):this.mapProjection_=null},e}(Us),FO=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),AO=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return FO(e,t),e.prototype.createRenderer=function(){return new zo(this)},e}(zs),kO=function(t){function e(e){var r=this,i=e||{};(r=t.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this).boundHandleRotationChanged_=r.handleRotationChanged_.bind(r),r.collapsed_=void 0===i.collapsed||i.collapsed,r.collapsible_=void 0===i.collapsible||i.collapsible,r.collapsible_||(r.collapsed_=!1),r.rotateWithView_=void 0!==i.rotateWithView&&i.rotateWithView,r.viewExtent_=void 0;var n=void 0!==i.className?i.className:"ol-overviewmap",o=void 0!==i.tipLabel?i.tipLabel:"Overview map",s=void 0!==i.collapseLabel?i.collapseLabel:"«";"string"==typeof s?(r.collapseLabel_=document.createElement("span"),r.collapseLabel_.textContent=s):r.collapseLabel_=s;var a=void 0!==i.label?i.label:"»";"string"==typeof a?(r.label_=document.createElement("span"),r.label_.textContent=a):r.label_=a;var l=r.collapsible_&&!r.collapsed_?r.collapseLabel_:r.label_,u=document.createElement("button");u.setAttribute("type","button"),u.title=o,u.appendChild(l),u.addEventListener(F,r.handleClick_.bind(r),!1),r.ovmapDiv_=document.createElement("div"),r.ovmapDiv_.className="ol-overviewmap-map",r.view_=i.view,r.ovmap_=new AO({view:i.view});var h=r.ovmap_;i.layers&&i.layers.forEach((function(t){h.addLayer(t)}));var c=document.createElement("div");c.className="ol-overviewmap-box",c.style.boxSizing="border-box",r.boxOverlay_=new dl({position:[0,0],positioning:rl,element:c}),r.ovmap_.addOverlay(r.boxOverlay_);var p=n+" ol-unselectable ol-control"+(r.collapsed_&&r.collapsible_?" ol-collapsed":"")+(r.collapsible_?"":" ol-uncollapsible"),d=r.element;d.className=p,d.appendChild(r.ovmapDiv_),d.appendChild(u);var f=r,g=r.boxOverlay_,y=r.boxOverlay_.getElement(),m=function(t){var e,r={clientX:(e=t).clientX,clientY:e.clientY},i=h.getEventCoordinateInternal(r);g.setPosition(i)},_=function(t){var e=h.getEventCoordinateInternal(t);f.getMap().getView().setCenterInternal(e),window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",_)};return y.addEventListener("mousedown",(function(){window.addEventListener("mousemove",m),window.addEventListener("mouseup",_)})),r}return FO(e,t),e.prototype.setMap=function(e){var r=this.getMap();if(e!==r){if(r){var i=r.getView();i&&this.unbindView_(i),this.ovmap_.setTarget(null)}if(t.prototype.setMap.call(this,e),e){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push(W(e,c,this.handleMapPropertyChange_,this));var n=e.getView();n&&(this.bindView_(n),n.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_()))}}},e.prototype.handleMapPropertyChange_=function(t){if(t.key===as){var e=t.oldValue;e&&this.unbindView_(e);var r=this.getMap().getView();this.bindView_(r)}},e.prototype.bindView_=function(t){if(!this.view_){var e=new ks({projection:t.getProjection()});this.ovmap_.setView(e)}t.addEventListener(tt(xs),this.boundHandleRotationChanged_),this.handleRotationChanged_()},e.prototype.unbindView_=function(t){t.removeEventListener(tt(xs),this.boundHandleRotationChanged_)},e.prototype.handleRotationChanged_=function(){this.rotateWithView_&&this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())},e.prototype.validateExtent_=function(){var t=this.getMap(),e=this.ovmap_;if(t.isRendered()&&e.isRendered()){var r=t.getSize(),i=t.getView().calculateExtentInternal(r);if(!this.viewExtent_||!Jt(i,this.viewExtent_)){this.viewExtent_=i;var n=e.getSize(),o=e.getView().calculateExtentInternal(n),s=e.getPixelFromCoordinateInternal(pe(i)),a=e.getPixelFromCoordinateInternal(se(i)),l=Math.abs(s[0]-a[0]),u=Math.abs(s[1]-a[1]),h=n[0],c=n[1];l<.1*h||u<.1*c||l>.75*h||u>.75*c?this.resetExtent_():Yt(o,i)||this.recenter_()}}},e.prototype.resetExtent_=function(){var t=this.getMap(),e=this.ovmap_,r=t.getSize(),i=t.getView().calculateExtentInternal(r),n=e.getView(),o=Math.log(7.5)/Math.LN2;me(i,1/(.1*Math.pow(2,o/2))),n.fitInternal(Oi(i))},e.prototype.recenter_=function(){var t=this.getMap(),e=this.ovmap_,r=t.getView();e.getView().setCenterInternal(r.getCenterInternal())},e.prototype.updateBox_=function(){var t=this.getMap(),e=this.ovmap_;if(t.isRendered()&&e.isRendered()){var r=t.getSize(),i=t.getView(),n=e.getView(),o=this.rotateWithView_?0:-i.getRotation(),s=this.boxOverlay_,a=this.boxOverlay_.getElement(),l=i.getCenterInternal(),u=i.getResolution(),h=n.getResolution(),c=r[0]*u/h,p=r[1]*u/h;if(s.setPosition(l),a){a.style.width=c+"px",a.style.height=p+"px";var d="rotate("+o+"rad)";a.style.transform=d}}},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_()},e.prototype.handleToggle_=function(){this.element.classList.toggle("ol-collapsed"),this.collapsed_?Yn(this.collapseLabel_,this.label_):Yn(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;var t=this.ovmap_;if(!this.collapsed_){if(t.isRendered())return this.viewExtent_=void 0,void t.render();t.updateSize(),this.resetExtent_(),V(t,es,(function(t){this.updateBox_()}),this)}},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.getRotateWithView=function(){return this.rotateWithView_},e.prototype.setRotateWithView=function(t){this.rotateWithView_!==t&&(this.rotateWithView_=t,0!==this.getMap().getView().getRotation()&&(this.rotateWithView_?this.handleRotationChanged_():this.ovmap_.getView().setRotation(0),this.viewExtent_=void 0,this.validateExtent_(),this.updateBox_()))},e.prototype.getOverviewMap=function(){return this.ovmap_},e.prototype.render=function(t){this.validateExtent_(),this.updateBox_()},e}(Us),NO=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),jO="degrees",DO="imperial",GO="nautical",zO="metric",BO="us",UO=[1,2,5],YO=function(t){function e(e){var r=this,i=e||{},n=void 0!==i.className?i.className:i.bar?"ol-scale-bar":"ol-scale-line";return(r=t.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this).innerElement_=document.createElement("div"),r.innerElement_.className=n+"-inner",r.element.className=n+" ol-unselectable",r.element.appendChild(r.innerElement_),r.viewState_=null,r.minWidth_=void 0!==i.minWidth?i.minWidth:64,r.renderedVisible_=!1,r.renderedWidth_=void 0,r.renderedHTML_="",r.addEventListener(tt("units"),r.handleUnitsChanged_),r.setUnits(i.units||zO),r.scaleBar_=i.bar||!1,r.scaleBarSteps_=i.steps||4,r.scaleBarText_=i.text||!1,r.dpi_=i.dpi||void 0,r}return NO(e,t),e.prototype.getUnits=function(){return this.get("units")},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set("units",t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,r=t.projection,i=this.getUnits(),n=i==jO?_t.DEGREES:_t.METERS,o=yr(r,t.resolution,e,n),s=this.minWidth_*(this.dpi_||25.4/.28)/(25.4/.28),a=s*o,l="";if(i==jO){var u=mt[_t.DEGREES];(a*=u)<u/60?(l="″",o*=3600):a<u?(l="′",o*=60):l="°"}else i==DO?a<.9144?(l="in",o/=.0254):a<1609.344?(l="ft",o/=.3048):(l="mi",o/=1609.344):i==GO?(o/=1852,l="nm"):i==zO?a<.001?(l="μm",o*=1e6):a<1?(l="mm",o*=1e3):a<1e3?l="m":(l="km",o/=1e3):i==BO?a<.9144?(l="in",o*=39.37):a<1609.344?(l="ft",o/=.30480061):(l="mi",o/=1609.3472):lt(!1,33);for(var h,c,p,d,f=3*Math.floor(Math.log(s*o)/Math.log(10));;){p=Math.floor(f/3);var g=Math.pow(10,p);if(h=UO[(f%3+3)%3]*g,c=Math.round(h/o),isNaN(c))return this.element.style.display="none",void(this.renderedVisible_=!1);if(c>=s)break;++f}d=this.scaleBar_?this.createScaleBar(c,h,l):h.toFixed(p<0?-p:0)+" "+l,this.renderedHTML_!=d&&(this.innerElement_.innerHTML=d,this.renderedHTML_=d),this.renderedWidth_!=c&&(this.innerElement_.style.width=c+"px",this.renderedWidth_=c),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.createScaleBar=function(t,e,r){for(var i="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),n=[],o=t/this.scaleBarSteps_,s="#ffffff",a=0;a<this.scaleBarSteps_;a++)0===a&&n.push(this.createMarker("absolute",a)),n.push('<div><div class="ol-scale-singlebar" style="width: '+o+"px;background-color: "+s+';"></div>'+this.createMarker("relative",a)+(a%2==0||2===this.scaleBarSteps_?this.createStepText(a,t,!1,e,r):"")+"</div>"),a===this.scaleBarSteps_-1&&n.push(this.createStepText(a+1,t,!0,e,r)),s="#ffffff"===s?"#000000":"#ffffff";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+t+'px;">'+i+"</div>":"")+n.join("")+"</div>"},e.prototype.createMarker=function(t,e){return'<div class="ol-scale-step-marker" style="position: '+t+";top: "+("absolute"===t?3:-10)+'px;"></div>'},e.prototype.createStepText=function(t,e,r,i,n){var o=(0===t?0:Math.round(i/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+n);return'<div class="ol-scale-step-text" style="margin-left: '+(0===t?-3:e/this.scaleBarSteps_*-1)+"px;text-align: "+(0===t?"left":"center")+"; min-width: "+(0===t?0:e/this.scaleBarSteps_*2)+"px;left: "+(r?e+"px":"unset")+';">'+o+"</div>"},e.prototype.getScaleForResolution=function(){var t=yr(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center),e=this.dpi_||25.4/.28,r=this.viewState_.projection.getMetersPerUnit();return parseFloat(t.toString())*r*39.37*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(Us),WO=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),VO=0,XO=1,qO=function(t){function e(e){var r=this,i=e||{};(r=t.call(this,{element:document.createElement("div"),render:i.render})||this).dragListenerKeys_=[],r.currentResolution_=void 0,r.direction_=VO,r.dragging_,r.heightLimit_=0,r.widthLimit_=0,r.startX_,r.startY_,r.thumbSize_=null,r.sliderInitialized_=!1,r.duration_=void 0!==i.duration?i.duration:200;var n=void 0!==i.className?i.className:"ol-zoomslider",o=document.createElement("button");o.setAttribute("type","button"),o.className=n+"-thumb ol-unselectable";var s=r.element;return s.className=n+" ol-unselectable ol-control",s.appendChild(o),s.addEventListener(Ho,r.handleDraggerStart_.bind(r),!1),s.addEventListener(Ko,r.handleDraggerDrag_.bind(r),!1),s.addEventListener(Jo,r.handleDraggerEnd_.bind(r),!1),s.addEventListener(F,r.handleContainerClick_.bind(r),!1),o.addEventListener(F,u,!1),r}return WO(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),e&&e.render()},e.prototype.initSlider_=function(){var t=this.element,e=t.offsetWidth,r=t.offsetHeight;if(0===e&&0===r)return this.sliderInitialized_=!1;var i=t.firstElementChild,n=getComputedStyle(i),o=i.offsetWidth+parseFloat(n.marginRight)+parseFloat(n.marginLeft),s=i.offsetHeight+parseFloat(n.marginTop)+parseFloat(n.marginBottom);return this.thumbSize_=[o,s],e>r?(this.direction_=XO,this.widthLimit_=e-o):(this.direction_=VO,this.heightLimit_=r-s),this.sliderInitialized_=!0},e.prototype.handleContainerClick_=function(t){var e=this.getMap().getView(),r=this.getRelativePosition_(t.offsetX-this.thumbSize_[0]/2,t.offsetY-this.thumbSize_[1]/2),i=this.getResolutionForPosition_(r),n=e.getConstrainedZoom(e.getZoomForResolution(i));e.animateInternal({zoom:n,duration:this.duration_,easing:Is})},e.prototype.handleDraggerStart_=function(t){if(!this.dragging_&&t.target===this.element.firstElementChild){var e=this.element.firstElementChild;if(this.getMap().getView().beginInteraction(),this.startX_=t.clientX-parseFloat(e.style.left),this.startY_=t.clientY-parseFloat(e.style.top),this.dragging_=!0,0===this.dragListenerKeys_.length){var r=this.handleDraggerDrag_,i=this.handleDraggerEnd_;this.dragListenerKeys_.push(W(document,Ko,r,this),W(document,Jo,i,this))}}},e.prototype.handleDraggerDrag_=function(t){if(this.dragging_){var e=t.clientX-this.startX_,r=t.clientY-this.startY_,i=this.getRelativePosition_(e,r);this.currentResolution_=this.getResolutionForPosition_(i),this.getMap().getView().setResolution(this.currentResolution_)}},e.prototype.handleDraggerEnd_=function(t){this.dragging_&&(this.getMap().getView().endInteraction(),this.dragging_=!1,this.startX_=void 0,this.startY_=void 0,this.dragListenerKeys_.forEach(X),this.dragListenerKeys_.length=0)},e.prototype.setThumbPosition_=function(t){var e=this.getPositionForResolution_(t),r=this.element.firstElementChild;this.direction_==XO?r.style.left=this.widthLimit_*e+"px":r.style.top=this.heightLimit_*e+"px"},e.prototype.getRelativePosition_=function(t,e){return we(this.direction_===XO?t/this.widthLimit_:e/this.heightLimit_,0,1)},e.prototype.getResolutionForPosition_=function(t){return this.getMap().getView().getResolutionForValueFunction()(1-t)},e.prototype.getPositionForResolution_=function(t){return we(1-this.getMap().getView().getValueForResolutionFunction()(t),0,1)},e.prototype.render=function(t){if(t.frameState&&(this.sliderInitialized_||this.initSlider_())){var e=t.frameState.viewState.resolution;this.currentResolution_=e,this.setThumbPosition_(e)}},e}(Us),ZO=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),KO=function(t){function e(e){var r=this,i=e||{};(r=t.call(this,{element:document.createElement("div"),target:i.target})||this).extent=i.extent?i.extent:null;var n=void 0!==i.className?i.className:"ol-zoom-extent",o=void 0!==i.label?i.label:"E",s=void 0!==i.tipLabel?i.tipLabel:"Fit to extent",a=document.createElement("button");a.setAttribute("type","button"),a.title=s,a.appendChild("string"==typeof o?document.createTextNode(o):o),a.addEventListener(F,r.handleClick_.bind(r),!1);var l=n+" ol-unselectable ol-control",u=r.element;return u.className=l,u.appendChild(a),r}return ZO(e,t),e.prototype.handleClick_=function(t){t.preventDefault(),this.handleZoomToExtent()},e.prototype.handleZoomToExtent=function(){var t=this.getMap().getView(),e=this.extent?this.extent:t.getProjection().getExtent();t.fitInternal(Oi(e))},e}(Us),HO={array:{},color:{},colorlike:{},control:{},coordinate:{},easing:{},events:{}};HO.events.condition={},HO.extent={},HO.featureloader={},HO.format={},HO.format.filter={},HO.geom={},HO.has={},HO.interaction={},HO.layer={},HO.loadingstrategy={},HO.proj={},HO.proj.Units={},HO.proj.proj4={},HO.render={},HO.render.canvas={},HO.renderer={},HO.renderer.canvas={},HO.renderer.webgl={},HO.size={},HO.source={},HO.sphere={},HO.style={},HO.style.IconImageCache={},HO.tilegrid={},HO.transform={},HO.util={},HO.webgl={},HO.xml={},HO.Collection=at,HO.Feature=ht,HO.Geolocation=Vi,HO.Kinetic=Xi,HO.Map=Ja,HO.Object=et,HO.Observable=K,HO.Observable.unByKey=Z,HO.Overlay=dl,HO.PluggableMap=zs,HO.View=ks,HO.array.stableSort=function(t,e){var r,i=t.length,n=Array(t.length);for(r=0;r<i;r++)n[r]={index:r,value:t[r]};for(n.sort((function(t,r){return e(t.value,r.value)||t.index-r.index})),r=0;r<t.length;r++)t[r]=n[r].value},HO.color.asArray=tn,HO.color.asString=Ki,HO.colorlike.asColorLike=Ln,HO.control.Attribution=Ws,HO.control.Control=Us,HO.control.FullScreen=OO,HO.control.MousePosition=MO,HO.control.OverviewMap=kO,HO.control.Rotate=Xs,HO.control.ScaleLine=YO,HO.control.Zoom=Zs,HO.control.ZoomSlider=qO,HO.control.ZoomToExtent=KO,HO.control.defaults=Ks,HO.coordinate.add=Qe,HO.coordinate.createStringXY=function(t){return function(e){return ur(e,t)}},HO.coordinate.format=rr,HO.coordinate.rotate=nr,HO.coordinate.toStringHDMS=function(t,e){return t?er("NS",t[1],e)+" "+er("EW",t[0],e):""},HO.coordinate.toStringXY=ur,HO.easing.easeIn=Ps,HO.easing.easeOut=Is,HO.easing.inAndOut=Os,HO.easing.linear=Ls,HO.easing.upAndDown=function(t){return t<.5?Os(2*t):1-Os(2*(t-.5))},HO.events.condition.altKeyOnly=sa,HO.events.condition.altShiftKeysOnly=aa,HO.events.condition.always=ha,HO.events.condition.click=function(t){return t.type==Zo.CLICK},HO.events.condition.doubleClick=function(t){return t.type==Zo.DBLCLICK},HO.events.condition.focus=la,HO.events.condition.mouseOnly=ma,HO.events.condition.never=pa,HO.events.condition.noModifierKeys=fa,HO.events.condition.penOnly=function(t){var e=t.originalEvent;return lt(void 0!==e,56),"pen"===e.pointerType},HO.events.condition.platformModifierKeyOnly=function(t){var e=t.originalEvent;return!e.altKey&&(kn?e.metaKey:e.ctrlKey)&&!e.shiftKey},HO.events.condition.pointerMove=function(t){return"pointermove"==t.type},HO.events.condition.primaryAction=_a,HO.events.condition.shiftKeyOnly=ga,HO.events.condition.singleClick=da,HO.events.condition.targetNotEditable=ya,HO.events.condition.touchOnly=function(t){var e=t.originalEvent;return lt(void 0!==e,56),"touch"===e.pointerType},HO.extent.applyTransform=_e,HO.extent.boundingExtent=Dt,HO.extent.buffer=Gt,HO.extent.containsCoordinate=Ut,HO.extent.containsExtent=Yt,HO.extent.containsXY=Wt,HO.extent.createEmpty=Xt,HO.extent.equals=Jt,HO.extent.extend=$t,HO.extent.getArea=ne,HO.extent.getBottomLeft=oe,HO.extent.getBottomRight=se,HO.extent.getCenter=ae,HO.extent.getHeight=he,HO.extent.getIntersection=ce,HO.extent.getSize=function(t){return[t[2]-t[0],t[3]-t[1]]},HO.extent.getTopLeft=pe,HO.extent.getTopRight=de,HO.extent.getWidth=fe,HO.extent.intersects=ge,HO.extent.isEmpty=ye,HO.featureloader.setWithCredentials=function(t){_l=t},HO.featureloader.xhr=xl,HO.format.EsriJSON=MS,HO.format.Feature=Df,HO.format.GML=iT,HO.format.GML2=aT,HO.format.GML3=eT,HO.format.GML32=hT,HO.format.GPX=XT,HO.format.GeoJSON=HT,HO.format.IGC=gC,HO.format.IIIFInfo=Ec,HO.format.KML=aR,HO.format.MVT=ng,HO.format.OSMXML=gR,HO.format.Polyline=SR,HO.format.Polyline.decodeDeltas=vR,HO.format.Polyline.decodeFloats=wR,HO.format.Polyline.encodeDeltas=_R,HO.format.Polyline.encodeFloats=xR,HO.format.TopoJSON=MR,HO.format.WFS=qP,HO.format.WFS.writeFilter=function(t){var e=Bl(LP,"Filter");return zP(e,t,[]),e},HO.format.WKT=pI,HO.format.WMSCapabilities=GI,HO.format.WMSGetFeatureInfo=BI,HO.format.WMTSCapabilities=bO,HO.format.filter.Bbox=GR,HO.format.filter.Contains=YR,HO.format.filter.During=qR,HO.format.filter.EqualTo=JR,HO.format.filter.GreaterThan=QR,HO.format.filter.GreaterThanOrEqualTo=eP,HO.format.filter.Intersects=iP,HO.format.filter.IsBetween=oP,HO.format.filter.IsLike=aP,HO.format.filter.IsNull=uP,HO.format.filter.LessThan=cP,HO.format.filter.LessThanOrEqualTo=dP,HO.format.filter.Not=gP,HO.format.filter.NotEqualTo=mP,HO.format.filter.Or=vP,HO.format.filter.Within=wP,HO.format.filter.and=bP,HO.format.filter.bbox=SP,HO.format.filter.between=function(t,e,r){return new oP(t,e,r)},HO.format.filter.contains=function(t,e,r){return new YR(t,e,r)},HO.format.filter.during=function(t,e,r){return new qR(t,e,r)},HO.format.filter.equalTo=function(t,e,r){return new JR(t,e,r)},HO.format.filter.greaterThan=function(t,e){return new QR(t,e)},HO.format.filter.greaterThanOrEqualTo=function(t,e){return new eP(t,e)},HO.format.filter.intersects=function(t,e,r){return new iP(t,e,r)},HO.format.filter.isNull=function(t){return new uP(t)},HO.format.filter.lessThan=function(t,e){return new cP(t,e)},HO.format.filter.lessThanOrEqualTo=function(t,e){return new dP(t,e)},HO.format.filter.like=function(t,e,r,i,n,o){return new aP(t,e,r,i,n,o)},HO.format.filter.not=function(t){return new gP(t)},HO.format.filter.notEqualTo=function(t,e,r){return new mP(t,e,r)},HO.format.filter.or=function(t){var e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(vP,e))},HO.format.filter.within=function(t,e,r){return new wP(t,e,r)},HO.geom.Circle=Ob,HO.geom.Geometry=Br,HO.geom.GeometryCollection=wS,HO.geom.LineString=Tf,HO.geom.LinearRing=hi,HO.geom.MultiLineString=Uf,HO.geom.MultiPoint=Wf,HO.geom.MultiPolygon=qf,HO.geom.Point=pi,HO.geom.Polygon=Pi,HO.geom.Polygon.circular=Ii,HO.geom.Polygon.fromCircle=Li,HO.geom.Polygon.fromExtent=Oi,HO.geom.SimpleGeometry=Wr,HO.has.DEVICE_PIXEL_RATIO=Nn,HO.interaction.DoubleClickZoom=ea,HO.interaction.DragAndDrop=Cb,HO.interaction.DragBox=Oa,HO.interaction.DragPan=xa,HO.interaction.DragRotate=ba,HO.interaction.DragRotateAndZoom=Rb,HO.interaction.DragZoom=Ma,HO.interaction.Draw=zb,HO.interaction.Draw.createBox=function(){return function(t,e,r){var i=Dt(t.map((function(t){return Mr(t,r)}))),n=[[oe(i),se(i),de(i),pe(i),oe(i)]],o=e;o?o.setCoordinates(n):o=new Pi(n);var s=Or();return s&&o.transform(r,s),o}},HO.interaction.Draw.createRegularPolygon=function(t,e){return function(r,i,n){var o=Mr(r[0],n),s=Mr(r[1],n),a=Math.sqrt(sr(o,s)),l=i||Li(new Ob(o),t),u=e;if(!e){var h=s[0]-o[0],c=s[1]-o[1];u=Math.atan(c/h)-(h<0?Math.PI:0)}Mi(l,o,a,u);var p=Or();return p&&l.transform(n,p),l}},HO.interaction.Extent=qb,HO.interaction.Interaction=Qs,HO.interaction.KeyboardPan=Da,HO.interaction.KeyboardZoom=za,HO.interaction.Modify=iS,HO.interaction.MouseWheelZoom=Wa,HO.interaction.PinchRotate=Xa,HO.interaction.PinchZoom=Za,HO.interaction.Pointer=na,HO.interaction.Select=lS,HO.interaction.Snap=pS,HO.interaction.Translate=_S,HO.interaction.defaults=Ka,HO.layer.Base=mn,HO.layer.BaseImage=ap,HO.layer.BaseTile=vp,HO.layer.BaseVector=_d,HO.layer.Graticule=Lf,HO.layer.Group=Yo,HO.layer.Heatmap=jf,HO.layer.Image=gp,HO.layer.Layer=In,HO.layer.MapboxVector=vb,HO.layer.Tile=Tp,HO.layer.Vector=Ef,HO.layer.VectorImage=wb,HO.layer.VectorTile=sg,HO.loadingstrategy.all=wl,HO.loadingstrategy.bbox=function(t,e){return[t]},HO.loadingstrategy.tile=function(t){return function(e,r){var i=t.getZForResolution(r),n=t.getTileRangeForExtentAndZ(e,i),o=[],s=[i,0,0];for(s[1]=n.minX;s[1]<=n.maxX;++s[1])for(s[2]=n.minY;s[2]<=n.maxY;++s[2])o.push(t.getTileCoordExtent(s));return o}},HO.proj.Projection=xe,HO.proj.Units.METERS_PER_UNIT=mt,HO.proj.addCoordinateTransforms=xr,HO.proj.addEquivalentProjections=mr,HO.proj.addProjection=fr,HO.proj.equivalent=wr,HO.proj.fromLonLat=function(t,e){return Tr(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")},HO.proj.get=gr,HO.proj.getPointResolution=yr,HO.proj.getTransform=Sr,HO.proj.proj4.register=function(t){var e,r,i=Object.keys(t.defs),n=i.length;for(e=0;e<n;++e){var o=i[e];if(!gr(o)){var s=t.defs(o);fr(new xe({code:o,axisOrientation:s.axis,metersPerUnit:s.to_meter,units:s.units}))}}for(e=0;e<n;++e){var a=i[e],l=gr(a);for(r=0;r<n;++r){var u=i[r],h=gr(u);if(!Xe(a,u)){var c=t.defs(a),p=t.defs(u);if(c===p)mr([l,h]);else{var d=t(T({},c,{axis:void 0}),T({},p,{axis:void 0}));xr(l,h,kr(l,h,d.forward),kr(h,l,d.inverse))}}}}},HO.proj.toLonLat=function(t,e){var r=Tr(t,void 0!==e?e:"EPSG:3857","EPSG:4326"),i=r[0];return(i<-180||i>180)&&(r[0]=Pe(i+180,360)-180),r},HO.proj.transform=Tr,HO.proj.transformExtent=Cr,HO.render.VectorContext=On,HO.render.canvas.labelCache=$n,HO.render.getRenderPixel=function(t,e){var r=e.slice(0);return St(t.inversePixelTransform.slice(),r),r},HO.render.getVectorContext=Mo,HO.render.toContext=function(t,e){var r=t.canvas,i=e||{},n=i.pixelRatio||Nn,o=i.size;o&&(r.width=o[0]*n,r.height=o[1]*n,r.style.width=o[0]+"px",r.style.height=o[1]+"px");var s=[0,0,r.width,r.height],a=Tt([1,0,0,1,0,0],n,n);return new go(t,n,s,a,0)},HO.renderer.Composite=zo,HO.renderer.canvas.ImageLayer=dp,HO.renderer.canvas.TileLayer=bp,HO.renderer.canvas.VectorImageLayer=df,HO.renderer.canvas.VectorLayer=cf,HO.renderer.canvas.VectorTileLayer=xf,HO.renderer.webgl.PointsLayer=Ed,HO.size.toSize=Ds,HO.source.BingMaps=Kh,HO.source.CartoDB=Qh,HO.source.Cluster=cc,HO.source.IIIF=Ic,HO.source.Image=Dc,HO.source.ImageArcGISRest=Bc,HO.source.ImageCanvas=Vc,HO.source.ImageMapGuide=qc,HO.source.ImageStatic=Kc,HO.source.ImageWMS=rp,HO.source.OSM=op,HO.source.OSM.ATTRIBUTION=np,HO.source.Raster=zp,HO.source.Source=Mh,HO.source.Stamen=Vp,HO.source.Tile=Nh,HO.source.TileArcGISRest=qp,HO.source.TileDebug=Hp,HO.source.TileImage=Xh,HO.source.TileJSON=$p,HO.source.TileWMS=td,HO.source.UTFGrid=id,HO.source.Vector=uc,HO.source.VectorTile=hd,HO.source.WMTS=gd,HO.source.WMTS.optionsFromCapabilities=function(t,e){var r=_(t.Contents.Layer,(function(t,r,i){return t.Identifier==e.layer}));if(null===r)return null;var i,n=t.Contents.TileMatrixSet;(i=r.TileMatrixSetLink.length>1?x(r.TileMatrixSetLink,"projection"in e?function(t,r,i){var o=_(n,(function(e){return e.Identifier==t.TileMatrixSet})).SupportedCRS,s=gr(o.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||gr(o),a=gr(e.projection);return s&&a?wr(s,a):o==e.projection}:function(t,r,i){return t.TileMatrixSet==e.matrixSet}):0)<0&&(i=0);var o=r.TileMatrixSetLink[i].TileMatrixSet,s=r.TileMatrixSetLink[i].TileMatrixSetLimits,a=r.Format[0];"format"in e&&(a=e.format),(i=x(r.Style,(function(t,r,i){return"style"in e?t.Title==e.style:t.isDefault})))<0&&(i=0);var l=r.Style[i].Identifier,u={};"Dimension"in r&&r.Dimension.forEach((function(t,e,r){var i=t.Identifier,n=t.Default;void 0===n&&(n=t.Value[0]),u[i]=n}));var h,c=_(t.Contents.TileMatrixSet,(function(t,e,r){return t.Identifier==o})),p=c.SupportedCRS;if(p&&(h=gr(p.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||gr(p)),"projection"in e){var d=gr(e.projection);d&&(h&&!wr(d,h)||(h=d))}var g="ne"==h.getAxisOrientation().substr(0,2),y=c.TileMatrix[0],m={MinTileCol:0,MinTileRow:0,MaxTileCol:y.MatrixWidth-1,MaxTileRow:y.MatrixHeight-1};s&&(m=s[s.length-1],y=_(c.TileMatrix,(function(t){return t.Identifier===m.TileMatrix})));var v=28e-5*y.ScaleDenominator/h.getMetersPerUnit(),w=g?[y.TopLeftCorner[1],y.TopLeftCorner[0]]:y.TopLeftCorner,b=y.TileWidth*v,S=y.TileHeight*v,T=[w[0]+b*m.MinTileCol,w[1]-S*(1+m.MaxTileRow),w[0]+b*(1+m.MaxTileCol),w[1]-S*m.MinTileRow];null===h.getExtent()&&h.setExtent(T);var C=Mu(c,T,s),E=[],R=e.requestEncoding;if(R=void 0!==R?R:"","OperationsMetadata"in t&&"GetTile"in t.OperationsMetadata)for(var P=t.OperationsMetadata.GetTile.DCP.HTTP.Get,I=0,O=P.length;I<O;++I)if(P[I].Constraint){var L=_(P[I].Constraint,(function(t){return"GetEncoding"==t.name})).AllowedValues.Value;if(""===R&&(R=L[0]),R!==pd)break;f(L,pd)&&E.push(P[I].href)}else P[I].href&&(R=pd,E.push(P[I].href));return 0===E.length&&(R=dd,r.ResourceURL.forEach((function(t){"tile"===t.resourceType&&(a=t.format,E.push(t.template))}))),{urls:E,layer:e.layer,matrixSet:o,format:a,projection:h,requestEncoding:R,tileGrid:C,style:l,dimensions:u,wrapX:!1,crossOrigin:e.crossOrigin}},HO.source.XYZ=Jh,HO.source.Zoomify=yc,HO.sphere.getArea=function t(e,r){var i=r||{},n=i.radius||6371008.8,o=i.projection||"EPSG:3857",s=e.getType();s!==gt.GEOMETRY_COLLECTION&&(e=e.clone().transform(o,"EPSG:4326"));var a,l,u,h,c,p,d=0;switch(s){case gt.POINT:case gt.MULTI_POINT:case gt.LINE_STRING:case gt.MULTI_LINE_STRING:case gt.LINEAR_RING:break;case gt.POLYGON:for(a=e.getCoordinates(),d=Math.abs(Ke(a[0],n)),u=1,h=a.length;u<h;++u)d-=Math.abs(Ke(a[u],n));break;case gt.MULTI_POLYGON:for(u=0,h=(a=e.getCoordinates()).length;u<h;++u)for(l=a[u],d+=Math.abs(Ke(l[0],n)),c=1,p=l.length;c<p;++c)d-=Math.abs(Ke(l[c],n));break;case gt.GEOMETRY_COLLECTION:var f=e.getGeometries();for(u=0,h=f.length;u<h;++u)d+=t(f[u],r);break;default:throw new Error("Unsupported geometry type: "+s)}return d},HO.sphere.getDistance=qe,HO.sphere.getLength=function t(e,r){var i=r||{},n=i.radius||6371008.8,o=i.projection||"EPSG:3857",s=e.getType();s!==gt.GEOMETRY_COLLECTION&&(e=e.clone().transform(o,"EPSG:4326"));var a,l,u,h,c,p,d=0;switch(s){case gt.POINT:case gt.MULTI_POINT:break;case gt.LINE_STRING:case gt.LINEAR_RING:d=Ze(a=e.getCoordinates(),n);break;case gt.MULTI_LINE_STRING:case gt.POLYGON:for(u=0,h=(a=e.getCoordinates()).length;u<h;++u)d+=Ze(a[u],n);break;case gt.MULTI_POLYGON:for(u=0,h=(a=e.getCoordinates()).length;u<h;++u)for(c=0,p=(l=a[u]).length;c<p;++c)d+=Ze(l[c],n);break;case gt.GEOMETRY_COLLECTION:var f=e.getGeometries();for(u=0,h=f.length;u<h;++u)d+=t(f[u],r);break;default:throw new Error("Unsupported geometry type: "+s)}return d},HO.style.Circle=ju,HO.style.Fill=Du,HO.style.Icon=th,HO.style.IconImageCache.shared=sn,HO.style.Image=Fu,HO.style.RegularShape=ku,HO.style.Stroke=eh,HO.style.Style=ah,HO.style.Text=hh,HO.tilegrid.TileGrid=Ll,HO.tilegrid.WMTS=Lu,HO.tilegrid.WMTS.createFromCapabilitiesMatrixSet=Mu,HO.tilegrid.createXYZ=Fl,HO.transform.composeCssTransform=function(t,e,r,i,n,o,s){return Rt(Ct([1,0,0,1,0,0],t,e,r,i,n,o,s))},HO.util.getUid=o,HO.webgl.ARRAY_BUFFER=34962,HO.webgl.Buffer=cu,HO.webgl.DYNAMIC_DRAW=35048,HO.webgl.ELEMENT_ARRAY_BUFFER=34963,HO.webgl.Helper=Eu,HO.webgl.Helper.computeAttributesStride=Tu,HO.webgl.PostProcessingPass=fu,HO.webgl.RenderTarget=Pu,HO.webgl.STATIC_DRAW=35044,HO.webgl.STREAM_DRAW=35040,HO.xml.getAllTextContent=Ul,HO.xml.parse=Wl,HO.xml.registerDocument=function(t){au=t},HO.xml.registerXMLSerializer=function(t){su=t};e.default=HO}]).default}));
//# sourceMappingURL=js/vendor/openlayers/ol.js.map