Skip to content

Instantly share code, notes, and snippets.

@pdbartsch
Last active July 26, 2019 05:57
Show Gist options
  • Save pdbartsch/44332447869f2a450144 to your computer and use it in GitHub Desktop.
Save pdbartsch/44332447869f2a450144 to your computer and use it in GitHub Desktop.
Turf.js example

Working my way through some turf.js tutorials.

starting here

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Hello Turf.js</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<link href='https://api.tiles.mapbox.com/mapbox.js/v2.1.8/mapbox.css' rel='stylesheet' />
<link href="styles.css" rel="stylesheet" media="all">
<script src='https://api.tiles.mapbox.com/mapbox.js/v2.1.8/mapbox.js'></script>
<script src='https://api.tiles.mapbox.com/mapbox.js/plugins/turf/v1.3.0/turf.min.js'></script>
<script src="leaflet-providers.js"></script>
</head>
<body>
<p><a href="https://www.mapbox.com/guides/analysis-with-turf/">Tutorial from MapBox</a></p>
<div id='map'></div>
<script>
L.mapbox.accessToken = 'pk.eyJ1IjoicGRiYXJ0c2NoIiwiYSI6IktCQVRZSnMifQ.lkDvYfHPWix0mNfNqvdxEA';
// store GeoJSON objects in these variables
var hospitals =
{
"type": "FeatureCollection",
"features": [
{ "type": "Feature", "properties": { "Name": "VA Medical Center -- Leestown Division", "Address": "2250 Leestown Rd" }, "geometry": { "type": "Point", "coordinates": [ -84.539487, 38.072916 ] } },
{ "type": "Feature", "properties": { "Name": "St. Joseph East", "Address": "150 N Eagle Creek Dr" }, "geometry": { "type": "Point", "coordinates": [ -84.440434, 37.998757 ] } },
{ "type": "Feature", "properties": { "Name": "Central Baptist Hospital", "Address": "1740 Nicholasville Rd" }, "geometry": { "type": "Point", "coordinates": [ -84.512283, 38.018918 ] } },
{ "type": "Feature", "properties": { "Name": "VA Medical Center -- Cooper Dr Division", "Address": "1101 Veterans Dr" }, "geometry": { "type": "Point", "coordinates": [ -84.506483, 38.02972 ] } },
{ "type": "Feature", "properties": { "Name": "Shriners Hospital for Children", "Address": "1900 Richmond Rd" }, "geometry": { "type": "Point", "coordinates": [ -84.472941, 38.022564 ] } },
{ "type": "Feature", "properties": { "Name": "Eastern State Hospital", "Address": "627 W Fourth St" }, "geometry": { "type": "Point", "coordinates": [ -84.498816, 38.060791 ] } },
{ "type": "Feature", "properties": { "Name": "Cardinal Hill Rehabilitation Hospital", "Address": "2050 Versailles Rd" }, "geometry": { "type": "Point", "coordinates": [ -84.54212, 38.046568 ] } },
{ "type": "Feature", "properties": { "Name": "St. Joseph Hospital", "ADDRESS": "1 St Joseph Dr" }, "geometry": { "type": "Point", "coordinates": [ -84.523636, 38.032475 ] } },
{ "type": "Feature", "properties": { "Name": "UK Healthcare Good Samaritan Hospital", "Address": "310 S Limestone" }, "geometry": { "type": "Point", "coordinates": [ -84.501222, 38.042123 ] } },
{ "type": "Feature", "properties": { "Name": "UK Medical Center", "Address": "800 Rose St" }, "geometry": { "type": "Point", "coordinates": [ -84.508205, 38.031254 ] }
}
]
}
;
var libraries =
{
"type": "FeatureCollection",
"features": [
{ "type": "Feature", "properties": { "Name": "Village Branch", "Address": "2185 Versailles Rd" }, "geometry": { "type": "Point", "coordinates": [ -84.548369, 38.047876 ] } },
{ "type": "Feature", "properties": { "Name": "Northside Branch", "ADDRESS": "1733 Russell Cave Rd" }, "geometry": { "type": "Point", "coordinates": [ -84.47135, 38.079734 ] } },
{ "type": "Feature", "properties": { "Name": "Central Library", "ADDRESS": "140 E Main St" }, "geometry": { "type": "Point", "coordinates": [ -84.496894, 38.045459 ] } },
{ "type": "Feature", "properties": { "Name": "Beaumont Branch", "Address": "3080 Fieldstone Way" }, "geometry": { "type": "Point", "coordinates": [ -84.557948, 38.012502 ] } },
{ "type": "Feature", "properties": { "Name": "Tates Creek Branch", "Address": "3628 Walden Dr" }, "geometry": { "type": "Point", "coordinates": [ -84.498679, 37.979598 ] } },
{ "type": "Feature", "properties": { "Name": "Eagle Creek Branch", "Address": "101 N Eagle Creek Dr" }, "geometry": { "type": "Point", "coordinates": [ -84.442219, 37.999437 ] } }
]
}
;
// Add marker color, symbol, and size to hospital GeoJSON
for(var i = 0; i < hospitals.features.length; i++) {
hospitals.features[i].properties['marker-color'] = '#DC143C';
hospitals.features[i].properties['marker-symbol'] = 'hospital';
hospitals.features[i].properties['marker-size'] = 'small';
};
// Add marker color, symbol, and size to library GeoJSON
for (var i = 0; i < libraries.features.length; i++) {
libraries.features[i].properties['marker-color'] = '#4169E1';
libraries.features[i].properties['marker-symbol'] = 'library';
libraries.features[i].properties['marker-size'] = 'small';
};
var map = L.mapbox.map('map')
.setView([38.05, -84.5], 12);
L.tileLayer.provider('Stamen.Watercolor').addTo(map);
var hospitalLayer = L.mapbox.featureLayer(hospitals)
.addTo(map);
var libraryLayer = L.mapbox.featureLayer(libraries)
.addTo(map);
// Bind a popup to each feature in hospitalLayer and libraryLayer
hospitalLayer.eachLayer(function (layer) {
layer.bindPopup('<strong>' + layer.feature.properties.Name + '</strong>', { closeButton: false });
}).addTo(map);
libraryLayer.eachLayer(function (layer) {
layer.bindPopup(layer.feature.properties.Name, { closeButton: false });
}).addTo(map);
// Open popups on hover
libraryLayer.on('mouseover', function (e) {
e.layer.openPopup();
});
hospitalLayer.on('mouseover', function (e) {
e.layer.openPopup();
});
// reset marker size to small
function reset() {
var hospitalFeatures = hospitalLayer.getGeoJSON();
for (var i = 0; i < hospitalFeatures.features.length; i++) {
hospitalFeatures.features[i].properties['marker-size'] = 'small';
};
hospitalLayer.setGeoJSON(hospitalFeatures);
};
libraryLayer.on('click', function (e) {
// Reset any and all marker sizes to small
reset();
// Get the GeoJSON from libraryFeatures and hospitalFeatures
var libraryFeatures = libraryLayer.getGeoJSON();
var hospitalFeatures = hospitalLayer.getGeoJSON();
// Using Turf, find the nearest hospital to library clicked
var nearestHospital = turf.nearest(e.layer.feature, hospitalFeatures);
// Change the nearest hospital to a large marker
nearestHospital.properties['marker-size'] = 'large';
// Add the new GeoJSON to hospitalLayer
hospitalLayer.setGeoJSON(hospitalFeatures);
});
map.on('click', function (e) {
reset();
});
// When map loads, zoom to libraryLayer features
map.fitBounds(libraryLayer.getBounds());
</script>
</body>
</html>
(function () {
'use strict';
L.TileLayer.Provider = L.TileLayer.extend({
initialize: function (arg, options) {
var providers = L.TileLayer.Provider.providers;
var parts = arg.split('.');
var providerName = parts[0];
var variantName = parts[1];
if (!providers[providerName]) {
throw 'No such provider (' + providerName + ')';
}
var provider = {
url: providers[providerName].url,
options: providers[providerName].options
};
// overwrite values in provider from variant.
if (variantName && 'variants' in providers[providerName]) {
if (!(variantName in providers[providerName].variants)) {
throw 'No such variant of ' + providerName + ' (' + variantName + ')';
}
var variant = providers[providerName].variants[variantName];
var variantOptions;
if (typeof variant === 'string') {
variantOptions = {
variant: variant
};
} else {
variantOptions = variant.options;
}
provider = {
url: variant.url || provider.url,
options: L.Util.extend({}, provider.options, variantOptions)
};
} else if (typeof provider.url === 'function') {
provider.url = provider.url(parts.splice(1, parts.length - 1).join('.'));
}
var forceHTTP = window.location.protocol === 'file:' || provider.options.forceHTTP;
if (provider.url.indexOf('//') === 0 && forceHTTP) {
provider.url = 'http:' + provider.url;
}
// replace attribution placeholders with their values from toplevel provider attribution,
// recursively
var attributionReplacer = function (attr) {
if (attr.indexOf('{attribution.') === -1) {
return attr;
}
return attr.replace(/\{attribution.(\w*)\}/,
function (match, attributionName) {
return attributionReplacer(providers[attributionName].options.attribution);
}
);
};
provider.options.attribution = attributionReplacer(provider.options.attribution);
// Compute final options combining provider options with any user overrides
var layerOpts = L.Util.extend({}, provider.options, options);
L.TileLayer.prototype.initialize.call(this, provider.url, layerOpts);
}
});
/**
* Definition of providers.
* see http://leafletjs.com/reference.html#tilelayer for options in the options map.
*/
L.TileLayer.Provider.providers = {
OpenStreetMap: {
url: '//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
options: {
attribution:
'&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
},
variants: {
Mapnik: {},
BlackAndWhite: {
url: 'http://{s}.tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png'
},
DE: {
url: 'http://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png'
},
HOT: {
url: 'http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',
options: {
attribution: '{attribution.OpenStreetMap}, Tiles courtesy of <a href="http://hot.openstreetmap.org/" target="_blank">Humanitarian OpenStreetMap Team</a>'
}
}
}
},
OpenSeaMap: {
url: 'http://tiles.openseamap.org/seamark/{z}/{x}/{y}.png',
options: {
attribution: 'Map data: &copy; <a href="http://www.openseamap.org">OpenSeaMap</a> contributors'
}
},
OpenTopoMap: {
url: '//{s}.tile.opentopomap.org/{z}/{x}/{y}.png',
options: {
maxZoom: 16,
attribution: 'Map data: {attribution.OpenStreetMap}, <a href="http://viewfinderpanoramas.org">SRTM</a> | Map style: &copy; <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)'
}
},
Thunderforest: {
url: '//{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png',
options: {
attribution:
'&copy; <a href="http://www.opencyclemap.org">OpenCycleMap</a>, {attribution.OpenStreetMap}',
variant: 'cycle'
},
variants: {
OpenCycleMap: 'cycle',
Transport: 'transport',
TransportDark: 'transport-dark',
Landscape: 'landscape',
Outdoors: 'outdoors'
}
},
OpenMapSurfer: {
url: 'http://openmapsurfer.uni-hd.de/tiles/{variant}/x={x}&y={y}&z={z}',
options: {
minZoom: 0,
maxZoom: 20,
variant: 'roads',
attribution: 'Imagery from <a href="http://giscience.uni-hd.de/">GIScience Research Group @ University of Heidelberg</a> &mdash; Map data {attribution.OpenStreetMap}'
},
variants: {
Roads: 'roads',
AdminBounds: {
options: {
variant: 'adminb',
maxZoom: 19
}
},
Grayscale: {
options: {
variant: 'roadsg',
maxZoom: 19
}
}
}
},
Hydda: {
url: 'http://{s}.tile.openstreetmap.se/hydda/{variant}/{z}/{x}/{y}.png',
options: {
minZoom: 0,
maxZoom: 18,
variant: 'full',
attribution: 'Tiles courtesy of <a href="http://openstreetmap.se/" target="_blank">OpenStreetMap Sweden</a> &mdash; Map data {attribution.OpenStreetMap}'
},
variants: {
Full: 'full',
Base: 'base',
RoadsAndLabels: 'roads_and_labels'
}
},
MapQuestOpen: {
/* Mapquest does support https, but with a different subdomain:
* https://otile{s}-s.mqcdn.com/tiles/1.0.0/{type}/{z}/{x}/{y}.{ext}
* which makes implementing protocol relativity impossible.
*/
url: 'http://otile{s}.mqcdn.com/tiles/1.0.0/{type}/{z}/{x}/{y}.{ext}',
options: {
type: 'map',
ext: 'jpg',
attribution:
'Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> &mdash; ' +
'Map data {attribution.OpenStreetMap}',
subdomains: '1234'
},
variants: {
OSM: {},
Aerial: {
options: {
type: 'sat',
attribution:
'Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> &mdash; ' +
'Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency'
}
},
HybridOverlay: {
options: {
type: 'hyb',
ext: 'png',
opacity: 0.9
}
}
}
},
MapBox: {
url: function (id) {
return '//{s}.tiles.mapbox.com/v3/' + id + '/{z}/{x}/{y}.png';
},
options: {
attribution:
'Imagery from <a href="http://mapbox.com/about/maps/">MapBox</a> &mdash; ' +
'Map data {attribution.OpenStreetMap}',
subdomains: 'abcd'
}
},
Stamen: {
url: 'http://{s}.tile.stamen.com/{variant}/{z}/{x}/{y}.{ext}',
options: {
attribution:
'Map tiles by <a href="http://stamen.com">Stamen Design</a>, ' +
'<a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> &mdash; ' +
'Map data {attribution.OpenStreetMap}',
subdomains: 'abcd',
minZoom: 0,
maxZoom: 20,
variant: 'toner',
ext: 'png'
},
variants: {
Toner: 'toner',
TonerBackground: 'toner-background',
TonerHybrid: 'toner-hybrid',
TonerLines: 'toner-lines',
TonerLabels: 'toner-labels',
TonerLite: 'toner-lite',
Watercolor: {
options: {
variant: 'watercolor',
minZoom: 1,
maxZoom: 16
}
},
Terrain: {
options: {
variant: 'terrain',
minZoom: 4,
maxZoom: 18,
bounds: [[22, -132], [70, -56]]
}
},
TerrainBackground: {
options: {
variant: 'terrain-background',
minZoom: 4,
maxZoom: 18,
bounds: [[22, -132], [70, -56]]
}
},
TopOSMRelief: {
options: {
variant: 'toposm-color-relief',
ext: 'jpg',
bounds: [[22, -132], [51, -56]]
}
},
TopOSMFeatures: {
options: {
variant: 'toposm-features',
bounds: [[22, -132], [51, -56]],
opacity: 0.9
}
}
}
},
Esri: {
url: '//server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}',
options: {
variant: 'World_Street_Map',
attribution: 'Tiles &copy; Esri'
},
variants: {
WorldStreetMap: {
options: {
attribution:
'{attribution.Esri} &mdash; ' +
'Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012'
}
},
DeLorme: {
options: {
variant: 'Specialty/DeLorme_World_Base_Map',
minZoom: 1,
maxZoom: 11,
attribution: '{attribution.Esri} &mdash; Copyright: &copy;2012 DeLorme'
}
},
WorldTopoMap: {
options: {
variant: 'World_Topo_Map',
attribution:
'{attribution.Esri} &mdash; ' +
'Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community'
}
},
WorldImagery: {
options: {
variant: 'World_Imagery',
attribution:
'{attribution.Esri} &mdash; ' +
'Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'
}
},
WorldTerrain: {
options: {
variant: 'World_Terrain_Base',
maxZoom: 13,
attribution:
'{attribution.Esri} &mdash; ' +
'Source: USGS, Esri, TANA, DeLorme, and NPS'
}
},
WorldShadedRelief: {
options: {
variant: 'World_Shaded_Relief',
maxZoom: 13,
attribution: '{attribution.Esri} &mdash; Source: Esri'
}
},
WorldPhysical: {
options: {
variant: 'World_Physical_Map',
maxZoom: 8,
attribution: '{attribution.Esri} &mdash; Source: US National Park Service'
}
},
OceanBasemap: {
options: {
variant: 'Ocean_Basemap',
maxZoom: 13,
attribution: '{attribution.Esri} &mdash; Sources: GEBCO, NOAA, CHS, OSU, UNH, CSUMB, National Geographic, DeLorme, NAVTEQ, and Esri'
}
},
NatGeoWorldMap: {
options: {
variant: 'NatGeo_World_Map',
maxZoom: 16,
attribution: '{attribution.Esri} &mdash; National Geographic, Esri, DeLorme, NAVTEQ, UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, iPC'
}
},
WorldGrayCanvas: {
options: {
variant: 'Canvas/World_Light_Gray_Base',
maxZoom: 16,
attribution: '{attribution.Esri} &mdash; Esri, DeLorme, NAVTEQ'
}
}
}
},
OpenWeatherMap: {
url: 'http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png',
options: {
attribution: 'Map data &copy; <a href="http://openweathermap.org">OpenWeatherMap</a>',
opacity: 0.5
},
variants: {
Clouds: 'clouds',
CloudsClassic: 'clouds_cls',
Precipitation: 'precipitation',
PrecipitationClassic: 'precipitation_cls',
Rain: 'rain',
RainClassic: 'rain_cls',
Pressure: 'pressure',
PressureContour: 'pressure_cntr',
Wind: 'wind',
Temperature: 'temp',
Snow: 'snow'
}
},
HERE: {
/*
* HERE maps, formerly Nokia maps.
* These basemaps are free, but you need an API key. Please sign up at
* http://developer.here.com/getting-started
*
* Note that the base urls contain '.cit' whichs is HERE's
* 'Customer Integration Testing' environment. Please remove for production
* envirionments.
*/
url:
'//{s}.{base}.maps.cit.api.here.com/maptile/2.1/' +
'maptile/{mapID}/{variant}/{z}/{x}/{y}/256/png8?' +
'app_id={app_id}&app_code={app_code}',
options: {
attribution:
'Map &copy; 1987-2014 <a href="http://developer.here.com">HERE</a>',
subdomains: '1234',
mapID: 'newest',
'app_id': '<insert your app_id here>',
'app_code': '<insert your app_code here>',
base: 'base',
variant: 'normal.day',
minZoom: 0,
maxZoom: 20
},
variants: {
normalDay: 'normal.day',
normalDayCustom: 'normal.day.custom',
normalDayGrey: 'normal.day.grey',
normalDayMobile: 'normal.day.mobile',
normalDayGreyMobile: 'normal.day.grey.mobile',
normalDayTransit: 'normal.day.transit',
normalDayTransitMobile: 'normal.day.transit.mobile',
normalNight: 'normal.night',
normalNightMobile: 'normal.night.mobile',
normalNightGrey: 'normal.night.grey',
normalNightGreyMobile: 'normal.night.grey.mobile',
carnavDayGrey: 'carnav.day.grey',
hybridDay: {
options: {
base: 'aerial',
variant: 'hybrid.day'
}
},
hybridDayMobile: {
options: {
base: 'aerial',
variant: 'hybrid.day.mobile'
}
},
pedestrianDay: 'pedestrian.day',
pedestrianNight: 'pedestrian.night',
satelliteDay: {
options: {
base: 'aerial',
variant: 'satellite.day'
}
},
terrainDay: {
options: {
base: 'aerial',
variant: 'terrain.day'
}
},
terrainDayMobile: {
options: {
base: 'aerial',
variant: 'terrain.day.mobile'
}
}
}
},
Acetate: {
url: 'http://a{s}.acetate.geoiq.com/tiles/{variant}/{z}/{x}/{y}.png',
options: {
attribution:
'&copy;2012 Esri & Stamen, Data from OSM and Natural Earth',
subdomains: '0123',
minZoom: 2,
maxZoom: 18,
variant: 'acetate-base'
},
variants: {
basemap: 'acetate-base',
terrain: 'terrain',
all: 'acetate-hillshading',
foreground: 'acetate-fg',
roads: 'acetate-roads',
labels: 'acetate-labels',
hillshading: 'hillshading'
}
},
FreeMapSK: {
url: 'http://{s}.freemap.sk/T/{z}/{x}/{y}.jpeg',
options: {
minZoom: 8,
maxZoom: 16,
subdomains: ['t1', 't2', 't3', 't4'],
attribution:
'{attribution.OpenStreetMap}, vizualization CC-By-SA 2.0 <a href="http://freemap.sk">Freemap.sk</a>'
}
},
MtbMap: {
url: 'http://tile.mtbmap.cz/mtbmap_tiles/{z}/{x}/{y}.png',
options: {
attribution:
'{attribution.OpenStreetMap} &amp; USGS'
}
},
CartoDB: {
url: 'http://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}.png',
options: {
attribution: '{attribution.OpenStreetMap} &copy; <a href="http://cartodb.com/attributions">CartoDB</a>',
subdomains: 'abcd',
minZoom: 0,
maxZoom: 18,
variant: 'light_all'
},
variants: {
Positron: 'light_all',
PositronNoLabels: 'light_nolabels',
DarkMatter: 'dark_all',
DarkMatterNoLabels: 'dark_nolabels'
}
},
HikeBike: {
url: 'http://{s}.tiles.wmflabs.org/hikebike/{z}/{x}/{y}.png',
options: {
attribution: '{attribution.OpenStreetMap}'
}
},
BasemapAT: {
url: '//maps{s}.wien.gv.at/basemap/{variant}/normal/google3857/{z}/{y}/{x}.{format}',
options: {
attribution: 'Datenquelle: <a href="www.basemap.at">basemap.at</a>',
subdomains: ['', '1', '2', '3', '4'],
bounds: [[46.358770, 8.782379], [49.037872, 17.189532]]
},
variants: {
basemap: {
options: {
variant: 'geolandbasemap',
format: 'jpeg'
}
},
highdpi: {
options: {
variant: 'bmaphidpi',
format: 'jpeg'
}
},
grau: {
options: {
variant: 'bmapgrau',
format: 'png'
}
},
overlay: {
options: {
variant: 'bmapoverlay',
format: 'png'
}
},
orthofoto: {
options: {
variant: 'bmaporthofoto30cm',
format: 'jpeg'
}
}
}
},
NASAGIBS: {
url: '//map1.vis.earthdata.nasa.gov/wmts-webmerc/{variant}/default/{time}/{tilematrixset}{maxZoom}/{z}/{y}/{x}.{format}',
options: {
attribution:
'Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System ' +
'(<a href="https://earthdata.nasa.gov">ESDIS</a>) with funding provided by NASA/HQ.',
bounds: [[-85.0511287776, -179.999999975], [85.0511287776, 179.999999975]],
minZoom: 1,
maxZoom: 9,
format: 'jpg',
time: '',
tilematrixset: 'GoogleMapsCompatible_Level'
},
variants: {
ModisTerraTrueColorCR: 'MODIS_Terra_CorrectedReflectance_TrueColor',
ModisTerraBands367CR: 'MODIS_Terra_CorrectedReflectance_Bands367',
ViirsEarthAtNight2012: {
options: {
variant: 'VIIRS_CityLights_2012',
maxZoom: 8
}
},
ModisTerraLSTDay: {
options: {
variant: 'MODIS_Terra_Land_Surface_Temp_Day',
format: 'png',
maxZoom: 7,
opacity: 0.75
}
},
ModisTerraSnowCover: {
options: {
variant: 'MODIS_Terra_Snow_Cover',
format: 'png',
maxZoom: 8,
opacity: 0.75
}
},
ModisTerraAOD: {
options: {
variant: 'MODIS_Terra_Aerosol',
format: 'png',
maxZoom: 6,
opacity: 0.75
}
},
ModisTerraChlorophyll: {
options: {
variant: 'MODIS_Terra_Chlorophyll_A',
format: 'png',
maxZoom: 7,
opacity: 0.75
}
}
}
}
};
L.tileLayer.provider = function (provider, options) {
return new L.TileLayer.Provider(provider, options);
};
}());
.leaflet-container{background:#fff;font:12px/20px 'Helvetica Neue',Arial,Helvetica,sans-serif;color:#404040;color:rgba(0,0,0,.75);outline:0;overflow:hidden;-ms-touch-action:none}.leaflet-container *,.leaflet-container :after,.leaflet-container :before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.leaflet-container h1,.leaflet-container h2,.leaflet-container h3,.leaflet-container h4,.leaflet-container h5,.leaflet-container h6,.leaflet-container p{font-size:15px;line-height:20px;margin:0 0 10px}.leaflet-container .marker-description img{margin-bottom:10px}.leaflet-container a{color:#3887BE;font-weight:400;text-decoration:none}.leaflet-container a:hover,.leaflet-container.dark a{color:#63b6e5}.leaflet-container.dark a:hover{color:#8fcaec}.leaflet-container .mapbox-button,.leaflet-container.dark .mapbox-button{background-color:#3887be;display:inline-block;height:40px;line-height:40px;text-decoration:none;color:#fff;font-size:12px;white-space:nowrap;text-overflow:ellipsis}.leaflet-container .mapbox-button:hover,.leaflet-container.dark .mapbox-button:hover{color:#fff;background-color:#3bb2d0}.leaflet-image-layer,.leaflet-layer,.leaflet-map-pane,.leaflet-marker-icon,.leaflet-marker-pane,.leaflet-marker-shadow,.leaflet-overlay-pane,.leaflet-overlay-pane svg,.leaflet-popup-pane,.leaflet-shadow-pane,.leaflet-tile,.leaflet-tile-container,.leaflet-tile-pane,.leaflet-zoom-box{position:absolute;left:0;top:0}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile{-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0}.leaflet-tile-pane{z-index:2}.leaflet-objects-pane{z-index:3}.leaflet-overlay-pane{z-index:4}.leaflet-shadow-pane{z-index:5}.leaflet-marker-pane{z-index:6}.leaflet-popup-pane{z-index:7}.leaflet-control{position:relative;z-index:7;pointer-events:auto;float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-bottom,.leaflet-top{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-fade-anim .leaflet-popup,.leaflet-fade-anim .leaflet-tile{opacity:0;-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;-o-transition:opacity .2s linear;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup,.leaflet-fade-anim .leaflet-tile-loaded{opacity:1}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);-o-transition:-o-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-pan-anim .leaflet-tile,.leaflet-touching .leaflet-zoom-animated,.leaflet-zoom-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-container{cursor:-webkit-grab;cursor:-moz-grab}.leaflet-container.leaflet-clickable,.leaflet-container.map-clickable,.leaflet-marker-icon,.leaflet-overlay-pane path{cursor:pointer}.leaflet-control,.leaflet-popup-pane{cursor:auto}.leaflet-dragging,.leaflet-dragging .leaflet-clickable,.leaflet-dragging .leaflet-container,.leaflet-dragging .map-clickable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing}.leaflet-zoom-box{background:#fff;border:2px dotted #202020;opacity:.5}.leaflet-bar,.leaflet-control-layers{background-color:#fff;border:1px solid #999;border-color:rgba(0,0,0,.4);border-radius:3px;box-shadow:none}.leaflet-bar a,.leaflet-bar a:hover{color:#404040;color:rgba(0,0,0,.75);border-bottom:1px solid #ddd;border-bottom-color:rgba(0,0,0,.1)}.leaflet-bar a:active,.leaflet-bar a:hover{background-color:#f8f8f8;cursor:pointer}.leaflet-bar a:hover:first-child{border-radius:3px 3px 0 0}.leaflet-bar a:hover:last-child{border-bottom:0;border-radius:0 0 3px 3px}.leaflet-bar a:hover:only-of-type{border-radius:3px}.leaflet-bar .leaflet-disabled{cursor:default;opacity:.75}.leaflet-control-zoom-in,.leaflet-control-zoom-out{display:block;content:'';text-indent:-999em}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{background:#fff;padding:6px 10px 6px 6px;color:#404040;color:rgba(0,0,0,.75)}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;border-top-color:rgba(0,0,0,.1);margin:5px -10px 5px -6px}.leaflet-container .leaflet-control-attribution{background-color:rgba(255,255,255,.5);margin:0;box-shadow:none}.leaflet-container .leaflet-control-attribution a,.leaflet-container .map-info-container a{color:#404040}.leaflet-control-attribution a:hover,.map-info-container a:hover{color:inherit;text-decoration:underline}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-container .leaflet-control-attribution.leaflet-compact-attribution{margin:10px;background:#fff;border-radius:3px 13px 13px 3px;padding:3px 31px 3px 3px;visibility:hidden}.leaflet-control-attribution.leaflet-compact-attribution:hover{visibility:visible}.leaflet-control-attribution.leaflet-compact-attribution:after{content:'';background-color:#fff;background-color:rgba(255,255,255,.5);background-position:0 -78px;border-radius:50%;position:absolute;display:inline-block;width:26px;height:26px;vertical-align:middle;bottom:0;z-index:1;visibility:visible;cursor:pointer}.leaflet-control-attribution.leaflet-compact-attribution:hover:after{background-color:#fff}.leaflet-right .leaflet-control-attribution.leaflet-compact-attribution:after{right:0}.leaflet-left .leaflet-control-attribution.leaflet-compact-attribution:after{left:0}.leaflet-control-scale-line{background-color:rgba(255,255,255,.5);border:1px solid #999;border-color:rgba(0,0,0,.4);border-top:0;padding:2px 5px 1px;white-space:nowrap;overflow:hidden}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #ddd;border-top-color:rgba(0,0,0,.1);border-bottom:0;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-popup{position:absolute;text-align:center;pointer-events:none}.leaflet-popup-content-wrapper{padding:1px;text-align:left;pointer-events:all}.leaflet-popup-content{padding:10px 10px 15px;margin:0;line-height:inherit}.leaflet-popup-close-button+.leaflet-popup-content-wrapper .leaflet-popup-content{padding-top:15px}.leaflet-popup-tip-container{width:20px;height:20px;margin:0 auto;position:relative}.leaflet-popup-tip{width:0;height:0;margin:0;border-left:10px solid transparent;border-right:10px solid transparent;border-top:10px solid #fff;box-shadow:none}.leaflet-popup-close-button{text-indent:-999em;position:absolute;top:0;right:0;pointer-events:all}.leaflet-popup-close-button:hover{background-color:#f8f8f8}.leaflet-popup-scrolled{overflow:auto;border-bottom:1px solid #ddd;border-top:1px solid #ddd}.leaflet-div-icon{background:#fff;border:1px solid #999;border-color:rgba(0,0,0,.4)}.leaflet-editing-icon{border-radius:3px}.leaflet-bar a,.leaflet-control-layers-toggle,.leaflet-popup-close-button,.map-tooltip.closable .close,.mapbox-button-icon:before,.mapbox-icon{content:'';display:inline-block;width:26px;height:26px;vertical-align:middle;background-repeat:no-repeat}.leaflet-bar a{display:block}.leaflet-container.dark .map-tooltip .close,.leaflet-control-attribution:after,.leaflet-control-layers-toggle,.leaflet-control-zoom-in,.leaflet-control-zoom-out,.leaflet-popup-close-button,.map-tooltip .close,.mapbox-icon{opacity:.75;background-image:url(images/icons-000000@2x.png);background-repeat:no-repeat;background-size:26px 260px}.leaflet-container.dark .leaflet-control-attribution:after,.leaflet-container.dark .leaflet-control-layers-toggle,.leaflet-container.dark .leaflet-control-zoom-in,.leaflet-container.dark .leaflet-control-zoom-out,.leaflet-container.dark .mapbox-icon,.mapbox-button-icon:before{opacity:1;background-image:url(images/icons-ffffff@2x.png);background-size:26px 260px}.leaflet-bar .leaflet-control-zoom-in{background-position:0 0}.leaflet-bar .leaflet-control-zoom-out{background-position:0 -26px}.leaflet-popup-close-button,.map-tooltip.closable .close{background-position:-3px -55px;width:20px;height:20px;border-radius:0 3px 0 0}.mapbox-icon-info{background-position:0 -78px}.leaflet-control-layers-toggle{background-position:0 -104px}.mapbox-icon.mapbox-icon-share,.mapbox-icon.mapbox-icon-share:before{background-position:0 -130px}.mapbox-icon.mapbox-icon-geocoder,.mapbox-icon.mapbox-icon-geocoder:before{background-position:0 -156px}.mapbox-icon-facebook,.mapbox-icon-facebook:before{background-position:0 -182px}.mapbox-icon-twitter,.mapbox-icon-twitter:before{background-position:0 -208px}.mapbox-icon-pinterest,.mapbox-icon-pinterest:before{background-position:0 -234px}.leaflet-popup-content-wrapper,.map-legends,.map-tooltip{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1)}.map-legends,.map-tooltip{max-width:300px}.map-legends .map-legend{padding:10px}.map-tooltip{z-index:999999;padding:10px;min-width:180px;max-height:400px;overflow:auto;opacity:1;-webkit-transition:opacity 150ms;-moz-transition:opacity 150ms;-o-transition:opacity 150ms;transition:opacity 150ms}.map-tooltip .close{text-indent:-999em;overflow:hidden;display:none}.map-tooltip.closable .close{position:absolute;top:0;right:0;border-radius:3px}.map-tooltip.closable .close:active{background-color:#f8f8f8}.leaflet-control-interaction{position:absolute;top:10px;right:10px;width:300px}.leaflet-popup-content .marker-title{font-weight:700}.leaflet-control .mapbox-button{background-color:#fff;border:1px solid #ddd;border-color:rgba(0,0,0,.1);padding:5px 10px;border-radius:3px}.mapbox-modal>div{position:absolute;top:0;left:0;width:100%;height:100%;z-index:-1;overflow-y:auto}.mapbox-modal.active>div{z-index:99999;transition:all .2s,z-index 0 0}.mapbox-modal .mapbox-modal-mask{background:rgba(0,0,0,.5);opacity:0}.mapbox-modal.active .mapbox-modal-mask{opacity:1}.mapbox-modal .mapbox-modal-content{-webkit-transform:translateY(-100%);-moz-transform:translateY(-100%);-ms-transform:translateY(-100%);transform:translateY(-100%)}.mapbox-modal.active .mapbox-modal-content{-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}.mapbox-modal-body{position:relative;background:#fff;padding:20px;z-index:1000;width:50%;margin:20px 0 20px 25%}.mapbox-share-buttons{margin:0 0 20px}.mapbox-share-buttons a{width:33.3333%;border-left:1px solid #fff;text-align:center;border-radius:0}.mapbox-share-buttons a:last-child{border-radius:0 3px 3px 0}.mapbox-share-buttons a:first-child{border:0;border-radius:3px 0 0 3px}.mapbox-modal input{width:100%;height:40px;padding:10px;border:1px solid #ddd;border-color:rgba(0,0,0,.1);color:rgba(0,0,0,.5)}.leaflet-control.mapbox-control-info{margin:5px 30px 10px 10px;min-height:26px}.leaflet-right .leaflet-control.mapbox-control-info{margin:5px 10px 10px 30px}.mapbox-info-toggle{background-color:#fff;background-color:rgba(255,255,255,.5);border-radius:50%;position:absolute;bottom:0;left:0;z-index:1}.leaflet-right .mapbox-control-info .mapbox-info-toggle{left:auto;right:0}.mapbox-info-toggle:hover{background-color:#fff}.map-info-container{background:#fff;padding:3px 5px 3px 27px;display:none;position:relative;bottom:0;left:0;border-radius:13px 3px 3px 13px}.leaflet-right .map-info-container{left:auto;right:0;padding:3px 27px 3px 5px;border-radius:3px 13px 13px 3px}.mapbox-control-info.active .map-info-container{display:inline-block}.leaflet-container .mapbox-improve-map{font-weight:700}.leaflet-control-mapbox-geocoder{position:relative}.leaflet-control-mapbox-geocoder.searching{opacity:.75}.leaflet-control-mapbox-geocoder .leaflet-control-mapbox-geocoder-wrap{background:#fff;position:absolute;border:1px solid #999;border-color:rgba(0,0,0,.4);overflow:hidden;left:26px;height:28px;width:0;top:-1px;border-radius:0 3px 3px 0;opacity:0;-webkit-transition:opacity 100ms;-moz-transition:opacity 100ms;-o-transition:opacity 100ms;transition:opacity 100ms}.leaflet-control-mapbox-geocoder.active .leaflet-control-mapbox-geocoder-wrap{width:180px;opacity:1}.leaflet-bar .leaflet-control-mapbox-geocoder-toggle,.leaflet-bar .leaflet-control-mapbox-geocoder-toggle:hover{border-bottom:0}.leaflet-control-mapbox-geocoder-toggle{border-radius:3px}.leaflet-control-mapbox-geocoder.active,.leaflet-control-mapbox-geocoder.active .leaflet-control-mapbox-geocoder-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.leaflet-control-mapbox-geocoder .leaflet-control-mapbox-geocoder-form input{background:0 0;border:0;width:180px;padding:0 0 0 10px;height:26px;outline:0}.leaflet-control-mapbox-geocoder-results{width:180px;position:absolute;left:26px;top:25px;border-radius:0 0 3px 3px}.leaflet-control-mapbox-geocoder.active .leaflet-control-mapbox-geocoder-results{background:#fff;border:1px solid #999;border-color:rgba(0,0,0,.4)}.leaflet-control-mapbox-geocoder-results a,.leaflet-control-mapbox-geocoder-results span{padding:0 10px;text-overflow:ellipsis;white-space:nowrap;display:block;width:100%;font-size:12px;line-height:26px;text-align:left;overflow:hidden}.leaflet-container.dark .leaflet-control .leaflet-control-mapbox-geocoder-results a:hover,.leaflet-control-mapbox-geocoder-results a:hover{background:#f8f8f8;opacity:1}.leaflet-right .leaflet-control-mapbox-geocoder-results,.leaflet-right .leaflet-control-mapbox-geocoder-wrap{left:auto;right:26px}.leaflet-right .leaflet-control-mapbox-geocoder-wrap{border-radius:3px 0 0 3px}.leaflet-right .leaflet-control-mapbox-geocoder.active,.leaflet-right .leaflet-control-mapbox-geocoder.active .leaflet-control-mapbox-geocoder-toggle{border-radius:0 3px 3px 0}.leaflet-bottom .leaflet-control-mapbox-geocoder-results{top:auto;bottom:25px;border-radius:3px 3px 0 0}.mapbox-logo-true:before{content:'';display:inline-block;width:61px;height:19px;vertical-align:middle}.mapbox-logo-true{background-repeat:no-repeat;background-size:61px 19px;background-image:url('data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOmNjPSJodHRwOi8vY3JlYXRpdmVjb21tb25zLm9yZy9ucyMiIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyIgeG1sbnM6c3ZnPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSI2NSIgaGVpZ2h0PSIyMCI+PGRlZnMvPjxtZXRhZGF0YT48cmRmOlJERj48Y2M6V29yayByZGY6YWJvdXQ9IiI+PGRjOmZvcm1hdD5pbWFnZS9zdmcreG1sPC9kYzpmb3JtYXQ+PGRjOnR5cGUgcmRmOnJlc291cmNlPSJodHRwOi8vcHVybC5vcmcvZGMvZGNtaXR5cGUvU3RpbGxJbWFnZSIvPjxkYzp0aXRsZS8+PC9jYzpXb3JrPjwvcmRmOlJERj48L21ldGFkYXRhPjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yNjEuODQ4MywtOTguNTAzOTUpIj48ZyB0cmFuc2Zvcm09Im1hdHJpeCgwLjE3NDQxODM2LDAsMCwwLjE3NDQxODM2LDIyMC41MjI4MiwyOS4yMjkzNDIpIiBzdHlsZT0ib3BhY2l0eTowLjI1O2ZpbGw6I2ZmZmZmZjtzdHJva2U6IzAwMDAwMDtzdHJva2Utd2lkdGg6MTcuMjAwMDIzNjU7c3Ryb2tlLWxpbmVjYXA6cm91bmQ7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjQ7c3Ryb2tlLW9wYWNpdHk6MTtzdHJva2UtZGFzaGFycmF5Om5vbmUiPjxwYXRoIGQ9Ik0gNS4yOCAxLjUgQyA0LjU0IDEuNTYgMy45IDIuMjUgMy45MSAzIGwgMCAxMS44OCBjIDAuMDIgMC43NyAwLjcyIDEuNDcgMS41IDEuNDcgbCAxLjc1IDAgYyAwLjc4IDAgMS40OCAtMC42OSAxLjUgLTEuNDcgbCAwIC00LjI4IDAuNzIgMS4xOSBjIDAuNTMgMC44NyAyLjAzIDAuODcgMi41NiAwIGwgMC43MiAtMS4xOSAwIDQuMjggYyAwLjAyIDAuNzYgMC43IDEuNDUgMS40NyAxLjQ3IGwgMS43NSAwIGMgMC43OCAwIDEuNDggLTAuNjkgMS41IC0xLjQ3IGwgMCAtMC4xNiBjIDEuMDIgMS4xMiAyLjQ2IDEuODEgNC4wOSAxLjgxIGwgNC4wOSAwIDAgMS40NyBjIC0wIDAuNzggMC42OSAxLjQ4IDEuNDcgMS41IGwgMS43NSAwIGMgMC43OSAtMCAxLjUgLTAuNzEgMS41IC0xLjUgbCAwLjAyIC0xLjQ3IGMgMS43MiAwIDMuMDggLTAuNjQgNC4xNCAtMS42OSBsIDAgMC4xOSBjIDAgMC4zOSAwLjE2IDAuNzkgMC40NCAxLjA2IDAuMjggMC4yOCAwLjY3IDAuNDQgMS4wNiAwLjQ0IGwgMy4zMSAwIGMgMi4wMyAwIDMuODUgLTEuMDYgNC45MSAtMi42OSAxLjA1IDEuNjEgMi44NCAyLjY5IDQuODggMi42OSAxLjAzIDAgMS45OCAtMC4yNyAyLjgxIC0wLjc1IDAuMjggMC4zNSAwLjczIDAuNTcgMS4xOSAwLjU2IGwgMi4xMiAwIGMgMC40OCAwLjAxIDAuOTcgLTAuMjMgMS4yNSAtMC42MiBsIDAuOTEgLTEuMjggMC45MSAxLjI4IGMgMC4yOCAwLjM5IDAuNzQgMC42MyAxLjIyIDAuNjIgbCAyLjE2IDAgQyA2Mi42NyAxNi4zMyA2My40MiAxNC44OSA2Mi44MSAxNCBMIDYwLjIyIDEwLjM4IDYyLjYyIDcgQyA2My4yNiA2LjExIDYyLjUgNC42MiA2MS40MSA0LjYyIGwgLTIuMTYgMCBDIDU4Ljc4IDQuNjIgNTguMzEgNC44NiA1OC4wMyA1LjI1IEwgNTcuMzEgNi4yOCA1Ni41NiA1LjI1IEMgNTYuMjkgNC44NiA1NS44MiA0LjYyIDU1LjM0IDQuNjIgbCAtMi4xNiAwIGMgLTAuNDkgLTAgLTAuOTcgMC4yNSAtMS4yNSAwLjY2IC0wLjg2IC0wLjUxIC0xLjg0IC0wLjgxIC0yLjkxIC0wLjgxIC0yLjAzIDAgLTMuODMgMS4wOCAtNC44OCAyLjY5IEMgNDMuMSA1LjUzIDQxLjI3IDQuNDcgMzkuMTkgNC40NyBMIDM5LjE5IDMgQyAzOS4xOSAyLjYxIDM5LjAzIDIuMjEgMzguNzUgMS45NCAzOC40NyAxLjY2IDM4LjA4IDEuNSAzNy42OSAxLjUgbCAtMS43NSAwIGMgLTAuNzEgMCAtMS41IDAuODMgLTEuNSAxLjUgbCAwIDMuMTYgQyAzMy4zOCA1LjEgMzEuOTYgNC40NyAzMC4zOCA0LjQ3IGwgLTMuMzQgMCBjIC0wLjc3IDAuMDIgLTEuNDcgMC43MiAtMS40NyAxLjUgbCAwIDAuMzEgYyAtMS4wMiAtMS4xMiAtMi40NiAtMS44MSAtNC4wOSAtMS44MSAtMS42MyAwIC0zLjA3IDAuNyAtNC4wOSAxLjgxIEwgMTcuMzggMyBjIC0wIC0wLjc5IC0wLjcxIC0xLjUgLTEuNSAtMS41IEwgMTQuNSAxLjUgQyAxMy41NSAxLjUgMTIuMjggMS44NyAxMS42NiAyLjk0IGwgLTEgMS42OSAtMSAtMS42OSBDIDkuMDMgMS44NyA3Ljc3IDEuNSA2LjgxIDEuNSBsIC0xLjQxIDAgQyA1LjM2IDEuNSA1LjMyIDEuNSA1LjI4IDEuNSB6IG0gMTYuMTkgNy43MiBjIDAuNTMgMCAwLjk0IDAuMzUgMC45NCAxLjI4IGwgMCAxLjI4IC0wLjk0IDAgYyAtMC41MiAwIC0wLjk0IC0wLjM4IC0wLjk0IC0xLjI4IC0wIC0wLjkgMC40MiAtMS4yOCAwLjk0IC0xLjI4IHogbSA4LjgxIDAgYyAwLjgzIDAgMS4xOCAwLjY4IDEuMTkgMS4yOCAwLjAxIDAuOTQgLTAuNjIgMS4yOCAtMS4xOSAxLjI4IHogbSA4LjcyIDAgYyAwLjcyIDAgMS4zNyAwLjYgMS4zNyAxLjI4IDAgMC43NyAtMC41MSAxLjI4IC0xLjM3IDEuMjggeiBtIDEwLjAzIDAgYyAwLjU4IDAgMS4wOSAwLjUgMS4wOSAxLjI4IDAgMC43OCAtMC41MSAxLjI4IC0xLjA5IDEuMjggLTAuNTggMCAtMS4xMiAtMC41IC0xLjEyIC0xLjI4IDAgLTAuNzggMC41NCAtMS4yOCAxLjEyIC0xLjI4IHoiIHRyYW5zZm9ybT0ibWF0cml4KDUuNzMzMzQxNCwwLDAsNS43MzMzNDE0LDIzNi45MzMwOCwzOTcuMTc0OTgpIiBzdHlsZT0iZm9udC1zaXplOm1lZGl1bTtmb250LXN0eWxlOm5vcm1hbDtmb250LXZhcmlhbnQ6bm9ybWFsO2ZvbnQtd2VpZ2h0Om5vcm1hbDtmb250LXN0cmV0Y2g6bm9ybWFsO3RleHQtaW5kZW50OjA7dGV4dC1hbGlnbjpzdGFydDt0ZXh0LWRlY29yYXRpb246bm9uZTtsaW5lLWhlaWdodDpub3JtYWw7bGV0dGVyLXNwYWNpbmc6bm9ybWFsO3dvcmQtc3BhY2luZzpub3JtYWw7dGV4dC10cmFuc2Zvcm06bm9uZTtkaXJlY3Rpb246bHRyO2Jsb2NrLXByb2dyZXNzaW9uOnRiO3dyaXRpbmctbW9kZTpsci10Yjt0ZXh0LWFuY2hvcjpzdGFydDtiYXNlbGluZS1zaGlmdDpiYXNlbGluZTtjb2xvcjojMDAwMDAwO2ZpbGw6IzAwMDAwMDtmaWxsLW9wYWNpdHk6MTtmaWxsLXJ1bGU6bm9uemVybztzdHJva2U6bm9uZTtzdHJva2Utd2lkdGg6MTcuMjAwMDIzNjU7bWFya2VyOm5vbmU7dmlzaWJpbGl0eTp2aXNpYmxlO2Rpc3BsYXk6aW5saW5lO292ZXJmbG93OnZpc2libGU7ZW5hYmxlLWJhY2tncm91bmQ6YWNjdW11bGF0ZTtmb250LWZhbWlseTpTYW5zOy1pbmtzY2FwZS1mb250LXNwZWNpZmljYXRpb246U2FucyIvPjwvZz48ZyB0cmFuc2Zvcm09Im1hdHJpeCgwLjE3NDQxODM2LDAsMCwwLjE3NDQxODM2LDIyMC41MjI4MiwyOS4yMjkzNDIpIiBzdHlsZT0iZmlsbDojZmZmZmZmIj48cGF0aCBkPSJtIDUuNDEgMyAwIDEyIDEuNzUgMCAwIC05LjkxIDMuNSA1Ljk0IDMuNDcgLTUuOTQgMCA5LjkxIDEuNzUgMCAwIC0xMiBMIDE0LjUgMyBDIDEzLjggMyAxMy4yNSAzLjE2IDEyLjk0IDMuNjkgTCAxMC42NiA3LjU5IDguMzggMy42OSBDIDguMDcgMy4xNiA3LjUxIDMgNi44MSAzIHogTSAzNiAzIGwgMCAxMi4wMyAzLjI1IDAgYyAyLjQ0IDAgNC4zOCAtMS45MSA0LjM4IC00LjUzIDAgLTIuNjIgLTEuOTMgLTQuNDcgLTQuMzggLTQuNDcgQyAzOC43IDYuMDMgMzguMzIgNiAzNy43NSA2IGwgMCAtMyB6IE0gMjEuNDcgNS45NyBjIC0yLjQ0IDAgLTQuMTkgMS45MSAtNC4xOSA0LjUzIDAgMi42MiAxLjc1IDQuNTMgNC4xOSA0LjUzIGwgNC4xOSAwIDAgLTQuNTMgYyAwIC0yLjYyIC0xLjc1IC00LjUzIC00LjE5IC00LjUzIHogbSAyNy41NiAwIGMgLTIuNDEgMCAtNC4zOCAyLjAzIC00LjM4IDQuNTMgMCAyLjUgMS45NyA0LjUzIDQuMzggNC41MyAyLjQxIDAgNC4zNCAtMi4wMyA0LjM0IC00LjUzIDAgLTIuNSAtMS45NCAtNC41MyAtNC4zNCAtNC41MyB6IG0gLTIyIDAuMDMgMCAxMiAxLjc1IDAgMCAtMi45NyBjIDAuNTcgMCAxLjA0IC0wIDEuNTkgMCAyLjQ0IDAgNC4zNCAtMS45MSA0LjM0IC00LjUzIDAgLTIuNjIgLTEuOSAtNC41IC00LjM0IC00LjUgeiBtIDI2LjE2IDAgMy4wMyA0LjM4IC0zLjE5IDQuNjIgMi4xMiAwIEwgNTcuMzEgMTEuOTEgNTkuNDQgMTUgNjEuNTkgMTUgNTguMzggMTAuMzggNjEuNDEgNiA1OS4yNSA2IDU3LjMxIDguODEgNTUuMzQgNiB6IE0gMjEuNDcgNy43MiBjIDEuNCAwIDIuNDQgMS4xOSAyLjQ0IDIuNzggbCAwIDIuNzggLTIuNDQgMCBjIC0xLjQgMCAtMi40NCAtMS4yMSAtMi40NCAtMi43OCAtMCAtMS41NyAxLjA0IC0yLjc4IDIuNDQgLTIuNzggeiBtIDI3LjU2IDAgYyAxLjQ0IDAgMi41OSAxLjI0IDIuNTkgMi43OCAwIDEuNTQgLTEuMTUgMi43OCAtMi41OSAyLjc4IC0xLjQ0IDAgLTIuNjIgLTEuMjQgLTIuNjIgLTIuNzggMCAtMS41NCAxLjE4IC0yLjc4IDIuNjIgLTIuNzggeiBtIC0yMC4yNSAwLjAzIDEuNTkgMCBjIDEuNTkgMCAyLjU5IDEuMjggMi41OSAyLjc1IDAgMS40NyAtMS4xMyAyLjc4IC0yLjU5IDIuNzggbCAtMS41OSAwIHogbSA4Ljk3IDAgMS41IDAgYyAxLjQ3IDAgMi42MiAxLjI4IDIuNjIgMi43NSAwIDEuNDcgLTEuMDQgMi43OCAtMi42MiAyLjc4IGwgLTEuNSAwIHoiIHRyYW5zZm9ybT0ibWF0cml4KDUuNzMzMzQxNCwwLDAsNS43MzMzNDE0LDIzNi45MzMwOCwzOTcuMTc0OTgpIiBzdHlsZT0iZmlsbDojZmZmZmZmO2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lIi8+PC9nPjwvZz48L3N2Zz4=')}.leaflet-container.dark .leaflet-bar{background-color:#404040;border-color:#202020;border-color:rgba(0,0,0,.75)}.leaflet-container.dark .leaflet-bar a{color:#404040;border-color:rgba(0,0,0,.5)}.leaflet-container.dark .leaflet-bar a:active,.leaflet-container.dark .leaflet-bar a:hover{background-color:#505050}.leaflet-container.dark .leaflet-control-attribution,.leaflet-container.dark .leaflet-control-attribution:after,.leaflet-container.dark .map-info-container,.leaflet-container.dark .mapbox-info-toggle{background-color:rgba(0,0,0,.5);color:#f8f8f8}.leaflet-container.dark .leaflet-control-attribution a,.leaflet-container.dark .leaflet-control-attribution a:hover,.leaflet-container.dark .map-info-container a,.leaflet-container.dark .map-info-container a:hover{color:#fff}.leaflet-container.dark .leaflet-control-attribution:hover:after{background-color:#000}.leaflet-container.dark .leaflet-control-layers-list span{color:#f8f8f8}.leaflet-container.dark .leaflet-control-layers-separator{border-top-color:rgba(255,255,255,.1)}.leaflet-container.dark .leaflet-bar a.leaflet-disabled,.leaflet-container.dark .leaflet-control .mapbox-button.disabled{background-color:#252525;color:#404040}.leaflet-container.dark .leaflet-control-mapbox-geocoder>div{border-color:#202020;border-color:rgba(0,0,0,.75)}.leaflet-container.dark .leaflet-control .leaflet-control-mapbox-geocoder-results a{border-color:#ddd #202020;border-color:rgba(0,0,0,.1) rgba(0,0,0,.75)}.leaflet-container.dark .leaflet-control .leaflet-control-mapbox-geocoder-results span{border-color:#202020;border-color:rgba(0,0,0,.75)}@media only screen and (max-width:800px){.mapbox-modal-body{width:83.3333%;margin-left:8.3333%}}@media only screen and (max-width:640px){.mapbox-modal-body{width:100%;height:100%;margin:0}}@media print{.mapbox-improve-map{display:none}}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-container img.leaflet-tile{max-width:none!important}.leaflet-container img.leaflet-marker-icon{max-width:none}.leaflet-container img.leaflet-image-layer{max-width:15000px!important}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-oldie .mapbox-modal .mapbox-modal-content{display:none}.leaflet-oldie .mapbox-modal.active .mapbox-modal-content{display:block}.map-tooltip{width:280px\8}.leaflet-oldie .leaflet-container.dark .map-tooltip .close,.leaflet-oldie .leaflet-control-layers-toggle,.leaflet-oldie .leaflet-control-zoom-in,.leaflet-oldie .leaflet-control-zoom-out,.leaflet-oldie .leaflet-popup-close-button,.leaflet-oldie .map-tooltip .close,.leaflet-oldie .mapbox-icon{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAEECAYAAAA24SSRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAXnSURBVHic7ZxfiFVFGMB/33pRUQsKto002DY3McJ6yBYkESQxpYTypaB66KEXYRWLYOlhr9RTRGWRUkk9RyEU+Y9ClECJVTKlPybWBilqkYuWrqBOD/NdPV7PmTPn3NPtat/AcO6ZP9/vfN/Mmfl2Zs6Kc452hK62UAxkIANdEURkVERGC9crOjKIiANwzkmRep1lOjWXa2ijaU7jaGWgKsL110a1EnV+LQMqbLqyobO6t4EMZCADGchABrqmQUlPNSWOVgaqIpi7ZSADGchABjKQga49kIjURaQem14apGE4KVR/D0fXds5FRaAOOL1e+h1dP7ZgE6wQxDnXvs7QWaZLE1wUVmRNdY1zrp6wRF0kfqHYnHwDGchABjJQIETNRyIyFVgBzAPmavIIsAt4xzn3d66QiNl1PnCYy05JczwMzG9pKlfIhQCkES/kwUKQqRma9GpM02xqGXdrBdCXZm2NzaFP66SGUGeYl5E+WqJO0HRHSG+PXtJN54AjVbhbjQcbBSjiakH4hR0p+hChOiHQrhKg7Drt6t7//Qtb9RAU5XtXMaiak28gAxnIQO0Gicg0EXlMRDaIyFGNGzRtWhQpMA/1A6uAL4BzZM9H57TMKqC/8HyUPFhZJLiMI4sh0/UDK4FtwHig3LiWWal1UkPsDDsFWAgsBZZo8hZgM7DdOXcmV0igjQ4Ba4HFwORAuclaZi1wqNU2OgNsVw22aNoS1XAhMCXx4OkubOBJZwKDwFbgLNm97qyWGQRmtuoFWRsV0ujabCPzVA1kIAMZqBNAIjIgImPNRxUzK+SsmtRJn4Pqmj8AjCXzsmTlaTSck/8zcDRX/QiNMp8S6Ab2a5nvG5plyioDaoLs1/sBYKwyUBokkTdQJeiVZgi6UR+UVQI0QWHdoXKFvKDYz7RiynXctk7LPlmeRmsKyAqWNQfSQAYykIGuS5CI1ERkSET2ishpvQ6JSLE93ByfoQbsRHeNgfe4vOO8E6iF6hdxToZU6OqGUIWv1vShqkB7VYNaU3pN0/fGgvLa6C5gk3PufJO5zwObgDuraqM8jbZWpdEnwG3AYKOX6XVQ07+sSqNQr3P4QxS9LXeGBGxIzTiGXwR8QSHRsCj7ZjxAbxFYaVAKbMe/BkrAduRpZJ6qgQxkoP8DKDRY1sk/s5W6YFhoUG3nFnZeOIJfxLgXWB7zBFmmyzPT44my9zXSC098OZCTwCQttzOZVzVoX1a5LHmdtYyWDM29yjknItKF3xSelFWvKo1mhCClQLo1sC95T8T/ebr+xrqOABVZT82tY56qgQxkIAN1CkhEulsGiUi3iCzKyJsjIpuBYyLyo4isFpHXReTuTFLAr1sOnAeeT8nbzNW+3rfAM2UcyAcSQj4FngR68Ot0F1NA24CuMqBu4PMUgYdS0hzwYqlFJ+AeNV3s30aLSoEUtjEScoHE3nkZ0Ay1fR7o3ZCcGNAEYHcO5A/g5pZACpsMPEf6UexTwCN5MvI6w2zgaeBt4HQK5BsC57ubY+jPll/wHzn1Ayc07QD+u6MR4GPn3LlA/SuCOZAGMpCBDFRhiF50EpFl+PP49wOzgIPAHmCLc+6zXAERE18P+b7DRqAnJCfvfF0P/mTgLZr0l97vB27CL3HO0rwTwBzn3PHCGiU0uQisA6bhzT0T/T4ZeAr4s6FZmal8WcI0LwETgdfwHzY1XKz3teyjibLLioLWa8UDeG/oZbxD+QHwdULwg1r+K71fXxQ0ohXfAgS/Mvyh5i1MgNZp2qt6P5ImL/QezdbrSeAG4EbVJJkH8LteJ+p1FikhBPpNr3Odc6fUNHdo2oJEucbX8Y2zDQeLgr7T62IReRb4AX9mGGC6Xo8Bu0VkOvCQpu1JlRZoo6Vc/WL2ad4C4A28CWvAR5TtdU0dwqH/ewHvHi8HbgUexh+euDRCFH6PVOh0/FKzw3um4M8zpA1DxwkMQzFjXR9+d/9N1WI8BZI71kU56Aq8HXgC+Ak/5o3gX+rUNmmO5nsbqP2gfwCyvJzPNoKXiAAAAABJRU5ErkJggg==)}.leaflet-oldie .leaflet-container.dark .leaflet-control-layers-toggle,.leaflet-oldie .leaflet-container.dark .leaflet-control-zoom-in,.leaflet-oldie .leaflet-container.dark .leaflet-control-zoom-out,.leaflet-oldie .leaflet-container.dark .mapbox-icon,.leaflet-oldie .mapbox-button-icon:before{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAEECAYAAAA24SSRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAXYSURBVHic7ZxfiFVFHMc/a4uKWtDDtqJGZprYgwX5ByTdkkLbSgghCiKih14EBYtg6aEr9RRREKRUUs9hGEVtChKaYMkq2VqWmnUX2tKiNDNZY/Xbw/wue7x7zsw559626zY/GM6df7/P+c3MPfO7M3NumyTGQiaMCSWCIiiC6qVqoZC0lXgy1Cq0FanUck1XxVmSNL8WrzYT1LCMvz5qL1FnoAyoTNOVkpYb3hEUQREUQREUQRF0RYOqjHim9aHaTFDDEt2tCIqgCIqgCIqgCLoiQRULedNLgwCeq1NasbR8IilvqMhJpe5zrvpFQElYIYiksRsMLdd0aYoLwYqsqW5i9KjLLdHJj6AIiqAIiiCP5J2PpgLrgGXAYkvrA/YBrwF/BTXkmB2XSzqhbDlhZRqaypdLuuiB1ORiCOaDTM2wZLaFNMumZunzDYZ1wJy01ubyPfOazLE6qeIbDMsy0qsl6ngtWpyRfqOFInVKbWFXS9TxWtRXQl9mHR9oXwlQdp2xGt4t8YVt6iMor+/d8EM1OvkRFEERFEH/AWga8CCwFfjJwlZLm5ZHge/pPQ+4z8IKYGJGub+BT4GPLBwvCio7f6QeWfQ13TxgA7ATGPKUG7IyG6xOOj3nxDcFWAl0A/da2sdAL/AJcD6kwAc6bop6gT1kWzUZ6LKb6CbDqrx9dB535704S8BZ1o2zdEpSZ1HQ3MRddtmdp8kQzuKa9d8VBSUl9lEh0Pjro6ZKy00TERRBERRBLQZaCpxh9FHFUqBKiiJZ+n5gFfBHnrsKgUKb7t/j/PCwBNZwapKW1yGp3/KPSDrjKVsalIT0W3ypwZoGSoPU8pY2E/RCCqSiwJ55GdBVBusIlCu0Xpf3Na1guZbb1mnYJwtZtKmALm/Z6EBGUARFUASNV1A70AMcBP60aw9F93ADPkO7pD3mDwxKesOusvT2QP3czkmPKd2YUNpucVl+LlBo4jsITAduAIbrmnMAOAncnqflQn10M26JebgufdjSb8oDyQM6hlv3ru/4dkv/vFmgd4EZwPoErN3iM4BdeUGNjDpJqsrtmzc86mqwHkkH5X4t7JD0tEFyw3INzYwwuwisEVA9bPe/CarBdocsip5qBEVQBP3fQRWyX4jOCpUsZS2xhR2SQdwixq3A2lDhMkcTa7Ie2G6fwzfsmax8clrSJCu3py4vVV/ZphsALtjnFXkqtNwyWlLqR1Ub7obPA5OyKjXLolk+SFmQgEN18eD/PLXEI2j8gYqspwbrRE81giIogiKohUAdzQB1APdk5C3Ends6CXwLbAReBm7J1OZxINdKGpb0VEpeb4pT+aWkx8os0SxJKHlf0iOSOiXNkHQpBbRT0oQyoA5JH6YoPJ6SJknPeHR5+6gTWJ2SPjej/BceXV7QV8AHvsoJucTlvt5o8ZkraZa1fUheD+gJfo9+Bq4JlPkNt4Xgl9CdSJos6UlJF1IsOSvp/hw6vL8mFgCLgCXA44w+730IeIiM89314gP9ACzHHXD9xdIO49476gO2MfJjLCjRgYygCIqgCGqiFFl0WoM7j78ImA8cBQ7gzuaHp/wck1anpO2BqXy7lSu9I9YJ9APXWfycxfuBa4HbzDpwc9ZC4FQZi2qWXJK0WdI0ue3SuRp5P/lRSb8nLCvsQK5JNM2zkiZKeknSkKVdlPSmlX0gUXZNUdAWq3hY7tzj83K++FuS9icU32Hl91p8S1FQn1V8VVKb3Mrw25a3MgHabGkvWrwvTZ/ve7TArqeBq3H+3f66PIBf7VrzkuaTIj7Qj3ZdDJwF9jLy5wJdiXK1t+NrZxuOFgV9bddVwBPAN8ARS5tp15PAZxa/29IOpGrz9FG3Rsscy+uS9IqkBXLD/Z1GRl1yQEjuHANy7vFaSdMlrZa0K1Gm1PcISTMlDZiSbZa2I8VSSTolz2Mo9PQeBO7CvTE1iDtRc2dKuffwPX4CfVQfrpf0sKRjks5Zs27J6pP6EH3vCBp70D8db2VXFPfIagAAAABJRU5ErkJggg==)}.leaflet-oldie .mapbox-logo-true{background-image:none}
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
function corslite(n,t,o){function e(n){return n>=200&&300>n||304===n}function i(){void 0===r.status||e(r.status)?t.call(r,null,r):t.call(r,r,null)}var l=!1;if("undefined"==typeof window.XMLHttpRequest)return t(Error("Browser not supported"));if("undefined"==typeof o){var u=n.match(/^\s*https?:\/\/[^\/]*/);o=u&&u[0]!==location.protocol+"//"+location.domain+(location.port?":"+location.port:"")}var r=new window.XMLHttpRequest;if(o&&!("withCredentials"in r)){r=new window.XDomainRequest;var a=t;t=function(){if(l)a.apply(this,arguments);else{var n=this,t=arguments;setTimeout(function(){a.apply(n,t)},0)}}}return"onload"in r?r.onload=i:r.onreadystatechange=function(){4===r.readyState&&i()},r.onerror=function(n){t.call(this,n||!0,null),t=function(){}},r.onprogress=function(){},r.ontimeout=function(n){t.call(this,n,null),t=function(){}},r.onabort=function(n){t.call(this,n,null),t=function(){}},r.open("GET",n,!0),r.send(null),l=!0,r}"undefined"!=typeof module&&(module.exports=corslite);
},{}],2:[function(require,module,exports){
!function(t,e,i){var n=t.L,o={};o.version="0.7.2","object"==typeof module&&"object"==typeof module.exports?module.exports=o:"function"==typeof define&&define.amd&&define(o),o.noConflict=function(){return t.L=n,this},t.L=o,o.Util={extend:function(t){var e,i,n,o,s=Array.prototype.slice.call(arguments,1);for(i=0,n=s.length;n>i;i++){o=s[i]||{};for(e in o)o.hasOwnProperty(e)&&(t[e]=o[e])}return t},bind:function(t,e){var i=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return t.apply(e,i||arguments)}},stamp:function(){var t=0,e="_leaflet_id";return function(i){return i[e]=i[e]||++t,i[e]}}(),invokeEach:function(t,e,i){var n,o;if("object"==typeof t){o=Array.prototype.slice.call(arguments,3);for(n in t)e.apply(i,[n,t[n]].concat(o));return!0}return!1},limitExecByInterval:function(t,e,i){var n,o;return function s(){var a=arguments;return n?void(o=!0):(n=!0,setTimeout(function(){n=!1,o&&(s.apply(i,a),o=!1)},e),void t.apply(i,a))}},falseFn:function(){return!1},formatNum:function(t,e){var i=Math.pow(10,e||5);return Math.round(t*i)/i},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},splitWords:function(t){return o.Util.trim(t).split(/\s+/)},setOptions:function(t,e){return t.options=o.extend({},t.options,e),t.options},getParamString:function(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")},template:function(t,e){return t.replace(/\{ *([\w_]+) *\}/g,function(t,n){var o=e[n];if(o===i)throw new Error("No value provided for variable "+t);return"function"==typeof o&&(o=o(e)),o})},isArray:Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function e(e){var i,n,o=["webkit","moz","o","ms"];for(i=0;i<o.length&&!n;i++)n=t[o[i]+e];return n}function i(e){var i=+new Date,o=Math.max(0,16-(i-n));return n=i+o,t.setTimeout(e,o)}var n=0,s=t.requestAnimationFrame||e("RequestAnimationFrame")||i,a=t.cancelAnimationFrame||e("CancelAnimationFrame")||e("CancelRequestAnimationFrame")||function(e){t.clearTimeout(e)};o.Util.requestAnimFrame=function(e,n,a,r){return e=o.bind(e,n),a&&s===i?void e():s.call(t,e,r)},o.Util.cancelAnimFrame=function(e){e&&a.call(t,e)}}(),o.extend=o.Util.extend,o.bind=o.Util.bind,o.stamp=o.Util.stamp,o.setOptions=o.Util.setOptions,o.Class=function(){},o.Class.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this._initHooks&&this.callInitHooks()},i=function(){};i.prototype=this.prototype;var n=new i;n.constructor=e,e.prototype=n;for(var s in this)this.hasOwnProperty(s)&&"prototype"!==s&&(e[s]=this[s]);t.statics&&(o.extend(e,t.statics),delete t.statics),t.includes&&(o.Util.extend.apply(null,[n].concat(t.includes)),delete t.includes),t.options&&n.options&&(t.options=o.extend({},n.options,t.options)),o.extend(n,t),n._initHooks=[];var a=this;return e.__super__=a.prototype,n.callInitHooks=function(){if(!this._initHooksCalled){a.prototype.callInitHooks&&a.prototype.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=n._initHooks.length;e>t;t++)n._initHooks[t].call(this)}},e},o.Class.include=function(t){o.extend(this.prototype,t)},o.Class.mergeOptions=function(t){o.extend(this.prototype.options,t)},o.Class.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i)};var s="_leaflet_events";o.Mixin={},o.Mixin.Events={addEventListener:function(t,e,i){if(o.Util.invokeEach(t,this.addEventListener,this,e,i))return this;var n,a,r,h,l,u,c,d=this[s]=this[s]||{},p=i&&i!==this&&o.stamp(i);for(t=o.Util.splitWords(t),n=0,a=t.length;a>n;n++)r={action:e,context:i||this},h=t[n],p?(l=h+"_idx",u=l+"_len",c=d[l]=d[l]||{},c[p]||(c[p]=[],d[u]=(d[u]||0)+1),c[p].push(r)):(d[h]=d[h]||[],d[h].push(r));return this},hasEventListeners:function(t){var e=this[s];return!!e&&(t in e&&e[t].length>0||t+"_idx"in e&&e[t+"_idx_len"]>0)},removeEventListener:function(t,e,i){if(!this[s])return this;if(!t)return this.clearAllEventListeners();if(o.Util.invokeEach(t,this.removeEventListener,this,e,i))return this;var n,a,r,h,l,u,c,d,p,_=this[s],m=i&&i!==this&&o.stamp(i);for(t=o.Util.splitWords(t),n=0,a=t.length;a>n;n++)if(r=t[n],u=r+"_idx",c=u+"_len",d=_[u],e){if(h=m&&d?d[m]:_[r]){for(l=h.length-1;l>=0;l--)h[l].action!==e||i&&h[l].context!==i||(p=h.splice(l,1),p[0].action=o.Util.falseFn);i&&d&&0===h.length&&(delete d[m],_[c]--)}}else delete _[r],delete _[u],delete _[c];return this},clearAllEventListeners:function(){return delete this[s],this},fireEvent:function(t,e){if(!this.hasEventListeners(t))return this;var i,n,a,r,h,l=o.Util.extend({},e,{type:t,target:this}),u=this[s];if(u[t])for(i=u[t].slice(),n=0,a=i.length;a>n;n++)i[n].action.call(i[n].context,l);r=u[t+"_idx"];for(h in r)if(i=r[h].slice())for(n=0,a=i.length;a>n;n++)i[n].action.call(i[n].context,l);return this},addOneTimeEventListener:function(t,e,i){if(o.Util.invokeEach(t,this.addOneTimeEventListener,this,e,i))return this;var n=o.bind(function(){this.removeEventListener(t,e,i).removeEventListener(t,n,i)},this);return this.addEventListener(t,e,i).addEventListener(t,n,i)}},o.Mixin.Events.on=o.Mixin.Events.addEventListener,o.Mixin.Events.off=o.Mixin.Events.removeEventListener,o.Mixin.Events.once=o.Mixin.Events.addOneTimeEventListener,o.Mixin.Events.fire=o.Mixin.Events.fireEvent,function(){var n="ActiveXObject"in t,s=n&&!e.addEventListener,a=navigator.userAgent.toLowerCase(),r=-1!==a.indexOf("webkit"),h=-1!==a.indexOf("chrome"),l=-1!==a.indexOf("phantom"),u=-1!==a.indexOf("android"),c=-1!==a.search("android [23]"),d=-1!==a.indexOf("gecko"),p=typeof orientation!=i+"",_=t.navigator&&t.navigator.msPointerEnabled&&t.navigator.msMaxTouchPoints&&!t.PointerEvent,m=t.PointerEvent&&t.navigator.pointerEnabled&&t.navigator.maxTouchPoints||_,f="devicePixelRatio"in t&&t.devicePixelRatio>1||"matchMedia"in t&&t.matchMedia("(min-resolution:144dpi)")&&t.matchMedia("(min-resolution:144dpi)").matches,g=e.documentElement,v=n&&"transition"in g.style,y="WebKitCSSMatrix"in t&&"m11"in new t.WebKitCSSMatrix&&!c,P="MozPerspective"in g.style,L="OTransition"in g.style,x=!t.L_DISABLE_3D&&(v||y||P||L)&&!l,w=!t.L_NO_TOUCH&&!l&&function(){var t="ontouchstart";if(m||t in g)return!0;var i=e.createElement("div"),n=!1;return i.setAttribute?(i.setAttribute(t,"return;"),"function"==typeof i[t]&&(n=!0),i.removeAttribute(t),i=null,n):!1}();o.Browser={ie:n,ielt9:s,webkit:r,gecko:d&&!r&&!t.opera&&!n,android:u,android23:c,chrome:h,ie3d:v,webkit3d:y,gecko3d:P,opera3d:L,any3d:x,mobile:p,mobileWebkit:p&&r,mobileWebkit3d:p&&y,mobileOpera:p&&t.opera,touch:w,msPointer:_,pointer:m,retina:f}}(),o.Point=function(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e},o.Point.prototype={clone:function(){return new o.Point(this.x,this.y)},add:function(t){return this.clone()._add(o.point(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(o.point(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},distanceTo:function(t){t=o.point(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t=o.point(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=o.point(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+o.Util.formatNum(this.x)+", "+o.Util.formatNum(this.y)+")"}},o.point=function(t,e,n){return t instanceof o.Point?t:o.Util.isArray(t)?new o.Point(t[0],t[1]):t===i||null===t?t:new o.Point(t,e,n)},o.Bounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},o.Bounds.prototype={extend:function(t){return t=o.point(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new o.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new o.Point(this.min.x,this.max.y)},getTopRight:function(){return new o.Point(this.max.x,this.min.y)},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return t="number"==typeof t[0]||t instanceof o.Point?o.point(t):o.bounds(t),t instanceof o.Bounds?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=o.bounds(t);var e=this.min,i=this.max,n=t.min,s=t.max,a=s.x>=e.x&&n.x<=i.x,r=s.y>=e.y&&n.y<=i.y;return a&&r},isValid:function(){return!(!this.min||!this.max)}},o.bounds=function(t,e){return!t||t instanceof o.Bounds?t:new o.Bounds(t,e)},o.Transformation=function(t,e,i,n){this._a=t,this._b=e,this._c=i,this._d=n},o.Transformation.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new o.Point((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}},o.DomUtil={get:function(t){return"string"==typeof t?e.getElementById(t):t},getStyle:function(t,i){var n=t.style[i];if(!n&&t.currentStyle&&(n=t.currentStyle[i]),(!n||"auto"===n)&&e.defaultView){var o=e.defaultView.getComputedStyle(t,null);n=o?o[i]:null}return"auto"===n?null:n},getViewportOffset:function(t){var i,n=0,s=0,a=t,r=e.body,h=e.documentElement;do{if(n+=a.offsetTop||0,s+=a.offsetLeft||0,n+=parseInt(o.DomUtil.getStyle(a,"borderTopWidth"),10)||0,s+=parseInt(o.DomUtil.getStyle(a,"borderLeftWidth"),10)||0,i=o.DomUtil.getStyle(a,"position"),a.offsetParent===r&&"absolute"===i)break;if("fixed"===i){n+=r.scrollTop||h.scrollTop||0,s+=r.scrollLeft||h.scrollLeft||0;break}if("relative"===i&&!a.offsetLeft){var l=o.DomUtil.getStyle(a,"width"),u=o.DomUtil.getStyle(a,"max-width"),c=a.getBoundingClientRect();("none"!==l||"none"!==u)&&(s+=c.left+a.clientLeft),n+=c.top+(r.scrollTop||h.scrollTop||0);break}a=a.offsetParent}while(a);a=t;do{if(a===r)break;n-=a.scrollTop||0,s-=a.scrollLeft||0,a=a.parentNode}while(a);return new o.Point(s,n)},documentIsLtr:function(){return o.DomUtil._docIsLtrCached||(o.DomUtil._docIsLtrCached=!0,o.DomUtil._docIsLtr="ltr"===o.DomUtil.getStyle(e.body,"direction")),o.DomUtil._docIsLtr},create:function(t,i,n){var o=e.createElement(t);return o.className=i,n&&n.appendChild(o),o},hasClass:function(t,e){if(t.classList!==i)return t.classList.contains(e);var n=o.DomUtil._getClass(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)},addClass:function(t,e){if(t.classList!==i)for(var n=o.Util.splitWords(e),s=0,a=n.length;a>s;s++)t.classList.add(n[s]);else if(!o.DomUtil.hasClass(t,e)){var r=o.DomUtil._getClass(t);o.DomUtil._setClass(t,(r?r+" ":"")+e)}},removeClass:function(t,e){t.classList!==i?t.classList.remove(e):o.DomUtil._setClass(t,o.Util.trim((" "+o.DomUtil._getClass(t)+" ").replace(" "+e+" "," ")))},_setClass:function(t,e){t.className.baseVal===i?t.className=e:t.className.baseVal=e},_getClass:function(t){return t.className.baseVal===i?t.className:t.className.baseVal},setOpacity:function(t,e){if("opacity"in t.style)t.style.opacity=e;else if("filter"in t.style){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(o){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}},testProp:function(t){for(var i=e.documentElement.style,n=0;n<t.length;n++)if(t[n]in i)return t[n];return!1},getTranslateString:function(t){var e=o.Browser.webkit3d,i="translate"+(e?"3d":"")+"(",n=(e?",0":"")+")";return i+t.x+"px,"+t.y+"px"+n},getScaleString:function(t,e){var i=o.DomUtil.getTranslateString(e.add(e.multiplyBy(-1*t))),n=" scale("+t+") ";return i+n},setPosition:function(t,e,i){t._leaflet_pos=e,!i&&o.Browser.any3d?t.style[o.DomUtil.TRANSFORM]=o.DomUtil.getTranslateString(e):(t.style.left=e.x+"px",t.style.top=e.y+"px")},getPosition:function(t){return t._leaflet_pos}},o.DomUtil.TRANSFORM=o.DomUtil.testProp(["transform","WebkitTransform","OTransform","MozTransform","msTransform"]),o.DomUtil.TRANSITION=o.DomUtil.testProp(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),o.DomUtil.TRANSITION_END="webkitTransition"===o.DomUtil.TRANSITION||"OTransition"===o.DomUtil.TRANSITION?o.DomUtil.TRANSITION+"End":"transitionend",function(){if("onselectstart"in e)o.extend(o.DomUtil,{disableTextSelection:function(){o.DomEvent.on(t,"selectstart",o.DomEvent.preventDefault)},enableTextSelection:function(){o.DomEvent.off(t,"selectstart",o.DomEvent.preventDefault)}});else{var i=o.DomUtil.testProp(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);o.extend(o.DomUtil,{disableTextSelection:function(){if(i){var t=e.documentElement.style;this._userSelect=t[i],t[i]="none"}},enableTextSelection:function(){i&&(e.documentElement.style[i]=this._userSelect,delete this._userSelect)}})}o.extend(o.DomUtil,{disableImageDrag:function(){o.DomEvent.on(t,"dragstart",o.DomEvent.preventDefault)},enableImageDrag:function(){o.DomEvent.off(t,"dragstart",o.DomEvent.preventDefault)}})}(),o.LatLng=function(t,e,n){if(t=parseFloat(t),e=parseFloat(e),isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=t,this.lng=e,n!==i&&(this.alt=parseFloat(n))},o.extend(o.LatLng,{DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,MAX_MARGIN:1e-9}),o.LatLng.prototype={equals:function(t){if(!t)return!1;t=o.latLng(t);var e=Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng));return e<=o.LatLng.MAX_MARGIN},toString:function(t){return"LatLng("+o.Util.formatNum(this.lat,t)+", "+o.Util.formatNum(this.lng,t)+")"},distanceTo:function(t){t=o.latLng(t);var e=6378137,i=o.LatLng.DEG_TO_RAD,n=(t.lat-this.lat)*i,s=(t.lng-this.lng)*i,a=this.lat*i,r=t.lat*i,h=Math.sin(n/2),l=Math.sin(s/2),u=h*h+l*l*Math.cos(a)*Math.cos(r);return 2*e*Math.atan2(Math.sqrt(u),Math.sqrt(1-u))},wrap:function(t,e){var i=this.lng;return t=t||-180,e=e||180,i=(i+e)%(e-t)+(t>i||i===e?e:t),new o.LatLng(this.lat,i)}},o.latLng=function(t,e){return t instanceof o.LatLng?t:o.Util.isArray(t)?"number"==typeof t[0]||"string"==typeof t[0]?new o.LatLng(t[0],t[1],t[2]):null:t===i||null===t?t:"object"==typeof t&&"lat"in t?new o.LatLng(t.lat,"lng"in t?t.lng:t.lon):e===i?null:new o.LatLng(t,e)},o.LatLngBounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},o.LatLngBounds.prototype={extend:function(t){if(!t)return this;var e=o.latLng(t);return t=null!==e?e:o.latLngBounds(t),t instanceof o.LatLng?this._southWest||this._northEast?(this._southWest.lat=Math.min(t.lat,this._southWest.lat),this._southWest.lng=Math.min(t.lng,this._southWest.lng),this._northEast.lat=Math.max(t.lat,this._northEast.lat),this._northEast.lng=Math.max(t.lng,this._northEast.lng)):(this._southWest=new o.LatLng(t.lat,t.lng),this._northEast=new o.LatLng(t.lat,t.lng)):t instanceof o.LatLngBounds&&(this.extend(t._southWest),this.extend(t._northEast)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,s=Math.abs(e.lng-i.lng)*t;return new o.LatLngBounds(new o.LatLng(e.lat-n,e.lng-s),new o.LatLng(i.lat+n,i.lng+s))},getCenter:function(){return new o.LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new o.LatLng(this.getNorth(),this.getWest())},getSouthEast:function(){return new o.LatLng(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof o.LatLng?o.latLng(t):o.latLngBounds(t);var e,i,n=this._southWest,s=this._northEast;return t instanceof o.LatLngBounds?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=s.lat&&e.lng>=n.lng&&i.lng<=s.lng},intersects:function(t){t=o.latLngBounds(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),s=t.getNorthEast(),a=s.lat>=e.lat&&n.lat<=i.lat,r=s.lng>=e.lng&&n.lng<=i.lng;return a&&r},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t){return t?(t=o.latLngBounds(t),this._southWest.equals(t.getSouthWest())&&this._northEast.equals(t.getNorthEast())):!1},isValid:function(){return!(!this._southWest||!this._northEast)}},o.latLngBounds=function(t,e){return!t||t instanceof o.LatLngBounds?t:new o.LatLngBounds(t,e)},o.Projection={},o.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(t){var e=o.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),s=t.lng*e,a=n*e;return a=Math.log(Math.tan(Math.PI/4+a/2)),new o.Point(s,a)},unproject:function(t){var e=o.LatLng.RAD_TO_DEG,i=t.x*e,n=(2*Math.atan(Math.exp(t.y))-Math.PI/2)*e;return new o.LatLng(n,i)}},o.Projection.LonLat={project:function(t){return new o.Point(t.lng,t.lat)},unproject:function(t){return new o.LatLng(t.y,t.x)}},o.CRS={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},scale:function(t){return 256*Math.pow(2,t)},getSize:function(t){var e=this.scale(t);return o.point(e,e)}},o.CRS.Simple=o.extend({},o.CRS,{projection:o.Projection.LonLat,transformation:new o.Transformation(1,0,-1,0),scale:function(t){return Math.pow(2,t)}}),o.CRS.EPSG3857=o.extend({},o.CRS,{code:"EPSG:3857",projection:o.Projection.SphericalMercator,transformation:new o.Transformation(.5/Math.PI,.5,-.5/Math.PI,.5),project:function(t){var e=this.projection.project(t),i=6378137;return e.multiplyBy(i)}}),o.CRS.EPSG900913=o.extend({},o.CRS.EPSG3857,{code:"EPSG:900913"}),o.CRS.EPSG4326=o.extend({},o.CRS,{code:"EPSG:4326",projection:o.Projection.LonLat,transformation:new o.Transformation(1/360,.5,-1/360,.5)}),o.Map=o.Class.extend({includes:o.Mixin.Events,options:{crs:o.CRS.EPSG3857,fadeAnimation:o.DomUtil.TRANSITION&&!o.Browser.android23,trackResize:!0,markerZoomAnimation:o.DomUtil.TRANSITION&&o.Browser.any3d},initialize:function(t,e){e=o.setOptions(this,e),this._initContainer(t),this._initLayout(),this._onResize=o.bind(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),e.center&&e.zoom!==i&&this.setView(o.latLng(e.center),e.zoom,{reset:!0}),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._tileLayersNum=0,this.callInitHooks(),this._addLayers(e.layers)},setView:function(t,e){return e=e===i?this.getZoom():e,this._resetView(o.latLng(t),this._limitZoom(e)),this},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=this._limitZoom(t),this)},zoomIn:function(t,e){return this.setZoom(this._zoom+(t||1),e)},zoomOut:function(t,e){return this.setZoom(this._zoom-(t||1),e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),s=this.getSize().divideBy(2),a=t instanceof o.Point?t:this.latLngToContainerPoint(t),r=a.subtract(s).multiplyBy(1-1/n),h=this.containerPointToLatLng(s.add(r));return this.setView(h,e,{zoom:i})},fitBounds:function(t,e){e=e||{},t=t.getBounds?t.getBounds():o.latLngBounds(t);var i=o.point(e.paddingTopLeft||e.padding||[0,0]),n=o.point(e.paddingBottomRight||e.padding||[0,0]),s=this.getBoundsZoom(t,!1,i.add(n)),a=n.subtract(i).divideBy(2),r=this.project(t.getSouthWest(),s),h=this.project(t.getNorthEast(),s),l=this.unproject(r.add(h).divideBy(2).add(a),s);return s=e&&e.maxZoom?Math.min(e.maxZoom,s):s,this.setView(l,s,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t){return this.fire("movestart"),this._rawPanBy(o.point(t)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(t){return t=o.latLngBounds(t),this.options.maxBounds=t,t?(this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds,this)):this.off("moveend",this._panInsideMaxBounds,this)},panInsideBounds:function(t,e){var i=this.getCenter(),n=this._limitCenter(i,this._zoom,t);return i.equals(n)?this:this.panTo(n,e)},addLayer:function(t){var e=o.stamp(t);return this._layers[e]?this:(this._layers[e]=t,!t.options||isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[e]=t,this._updateZoomLevels()),this.options.zoomAnimation&&o.TileLayer&&t instanceof o.TileLayer&&(this._tileLayersNum++,this._tileLayersToLoad++,t.on("load",this._onTileLayerLoad,this)),this._loaded&&this._layerAdd(t),this)},removeLayer:function(t){var e=o.stamp(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&this.fire("layerremove",{layer:t}),this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels()),this.options.zoomAnimation&&o.TileLayer&&t instanceof o.TileLayer&&(this._tileLayersNum--,this._tileLayersToLoad--,t.off("load",this._onTileLayerLoad,this)),this):this},hasLayer:function(t){return t?o.stamp(t)in this._layers:!1},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},invalidateSize:function(t){if(!this._loaded)return this;t=o.extend({animate:!1,pan:!0},t===!0?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._initialCenter=null;var i=this.getSize(),n=e.divideBy(2).round(),s=i.divideBy(2).round(),a=n.subtract(s);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o.bind(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):this},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){this._loaded&&this.fire("unload"),this._initEvents("off");try{delete this._container._leaflet}catch(t){this._container._leaflet=i}return this._clearPanes(),this._clearControlPos&&this._clearControlPos(),this._clearHandlers(),this},getCenter:function(){return this._checkIfLoaded(),this._initialCenter&&!this._moved()?this._initialCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds(),e=this.unproject(t.getBottomLeft()),i=this.unproject(t.getTopRight());return new o.LatLngBounds(e,i)},getMinZoom:function(){return this.options.minZoom===i?this._layersMinZoom===i?0:this._layersMinZoom:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===i?this._layersMaxZoom===i?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=o.latLngBounds(t);var n,s=this.getMinZoom()-(e?1:0),a=this.getMaxZoom(),r=this.getSize(),h=t.getNorthWest(),l=t.getSouthEast(),u=!0;i=o.point(i||[0,0]);do s++,n=this.project(l,s).subtract(this.project(h,s)).add(i),u=e?n.x<r.x||n.y<r.y:r.contains(n);while(u&&a>=s);return u&&e?null:e?s:s-1},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new o.Point(this._container.clientWidth,this._container.clientHeight),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(){var t=this._getTopLeftPoint();return new o.Bounds(t,t.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._initialTopLeftPoint},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t){var e=this.options.crs;return e.scale(t)/e.scale(this._zoom)},getScaleZoom:function(t){return this._zoom+Math.log(t)/Math.LN2},project:function(t,e){return e=e===i?this._zoom:e,this.options.crs.latLngToPoint(o.latLng(t),e)},unproject:function(t,e){return e=e===i?this._zoom:e,this.options.crs.pointToLatLng(o.point(t),e)},layerPointToLatLng:function(t){var e=o.point(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(o.latLng(t))._round();return e._subtract(this.getPixelOrigin())},containerPointToLayerPoint:function(t){return o.point(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return o.point(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(o.point(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(o.latLng(t)))},mouseEventToContainerPoint:function(t){return o.DomEvent.getMousePosition(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=o.DomUtil.get(t);if(!e)throw new Error("Map container not found.");if(e._leaflet)throw new Error("Map container is already initialized.");e._leaflet=!0},_initLayout:function(){var t=this._container;o.DomUtil.addClass(t,"leaflet-container"+(o.Browser.touch?" leaflet-touch":"")+(o.Browser.retina?" leaflet-retina":"")+(o.Browser.ielt9?" leaflet-oldie":"")+(this.options.fadeAnimation?" leaflet-fade-anim":""));var e=o.DomUtil.getStyle(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._mapPane=t.mapPane=this._createPane("leaflet-map-pane",this._container),this._tilePane=t.tilePane=this._createPane("leaflet-tile-pane",this._mapPane),t.objectsPane=this._createPane("leaflet-objects-pane",this._mapPane),t.shadowPane=this._createPane("leaflet-shadow-pane"),t.overlayPane=this._createPane("leaflet-overlay-pane"),t.markerPane=this._createPane("leaflet-marker-pane"),t.popupPane=this._createPane("leaflet-popup-pane");var e=" leaflet-zoom-hide";this.options.markerZoomAnimation||(o.DomUtil.addClass(t.markerPane,e),o.DomUtil.addClass(t.shadowPane,e),o.DomUtil.addClass(t.popupPane,e))},_createPane:function(t,e){return o.DomUtil.create("div",t,e||this._panes.objectsPane)},_clearPanes:function(){this._container.removeChild(this._mapPane)},_addLayers:function(t){t=t?o.Util.isArray(t)?t:[t]:[];for(var e=0,i=t.length;i>e;e++)this.addLayer(t[e])},_resetView:function(t,e,i,n){var s=this._zoom!==e;n||(this.fire("movestart"),s&&this.fire("zoomstart")),this._zoom=e,this._initialCenter=t,this._initialTopLeftPoint=this._getNewTopLeftPoint(t),i?this._initialTopLeftPoint._add(this._getMapPanePos()):o.DomUtil.setPosition(this._mapPane,new o.Point(0,0)),this._tileLayersToLoad=this._tileLayersNum;var a=!this._loaded;this._loaded=!0,this.fire("viewreset",{hard:!i}),a&&(this.fire("load"),this.eachLayer(this._layerAdd,this)),this.fire("move"),(s||n)&&this.fire("zoomend"),this.fire("moveend",{hard:!i})},_rawPanBy:function(t){o.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_updateZoomLevels:function(){var t,e=1/0,n=-(1/0),o=this._getZoomSpan();for(t in this._zoomBoundLayers){var s=this._zoomBoundLayers[t];isNaN(s.options.minZoom)||(e=Math.min(e,s.options.minZoom)),isNaN(s.options.maxZoom)||(n=Math.max(n,s.options.maxZoom))}t===i?this._layersMaxZoom=this._layersMinZoom=i:(this._layersMaxZoom=n,this._layersMinZoom=e),o!==this._getZoomSpan()&&this.fire("zoomlevelschange")},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(e){if(o.DomEvent){e=e||"on",o.DomEvent[e](this._container,"click",this._onMouseClick,this);var i,n,s=["dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","contextmenu"];for(i=0,n=s.length;n>i;i++)o.DomEvent[e](this._container,s[i],this._fireMouseEvent,this);this.options.trackResize&&o.DomEvent[e](t,"resize",this._onResize,this)}},_onResize:function(){o.Util.cancelAnimFrame(this._resizeRequest),this._resizeRequest=o.Util.requestAnimFrame(function(){this.invalidateSize({debounceMoveend:!0})},this,!1,this._container)},_onMouseClick:function(t){!this._loaded||!t._simulated&&(this.dragging&&this.dragging.moved()||this.boxZoom&&this.boxZoom.moved())||o.DomEvent._skipped(t)||(this.fire("preclick"),this._fireMouseEvent(t))},_fireMouseEvent:function(t){if(this._loaded&&!o.DomEvent._skipped(t)){var e=t.type;if(e="mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,this.hasEventListeners(e)){"contextmenu"===e&&o.DomEvent.preventDefault(t);var i=this.mouseEventToContainerPoint(t),n=this.containerPointToLayerPoint(i),s=this.layerPointToLatLng(n);this.fire(e,{latlng:s,layerPoint:n,containerPoint:i,originalEvent:t})}}},_onTileLayerLoad:function(){this._tileLayersToLoad--,this._tileLayersNum&&!this._tileLayersToLoad&&this.fire("tilelayersload")},_clearHandlers:function(){for(var t=0,e=this._handlers.length;e>t;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,this):this.on("load",t,e),this},_layerAdd:function(t){t.onAdd(this),this.fire("layeradd",{layer:t})},_getMapPanePos:function(){return o.DomUtil.getPosition(this._mapPane)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(){return this.getPixelOrigin().subtract(this._getMapPanePos())},_getNewTopLeftPoint:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewTopLeftPoint(i,e).add(this._getMapPanePos());return this.project(t,e)._subtract(n)},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var n=this.project(t,e),s=this.getSize().divideBy(2),a=new o.Bounds(n.subtract(s),n.add(s)),r=this._getBoundsOffset(a,i,e);return this.unproject(n.add(r),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new o.Bounds(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=this.project(e.getNorthWest(),i).subtract(t.min),s=this.project(e.getSouthEast(),i).subtract(t.max),a=this._rebound(n.x,-s.x),r=this._rebound(n.y,-s.y);return new o.Point(a,r)},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom();return Math.max(e,Math.min(i,t))}}),o.map=function(t,e){return new o.Map(t,e)},o.Projection.Mercator={MAX_LATITUDE:85.0840591556,R_MINOR:6356752.314245179,R_MAJOR:6378137,project:function(t){var e=o.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),s=this.R_MAJOR,a=this.R_MINOR,r=t.lng*e*s,h=n*e,l=a/s,u=Math.sqrt(1-l*l),c=u*Math.sin(h);c=Math.pow((1-c)/(1+c),.5*u);var d=Math.tan(.5*(.5*Math.PI-h))/c;return h=-s*Math.log(d),new o.Point(r,h)},unproject:function(t){for(var e,i=o.LatLng.RAD_TO_DEG,n=this.R_MAJOR,s=this.R_MINOR,a=t.x*i/n,r=s/n,h=Math.sqrt(1-r*r),l=Math.exp(-t.y/n),u=Math.PI/2-2*Math.atan(l),c=15,d=1e-7,p=c,_=.1;Math.abs(_)>d&&--p>0;)e=h*Math.sin(u),
_=Math.PI/2-2*Math.atan(l*Math.pow((1-e)/(1+e),.5*h))-u,u+=_;return new o.LatLng(u*i,a)}},o.CRS.EPSG3395=o.extend({},o.CRS,{code:"EPSG:3395",projection:o.Projection.Mercator,transformation:function(){var t=o.Projection.Mercator,e=t.R_MAJOR,i=.5/(Math.PI*e);return new o.Transformation(i,.5,-i,.5)}()}),o.TileLayer=o.Class.extend({includes:o.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:o.Browser.mobile,updateWhenIdle:o.Browser.mobile},initialize:function(t,e){e=o.setOptions(this,e),e.detectRetina&&o.Browser.retina&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomOffset++,e.minZoom>0&&e.minZoom--,this.options.maxZoom--),e.bounds&&(e.bounds=o.latLngBounds(e.bounds)),this._url=t;var i=this.options.subdomains;"string"==typeof i&&(this.options.subdomains=i.split(""))},onAdd:function(t){this._map=t,this._animated=t._zoomAnimated,this._initContainer(),t.on({viewreset:this._reset,moveend:this._update},this),this._animated&&t.on({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||(this._limitedUpdate=o.Util.limitExecByInterval(this._update,150,this),t.on("move",this._limitedUpdate,this)),this._reset(),this._update()},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this._container.parentNode.removeChild(this._container),t.off({viewreset:this._reset,moveend:this._update},this),this._animated&&t.off({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||t.off("move",this._limitedUpdate,this),this._container=null,this._map=null},bringToFront:function(){var t=this._map._panes.tilePane;return this._container&&(t.appendChild(this._container),this._setAutoZIndex(t,Math.max)),this},bringToBack:function(){var t=this._map._panes.tilePane;return this._container&&(t.insertBefore(this._container,t.firstChild),this._setAutoZIndex(t,Math.min)),this},getAttribution:function(){return this.options.attribution},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},setUrl:function(t,e){return this._url=t,e||this.redraw(),this},redraw:function(){return this._map&&(this._reset({hard:!0}),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==i&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t,e){var i,n,o,s=t.children,a=-e(1/0,-(1/0));for(n=0,o=s.length;o>n;n++)s[n]!==this._container&&(i=parseInt(s[n].style.zIndex,10),isNaN(i)||(a=e(a,i)));this.options.zIndex=this._container.style.zIndex=(isFinite(a)?a:0)+e(1,-1)},_updateOpacity:function(){var t,e=this._tiles;if(o.Browser.ielt9)for(t in e)o.DomUtil.setOpacity(e[t],this.options.opacity);else o.DomUtil.setOpacity(this._container,this.options.opacity)},_initContainer:function(){var t=this._map._panes.tilePane;if(!this._container){if(this._container=o.DomUtil.create("div","leaflet-layer"),this._updateZIndex(),this._animated){var e="leaflet-tile-container";this._bgBuffer=o.DomUtil.create("div",e,this._container),this._tileContainer=o.DomUtil.create("div",e,this._container)}else this._tileContainer=this._container;t.appendChild(this._container),this.options.opacity<1&&this._updateOpacity()}},_reset:function(t){for(var e in this._tiles)this.fire("tileunload",{tile:this._tiles[e]});this._tiles={},this._tilesToLoad=0,this.options.reuseTiles&&(this._unusedTiles=[]),this._tileContainer.innerHTML="",this._animated&&t&&t.hard&&this._clearBgBuffer(),this._initContainer()},_getTileSize:function(){var t=this._map,e=t.getZoom()+this.options.zoomOffset,i=this.options.maxNativeZoom,n=this.options.tileSize;return i&&e>i&&(n=Math.round(t.getZoomScale(e)/t.getZoomScale(i)*n)),n},_update:function(){if(this._map){var t=this._map,e=t.getPixelBounds(),i=t.getZoom(),n=this._getTileSize();if(!(i>this.options.maxZoom||i<this.options.minZoom)){var s=o.bounds(e.min.divideBy(n)._floor(),e.max.divideBy(n)._floor());this._addTilesFromCenterOut(s),(this.options.unloadInvisibleTiles||this.options.reuseTiles)&&this._removeOtherTiles(s)}}},_addTilesFromCenterOut:function(t){var i,n,s,a=[],r=t.getCenter();for(i=t.min.y;i<=t.max.y;i++)for(n=t.min.x;n<=t.max.x;n++)s=new o.Point(n,i),this._tileShouldBeLoaded(s)&&a.push(s);var h=a.length;if(0!==h){a.sort(function(t,e){return t.distanceTo(r)-e.distanceTo(r)});var l=e.createDocumentFragment();for(this._tilesToLoad||this.fire("loading"),this._tilesToLoad+=h,n=0;h>n;n++)this._addTile(a[n],l);this._tileContainer.appendChild(l)}},_tileShouldBeLoaded:function(t){if(t.x+":"+t.y in this._tiles)return!1;var e=this.options;if(!e.continuousWorld){var i=this._getWrapTileNum();if(e.noWrap&&(t.x<0||t.x>=i.x)||t.y<0||t.y>=i.y)return!1}if(e.bounds){var n=e.tileSize,o=t.multiplyBy(n),s=o.add([n,n]),a=this._map.unproject(o),r=this._map.unproject(s);if(e.continuousWorld||e.noWrap||(a=a.wrap(),r=r.wrap()),!e.bounds.intersects([a,r]))return!1}return!0},_removeOtherTiles:function(t){var e,i,n,o;for(o in this._tiles)e=o.split(":"),i=parseInt(e[0],10),n=parseInt(e[1],10),(i<t.min.x||i>t.max.x||n<t.min.y||n>t.max.y)&&this._removeTile(o)},_removeTile:function(t){var e=this._tiles[t];this.fire("tileunload",{tile:e,url:e.src}),this.options.reuseTiles?(o.DomUtil.removeClass(e,"leaflet-tile-loaded"),this._unusedTiles.push(e)):e.parentNode===this._tileContainer&&this._tileContainer.removeChild(e),o.Browser.android||(e.onload=null,e.src=o.Util.emptyImageUrl),delete this._tiles[t]},_addTile:function(t,e){var i=this._getTilePos(t),n=this._getTile();o.DomUtil.setPosition(n,i,o.Browser.chrome),this._tiles[t.x+":"+t.y]=n,this._loadTile(n,t),n.parentNode!==this._tileContainer&&e.appendChild(n)},_getZoomForUrl:function(){var t=this.options,e=this._map.getZoom();return t.zoomReverse&&(e=t.maxZoom-e),e+=t.zoomOffset,t.maxNativeZoom?Math.min(e,t.maxNativeZoom):e},_getTilePos:function(t){var e=this._map.getPixelOrigin(),i=this._getTileSize();return t.multiplyBy(i).subtract(e)},getTileUrl:function(t){return o.Util.template(this._url,o.extend({s:this._getSubdomain(t),z:t.z,x:t.x,y:t.y},this.options))},_getWrapTileNum:function(){var t=this._map.options.crs,e=t.getSize(this._map.getZoom());return e.divideBy(this._getTileSize())._floor()},_adjustTilePoint:function(t){var e=this._getWrapTileNum();this.options.continuousWorld||this.options.noWrap||(t.x=(t.x%e.x+e.x)%e.x),this.options.tms&&(t.y=e.y-t.y-1),t.z=this._getZoomForUrl()},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var t=this._unusedTiles.pop();return this._resetTile(t),t}return this._createTile()},_resetTile:function(){},_createTile:function(){var t=o.DomUtil.create("img","leaflet-tile");return t.style.width=t.style.height=this._getTileSize()+"px",t.galleryimg="no",t.onselectstart=t.onmousemove=o.Util.falseFn,o.Browser.ielt9&&this.options.opacity!==i&&o.DomUtil.setOpacity(t,this.options.opacity),o.Browser.mobileWebkit3d&&(t.style.WebkitBackfaceVisibility="hidden"),t},_loadTile:function(t,e){t._layer=this,t.onload=this._tileOnLoad,t.onerror=this._tileOnError,this._adjustTilePoint(e),t.src=this.getTileUrl(e),this.fire("tileloadstart",{tile:t,url:t.src})},_tileLoaded:function(){this._tilesToLoad--,this._animated&&o.DomUtil.addClass(this._tileContainer,"leaflet-zoom-animated"),this._tilesToLoad||(this.fire("load"),this._animated&&(clearTimeout(this._clearBgBufferTimer),this._clearBgBufferTimer=setTimeout(o.bind(this._clearBgBuffer,this),500)))},_tileOnLoad:function(){var t=this._layer;this.src!==o.Util.emptyImageUrl&&(o.DomUtil.addClass(this,"leaflet-tile-loaded"),t.fire("tileload",{tile:this,url:this.src})),t._tileLoaded()},_tileOnError:function(){var t=this._layer;t.fire("tileerror",{tile:this,url:this.src});var e=t.options.errorTileUrl;e&&(this.src=e),t._tileLoaded()}}),o.tileLayer=function(t,e){return new o.TileLayer(t,e)},o.TileLayer.WMS=o.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(t,e){this._url=t;var i=o.extend({},this.defaultWmsParams),n=e.tileSize||this.options.tileSize;e.detectRetina&&o.Browser.retina?i.width=i.height=2*n:i.width=i.height=n;for(var s in e)this.options.hasOwnProperty(s)||"crs"===s||(i[s]=e[s]);this.wmsParams=i,o.setOptions(this,e)},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,o.TileLayer.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._map,i=this.options.tileSize,n=t.multiplyBy(i),s=n.add([i,i]),a=this._crs.project(e.unproject(n,t.z)),r=this._crs.project(e.unproject(s,t.z)),h=this._wmsVersion>=1.3&&this._crs===o.CRS.EPSG4326?[r.y,a.x,a.y,r.x].join(","):[a.x,r.y,r.x,a.y].join(","),l=o.Util.template(this._url,{s:this._getSubdomain(t)});return l+o.Util.getParamString(this.wmsParams,l,!0)+"&BBOX="+h},setParams:function(t,e){return o.extend(this.wmsParams,t),e||this.redraw(),this}}),o.tileLayer.wms=function(t,e){return new o.TileLayer.WMS(t,e)},o.TileLayer.Canvas=o.TileLayer.extend({options:{async:!1},initialize:function(t){o.setOptions(this,t)},redraw:function(){this._map&&(this._reset({hard:!0}),this._update());for(var t in this._tiles)this._redrawTile(this._tiles[t]);return this},_redrawTile:function(t){this.drawTile(t,t._tilePoint,this._map._zoom)},_createTile:function(){var t=o.DomUtil.create("canvas","leaflet-tile");return t.width=t.height=this.options.tileSize,t.onselectstart=t.onmousemove=o.Util.falseFn,t},_loadTile:function(t,e){t._layer=this,t._tilePoint=e,this._redrawTile(t),this.options.async||this.tileDrawn(t)},drawTile:function(){},tileDrawn:function(t){this._tileOnLoad.call(t)}}),o.tileLayer.canvas=function(t){return new o.TileLayer.Canvas(t)},o.ImageOverlay=o.Class.extend({includes:o.Mixin.Events,options:{opacity:1},initialize:function(t,e,i){this._url=t,this._bounds=o.latLngBounds(e),o.setOptions(this,i)},onAdd:function(t){this._map=t,this._image||this._initImage(),t._panes.overlayPane.appendChild(this._image),t.on("viewreset",this._reset,this),t.options.zoomAnimation&&o.Browser.any3d&&t.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(t){t.getPanes().overlayPane.removeChild(this._image),t.off("viewreset",this._reset,this),t.options.zoomAnimation&&t.off("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var t=this._map._panes.overlayPane;return this._image&&t.insertBefore(this._image,t.firstChild),this},setUrl:function(t){this._url=t,this._image.src=this._url},getAttribution:function(){return this.options.attribution},_initImage:function(){this._image=o.DomUtil.create("img","leaflet-image-layer"),this._map.options.zoomAnimation&&o.Browser.any3d?o.DomUtil.addClass(this._image,"leaflet-zoom-animated"):o.DomUtil.addClass(this._image,"leaflet-zoom-hide"),this._updateOpacity(),o.extend(this._image,{galleryimg:"no",onselectstart:o.Util.falseFn,onmousemove:o.Util.falseFn,onload:o.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(t){var e=this._map,i=this._image,n=e.getZoomScale(t.zoom),s=this._bounds.getNorthWest(),a=this._bounds.getSouthEast(),r=e._latLngToNewLayerPoint(s,t.zoom,t.center),h=e._latLngToNewLayerPoint(a,t.zoom,t.center)._subtract(r),l=r._add(h._multiplyBy(.5*(1-1/n)));i.style[o.DomUtil.TRANSFORM]=o.DomUtil.getTranslateString(l)+" scale("+n+") "},_reset:function(){var t=this._image,e=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),i=this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(e);o.DomUtil.setPosition(t,e),t.style.width=i.x+"px",t.style.height=i.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){o.DomUtil.setOpacity(this._image,this.options.opacity)}}),o.imageOverlay=function(t,e,i){return new o.ImageOverlay(t,e,i)},o.Icon=o.Class.extend({options:{className:""},initialize:function(t){o.setOptions(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n;return n=e&&"IMG"===e.tagName?this._createImg(i,e):this._createImg(i),this._setIconStyles(n,t),n},_setIconStyles:function(t,e){var i,n=this.options,s=o.point(n[e+"Size"]);i=o.point("shadow"===e?n.shadowAnchor||n.iconAnchor:n.iconAnchor),!i&&s&&(i=s.divideBy(2,!0)),t.className="leaflet-marker-"+e+" "+n.className,i&&(t.style.marginLeft=-i.x+"px",t.style.marginTop=-i.y+"px"),s&&(t.style.width=s.x+"px",t.style.height=s.y+"px")},_createImg:function(t,i){return i=i||e.createElement("img"),i.src=t,i},_getIconUrl:function(t){return o.Browser.retina&&this.options[t+"RetinaUrl"]?this.options[t+"RetinaUrl"]:this.options[t+"Url"]}}),o.icon=function(t){return new o.Icon(t)},o.Icon.Default=o.Icon.extend({options:{iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]},_getIconUrl:function(t){var e=t+"Url";if(this.options[e])return this.options[e];o.Browser.retina&&"icon"===t&&(t+="-2x");var i=o.Icon.Default.imagePath;if(!i)throw new Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return i+"/marker-"+t+".png"}}),o.Icon.Default.imagePath=function(){var t,i,n,o,s,a=e.getElementsByTagName("script"),r=/[\/^]leaflet[\-\._]?([\w\-\._]*)\.js\??/;for(t=0,i=a.length;i>t;t++)if(n=a[t].src,o=n.match(r))return s=n.split(r)[0],(s?s+"/":"")+"images"}(),o.Marker=o.Class.extend({includes:o.Mixin.Events,options:{icon:new o.Icon.Default,title:"",alt:"",clickable:!0,draggable:!1,keyboard:!0,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250},initialize:function(t,e){o.setOptions(this,e),this._latlng=o.latLng(t)},onAdd:function(t){this._map=t,t.on("viewreset",this.update,this),this._initIcon(),this.update(),this.fire("add"),t.options.zoomAnimation&&t.options.markerZoomAnimation&&t.on("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this.dragging&&this.dragging.disable(),this._removeIcon(),this._removeShadow(),this.fire("remove"),t.off({viewreset:this.update,zoomanim:this._animateZoom},this),this._map=null},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=o.latLng(t),this.update(),this.fire("move",{latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update(),this},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup),this},update:function(){if(this._icon){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e=this._map,i=e.options.zoomAnimation&&e.options.markerZoomAnimation,n=i?"leaflet-zoom-animated":"leaflet-zoom-hide",s=t.icon.createIcon(this._icon),a=!1;s!==this._icon&&(this._icon&&this._removeIcon(),a=!0,t.title&&(s.title=t.title),t.alt&&(s.alt=t.alt)),o.DomUtil.addClass(s,n),t.keyboard&&(s.tabIndex="0"),this._icon=s,this._initInteraction(),t.riseOnHover&&o.DomEvent.on(s,"mouseover",this._bringToFront,this).on(s,"mouseout",this._resetZIndex,this);var r=t.icon.createShadow(this._shadow),h=!1;r!==this._shadow&&(this._removeShadow(),h=!0),r&&o.DomUtil.addClass(r,n),this._shadow=r,t.opacity<1&&this._updateOpacity();var l=this._map._panes;a&&l.markerPane.appendChild(this._icon),r&&h&&l.shadowPane.appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&o.DomEvent.off(this._icon,"mouseover",this._bringToFront).off(this._icon,"mouseout",this._resetZIndex),this._map._panes.markerPane.removeChild(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&this._map._panes.shadowPane.removeChild(this._shadow),this._shadow=null},_setPos:function(t){o.DomUtil.setPosition(this._icon,t),this._shadow&&o.DomUtil.setPosition(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.clickable){var t=this._icon,e=["dblclick","mousedown","mouseover","mouseout","contextmenu"];o.DomUtil.addClass(t,"leaflet-clickable"),o.DomEvent.on(t,"click",this._onMouseClick,this),o.DomEvent.on(t,"keypress",this._onKeyPress,this);for(var i=0;i<e.length;i++)o.DomEvent.on(t,e[i],this._fireMouseEvent,this);o.Handler.MarkerDrag&&(this.dragging=new o.Handler.MarkerDrag(this),this.options.draggable&&this.dragging.enable())}},_onMouseClick:function(t){var e=this.dragging&&this.dragging.moved();(this.hasEventListeners(t.type)||e)&&o.DomEvent.stopPropagation(t),e||(this.dragging&&this.dragging._enabled||!this._map.dragging||!this._map.dragging.moved())&&this.fire(t.type,{originalEvent:t,latlng:this._latlng})},_onKeyPress:function(t){13===t.keyCode&&this.fire("click",{originalEvent:t,latlng:this._latlng})},_fireMouseEvent:function(t){this.fire(t.type,{originalEvent:t,latlng:this._latlng}),"contextmenu"===t.type&&this.hasEventListeners(t.type)&&o.DomEvent.preventDefault(t),"mousedown"!==t.type?o.DomEvent.stopPropagation(t):o.DomEvent.preventDefault(t)},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){o.DomUtil.setOpacity(this._icon,this.options.opacity),this._shadow&&o.DomUtil.setOpacity(this._shadow,this.options.opacity)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)}}),o.marker=function(t,e){return new o.Marker(t,e)},o.DivIcon=o.Icon.extend({options:{iconSize:[12,12],className:"leaflet-div-icon",html:!1},createIcon:function(t){var i=t&&"DIV"===t.tagName?t:e.createElement("div"),n=this.options;return n.html!==!1?i.innerHTML=n.html:i.innerHTML="",n.bgPos&&(i.style.backgroundPosition=-n.bgPos.x+"px "+-n.bgPos.y+"px"),this._setIconStyles(i,"icon"),i},createShadow:function(){return null}}),o.divIcon=function(t){return new o.DivIcon(t)},o.Map.mergeOptions({closePopupOnClick:!0}),o.Popup=o.Class.extend({includes:o.Mixin.Events,options:{minWidth:50,maxWidth:300,autoPan:!0,closeButton:!0,offset:[0,7],autoPanPadding:[5,5],keepInView:!1,className:"",zoomAnimation:!0},initialize:function(t,e){o.setOptions(this,t),this._source=e,this._animated=o.Browser.any3d&&this.options.zoomAnimation,this._isOpen=!1},onAdd:function(t){this._map=t,this._container||this._initLayout();var e=t.options.fadeAnimation;e&&o.DomUtil.setOpacity(this._container,0),t._panes.popupPane.appendChild(this._container),t.on(this._getEvents(),this),this.update(),e&&o.DomUtil.setOpacity(this._container,1),this.fire("open"),t.fire("popupopen",{popup:this}),this._source&&this._source.fire("popupopen",{popup:this})},addTo:function(t){return t.addLayer(this),this},openOn:function(t){return t.openPopup(this),this},onRemove:function(t){t._panes.popupPane.removeChild(this._container),o.Util.falseFn(this._container.offsetWidth),t.off(this._getEvents(),this),t.options.fadeAnimation&&o.DomUtil.setOpacity(this._container,0),this._map=null,this.fire("close"),t.fire("popupclose",{popup:this}),this._source&&this._source.fire("popupclose",{popup:this})},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=o.latLng(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},_getEvents:function(){var t={viewreset:this._updatePosition};return this._animated&&(t.zoomanim=this._zoomAnimation),("closeOnClick"in this.options?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this._close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var t,e="leaflet-popup",i=e+" "+this.options.className+" leaflet-zoom-"+(this._animated?"animated":"hide"),n=this._container=o.DomUtil.create("div",i);this.options.closeButton&&(t=this._closeButton=o.DomUtil.create("a",e+"-close-button",n),t.href="#close",t.innerHTML="&#215;",o.DomEvent.disableClickPropagation(t),o.DomEvent.on(t,"click",this._onCloseButtonClick,this));var s=this._wrapper=o.DomUtil.create("div",e+"-content-wrapper",n);o.DomEvent.disableClickPropagation(s),this._contentNode=o.DomUtil.create("div",e+"-content",s),o.DomEvent.disableScrollPropagation(this._contentNode),o.DomEvent.on(s,"contextmenu",o.DomEvent.stopPropagation),this._tipContainer=o.DomUtil.create("div",e+"-tip-container",n),this._tip=o.DomUtil.create("div",e+"-tip",this._tipContainer)},_updateContent:function(){if(this._content){if("string"==typeof this._content)this._contentNode.innerHTML=this._content;else{for(;this._contentNode.hasChildNodes();)this._contentNode.removeChild(this._contentNode.firstChild);this._contentNode.appendChild(this._content)}this.fire("contentupdate")}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var n=t.offsetHeight,s=this.options.maxHeight,a="leaflet-popup-scrolled";s&&n>s?(e.height=s+"px",o.DomUtil.addClass(t,a)):o.DomUtil.removeClass(t,a),this._containerWidth=this._container.offsetWidth},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=this._animated,i=o.point(this.options.offset);e&&o.DomUtil.setPosition(this._container,t),this._containerBottom=-i.y-(e?0:t.y),this._containerLeft=-Math.round(this._containerWidth/2)+i.x+(e?0:t.x),this._container.style.bottom=this._containerBottom+"px",this._container.style.left=this._containerLeft+"px"}},_zoomAnimation:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);o.DomUtil.setPosition(this._container,e)},_adjustPan:function(){if(this.options.autoPan){var t=this._map,e=this._container.offsetHeight,i=this._containerWidth,n=new o.Point(this._containerLeft,-e-this._containerBottom);this._animated&&n._add(o.DomUtil.getPosition(this._container));var s=t.layerPointToContainerPoint(n),a=o.point(this.options.autoPanPadding),r=o.point(this.options.autoPanPaddingTopLeft||a),h=o.point(this.options.autoPanPaddingBottomRight||a),l=t.getSize(),u=0,c=0;s.x+i+h.x>l.x&&(u=s.x+i-l.x+h.x),s.x-u-r.x<0&&(u=s.x-r.x),s.y+e+h.y>l.y&&(c=s.y+e-l.y+h.y),s.y-c-r.y<0&&(c=s.y-r.y),(u||c)&&t.fire("autopanstart").panBy([u,c])}},_onCloseButtonClick:function(t){this._close(),o.DomEvent.stop(t)}}),o.popup=function(t,e){return new o.Popup(t,e)},o.Map.include({openPopup:function(t,e,i){if(this.closePopup(),!(t instanceof o.Popup)){var n=t;t=new o.Popup(i).setLatLng(e).setContent(n)}return t._isOpen=!0,this._popup=t,this.addLayer(t)},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&(this.removeLayer(t),t._isOpen=!1),this}}),o.Marker.include({openPopup:function(){return this._popup&&this._map&&!this._map.hasLayer(this._popup)&&(this._popup.setLatLng(this._latlng),this._map.openPopup(this._popup)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(){return this._popup&&(this._popup._isOpen?this.closePopup():this.openPopup()),this},bindPopup:function(t,e){var i=o.point(this.options.icon.options.popupAnchor||[0,0]);return i=i.add(o.Popup.prototype.options.offset),e&&e.offset&&(i=i.add(e.offset)),e=o.extend({offset:i},e),this._popupHandlersAdded||(this.on("click",this.togglePopup,this).on("remove",this.closePopup,this).on("move",this._movePopup,this),this._popupHandlersAdded=!0),t instanceof o.Popup?(o.setOptions(t,e),this._popup=t):this._popup=new o.Popup(e,this).setContent(t),this},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.togglePopup,this).off("remove",this.closePopup,this).off("move",this._movePopup,this),this._popupHandlersAdded=!1),this},getPopup:function(){return this._popup},_movePopup:function(t){this._popup.setLatLng(t.latlng)}}),o.LayerGroup=o.Class.extend({initialize:function(t){this._layers={};var e,i;if(t)for(e=0,i=t.length;i>e;e++)this.addLayer(t[e])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return t?t in this._layers||this.getLayerId(t)in this._layers:!1},clearLayers:function(){return this.eachLayer(this.removeLayer,this),this},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)i=this._layers[e],i[t]&&i[t].apply(i,n);return this},onAdd:function(t){this._map=t,this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t),this._map=null},addTo:function(t){return t.addLayer(this),this},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];for(var e in this._layers)t.push(this._layers[e]);return t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return o.stamp(t)}}),o.layerGroup=function(t){return new o.LayerGroup(t)},o.FeatureGroup=o.LayerGroup.extend({includes:o.Mixin.Events,statics:{EVENTS:"click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose"},addLayer:function(t){return this.hasLayer(t)?this:("on"in t&&t.on(o.FeatureGroup.EVENTS,this._propagateEvent,this),o.LayerGroup.prototype.addLayer.call(this,t),this._popupContent&&t.bindPopup&&t.bindPopup(this._popupContent,this._popupOptions),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.off(o.FeatureGroup.EVENTS,this._propagateEvent,this),o.LayerGroup.prototype.removeLayer.call(this,t),this._popupContent&&this.invoke("unbindPopup"),this.fire("layerremove",{layer:t})):this},bindPopup:function(t,e){return this._popupContent=t,this._popupOptions=e,this.invoke("bindPopup",t,e)},openPopup:function(t){for(var e in this._layers){this._layers[e].openPopup(t);break}return this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new o.LatLngBounds;return this.eachLayer(function(e){t.extend(e instanceof o.Marker?e.getLatLng():e.getBounds())}),t},_propagateEvent:function(t){t=o.extend({layer:t.target,target:this},t),this.fire(t.type,t)}}),o.featureGroup=function(t){return new o.FeatureGroup(t)},o.Path=o.Class.extend({includes:[o.Mixin.Events],statics:{CLIP_PADDING:function(){var e=o.Browser.mobile?1280:2e3,i=(e/Math.max(t.outerWidth,t.outerHeight)-1)/2;return Math.max(0,Math.min(.5,i))}()},options:{stroke:!0,color:"#0033ff",dashArray:null,lineCap:null,lineJoin:null,weight:5,opacity:.5,fill:!1,fillColor:null,fillOpacity:.2,clickable:!0},initialize:function(t){o.setOptions(this,t)},onAdd:function(t){this._map=t,this._container||(this._initElements(),this._initEvents()),this.projectLatlngs(),this._updatePath(),this._container&&this._map._pathRoot.appendChild(this._container),this.fire("add"),t.on({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){t._pathRoot.removeChild(this._container),this.fire("remove"),this._map=null,o.Browser.vml&&(this._container=null,this._stroke=null,this._fill=null),t.off({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},projectLatlngs:function(){},setStyle:function(t){return o.setOptions(this,t),this._container&&this._updateStyle(),this},redraw:function(){return this._map&&(this.projectLatlngs(),this._updatePath()),this}}),o.Map.include({_updatePathViewport:function(){var t=o.Path.CLIP_PADDING,e=this.getSize(),i=o.DomUtil.getPosition(this._mapPane),n=i.multiplyBy(-1)._subtract(e.multiplyBy(t)._round()),s=n.add(e.multiplyBy(1+2*t)._round());this._pathViewport=new o.Bounds(n,s)}}),o.Path.SVG_NS="http://www.w3.org/2000/svg",o.Browser.svg=!(!e.createElementNS||!e.createElementNS(o.Path.SVG_NS,"svg").createSVGRect),o.Path=o.Path.extend({statics:{SVG:o.Browser.svg},bringToFront:function(){var t=this._map._pathRoot,e=this._container;return e&&t.lastChild!==e&&t.appendChild(e),this},bringToBack:function(){var t=this._map._pathRoot,e=this._container,i=t.firstChild;return e&&i!==e&&t.insertBefore(e,i),this},getPathString:function(){},_createElement:function(t){return e.createElementNS(o.Path.SVG_NS,t)},_initElements:function(){this._map._initPathRoot(),this._initPath(),this._initStyle()},_initPath:function(){this._container=this._createElement("g"),this._path=this._createElement("path"),this.options.className&&o.DomUtil.addClass(this._path,this.options.className),this._container.appendChild(this._path)},_initStyle:function(){this.options.stroke&&(this._path.setAttribute("stroke-linejoin","round"),this._path.setAttribute("stroke-linecap","round")),this.options.fill&&this._path.setAttribute("fill-rule","evenodd"),this.options.pointerEvents&&this._path.setAttribute("pointer-events",this.options.pointerEvents),this.options.clickable||this.options.pointerEvents||this._path.setAttribute("pointer-events","none"),this._updateStyle()},_updateStyle:function(){this.options.stroke?(this._path.setAttribute("stroke",this.options.color),this._path.setAttribute("stroke-opacity",this.options.opacity),this._path.setAttribute("stroke-width",this.options.weight),this.options.dashArray?this._path.setAttribute("stroke-dasharray",this.options.dashArray):this._path.removeAttribute("stroke-dasharray"),this.options.lineCap&&this._path.setAttribute("stroke-linecap",this.options.lineCap),this.options.lineJoin&&this._path.setAttribute("stroke-linejoin",this.options.lineJoin)):this._path.setAttribute("stroke","none"),this.options.fill?(this._path.setAttribute("fill",this.options.fillColor||this.options.color),this._path.setAttribute("fill-opacity",this.options.fillOpacity)):this._path.setAttribute("fill","none")},_updatePath:function(){var t=this.getPathString();t||(t="M0 0"),this._path.setAttribute("d",t)},_initEvents:function(){if(this.options.clickable){(o.Browser.svg||!o.Browser.vml)&&o.DomUtil.addClass(this._path,"leaflet-clickable"),o.DomEvent.on(this._container,"click",this._onMouseClick,this);for(var t=["dblclick","mousedown","mouseover","mouseout","mousemove","contextmenu"],e=0;e<t.length;e++)o.DomEvent.on(this._container,t[e],this._fireMouseEvent,this)}},_onMouseClick:function(t){this._map.dragging&&this._map.dragging.moved()||this._fireMouseEvent(t)},_fireMouseEvent:function(t){if(this.hasEventListeners(t.type)){var e=this._map,i=e.mouseEventToContainerPoint(t),n=e.containerPointToLayerPoint(i),s=e.layerPointToLatLng(n);this.fire(t.type,{latlng:s,layerPoint:n,containerPoint:i,originalEvent:t}),"contextmenu"===t.type&&o.DomEvent.preventDefault(t),"mousemove"!==t.type&&o.DomEvent.stopPropagation(t)}}}),o.Map.include({_initPathRoot:function(){this._pathRoot||(this._pathRoot=o.Path.prototype._createElement("svg"),this._panes.overlayPane.appendChild(this._pathRoot),
this.options.zoomAnimation&&o.Browser.any3d?(o.DomUtil.addClass(this._pathRoot,"leaflet-zoom-animated"),this.on({zoomanim:this._animatePathZoom,zoomend:this._endPathZoom})):o.DomUtil.addClass(this._pathRoot,"leaflet-zoom-hide"),this.on("moveend",this._updateSvgViewport),this._updateSvgViewport())},_animatePathZoom:function(t){var e=this.getZoomScale(t.zoom),i=this._getCenterOffset(t.center)._multiplyBy(-e)._add(this._pathViewport.min);this._pathRoot.style[o.DomUtil.TRANSFORM]=o.DomUtil.getTranslateString(i)+" scale("+e+") ",this._pathZooming=!0},_endPathZoom:function(){this._pathZooming=!1},_updateSvgViewport:function(){if(!this._pathZooming){this._updatePathViewport();var t=this._pathViewport,e=t.min,i=t.max,n=i.x-e.x,s=i.y-e.y,a=this._pathRoot,r=this._panes.overlayPane;o.Browser.mobileWebkit&&r.removeChild(a),o.DomUtil.setPosition(a,e),a.setAttribute("width",n),a.setAttribute("height",s),a.setAttribute("viewBox",[e.x,e.y,n,s].join(" ")),o.Browser.mobileWebkit&&r.appendChild(a)}}}),o.Path.include({bindPopup:function(t,e){return t instanceof o.Popup?this._popup=t:((!this._popup||e)&&(this._popup=new o.Popup(e,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on("click",this._openPopup,this).on("remove",this.closePopup,this),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this._openPopup).off("remove",this.closePopup),this._popupHandlersAdded=!1),this},openPopup:function(t){return this._popup&&(t=t||this._latlng||this._latlngs[Math.floor(this._latlngs.length/2)],this._openPopup({latlng:t})),this},closePopup:function(){return this._popup&&this._popup._close(),this},_openPopup:function(t){this._popup.setLatLng(t.latlng),this._map.openPopup(this._popup)}}),o.Browser.vml=!o.Browser.svg&&function(){try{var t=e.createElement("div");t.innerHTML='<v:shape adj="1"/>';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(n){return!1}}(),o.Path=o.Browser.svg||!o.Browser.vml?o.Path:o.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{return e.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return e.createElement("<lvml:"+t+' class="lvml">')}}catch(t){return function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var t=this._container=this._createElement("shape");o.DomUtil.addClass(t,"leaflet-vml-shape"+(this.options.className?" "+this.options.className:"")),this.options.clickable&&o.DomUtil.addClass(t,"leaflet-clickable"),t.coordsize="1 1",this._path=this._createElement("path"),t.appendChild(this._path),this._map._pathRoot.appendChild(t)},_initStyle:function(){this._updateStyle()},_updateStyle:function(){var t=this._stroke,e=this._fill,i=this.options,n=this._container;n.stroked=i.stroke,n.filled=i.fill,i.stroke?(t||(t=this._stroke=this._createElement("stroke"),t.endcap="round",n.appendChild(t)),t.weight=i.weight+"px",t.color=i.color,t.opacity=i.opacity,i.dashArray?t.dashStyle=o.Util.isArray(i.dashArray)?i.dashArray.join(" "):i.dashArray.replace(/( *, *)/g," "):t.dashStyle="",i.lineCap&&(t.endcap=i.lineCap.replace("butt","flat")),i.lineJoin&&(t.joinstyle=i.lineJoin)):t&&(n.removeChild(t),this._stroke=null),i.fill?(e||(e=this._fill=this._createElement("fill"),n.appendChild(e)),e.color=i.fillColor||i.color,e.opacity=i.fillOpacity):e&&(n.removeChild(e),this._fill=null)},_updatePath:function(){var t=this._container.style;t.display="none",this._path.v=this.getPathString()+" ",t.display=""}}),o.Map.include(o.Browser.svg||!o.Browser.vml?{}:{_initPathRoot:function(){if(!this._pathRoot){var t=this._pathRoot=e.createElement("div");t.className="leaflet-vml-container",this._panes.overlayPane.appendChild(t),this.on("moveend",this._updatePathViewport),this._updatePathViewport()}}}),o.Browser.canvas=function(){return!!e.createElement("canvas").getContext}(),o.Path=o.Path.SVG&&!t.L_PREFER_CANVAS||!o.Browser.canvas?o.Path:o.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){return this._map&&(this.projectLatlngs(),this._requestUpdate()),this},setStyle:function(t){return o.setOptions(this,t),this._map&&(this._updateStyle(),this._requestUpdate()),this},onRemove:function(t){t.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this),this.options.clickable&&(this._map.off("click",this._onClick,this),this._map.off("mousemove",this._onMouseMove,this)),this._requestUpdate(),this.fire("remove"),this._map=null},_requestUpdate:function(){this._map&&!o.Path._updateRequest&&(o.Path._updateRequest=o.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){o.Path._updateRequest=null,this.fire("moveend")},_initElements:function(){this._map._initPathRoot(),this._ctx=this._map._canvasCtx},_updateStyle:function(){var t=this.options;t.stroke&&(this._ctx.lineWidth=t.weight,this._ctx.strokeStyle=t.color),t.fill&&(this._ctx.fillStyle=t.fillColor||t.color)},_drawPath:function(){var t,e,i,n,s,a;for(this._ctx.beginPath(),t=0,i=this._parts.length;i>t;t++){for(e=0,n=this._parts[t].length;n>e;e++)s=this._parts[t][e],a=(0===e?"move":"line")+"To",this._ctx[a](s.x,s.y);this instanceof o.Polygon&&this._ctx.closePath()}},_checkIfEmpty:function(){return!this._parts.length},_updatePath:function(){if(!this._checkIfEmpty()){var t=this._ctx,e=this.options;this._drawPath(),t.save(),this._updateStyle(),e.fill&&(t.globalAlpha=e.fillOpacity,t.fill()),e.stroke&&(t.globalAlpha=e.opacity,t.stroke()),t.restore()}},_initEvents:function(){this.options.clickable&&(this._map.on("mousemove",this._onMouseMove,this),this._map.on("click",this._onClick,this))},_onClick:function(t){this._containsPoint(t.layerPoint)&&this.fire("click",t)},_onMouseMove:function(t){this._map&&!this._map._animatingZoom&&(this._containsPoint(t.layerPoint)?(this._ctx.canvas.style.cursor="pointer",this._mouseInside=!0,this.fire("mouseover",t)):this._mouseInside&&(this._ctx.canvas.style.cursor="",this._mouseInside=!1,this.fire("mouseout",t)))}}),o.Map.include(o.Path.SVG&&!t.L_PREFER_CANVAS||!o.Browser.canvas?{}:{_initPathRoot:function(){var t,i=this._pathRoot;i||(i=this._pathRoot=e.createElement("canvas"),i.style.position="absolute",t=this._canvasCtx=i.getContext("2d"),t.lineCap="round",t.lineJoin="round",this._panes.overlayPane.appendChild(i),this.options.zoomAnimation&&(this._pathRoot.className="leaflet-zoom-animated",this.on("zoomanim",this._animatePathZoom),this.on("zoomend",this._endPathZoom)),this.on("moveend",this._updateCanvasViewport),this._updateCanvasViewport())},_updateCanvasViewport:function(){if(!this._pathZooming){this._updatePathViewport();var t=this._pathViewport,e=t.min,i=t.max.subtract(e),n=this._pathRoot;o.DomUtil.setPosition(n,e),n.width=i.x,n.height=i.y,n.getContext("2d").translate(-e.x,-e.y)}}}),o.LineUtil={simplify:function(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=this._reducePoints(t,i),t=this._simplifyDP(t,i)},pointToSegmentDistance:function(t,e,i){return Math.sqrt(this._sqClosestPointOnSegment(t,e,i,!0))},closestPointOnSegment:function(t,e,i){return this._sqClosestPointOnSegment(t,e,i)},_simplifyDP:function(t,e){var n=t.length,o=typeof Uint8Array!=i+""?Uint8Array:Array,s=new o(n);s[0]=s[n-1]=1,this._simplifyDPStep(t,s,e,0,n-1);var a,r=[];for(a=0;n>a;a++)s[a]&&r.push(t[a]);return r},_simplifyDPStep:function(t,e,i,n,o){var s,a,r,h=0;for(a=n+1;o-1>=a;a++)r=this._sqClosestPointOnSegment(t[a],t[n],t[o],!0),r>h&&(s=a,h=r);h>i&&(e[s]=1,this._simplifyDPStep(t,e,i,n,s),this._simplifyDPStep(t,e,i,s,o))},_reducePoints:function(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;s>n;n++)this._sqDist(t[n],t[o])>e&&(i.push(t[n]),o=n);return s-1>o&&i.push(t[s-1]),i},clipSegment:function(t,e,i,n){var o,s,a,r=n?this._lastCode:this._getBitCode(t,i),h=this._getBitCode(e,i);for(this._lastCode=h;;){if(!(r|h))return[t,e];if(r&h)return!1;o=r||h,s=this._getEdgeIntersection(t,e,o,i),a=this._getBitCode(s,i),o===r?(t=s,r=a):(e=s,h=a)}},_getEdgeIntersection:function(t,e,i,n){var s=e.x-t.x,a=e.y-t.y,r=n.min,h=n.max;return 8&i?new o.Point(t.x+s*(h.y-t.y)/a,h.y):4&i?new o.Point(t.x+s*(r.y-t.y)/a,r.y):2&i?new o.Point(h.x,t.y+a*(h.x-t.x)/s):1&i?new o.Point(r.x,t.y+a*(r.x-t.x)/s):void 0},_getBitCode:function(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i},_sqDist:function(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n},_sqClosestPointOnSegment:function(t,e,i,n){var s,a=e.x,r=e.y,h=i.x-a,l=i.y-r,u=h*h+l*l;return u>0&&(s=((t.x-a)*h+(t.y-r)*l)/u,s>1?(a=i.x,r=i.y):s>0&&(a+=h*s,r+=l*s)),h=t.x-a,l=t.y-r,n?h*h+l*l:new o.Point(a,r)}},o.Polyline=o.Path.extend({initialize:function(t,e){o.Path.prototype.initialize.call(this,e),this._latlngs=this._convertLatLngs(t)},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var t=0,e=this._latlngs.length;e>t;t++)this._originalPoints[t]=this._map.latLngToLayerPoint(this._latlngs[t])},getPathString:function(){for(var t=0,e=this._parts.length,i="";e>t;t++)i+=this._getPathPartStr(this._parts[t]);return i},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._latlngs=this._convertLatLngs(t),this.redraw()},addLatLng:function(t){return this._latlngs.push(o.latLng(t)),this.redraw()},spliceLatLngs:function(){var t=[].splice.apply(this._latlngs,arguments);return this._convertLatLngs(this._latlngs,!0),this.redraw(),t},closestLayerPoint:function(t){for(var e,i,n=1/0,s=this._parts,a=null,r=0,h=s.length;h>r;r++)for(var l=s[r],u=1,c=l.length;c>u;u++){e=l[u-1],i=l[u];var d=o.LineUtil._sqClosestPointOnSegment(t,e,i,!0);n>d&&(n=d,a=o.LineUtil._sqClosestPointOnSegment(t,e,i))}return a&&(a.distance=Math.sqrt(n)),a},getBounds:function(){return new o.LatLngBounds(this.getLatLngs())},_convertLatLngs:function(t,e){var i,n,s=e?t:[];for(i=0,n=t.length;n>i;i++){if(o.Util.isArray(t[i])&&"number"!=typeof t[i][0])return;s[i]=o.latLng(t[i])}return s},_initEvents:function(){o.Path.prototype._initEvents.call(this)},_getPathPartStr:function(t){for(var e,i=o.Path.VML,n=0,s=t.length,a="";s>n;n++)e=t[n],i&&e._round(),a+=(n?"L":"M")+e.x+" "+e.y;return a},_clipPoints:function(){var t,e,i,n=this._originalPoints,s=n.length;if(this.options.noClip)return void(this._parts=[n]);this._parts=[];var a=this._parts,r=this._map._pathViewport,h=o.LineUtil;for(t=0,e=0;s-1>t;t++)i=h.clipSegment(n[t],n[t+1],r,t),i&&(a[e]=a[e]||[],a[e].push(i[0]),(i[1]!==n[t+1]||t===s-2)&&(a[e].push(i[1]),e++))},_simplifyPoints:function(){for(var t=this._parts,e=o.LineUtil,i=0,n=t.length;n>i;i++)t[i]=e.simplify(t[i],this.options.smoothFactor)},_updatePath:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),o.Path.prototype._updatePath.call(this))}}),o.polyline=function(t,e){return new o.Polyline(t,e)},o.PolyUtil={},o.PolyUtil.clipPolygon=function(t,e){var i,n,s,a,r,h,l,u,c,d=[1,4,2,8],p=o.LineUtil;for(n=0,l=t.length;l>n;n++)t[n]._code=p._getBitCode(t[n],e);for(a=0;4>a;a++){for(u=d[a],i=[],n=0,l=t.length,s=l-1;l>n;s=n++)r=t[n],h=t[s],r._code&u?h._code&u||(c=p._getEdgeIntersection(h,r,u,e),c._code=p._getBitCode(c,e),i.push(c)):(h._code&u&&(c=p._getEdgeIntersection(h,r,u,e),c._code=p._getBitCode(c,e),i.push(c)),i.push(r));t=i}return t},o.Polygon=o.Polyline.extend({options:{fill:!0},initialize:function(t,e){o.Polyline.prototype.initialize.call(this,t,e),this._initWithHoles(t)},_initWithHoles:function(t){var e,i,n;if(t&&o.Util.isArray(t[0])&&"number"!=typeof t[0][0])for(this._latlngs=this._convertLatLngs(t[0]),this._holes=t.slice(1),e=0,i=this._holes.length;i>e;e++)n=this._holes[e]=this._convertLatLngs(this._holes[e]),n[0].equals(n[n.length-1])&&n.pop();t=this._latlngs,t.length>=2&&t[0].equals(t[t.length-1])&&t.pop()},projectLatlngs:function(){if(o.Polyline.prototype.projectLatlngs.call(this),this._holePoints=[],this._holes){var t,e,i,n;for(t=0,i=this._holes.length;i>t;t++)for(this._holePoints[t]=[],e=0,n=this._holes[t].length;n>e;e++)this._holePoints[t][e]=this._map.latLngToLayerPoint(this._holes[t][e])}},setLatLngs:function(t){return t&&o.Util.isArray(t[0])&&"number"!=typeof t[0][0]?(this._initWithHoles(t),this.redraw()):o.Polyline.prototype.setLatLngs.call(this,t)},_clipPoints:function(){var t=this._originalPoints,e=[];if(this._parts=[t].concat(this._holePoints),!this.options.noClip){for(var i=0,n=this._parts.length;n>i;i++){var s=o.PolyUtil.clipPolygon(this._parts[i],this._map._pathViewport);s.length&&e.push(s)}this._parts=e}},_getPathPartStr:function(t){var e=o.Polyline.prototype._getPathPartStr.call(this,t);return e+(o.Browser.svg?"z":"x")}}),o.polygon=function(t,e){return new o.Polygon(t,e)},function(){function t(t){return o.FeatureGroup.extend({initialize:function(t,e){this._layers={},this._options=e,this.setLatLngs(t)},setLatLngs:function(e){var i=0,n=e.length;for(this.eachLayer(function(t){n>i?t.setLatLngs(e[i++]):this.removeLayer(t)},this);n>i;)this.addLayer(new t(e[i++],this._options));return this},getLatLngs:function(){var t=[];return this.eachLayer(function(e){t.push(e.getLatLngs())}),t}})}o.MultiPolyline=t(o.Polyline),o.MultiPolygon=t(o.Polygon),o.multiPolyline=function(t,e){return new o.MultiPolyline(t,e)},o.multiPolygon=function(t,e){return new o.MultiPolygon(t,e)}}(),o.Rectangle=o.Polygon.extend({initialize:function(t,e){o.Polygon.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=o.latLngBounds(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}}),o.rectangle=function(t,e){return new o.Rectangle(t,e)},o.Circle=o.Path.extend({initialize:function(t,e,i){o.Path.prototype.initialize.call(this,i),this._latlng=o.latLng(t),this._mRadius=e},options:{fill:!0},setLatLng:function(t){return this._latlng=o.latLng(t),this.redraw()},setRadius:function(t){return this._mRadius=t,this.redraw()},projectLatlngs:function(){var t=this._getLngRadius(),e=this._latlng,i=this._map.latLngToLayerPoint([e.lat,e.lng-t]);this._point=this._map.latLngToLayerPoint(e),this._radius=Math.max(this._point.x-i.x,1)},getBounds:function(){var t=this._getLngRadius(),e=this._mRadius/40075017*360,i=this._latlng;return new o.LatLngBounds([i.lat-e,i.lng-t],[i.lat+e,i.lng+t])},getLatLng:function(){return this._latlng},getPathString:function(){var t=this._point,e=this._radius;return this._checkIfEmpty()?"":o.Browser.svg?"M"+t.x+","+(t.y-e)+"A"+e+","+e+",0,1,1,"+(t.x-.1)+","+(t.y-e)+" z":(t._round(),e=Math.round(e),"AL "+t.x+","+t.y+" "+e+","+e+" 0,23592600")},getRadius:function(){return this._mRadius},_getLatRadius:function(){return this._mRadius/40075017*360},_getLngRadius:function(){return this._getLatRadius()/Math.cos(o.LatLng.DEG_TO_RAD*this._latlng.lat)},_checkIfEmpty:function(){if(!this._map)return!1;var t=this._map._pathViewport,e=this._radius,i=this._point;return i.x-e>t.max.x||i.y-e>t.max.y||i.x+e<t.min.x||i.y+e<t.min.y}}),o.circle=function(t,e,i){return new o.Circle(t,e,i)},o.CircleMarker=o.Circle.extend({options:{radius:10,weight:2},initialize:function(t,e){o.Circle.prototype.initialize.call(this,t,null,e),this._radius=this.options.radius},projectLatlngs:function(){this._point=this._map.latLngToLayerPoint(this._latlng)},_updateStyle:function(){o.Circle.prototype._updateStyle.call(this),this.setRadius(this.options.radius)},setLatLng:function(t){return o.Circle.prototype.setLatLng.call(this,t),this._popup&&this._popup._isOpen&&this._popup.setLatLng(t),this},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius}}),o.circleMarker=function(t,e){return new o.CircleMarker(t,e)},o.Polyline.include(o.Path.CANVAS?{_containsPoint:function(t,e){var i,n,s,a,r,h,l,u=this.options.weight/2;for(o.Browser.touch&&(u+=10),i=0,a=this._parts.length;a>i;i++)for(l=this._parts[i],n=0,r=l.length,s=r-1;r>n;s=n++)if((e||0!==n)&&(h=o.LineUtil.pointToSegmentDistance(t,l[s],l[n]),u>=h))return!0;return!1}}:{}),o.Polygon.include(o.Path.CANVAS?{_containsPoint:function(t){var e,i,n,s,a,r,h,l,u=!1;if(o.Polyline.prototype._containsPoint.call(this,t,!0))return!0;for(s=0,h=this._parts.length;h>s;s++)for(e=this._parts[s],a=0,l=e.length,r=l-1;l>a;r=a++)i=e[a],n=e[r],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(u=!u);return u}}:{}),o.Circle.include(o.Path.CANVAS?{_drawPath:function(){var t=this._point;this._ctx.beginPath(),this._ctx.arc(t.x,t.y,this._radius,0,2*Math.PI,!1)},_containsPoint:function(t){var e=this._point,i=this.options.stroke?this.options.weight/2:0;return t.distanceTo(e)<=this._radius+i}}:{}),o.CircleMarker.include(o.Path.CANVAS?{_updateStyle:function(){o.Path.prototype._updateStyle.call(this)}}:{}),o.GeoJSON=o.FeatureGroup.extend({initialize:function(t,e){o.setOptions(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,s=o.Util.isArray(t)?t:t.features;if(s){for(e=0,i=s.length;i>e;e++)n=s[e],(n.geometries||n.geometry||n.features||n.coordinates)&&this.addData(s[e]);return this}var a=this.options;if(!a.filter||a.filter(t)){var r=o.GeoJSON.geometryToLayer(t,a.pointToLayer,a.coordsToLatLng,a);return r.feature=o.GeoJSON.asFeature(t),r.defaultOptions=r.options,this.resetStyle(r),a.onEachFeature&&a.onEachFeature(t,r),this.addLayer(r)}},resetStyle:function(t){var e=this.options.style;e&&(o.Util.extend(t.options,t.defaultOptions),this._setLayerStyle(t,e))},setStyle:function(t){this.eachLayer(function(e){this._setLayerStyle(e,t)},this)},_setLayerStyle:function(t,e){"function"==typeof e&&(e=e(t.feature)),t.setStyle&&t.setStyle(e)}}),o.extend(o.GeoJSON,{geometryToLayer:function(t,e,i,n){var s,a,r,h,l="Feature"===t.type?t.geometry:t,u=l.coordinates,c=[];switch(i=i||this.coordsToLatLng,l.type){case"Point":return s=i(u),e?e(t,s):new o.Marker(s);case"MultiPoint":for(r=0,h=u.length;h>r;r++)s=i(u[r]),c.push(e?e(t,s):new o.Marker(s));return new o.FeatureGroup(c);case"LineString":return a=this.coordsToLatLngs(u,0,i),new o.Polyline(a,n);case"Polygon":if(2===u.length&&!u[1].length)throw new Error("Invalid GeoJSON object.");return a=this.coordsToLatLngs(u,1,i),new o.Polygon(a,n);case"MultiLineString":return a=this.coordsToLatLngs(u,1,i),new o.MultiPolyline(a,n);case"MultiPolygon":return a=this.coordsToLatLngs(u,2,i),new o.MultiPolygon(a,n);case"GeometryCollection":for(r=0,h=l.geometries.length;h>r;r++)c.push(this.geometryToLayer({geometry:l.geometries[r],type:"Feature",properties:t.properties},e,i,n));return new o.FeatureGroup(c);default:throw new Error("Invalid GeoJSON object.")}},coordsToLatLng:function(t){return new o.LatLng(t[1],t[0],t[2])},coordsToLatLngs:function(t,e,i){var n,o,s,a=[];for(o=0,s=t.length;s>o;o++)n=e?this.coordsToLatLngs(t[o],e-1,i):(i||this.coordsToLatLng)(t[o]),a.push(n);return a},latLngToCoords:function(t){var e=[t.lng,t.lat];return t.alt!==i&&e.push(t.alt),e},latLngsToCoords:function(t){for(var e=[],i=0,n=t.length;n>i;i++)e.push(o.GeoJSON.latLngToCoords(t[i]));return e},getFeature:function(t,e){return t.feature?o.extend({},t.feature,{geometry:e}):o.GeoJSON.asFeature(e)},asFeature:function(t){return"Feature"===t.type?t:{type:"Feature",properties:{},geometry:t}}});var a={toGeoJSON:function(){return o.GeoJSON.getFeature(this,{type:"Point",coordinates:o.GeoJSON.latLngToCoords(this.getLatLng())})}};o.Marker.include(a),o.Circle.include(a),o.CircleMarker.include(a),o.Polyline.include({toGeoJSON:function(){return o.GeoJSON.getFeature(this,{type:"LineString",coordinates:o.GeoJSON.latLngsToCoords(this.getLatLngs())})}}),o.Polygon.include({toGeoJSON:function(){var t,e,i,n=[o.GeoJSON.latLngsToCoords(this.getLatLngs())];if(n[0].push(n[0][0]),this._holes)for(t=0,e=this._holes.length;e>t;t++)i=o.GeoJSON.latLngsToCoords(this._holes[t]),i.push(i[0]),n.push(i);return o.GeoJSON.getFeature(this,{type:"Polygon",coordinates:n})}}),function(){function t(t){return function(){var e=[];return this.eachLayer(function(t){e.push(t.toGeoJSON().geometry.coordinates)}),o.GeoJSON.getFeature(this,{type:t,coordinates:e})}}o.MultiPolyline.include({toGeoJSON:t("MultiLineString")}),o.MultiPolygon.include({toGeoJSON:t("MultiPolygon")}),o.LayerGroup.include({toGeoJSON:function(){var e,i=this.feature&&this.feature.geometry,n=[];if(i&&"MultiPoint"===i.type)return t("MultiPoint").call(this);var s=i&&"GeometryCollection"===i.type;return this.eachLayer(function(t){t.toGeoJSON&&(e=t.toGeoJSON(),n.push(s?e.geometry:o.GeoJSON.asFeature(e)))}),s?o.GeoJSON.getFeature(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}})}(),o.geoJson=function(t,e){return new o.GeoJSON(t,e)},o.DomEvent={addListener:function(t,e,i,n){var s,a,r,h=o.stamp(i),l="_leaflet_"+e+h;return t[l]?this:(s=function(e){return i.call(n||t,e||o.DomEvent._getEvent())},o.Browser.pointer&&0===e.indexOf("touch")?this.addPointerListener(t,e,s,h):(o.Browser.touch&&"dblclick"===e&&this.addDoubleTapListener&&this.addDoubleTapListener(t,s,h),"addEventListener"in t?"mousewheel"===e?(t.addEventListener("DOMMouseScroll",s,!1),t.addEventListener(e,s,!1)):"mouseenter"===e||"mouseleave"===e?(a=s,r="mouseenter"===e?"mouseover":"mouseout",s=function(e){return o.DomEvent._checkMouse(t,e)?a(e):void 0},t.addEventListener(r,s,!1)):"click"===e&&o.Browser.android?(a=s,s=function(t){return o.DomEvent._filterClick(t,a)},t.addEventListener(e,s,!1)):t.addEventListener(e,s,!1):"attachEvent"in t&&t.attachEvent("on"+e,s),t[l]=s,this))},removeListener:function(t,e,i){var n=o.stamp(i),s="_leaflet_"+e+n,a=t[s];return a?(o.Browser.pointer&&0===e.indexOf("touch")?this.removePointerListener(t,e,n):o.Browser.touch&&"dblclick"===e&&this.removeDoubleTapListener?this.removeDoubleTapListener(t,n):"removeEventListener"in t?"mousewheel"===e?(t.removeEventListener("DOMMouseScroll",a,!1),t.removeEventListener(e,a,!1)):"mouseenter"===e||"mouseleave"===e?t.removeEventListener("mouseenter"===e?"mouseover":"mouseout",a,!1):t.removeEventListener(e,a,!1):"detachEvent"in t&&t.detachEvent("on"+e,a),t[s]=null,this):this},stopPropagation:function(t){return t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,o.DomEvent._skipped(t),this},disableScrollPropagation:function(t){var e=o.DomEvent.stopPropagation;return o.DomEvent.on(t,"mousewheel",e).on(t,"MozMousePixelScroll",e)},disableClickPropagation:function(t){for(var e=o.DomEvent.stopPropagation,i=o.Draggable.START.length-1;i>=0;i--)o.DomEvent.on(t,o.Draggable.START[i],e);return o.DomEvent.on(t,"click",o.DomEvent._fakeStop).on(t,"dblclick",e)},preventDefault:function(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this},stop:function(t){return o.DomEvent.preventDefault(t).stopPropagation(t)},getMousePosition:function(t,e){if(!e)return new o.Point(t.clientX,t.clientY);var i=e.getBoundingClientRect();return new o.Point(t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop)},getWheelDelta:function(t){var e=0;return t.wheelDelta&&(e=t.wheelDelta/120),t.detail&&(e=-t.detail/3),e},_skipEvents:{},_fakeStop:function(t){o.DomEvent._skipEvents[t.type]=!0},_skipped:function(t){var e=this._skipEvents[t.type];return this._skipEvents[t.type]=!1,e},_checkMouse:function(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(n){return!1}return i!==t},_getEvent:function(){var e=t.event;if(!e)for(var i=arguments.callee.caller;i&&(e=i.arguments[0],!e||t.Event!==e.constructor);)i=i.caller;return e},_filterClick:function(t,e){var i=t.timeStamp||t.originalEvent.timeStamp,n=o.DomEvent._lastClick&&i-o.DomEvent._lastClick;return n&&n>100&&500>n||t.target._simulatedClick&&!t._simulated?void o.DomEvent.stop(t):(o.DomEvent._lastClick=i,e(t))}},o.DomEvent.on=o.DomEvent.addListener,o.DomEvent.off=o.DomEvent.removeListener,o.Draggable=o.Class.extend({includes:o.Mixin.Events,statics:{START:o.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"}},initialize:function(t,e){this._element=t,this._dragStartTarget=e||t},enable:function(){if(!this._enabled){for(var t=o.Draggable.START.length-1;t>=0;t--)o.DomEvent.on(this._dragStartTarget,o.Draggable.START[t],this._onDown,this);this._enabled=!0}},disable:function(){if(this._enabled){for(var t=o.Draggable.START.length-1;t>=0;t--)o.DomEvent.off(this._dragStartTarget,o.Draggable.START[t],this._onDown,this);this._enabled=!1,this._moved=!1}},_onDown:function(t){if(this._moved=!1,!(t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(o.DomEvent.stopPropagation(t),o.Draggable._disabled||(o.DomUtil.disableImageDrag(),o.DomUtil.disableTextSelection(),this._moving)))){var i=t.touches?t.touches[0]:t;this._startPoint=new o.Point(i.clientX,i.clientY),this._startPos=this._newPos=o.DomUtil.getPosition(this._element),o.DomEvent.on(e,o.Draggable.MOVE[t.type],this._onMove,this).on(e,o.Draggable.END[t.type],this._onUp,this)}},_onMove:function(t){if(t.touches&&t.touches.length>1)return void(this._moved=!0);var i=t.touches&&1===t.touches.length?t.touches[0]:t,n=new o.Point(i.clientX,i.clientY),s=n.subtract(this._startPoint);(s.x||s.y)&&(o.Browser.touch&&Math.abs(s.x)+Math.abs(s.y)<3||(o.DomEvent.preventDefault(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=o.DomUtil.getPosition(this._element).subtract(s),o.DomUtil.addClass(e.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,o.DomUtil.addClass(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(s),this._moving=!0,o.Util.cancelAnimFrame(this._animRequest),this._animRequest=o.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget)))},_updatePosition:function(){this.fire("predrag"),o.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(){o.DomUtil.removeClass(e.body,"leaflet-dragging"),this._lastTarget&&(o.DomUtil.removeClass(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null);for(var t in o.Draggable.MOVE)o.DomEvent.off(e,o.Draggable.MOVE[t],this._onMove).off(e,o.Draggable.END[t],this._onUp);o.DomUtil.enableImageDrag(),o.DomUtil.enableTextSelection(),this._moved&&this._moving&&(o.Util.cancelAnimFrame(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1}}),o.Handler=o.Class.extend({initialize:function(t){this._map=t},enable:function(){this._enabled||(this._enabled=!0,this.addHooks())},disable:function(){this._enabled&&(this._enabled=!1,this.removeHooks())},enabled:function(){return!!this._enabled}}),o.Map.mergeOptions({dragging:!0,inertia:!o.Browser.android23,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,inertiaThreshold:o.Browser.touch?32:18,easeLinearity:.25,worldCopyJump:!1}),o.Map.Drag=o.Handler.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new o.Draggable(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDrag,this),t.on("viewreset",this._onViewReset,this),t.whenReady(this._onViewReset,this))}this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){var t=this._map;t._panAnim&&t._panAnim.stop(),t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(){if(this._map.options.inertia){var t=this._lastTime=+new Date,e=this._lastPos=this._draggable._newPos;this._positions.push(e),this._times.push(t),t-this._times[0]>200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var t=this._map.getSize()._divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.project([0,180]).x},_onPreDrag:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,a=Math.abs(o+i)<Math.abs(s+i)?o:s;this._draggable._newPos.x=a},_onDragEnd:function(t){var e=this._map,i=e.options,n=+new Date-this._lastTime,s=!i.inertia||n>i.inertiaThreshold||!this._positions[0];if(e.fire("dragend",t),s)e.fire("moveend");else{var a=this._lastPos.subtract(this._positions[0]),r=(this._lastTime+n-this._times[0])/1e3,h=i.easeLinearity,l=a.multiplyBy(h/r),u=l.distanceTo([0,0]),c=Math.min(i.inertiaMaxSpeed,u),d=l.multiplyBy(c/u),p=c/(i.inertiaDeceleration*h),_=d.multiplyBy(-p/2).round();_.x&&_.y?(_=e._limitOffset(_,e.options.maxBounds),o.Util.requestAnimFrame(function(){e.panBy(_,{duration:p,easeLinearity:h,noMoveStart:!0})})):e.fire("moveend")}}}),o.Map.addInitHook("addHandler","dragging",o.Map.Drag),o.Map.mergeOptions({doubleClickZoom:!0}),o.Map.DoubleClickZoom=o.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom()+(t.originalEvent.shiftKey?-1:1);"center"===e.options.doubleClickZoom?e.setZoom(i):e.setZoomAround(t.containerPoint,i)}}),o.Map.addInitHook("addHandler","doubleClickZoom",o.Map.DoubleClickZoom),o.Map.mergeOptions({scrollWheelZoom:!0}),o.Map.ScrollWheelZoom=o.Handler.extend({addHooks:function(){o.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this),o.DomEvent.on(this._map._container,"MozMousePixelScroll",o.DomEvent.preventDefault),this._delta=0},removeHooks:function(){o.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll),o.DomEvent.off(this._map._container,"MozMousePixelScroll",o.DomEvent.preventDefault)},_onWheelScroll:function(t){var e=o.DomEvent.getWheelDelta(t);this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var i=Math.max(40-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(o.bind(this._performZoom,this),i),o.DomEvent.preventDefault(t),o.DomEvent.stopPropagation(t)},_performZoom:function(){var t=this._map,e=this._delta,i=t.getZoom();e=e>0?Math.ceil(e):Math.floor(e),e=Math.max(Math.min(e,4),-4),e=t._limitZoom(i+e)-i,this._delta=0,this._startTime=null,e&&("center"===t.options.scrollWheelZoom?t.setZoom(i+e):t.setZoomAround(this._lastMousePos,i+e))}}),o.Map.addInitHook("addHandler","scrollWheelZoom",o.Map.ScrollWheelZoom),o.extend(o.DomEvent,{_touchstart:o.Browser.msPointer?"MSPointerDown":o.Browser.pointer?"pointerdown":"touchstart",_touchend:o.Browser.msPointer?"MSPointerUp":o.Browser.pointer?"pointerup":"touchend",addDoubleTapListener:function(t,i,n){function s(t){var e;if(o.Browser.pointer?(_.push(t.pointerId),e=_.length):e=t.touches.length,!(e>1)){var i=Date.now(),n=i-(r||i);h=t.touches?t.touches[0]:t,l=n>0&&u>=n,r=i}}function a(t){if(o.Browser.pointer){var e=_.indexOf(t.pointerId);if(-1===e)return;_.splice(e,1)}if(l){if(o.Browser.pointer){var n,s={};for(var a in h)n=h[a],"function"==typeof n?s[a]=n.bind(h):s[a]=n;h=s}h.type="dblclick",i(h),r=null}}var r,h,l=!1,u=250,c="_leaflet_",d=this._touchstart,p=this._touchend,_=[];t[c+d+n]=s,t[c+p+n]=a;var m=o.Browser.pointer?e.documentElement:t;return t.addEventListener(d,s,!1),m.addEventListener(p,a,!1),o.Browser.pointer&&m.addEventListener(o.DomEvent.POINTER_CANCEL,a,!1),this},removeDoubleTapListener:function(t,i){var n="_leaflet_";return t.removeEventListener(this._touchstart,t[n+this._touchstart+i],!1),(o.Browser.pointer?e.documentElement:t).removeEventListener(this._touchend,t[n+this._touchend+i],!1),o.Browser.pointer&&e.documentElement.removeEventListener(o.DomEvent.POINTER_CANCEL,t[n+this._touchend+i],!1),this}}),o.extend(o.DomEvent,{POINTER_DOWN:o.Browser.msPointer?"MSPointerDown":"pointerdown",POINTER_MOVE:o.Browser.msPointer?"MSPointerMove":"pointermove",POINTER_UP:o.Browser.msPointer?"MSPointerUp":"pointerup",POINTER_CANCEL:o.Browser.msPointer?"MSPointerCancel":"pointercancel",_pointers:[],_pointerDocumentListener:!1,addPointerListener:function(t,e,i,n){switch(e){case"touchstart":return this.addPointerListenerStart(t,e,i,n);
case"touchend":return this.addPointerListenerEnd(t,e,i,n);case"touchmove":return this.addPointerListenerMove(t,e,i,n);default:throw"Unknown touch event type"}},addPointerListenerStart:function(t,i,n,s){var a="_leaflet_",r=this._pointers,h=function(t){o.DomEvent.preventDefault(t);for(var e=!1,i=0;i<r.length;i++)if(r[i].pointerId===t.pointerId){e=!0;break}e||r.push(t),t.touches=r.slice(),t.changedTouches=[t],n(t)};if(t[a+"touchstart"+s]=h,t.addEventListener(this.POINTER_DOWN,h,!1),!this._pointerDocumentListener){var l=function(t){for(var e=0;e<r.length;e++)if(r[e].pointerId===t.pointerId){r.splice(e,1);break}};e.documentElement.addEventListener(this.POINTER_UP,l,!1),e.documentElement.addEventListener(this.POINTER_CANCEL,l,!1),this._pointerDocumentListener=!0}return this},addPointerListenerMove:function(t,e,i,n){function o(t){if(t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&"mouse"!==t.pointerType||0!==t.buttons){for(var e=0;e<a.length;e++)if(a[e].pointerId===t.pointerId){a[e]=t;break}t.touches=a.slice(),t.changedTouches=[t],i(t)}}var s="_leaflet_",a=this._pointers;return t[s+"touchmove"+n]=o,t.addEventListener(this.POINTER_MOVE,o,!1),this},addPointerListenerEnd:function(t,e,i,n){var o="_leaflet_",s=this._pointers,a=function(t){for(var e=0;e<s.length;e++)if(s[e].pointerId===t.pointerId){s.splice(e,1);break}t.touches=s.slice(),t.changedTouches=[t],i(t)};return t[o+"touchend"+n]=a,t.addEventListener(this.POINTER_UP,a,!1),t.addEventListener(this.POINTER_CANCEL,a,!1),this},removePointerListener:function(t,e,i){var n="_leaflet_",o=t[n+e+i];switch(e){case"touchstart":t.removeEventListener(this.POINTER_DOWN,o,!1);break;case"touchmove":t.removeEventListener(this.POINTER_MOVE,o,!1);break;case"touchend":t.removeEventListener(this.POINTER_UP,o,!1),t.removeEventListener(this.POINTER_CANCEL,o,!1)}return this}}),o.Map.mergeOptions({touchZoom:o.Browser.touch&&!o.Browser.android23,bounceAtZoomLimits:!0}),o.Map.TouchZoom=o.Handler.extend({addHooks:function(){o.DomEvent.on(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){o.DomEvent.off(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var i=this._map;if(t.touches&&2===t.touches.length&&!i._animatingZoom&&!this._zooming){var n=i.mouseEventToLayerPoint(t.touches[0]),s=i.mouseEventToLayerPoint(t.touches[1]),a=i._getCenterLayerPoint();this._startCenter=n.add(s)._divideBy(2),this._startDist=n.distanceTo(s),this._moved=!1,this._zooming=!0,this._centerOffset=a.subtract(this._startCenter),i._panAnim&&i._panAnim.stop(),o.DomEvent.on(e,"touchmove",this._onTouchMove,this).on(e,"touchend",this._onTouchEnd,this),o.DomEvent.preventDefault(t)}},_onTouchMove:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&this._zooming){var i=e.mouseEventToLayerPoint(t.touches[0]),n=e.mouseEventToLayerPoint(t.touches[1]);this._scale=i.distanceTo(n)/this._startDist,this._delta=i._add(n)._divideBy(2)._subtract(this._startCenter),1!==this._scale&&(e.options.bounceAtZoomLimits||!(e.getZoom()===e.getMinZoom()&&this._scale<1||e.getZoom()===e.getMaxZoom()&&this._scale>1))&&(this._moved||(o.DomUtil.addClass(e._mapPane,"leaflet-touching"),e.fire("movestart").fire("zoomstart"),this._moved=!0),o.Util.cancelAnimFrame(this._animRequest),this._animRequest=o.Util.requestAnimFrame(this._updateOnMove,this,!0,this._map._container),o.DomEvent.preventDefault(t))}},_updateOnMove:function(){var t=this._map,e=this._getScaleOrigin(),i=t.layerPointToLatLng(e),n=t.getScaleZoom(this._scale);t._animateZoom(i,n,this._startCenter,this._scale,this._delta,!1,!0)},_onTouchEnd:function(){if(!this._moved||!this._zooming)return void(this._zooming=!1);var t=this._map;this._zooming=!1,o.DomUtil.removeClass(t._mapPane,"leaflet-touching"),o.Util.cancelAnimFrame(this._animRequest),o.DomEvent.off(e,"touchmove",this._onTouchMove).off(e,"touchend",this._onTouchEnd);var i=this._getScaleOrigin(),n=t.layerPointToLatLng(i),s=t.getZoom(),a=t.getScaleZoom(this._scale)-s,r=a>0?Math.ceil(a):Math.floor(a),h=t._limitZoom(s+r),l=t.getZoomScale(h)/this._scale;t._animateZoom(n,h,i,l)},_getScaleOrigin:function(){var t=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(t)}}),o.Map.addInitHook("addHandler","touchZoom",o.Map.TouchZoom),o.Map.mergeOptions({tap:!0,tapTolerance:15}),o.Map.Tap=o.Handler.extend({addHooks:function(){o.DomEvent.on(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){o.DomEvent.off(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(o.DomEvent.preventDefault(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var i=t.touches[0],n=i.target;this._startPos=this._newPos=new o.Point(i.clientX,i.clientY),n.tagName&&"a"===n.tagName.toLowerCase()&&o.DomUtil.addClass(n,"leaflet-active"),this._holdTimeout=setTimeout(o.bind(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",i))},this),1e3),o.DomEvent.on(e,"touchmove",this._onMove,this).on(e,"touchend",this._onUp,this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),o.DomEvent.off(e,"touchmove",this._onMove,this).off(e,"touchend",this._onUp,this),this._fireClick&&t&&t.changedTouches){var i=t.changedTouches[0],n=i.target;n&&n.tagName&&"a"===n.tagName.toLowerCase()&&o.DomUtil.removeClass(n,"leaflet-active"),this._isTapValid()&&this._simulateEvent("click",i)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new o.Point(e.clientX,e.clientY)},_simulateEvent:function(i,n){var o=e.createEvent("MouseEvents");o._simulated=!0,n.target._simulatedClick=!0,o.initMouseEvent(i,!0,!0,t,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),n.target.dispatchEvent(o)}}),o.Browser.touch&&!o.Browser.pointer&&o.Map.addInitHook("addHandler","tap",o.Map.Tap),o.Map.mergeOptions({boxZoom:!0}),o.Map.BoxZoom=o.Handler.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._moved=!1},addHooks:function(){o.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){o.DomEvent.off(this._container,"mousedown",this._onMouseDown),this._moved=!1},moved:function(){return this._moved},_onMouseDown:function(t){return this._moved=!1,!t.shiftKey||1!==t.which&&1!==t.button?!1:(o.DomUtil.disableTextSelection(),o.DomUtil.disableImageDrag(),this._startLayerPoint=this._map.mouseEventToLayerPoint(t),void o.DomEvent.on(e,"mousemove",this._onMouseMove,this).on(e,"mouseup",this._onMouseUp,this).on(e,"keydown",this._onKeyDown,this))},_onMouseMove:function(t){this._moved||(this._box=o.DomUtil.create("div","leaflet-zoom-box",this._pane),o.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",this._map.fire("boxzoomstart"));var e=this._startLayerPoint,i=this._box,n=this._map.mouseEventToLayerPoint(t),s=n.subtract(e),a=new o.Point(Math.min(n.x,e.x),Math.min(n.y,e.y));o.DomUtil.setPosition(i,a),this._moved=!0,i.style.width=Math.max(0,Math.abs(s.x)-4)+"px",i.style.height=Math.max(0,Math.abs(s.y)-4)+"px"},_finish:function(){this._moved&&(this._pane.removeChild(this._box),this._container.style.cursor=""),o.DomUtil.enableTextSelection(),o.DomUtil.enableImageDrag(),o.DomEvent.off(e,"mousemove",this._onMouseMove).off(e,"mouseup",this._onMouseUp).off(e,"keydown",this._onKeyDown)},_onMouseUp:function(t){this._finish();var e=this._map,i=e.mouseEventToLayerPoint(t);if(!this._startLayerPoint.equals(i)){var n=new o.LatLngBounds(e.layerPointToLatLng(this._startLayerPoint),e.layerPointToLatLng(i));e.fitBounds(n),e.fire("boxzoomend",{boxZoomBounds:n})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}}),o.Map.addInitHook("addHandler","boxZoom",o.Map.BoxZoom),o.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),o.Map.Keyboard=o.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,173]},initialize:function(t){this._map=t,this._setPanOffset(t.options.keyboardPanOffset),this._setZoomOffset(t.options.keyboardZoomOffset)},addHooks:function(){var t=this._map._container;-1===t.tabIndex&&(t.tabIndex="0"),o.DomEvent.on(t,"focus",this._onFocus,this).on(t,"blur",this._onBlur,this).on(t,"mousedown",this._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var t=this._map._container;o.DomEvent.off(t,"focus",this._onFocus,this).off(t,"blur",this._onBlur,this).off(t,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){if(!this._focused){var i=e.body,n=e.documentElement,o=i.scrollTop||n.scrollTop,s=i.scrollLeft||n.scrollLeft;this._map._container.focus(),t.scrollTo(s,o)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;i>e;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;i>e;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;i>e;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;i>e;e++)n[o.up[e]]=[0,-1*t]},_setZoomOffset:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;i>e;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;i>e;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){o.DomEvent.on(e,"keydown",this._onKeyDown,this)},_removeHooks:function(){o.DomEvent.off(e,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){var e=t.keyCode,i=this._map;if(e in this._panKeys){if(i._panAnim&&i._panAnim._inProgress)return;i.panBy(this._panKeys[e]),i.options.maxBounds&&i.panInsideBounds(i.options.maxBounds)}else{if(!(e in this._zoomKeys))return;i.setZoom(i.getZoom()+this._zoomKeys[e])}o.DomEvent.stop(t)}}),o.Map.addInitHook("addHandler","keyboard",o.Map.Keyboard),o.Handler.MarkerDrag=o.Handler.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new o.Draggable(t,t)),this._draggable.on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this),this._draggable.enable(),o.DomUtil.addClass(this._marker._icon,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off("dragstart",this._onDragStart,this).off("drag",this._onDrag,this).off("dragend",this._onDragEnd,this),this._draggable.disable(),o.DomUtil.removeClass(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(){var t=this._marker,e=t._shadow,i=o.DomUtil.getPosition(t._icon),n=t._map.layerPointToLatLng(i);e&&o.DomUtil.setPosition(e,i),t._latlng=n,t.fire("move",{latlng:n}).fire("drag")},_onDragEnd:function(t){this._marker.fire("moveend").fire("dragend",t)}}),o.Control=o.Class.extend({options:{position:"topright"},initialize:function(t){o.setOptions(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return o.DomUtil.addClass(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this},removeFrom:function(t){var e=this.getPosition(),i=t._controlCorners[e];return i.removeChild(this._container),this._map=null,this.onRemove&&this.onRemove(t),this},_refocusOnMap:function(){this._map&&this._map.getContainer().focus()}}),o.control=function(t){return new o.Control(t)},o.Map.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.removeFrom(this),this},_initControlPos:function(){function t(t,s){var a=i+t+" "+i+s;e[t+s]=o.DomUtil.create("div",a,n)}var e=this._controlCorners={},i="leaflet-",n=this._controlContainer=o.DomUtil.create("div",i+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){this._container.removeChild(this._controlContainer)}}),o.Control.Zoom=o.Control.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"-",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=o.DomUtil.create("div",e+" leaflet-bar");return this._map=t,this._zoomInButton=this._createButton(this.options.zoomInText,this.options.zoomInTitle,e+"-in",i,this._zoomIn,this),this._zoomOutButton=this._createButton(this.options.zoomOutText,this.options.zoomOutTitle,e+"-out",i,this._zoomOut,this),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},_zoomIn:function(t){this._map.zoomIn(t.shiftKey?3:1)},_zoomOut:function(t){this._map.zoomOut(t.shiftKey?3:1)},_createButton:function(t,e,i,n,s,a){var r=o.DomUtil.create("a",i,n);r.innerHTML=t,r.href="#",r.title=e;var h=o.DomEvent.stopPropagation;return o.DomEvent.on(r,"click",h).on(r,"mousedown",h).on(r,"dblclick",h).on(r,"click",o.DomEvent.preventDefault).on(r,"click",s,a).on(r,"click",this._refocusOnMap,a),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";o.DomUtil.removeClass(this._zoomInButton,e),o.DomUtil.removeClass(this._zoomOutButton,e),t._zoom===t.getMinZoom()&&o.DomUtil.addClass(this._zoomOutButton,e),t._zoom===t.getMaxZoom()&&o.DomUtil.addClass(this._zoomInButton,e)}}),o.Map.mergeOptions({zoomControl:!0}),o.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new o.Control.Zoom,this.addControl(this.zoomControl))}),o.control.zoom=function(t){return new o.Control.Zoom(t)},o.Control.Attribution=o.Control.extend({options:{position:"bottomright",prefix:'<a href="http://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(t){o.setOptions(this,t),this._attributions={}},onAdd:function(t){this._container=o.DomUtil.create("div","leaflet-control-attribution"),o.DomEvent.disableClickPropagation(this._container);for(var e in t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return t.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(t){t.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):void 0},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):void 0},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}},_onLayerAdd:function(t){t.layer.getAttribution&&this.addAttribution(t.layer.getAttribution())},_onLayerRemove:function(t){t.layer.getAttribution&&this.removeAttribution(t.layer.getAttribution())}}),o.Map.mergeOptions({attributionControl:!0}),o.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new o.Control.Attribution).addTo(this))}),o.control.attribution=function(t){return new o.Control.Attribution(t)},o.Control.Scale=o.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(t){this._map=t;var e="leaflet-control-scale",i=o.DomUtil.create("div",e),n=this.options;return this._addScales(n,e,i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=o.DomUtil.create("div",e+"-line",i)),t.imperial&&(this._iScale=o.DomUtil.create("div",e+"-line",i))},_update:function(){var t=this._map.getBounds(),e=t.getCenter().lat,i=6378137*Math.PI*Math.cos(e*Math.PI/180),n=i*(t.getNorthEast().lng-t.getSouthWest().lng)/180,o=this._map.getSize(),s=this.options,a=0;o.x>0&&(a=n*(s.maxWidth/o.x)),this._updateScales(s,a)},_updateScales:function(t,e){t.metric&&e&&this._updateMetric(e),t.imperial&&e&&this._updateImperial(e)},_updateMetric:function(t){var e=this._getRoundNum(t);this._mScale.style.width=this._getScaleWidth(e/t)+"px",this._mScale.innerHTML=1e3>e?e+" m":e/1e3+" km"},_updateImperial:function(t){var e,i,n,o=3.2808399*t,s=this._iScale;o>5280?(e=o/5280,i=this._getRoundNum(e),s.style.width=this._getScaleWidth(i/e)+"px",s.innerHTML=i+" mi"):(n=this._getRoundNum(o),s.style.width=this._getScaleWidth(n/o)+"px",s.innerHTML=n+" ft")},_getScaleWidth:function(t){return Math.round(this.options.maxWidth*t)-10},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1,e*i}}),o.control.scale=function(t){return new o.Control.Scale(t)},o.Control.Layers=o.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(t,e,i){o.setOptions(this,i),this._layers={},this._lastZIndex=0,this._handlingClick=!1;for(var n in t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){return this._initLayout(),this._update(),t.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this),this._container},onRemove:function(t){t.off("layeradd",this._onLayerChange,this).off("layerremove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._update(),this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._update(),this},removeLayer:function(t){var e=o.stamp(t);return delete this._layers[e],this._update(),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=o.DomUtil.create("div",t);e.setAttribute("aria-haspopup",!0),o.Browser.touch?o.DomEvent.on(e,"click",o.DomEvent.stopPropagation):o.DomEvent.disableClickPropagation(e).disableScrollPropagation(e);var i=this._form=o.DomUtil.create("form",t+"-list");if(this.options.collapsed){o.Browser.android||o.DomEvent.on(e,"mouseover",this._expand,this).on(e,"mouseout",this._collapse,this);var n=this._layersLink=o.DomUtil.create("a",t+"-toggle",e);n.href="#",n.title="Layers",o.Browser.touch?o.DomEvent.on(n,"click",o.DomEvent.stop).on(n,"click",this._expand,this):o.DomEvent.on(n,"focus",this._expand,this),o.DomEvent.on(i,"click",function(){setTimeout(o.bind(this._onInputClick,this),0)},this),this._map.on("click",this._collapse,this)}else this._expand();this._baseLayersList=o.DomUtil.create("div",t+"-base",i),this._separator=o.DomUtil.create("div",t+"-separator",i),this._overlaysList=o.DomUtil.create("div",t+"-overlays",i),e.appendChild(i)},_addLayer:function(t,e,i){var n=o.stamp(t);this._layers[n]={layer:t,name:e,overlay:i},this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex))},_update:function(){if(this._container){this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var t,e,i=!1,n=!1;for(t in this._layers)e=this._layers[t],this._addItem(e),n=n||e.overlay,i=i||!e.overlay;this._separator.style.display=n&&i?"":"none"}},_onLayerChange:function(t){var e=this._layers[o.stamp(t.layer)];if(e){this._handlingClick||this._update();var i=e.overlay?"layeradd"===t.type?"overlayadd":"overlayremove":"layeradd"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)}},_createRadioElement:function(t,i){var n='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"';i&&(n+=' checked="checked"'),n+="/>";var o=e.createElement("div");return o.innerHTML=n,o.firstChild},_addItem:function(t){var i,n=e.createElement("label"),s=this._map.hasLayer(t.layer);t.overlay?(i=e.createElement("input"),i.type="checkbox",i.className="leaflet-control-layers-selector",i.defaultChecked=s):i=this._createRadioElement("leaflet-base-layers",s),i.layerId=o.stamp(t.layer),o.DomEvent.on(i,"click",this._onInputClick,this);var a=e.createElement("span");a.innerHTML=" "+t.name,n.appendChild(i),n.appendChild(a);var r=t.overlay?this._overlaysList:this._baseLayersList;return r.appendChild(n),n},_onInputClick:function(){var t,e,i,n=this._form.getElementsByTagName("input"),o=n.length;for(this._handlingClick=!0,t=0;o>t;t++)e=n[t],i=this._layers[e.layerId],e.checked&&!this._map.hasLayer(i.layer)?this._map.addLayer(i.layer):!e.checked&&this._map.hasLayer(i.layer)&&this._map.removeLayer(i.layer);this._handlingClick=!1,this._refocusOnMap()},_expand:function(){o.DomUtil.addClass(this._container,"leaflet-control-layers-expanded")},_collapse:function(){this._container.className=this._container.className.replace(" leaflet-control-layers-expanded","")}}),o.control.layers=function(t,e,i){return new o.Control.Layers(t,e,i)},o.PosAnimation=o.Class.extend({includes:o.Mixin.Events,run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._newPos=e,this.fire("start"),t.style[o.DomUtil.TRANSITION]="all "+(i||.25)+"s cubic-bezier(0,0,"+(n||.5)+",1)",o.DomEvent.on(t,o.DomUtil.TRANSITION_END,this._onTransitionEnd,this),o.DomUtil.setPosition(t,e),o.Util.falseFn(t.offsetWidth),this._stepTimer=setInterval(o.bind(this._onStep,this),50)},stop:function(){this._inProgress&&(o.DomUtil.setPosition(this._el,this._getPos()),this._onTransitionEnd(),o.Util.falseFn(this._el.offsetWidth))},_onStep:function(){var t=this._getPos();return t?(this._el._leaflet_pos=t,void this.fire("step")):void this._onTransitionEnd()},_transformRe:/([-+]?(?:\d*\.)?\d+)\D*, ([-+]?(?:\d*\.)?\d+)\D*\)/,_getPos:function(){var e,i,n,s=this._el,a=t.getComputedStyle(s);if(o.Browser.any3d){if(n=a[o.DomUtil.TRANSFORM].match(this._transformRe),!n)return;e=parseFloat(n[1]),i=parseFloat(n[2])}else e=parseFloat(a.left),i=parseFloat(a.top);return new o.Point(e,i,!0)},_onTransitionEnd:function(){o.DomEvent.off(this._el,o.DomUtil.TRANSITION_END,this._onTransitionEnd,this),this._inProgress&&(this._inProgress=!1,this._el.style[o.DomUtil.TRANSITION]="",this._el._leaflet_pos=this._newPos,clearInterval(this._stepTimer),this.fire("step").fire("end"))}}),o.Map.include({setView:function(t,e,n){if(e=e===i?this._zoom:this._limitZoom(e),t=this._limitCenter(o.latLng(t),e,this.options.maxBounds),n=n||{},this._panAnim&&this._panAnim.stop(),this._loaded&&!n.reset&&n!==!0){n.animate!==i&&(n.zoom=o.extend({animate:n.animate},n.zoom),n.pan=o.extend({animate:n.animate},n.pan));var s=this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,n.zoom):this._tryAnimatedPan(t,n.pan);if(s)return clearTimeout(this._sizeTimer),this}return this._resetView(t,e),this},panBy:function(t,e){if(t=o.point(t).round(),e=e||{},!t.x&&!t.y)return this;if(this._panAnim||(this._panAnim=new o.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),e.animate!==!1){o.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t);this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){o.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._floor();return(e&&e.animate)===!0||this.getSize().contains(i)?(this.panBy(i,e),!0):!1}}),o.PosAnimation=o.DomUtil.TRANSITION?o.PosAnimation:o.PosAnimation.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=o.DomUtil.getPosition(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(),this._complete())},_animate:function(){this._animId=o.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(){var t=+new Date-this._startTime,e=1e3*this._duration;e>t?this._runFrame(this._easeOut(t/e)):(this._runFrame(1),this._complete())},_runFrame:function(t){var e=this._startPos.add(this._offset.multiplyBy(t));o.DomUtil.setPosition(this._el,e),this.fire("step")},_complete:function(){o.Util.cancelAnimFrame(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),o.Map.mergeOptions({zoomAnimation:!0,zoomAnimationThreshold:4}),o.DomUtil.TRANSITION&&o.Map.addInitHook(function(){this._zoomAnimated=this.options.zoomAnimation&&o.DomUtil.TRANSITION&&o.Browser.any3d&&!o.Browser.android23&&!o.Browser.mobileOpera,this._zoomAnimated&&o.DomEvent.on(this._mapPane,o.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)}),o.Map.include(o.DomUtil.TRANSITION?{_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||i.animate===!1||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n),s=this._getCenterLayerPoint()._add(o);return i.animate===!0||this.getSize().contains(o)?(this.fire("movestart").fire("zoomstart"),this._animateZoom(t,e,s,n,null,!0),!0):!1},_animateZoom:function(t,e,i,n,s,a,r){r||(this._animatingZoom=!0),o.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim"),this._animateToCenter=t,this._animateToZoom=e,o.Draggable&&(o.Draggable._disabled=!0),o.Util.requestAnimFrame(function(){this.fire("zoomanim",{center:t,zoom:e,origin:i,scale:n,delta:s,backwards:a})},this)},_onZoomTransitionEnd:function(){this._animatingZoom=!1,o.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),this._resetView(this._animateToCenter,this._animateToZoom,!0,!0),o.Draggable&&(o.Draggable._disabled=!1)}}:{}),o.TileLayer.include({_animateZoom:function(t){this._animating||(this._animating=!0,this._prepareBgBuffer());var e=this._bgBuffer,i=o.DomUtil.TRANSFORM,n=t.delta?o.DomUtil.getTranslateString(t.delta):e.style[i],s=o.DomUtil.getScaleString(t.scale,t.origin);e.style[i]=t.backwards?s+" "+n:n+" "+s},_endZoomAnim:function(){var t=this._tileContainer,e=this._bgBuffer;t.style.visibility="",t.parentNode.appendChild(t),o.Util.falseFn(e.offsetWidth),this._animating=!1},_clearBgBuffer:function(){var t=this._map;!t||t._animatingZoom||t.touchZoom._zooming||(this._bgBuffer.innerHTML="",this._bgBuffer.style[o.DomUtil.TRANSFORM]="")},_prepareBgBuffer:function(){var t=this._tileContainer,e=this._bgBuffer,i=this._getLoadedTilesPercentage(e),n=this._getLoadedTilesPercentage(t);return e&&i>.5&&.5>n?(t.style.visibility="hidden",void this._stopLoadingImages(t)):(e.style.visibility="hidden",e.style[o.DomUtil.TRANSFORM]="",this._tileContainer=e,e=this._bgBuffer=t,this._stopLoadingImages(e),void clearTimeout(this._clearBgBufferTimer))},_getLoadedTilesPercentage:function(t){var e,i,n=t.getElementsByTagName("img"),o=0;for(e=0,i=n.length;i>e;e++)n[e].complete&&o++;return o/i},_stopLoadingImages:function(t){var e,i,n,s=Array.prototype.slice.call(t.getElementsByTagName("img"));for(e=0,i=s.length;i>e;e++)n=s[e],n.complete||(n.onload=o.Util.falseFn,n.onerror=o.Util.falseFn,n.src=o.Util.emptyImageUrl,n.parentNode.removeChild(n))}}),o.Map.include({_defaultLocateOptions:{watch:!1,setView:!1,maxZoom:1/0,timeout:1e4,maximumAge:0,enableHighAccuracy:!1},locate:function(t){if(t=this._locateOptions=o.extend(this._defaultLocateOptions,t),!navigator.geolocation)return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=o.bind(this._handleGeolocationResponse,this),i=o.bind(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=t.coords.latitude,i=t.coords.longitude,n=new o.LatLng(e,i),s=180*t.coords.accuracy/40075017,a=s/Math.cos(o.LatLng.DEG_TO_RAD*e),r=o.latLngBounds([e-s,i-a],[e+s,i+a]),h=this._locateOptions;if(h.setView){var l=Math.min(this.getBoundsZoom(r),h.maxZoom);this.setView(n,l)}var u={latlng:n,bounds:r,timestamp:t.timestamp};for(var c in t.coords)"number"==typeof t.coords[c]&&(u[c]=t.coords[c]);this.fire("locationfound",u)}})}(window,document);
},{}],3:[function(require,module,exports){
!function(t,e){if("object"==typeof exports&&exports)e(exports);else{var n={};e(n),"function"==typeof define&&define.amd?define(n):t.Mustache=n}}(this,function(t){function e(t,e){return y.call(t,e)}function n(t){return!e(w,t)}function r(t){return"function"==typeof t}function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function a(t){return String(t).replace(/[&<>"'\/]/g,function(t){return _[t]})}function o(t){this.string=t,this.tail=t,this.pos=0}function s(t,e){this.view=null==t?{}:t,this.parent=e,this._cache={".":this.view}}function c(){this.clearCache()}function l(e,n,i,a){function o(t){return n.render(t,i)}for(var s,c,u,p="",h=0,f=e.length;f>h;++h)switch(s=e[h],c=s[1],s[0]){case"#":if(u=i.lookup(c),"object"==typeof u||"string"==typeof u)if(x(u))for(var g=0,v=u.length;v>g;++g)p+=l(s[4],n,i.push(u[g]),a);else u&&(p+=l(s[4],n,i.push(u),a));else if(r(u)){var w=null==a?null:a.slice(s[3],s[5]);u=u.call(i.view,w,o),null!=u&&(p+=u)}else u&&(p+=l(s[4],n,i,a));break;case"^":u=i.lookup(c),(!u||x(u)&&0===u.length)&&(p+=l(s[4],n,i,a));break;case">":u=n.getPartial(c),r(u)&&(p+=u(i));break;case"&":u=i.lookup(c),null!=u&&(p+=u);break;case"name":u=i.lookup(c),null!=u&&(p+=t.escape(u));break;case"text":p+=c}return p}function u(t){for(var e,n=[],r=n,i=[],a=0,o=t.length;o>a;++a)switch(e=t[a],e[0]){case"#":case"^":i.push(e),r.push(e),r=e[4]=[];break;case"/":var s=i.pop();s[5]=e[2],r=i.length>0?i[i.length-1][4]:n;break;default:r.push(e)}return n}function p(t){for(var e,n,r=[],i=0,a=t.length;a>i;++i)e=t[i],e&&("text"===e[0]&&n&&"text"===n[0]?(n[1]+=e[1],n[3]=e[3]):(n=e,r.push(e)));return r}function h(t){return[new RegExp(i(t[0])+"\\s*"),new RegExp("\\s*"+i(t[1]))]}function f(e,r){function a(){if(P&&!C)for(;E.length;)delete U[E.pop()];else E=[];P=!1,C=!1}if(e=e||"",r=r||t.tags,"string"==typeof r&&(r=r.split(v)),2!==r.length)throw new Error("Invalid tags: "+r.join(", "));for(var s,c,l,f,w,y,b=h(r),x=new o(e),_=[],U=[],E=[],P=!1,C=!1;!x.eos();){if(s=x.pos,l=x.scanUntil(b[0]))for(var j=0,A=l.length;A>j;++j)f=l.charAt(j),n(f)?E.push(U.length):C=!0,U.push(["text",f,s,s+1]),s+=1,"\n"==f&&a();if(!x.scan(b[0]))break;if(P=!0,c=x.scan(k)||"name",x.scan(g),"="===c?(l=x.scanUntil(m),x.scan(m),x.scanUntil(b[1])):"{"===c?(l=x.scanUntil(new RegExp("\\s*"+i("}"+r[1]))),x.scan(d),x.scanUntil(b[1]),c="&"):l=x.scanUntil(b[1]),!x.scan(b[1]))throw new Error("Unclosed tag at "+x.pos);if(w=[c,l,s,x.pos],U.push(w),"#"===c||"^"===c)_.push(w);else if("/"===c){if(y=_.pop(),!y)throw new Error('Unopened section "'+l+'" at '+s);if(y[1]!==l)throw new Error('Unclosed section "'+y[1]+'" at '+s)}else if("name"===c||"{"===c||"&"===c)C=!0;else if("="===c){if(r=l.split(v),2!==r.length)throw new Error("Invalid tags at "+s+": "+r.join(", "));b=h(r)}}if(y=_.pop())throw new Error('Unclosed section "'+y[1]+'" at '+x.pos);return u(p(U))}var g=/\s*/,v=/\s+/,w=/\S/,m=/\s*=/,d=/\s*\}/,k=/#|\^|\/|>|\{|&|=|!/,y=RegExp.prototype.test,b=Object.prototype.toString,x=Array.isArray||function(t){return"[object Array]"===b.call(t)},_={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};o.prototype.eos=function(){return""===this.tail},o.prototype.scan=function(t){var e=this.tail.match(t);if(e&&0===e.index){var n=e[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n}return""},o.prototype.scanUntil=function(t){var e,n=this.tail.search(t);switch(n){case-1:e=this.tail,this.tail="";break;case 0:e="";break;default:e=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=e.length,e},s.make=function(t){return t instanceof s?t:new s(t)},s.prototype.push=function(t){return new s(t,this)},s.prototype.lookup=function(t){var e;if(t in this._cache)e=this._cache[t];else{for(var n=this;n;){if(t.indexOf(".")>0){e=n.view;for(var i=t.split("."),a=0;null!=e&&a<i.length;)e=e[i[a++]]}else e=n.view[t];if(null!=e)break;n=n.parent}this._cache[t]=e}return r(e)&&(e=e.call(this.view)),e},c.prototype.clearCache=function(){this._cache={},this._partialCache={}},c.prototype.compile=function(e,n){var r=this._cache[e];if(!r){var i=t.parse(e,n);r=this._cache[e]=this.compileTokens(i,e)}return r},c.prototype.compilePartial=function(t,e,n){var r=this.compile(e,n);return this._partialCache[t]=r,r},c.prototype.getPartial=function(t){return t in this._partialCache||!this._loadPartial||this.compilePartial(t,this._loadPartial(t)),this._partialCache[t]},c.prototype.compileTokens=function(t,e){var n=this;return function(i,a){if(a)if(r(a))n._loadPartial=a;else for(var o in a)n.compilePartial(o,a[o]);return l(t,n,s.make(i),e)}},c.prototype.render=function(t,e,n){return this.compile(t)(e,n)},t.name="mustache.js",t.version="0.7.3",t.tags=["{{","}}"],t.Scanner=o,t.Context=s,t.Writer=c,t.parse=f,t.escape=a;var U=new c;t.clearCache=function(){return U.clearCache()},t.compile=function(t,e){return U.compile(t,e)},t.compilePartial=function(t,e,n){return U.compilePartial(t,e,n)},t.compileTokens=function(t,e){return U.compileTokens(t,e)},t.render=function(t,e,n){return U.render(t,e,n)},t.to_html=function(e,n,i,a){var o=t.render(e,n,i);return r(a)?void a(o):o}});
},{}],4:[function(require,module,exports){
function cleanUrl(t){"use strict";return/^https?/.test(t.getScheme())?t.toString():/^mailto?/.test(t.getScheme())?t.toString():"data"==t.getScheme()&&/^image/.test(t.getPath())?t.toString():void 0}function cleanId(t){return t}var html_sanitize=require("./sanitizer-bundle.js");module.exports=function(t){return t?html_sanitize(t,cleanUrl,cleanId):""};
},{"./sanitizer-bundle.js":5}],5:[function(require,module,exports){
var URI=function(){function e(e){var t=(""+e).match(p);return t?new s(c(t[1]),c(t[2]),c(t[3]),c(t[4]),c(t[5]),c(t[6]),c(t[7])):null}function t(e,t,o,i,l,c,m){var u=new s(n(e,d),n(t,d),a(o),i>0?i.toString():null,n(l,f),null,a(m));return c&&("string"==typeof c?u.setRawQuery(c.replace(/[^?&=0-9A-Za-z_\-~.%]/g,r)):u.setAllParameters(c)),u}function a(e){return"string"==typeof e?encodeURIComponent(e):null}function n(e,t){return"string"==typeof e?encodeURI(e).replace(t,r):null}function r(e){var t=e.charCodeAt(0);return"%"+"0123456789ABCDEF".charAt(t>>4&15)+"0123456789ABCDEF".charAt(15&t)}function o(e){return e.replace(/(^|\/)\.(?:\/|$)/g,"$1").replace(/\/{2,}/g,"/")}function i(e){if(null===e)return null;for(var t,a=o(e),n=u;(t=a.replace(n,"$1"))!=a;a=t);return a}function l(e,t){var a=e.clone(),n=t.hasScheme();n?a.setRawScheme(t.getRawScheme()):n=t.hasCredentials(),n?a.setRawCredentials(t.getRawCredentials()):n=t.hasDomain(),n?a.setRawDomain(t.getRawDomain()):n=t.hasPort();var r=t.getRawPath(),o=i(r);if(n)a.setPort(t.getPort()),o=o&&o.replace(h,"");else if(n=!!r){if(47!==o.charCodeAt(0)){var l=i(a.getRawPath()||"").replace(h,""),s=l.lastIndexOf("/")+1;o=i((s?l.substring(0,s):"")+i(r)).replace(h,"")}}else o=o&&o.replace(h,""),o!==r&&a.setRawPath(o);return n?a.setRawPath(o):n=t.hasQuery(),n?a.setRawQuery(t.getRawQuery()):n=t.hasFragment(),n&&a.setRawFragment(t.getRawFragment()),a}function s(e,t,a,n,r,o,i){this.scheme_=e,this.credentials_=t,this.domain_=a,this.port_=n,this.path_=r,this.query_=o,this.fragment_=i,this.paramCache_=null}function c(e){return"string"==typeof e&&e.length>0?e:null}var m=new RegExp("(/|^)(?:[^./][^/]*|\\.{2,}(?:[^./][^/]*)|\\.{3,}[^/]*)/\\.\\.(?:/|$)"),u=new RegExp(m),h=/^(?:\.\.\/)*(?:\.\.$)?/;s.prototype.toString=function(){var e=[];return null!==this.scheme_&&e.push(this.scheme_,":"),null!==this.domain_&&(e.push("//"),null!==this.credentials_&&e.push(this.credentials_,"@"),e.push(this.domain_),null!==this.port_&&e.push(":",this.port_.toString())),null!==this.path_&&e.push(this.path_),null!==this.query_&&e.push("?",this.query_),null!==this.fragment_&&e.push("#",this.fragment_),e.join("")},s.prototype.clone=function(){return new s(this.scheme_,this.credentials_,this.domain_,this.port_,this.path_,this.query_,this.fragment_)},s.prototype.getScheme=function(){return this.scheme_&&decodeURIComponent(this.scheme_).toLowerCase()},s.prototype.getRawScheme=function(){return this.scheme_},s.prototype.setScheme=function(e){return this.scheme_=n(e,d),this},s.prototype.setRawScheme=function(e){return this.scheme_=e?e:null,this},s.prototype.hasScheme=function(){return null!==this.scheme_},s.prototype.getCredentials=function(){return this.credentials_&&decodeURIComponent(this.credentials_)},s.prototype.getRawCredentials=function(){return this.credentials_},s.prototype.setCredentials=function(e){return this.credentials_=n(e,d),this},s.prototype.setRawCredentials=function(e){return this.credentials_=e?e:null,this},s.prototype.hasCredentials=function(){return null!==this.credentials_},s.prototype.getDomain=function(){return this.domain_&&decodeURIComponent(this.domain_)},s.prototype.getRawDomain=function(){return this.domain_},s.prototype.setDomain=function(e){return this.setRawDomain(e&&encodeURIComponent(e))},s.prototype.setRawDomain=function(e){return this.domain_=e?e:null,this.setRawPath(this.path_)},s.prototype.hasDomain=function(){return null!==this.domain_},s.prototype.getPort=function(){return this.port_&&decodeURIComponent(this.port_)},s.prototype.setPort=function(e){if(e){if(e=Number(e),e!==(65535&e))throw new Error("Bad port number "+e);this.port_=""+e}else this.port_=null;return this},s.prototype.hasPort=function(){return null!==this.port_},s.prototype.getPath=function(){return this.path_&&decodeURIComponent(this.path_)},s.prototype.getRawPath=function(){return this.path_},s.prototype.setPath=function(e){return this.setRawPath(n(e,f))},s.prototype.setRawPath=function(e){return e?(e=String(e),this.path_=!this.domain_||/^\//.test(e)?e:"/"+e):this.path_=null,this},s.prototype.hasPath=function(){return null!==this.path_},s.prototype.getQuery=function(){return this.query_&&decodeURIComponent(this.query_).replace(/\+/g," ")},s.prototype.getRawQuery=function(){return this.query_},s.prototype.setQuery=function(e){return this.paramCache_=null,this.query_=a(e),this},s.prototype.setRawQuery=function(e){return this.paramCache_=null,this.query_=e?e:null,this},s.prototype.hasQuery=function(){return null!==this.query_},s.prototype.setAllParameters=function(e){if("object"==typeof e&&!(e instanceof Array)&&(e instanceof Object||"[object Array]"!==Object.prototype.toString.call(e))){var t=[],a=-1;for(var n in e){var r=e[n];"string"==typeof r&&(t[++a]=n,t[++a]=r)}e=t}this.paramCache_=null;for(var o=[],i="",l=0;l<e.length;){var n=e[l++],r=e[l++];o.push(i,encodeURIComponent(n.toString())),i="&",r&&o.push("=",encodeURIComponent(r.toString()))}return this.query_=o.join(""),this},s.prototype.checkParameterCache_=function(){if(!this.paramCache_){var e=this.query_;if(e){for(var t=e.split(/[&\?]/),a=[],n=-1,r=0;r<t.length;++r){var o=t[r].match(/^([^=]*)(?:=(.*))?$/);a[++n]=decodeURIComponent(o[1]).replace(/\+/g," "),a[++n]=decodeURIComponent(o[2]||"").replace(/\+/g," ")}this.paramCache_=a}else this.paramCache_=[]}},s.prototype.setParameterValues=function(e,t){"string"==typeof t&&(t=[t]),this.checkParameterCache_();for(var a=0,n=this.paramCache_,r=[],o=0;o<n.length;o+=2)e===n[o]?a<t.length&&r.push(e,t[a++]):r.push(n[o],n[o+1]);for(;a<t.length;)r.push(e,t[a++]);return this.setAllParameters(r),this},s.prototype.removeParameter=function(e){return this.setParameterValues(e,[])},s.prototype.getAllParameters=function(){return this.checkParameterCache_(),this.paramCache_.slice(0,this.paramCache_.length)},s.prototype.getParameterValues=function(e){this.checkParameterCache_();for(var t=[],a=0;a<this.paramCache_.length;a+=2)e===this.paramCache_[a]&&t.push(this.paramCache_[a+1]);return t},s.prototype.getParameterMap=function(e){this.checkParameterCache_();for(var t={},a=0;a<this.paramCache_.length;a+=2){var n=this.paramCache_[a++],r=this.paramCache_[a++];n in t?t[n].push(r):t[n]=[r]}return t},s.prototype.getParameterValue=function(e){this.checkParameterCache_();for(var t=0;t<this.paramCache_.length;t+=2)if(e===this.paramCache_[t])return this.paramCache_[t+1];return null},s.prototype.getFragment=function(){return this.fragment_&&decodeURIComponent(this.fragment_)},s.prototype.getRawFragment=function(){return this.fragment_},s.prototype.setFragment=function(e){return this.fragment_=e?encodeURIComponent(e):null,this},s.prototype.setRawFragment=function(e){return this.fragment_=e?e:null,this},s.prototype.hasFragment=function(){return null!==this.fragment_};var p=new RegExp("^(?:([^:/?#]+):)?(?://(?:([^/?#]*)@)?([^/?#:@]*)(?::([0-9]+))?)?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$"),d=/[#\/\?@]/g,f=/[\#\?]/g;return s.parse=e,s.create=t,s.resolve=l,s.collapse_dots=i,s.utils={mimeTypeOf:function(t){var a=e(t);return/\.html$/.test(a.getPath())?"text/html":"application/javascript"},resolve:function(t,a){return t?l(e(t),e(a)).toString():""+a}},s}(),html4={};if(html4.atype={NONE:0,URI:1,URI_FRAGMENT:11,SCRIPT:2,STYLE:3,HTML:12,ID:4,IDREF:5,IDREFS:6,GLOBAL_NAME:7,LOCAL_NAME:8,CLASSES:9,FRAME_TARGET:10,MEDIA_QUERY:13},html4.atype=html4.atype,html4.ATTRIBS={"*::class":9,"*::dir":0,"*::draggable":0,"*::hidden":0,"*::id":4,"*::inert":0,"*::itemprop":0,"*::itemref":6,"*::itemscope":0,"*::lang":0,"*::onblur":2,"*::onchange":2,"*::onclick":2,"*::ondblclick":2,"*::onfocus":2,"*::onkeydown":2,"*::onkeypress":2,"*::onkeyup":2,"*::onload":2,"*::onmousedown":2,"*::onmousemove":2,"*::onmouseout":2,"*::onmouseover":2,"*::onmouseup":2,"*::onreset":2,"*::onscroll":2,"*::onselect":2,"*::onsubmit":2,"*::onunload":2,"*::spellcheck":0,"*::style":3,"*::title":0,"*::translate":0,"a::accesskey":0,"a::coords":0,"a::href":1,"a::hreflang":0,"a::name":7,"a::onblur":2,"a::onfocus":2,"a::shape":0,"a::tabindex":0,"a::target":10,"a::type":0,"area::accesskey":0,"area::alt":0,"area::coords":0,"area::href":1,"area::nohref":0,"area::onblur":2,"area::onfocus":2,"area::shape":0,"area::tabindex":0,"area::target":10,"audio::controls":0,"audio::loop":0,"audio::mediagroup":5,"audio::muted":0,"audio::preload":0,"bdo::dir":0,"blockquote::cite":1,"br::clear":0,"button::accesskey":0,"button::disabled":0,"button::name":8,"button::onblur":2,"button::onfocus":2,"button::tabindex":0,"button::type":0,"button::value":0,"canvas::height":0,"canvas::width":0,"caption::align":0,"col::align":0,"col::char":0,"col::charoff":0,"col::span":0,"col::valign":0,"col::width":0,"colgroup::align":0,"colgroup::char":0,"colgroup::charoff":0,"colgroup::span":0,"colgroup::valign":0,"colgroup::width":0,"command::checked":0,"command::command":5,"command::disabled":0,"command::icon":1,"command::label":0,"command::radiogroup":0,"command::type":0,"data::value":0,"del::cite":1,"del::datetime":0,"details::open":0,"dir::compact":0,"div::align":0,"dl::compact":0,"fieldset::disabled":0,"font::color":0,"font::face":0,"font::size":0,"form::accept":0,"form::action":1,"form::autocomplete":0,"form::enctype":0,"form::method":0,"form::name":7,"form::novalidate":0,"form::onreset":2,"form::onsubmit":2,"form::target":10,"h1::align":0,"h2::align":0,"h3::align":0,"h4::align":0,"h5::align":0,"h6::align":0,"hr::align":0,"hr::noshade":0,"hr::size":0,"hr::width":0,"iframe::align":0,"iframe::frameborder":0,"iframe::height":0,"iframe::marginheight":0,"iframe::marginwidth":0,"iframe::width":0,"img::align":0,"img::alt":0,"img::border":0,"img::height":0,"img::hspace":0,"img::ismap":0,"img::name":7,"img::src":1,"img::usemap":11,"img::vspace":0,"img::width":0,"input::accept":0,"input::accesskey":0,"input::align":0,"input::alt":0,"input::autocomplete":0,"input::checked":0,"input::disabled":0,"input::inputmode":0,"input::ismap":0,"input::list":5,"input::max":0,"input::maxlength":0,"input::min":0,"input::multiple":0,"input::name":8,"input::onblur":2,"input::onchange":2,"input::onfocus":2,"input::onselect":2,"input::placeholder":0,"input::readonly":0,"input::required":0,"input::size":0,"input::src":1,"input::step":0,"input::tabindex":0,"input::type":0,"input::usemap":11,"input::value":0,"ins::cite":1,"ins::datetime":0,"label::accesskey":0,"label::for":5,"label::onblur":2,"label::onfocus":2,"legend::accesskey":0,"legend::align":0,"li::type":0,"li::value":0,"map::name":7,"menu::compact":0,"menu::label":0,"menu::type":0,"meter::high":0,"meter::low":0,"meter::max":0,"meter::min":0,"meter::value":0,"ol::compact":0,"ol::reversed":0,"ol::start":0,"ol::type":0,"optgroup::disabled":0,"optgroup::label":0,"option::disabled":0,"option::label":0,"option::selected":0,"option::value":0,"output::for":6,"output::name":8,"p::align":0,"pre::width":0,"progress::max":0,"progress::min":0,"progress::value":0,"q::cite":1,"select::autocomplete":0,"select::disabled":0,"select::multiple":0,"select::name":8,"select::onblur":2,"select::onchange":2,"select::onfocus":2,"select::required":0,"select::size":0,"select::tabindex":0,"source::type":0,"table::align":0,"table::bgcolor":0,"table::border":0,"table::cellpadding":0,"table::cellspacing":0,"table::frame":0,"table::rules":0,"table::summary":0,"table::width":0,"tbody::align":0,"tbody::char":0,"tbody::charoff":0,"tbody::valign":0,"td::abbr":0,"td::align":0,"td::axis":0,"td::bgcolor":0,"td::char":0,"td::charoff":0,"td::colspan":0,"td::headers":6,"td::height":0,"td::nowrap":0,"td::rowspan":0,"td::scope":0,"td::valign":0,"td::width":0,"textarea::accesskey":0,"textarea::autocomplete":0,"textarea::cols":0,"textarea::disabled":0,"textarea::inputmode":0,"textarea::name":8,"textarea::onblur":2,"textarea::onchange":2,"textarea::onfocus":2,"textarea::onselect":2,"textarea::placeholder":0,"textarea::readonly":0,"textarea::required":0,"textarea::rows":0,"textarea::tabindex":0,"textarea::wrap":0,"tfoot::align":0,"tfoot::char":0,"tfoot::charoff":0,"tfoot::valign":0,"th::abbr":0,"th::align":0,"th::axis":0,"th::bgcolor":0,"th::char":0,"th::charoff":0,"th::colspan":0,"th::headers":6,"th::height":0,"th::nowrap":0,"th::rowspan":0,"th::scope":0,"th::valign":0,"th::width":0,"thead::align":0,"thead::char":0,"thead::charoff":0,"thead::valign":0,"tr::align":0,"tr::bgcolor":0,"tr::char":0,"tr::charoff":0,"tr::valign":0,"track::default":0,"track::kind":0,"track::label":0,"track::srclang":0,"ul::compact":0,"ul::type":0,"video::controls":0,"video::height":0,"video::loop":0,"video::mediagroup":5,"video::muted":0,"video::poster":1,"video::preload":0,"video::width":0},html4.ATTRIBS=html4.ATTRIBS,html4.eflags={OPTIONAL_ENDTAG:1,EMPTY:2,CDATA:4,RCDATA:8,UNSAFE:16,FOLDABLE:32,SCRIPT:64,STYLE:128,VIRTUALIZED:256},html4.eflags=html4.eflags,html4.ELEMENTS={a:0,abbr:0,acronym:0,address:0,applet:272,area:2,article:0,aside:0,audio:0,b:0,base:274,basefont:274,bdi:0,bdo:0,big:0,blockquote:0,body:305,br:2,button:0,canvas:0,caption:0,center:0,cite:0,code:0,col:2,colgroup:1,command:2,data:0,datalist:0,dd:1,del:0,details:0,dfn:0,dialog:272,dir:0,div:0,dl:0,dt:1,em:0,fieldset:0,figcaption:0,figure:0,font:0,footer:0,form:0,frame:274,frameset:272,h1:0,h2:0,h3:0,h4:0,h5:0,h6:0,head:305,header:0,hgroup:0,hr:2,html:305,i:0,iframe:16,img:2,input:2,ins:0,isindex:274,kbd:0,keygen:274,label:0,legend:0,li:1,link:274,map:0,mark:0,menu:0,meta:274,meter:0,nav:0,nobr:0,noembed:276,noframes:276,noscript:276,object:272,ol:0,optgroup:0,option:1,output:0,p:1,param:274,pre:0,progress:0,q:0,s:0,samp:0,script:84,section:0,select:0,small:0,source:2,span:0,strike:0,strong:0,style:148,sub:0,summary:0,sup:0,table:0,tbody:1,td:1,textarea:8,tfoot:1,th:1,thead:1,time:0,title:280,tr:1,track:2,tt:0,u:0,ul:0,"var":0,video:0,wbr:2},html4.ELEMENTS=html4.ELEMENTS,html4.ELEMENT_DOM_INTERFACES={a:"HTMLAnchorElement",abbr:"HTMLElement",acronym:"HTMLElement",address:"HTMLElement",applet:"HTMLAppletElement",area:"HTMLAreaElement",article:"HTMLElement",aside:"HTMLElement",audio:"HTMLAudioElement",b:"HTMLElement",base:"HTMLBaseElement",basefont:"HTMLBaseFontElement",bdi:"HTMLElement",bdo:"HTMLElement",big:"HTMLElement",blockquote:"HTMLQuoteElement",body:"HTMLBodyElement",br:"HTMLBRElement",button:"HTMLButtonElement",canvas:"HTMLCanvasElement",caption:"HTMLTableCaptionElement",center:"HTMLElement",cite:"HTMLElement",code:"HTMLElement",col:"HTMLTableColElement",colgroup:"HTMLTableColElement",command:"HTMLCommandElement",data:"HTMLElement",datalist:"HTMLDataListElement",dd:"HTMLElement",del:"HTMLModElement",details:"HTMLDetailsElement",dfn:"HTMLElement",dialog:"HTMLDialogElement",dir:"HTMLDirectoryElement",div:"HTMLDivElement",dl:"HTMLDListElement",dt:"HTMLElement",em:"HTMLElement",fieldset:"HTMLFieldSetElement",figcaption:"HTMLElement",figure:"HTMLElement",font:"HTMLFontElement",footer:"HTMLElement",form:"HTMLFormElement",frame:"HTMLFrameElement",frameset:"HTMLFrameSetElement",h1:"HTMLHeadingElement",h2:"HTMLHeadingElement",h3:"HTMLHeadingElement",h4:"HTMLHeadingElement",h5:"HTMLHeadingElement",h6:"HTMLHeadingElement",head:"HTMLHeadElement",header:"HTMLElement",hgroup:"HTMLElement",hr:"HTMLHRElement",html:"HTMLHtmlElement",i:"HTMLElement",iframe:"HTMLIFrameElement",img:"HTMLImageElement",input:"HTMLInputElement",ins:"HTMLModElement",isindex:"HTMLUnknownElement",kbd:"HTMLElement",keygen:"HTMLKeygenElement",label:"HTMLLabelElement",legend:"HTMLLegendElement",li:"HTMLLIElement",link:"HTMLLinkElement",map:"HTMLMapElement",mark:"HTMLElement",menu:"HTMLMenuElement",meta:"HTMLMetaElement",meter:"HTMLMeterElement",nav:"HTMLElement",nobr:"HTMLElement",noembed:"HTMLElement",noframes:"HTMLElement",noscript:"HTMLElement",object:"HTMLObjectElement",ol:"HTMLOListElement",optgroup:"HTMLOptGroupElement",option:"HTMLOptionElement",output:"HTMLOutputElement",p:"HTMLParagraphElement",param:"HTMLParamElement",pre:"HTMLPreElement",progress:"HTMLProgressElement",q:"HTMLQuoteElement",s:"HTMLElement",samp:"HTMLElement",script:"HTMLScriptElement",section:"HTMLElement",select:"HTMLSelectElement",small:"HTMLElement",source:"HTMLSourceElement",span:"HTMLSpanElement",strike:"HTMLElement",strong:"HTMLElement",style:"HTMLStyleElement",sub:"HTMLElement",summary:"HTMLElement",sup:"HTMLElement",table:"HTMLTableElement",tbody:"HTMLTableSectionElement",td:"HTMLTableDataCellElement",textarea:"HTMLTextAreaElement",tfoot:"HTMLTableSectionElement",th:"HTMLTableHeaderCellElement",thead:"HTMLTableSectionElement",time:"HTMLTimeElement",title:"HTMLTitleElement",tr:"HTMLTableRowElement",track:"HTMLTrackElement",tt:"HTMLElement",u:"HTMLElement",ul:"HTMLUListElement","var":"HTMLElement",video:"HTMLVideoElement",wbr:"HTMLElement"},html4.ELEMENT_DOM_INTERFACES=html4.ELEMENT_DOM_INTERFACES,html4.ueffects={NOT_LOADED:0,SAME_DOCUMENT:1,NEW_DOCUMENT:2},html4.ueffects=html4.ueffects,html4.URIEFFECTS={"a::href":2,"area::href":2,"blockquote::cite":0,"command::icon":1,"del::cite":0,"form::action":2,"img::src":1,"input::src":1,"ins::cite":0,"q::cite":0,"video::poster":1},html4.URIEFFECTS=html4.URIEFFECTS,html4.ltypes={UNSANDBOXED:2,SANDBOXED:1,DATA:0},html4.ltypes=html4.ltypes,html4.LOADERTYPES={"a::href":2,"area::href":2,"blockquote::cite":2,"command::icon":1,"del::cite":2,"form::action":2,"img::src":1,"input::src":1,"ins::cite":2,"q::cite":2,"video::poster":1},html4.LOADERTYPES=html4.LOADERTYPES,"i"!=="I".toLowerCase())throw"I/i problem";var html=function(e){function t(e){if(S.hasOwnProperty(e))return S[e];var t=e.match(P);if(t)return String.fromCharCode(parseInt(t[1],10));if(t=e.match(D))return String.fromCharCode(parseInt(t[1],16));if(I&&k.test(e)){I.innerHTML="&"+e+";";var a=I.textContent;return S[e]=a,a}return"&"+e+";"}function a(e,a){return t(a)}function n(e){return e.replace(x,"")}function r(e){return e.replace(N,a)}function o(e){return(""+e).replace(F,"&amp;").replace(B,"&lt;").replace(q,"&gt;").replace(z,"&#34;")}function i(e){return e.replace(U,"&amp;$1").replace(B,"&lt;").replace(q,"&gt;")}function l(e){var t={cdata:e.cdata||e.cdata,comment:e.comment||e.comment,endDoc:e.endDoc||e.endDoc,endTag:e.endTag||e.endTag,pcdata:e.pcdata||e.pcdata,rcdata:e.rcdata||e.rcdata,startDoc:e.startDoc||e.startDoc,startTag:e.startTag||e.startTag};return function(e,a){return s(e,t,a)}}function s(e,t,a){var n=u(e),r={noMoreGT:!1,noMoreEndComments:!1};m(t,n,0,r,a)}function c(e,t,a,n,r){return function(){m(e,t,a,n,r)}}function m(t,a,n,r,o){try{t.startDoc&&0==n&&t.startDoc(o);for(var i,l,s,m=n,u=a.length;u>m;){var f=a[m++],g=a[m];switch(f){case"&":O.test(g)?(t.pcdata&&t.pcdata("&"+g,o,Y,c(t,a,m,r,o)),m++):t.pcdata&&t.pcdata("&amp;",o,Y,c(t,a,m,r,o));break;case"</":(i=/^([-\w:]+)[^\'\"]*/.exec(g))?i[0].length===g.length&&">"===a[m+1]?(m+=2,s=i[1].toLowerCase(),t.endTag&&t.endTag(s,o,Y,c(t,a,m,r,o))):m=h(a,m,t,o,Y,r):t.pcdata&&t.pcdata("&lt;/",o,Y,c(t,a,m,r,o));break;case"<":if(i=/^([-\w:]+)\s*\/?/.exec(g))if(i[0].length===g.length&&">"===a[m+1]){m+=2,s=i[1].toLowerCase(),t.startTag&&t.startTag(s,[],o,Y,c(t,a,m,r,o));var E=e.ELEMENTS[s];if(E&j){var T={name:s,next:m,eflags:E};m=d(a,T,t,o,Y,r)}}else m=p(a,m,t,o,Y,r);else t.pcdata&&t.pcdata("&lt;",o,Y,c(t,a,m,r,o));break;case"<!--":if(!r.noMoreEndComments){for(l=m+1;u>l&&(">"!==a[l]||!/--$/.test(a[l-1]));l++);if(u>l){if(t.comment){var L=a.slice(m,l).join("");t.comment(L.substr(0,L.length-2),o,Y,c(t,a,l+1,r,o))}m=l+1}else r.noMoreEndComments=!0}r.noMoreEndComments&&t.pcdata&&t.pcdata("&lt;!--",o,Y,c(t,a,m,r,o));break;case"<!":if(/^\w/.test(g)){if(!r.noMoreGT){for(l=m+1;u>l&&">"!==a[l];l++);u>l?m=l+1:r.noMoreGT=!0}r.noMoreGT&&t.pcdata&&t.pcdata("&lt;!",o,Y,c(t,a,m,r,o))}else t.pcdata&&t.pcdata("&lt;!",o,Y,c(t,a,m,r,o));break;case"<?":if(!r.noMoreGT){for(l=m+1;u>l&&">"!==a[l];l++);u>l?m=l+1:r.noMoreGT=!0}r.noMoreGT&&t.pcdata&&t.pcdata("&lt;?",o,Y,c(t,a,m,r,o));break;case">":t.pcdata&&t.pcdata("&gt;",o,Y,c(t,a,m,r,o));break;case"":break;default:t.pcdata&&t.pcdata(f,o,Y,c(t,a,m,r,o))}}t.endDoc&&t.endDoc(o)}catch(M){if(M!==Y)throw M}}function u(e){var t=/(<\/|<\!--|<[!?]|[&<>])/g;if(e+="",$)return e.split(t);for(var a,n=[],r=0;null!==(a=t.exec(e));)n.push(e.substring(r,a.index)),n.push(a[0]),r=a.index+a[0].length;return n.push(e.substring(r)),n}function h(e,t,a,n,r,o){var i=f(e,t);return i?(a.endTag&&a.endTag(i.name,n,r,c(a,e,t,o,n)),i.next):e.length}function p(e,t,a,n,r,o){var i=f(e,t);return i?(a.startTag&&a.startTag(i.name,i.attrs,n,r,c(a,e,i.next,o,n)),i.eflags&j?d(e,i,a,n,r,o):i.next):e.length}function d(t,a,n,r,o,l){var s=t.length;Q.hasOwnProperty(a.name)||(Q[a.name]=new RegExp("^"+a.name+"(?:[\\s\\/]|$)","i"));for(var m=Q[a.name],u=a.next,h=a.next+1;s>h&&("</"!==t[h-1]||!m.test(t[h]));h++);s>h&&(h-=1);var p=t.slice(u,h).join("");if(a.eflags&e.eflags.CDATA)n.cdata&&n.cdata(p,r,o,c(n,t,h,l,r));else{if(!(a.eflags&e.eflags.RCDATA))throw new Error("bug");n.rcdata&&n.rcdata(i(p),r,o,c(n,t,h,l,r))}return h}function f(t,a){var n=/^([-\w:]+)/.exec(t[a]),r={};r.name=n[1].toLowerCase(),r.eflags=e.ELEMENTS[r.name];for(var o=t[a].substr(n[0].length),i=a+1,l=t.length;l>i&&">"!==t[i];i++)o+=t[i];if(i>=l)return void 0;for(var s=[];""!==o;)if(n=G.exec(o)){if(n[4]&&!n[5]||n[6]&&!n[7]){for(var c=n[4]||n[6],m=!1,u=[o,t[i++]];l>i;i++){if(m){if(">"===t[i])break}else 0<=t[i].indexOf(c)&&(m=!0);u.push(t[i])}if(i>=l)break;o=u.join("");continue}var h=n[1].toLowerCase(),p=n[2]?g(n[3]):"";s.push(h,p),o=o.substr(n[0].length)}else o=o.replace(/^[\s\S][^a-z\s]*/,"");return r.attrs=s,r.next=i+1,r}function g(e){var t=e.charCodeAt(0);return(34===t||39===t)&&(e=e.substr(1,e.length-2)),r(n(e))}function E(t){var a,n,r=function(e,t){n||t.push(e)};return l({startDoc:function(e){a=[],n=!1},startTag:function(r,i,l){if(!n&&e.ELEMENTS.hasOwnProperty(r)){var s=e.ELEMENTS[r];if(!(s&e.eflags.FOLDABLE)){var c=t(r,i);if(!c)return void(n=!(s&e.eflags.EMPTY));if("object"!=typeof c)throw new Error("tagPolicy did not return object (old API?)");if(!("attribs"in c))throw new Error("tagPolicy gave no attribs");i=c.attribs;var m,u;if("tagName"in c?(u=c.tagName,m=e.ELEMENTS[u]):(u=r,m=s),s&e.eflags.OPTIONAL_ENDTAG){var h=a[a.length-1];!h||h.orig!==r||h.rep===u&&r===u||l.push("</",h.rep,">")}s&e.eflags.EMPTY||a.push({orig:r,rep:u}),l.push("<",u);for(var p=0,d=i.length;d>p;p+=2){var f=i[p],g=i[p+1];null!==g&&void 0!==g&&l.push(" ",f,'="',o(g),'"')}l.push(">"),s&e.eflags.EMPTY&&!(m&e.eflags.EMPTY)&&l.push("</",u,">")}}},endTag:function(t,r){if(n)return void(n=!1);if(e.ELEMENTS.hasOwnProperty(t)){var o=e.ELEMENTS[t];if(!(o&(e.eflags.EMPTY|e.eflags.FOLDABLE))){var i;if(o&e.eflags.OPTIONAL_ENDTAG)for(i=a.length;--i>=0;){var l=a[i].orig;if(l===t)break;if(!(e.ELEMENTS[l]&e.eflags.OPTIONAL_ENDTAG))return}else for(i=a.length;--i>=0&&a[i].orig!==t;);if(0>i)return;for(var s=a.length;--s>i;){var c=a[s].rep;e.ELEMENTS[c]&e.eflags.OPTIONAL_ENDTAG||r.push("</",c,">")}i<a.length&&(t=a[i].rep),a.length=i,r.push("</",t,">")}}},pcdata:r,rcdata:r,cdata:r,endDoc:function(e){for(;a.length;a.length--)e.push("</",a[a.length-1].rep,">")}})}function T(e,t,a,n,r){if(!r)return null;try{var o=URI.parse(""+e);if(o&&(!o.hasScheme()||V.test(o.getScheme()))){var i=r(o,t,a,n);return i?i.toString():null}}catch(l){return null}return null}function L(e,t,a,n,r){if(a||e(t+" removed",{change:"removed",tagName:t}),n!==r){var o="changed";n&&!r?o="removed":!n&&r&&(o="added"),e(t+"."+a+" "+o,{change:o,tagName:t,attribName:a,oldValue:n,newValue:r})}}function M(e,t,a){var n;return n=t+"::"+a,e.hasOwnProperty(n)?e[n]:(n="*::"+a,e.hasOwnProperty(n)?e[n]:void 0)}function b(t,a){return M(e.LOADERTYPES,t,a)}function y(t,a){return M(e.URIEFFECTS,t,a)}function v(t,a,n,r,o){for(var i=0;i<a.length;i+=2){var l,s=a[i],c=a[i+1],m=c,u=null;if(l=t+"::"+s,(e.ATTRIBS.hasOwnProperty(l)||(l="*::"+s,e.ATTRIBS.hasOwnProperty(l)))&&(u=e.ATTRIBS[l]),null!==u)switch(u){case e.atype.NONE:break;case e.atype.SCRIPT:c=null,o&&L(o,t,s,m,c);break;case e.atype.STYLE:if("undefined"==typeof A){c=null,o&&L(o,t,s,m,c);break}var h=[];A(c,{declaration:function(t,a){var r=t.toLowerCase(),o=C[r];o&&(R(r,o,a,n?function(t){return T(t,e.ueffects.SAME_DOCUMENT,e.ltypes.SANDBOXED,{TYPE:"CSS",CSS_PROP:r},n)}:null),h.push(t+": "+a.join(" ")))}}),c=h.length>0?h.join(" ; "):null,o&&L(o,t,s,m,c);break;case e.atype.ID:case e.atype.IDREF:case e.atype.IDREFS:case e.atype.GLOBAL_NAME:case e.atype.LOCAL_NAME:case e.atype.CLASSES:c=r?r(c):c,o&&L(o,t,s,m,c);break;case e.atype.URI:c=T(c,y(t,s),b(t,s),{TYPE:"MARKUP",XML_ATTR:s,XML_TAG:t},n),o&&L(o,t,s,m,c);break;case e.atype.URI_FRAGMENT:c&&"#"===c.charAt(0)?(c=c.substring(1),c=r?r(c):c,null!==c&&void 0!==c&&(c="#"+c)):c=null,o&&L(o,t,s,m,c);break;default:c=null,o&&L(o,t,s,m,c)}else c=null,o&&L(o,t,s,m,c);a[i+1]=c}return a}function H(t,a,n){return function(r,o){return e.ELEMENTS[r]&e.eflags.UNSAFE?void(n&&L(n,r,void 0,void 0,void 0)):{attribs:v(r,o,t,a,n)}}}function _(e,t){var a=[];return E(t)(e,a),a.join("")}function w(e,t,a,n){var r=H(t,a,n);return _(e,r)}var A,R,C;"undefined"!=typeof window&&(A=window.parseCssDeclarations,R=window.sanitizeCssProperty,C=window.cssSchema);var S={lt:"<",LT:"<",gt:">",GT:">",amp:"&",AMP:"&",quot:'"',apos:"'",nbsp:"Â "},P=/^#(\d+)$/,D=/^#x([0-9A-Fa-f]+)$/,k=/^[A-Za-z][A-za-z0-9]+$/,I="undefined"!=typeof window&&window.document?window.document.createElement("textarea"):null,x=/\0/g,N=/&(#[0-9]+|#[xX][0-9A-Fa-f]+|\w+);/g,O=/^(#[0-9]+|#[xX][0-9A-Fa-f]+|\w+);/,F=/&/g,U=/&([^a-z#]|#(?:[^0-9x]|x(?:[^0-9a-f]|$)|$)|$)/gi,B=/[<]/g,q=/>/g,z=/\"/g,G=new RegExp("^\\s*([-.:\\w]+)(?:\\s*(=)\\s*((\")[^\"]*(\"|$)|(')[^']*('|$)|(?=[a-z][-\\w]*\\s*=)|[^\"'\\s]*))?","i"),$=3==="a,b".split(/(,)/).length,j=e.eflags.CDATA|e.eflags.RCDATA,Y={},Q={},V=/^(?:https?|mailto|data)$/i,X={};return X.escapeAttrib=X.escapeAttrib=o,X.makeHtmlSanitizer=X.makeHtmlSanitizer=E,X.makeSaxParser=X.makeSaxParser=l,X.makeTagPolicy=X.makeTagPolicy=H,X.normalizeRCData=X.normalizeRCData=i,X.sanitize=X.sanitize=w,X.sanitizeAttribs=X.sanitizeAttribs=v,X.sanitizeWithPolicy=X.sanitizeWithPolicy=_,X.unescapeEntities=X.unescapeEntities=r,X}(html4),html_sanitize=html.sanitize;html4.ATTRIBS["*::style"]=0,html4.ELEMENTS.style=0,html4.ATTRIBS["a::target"]=0,html4.ELEMENTS.video=0,html4.ATTRIBS["video::src"]=0,html4.ATTRIBS["video::poster"]=0,html4.ATTRIBS["video::controls"]=0,html4.ELEMENTS.audio=0,html4.ATTRIBS["audio::src"]=0,html4.ATTRIBS["video::autoplay"]=0,html4.ATTRIBS["video::controls"]=0,"undefined"!=typeof module&&(module.exports=html_sanitize);
},{}],6:[function(require,module,exports){
module.exports={"author":"Mapbox","name":"mapbox.js","description":"mapbox javascript api","version":"2.1.8","homepage":"http://mapbox.com/","repository":{"type":"git","url":"git://github.com/mapbox/mapbox.js.git"},"main":"src/index.js","dependencies":{"leaflet":"0.7.3","mustache":"0.7.3","corslite":"0.0.6","sanitize-caja":"0.1.3"},"scripts":{"test":"jshint src/*.js && mocha-phantomjs test/index.html"},"devDependencies":{"browserify":"^6.3.2","clean-css":"~2.0.7","expect.js":"0.3.1","happen":"0.1.3","jshint":"2.4.4","leaflet-fullscreen":"0.0.4","leaflet-hash":"0.2.1","marked":"~0.3.0","minifyify":"^6.1.0","minimist":"0.0.5","mocha":"1.17.1","mocha-phantomjs":"3.1.6","sinon":"1.10.2"},"optionalDependencies":{},"engines":{"node":"*"}}
},{}],7:[function(require,module,exports){
"use strict";module.exports={HTTP_URL:"http://a.tiles.mapbox.com/v4",HTTPS_URL:"https://a.tiles.mapbox.com/v4",FORCE_HTTPS:!1,REQUIRE_ACCESS_TOKEN:!0};
},{}],8:[function(require,module,exports){
"use strict";var util=require("./util"),urlhelper=require("./url"),request=require("./request"),marker=require("./marker"),simplestyle=require("./simplestyle"),FeatureLayer=L.FeatureGroup.extend({options:{filter:function(){return!0},sanitizer:require("sanitize-caja"),style:simplestyle.style,popupOptions:{closeButton:!1}},initialize:function(e,t){L.setOptions(this,t),this._layers={},"string"==typeof e?util.idUrl(e,this):e&&"object"==typeof e&&this.setGeoJSON(e)},setGeoJSON:function(e){return this._geojson=e,this.clearLayers(),this._initialize(e),this},getGeoJSON:function(){return this._geojson},loadURL:function(e){return this._request&&"abort"in this._request&&this._request.abort(),this._request=request(e,L.bind(function(t,i){this._request=null,t&&"abort"!==t.type?(util.log("could not load features at "+e),this.fire("error",{error:t})):i&&(this.setGeoJSON(i),this.fire("ready"))},this)),this},loadID:function(e){return this.loadURL(urlhelper("/"+e+"/features.json",this.options.accessToken))},setFilter:function(e){return this.options.filter=e,this._geojson&&(this.clearLayers(),this._initialize(this._geojson)),this},getFilter:function(){return this.options.filter},_initialize:function(e){var t,i,r=L.Util.isArray(e)?e:e.features;if(r)for(t=0,i=r.length;i>t;t++)(r[t].geometries||r[t].geometry||r[t].features)&&this._initialize(r[t]);else if(this.options.filter(e)){var s={accessToken:this.options.accessToken},o=this.options.pointToLayer||function(e,t){return marker.style(e,t,s)},n=L.GeoJSON.geometryToLayer(e,o),u=marker.createPopup(e,this.options.sanitizer),a=this.options.style;a&&"setStyle"in n&&("function"==typeof a&&(a=a(e)),n.setStyle(a)),n.feature=e,u&&n.bindPopup(u,this.options.popupOptions),this.addLayer(n)}}});module.exports.FeatureLayer=FeatureLayer,module.exports.featureLayer=function(e,t){return new FeatureLayer(e,t)};
},{"./marker":23,"./request":24,"./simplestyle":26,"./url":28,"./util":29,"sanitize-caja":4}],9:[function(require,module,exports){
"use strict";var Feedback=L.Class.extend({includes:L.Mixin.Events,data:{},record:function(e){L.extend(this.data,e),this.fire("change")}});module.exports=new Feedback;
},{}],10:[function(require,module,exports){
"use strict";var util=require("./util"),urlhelper=require("./url"),feedback=require("./feedback"),request=require("./request");module.exports=function(e,r){var t={};return util.strict(e,"string"),-1===e.indexOf("/")&&(e=urlhelper("/geocode/"+e+"/{query}.json",r&&r.accessToken)),t.getURL=function(){return e},t.queryURL=function(e){var r;if("string"!=typeof e){for(var n=[],u=0;u<e.length;u++)n[u]=encodeURIComponent(e[u]);r=n.join(";")}else r=encodeURIComponent(e);return feedback.record({geocoding:r}),L.Util.template(t.getURL(),{query:r})},t.query=function(e,r){return util.strict(r,"function"),request(t.queryURL(e),function(e,t){if(t&&(t.length||t.features)){var n={results:t};t.features&&t.features.length&&(n.latlng=[t.features[0].center[1],t.features[0].center[0]],t.features[0].bbox&&(n.bounds=t.features[0].bbox,n.lbounds=util.lbounds(n.bounds))),r(null,n)}else r(e||!0)}),t},t.reverseQuery=function(e,r){function n(e){return void 0!==e.lat&&void 0!==e.lng?e.lng+","+e.lat:void 0!==e.lat&&void 0!==e.lon?e.lon+","+e.lat:e[0]+","+e[1]}var u="";if(e.length&&e[0].length){for(var o=0,l=[];o<e.length;o++)l.push(n(e[o]));u=l.join(";")}else u=n(e);return request(t.queryURL(u),function(e,t){r(e,t)}),t},t};
},{"./feedback":9,"./request":24,"./url":28,"./util":29}],11:[function(require,module,exports){
"use strict";var geocoder=require("./geocoder"),util=require("./util"),GeocoderControl=L.Control.extend({includes:L.Mixin.Events,options:{position:"topleft",pointZoom:16,keepOpen:!1,autocomplete:!1},initialize:function(t,e){L.Util.setOptions(this,e),this.setURL(t),this._updateSubmit=L.bind(this._updateSubmit,this),this._updateAutocomplete=L.bind(this._updateAutocomplete,this),this._chooseResult=L.bind(this._chooseResult,this)},setURL:function(t){return this.geocoder=geocoder(t,{accessToken:this.options.accessToken}),this},getURL:function(){return this.geocoder.getURL()},setID:function(t){return this.setURL(t)},setTileJSON:function(t){return this.setURL(t.geocoder)},_toggle:function(t){t&&L.DomEvent.stop(t),L.DomUtil.hasClass(this._container,"active")?(L.DomUtil.removeClass(this._container,"active"),this._results.innerHTML="",this._input.blur()):(L.DomUtil.addClass(this._container,"active"),this._input.focus(),this._input.select())},_closeIfOpen:function(t){L.DomUtil.hasClass(this._container,"active")&&!this.options.keepOpen&&(L.DomUtil.removeClass(this._container,"active"),this._results.innerHTML="",this._input.blur())},onAdd:function(t){var e=L.DomUtil.create("div","leaflet-control-mapbox-geocoder leaflet-bar leaflet-control"),o=L.DomUtil.create("a","leaflet-control-mapbox-geocoder-toggle mapbox-icon mapbox-icon-geocoder",e),i=L.DomUtil.create("div","leaflet-control-mapbox-geocoder-results",e),s=L.DomUtil.create("div","leaflet-control-mapbox-geocoder-wrap",e),n=L.DomUtil.create("form","leaflet-control-mapbox-geocoder-form",s),r=L.DomUtil.create("input","",n);return o.href="#",o.innerHTML="&nbsp;",r.type="text",r.setAttribute("placeholder","Search"),L.DomEvent.addListener(n,"submit",this._geocode,this),L.DomEvent.addListener(r,"keyup",this._autocomplete,this),L.DomEvent.disableClickPropagation(e),this._map=t,this._results=i,this._input=r,this._form=n,this.options.keepOpen?L.DomUtil.addClass(e,"active"):(this._map.on("click",this._closeIfOpen,this),L.DomEvent.addListener(o,"click",this._toggle,this)),e},_updateSubmit:function(t,e){if(L.DomUtil.removeClass(this._container,"searching"),this._results.innerHTML="",t||!e)this.fire("error",{error:t});else{var o=[];e.results&&e.results.features&&(o=e.results.features),1===o.length?(this.fire("autoselect",{feature:o[0]}),this.fire("found",{results:e.results}),this._chooseResult(o[0]),this._closeIfOpen()):o.length>1?(this.fire("found",{results:e.results}),this._displayResults(o)):this._displayResults(o)}},_updateAutocomplete:function(t,e){if(this._results.innerHTML="",t||!e)this.fire("error",{error:t});else{var o=[];e.results&&e.results.features&&(o=e.results.features),o.length&&this.fire("found",{results:e.results}),this._displayResults(o)}},_displayResults:function(t){for(var e=0,o=Math.min(t.length,5);o>e;e++){var i=t[e],s=i.place_name;if(s.length){var n=L.DomUtil.create("a","",this._results),r="innerText"in n?"innerText":"textContent";n[r]=s,n.href="#",L.bind(function(t){L.DomEvent.addListener(n,"click",function(e){this._chooseResult(t),L.DomEvent.stop(e),this.fire("select",{feature:t})},this)},this)(i)}}if(t.length>5){var l=L.DomUtil.create("span","",this._results);l.innerHTML="Top 5 of "+t.length+" results"}},_chooseResult:function(t){t.bbox?this._map.fitBounds(util.lbounds(t.bbox)):t.center&&this._map.setView([t.center[1],t.center[0]],void 0===this._map.getZoom()?this.options.pointZoom:Math.max(this._map.getZoom(),this.options.pointZoom))},_geocode:function(t){return L.DomEvent.preventDefault(t),""===this._input.value?this._updateSubmit():(L.DomUtil.addClass(this._container,"searching"),void this.geocoder.query(this._input.value,this._updateSubmit))},_autocomplete:function(t){return this.options.autocomplete?""===this._input.value?this._updateAutocomplete():void this.geocoder.query(this._input.value,this._updateAutocomplete):void 0}});module.exports.GeocoderControl=GeocoderControl,module.exports.geocoderControl=function(t,e){return new GeocoderControl(t,e)};
},{"./geocoder":10,"./util":29}],12:[function(require,module,exports){
"use strict";function utfDecode(t){return t>=93&&t--,t>=35&&t--,t-32}module.exports=function(t){return function(e,r){if(t){var u=utfDecode(t.grid[r].charCodeAt(e)),n=t.keys[u];return t.data[n]}}};
},{}],13:[function(require,module,exports){
"use strict";var util=require("./util"),Mustache=require("mustache"),GridControl=L.Control.extend({options:{pinnable:!0,follow:!1,sanitizer:require("sanitize-caja"),touchTeaser:!0,location:!0},_currentContent:"",_pinned:!1,initialize:function(t,o){L.Util.setOptions(this,o),util.strict_instance(t,L.Class,"L.mapbox.gridLayer"),this._layer=t},setTemplate:function(t){return util.strict(t,"string"),this.options.template=t,this},_template:function(t,o){if(o){var i=this.options.template||this._layer.getTileJSON().template;if(i){var e={};return e["__"+t+"__"]=!0,this.options.sanitizer(Mustache.to_html(i,L.extend(e,o)))}}},_show:function(t,o){t!==this._currentContent&&(this._currentContent=t,this.options.follow?(this._popup.setContent(t).setLatLng(o.latLng),this._map._popup!==this._popup&&this._popup.openOn(this._map)):(this._container.style.display="block",this._contentWrapper.innerHTML=t))},hide:function(){return this._pinned=!1,this._currentContent="",this._map.closePopup(),this._container.style.display="none",this._contentWrapper.innerHTML="",L.DomUtil.removeClass(this._container,"closable"),this},_mouseover:function(t){if(t.data?L.DomUtil.addClass(this._map._container,"map-clickable"):L.DomUtil.removeClass(this._map._container,"map-clickable"),!this._pinned){var o=this._template("teaser",t.data);o?this._show(o,t):this.hide()}},_mousemove:function(t){this._pinned||this.options.follow&&this._popup.setLatLng(t.latLng)},_navigateTo:function(t){window.top.location.href=t},_click:function(t){var o=this._template("location",t.data);if(this.options.location&&o&&0===o.search(/^https?:/))return this._navigateTo(this._template("location",t.data));if(this.options.pinnable){var i=this._template("full",t.data);!i&&this.options.touchTeaser&&L.Browser.touch&&(i=this._template("teaser",t.data)),i?(L.DomUtil.addClass(this._container,"closable"),this._pinned=!0,this._show(i,t)):this._pinned&&(L.DomUtil.removeClass(this._container,"closable"),this._pinned=!1,this.hide())}},_onPopupClose:function(){this._currentContent=null,this._pinned=!1},_createClosebutton:function(t,o){var i=L.DomUtil.create("a","close",t);return i.innerHTML="close",i.href="#",i.title="close",L.DomEvent.on(i,"click",L.DomEvent.stopPropagation).on(i,"mousedown",L.DomEvent.stopPropagation).on(i,"dblclick",L.DomEvent.stopPropagation).on(i,"click",L.DomEvent.preventDefault).on(i,"click",o,this),i},onAdd:function(t){this._map=t;var o="leaflet-control-grid map-tooltip",i=L.DomUtil.create("div",o),e=L.DomUtil.create("div","map-tooltip-content");return i.style.display="none",this._createClosebutton(i,this.hide),i.appendChild(e),this._contentWrapper=e,this._popup=new L.Popup({autoPan:!1,closeOnClick:!1}),t.on("popupclose",this._onPopupClose,this),L.DomEvent.disableClickPropagation(i).addListener(i,"mousewheel",L.DomEvent.stopPropagation),this._layer.on("mouseover",this._mouseover,this).on("mousemove",this._mousemove,this).on("click",this._click,this),i},onRemove:function(t){t.off("popupclose",this._onPopupClose,this),this._layer.off("mouseover",this._mouseover,this).off("mousemove",this._mousemove,this).off("click",this._click,this)}});module.exports.GridControl=GridControl,module.exports.gridControl=function(t,o){return new GridControl(t,o)};
},{"./util":29,"mustache":3,"sanitize-caja":4}],14:[function(require,module,exports){
"use strict";var util=require("./util"),request=require("./request"),grid=require("./grid"),GridLayer=L.Class.extend({includes:[L.Mixin.Events,require("./load_tilejson")],options:{template:function(){return""}},_mouseOn:null,_tilejson:{},_cache:{},initialize:function(t,i){L.Util.setOptions(this,i),this._loadTileJSON(t)},_setTileJSON:function(t){return util.strict(t,"object"),L.extend(this.options,{grids:t.grids,minZoom:t.minzoom,maxZoom:t.maxzoom,bounds:t.bounds&&util.lbounds(t.bounds)}),this._tilejson=t,this._cache={},this._update(),this},getTileJSON:function(){return this._tilejson},active:function(){return!!(this._map&&this.options.grids&&this.options.grids.length)},addTo:function(t){return t.addLayer(this),this},onAdd:function(t){this._map=t,this._update(),this._map.on("click",this._click,this).on("mousemove",this._move,this).on("moveend",this._update,this)},onRemove:function(){this._map.off("click",this._click,this).off("mousemove",this._move,this).off("moveend",this._update,this)},getData:function(t,i){if(this.active()){var e=this._map,o=e.project(t.wrap()),s=256,n=4,a=Math.floor(o.x/s),h=Math.floor(o.y/s),r=e.options.crs.scale(e.getZoom())/s;return a=(a+r)%r,h=(h+r)%r,this._getTile(e.getZoom(),a,h,function(t){var e=Math.floor((o.x-a*s)/n),r=Math.floor((o.y-h*s)/n);i(t(e,r))}),this}},_click:function(t){this.getData(t.latlng,L.bind(function(i){this.fire("click",{latLng:t.latlng,data:i})},this))},_move:function(t){this.getData(t.latlng,L.bind(function(i){i!==this._mouseOn?(this._mouseOn&&this.fire("mouseout",{latLng:t.latlng,data:this._mouseOn}),this.fire("mouseover",{latLng:t.latlng,data:i}),this._mouseOn=i):this.fire("mousemove",{latLng:t.latlng,data:i})},this))},_getTileURL:function(t){var i=this.options.grids,e=(t.x+t.y)%i.length,o=i[e];return L.Util.template(o,t)},_update:function(){if(this.active()){var t=this._map.getPixelBounds(),i=this._map.getZoom(),e=256;if(!(i>this.options.maxZoom||i<this.options.minZoom))for(var o=L.bounds(t.min.divideBy(e)._floor(),t.max.divideBy(e)._floor()),s=this._map.options.crs.scale(i)/e,n=o.min.x;n<=o.max.x;n++)for(var a=o.min.y;a<=o.max.y;a++)this._getTile(i,(n%s+s)%s,(a%s+s)%s)}},_getTile:function(t,i,e,o){var s=t+"_"+i+"_"+e,n=L.point(i,e);if(n.z=t,this._tileShouldBeLoaded(n)){if(s in this._cache){if(!o)return;return void("function"==typeof this._cache[s]?o(this._cache[s]):this._cache[s].push(o))}this._cache[s]=[],o&&this._cache[s].push(o),request(this._getTileURL(n),L.bind(function(t,i){var e=this._cache[s];this._cache[s]=grid(i);for(var o=0;o<e.length;++o)e[o](this._cache[s])},this))}},_tileShouldBeLoaded:function(t){if(t.z>this.options.maxZoom||t.z<this.options.minZoom)return!1;if(this.options.bounds){var i=256,e=t.multiplyBy(i),o=e.add(new L.Point(i,i)),s=this._map.unproject(e),n=this._map.unproject(o),a=new L.LatLngBounds([s,n]);if(!this.options.bounds.intersects(a))return!1}return!0}});module.exports.GridLayer=GridLayer,module.exports.gridLayer=function(t,i){return new GridLayer(t,i)};
},{"./grid":12,"./load_tilejson":19,"./request":24,"./util":29}],15:[function(require,module,exports){
require("./leaflet"),require("./mapbox");
},{"./leaflet":17,"./mapbox":21}],16:[function(require,module,exports){
"use strict";var InfoControl=L.Control.extend({options:{position:"bottomright",sanitizer:require("sanitize-caja")},initialize:function(t){L.setOptions(this,t),this._info={},console.warn("infoControl has been deprecated and will be removed in mapbox.js v3.0.0. Use the default attribution control instead, which is now responsive.")},onAdd:function(t){this._container=L.DomUtil.create("div","mapbox-control-info mapbox-small"),this._content=L.DomUtil.create("div","map-info-container",this._container);var i=L.DomUtil.create("a","mapbox-info-toggle mapbox-icon mapbox-icon-info",this._container);i.href="#",L.DomEvent.addListener(i,"click",this._showInfo,this),L.DomEvent.disableClickPropagation(this._container);for(var n in t._layers)t._layers[n].getAttribution&&this.addInfo(t._layers[n].getAttribution());return t.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(t){t.off("layeradd",this._onLayerAdd,this).off("layerremove",this._onLayerRemove,this)},addInfo:function(t){return t?(this._info[t]||(this._info[t]=0),this._info[t]=!0,this._update()):this},removeInfo:function(t){return t?(this._info[t]&&(this._info[t]=!1),this._update()):this},_showInfo:function(t){return L.DomEvent.preventDefault(t),this._active===!0?this._hidecontent():(L.DomUtil.addClass(this._container,"active"),this._active=!0,void this._update())},_hidecontent:function(){this._content.innerHTML="",this._active=!1,L.DomUtil.removeClass(this._container,"active")},_update:function(){if(!this._map)return this;this._content.innerHTML="";var t="none",i=[];for(var n in this._info)this._info.hasOwnProperty(n)&&this._info[n]&&(i.push(this.options.sanitizer(n)),t="block");return this._content.innerHTML+=i.join(" | "),this._container.style.display=t,this},_onLayerAdd:function(t){t.layer.getAttribution&&t.layer.getAttribution()?this.addInfo(t.layer.getAttribution()):"on"in t.layer&&t.layer.getAttribution&&t.layer.on("ready",L.bind(function(){this.addInfo(t.layer.getAttribution())},this))},_onLayerRemove:function(t){t.layer.getAttribution&&this.removeInfo(t.layer.getAttribution())}});module.exports.InfoControl=InfoControl,module.exports.infoControl=function(t){return new InfoControl(t)};
},{"sanitize-caja":4}],17:[function(require,module,exports){
window.L=require("leaflet/dist/leaflet-src");
},{"leaflet/dist/leaflet-src":2}],18:[function(require,module,exports){
"use strict";var LegendControl=L.Control.extend({options:{position:"bottomright",sanitizer:require("sanitize-caja")},initialize:function(e){L.setOptions(this,e),this._legends={}},onAdd:function(e){return this._container=L.DomUtil.create("div","map-legends wax-legends"),L.DomEvent.disableClickPropagation(this._container),this._update(),this._container},addLegend:function(e){return e?(this._legends[e]||(this._legends[e]=0),this._legends[e]++,this._update()):this},removeLegend:function(e){return e?(this._legends[e]&&this._legends[e]--,this._update()):this},_update:function(){if(!this._map)return this;this._container.innerHTML="";var e="none";for(var t in this._legends)if(this._legends.hasOwnProperty(t)&&this._legends[t]){var n=L.DomUtil.create("div","map-legend wax-legend",this._container);n.innerHTML=this.options.sanitizer(t),e="block"}return this._container.style.display=e,this}});module.exports.LegendControl=LegendControl,module.exports.legendControl=function(e){return new LegendControl(e)};
},{"sanitize-caja":4}],19:[function(require,module,exports){
"use strict";var request=require("./request"),url=require("./url"),util=require("./util");module.exports={_loadTileJSON:function(e){"string"==typeof e?(e=url.tileJSON(e,this.options&&this.options.accessToken),request(e,L.bind(function(t,i){t?(util.log("could not load TileJSON at "+e),this.fire("error",{error:t})):i&&(this._setTileJSON(i),this.fire("ready"))},this))):e&&"object"==typeof e&&this._setTileJSON(e)}};
},{"./request":24,"./url":28,"./util":29}],20:[function(require,module,exports){
"use strict";function withAccessToken(t,o){return!o||t.accessToken?t:L.extend({accessToken:o},t)}var util=require("./util"),tileLayer=require("./tile_layer").tileLayer,featureLayer=require("./feature_layer").featureLayer,gridLayer=require("./grid_layer").gridLayer,gridControl=require("./grid_control").gridControl,infoControl=require("./info_control").infoControl,shareControl=require("./share_control").shareControl,legendControl=require("./legend_control").legendControl,mapboxLogoControl=require("./mapbox_logo").mapboxLogoControl,feedback=require("./feedback"),LMap=L.Map.extend({includes:[require("./load_tilejson")],options:{tileLayer:{},featureLayer:{},gridLayer:{},legendControl:{},gridControl:{},infoControl:!1,shareControl:!1,sanitizer:require("sanitize-caja")},_tilejson:{},initialize:function(t,o,e){if(L.Map.prototype.initialize.call(this,t,L.extend({},L.Map.prototype.options,e)),this.attributionControl){this.attributionControl.setPrefix("");var i=this.options.attributionControl.compact;(i||i!==!1&&this._container.offsetWidth<=640)&&L.DomUtil.addClass(this.attributionControl._container,"leaflet-compact-attribution"),void 0===i&&this.on("resize",function(){this._container.offsetWidth>640?L.DomUtil.removeClass(this.attributionControl._container,"leaflet-compact-attribution"):L.DomUtil.addClass(this.attributionControl._container,"leaflet-compact-attribution")})}this.options.tileLayer&&(this.tileLayer=tileLayer(void 0,withAccessToken(this.options.tileLayer,this.options.accessToken)),this.addLayer(this.tileLayer)),this.options.featureLayer&&(this.featureLayer=featureLayer(void 0,withAccessToken(this.options.featureLayer,this.options.accessToken)),this.addLayer(this.featureLayer)),this.options.gridLayer&&(this.gridLayer=gridLayer(void 0,withAccessToken(this.options.gridLayer,this.options.accessToken)),this.addLayer(this.gridLayer)),this.options.gridLayer&&this.options.gridControl&&(this.gridControl=gridControl(this.gridLayer,this.options.gridControl),this.addControl(this.gridControl)),this.options.infoControl&&(this.infoControl=infoControl(this.options.infoControl),this.addControl(this.infoControl)),this.options.legendControl&&(this.legendControl=legendControl(this.options.legendControl),this.addControl(this.legendControl)),this.options.shareControl&&(this.shareControl=shareControl(void 0,withAccessToken(this.options.shareControl,this.options.accessToken)),this.addControl(this.shareControl)),this._mapboxLogoControl=mapboxLogoControl(this.options.mapboxLogoControl),this.addControl(this._mapboxLogoControl),this._loadTileJSON(o),this.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this).on("moveend",this._updateMapFeedbackLink,this),this.whenReady(function(){feedback.on("change",this._updateMapFeedbackLink,this)}),this.on("unload",function(){feedback.off("change",this._updateMapFeedbackLink,this)})},_setTileJSON:function(t){return this._tilejson=t,this._initialize(t),this},getTileJSON:function(){return this._tilejson},_initialize:function(t){if(this.tileLayer&&(this.tileLayer._setTileJSON(t),this._updateLayer(this.tileLayer)),this.featureLayer&&!this.featureLayer.getGeoJSON()&&t.data&&t.data[0]&&this.featureLayer.loadURL(t.data[0]),this.gridLayer&&(this.gridLayer._setTileJSON(t),this._updateLayer(this.gridLayer)),this.infoControl&&t.attribution&&(this.infoControl.addInfo(this.options.sanitizer(t.attribution)),this._updateMapFeedbackLink()),this.legendControl&&t.legend&&this.legendControl.addLegend(t.legend),this.shareControl&&this.shareControl._setTileJSON(t),this._mapboxLogoControl._setTileJSON(t),!this._loaded&&t.center){var o=void 0!==this.getZoom()?this.getZoom():t.center[2],e=L.latLng(t.center[1],t.center[0]);this.setView(e,o)}},_updateMapFeedbackLink:function(){if(this._controlContainer.getElementsByClassName){var t=this._controlContainer.getElementsByClassName("mapbox-improve-map");if(t.length&&this._loaded){var o=this.getCenter().wrap(),e=this._tilejson||{},i=e.id||"",n="#"+i+"/"+o.lng.toFixed(3)+"/"+o.lat.toFixed(3)+"/"+this.getZoom();for(var r in feedback.data)n+="/"+r+"="+feedback.data[r];for(var a=0;a<t.length;a++)t[a].hash=n}}},_onLayerAdd:function(t){"on"in t.layer&&t.layer.on("ready",this._onLayerReady,this),window.setTimeout(L.bind(this._updateMapFeedbackLink,this),0)},_onLayerRemove:function(t){"on"in t.layer&&t.layer.off("ready",this._onLayerReady,this),window.setTimeout(L.bind(this._updateMapFeedbackLink,this),0)},_onLayerReady:function(t){this._updateLayer(t.target)},_updateLayer:function(t){t.options&&(this.infoControl&&this._loaded&&this.infoControl.addInfo(t.options.infoControl),this.attributionControl&&this._loaded&&t.getAttribution&&this.attributionControl.addAttribution(t.getAttribution()),L.stamp(t)in this._zoomBoundLayers||!t.options.maxZoom&&!t.options.minZoom||(this._zoomBoundLayers[L.stamp(t)]=t),this._updateMapFeedbackLink(),this._updateZoomLevels())}});module.exports.Map=LMap,module.exports.map=function(t,o,e){return new LMap(t,o,e)};
},{"./feature_layer":8,"./feedback":9,"./grid_control":13,"./grid_layer":14,"./info_control":16,"./legend_control":18,"./load_tilejson":19,"./mapbox_logo":22,"./share_control":25,"./tile_layer":27,"./util":29,"sanitize-caja":4}],21:[function(require,module,exports){
"use strict";var geocoderControl=require("./geocoder_control"),gridControl=require("./grid_control"),featureLayer=require("./feature_layer"),legendControl=require("./legend_control"),shareControl=require("./share_control"),tileLayer=require("./tile_layer"),infoControl=require("./info_control"),map=require("./map"),gridLayer=require("./grid_layer");L.mapbox=module.exports={VERSION:require("../package.json").version,geocoder:require("./geocoder"),marker:require("./marker"),simplestyle:require("./simplestyle"),tileLayer:tileLayer.tileLayer,TileLayer:tileLayer.TileLayer,infoControl:infoControl.infoControl,InfoControl:infoControl.InfoControl,shareControl:shareControl.shareControl,ShareControl:shareControl.ShareControl,legendControl:legendControl.legendControl,LegendControl:legendControl.LegendControl,geocoderControl:geocoderControl.geocoderControl,GeocoderControl:geocoderControl.GeocoderControl,gridControl:gridControl.gridControl,GridControl:gridControl.GridControl,gridLayer:gridLayer.gridLayer,GridLayer:gridLayer.GridLayer,featureLayer:featureLayer.featureLayer,FeatureLayer:featureLayer.FeatureLayer,map:map.map,Map:map.Map,config:require("./config"),sanitize:require("sanitize-caja"),template:require("mustache").to_html,feedback:require("./feedback")},window.L.Icon.Default.imagePath=("https:"==document.location.protocol||"http:"==document.location.protocol?"":"https:")+"//api.tiles.mapbox.com/mapbox.js/v"+require("../package.json").version+"/images";
},{"../package.json":6,"./config":7,"./feature_layer":8,"./feedback":9,"./geocoder":10,"./geocoder_control":11,"./grid_control":13,"./grid_layer":14,"./info_control":16,"./legend_control":18,"./map":20,"./marker":23,"./share_control":25,"./simplestyle":26,"./tile_layer":27,"mustache":3,"sanitize-caja":4}],22:[function(require,module,exports){
"use strict";var MapboxLogoControl=L.Control.extend({options:{position:"bottomleft"},initialize:function(o){L.setOptions(this,o)},onAdd:function(o){return this._container=L.DomUtil.create("div","mapbox-logo"),this._container},_setTileJSON:function(o){o.mapbox_logo&&L.DomUtil.addClass(this._container,"mapbox-logo-true")}});module.exports.MapboxLogoControl=MapboxLogoControl,module.exports.mapboxLogoControl=function(o){return new MapboxLogoControl(o)};
},{}],23:[function(require,module,exports){
"use strict";function icon(e,r){e=e||{};var i={small:[20,50],medium:[30,70],large:[35,90]},t=e["marker-size"]||"medium",o="marker-symbol"in e&&""!==e["marker-symbol"]?"-"+e["marker-symbol"]:"",s=(e["marker-color"]||"7e7e7e").replace("#","");return L.icon({iconUrl:url("/marker/pin-"+t.charAt(0)+o+"+"+s+(L.Browser.retina?"@2x":"")+".png",r&&r.accessToken),iconSize:i[t],iconAnchor:[i[t][0]/2,i[t][1]/2],popupAnchor:[0,-i[t][1]/2]})}function style(e,r,i){return L.marker(r,{icon:icon(e.properties,i),title:util.strip_tags(sanitize(e.properties&&e.properties.title||""))})}function createPopup(e,r){if(!e||!e.properties)return"";var i="";return e.properties.title&&(i+='<div class="marker-title">'+e.properties.title+"</div>"),e.properties.description&&(i+='<div class="marker-description">'+e.properties.description+"</div>"),(r||sanitize)(i)}var url=require("./url"),util=require("./util"),sanitize=require("sanitize-caja");module.exports={icon:icon,style:style,createPopup:createPopup};
},{"./url":28,"./util":29,"sanitize-caja":4}],24:[function(require,module,exports){
"use strict";var corslite=require("corslite"),strict=require("./util").strict,config=require("./config"),protocol=/^(https?:)?(?=\/\/(.|api)\.tiles\.mapbox\.com\/)/;module.exports=function(t,o){function r(t,r){!t&&r&&(r=JSON.parse(r.responseText)),o(t,r)}return strict(t,"string"),strict(o,"function"),t=t.replace(protocol,function(t,o){return"withCredentials"in new window.XMLHttpRequest?"https:"===o||"https:"===document.location.protocol||config.FORCE_HTTPS?"https:":"http:":document.location.protocol}),corslite(t,r)};
},{"./config":7,"./util":29,"corslite":1}],25:[function(require,module,exports){
"use strict";var urlhelper=require("./url"),ShareControl=L.Control.extend({includes:[require("./load_tilejson")],options:{position:"topleft",url:""},initialize:function(t,e){L.setOptions(this,e),this._loadTileJSON(t)},_setTileJSON:function(t){this._tilejson=t},onAdd:function(t){this._map=t;var e=L.DomUtil.create("div","leaflet-control-mapbox-share leaflet-bar"),o=L.DomUtil.create("a","mapbox-share mapbox-icon mapbox-icon-share",e);return o.href="#",this._modal=L.DomUtil.create("div","mapbox-modal",this._map._container),this._mask=L.DomUtil.create("div","mapbox-modal-mask",this._modal),this._content=L.DomUtil.create("div","mapbox-modal-content",this._modal),L.DomEvent.addListener(o,"click",this._shareClick,this),L.DomEvent.disableClickPropagation(e),this._map.on("mousedown",this._clickOut,this),e},_clickOut:function(t){return this._sharing?(L.DomEvent.preventDefault(t),L.DomUtil.removeClass(this._modal,"active"),this._content.innerHTML="",void(this._sharing=null)):void 0},_shareClick:function(t){if(L.DomEvent.stop(t),this._sharing)return this._clickOut(t);var e=this._tilejson||this._map._tilejson||{},o=encodeURIComponent(this.options.url||e.webpage||window.location),i=encodeURIComponent(e.name),a=urlhelper("/"+e.id+"/"+this._map.getCenter().lng+","+this._map.getCenter().lat+","+this._map.getZoom()+"/600x600.png",this.options.accessToken),n=urlhelper("/"+e.id+".html",this.options.accessToken),s="//twitter.com/intent/tweet?status="+i+" "+o,r="//www.facebook.com/sharer.php?u="+o+"&t="+encodeURIComponent(e.name),l="//www.pinterest.com/pin/create/button/?url="+o+"&media="+a+"&description="+e.name,c="<h3>Share this map</h3><div class='mapbox-share-buttons'><a class='mapbox-button mapbox-button-icon mapbox-icon-facebook' target='_blank' href='{{facebook}}'>Facebook</a><a class='mapbox-button mapbox-button-icon mapbox-icon-twitter' target='_blank' href='{{twitter}}'>Twitter</a><a class='mapbox-button mapbox-button-icon mapbox-icon-pinterest' target='_blank' href='{{pinterest}}'>Pinterest</a></div>".replace("{{twitter}}",s).replace("{{facebook}}",r).replace("{{pinterest}}",l),m='<iframe width="100%" height="500px" frameBorder="0" src="{{embed}}"></iframe>'.replace("{{embed}}",n),h="Copy and paste this <strong>HTML code</strong> into documents to embed this map on web pages.";L.DomUtil.addClass(this._modal,"active"),this._sharing=L.DomUtil.create("div","mapbox-modal-body",this._content),this._sharing.innerHTML=c;var p=L.DomUtil.create("input","mapbox-embed",this._sharing);p.type="text",p.value=m;var d=L.DomUtil.create("label","mapbox-embed-description",this._sharing);d.innerHTML=h;var b=L.DomUtil.create("a","leaflet-popup-close-button",this._sharing);b.href="#",L.DomEvent.disableClickPropagation(this._sharing),L.DomEvent.addListener(b,"click",this._clickOut,this),L.DomEvent.addListener(p,"click",function(t){t.target.focus(),t.target.select()})}});module.exports.ShareControl=ShareControl,module.exports.shareControl=function(t,e){return new ShareControl(t,e)};
},{"./load_tilejson":19,"./url":28}],26:[function(require,module,exports){
"use strict";function fallback(t,l){var i={};for(var r in l)void 0===t[r]?i[r]=l[r]:i[r]=t[r];return i}function remap(t){for(var l={},i=0;i<mapping.length;i++)l[mapping[i][1]]=t[mapping[i][0]];return l}function style(t){return remap(fallback(t.properties||{},defaults))}var defaults={stroke:"#555555","stroke-width":2,"stroke-opacity":1,fill:"#555555","fill-opacity":.5},mapping=[["stroke","color"],["stroke-width","weight"],["stroke-opacity","opacity"],["fill","fillColor"],["fill-opacity","fillOpacity"]];module.exports={style:style,defaults:defaults};
},{}],27:[function(require,module,exports){
"use strict";var util=require("./util"),formatPattern=/\.((?:png|jpg)\d*)(?=$|\?)/,TileLayer=L.TileLayer.extend({includes:[require("./load_tilejson")],options:{sanitizer:require("sanitize-caja")},formats:["png","jpg","png32","png64","png128","png256","jpg70","jpg80","jpg90"],scalePrefix:"@2x.",initialize:function(t,i){L.TileLayer.prototype.initialize.call(this,void 0,i),this._tilejson={},i&&i.format&&util.strict_oneof(i.format,this.formats),this._loadTileJSON(t)},setFormat:function(t){return util.strict(t,"string"),this.options.format=t,this.redraw(),this},setUrl:null,_setTileJSON:function(t){return util.strict(t,"object"),this.options.format=this.options.format||t.tiles[0].match(formatPattern)[1],L.extend(this.options,{tiles:t.tiles,attribution:this.options.sanitizer(t.attribution),minZoom:t.minzoom||0,maxZoom:t.maxzoom||18,tms:"tms"===t.scheme,bounds:t.bounds&&util.lbounds(t.bounds)}),this._tilejson=t,this.redraw(),this},getTileJSON:function(){return this._tilejson},getTileUrl:function(t){var i=this.options.tiles,e=Math.floor(Math.abs(t.x+t.y)%i.length),o=i[e],r=L.Util.template(o,t);return r?r.replace(formatPattern,(L.Browser.retina?this.scalePrefix:".")+this.options.format):r},_update:function(){this.options.tiles&&L.TileLayer.prototype._update.call(this)}});module.exports.TileLayer=TileLayer,module.exports.tileLayer=function(t,i){return new TileLayer(t,i)};
},{"./load_tilejson":19,"./util":29,"sanitize-caja":4}],28:[function(require,module,exports){
"use strict";var config=require("./config"),version=require("../package.json").version;module.exports=function(e,o){if(o=o||L.mapbox.accessToken,!o&&config.REQUIRE_ACCESS_TOKEN)throw new Error("An API access token is required to use Mapbox.js. See https://www.mapbox.com/mapbox.js/api/v"+version+"/api-access-tokens/");var s="https:"===document.location.protocol||config.FORCE_HTTPS?config.HTTPS_URL:config.HTTP_URL;if(s+=e,s+=-1!==s.indexOf("?")?"&access_token=":"?access_token=",config.REQUIRE_ACCESS_TOKEN){if("s"===o[0])throw new Error("Use a public access token (pk.*) with Mapbox.js, not a secret access token (sk.*). See https://www.mapbox.com/mapbox.js/api/v"+version+"/api-access-tokens/");s+=o}return s},module.exports.tileJSON=function(e,o){if(-1!==e.indexOf("/"))return e;var s=module.exports("/"+e+".json",o);return 0===s.indexOf("https")&&(s+="&secure"),s};
},{"../package.json":6,"./config":7}],29:[function(require,module,exports){
"use strict";function contains(n,t){if(!t||!t.length)return!1;for(var r=0;r<t.length;r++)if(t[r]==n)return!0;return!1}module.exports={idUrl:function(n,t){-1==n.indexOf("/")?t.loadID(n):t.loadURL(n)},log:function(n){"object"==typeof console&&"function"==typeof console.error&&console.error(n)},strict:function(n,t){if(typeof n!==t)throw new Error("Invalid argument: "+t+" expected")},strict_instance:function(n,t,r){if(!(n instanceof t))throw new Error("Invalid argument: "+r+" expected")},strict_oneof:function(n,t){if(!contains(n,t))throw new Error("Invalid argument: "+n+" given, valid values are "+t.join(", "))},strip_tags:function(n){return n.replace(/<[^<]+>/g,"")},lbounds:function(n){return new L.LatLngBounds([[n[1],n[0]],[n[3],n[2]]])}};
},{}]},{},[15])
//# sourceMappingURL=mapbox.js.map
/* ---------------------------------------------------------
HTML5 Bones
This stylesheet contains print styling and a section for
you to simply add your own. This is a basic template
after all.
---------------------------------------------------------*/
body {
}
/* Default link styling */
a:link { color:#0271fb; }
a:visited { color:#bd02fb; }
a:hover, a:focus { color:#000; }
a:active { color:#fb0e02; }
/* ---------------------------------------------------------
Author's styles
---------------------------------------------------------*/
/*
html { height: 100% }
body { height: 100%; margin: 0; padding: 0;}
#map { height: 100% }
*/
#map {
width: 900px;
height: 500px;
}
/* ---------------------------------------------------------
Print styles
---------------------------------------------------------*/
@media print {
* {
color:#000 !important;
box-shadow:none !important;
text-shadow:none !important;
background:transparent !important;
}
html { background-color:#fff; }
/* Hide navigation */
nav { display:none; }
/* Show link destinations in brackets after the link text */
a[href]:after { content: " (" attr(href) ") "; }
a[href] {
font-weight:bold;
text-decoration:underline;
color:#06c;
border:none;
}
/* Don't show link destinations for JavaScript or internal links */
a[href^="javascript:"]:after, a[href^="#"]:after { content:""; }
/* Show abbr title value in brackets after the text */
abbr[title]:after { content: " (" attr(title) ")"; }
figure {
margin-bottom:1em;
overflow:hidden;
}
figure img { border:1px solid #000; }
}
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.turf=t()}}(function(){var t;return function e(t,o,n){function r(s,a){if(!o[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(i)return i(s,!0);var p=new Error("Cannot find module '"+s+"'");throw p.code="MODULE_NOT_FOUND",p}var g=o[s]={exports:{}};t[s][0].call(g.exports,function(e){var o=t[s][1][e];return r(o?o:e)},g,g.exports,e,t,o,n)}return o[s].exports}for(var i="function"==typeof require&&require,s=0;s<n.length;s++)r(n[s]);return r}({1:[function(t,e){e.exports={isClockwise:t("turf-is-clockwise"),isolines:t("turf-isolines"),isobands:t("turf-isobands"),merge:t("turf-merge"),convex:t("turf-convex"),within:t("turf-within"),concave:t("turf-concave"),count:t("turf-count"),erase:t("turf-erase"),variance:t("turf-variance"),deviation:t("turf-deviation"),median:t("turf-median"),min:t("turf-min"),max:t("turf-max"),aggregate:t("turf-aggregate"),flip:t("turf-flip"),simplify:t("turf-simplify"),sum:t("turf-sum"),average:t("turf-average"),bezier:t("turf-bezier"),tag:t("turf-tag"),size:t("turf-size"),sample:t("turf-sample"),jenks:t("turf-jenks"),quantile:t("turf-quantile"),envelope:t("turf-envelope"),square:t("turf-square"),midpoint:t("turf-midpoint"),buffer:t("turf-buffer"),center:t("turf-center"),centroid:t("turf-centroid"),combine:t("turf-combine"),distance:t("turf-distance"),explode:t("turf-explode"),extent:t("turf-extent"),bboxPolygon:t("turf-bbox-polygon"),featurecollection:t("turf-featurecollection"),filter:t("turf-filter"),grid:t("turf-grid"),inside:t("turf-inside"),intersect:t("turf-intersect"),linestring:t("turf-linestring"),nearest:t("turf-nearest"),planepoint:t("turf-planepoint"),point:t("turf-point"),polygon:t("turf-polygon"),reclass:t("turf-reclass"),remove:t("turf-remove"),tin:t("turf-tin"),union:t("turf-union"),bearing:t("turf-bearing"),destination:t("turf-destination"),hex:t("turf-hex"),kinks:t("turf-kinks"),pointOnSurface:t("turf-point-on-surface")}},{"turf-aggregate":6,"turf-average":29,"turf-bbox-polygon":30,"turf-bearing":32,"turf-bezier":33,"turf-buffer":35,"turf-center":40,"turf-centroid":41,"turf-combine":42,"turf-concave":43,"turf-convex":44,"turf-count":45,"turf-destination":47,"turf-deviation":48,"turf-distance":50,"turf-envelope":51,"turf-erase":56,"turf-explode":61,"turf-extent":65,"turf-featurecollection":67,"turf-filter":68,"turf-flip":69,"turf-grid":70,"turf-hex":71,"turf-inside":73,"turf-intersect":74,"turf-is-clockwise":79,"turf-isobands":80,"turf-isolines":89,"turf-jenks":98,"turf-kinks":100,"turf-linestring":101,"turf-max":102,"turf-median":104,"turf-merge":106,"turf-midpoint":108,"turf-min":109,"turf-nearest":111,"turf-planepoint":112,"turf-point":114,"turf-point-on-surface":113,"turf-polygon":115,"turf-quantile":116,"turf-reclass":118,"turf-remove":119,"turf-sample":120,"turf-simplify":121,"turf-size":123,"turf-square":124,"turf-sum":128,"turf-tag":131,"turf-tin":132,"turf-union":133,"turf-variance":138,"turf-within":140}],2:[function(t,e,o){function n(t,e,o){if(!(this instanceof n))return new n(t,e,o);var r,i=typeof t;if("number"===i)r=t>0?t>>>0:0;else if("string"===i)"base64"===e&&(t=S(t)),r=n.byteLength(t,e);else{if("object"!==i||null===t)throw new TypeError("must start with number, buffer, array or string");"Buffer"===t.type&&D(t.data)&&(t=t.data),r=+t.length>0?Math.floor(+t.length):0}if(this.length>G)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+G.toString(16)+" bytes");var s;n.TYPED_ARRAY_SUPPORT?s=n._augment(new Uint8Array(r)):(s=this,s.length=r,s._isBuffer=!0);var a;if(n.TYPED_ARRAY_SUPPORT&&"number"==typeof t.byteLength)s._set(t);else if(C(t))if(n.isBuffer(t))for(a=0;r>a;a++)s[a]=t.readUInt8(a);else for(a=0;r>a;a++)s[a]=(t[a]%256+256)%256;else if("string"===i)s.write(t,0,e);else if("number"===i&&!n.TYPED_ARRAY_SUPPORT&&!o)for(a=0;r>a;a++)s[a]=0;return s}function r(t,e,o,n){o=Number(o)||0;var r=t.length-o;n?(n=Number(n),n>r&&(n=r)):n=r;var i=e.length;if(i%2!==0)throw new Error("Invalid hex string");n>i/2&&(n=i/2);for(var s=0;n>s;s++){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))throw new Error("Invalid hex string");t[o+s]=a}return s}function i(t,e,o,n){var r=O(b(e),t,o,n);return r}function s(t,e,o,n){var r=O(P(e),t,o,n);return r}function a(t,e,o,n){return s(t,e,o,n)}function u(t,e,o,n){var r=O(w(e),t,o,n);return r}function p(t,e,o,n){var r=O(R(e),t,o,n,2);return r}function g(t,e,o){return T.fromByteArray(0===e&&o===t.length?t:t.slice(e,o))}function l(t,e,o){var n="",r="";o=Math.min(t.length,o);for(var i=e;o>i;i++)t[i]<=127?(n+=M(r)+String.fromCharCode(t[i]),r=""):r+="%"+t[i].toString(16);return n+M(r)}function h(t,e,o){var n="";o=Math.min(t.length,o);for(var r=e;o>r;r++)n+=String.fromCharCode(t[r]);return n}function d(t,e,o){return h(t,e,o)}function c(t,e,o){var n=t.length;(!e||0>e)&&(e=0),(!o||0>o||o>n)&&(o=n);for(var r="",i=e;o>i;i++)r+=N(t[i]);return r}function m(t,e,o){for(var n=t.slice(e,o),r="",i=0;i<n.length;i+=2)r+=String.fromCharCode(n[i]+256*n[i+1]);return r}function f(t,e,o){if(t%1!==0||0>t)throw new RangeError("offset is not uint");if(t+e>o)throw new RangeError("Trying to access beyond buffer length")}function y(t,e,o,r,i,s){if(!n.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");if(e>i||s>e)throw new TypeError("value is out of bounds");if(o+r>t.length)throw new TypeError("index out of range")}function j(t,e,o,n){0>e&&(e=65535+e+1);for(var r=0,i=Math.min(t.length-o,2);i>r;r++)t[o+r]=(e&255<<8*(n?r:1-r))>>>8*(n?r:1-r)}function v(t,e,o,n){0>e&&(e=4294967295+e+1);for(var r=0,i=Math.min(t.length-o,4);i>r;r++)t[o+r]=e>>>8*(n?r:3-r)&255}function x(t,e,o,n,r,i){if(e>r||i>e)throw new TypeError("value is out of bounds");if(o+n>t.length)throw new TypeError("index out of range")}function E(t,e,o,n,r){return r||x(t,e,o,4,3.4028234663852886e38,-3.4028234663852886e38),A.write(t,e,o,n,23,4),o+4}function I(t,e,o,n,r){return r||x(t,e,o,8,1.7976931348623157e308,-1.7976931348623157e308),A.write(t,e,o,n,52,8),o+8}function S(t){for(t=L(t).replace(B,"");t.length%4!==0;)t+="=";return t}function L(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function C(t){return D(t)||n.isBuffer(t)||t&&"object"==typeof t&&"number"==typeof t.length}function N(t){return 16>t?"0"+t.toString(16):t.toString(16)}function b(t){for(var e=[],o=0;o<t.length;o++){var n=t.charCodeAt(o);if(127>=n)e.push(n);else{var r=o;n>=55296&&57343>=n&&o++;for(var i=encodeURIComponent(t.slice(r,o+1)).substr(1).split("%"),s=0;s<i.length;s++)e.push(parseInt(i[s],16))}}return e}function P(t){for(var e=[],o=0;o<t.length;o++)e.push(255&t.charCodeAt(o));return e}function R(t){for(var e,o,n,r=[],i=0;i<t.length;i++)e=t.charCodeAt(i),o=e>>8,n=e%256,r.push(n),r.push(o);return r}function w(t){return T.toByteArray(t)}function O(t,e,o,n,r){r&&(n-=n%r);for(var i=0;n>i&&!(i+o>=e.length||i>=t.length);i++)e[i+o]=t[i];return i}function M(t){try{return decodeURIComponent(t)}catch(e){return String.fromCharCode(65533)}}var T=t("base64-js"),A=t("ieee754"),D=t("is-array");o.Buffer=n,o.SlowBuffer=n,o.INSPECT_MAX_BYTES=50,n.poolSize=8192;var G=1073741823;n.TYPED_ARRAY_SUPPORT=function(){try{var t=new ArrayBuffer(0),e=new Uint8Array(t);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray&&0===new Uint8Array(1).subarray(1,1).byteLength}catch(o){return!1}}(),n.isBuffer=function(t){return!(null==t||!t._isBuffer)},n.compare=function(t,e){if(!n.isBuffer(t)||!n.isBuffer(e))throw new TypeError("Arguments must be Buffers");for(var o=t.length,r=e.length,i=0,s=Math.min(o,r);s>i&&t[i]===e[i];i++);return i!==s&&(o=t[i],r=e[i]),r>o?-1:o>r?1:0},n.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},n.concat=function(t,e){if(!D(t))throw new TypeError("Usage: Buffer.concat(list[, length])");if(0===t.length)return new n(0);if(1===t.length)return t[0];var o;if(void 0===e)for(e=0,o=0;o<t.length;o++)e+=t[o].length;var r=new n(e),i=0;for(o=0;o<t.length;o++){var s=t[o];s.copy(r,i),i+=s.length}return r},n.byteLength=function(t,e){var o;switch(t+="",e||"utf8"){case"ascii":case"binary":case"raw":o=t.length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":o=2*t.length;break;case"hex":o=t.length>>>1;break;case"utf8":case"utf-8":o=b(t).length;break;case"base64":o=w(t).length;break;default:o=t.length}return o},n.prototype.length=void 0,n.prototype.parent=void 0,n.prototype.toString=function(t,e,o){var n=!1;if(e>>>=0,o=void 0===o||1/0===o?this.length:o>>>0,t||(t="utf8"),0>e&&(e=0),o>this.length&&(o=this.length),e>=o)return"";for(;;)switch(t){case"hex":return c(this,e,o);case"utf8":case"utf-8":return l(this,e,o);case"ascii":return h(this,e,o);case"binary":return d(this,e,o);case"base64":return g(this,e,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m(this,e,o);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}},n.prototype.equals=function(t){if(!n.isBuffer(t))throw new TypeError("Argument must be a Buffer");return 0===n.compare(this,t)},n.prototype.inspect=function(){var t="",e=o.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},n.prototype.compare=function(t){if(!n.isBuffer(t))throw new TypeError("Argument must be a Buffer");return n.compare(this,t)},n.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},n.prototype.set=function(t,e){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,e)},n.prototype.write=function(t,e,o,n){if(isFinite(e))isFinite(o)||(n=o,o=void 0);else{var g=n;n=e,e=o,o=g}e=Number(e)||0;var l=this.length-e;o?(o=Number(o),o>l&&(o=l)):o=l,n=String(n||"utf8").toLowerCase();var h;switch(n){case"hex":h=r(this,t,e,o);break;case"utf8":case"utf-8":h=i(this,t,e,o);break;case"ascii":h=s(this,t,e,o);break;case"binary":h=a(this,t,e,o);break;case"base64":h=u(this,t,e,o);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":h=p(this,t,e,o);break;default:throw new TypeError("Unknown encoding: "+n)}return h},n.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},n.prototype.slice=function(t,e){var o=this.length;if(t=~~t,e=void 0===e?o:~~e,0>t?(t+=o,0>t&&(t=0)):t>o&&(t=o),0>e?(e+=o,0>e&&(e=0)):e>o&&(e=o),t>e&&(e=t),n.TYPED_ARRAY_SUPPORT)return n._augment(this.subarray(t,e));for(var r=e-t,i=new n(r,void 0,!0),s=0;r>s;s++)i[s]=this[s+t];return i},n.prototype.readUInt8=function(t,e){return e||f(t,1,this.length),this[t]},n.prototype.readUInt16LE=function(t,e){return e||f(t,2,this.length),this[t]|this[t+1]<<8},n.prototype.readUInt16BE=function(t,e){return e||f(t,2,this.length),this[t]<<8|this[t+1]},n.prototype.readUInt32LE=function(t,e){return e||f(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},n.prototype.readUInt32BE=function(t,e){return e||f(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},n.prototype.readInt8=function(t,e){return e||f(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},n.prototype.readInt16LE=function(t,e){e||f(t,2,this.length);var o=this[t]|this[t+1]<<8;return 32768&o?4294901760|o:o},n.prototype.readInt16BE=function(t,e){e||f(t,2,this.length);var o=this[t+1]|this[t]<<8;return 32768&o?4294901760|o:o},n.prototype.readInt32LE=function(t,e){return e||f(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},n.prototype.readInt32BE=function(t,e){return e||f(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},n.prototype.readFloatLE=function(t,e){return e||f(t,4,this.length),A.read(this,t,!0,23,4)},n.prototype.readFloatBE=function(t,e){return e||f(t,4,this.length),A.read(this,t,!1,23,4)},n.prototype.readDoubleLE=function(t,e){return e||f(t,8,this.length),A.read(this,t,!0,52,8)},n.prototype.readDoubleBE=function(t,e){return e||f(t,8,this.length),A.read(this,t,!1,52,8)},n.prototype.writeUInt8=function(t,e,o){return t=+t,e>>>=0,o||y(this,t,e,1,255,0),n.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t,e+1},n.prototype.writeUInt16LE=function(t,e,o){return t=+t,e>>>=0,o||y(this,t,e,2,65535,0),n.TYPED_ARRAY_SUPPORT?(this[e]=t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},n.prototype.writeUInt16BE=function(t,e,o){return t=+t,e>>>=0,o||y(this,t,e,2,65535,0),n.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t):j(this,t,e,!1),e+2},n.prototype.writeUInt32LE=function(t,e,o){return t=+t,e>>>=0,o||y(this,t,e,4,4294967295,0),n.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t):v(this,t,e,!0),e+4},n.prototype.writeUInt32BE=function(t,e,o){return t=+t,e>>>=0,o||y(this,t,e,4,4294967295,0),n.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t):v(this,t,e,!1),e+4},n.prototype.writeInt8=function(t,e,o){return t=+t,e>>>=0,o||y(this,t,e,1,127,-128),n.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[e]=t,e+1},n.prototype.writeInt16LE=function(t,e,o){return t=+t,e>>>=0,o||y(this,t,e,2,32767,-32768),n.TYPED_ARRAY_SUPPORT?(this[e]=t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},n.prototype.writeInt16BE=function(t,e,o){return t=+t,e>>>=0,o||y(this,t,e,2,32767,-32768),n.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t):j(this,t,e,!1),e+2},n.prototype.writeInt32LE=function(t,e,o){return t=+t,e>>>=0,o||y(this,t,e,4,2147483647,-2147483648),n.TYPED_ARRAY_SUPPORT?(this[e]=t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):v(this,t,e,!0),e+4},n.prototype.writeInt32BE=function(t,e,o){return t=+t,e>>>=0,o||y(this,t,e,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),n.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t):v(this,t,e,!1),e+4},n.prototype.writeFloatLE=function(t,e,o){return E(this,t,e,!0,o)},n.prototype.writeFloatBE=function(t,e,o){return E(this,t,e,!1,o)},n.prototype.writeDoubleLE=function(t,e,o){return I(this,t,e,!0,o)},n.prototype.writeDoubleBE=function(t,e,o){return I(this,t,e,!1,o)},n.prototype.copy=function(t,e,o,r){var i=this;if(o||(o=0),r||0===r||(r=this.length),e||(e=0),r!==o&&0!==t.length&&0!==i.length){if(o>r)throw new TypeError("sourceEnd < sourceStart");if(0>e||e>=t.length)throw new TypeError("targetStart out of bounds");if(0>o||o>=i.length)throw new TypeError("sourceStart out of bounds");if(0>r||r>i.length)throw new TypeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-o&&(r=t.length-e+o);var s=r-o;if(1e3>s||!n.TYPED_ARRAY_SUPPORT)for(var a=0;s>a;a++)t[a+e]=this[a+o];else t._set(this.subarray(o,o+s),e)}},n.prototype.fill=function(t,e,o){if(t||(t=0),e||(e=0),o||(o=this.length),e>o)throw new TypeError("end < start");if(o!==e&&0!==this.length){if(0>e||e>=this.length)throw new TypeError("start out of bounds");if(0>o||o>this.length)throw new TypeError("end out of bounds");var n;if("number"==typeof t)for(n=e;o>n;n++)this[n]=t;else{var r=b(t.toString()),i=r.length;for(n=e;o>n;n++)this[n]=r[n%i]}return this}},n.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(n.TYPED_ARRAY_SUPPORT)return new n(this).buffer;for(var t=new Uint8Array(this.length),e=0,o=t.length;o>e;e+=1)t[e]=this[e];return t.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var F=n.prototype;n._augment=function(t){return t.constructor=n,t._isBuffer=!0,t._get=t.get,t._set=t.set,t.get=F.get,t.set=F.set,t.write=F.write,t.toString=F.toString,t.toLocaleString=F.toString,t.toJSON=F.toJSON,t.equals=F.equals,t.compare=F.compare,t.copy=F.copy,t.slice=F.slice,t.readUInt8=F.readUInt8,t.readUInt16LE=F.readUInt16LE,t.readUInt16BE=F.readUInt16BE,t.readUInt32LE=F.readUInt32LE,t.readUInt32BE=F.readUInt32BE,t.readInt8=F.readInt8,t.readInt16LE=F.readInt16LE,t.readInt16BE=F.readInt16BE,t.readInt32LE=F.readInt32LE,t.readInt32BE=F.readInt32BE,t.readFloatLE=F.readFloatLE,t.readFloatBE=F.readFloatBE,t.readDoubleLE=F.readDoubleLE,t.readDoubleBE=F.readDoubleBE,t.writeUInt8=F.writeUInt8,t.writeUInt16LE=F.writeUInt16LE,t.writeUInt16BE=F.writeUInt16BE,t.writeUInt32LE=F.writeUInt32LE,t.writeUInt32BE=F.writeUInt32BE,t.writeInt8=F.writeInt8,t.writeInt16LE=F.writeInt16LE,t.writeInt16BE=F.writeInt16BE,t.writeInt32LE=F.writeInt32LE,t.writeInt32BE=F.writeInt32BE,t.writeFloatLE=F.writeFloatLE,t.writeFloatBE=F.writeFloatBE,t.writeDoubleLE=F.writeDoubleLE,t.writeDoubleBE=F.writeDoubleBE,t.fill=F.fill,t.inspect=F.inspect,t.toArrayBuffer=F.toArrayBuffer,t};var B=/[^+\/0-9A-z]/g},{"base64-js":3,ieee754:4,"is-array":5}],3:[function(t,e,o){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(t){"use strict";function e(t){var e=t.charCodeAt(0);return e===s?62:e===a?63:u>e?-1:u+10>e?e-u+26+26:g+26>e?e-g:p+26>e?e-p+26:void 0}function o(t){function o(t){p[l++]=t}var n,r,s,a,u,p;if(t.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var g=t.length;u="="===t.charAt(g-2)?2:"="===t.charAt(g-1)?1:0,p=new i(3*t.length/4-u),s=u>0?t.length-4:t.length;var l=0;for(n=0,r=0;s>n;n+=4,r+=3)a=e(t.charAt(n))<<18|e(t.charAt(n+1))<<12|e(t.charAt(n+2))<<6|e(t.charAt(n+3)),o((16711680&a)>>16),o((65280&a)>>8),o(255&a);return 2===u?(a=e(t.charAt(n))<<2|e(t.charAt(n+1))>>4,o(255&a)):1===u&&(a=e(t.charAt(n))<<10|e(t.charAt(n+1))<<4|e(t.charAt(n+2))>>2,o(a>>8&255),o(255&a)),p}function r(t){function e(t){return n.charAt(t)}function o(t){return e(t>>18&63)+e(t>>12&63)+e(t>>6&63)+e(63&t)}var r,i,s,a=t.length%3,u="";for(r=0,s=t.length-a;s>r;r+=3)i=(t[r]<<16)+(t[r+1]<<8)+t[r+2],u+=o(i);switch(a){case 1:i=t[t.length-1],u+=e(i>>2),u+=e(i<<4&63),u+="==";break;case 2:i=(t[t.length-2]<<8)+t[t.length-1],u+=e(i>>10),u+=e(i>>4&63),u+=e(i<<2&63),u+="="}return u}var i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="+".charCodeAt(0),a="/".charCodeAt(0),u="0".charCodeAt(0),p="a".charCodeAt(0),g="A".charCodeAt(0);t.toByteArray=o,t.fromByteArray=r}("undefined"==typeof o?this.base64js={}:o)},{}],4:[function(t,e,o){o.read=function(t,e,o,n,r){var i,s,a=8*r-n-1,u=(1<<a)-1,p=u>>1,g=-7,l=o?r-1:0,h=o?-1:1,d=t[e+l];for(l+=h,i=d&(1<<-g)-1,d>>=-g,g+=a;g>0;i=256*i+t[e+l],l+=h,g-=8);for(s=i&(1<<-g)-1,i>>=-g,g+=n;g>0;s=256*s+t[e+l],l+=h,g-=8);if(0===i)i=1-p;else{if(i===u)return s?0/0:1/0*(d?-1:1);s+=Math.pow(2,n),i-=p}return(d?-1:1)*s*Math.pow(2,i-n)},o.write=function(t,e,o,n,r,i){var s,a,u,p=8*i-r-1,g=(1<<p)-1,l=g>>1,h=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,c=n?1:-1,m=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||1/0===e?(a=isNaN(e)?1:0,s=g):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),e+=s+l>=1?h/u:h*Math.pow(2,1-l),e*u>=2&&(s++,u/=2),s+l>=g?(a=0,s=g):s+l>=1?(a=(e*u-1)*Math.pow(2,r),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,r),s=0));r>=8;t[o+d]=255&a,d+=c,a/=256,r-=8);for(s=s<<r|a,p+=r;p>0;t[o+d]=255&s,d+=c,s/=256,p-=8);t[o+d-c]|=128*m}},{}],5:[function(t,e){var o=Array.isArray,n=Object.prototype.toString;e.exports=o||function(t){return!!t&&"[object Array]"==n.call(t)}},{}],6:[function(t,e){function o(t){return"average"===t||"sum"===t||"median"===t||"min"===t||"max"===t||"deviation"===t||"variance"===t||"count"===t}var n=t("turf-average"),r=t("turf-sum"),i=t("turf-median"),s=t("turf-min"),a=t("turf-max"),u=t("turf-deviation"),p=t("turf-variance"),g=t("turf-count"),l={};l.average=n,l.sum=r,l.median=i,l.min=s,l.max=a,l.deviation=u,l.variance=p,l.count=g,e.exports=function(t,e,n){for(var r=0,i=n.length;i>r;r++){var s=n[r],a=s.aggregation;if(!o(a))return new Error('"'+a+'" is not a recognized aggregation operation.');t="count"===a?l[a](t,e,s.outField):l[a](t,e,s.inField,s.outField)}return t}},{"turf-average":7,"turf-count":9,"turf-deviation":11,"turf-max":14,"turf-median":17,"turf-min":20,"turf-sum":23,"turf-variance":26}],7:[function(t,e){function o(t){for(var e=0,o=0;o<t.length;o++)e+=t[o];return e/t.length}var n=t("turf-inside");e.exports=function(t,e,r,i){return t.features.forEach(function(t){t.properties||(t.properties={});var s=[];e.features.forEach(function(e){n(e,t)&&s.push(e.properties[r])}),t.properties[i]=o(s)}),t}},{"turf-inside":8}],8:[function(t,e){e.exports=function(t,e){for(var o=t.geometry.coordinates[0],n=t.geometry.coordinates[1],r=e.geometry.coordinates[0],i=!1,s=0,a=r.length-1;s<r.length;a=s++){var u=r[s][0],p=r[s][1],g=r[a][0],l=r[a][1],h=p>n!=l>n&&(g-u)*(n-p)/(l-p)+u>o;h&&(i=!i)}return i}},{}],9:[function(t,e){var o=t("turf-inside");e.exports=function(t,e,n){return t.features.forEach(function(t){t.properties||(t.properties={});var r=[];e.features.forEach(function(e){o(e,t)&&r.push(1)}),t.properties[n]=r.length}),t}},{"turf-inside":10}],10:[function(t,e){e.exports=t(8)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-aggregate/node_modules/turf-average/node_modules/turf-inside/index.js":8}],11:[function(t,e){var o=t("simple-statistics"),n=t("turf-inside");e.exports=function(t,e,r,i){return t.features.forEach(function(t){t.properties||(t.properties={});var s=[];e.features.forEach(function(e){n(e,t)&&s.push(e.properties[r])}),t.properties[i]=o.standard_deviation(s)}),t}},{"simple-statistics":12,"turf-inside":13}],12:[function(t,e){!function(){function t(){var t={},e=[];return t.data=function(o){return arguments.length?(e=o.slice(),t):e},t.mb=function(){var t,o,n=e.length;if(1===n)t=0,o=e[0][1];else{for(var r,i,s,a=0,u=0,p=0,g=0,l=0;n>l;l++)r=e[l],i=r[0],s=r[1],a+=i,u+=s,p+=i*i,g+=i*s;t=(n*g-a*u)/(n*p-a*a),o=u/n-t*a/n}return{m:t,b:o}},t.m=function(){return t.mb().m},t.b=function(){return t.mb().b},t.line=function(){var e=t.mb(),o=e.m,n=e.b;return function(t){return n+o*t}},t}function o(t,e){if(t.length<2)return 1;for(var o,n=0,r=0;r<t.length;r++)n+=t[r][1];o=n/t.length;for(var i=0,s=0;s<t.length;s++)i+=Math.pow(o-t[s][1],2);for(var a=0,u=0;u<t.length;u++)a+=Math.pow(t[u][1]-e(t[u][0]),2);return 1-a/i}function n(){var t={},e=0,o={};return t.train=function(t,n){o[n]||(o[n]={});for(var r in t){var i=t[r];void 0===o[n][r]&&(o[n][r]={}),void 0===o[n][r][i]&&(o[n][r][i]=0),o[n][r][t[r]]++}e++},t.score=function(t){var n,r={};for(var i in t){var s=t[i];for(n in o)void 0===r[n]&&(r[n]={}),r[n][i+"_"+s]=o[n][i]?(o[n][i][s]||0)/e:0}var a={};for(n in r)for(var u in r[n])void 0===a[n]&&(a[n]=0),a[n]+=r[n][u];return a},t}function r(t){for(var e=0,o=0;o<t.length;o++)e+=t[o];return e}function i(t){return 0===t.length?null:r(t)/t.length}function s(t){if(0===t.length)return null;for(var e=1,o=0;o<t.length;o++){if(t[o]<=0)return null;e*=t[o]}return Math.pow(e,1/t.length)}function a(t){if(0===t.length)return null;for(var e=0,o=0;o<t.length;o++){if(t[o]<=0)return null;e+=1/t[o]}return t.length/e}function u(t){for(var e,o=0;o<t.length;o++)(t[o]<e||void 0===e)&&(e=t[o]);return e}function p(t){for(var e,o=0;o<t.length;o++)(t[o]>e||void 0===e)&&(e=t[o]);return e}function g(t){if(0===t.length)return null;for(var e=i(t),o=[],n=0;n<t.length;n++)o.push(Math.pow(t[n]-e,2));return i(o)}function l(t){return 0===t.length?null:Math.sqrt(g(t))}function h(t,e){for(var o=i(t),n=0,r=0;r<t.length;r++)n+=Math.pow(t[r]-o,e);return n}function d(t){if(t.length<=1)return null;var e=h(t,2);return e/(t.length-1)}function c(t){return t.length<=1?null:Math.sqrt(d(t))}function m(t,e){if(t.length<=1||t.length!=e.length)return null;for(var o=i(t),n=i(e),r=0,s=0;s<t.length;s++)r+=(t[s]-o)*(e[s]-n);return r/(t.length-1)}function f(t,e){var o=m(t,e),n=c(t),r=c(e);return null===o||null===n||null===r?null:o/n/r}function y(t){if(0===t.length)return null;var e=t.slice().sort(function(t,e){return t-e});if(e.length%2===1)return e[(e.length-1)/2];var o=e[e.length/2-1],n=e[e.length/2];return(o+n)/2}function j(t){if(0===t.length)return null;if(1===t.length)return t[0];for(var e,o=t.slice().sort(function(t,e){return t-e}),n=o[0],r=0,i=1,s=1;s<o.length+1;s++)o[s]!==n?(i>r&&(r=i,e=n),i=1,n=o[s]):i++;return e}function v(t,e){var o=i(t),n=l(t),r=Math.sqrt(t.length);return(o-e)/(n/r)}function x(t,e,o){var n=t.length,r=e.length;if(!n||!r)return null;o||(o=0);var s=i(t),a=i(e),u=((n-1)*d(t)+(r-1)*d(e))/(n+r-2);return(s-a-o)/Math.sqrt(u*(1/n+1/r))}function E(t,e){if(0===t.length)return null;var o=t.slice().sort(function(t,e){return t-e});if(e.length){for(var n=[],r=0;r<e.length;r++)n[r]=I(o,e[r]);return n}return I(o,e)}function I(t,e){var o=t.length*e;return 0>e||e>1?null:1===e?t[t.length-1]:0===e?t[0]:o%1!==0?t[Math.ceil(o)-1]:t.length%2===0?(t[o-1]+t[o])/2:t[o]}function S(t){return 0===t.length?null:E(t,.75)-E(t,.25)}function L(t){if(!t||0===t.length)return null;for(var e=y(t),o=[],n=0;n<t.length;n++)o.push(Math.abs(t[n]-e));return y(o)}function C(t,e){var o,n,r=[],i=[],s=0;for(o=0;o<t.length+1;o++){var a=[],u=[];for(n=0;e+1>n;n++)a.push(0),u.push(0);r.push(a),i.push(u)}for(o=1;e+1>o;o++)for(r[1][o]=1,i[1][o]=0,n=2;n<t.length+1;n++)i[n][o]=1/0;for(var p=2;p<t.length+1;p++){for(var g=0,l=0,h=0,d=0,c=1;p+1>c;c++){var m=p-c+1,f=t[m-1];if(h++,g+=f,l+=f*f,s=l-g*g/h,d=m-1,0!==d)for(n=2;e+1>n;n++)i[p][n]>=s+i[d][n-1]&&(r[p][n]=m,i[p][n]=s+i[d][n-1])}r[p][1]=1,i[p][1]=s}return{lower_class_limits:r,variance_combinations:i}}function N(t,e,o){var n=t.length-1,r=[],i=o;for(r[o]=t[t.length-1],r[0]=t[0];i>1;)r[i-1]=t[e[n][i]-2],n=e[n][i]-1,i--;return r}function b(t,e){if(e>t.length)return null;t=t.slice().sort(function(t,e){return t-e});var o=C(t,e),n=o.lower_class_limits;return N(t,n,e)}function P(t){if(t.length<3)return null;var e=t.length,o=Math.pow(c(t),3),n=h(t,3);return e*n/((e-1)*(e-2)*o)}function R(t){var e=Math.abs(t),o=Math.floor(10*e),n=10*(Math.floor(100*e)/10-Math.floor(100*e/10)),r=Math.min(10*o+n,B.length-1);return t>=0?B[r]:+(1-B[r]).toFixed(4)}function w(t,e,o){return(t-e)/o}function O(t){if(0>t)return null;for(var e=1,o=2;t>=o;o++)e*=o;return e}function M(t){return 0>t||t>1?null:T(1,t)}function T(t,e){function o(t,e,o){return O(e)/(O(t)*O(e-t))*Math.pow(o,t)*Math.pow(1-o,e-t)}if(0>e||e>1||0>=t||t%1!==0)return null;var n=0,r=0,i={};do i[n]=o(n,t,e),r+=i[n],n++;while(1-_>r);return i}function A(t){function e(t,e){return Math.pow(Math.E,-e)*Math.pow(e,t)/O(t)}if(0>=t)return null;var o=0,n=0,r={};do r[o]=e(o,t),n+=r[o],o++;while(1-_>n);return r}function D(t,e,o){for(var n,r,s=i(t),a=0,u=1,p=e(s),g=[],l=[],h=0;h<t.length;h++)void 0===g[t[h]]&&(g[t[h]]=0),g[t[h]]++;for(h=0;h<g.length;h++)void 0===g[h]&&(g[h]=0);for(r in p)r in g&&(l[r]=p[r]*t.length);for(r=l.length-1;r>=0;r--)l[r]<3&&(l[r-1]+=l[r],l.pop(),g[r-1]+=g[r],g.pop());for(r=0;r<g.length;r++)a+=Math.pow(g[r]-l[r],2)/l[r];return n=g.length-u-1,q[n][o]<a}function G(t){function e(t){return function(){var e=Array.prototype.slice.apply(arguments);return e.unshift(this),F[t].apply(F,e)}}var o=!(!Object.defineProperty||!Object.defineProperties);if(!o)throw new Error("without defineProperty, simple-statistics cannot be mixed in");var n,r=["median","standard_deviation","sum","sample_skewness","mean","min","max","quantile","geometric_mean","harmonic_mean"];n=t?t.slice():Array.prototype;for(var i=0;i<r.length;i++)Object.defineProperty(n,r[i],{value:e(r[i]),configurable:!0,enumerable:!1,writable:!0});return n}var F={};"undefined"!=typeof e?e.exports=F:this.ss=F;var B=[.5,.504,.508,.512,.516,.5199,.5239,.5279,.5319,.5359,.5398,.5438,.5478,.5517,.5557,.5596,.5636,.5675,.5714,.5753,.5793,.5832,.5871,.591,.5948,.5987,.6026,.6064,.6103,.6141,.6179,.6217,.6255,.6293,.6331,.6368,.6406,.6443,.648,.6517,.6554,.6591,.6628,.6664,.67,.6736,.6772,.6808,.6844,.6879,.6915,.695,.6985,.7019,.7054,.7088,.7123,.7157,.719,.7224,.7257,.7291,.7324,.7357,.7389,.7422,.7454,.7486,.7517,.7549,.758,.7611,.7642,.7673,.7704,.7734,.7764,.7794,.7823,.7852,.7881,.791,.7939,.7967,.7995,.8023,.8051,.8078,.8106,.8133,.8159,.8186,.8212,.8238,.8264,.8289,.8315,.834,.8365,.8389,.8413,.8438,.8461,.8485,.8508,.8531,.8554,.8577,.8599,.8621,.8643,.8665,.8686,.8708,.8729,.8749,.877,.879,.881,.883,.8849,.8869,.8888,.8907,.8925,.8944,.8962,.898,.8997,.9015,.9032,.9049,.9066,.9082,.9099,.9115,.9131,.9147,.9162,.9177,.9192,.9207,.9222,.9236,.9251,.9265,.9279,.9292,.9306,.9319,.9332,.9345,.9357,.937,.9382,.9394,.9406,.9418,.9429,.9441,.9452,.9463,.9474,.9484,.9495,.9505,.9515,.9525,.9535,.9545,.9554,.9564,.9573,.9582,.9591,.9599,.9608,.9616,.9625,.9633,.9641,.9649,.9656,.9664,.9671,.9678,.9686,.9693,.9699,.9706,.9713,.9719,.9726,.9732,.9738,.9744,.975,.9756,.9761,.9767,.9772,.9778,.9783,.9788,.9793,.9798,.9803,.9808,.9812,.9817,.9821,.9826,.983,.9834,.9838,.9842,.9846,.985,.9854,.9857,.9861,.9864,.9868,.9871,.9875,.9878,.9881,.9884,.9887,.989,.9893,.9896,.9898,.9901,.9904,.9906,.9909,.9911,.9913,.9916,.9918,.992,.9922,.9925,.9927,.9929,.9931,.9932,.9934,.9936,.9938,.994,.9941,.9943,.9945,.9946,.9948,.9949,.9951,.9952,.9953,.9955,.9956,.9957,.9959,.996,.9961,.9962,.9963,.9964,.9965,.9966,.9967,.9968,.9969,.997,.9971,.9972,.9973,.9974,.9974,.9975,.9976,.9977,.9977,.9978,.9979,.9979,.998,.9981,.9981,.9982,.9982,.9983,.9984,.9984,.9985,.9985,.9986,.9986,.9987,.9987,.9987,.9988,.9988,.9989,.9989,.9989,.999,.999],_=1e-4,q={1:{.995:0,.99:0,.975:0,.95:0,.9:.02,.5:.45,.1:2.71,.05:3.84,.025:5.02,.01:6.63,.005:7.88},2:{.995:.01,.99:.02,.975:.05,.95:.1,.9:.21,.5:1.39,.1:4.61,.05:5.99,.025:7.38,.01:9.21,.005:10.6},3:{.995:.07,.99:.11,.975:.22,.95:.35,.9:.58,.5:2.37,.1:6.25,.05:7.81,.025:9.35,.01:11.34,.005:12.84},4:{.995:.21,.99:.3,.975:.48,.95:.71,.9:1.06,.5:3.36,.1:7.78,.05:9.49,.025:11.14,.01:13.28,.005:14.86},5:{.995:.41,.99:.55,.975:.83,.95:1.15,.9:1.61,.5:4.35,.1:9.24,.05:11.07,.025:12.83,.01:15.09,.005:16.75},6:{.995:.68,.99:.87,.975:1.24,.95:1.64,.9:2.2,.5:5.35,.1:10.65,.05:12.59,.025:14.45,.01:16.81,.005:18.55},7:{.995:.99,.99:1.25,.975:1.69,.95:2.17,.9:2.83,.5:6.35,.1:12.02,.05:14.07,.025:16.01,.01:18.48,.005:20.28},8:{.995:1.34,.99:1.65,.975:2.18,.95:2.73,.9:3.49,.5:7.34,.1:13.36,.05:15.51,.025:17.53,.01:20.09,.005:21.96},9:{.995:1.73,.99:2.09,.975:2.7,.95:3.33,.9:4.17,.5:8.34,.1:14.68,.05:16.92,.025:19.02,.01:21.67,.005:23.59},10:{.995:2.16,.99:2.56,.975:3.25,.95:3.94,.9:4.87,.5:9.34,.1:15.99,.05:18.31,.025:20.48,.01:23.21,.005:25.19},11:{.995:2.6,.99:3.05,.975:3.82,.95:4.57,.9:5.58,.5:10.34,.1:17.28,.05:19.68,.025:21.92,.01:24.72,.005:26.76},12:{.995:3.07,.99:3.57,.975:4.4,.95:5.23,.9:6.3,.5:11.34,.1:18.55,.05:21.03,.025:23.34,.01:26.22,.005:28.3},13:{.995:3.57,.99:4.11,.975:5.01,.95:5.89,.9:7.04,.5:12.34,.1:19.81,.05:22.36,.025:24.74,.01:27.69,.005:29.82},14:{.995:4.07,.99:4.66,.975:5.63,.95:6.57,.9:7.79,.5:13.34,.1:21.06,.05:23.68,.025:26.12,.01:29.14,.005:31.32},15:{.995:4.6,.99:5.23,.975:6.27,.95:7.26,.9:8.55,.5:14.34,.1:22.31,.05:25,.025:27.49,.01:30.58,.005:32.8},16:{.995:5.14,.99:5.81,.975:6.91,.95:7.96,.9:9.31,.5:15.34,.1:23.54,.05:26.3,.025:28.85,.01:32,.005:34.27},17:{.995:5.7,.99:6.41,.975:7.56,.95:8.67,.9:10.09,.5:16.34,.1:24.77,.05:27.59,.025:30.19,.01:33.41,.005:35.72},18:{.995:6.26,.99:7.01,.975:8.23,.95:9.39,.9:10.87,.5:17.34,.1:25.99,.05:28.87,.025:31.53,.01:34.81,.005:37.16},19:{.995:6.84,.99:7.63,.975:8.91,.95:10.12,.9:11.65,.5:18.34,.1:27.2,.05:30.14,.025:32.85,.01:36.19,.005:38.58},20:{.995:7.43,.99:8.26,.975:9.59,.95:10.85,.9:12.44,.5:19.34,.1:28.41,.05:31.41,.025:34.17,.01:37.57,.005:40},21:{.995:8.03,.99:8.9,.975:10.28,.95:11.59,.9:13.24,.5:20.34,.1:29.62,.05:32.67,.025:35.48,.01:38.93,.005:41.4},22:{.995:8.64,.99:9.54,.975:10.98,.95:12.34,.9:14.04,.5:21.34,.1:30.81,.05:33.92,.025:36.78,.01:40.29,.005:42.8},23:{.995:9.26,.99:10.2,.975:11.69,.95:13.09,.9:14.85,.5:22.34,.1:32.01,.05:35.17,.025:38.08,.01:41.64,.005:44.18},24:{.995:9.89,.99:10.86,.975:12.4,.95:13.85,.9:15.66,.5:23.34,.1:33.2,.05:36.42,.025:39.36,.01:42.98,.005:45.56},25:{.995:10.52,.99:11.52,.975:13.12,.95:14.61,.9:16.47,.5:24.34,.1:34.28,.05:37.65,.025:40.65,.01:44.31,.005:46.93},26:{.995:11.16,.99:12.2,.975:13.84,.95:15.38,.9:17.29,.5:25.34,.1:35.56,.05:38.89,.025:41.92,.01:45.64,.005:48.29},27:{.995:11.81,.99:12.88,.975:14.57,.95:16.15,.9:18.11,.5:26.34,.1:36.74,.05:40.11,.025:43.19,.01:46.96,.005:49.65},28:{.995:12.46,.99:13.57,.975:15.31,.95:16.93,.9:18.94,.5:27.34,.1:37.92,.05:41.34,.025:44.46,.01:48.28,.005:50.99},29:{.995:13.12,.99:14.26,.975:16.05,.95:17.71,.9:19.77,.5:28.34,.1:39.09,.05:42.56,.025:45.72,.01:49.59,.005:52.34},30:{.995:13.79,.99:14.95,.975:16.79,.95:18.49,.9:20.6,.5:29.34,.1:40.26,.05:43.77,.025:46.98,.01:50.89,.005:53.67},40:{.995:20.71,.99:22.16,.975:24.43,.95:26.51,.9:29.05,.5:39.34,.1:51.81,.05:55.76,.025:59.34,.01:63.69,.005:66.77},50:{.995:27.99,.99:29.71,.975:32.36,.95:34.76,.9:37.69,.5:49.33,.1:63.17,.05:67.5,.025:71.42,.01:76.15,.005:79.49},60:{.995:35.53,.99:37.48,.975:40.48,.95:43.19,.9:46.46,.5:59.33,.1:74.4,.05:79.08,.025:83.3,.01:88.38,.005:91.95},70:{.995:43.28,.99:45.44,.975:48.76,.95:51.74,.9:55.33,.5:69.33,.1:85.53,.05:90.53,.025:95.02,.01:100.42,.005:104.22},80:{.995:51.17,.99:53.54,.975:57.15,.95:60.39,.9:64.28,.5:79.33,.1:96.58,.05:101.88,.025:106.63,.01:112.33,.005:116.32},90:{.995:59.2,.99:61.75,.975:65.65,.95:69.13,.9:73.29,.5:89.33,.1:107.57,.05:113.14,.025:118.14,.01:124.12,.005:128.3},100:{.995:67.33,.99:70.06,.975:74.22,.95:77.93,.9:82.36,.5:99.33,.1:118.5,.05:124.34,.025:129.56,.01:135.81,.005:140.17}};
F.linear_regression=t,F.standard_deviation=l,F.r_squared=o,F.median=y,F.mean=i,F.mode=j,F.min=u,F.max=p,F.sum=r,F.quantile=E,F.quantile_sorted=I,F.iqr=S,F.mad=L,F.sample_covariance=m,F.sample_correlation=f,F.sample_variance=d,F.sample_standard_deviation=c,F.sample_skewness=P,F.geometric_mean=s,F.harmonic_mean=a,F.variance=g,F.t_test=v,F.t_test_two_sample=x,F.jenksMatrices=C,F.jenksBreaks=N,F.jenks=b,F.bayesian=n,F.epsilon=_,F.factorial=O,F.bernoulli_distribution=M,F.binomial_distribution=T,F.poisson_distribution=A,F.chi_squared_goodness_of_fit=D,F.z_score=w,F.cumulative_std_normal_probability=R,F.standard_normal_table=B,F.average=i,F.interquartile_range=S,F.mixin=G,F.median_absolute_deviation=L}(this)},{}],13:[function(t,e){e.exports=t(8)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-aggregate/node_modules/turf-average/node_modules/turf-inside/index.js":8}],14:[function(t,e){var o=t("simple-statistics"),n=t("turf-inside");e.exports=function(t,e,r,i){return t.features.forEach(function(t){t.properties||(t.properties={});var s=[];e.features.forEach(function(e){n(e,t)&&s.push(e.properties[r])}),t.properties[i]=o.max(s)}),t}},{"simple-statistics":15,"turf-inside":16}],15:[function(t,e){e.exports=t(12)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-aggregate/node_modules/turf-deviation/node_modules/simple-statistics/src/simple_statistics.js":12}],16:[function(t,e){e.exports=t(8)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-aggregate/node_modules/turf-average/node_modules/turf-inside/index.js":8}],17:[function(t,e){var o=t("simple-statistics"),n=t("turf-inside");e.exports=function(t,e,r,i){return t.features.forEach(function(t){t.properties||(t.properties={});var s=[];e.features.forEach(function(e){n(e,t)&&s.push(e.properties[r])}),t.properties[i]=o.median(s)}),t}},{"simple-statistics":18,"turf-inside":19}],18:[function(t,e){e.exports=t(12)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-aggregate/node_modules/turf-deviation/node_modules/simple-statistics/src/simple_statistics.js":12}],19:[function(t,e){e.exports=t(8)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-aggregate/node_modules/turf-average/node_modules/turf-inside/index.js":8}],20:[function(t,e){var o=t("simple-statistics"),n=t("turf-inside");e.exports=function(t,e,r,i){return t.features.forEach(function(t){t.properties||(t.properties={});var s=[];e.features.forEach(function(e){n(e,t)&&s.push(e.properties[r])}),t.properties[i]=o.min(s)}),t}},{"simple-statistics":21,"turf-inside":22}],21:[function(t,e){e.exports=t(12)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-aggregate/node_modules/turf-deviation/node_modules/simple-statistics/src/simple_statistics.js":12}],22:[function(t,e){e.exports=t(8)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-aggregate/node_modules/turf-average/node_modules/turf-inside/index.js":8}],23:[function(t,e){var o=t("simple-statistics"),n=t("turf-inside");e.exports=function(t,e,r,i){return t.features.forEach(function(t){t.properties||(t.properties={});var s=[];e.features.forEach(function(e){n(e,t)&&s.push(e.properties[r])}),t.properties[i]=o.sum(s)}),t}},{"simple-statistics":24,"turf-inside":25}],24:[function(t,e){e.exports=t(12)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-aggregate/node_modules/turf-deviation/node_modules/simple-statistics/src/simple_statistics.js":12}],25:[function(t,e){e.exports=t(8)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-aggregate/node_modules/turf-average/node_modules/turf-inside/index.js":8}],26:[function(t,e){var o=t("simple-statistics"),n=t("turf-inside");e.exports=function(t,e,r,i){return t.features.forEach(function(t){t.properties||(t.properties={});var s=[];e.features.forEach(function(e){n(e,t)&&s.push(e.properties[r])}),t.properties[i]=o.variance(s)}),t}},{"simple-statistics":27,"turf-inside":28}],27:[function(t,e){e.exports=t(12)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-aggregate/node_modules/turf-deviation/node_modules/simple-statistics/src/simple_statistics.js":12}],28:[function(t,e){e.exports=t(8)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-aggregate/node_modules/turf-average/node_modules/turf-inside/index.js":8}],29:[function(t,e){function o(t){for(var e=0,o=0;o<t.length;o++)e+=t[o];return e/t.length}var n=t("turf-inside");e.exports=function(t,e,r,i){return t.features.forEach(function(t){t.properties||(t.properties={});var s=[];e.features.forEach(function(e){n(e,t)&&s.push(e.properties[r])}),t.properties[i]=o(s)}),t}},{"turf-inside":73}],30:[function(t,e){var o=t("turf-polygon");e.exports=function(t){var e=[t[0],t[1]],n=[t[0],t[3]],r=[t[2],t[3]],i=[t[2],t[1]],s=o([[e,i,r,n,e]]);return s}},{"turf-polygon":31}],31:[function(t,e){e.exports=function(t,e){if(null===t)return new Error("No coordinates passed");var o={type:"Feature",geometry:{type:"Polygon",coordinates:t},properties:e};return o.properties||(o.properties={}),o}},{}],32:[function(t,e){function o(t){return t*Math.PI/180}function n(t){return 180*t/Math.PI}e.exports=function(t,e){var r=t.geometry.coordinates,i=e.geometry.coordinates,s=o(r[0]),a=o(i[0]),u=o(r[1]),p=o(i[1]),g=Math.sin(a-s)*Math.cos(p),l=Math.cos(u)*Math.sin(p)-Math.sin(u)*Math.cos(p)*Math.cos(a-s),h=n(Math.atan2(g,l));return h}},{}],33:[function(t,e){var o={};o.linestring=t("turf-linestring"),e.exports=function(t,e,n){var r=o.linestring([]);r.properties=t.properties,pts=[],pts=t.geometry.coordinates.map(function(t){return{x:t[0],y:t[1]}});for(var i=new Spline({points:pts,duration:e,sharpness:n}),s=0;s<i.duration;s+=10){var a=i.pos(s);Math.floor(s/100)%2==0&&r.geometry.coordinates.push([a.x,a.y])}return r},Spline=function(t){this.points=t.points||[],this.duration=t.duration||1e4,this.sharpness=t.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=t.stepLength||60,this.length=this.points.length,this.delay=0;for(var e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(var e=0;e<this.length-1;e++){var o=this.points[e],n=this.points[e+1];this.centers.push({x:(o.x+n.x)/2,y:(o.y+n.y)/2,z:(o.z+n.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var e=0;e<this.centers.length-1;e++){var o=this.centers[e],n=this.centers[e+1],r=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,i=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,s=this.points[e+1].z-(this.centers[e].y+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+r),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+i),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+s)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+r),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+i),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+s)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this},Spline.prototype.cacheSteps=function(t){var e=[],o=this.pos(0);e.push(0);for(var n=0;n<this.duration;n+=10){var r=this.pos(n),i=Math.sqrt((r.x-o.x)*(r.x-o.x)+(r.y-o.y)*(r.y-o.y)+(r.z-o.z)*(r.z-o.z));i>t&&(e.push(n),o=r)}return e},Spline.prototype.vector=function(t){var e=this.pos(t+10),o=this.pos(t-10);return{angle:180*Math.atan2(e.y-o.y,e.x-o.x)/3.14,speed:Math.sqrt((o.x-e.x)*(o.x-e.x)+(o.y-e.y)*(o.y-e.y)+(o.z-e.z)*(o.z-e.z))}},Spline.prototype.drawControlPoints=function(t,e){t.fillStyle=e||"#f60",t.strokeStyle="#fff",t.lineWidth=2;for(var o=0;o<this.length;o++){var n=this.points[o],r=this.controls[o][0],i=this.controls[o][1];t.beginPath(),t.moveTo(r.x,r.y),t.lineTo(n.x,n.y),t.lineTo(i.x,i.y),t.stroke(),t.beginPath(),t.arc(r.x,r.y,3,0,2*Math.PI,!1),t.fill(),t.stroke(),t.beginPath(),t.arc(i.x,i.y,3,0,2*Math.PI,!1),t.fill(),t.stroke(),t.beginPath(),t.arc(n.x,n.y,7,0,2*Math.PI,!1),t.fill(),t.stroke()}return this},Spline.prototype.pos=function(t){function e(t,e,o,n,r){var i=function(t){var e=t*t,o=e*t;return[o,3*e*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]},s=i(t),a={x:r.x*s[0]+n.x*s[1]+o.x*s[2]+e.x*s[3],y:r.y*s[0]+n.y*s[1]+o.y*s[2]+e.y*s[3],z:r.z*s[0]+n.z*s[1]+o.z*s[2]+e.z*s[3]};return a}var o=t-this.delay;0>o&&(o=0),o>this.duration&&(o=this.duration-1);var n=o/this.duration;if(n>=1)return this.points[this.length-1];var r=Math.floor((this.points.length-1)*n),i=(this.length-1)*n-r;return e(i,this.points[r],this.controls[r][1],this.controls[r+1][0],this.points[r+1])},Spline.prototype.draw=function(t,e){t.strokeStyle=e||"#7e5e38",t.lineWidth=14,t.beginPath();for(var o,n=0;n<this.duration;n+=10)o=this.pos(n),Math.floor(n/100)%2==0?t.lineTo(o.x,o.y):t.moveTo(o.x,o.y);return t.stroke(),this}},{"turf-linestring":34}],34:[function(t,e){e.exports=function(t,e){if(!t)return new Error("No coordinates passed");var o={type:"Feature",geometry:{type:"LineString",coordinates:t},properties:e};return o}},{}],35:[function(t,e){var o=t("turf-featurecollection"),n=t("turf-polygon"),r=t("turf-combine"),i=t("jsts");e.exports=function(t,e,o,n){var i;switch(n=n||function(){},o){case"miles":e/=69.047;break;case"kilometers":e/=111.12;break;case"degrees":}if("FeatureCollection"===t.type){var a=r(t);return a.properties={},i=s(a,e),n(null,i),i}return i=s(t,e),n(null,i),i};var s=function(t,e){var r=new i.io.GeoJSONReader,s=r.read(JSON.stringify(t.geometry)),a=s.buffer(e),u=new i.io.GeoJSONParser;return a=u.write(a),"MultiPolygon"===a.type?(a={type:"Feature",geometry:a,properties:{}},a=o([a])):a=o([n(a.coordinates)]),a}},{jsts:36,"turf-combine":42,"turf-featurecollection":67,"turf-polygon":115}],36:[function(t,e){t("javascript.util");var o=t("./lib/jsts");e.exports=o},{"./lib/jsts":37,"javascript.util":39}],37:[function(t,e){jsts={version:"0.15.0",algorithm:{distance:{},locate:{}},error:{},geom:{util:{}},geomgraph:{index:{}},index:{bintree:{},chain:{},kdtree:{},quadtree:{},strtree:{}},io:{},noding:{snapround:{}},operation:{buffer:{},distance:{},overlay:{snap:{}},polygonize:{},predicate:{},relate:{},union:{},valid:{}},planargraph:{},simplify:{},triangulate:{quadedge:{}},util:{}},"function"!=typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),jsts.abstractFunc=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.error={},jsts.error.IllegalArgumentError=function(t){this.name="IllegalArgumentError",this.message=t},jsts.error.IllegalArgumentError.prototype=new Error,jsts.error.TopologyError=function(t,e){this.name="TopologyError",this.message=e?t+" [ "+e+" ]":t},jsts.error.TopologyError.prototype=new Error,jsts.error.AbstractMethodInvocationError=function(){this.name="AbstractMethodInvocationError",this.message="Abstract method called, should be implemented in subclass."},jsts.error.AbstractMethodInvocationError.prototype=new Error,jsts.error.NotImplementedError=function(){this.name="NotImplementedError",this.message="This method has not yet been implemented."},jsts.error.NotImplementedError.prototype=new Error,jsts.error.NotRepresentableError=function(t){this.name="NotRepresentableError",this.message=t},jsts.error.NotRepresentableError.prototype=new Error,jsts.error.LocateFailureError=function(t){this.name="LocateFailureError",this.message=t},jsts.error.LocateFailureError.prototype=new Error,"undefined"!=typeof e&&(e.exports=jsts),jsts.geom.GeometryFilter=function(){},jsts.geom.GeometryFilter.prototype.filter=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.util.PolygonExtracter=function(t){this.comps=t},jsts.geom.util.PolygonExtracter.prototype=new jsts.geom.GeometryFilter,jsts.geom.util.PolygonExtracter.prototype.comps=null,jsts.geom.util.PolygonExtracter.getPolygons=function(t,e){return void 0===e&&(e=[]),t instanceof jsts.geom.Polygon?e.push(t):t instanceof jsts.geom.GeometryCollection&&t.apply(new jsts.geom.util.PolygonExtracter(e)),e},jsts.geom.util.PolygonExtracter.prototype.filter=function(t){t instanceof jsts.geom.Polygon&&this.comps.push(t)},jsts.io.WKTParser=function(t){this.geometryFactory=t||new jsts.geom.GeometryFactory,this.regExes={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/}},jsts.io.WKTParser.prototype.read=function(t){var e,o,n;t=t.replace(/[\n\r]/g," ");var r=this.regExes.typeStr.exec(t);if(-1!==t.search("EMPTY")&&(r=this.regExes.emptyTypeStr.exec(t),r[2]=void 0),r&&(o=r[1].toLowerCase(),n=r[2],this.parse[o]&&(e=this.parse[o].apply(this,[n]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},jsts.io.WKTParser.prototype.write=function(t){return this.extractGeometry(t)},jsts.io.WKTParser.prototype.extractGeometry=function(t){var e=t.CLASS_NAME.split(".")[2].toLowerCase();if(!this.extract[e])return null;var o,n=e.toUpperCase();return o=t.isEmpty()?n+" EMPTY":n+"("+this.extract[e].apply(this,[t])+")"},jsts.io.WKTParser.prototype.extract={coordinate:function(t){return t.x+" "+t.y},point:function(t){return t.coordinate.x+" "+t.coordinate.y},multipoint:function(t){for(var e=[],o=0,n=t.geometries.length;n>o;++o)e.push("("+this.extract.point.apply(this,[t.geometries[o]])+")");return e.join(",")},linestring:function(t){for(var e=[],o=0,n=t.points.length;n>o;++o)e.push(this.extract.coordinate.apply(this,[t.points[o]]));return e.join(",")},multilinestring:function(t){for(var e=[],o=0,n=t.geometries.length;n>o;++o)e.push("("+this.extract.linestring.apply(this,[t.geometries[o]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+this.extract.linestring.apply(this,[t.shell])+")");for(var o=0,n=t.holes.length;n>o;++o)e.push("("+this.extract.linestring.apply(this,[t.holes[o]])+")");return e.join(",")},multipolygon:function(t){for(var e=[],o=0,n=t.geometries.length;n>o;++o)e.push("("+this.extract.polygon.apply(this,[t.geometries[o]])+")");return e.join(",")},geometrycollection:function(t){for(var e=[],o=0,n=t.geometries.length;n>o;++o)e.push(this.extractGeometry.apply(this,[t.geometries[o]]));return e.join(",")}},jsts.io.WKTParser.prototype.parse={point:function(t){if(void 0===t)return this.geometryFactory.createPoint(null);var e=t.trim().split(this.regExes.spaces);return this.geometryFactory.createPoint(new jsts.geom.Coordinate(e[0],e[1]))},multipoint:function(t){if(void 0===t)return this.geometryFactory.createMultiPoint(null);for(var e,o=t.trim().split(","),n=[],r=0,i=o.length;i>r;++r)e=o[r].replace(this.regExes.trimParens,"$1"),n.push(this.parse.point.apply(this,[e]));return this.geometryFactory.createMultiPoint(n)},linestring:function(t){if(void 0===t)return this.geometryFactory.createLineString(null);for(var e,o=t.trim().split(","),n=[],r=0,i=o.length;i>r;++r)e=o[r].trim().split(this.regExes.spaces),n.push(new jsts.geom.Coordinate(e[0],e[1]));return this.geometryFactory.createLineString(n)},linearring:function(t){if(void 0===t)return this.geometryFactory.createLinearRing(null);for(var e,o=t.trim().split(","),n=[],r=0,i=o.length;i>r;++r)e=o[r].trim().split(this.regExes.spaces),n.push(new jsts.geom.Coordinate(e[0],e[1]));return this.geometryFactory.createLinearRing(n)},multilinestring:function(t){if(void 0===t)return this.geometryFactory.createMultiLineString(null);for(var e,o=t.trim().split(this.regExes.parenComma),n=[],r=0,i=o.length;i>r;++r)e=o[r].replace(this.regExes.trimParens,"$1"),n.push(this.parse.linestring.apply(this,[e]));return this.geometryFactory.createMultiLineString(n)},polygon:function(t){if(void 0===t)return this.geometryFactory.createPolygon(null);for(var e,o,n,r,i=t.trim().split(this.regExes.parenComma),s=[],a=0,u=i.length;u>a;++a)e=i[a].replace(this.regExes.trimParens,"$1"),o=this.parse.linestring.apply(this,[e]),n=this.geometryFactory.createLinearRing(o.points),0===a?r=n:s.push(n);return this.geometryFactory.createPolygon(r,s)},multipolygon:function(t){if(void 0===t)return this.geometryFactory.createMultiPolygon(null);for(var e,o=t.trim().split(this.regExes.doubleParenComma),n=[],r=0,i=o.length;i>r;++r)e=o[r].replace(this.regExes.trimParens,"$1"),n.push(this.parse.polygon.apply(this,[e]));return this.geometryFactory.createMultiPolygon(n)},geometrycollection:function(t){if(void 0===t)return this.geometryFactory.createGeometryCollection(null);t=t.replace(/,\s*([A-Za-z])/g,"|$1");for(var e=t.trim().split("|"),o=[],n=0,r=e.length;r>n;++n)o.push(jsts.io.WKTParser.prototype.read.apply(this,[e[n]]));return this.geometryFactory.createGeometryCollection(o)}},jsts.index.ItemVisitor=function(){},jsts.index.ItemVisitor.prototype.visitItem=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.algorithm.CGAlgorithms=function(){},jsts.algorithm.CGAlgorithms.CLOCKWISE=-1,jsts.algorithm.CGAlgorithms.RIGHT=jsts.algorithm.CGAlgorithms.CLOCKWISE,jsts.algorithm.CGAlgorithms.COUNTERCLOCKWISE=1,jsts.algorithm.CGAlgorithms.LEFT=jsts.algorithm.CGAlgorithms.COUNTERCLOCKWISE,jsts.algorithm.CGAlgorithms.COLLINEAR=0,jsts.algorithm.CGAlgorithms.STRAIGHT=jsts.algorithm.CGAlgorithms.COLLINEAR,jsts.algorithm.CGAlgorithms.orientationIndex=function(t,e,o){var n,r,i,s;return n=e.x-t.x,r=e.y-t.y,i=o.x-e.x,s=o.y-e.y,jsts.algorithm.RobustDeterminant.signOfDet2x2(n,r,i,s)},jsts.algorithm.CGAlgorithms.isPointInRing=function(t,e){return jsts.algorithm.CGAlgorithms.locatePointInRing(t,e)!==jsts.geom.Location.EXTERIOR},jsts.algorithm.CGAlgorithms.locatePointInRing=function(t,e){return jsts.algorithm.RayCrossingCounter.locatePointInRing(t,e)},jsts.algorithm.CGAlgorithms.isOnLine=function(t,e){var o,n,r,i,s;for(o=new jsts.algorithm.RobustLineIntersector,n=1,r=e.length;r>n;n++)if(i=e[n-1],s=e[n],o.computeIntersection(t,i,s),o.hasIntersection())return!0;return!1},jsts.algorithm.CGAlgorithms.isCCW=function(t){var e,o,n,r,i,s,a,u,p,g,l;if(e=t.length-1,3>e)throw new jsts.IllegalArgumentError("Ring has fewer than 3 points, so orientation cannot be determined");for(o=t[0],n=0,p=1;e>=p;p++)r=t[p],r.y>o.y&&(o=r,n=p);i=n;do i-=1,0>i&&(i=e);while(t[i].equals2D(o)&&i!==n);s=n;do s=(s+1)%e;while(t[s].equals2D(o)&&s!==n);return a=t[i],u=t[s],a.equals2D(o)||u.equals2D(o)||a.equals2D(u)?!1:(g=jsts.algorithm.CGAlgorithms.computeOrientation(a,o,u),l=!1,l=0===g?a.x>u.x:g>0)},jsts.algorithm.CGAlgorithms.computeOrientation=function(t,e,o){return jsts.algorithm.CGAlgorithms.orientationIndex(t,e,o)},jsts.algorithm.CGAlgorithms.distancePointLine=function(t,e,o){if(e instanceof jsts.geom.Coordinate||jsts.algorithm.CGAlgorithms.distancePointLine2.apply(this,arguments),e.x===o.x&&e.y===o.y)return t.distance(e);var n,r;return n=((t.x-e.x)*(o.x-e.x)+(t.y-e.y)*(o.y-e.y))/((o.x-e.x)*(o.x-e.x)+(o.y-e.y)*(o.y-e.y)),0>=n?t.distance(e):n>=1?t.distance(o):(r=((e.y-t.y)*(o.x-e.x)-(e.x-t.x)*(o.y-e.y))/((o.x-e.x)*(o.x-e.x)+(o.y-e.y)*(o.y-e.y)),Math.abs(r)*Math.sqrt((o.x-e.x)*(o.x-e.x)+(o.y-e.y)*(o.y-e.y)))},jsts.algorithm.CGAlgorithms.distancePointLinePerpendicular=function(t,e,o){var n=((e.y-t.y)*(o.x-e.x)-(e.x-t.x)*(o.y-e.y))/((o.x-e.x)*(o.x-e.x)+(o.y-e.y)*(o.y-e.y));return Math.abs(n)*Math.sqrt((o.x-e.x)*(o.x-e.x)+(o.y-e.y)*(o.y-e.y))},jsts.algorithm.CGAlgorithms.distancePointLine2=function(t,e){var o,n,r,i;if(0===e.length)throw new jsts.error.IllegalArgumentError("Line array must contain at least one vertex");for(o=t.distance(e[0]),n=0,r=e.length-1;r>n;n++)i=jsts.algorithm.CGAlgorithms.distancePointLine(t,e[n],e[n+1]),o>i&&(o=i);return o},jsts.algorithm.CGAlgorithms.distanceLineLine=function(t,e,o,n){if(t.equals(e))return jsts.algorithm.CGAlgorithms.distancePointLine(t,o,n);if(o.equals(n))return jsts.algorithm.CGAlgorithms.distancePointLine(n,t,e);var r,i,s,a,u,p;return r=(t.y-o.y)*(n.x-o.x)-(t.x-o.x)*(n.y-o.y),i=(e.x-t.x)*(n.y-o.y)-(e.y-t.y)*(n.x-o.x),s=(t.y-o.y)*(e.x-t.x)-(t.x-o.x)*(e.y-t.y),a=(e.x-t.x)*(n.y-o.y)-(e.y-t.y)*(n.x-o.x),0===i||0===a?Math.min(jsts.algorithm.CGAlgorithms.distancePointLine(t,o,n),Math.min(jsts.algorithm.CGAlgorithms.distancePointLine(e,o,n),Math.min(jsts.algorithm.CGAlgorithms.distancePointLine(o,t,e),jsts.algorithm.CGAlgorithms.distancePointLine(n,t,e)))):(u=s/a,p=r/i,0>p||p>1||0>u||u>1?Math.min(jsts.algorithm.CGAlgorithms.distancePointLine(t,o,n),Math.min(jsts.algorithm.CGAlgorithms.distancePointLine(e,o,n),Math.min(jsts.algorithm.CGAlgorithms.distancePointLine(o,t,e),jsts.algorithm.CGAlgorithms.distancePointLine(n,t,e)))):0)},jsts.algorithm.CGAlgorithms.signedArea=function(t){if(t.length<3)return 0;var e,o,n,r,i,s,a;for(e=0,o=0,n=t.length-1;n>o;o++)r=t[o].x,i=t[o].y,s=t[o+1].x,a=t[o+1].y,e+=(r+s)*(a-i);return-e/2},jsts.algorithm.CGAlgorithms.signedArea=function(t){var e,o,n,r,i,s,a,u;if(e=t.length,3>e)return 0;for(o=0,n=t[0],r=n.x,i=n.y,s=1;e>s;s++)n=t[s],a=n.x,u=n.y,o+=(r+a)*(u-i),r=a,i=u;return-o/2},jsts.algorithm.CGAlgorithms.computeLength=function(t){var e,o,n,r,i,s,a,u,p,g,l=t.length;if(1>=l)return 0;for(e=0,u=t[0],o=u.x,n=u.y,p=1,g=l,p;l>p;p++)u=t[p],r=u.x,i=u.y,s=r-o,a=i-n,e+=Math.sqrt(s*s+a*a),o=r,n=i;return e},jsts.algorithm.CGAlgorithms.length=function(){},jsts.algorithm.Angle=function(){},jsts.algorithm.Angle.PI_TIMES_2=2*Math.PI,jsts.algorithm.Angle.PI_OVER_2=Math.PI/2,jsts.algorithm.Angle.PI_OVER_4=Math.PI/4,jsts.algorithm.Angle.COUNTERCLOCKWISE=jsts.algorithm.CGAlgorithms.COUNTERCLOCKWISE,jsts.algorithm.Angle.CLOCKWISE=jsts.algorithm.CGAlgorithms.CLOCKWISE,jsts.algorithm.Angle.NONE=jsts.algorithm.CGAlgorithms.COLLINEAR,jsts.algorithm.Angle.toDegrees=function(t){return 180*t/Math.PI},jsts.algorithm.Angle.toRadians=function(t){return t*Math.PI/180},jsts.algorithm.Angle.angle=function(){return 1===arguments.length?jsts.algorithm.Angle.angleFromOrigo(arguments[0]):jsts.algorithm.Angle.angleBetweenCoords(arguments[0],arguments[1])},jsts.algorithm.Angle.angleBetweenCoords=function(t,e){var o,n;return o=e.x-t.x,n=e.y-t.y,Math.atan2(n,o)},jsts.algorithm.Angle.angleFromOrigo=function(t){return Math.atan2(t.y,t.x)},jsts.algorithm.Angle.isAcute=function(t,e,o){var n,r,i,s,a;return n=t.x-e.x,r=t.y-e.y,i=o.x-e.x,s=o.y-e.y,a=n*i+r*s,a>0},jsts.algorithm.Angle.isObtuse=function(t,e,o){var n,r,i,s,a;return n=t.x-e.x,r=t.y-e.y,i=o.x-e.x,s=o.y-e.y,a=n*i+r*s,0>a},jsts.algorithm.Angle.angleBetween=function(t,e,o){var n,r;return n=jsts.algorithm.Angle.angle(e,t),r=jsts.algorithm.Angle.angle(e,o),jsts.algorithm.Angle.diff(n,r)},jsts.algorithm.Angle.angleBetweenOriented=function(t,e,o){var n,r,i;return n=jsts.algorithm.Angle.angle(e,t),r=jsts.algorithm.Angle.angle(e,o),i=r-n,i<=-Math.PI?i+jsts.algorithm.Angle.PI_TIMES_2:i>Math.PI?i-jsts.algorithm.Angle.PI_TIMES_2:i},jsts.algorithm.Angle.interiorAngle=function(t,e,o){var n,r;return n=jsts.algorithm.Angle.angle(e,t),r=jsts.algorithm.Angle.angle(e,o),Math.abs(r-n)},jsts.algorithm.Angle.getTurn=function(t,e){var o=Math.sin(e-t);return o>0?jsts.algorithm.Angle.COUNTERCLOCKWISE:0>o?jsts.algorithm.Angle.CLOCKWISE:jsts.algorithm.Angle.NONE},jsts.algorithm.Angle.normalize=function(t){for(;t>Math.PI;)t-=jsts.algorithm.Angle.PI_TIMES_2;for(;t<=-Math.PI;)t+=jsts.algorithm.Angle.PI_TIMES_2;return t},jsts.algorithm.Angle.normalizePositive=function(t){if(0>t){for(;0>t;)t+=jsts.algorithm.Angle.PI_TIMES_2;t>=jsts.algorithm.Angle.PI_TIMES_2&&(t=0)}else{for(;t>=jsts.algorithm.Angle.PI_TIMES_2;)t-=jsts.algorithm.Angle.PI_TIMES_2;0>t&&(t=0)}return t},jsts.algorithm.Angle.diff=function(t,e){var o;return o=e>t?e-t:t-e,o>Math.PI&&(o=2*Math.PI-o),o},jsts.geom.GeometryComponentFilter=function(){},jsts.geom.GeometryComponentFilter.prototype.filter=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.util.LinearComponentExtracter=function(t,e){this.lines=t,this.isForcedToLineString=e},jsts.geom.util.LinearComponentExtracter.prototype=new jsts.geom.GeometryComponentFilter,jsts.geom.util.LinearComponentExtracter.prototype.lines=null,jsts.geom.util.LinearComponentExtracter.prototype.isForcedToLineString=!1,jsts.geom.util.LinearComponentExtracter.getLines=function(t,e){if(1==arguments.length)return jsts.geom.util.LinearComponentExtracter.getLines5.apply(this,arguments);if(2==arguments.length&&"boolean"==typeof e)return jsts.geom.util.LinearComponentExtracter.getLines6.apply(this,arguments);if(2==arguments.length&&t instanceof jsts.geom.Geometry)return jsts.geom.util.LinearComponentExtracter.getLines3.apply(this,arguments);if(3==arguments.length&&t instanceof jsts.geom.Geometry)return jsts.geom.util.LinearComponentExtracter.getLines4.apply(this,arguments);if(3==arguments.length)return jsts.geom.util.LinearComponentExtracter.getLines2.apply(this,arguments);for(var o=0;o<t.length;o++){var n=t[o];jsts.geom.util.LinearComponentExtracter.getLines3(n,e)}return e},jsts.geom.util.LinearComponentExtracter.getLines2=function(t,e,o){for(var n=0;n<t.length;n++){var r=t[n];jsts.geom.util.LinearComponentExtracter.getLines4(r,e,o)}return e},jsts.geom.util.LinearComponentExtracter.getLines3=function(t,e){return t instanceof LineString?e.add(t):t.apply(new jsts.geom.util.LinearComponentExtracter(e)),e},jsts.geom.util.LinearComponentExtracter.getLines4=function(t,e,o){return t.apply(new jsts.geom.util.LinearComponentExtracter(e,o)),e},jsts.geom.util.LinearComponentExtracter.getLines5=function(t){return jsts.geom.util.LinearComponentExtracter.getLines6(t,!1)},jsts.geom.util.LinearComponentExtracter.getLines6=function(t,e){var o=[];return t.apply(new jsts.geom.util.LinearComponentExtracter(o,e)),o},jsts.geom.util.LinearComponentExtracter.prototype.setForceToLineString=function(t){this.isForcedToLineString=t},jsts.geom.util.LinearComponentExtracter.prototype.filter=function(t){if(this.isForcedToLineString&&t instanceof jsts.geom.LinearRing){var e=t.getFactory().createLineString(t.getCoordinateSequence());return void this.lines.push(e)}(t instanceof jsts.geom.LineString||t instanceof jsts.geom.LinearRing)&&this.lines.push(t)},jsts.geom.Location=function(){},jsts.geom.Location.INTERIOR=0,jsts.geom.Location.BOUNDARY=1,jsts.geom.Location.EXTERIOR=2,jsts.geom.Location.NONE=-1,jsts.geom.Location.toLocationSymbol=function(t){switch(t){case jsts.geom.Location.EXTERIOR:return"e";case jsts.geom.Location.BOUNDARY:return"b";case jsts.geom.Location.INTERIOR:return"i";case jsts.geom.Location.NONE:return"-"}throw new jsts.IllegalArgumentError("Unknown location value: "+t)},function(){jsts.io.GeoJSONReader=function(t){this.geometryFactory=t||new jsts.geom.GeometryFactory,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new jsts.io.GeoJSONParser(this.geometryFactory)},jsts.io.GeoJSONReader.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===jsts.geom.PrecisionModel.FIXED&&this.reducePrecision(e),e},jsts.io.GeoJSONReader.prototype.reducePrecision=function(t){var e,o;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(e=0,o=t.points.length;o>e;e++)this.precisionModel.makePrecise(t.points[e]);else if(t.geometries)for(e=0,o=t.geometries.length;o>e;e++)this.reducePrecision(t.geometries[e])}}(),jsts.geom.Geometry=function(t){this.factory=t},jsts.geom.Geometry.prototype.envelope=null,jsts.geom.Geometry.prototype.factory=null,jsts.geom.Geometry.prototype.getGeometryType=function(){return"Geometry"},jsts.geom.Geometry.hasNonEmptyElements=function(t){var e;for(e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},jsts.geom.Geometry.hasNullElements=function(t){var e;for(e=0;e<t.length;e++)if(null===t[e])return!0;return!1},jsts.geom.Geometry.prototype.getFactory=function(){return(null===this.factory||void 0===this.factory)&&(this.factory=new jsts.geom.GeometryFactory),this.factory},jsts.geom.Geometry.prototype.getNumGeometries=function(){return 1},jsts.geom.Geometry.prototype.getGeometryN=function(){return this},jsts.geom.Geometry.prototype.getPrecisionModel=function(){return this.getFactory().getPrecisionModel()},jsts.geom.Geometry.prototype.getCoordinate=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.Geometry.prototype.getCoordinates=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.Geometry.prototype.getNumPoints=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.Geometry.prototype.isSimple=function(){this.checkNotGeometryCollection(this);var t=new jsts.operation.IsSimpleOp(this);return t.isSimple()},jsts.geom.Geometry.prototype.isValid=function(){var t=new jsts.operation.valid.IsValidOp(this);return t.isValid()},jsts.geom.Geometry.prototype.isEmpty=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.Geometry.prototype.distance=function(t){return jsts.operation.distance.DistanceOp.distance(this,t)},jsts.geom.Geometry.prototype.isWithinDistance=function(t,e){var o=this.getEnvelopeInternal().distance(t.getEnvelopeInternal());return o>e?!1:DistanceOp.isWithinDistance(this,t,e)},jsts.geom.Geometry.prototype.isRectangle=function(){return!1},jsts.geom.Geometry.prototype.getArea=function(){return 0},jsts.geom.Geometry.prototype.getLength=function(){return 0},jsts.geom.Geometry.prototype.getCentroid=function(){if(this.isEmpty())return null;var t,e=null,o=this.getDimension();return 0===o?(t=new jsts.algorithm.CentroidPoint,t.add(this),e=t.getCentroid()):1===o?(t=new jsts.algorithm.CentroidLine,t.add(this),e=t.getCentroid()):(t=new jsts.algorithm.CentroidArea,t.add(this),e=t.getCentroid()),this.createPointFromInternalCoord(e,this)},jsts.geom.Geometry.prototype.getInteriorPoint=function(){var t,e=null,o=this.getDimension();return 0===o?(t=new jsts.algorithm.InteriorPointPoint(this),e=t.getInteriorPoint()):1===o?(t=new jsts.algorithm.InteriorPointLine(this),e=t.getInteriorPoint()):(t=new jsts.algorithm.InteriorPointArea(this),e=t.getInteriorPoint()),this.createPointFromInternalCoord(e,this)},jsts.geom.Geometry.prototype.getDimension=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.Geometry.prototype.getBoundary=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.Geometry.prototype.getBoundaryDimension=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.Geometry.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},jsts.geom.Geometry.prototype.getEnvelopeInternal=function(){return null===this.envelope&&(this.envelope=this.computeEnvelopeInternal()),this.envelope},jsts.geom.Geometry.prototype.disjoint=function(t){return!this.intersects(t)},jsts.geom.Geometry.prototype.touches=function(t){return this.getEnvelopeInternal().intersects(t.getEnvelopeInternal())?this.relate(t).isTouches(this.getDimension(),t.getDimension()):!1},jsts.geom.Geometry.prototype.intersects=function(t){return this.getEnvelopeInternal().intersects(t.getEnvelopeInternal())?this.isRectangle()?jsts.operation.predicate.RectangleIntersects.intersects(this,t):t.isRectangle()?jsts.operation.predicate.RectangleIntersects.intersects(t,this):this.relate(t).isIntersects():!1},jsts.geom.Geometry.prototype.crosses=function(t){return this.getEnvelopeInternal().intersects(t.getEnvelopeInternal())?this.relate(t).isCrosses(this.getDimension(),t.getDimension()):!1},jsts.geom.Geometry.prototype.within=function(t){return t.contains(this)},jsts.geom.Geometry.prototype.contains=function(t){return this.getEnvelopeInternal().contains(t.getEnvelopeInternal())?this.isRectangle()?jsts.operation.predicate.RectangleContains.contains(this,t):this.relate(t).isContains():!1},jsts.geom.Geometry.prototype.overlaps=function(t){return this.getEnvelopeInternal().intersects(t.getEnvelopeInternal())?this.relate(t).isOverlaps(this.getDimension(),t.getDimension()):!1},jsts.geom.Geometry.prototype.covers=function(t){return this.getEnvelopeInternal().covers(t.getEnvelopeInternal())?this.isRectangle()?!0:this.relate(t).isCovers():!1},jsts.geom.Geometry.prototype.coveredBy=function(t){return t.covers(this)},jsts.geom.Geometry.prototype.relate=function(t,e){return 1===arguments.length?this.relate2.apply(this,arguments):this.relate2(t).matches(e)},jsts.geom.Geometry.prototype.relate2=function(t){return this.checkNotGeometryCollection(this),this.checkNotGeometryCollection(t),jsts.operation.relate.RelateOp.relate(this,t)
},jsts.geom.Geometry.prototype.equalsTopo=function(t){return this.getEnvelopeInternal().equals(t.getEnvelopeInternal())?this.relate(t).isEquals(this.getDimension(),t.getDimension()):!1},jsts.geom.Geometry.prototype.equals=function(t){return t instanceof jsts.geom.Geometry||t instanceof jsts.geom.LinearRing||t instanceof jsts.geom.Polygon||t instanceof jsts.geom.GeometryCollection||t instanceof jsts.geom.MultiPoint||t instanceof jsts.geom.MultiLineString||t instanceof jsts.geom.MultiPolygon?this.equalsExact(t):!1},jsts.geom.Geometry.prototype.buffer=function(t,e,o){var n=new jsts.operation.buffer.BufferParameters(e,o);return jsts.operation.buffer.BufferOp.bufferOp2(this,t,n)},jsts.geom.Geometry.prototype.convexHull=function(){return new jsts.algorithm.ConvexHull(this).getConvexHull()},jsts.geom.Geometry.prototype.intersection=function(t){if(this.isEmpty())return this.getFactory().createGeometryCollection(null);if(t.isEmpty())return this.getFactory().createGeometryCollection(null);if(this.isGeometryCollection(this));return this.checkNotGeometryCollection(this),this.checkNotGeometryCollection(t),jsts.operation.overlay.snap.SnapIfNeededOverlayOp.overlayOp(this,t,jsts.operation.overlay.OverlayOp.INTERSECTION)},jsts.geom.Geometry.prototype.union=function(t){return 0===arguments.length?jsts.operation.union.UnaryUnionOp.union(this):this.isEmpty()?t.clone():t.isEmpty()?this.clone():(this.checkNotGeometryCollection(this),this.checkNotGeometryCollection(t),jsts.operation.overlay.snap.SnapIfNeededOverlayOp.overlayOp(this,t,jsts.operation.overlay.OverlayOp.UNION))},jsts.geom.Geometry.prototype.difference=function(t){return this.isEmpty()?this.getFactory().createGeometryCollection(null):t.isEmpty()?this.clone():(this.checkNotGeometryCollection(this),this.checkNotGeometryCollection(t),jsts.operation.overlay.snap.SnapIfNeededOverlayOp.overlayOp(this,t,jsts.operation.overlay.OverlayOp.DIFFERENCE))},jsts.geom.Geometry.prototype.symDifference=function(t){return this.isEmpty()?t.clone():t.isEmpty()?this.clone():(this.checkNotGeometryCollection(this),this.checkNotGeometryCollection(t),jsts.operation.overlay.snap.SnapIfNeededOverlayOp.overlayOp(this,t,jsts.operation.overlay.OverlayOp.SYMDIFFERENCE))},jsts.geom.Geometry.prototype.equalsExact=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.Geometry.prototype.equalsNorm=function(t){return null===t||void 0===t?!1:this.norm().equalsExact(t.norm())},jsts.geom.Geometry.prototype.apply=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.Geometry.prototype.clone=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.Geometry.prototype.normalize=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.Geometry.prototype.norm=function(){var t=this.clone();return t.normalize(),t},jsts.geom.Geometry.prototype.compareTo=function(t){var e=t;return this.getClassSortIndex()!==e.getClassSortIndex()?this.getClassSortIndex()-e.getClassSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)},jsts.geom.Geometry.prototype.isEquivalentClass=function(t){return this instanceof jsts.geom.Point&&t instanceof jsts.geom.Point?!0:this instanceof jsts.geom.LineString&&t instanceof jsts.geom.LineString|t instanceof jsts.geom.LinearRing?!0:this instanceof jsts.geom.LinearRing&&t instanceof jsts.geom.LineString|t instanceof jsts.geom.LinearRing?!0:this instanceof jsts.geom.Polygon&&t instanceof jsts.geom.Polygon?!0:this instanceof jsts.geom.MultiPoint&&t instanceof jsts.geom.MultiPoint?!0:this instanceof jsts.geom.MultiLineString&&t instanceof jsts.geom.MultiLineString?!0:this instanceof jsts.geom.MultiPolygon&&t instanceof jsts.geom.MultiPolygon?!0:this instanceof jsts.geom.GeometryCollection&&t instanceof jsts.geom.GeometryCollection?!0:!1},jsts.geom.Geometry.prototype.checkNotGeometryCollection=function(t){if(t.isGeometryCollectionBase())throw new jsts.error.IllegalArgumentError("This method does not support GeometryCollection")},jsts.geom.Geometry.prototype.isGeometryCollection=function(){return this instanceof jsts.geom.GeometryCollection},jsts.geom.Geometry.prototype.isGeometryCollectionBase=function(){return"jsts.geom.GeometryCollection"===this.CLASS_NAME},jsts.geom.Geometry.prototype.computeEnvelopeInternal=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.Geometry.prototype.compareToSameClass=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.Geometry.prototype.compare=function(t,e){for(var o=t.iterator(),n=e.iterator();o.hasNext()&&n.hasNext();){var r=o.next(),i=n.next(),s=r.compareTo(i);if(0!==s)return s}return o.hasNext()?1:n.hasNext()?-1:0},jsts.geom.Geometry.prototype.equal=function(t,e,o){return void 0===o||null===o||0===o?t.equals(e):t.distance(e)<=o},jsts.geom.Geometry.prototype.getClassSortIndex=function(){for(var t=[jsts.geom.Point,jsts.geom.MultiPoint,jsts.geom.LineString,jsts.geom.LinearRing,jsts.geom.MultiLineString,jsts.geom.Polygon,jsts.geom.MultiPolygon,jsts.geom.GeometryCollection],e=0;e<t.length;e++)if(this instanceof t[e])return e;return jsts.util.Assert.shouldNeverReachHere("Class not supported: "+this),-1},jsts.geom.Geometry.prototype.toString=function(){return(new jsts.io.WKTWriter).write(this)},jsts.geom.Geometry.prototype.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},function(){jsts.geom.Coordinate=function(t,e){"number"==typeof t?(this.x=t,this.y=e):t instanceof jsts.geom.Coordinate?(this.x=parseFloat(t.x),this.y=parseFloat(t.y)):void 0===t||null===t?(this.x=0,this.y=0):"string"==typeof t&&(this.x=parseFloat(t),this.y=parseFloat(e))},jsts.geom.Coordinate.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y},jsts.geom.Coordinate.prototype.clone=function(){return new jsts.geom.Coordinate(this.x,this.y)},jsts.geom.Coordinate.prototype.distance=function(t){var e=this.x-t.x,o=this.y-t.y;return Math.sqrt(e*e+o*o)},jsts.geom.Coordinate.prototype.equals2D=function(t){return this.x!==t.x?!1:this.y!==t.y?!1:!0},jsts.geom.Coordinate.prototype.equals=function(t){return!t instanceof jsts.geom.Coordinate||void 0===t?!1:this.equals2D(t)},jsts.geom.Coordinate.prototype.compareTo=function(t){return this.x<t.x?-1:this.x>t.x?1:this.y<t.y?-1:this.y>t.y?1:0},jsts.geom.Coordinate.prototype.toString=function(){return"("+this.x+", "+this.y+")"}}(),jsts.geom.Envelope=function(){jsts.geom.Envelope.prototype.init.apply(this,arguments)},jsts.geom.Envelope.prototype.minx=null,jsts.geom.Envelope.prototype.maxx=null,jsts.geom.Envelope.prototype.miny=null,jsts.geom.Envelope.prototype.maxy=null,jsts.geom.Envelope.prototype.init=function(){"number"==typeof arguments[0]&&4===arguments.length?this.initFromValues(arguments[0],arguments[1],arguments[2],arguments[3]):arguments[0]instanceof jsts.geom.Coordinate&&1===arguments.length?this.initFromCoordinate(arguments[0]):arguments[0]instanceof jsts.geom.Coordinate&&2===arguments.length?this.initFromCoordinates(arguments[0],arguments[1]):arguments[0]instanceof jsts.geom.Envelope&&1===arguments.length?this.initFromEnvelope(arguments[0]):this.setToNull()},jsts.geom.Envelope.prototype.initFromValues=function(t,e,o,n){e>t?(this.minx=t,this.maxx=e):(this.minx=e,this.maxx=t),n>o?(this.miny=o,this.maxy=n):(this.miny=n,this.maxy=o)},jsts.geom.Envelope.prototype.initFromCoordinates=function(t,e){this.initFromValues(t.x,e.x,t.y,e.y)},jsts.geom.Envelope.prototype.initFromCoordinate=function(t){this.initFromValues(t.x,t.x,t.y,t.y)},jsts.geom.Envelope.prototype.initFromEnvelope=function(t){this.minx=t.minx,this.maxx=t.maxx,this.miny=t.miny,this.maxy=t.maxy},jsts.geom.Envelope.prototype.setToNull=function(){this.minx=0,this.maxx=-1,this.miny=0,this.maxy=-1},jsts.geom.Envelope.prototype.isNull=function(){return this.maxx<this.minx},jsts.geom.Envelope.prototype.getHeight=function(){return this.isNull()?0:this.maxy-this.miny},jsts.geom.Envelope.prototype.getWidth=function(){return this.isNull()?0:this.maxx-this.minx},jsts.geom.Envelope.prototype.getMinX=function(){return this.minx},jsts.geom.Envelope.prototype.getMaxX=function(){return this.maxx},jsts.geom.Envelope.prototype.getMinY=function(){return this.miny},jsts.geom.Envelope.prototype.getMaxY=function(){return this.maxy},jsts.geom.Envelope.prototype.getArea=function(){return this.getWidth()*this.getHeight()},jsts.geom.Envelope.prototype.expandToInclude=function(){arguments[0]instanceof jsts.geom.Coordinate?this.expandToIncludeCoordinate(arguments[0]):arguments[0]instanceof jsts.geom.Envelope?this.expandToIncludeEnvelope(arguments[0]):this.expandToIncludeValues(arguments[0],arguments[1])},jsts.geom.Envelope.prototype.expandToIncludeCoordinate=function(t){this.expandToIncludeValues(t.x,t.y)},jsts.geom.Envelope.prototype.expandToIncludeValues=function(t,e){this.isNull()?(this.minx=t,this.maxx=t,this.miny=e,this.maxy=e):(t<this.minx&&(this.minx=t),t>this.maxx&&(this.maxx=t),e<this.miny&&(this.miny=e),e>this.maxy&&(this.maxy=e))},jsts.geom.Envelope.prototype.expandToIncludeEnvelope=function(t){t.isNull()||(this.isNull()?(this.minx=t.getMinX(),this.maxx=t.getMaxX(),this.miny=t.getMinY(),this.maxy=t.getMaxY()):(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)))},jsts.geom.Envelope.prototype.expandBy=function(){1===arguments.length?this.expandByDistance(arguments[0]):this.expandByDistances(arguments[0],arguments[1])},jsts.geom.Envelope.prototype.expandByDistance=function(t){this.expandByDistances(t,t)},jsts.geom.Envelope.prototype.expandByDistances=function(t,e){this.isNull()||(this.minx-=t,this.maxx+=t,this.miny-=e,this.maxy+=e,(this.minx>this.maxx||this.miny>this.maxy)&&this.setToNull())},jsts.geom.Envelope.prototype.translate=function(t,e){this.isNull()||this.init(this.minx+t,this.maxx+t,this.miny+e,this.maxy+e)},jsts.geom.Envelope.prototype.centre=function(){return this.isNull()?null:new jsts.geom.Coordinate((this.minx+this.maxx)/2,(this.miny+this.maxy)/2)},jsts.geom.Envelope.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new jsts.geom.Envelope;var e=this.minx>t.minx?this.minx:t.minx,o=this.miny>t.miny?this.miny:t.miny,n=this.maxx<t.maxx?this.maxx:t.maxx,r=this.maxy<t.maxy?this.maxy:t.maxy;return new jsts.geom.Envelope(e,n,o,r)},jsts.geom.Envelope.prototype.intersects=function(){return arguments[0]instanceof jsts.geom.Envelope?this.intersectsEnvelope(arguments[0]):arguments[0]instanceof jsts.geom.Coordinate?this.intersectsCoordinate(arguments[0]):this.intersectsValues(arguments[0],arguments[1])},jsts.geom.Envelope.prototype.intersectsEnvelope=function(t){if(this.isNull()||t.isNull())return!1;var e=!(t.minx>this.maxx||t.maxx<this.minx||t.miny>this.maxy||t.maxy<this.miny);return e},jsts.geom.Envelope.prototype.intersectsCoordinate=function(t){return this.intersectsValues(t.x,t.y)},jsts.geom.Envelope.prototype.intersectsValues=function(t,e){return this.isNull()?!1:!(t>this.maxx||t<this.minx||e>this.maxy||e<this.miny)},jsts.geom.Envelope.prototype.contains=function(){return arguments[0]instanceof jsts.geom.Envelope?this.containsEnvelope(arguments[0]):arguments[0]instanceof jsts.geom.Coordinate?this.containsCoordinate(arguments[0]):this.containsValues(arguments[0],arguments[1])},jsts.geom.Envelope.prototype.containsEnvelope=function(t){return this.coversEnvelope(t)},jsts.geom.Envelope.prototype.containsCoordinate=function(t){return this.coversCoordinate(t)},jsts.geom.Envelope.prototype.containsValues=function(t,e){return this.coversValues(t,e)},jsts.geom.Envelope.prototype.covers=function(){return arguments[0]instanceof jsts.geom.Envelope?this.coversEnvelope(arguments[0]):arguments[0]instanceof jsts.geom.Coordinate?this.coversCoordinate(arguments[0]):this.coversValues(arguments[0],arguments[1])},jsts.geom.Envelope.prototype.coversValues=function(t,e){return this.isNull()?!1:t>=this.minx&&t<=this.maxx&&e>=this.miny&&e<=this.maxy},jsts.geom.Envelope.prototype.coversCoordinate=function(t){return this.coversValues(t.x,t.y)},jsts.geom.Envelope.prototype.coversEnvelope=function(t){return this.isNull()||t.isNull()?!1:t.minx>=this.minx&&t.maxx<=this.maxx&&t.miny>=this.miny&&t.maxy<=this.maxy},jsts.geom.Envelope.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this.maxx<t.minx&&(e=t.minx-this.maxx),this.minx>t.maxx&&(e=this.minx-t.maxx);var o=0;return this.maxy<t.miny&&(o=t.miny-this.maxy),this.miny>t.maxy&&(o=this.miny-t.maxy),0===e?o:0===o?e:Math.sqrt(e*e+o*o)},jsts.geom.Envelope.prototype.equals=function(t){return this.isNull()?t.isNull():this.maxx===t.maxx&&this.maxy===t.maxy&&this.minx===t.minx&&this.miny===t.miny},jsts.geom.Envelope.prototype.toString=function(){return"Env["+this.minx+" : "+this.maxx+", "+this.miny+" : "+this.maxy+"]"},jsts.geom.Envelope.intersects=function(t,e,o){if(4===arguments.length)return jsts.geom.Envelope.intersectsEnvelope(arguments[0],arguments[1],arguments[2],arguments[3]);var n=t.x<e.x?t.x:e.x,r=t.x>e.x?t.x:e.x,i=t.y<e.y?t.y:e.y,s=t.y>e.y?t.y:e.y;return o.x>=n&&o.x<=r&&o.y>=i&&o.y<=s?!0:!1},jsts.geom.Envelope.intersectsEnvelope=function(t,e,o,n){var r=Math.min(o.x,n.x),i=Math.max(o.x,n.x),s=Math.min(t.x,e.x),a=Math.max(t.x,e.x);return s>i?!1:r>a?!1:(r=Math.min(o.y,n.y),i=Math.max(o.y,n.y),s=Math.min(t.y,e.y),a=Math.max(t.y,e.y),s>i?!1:r>a?!1:!0)},jsts.geom.Envelope.prototype.clone=function(){return new jsts.geom.Envelope(this.minx,this.maxx,this.miny,this.maxy)},jsts.geom.util.GeometryCombiner=function(t){this.geomFactory=jsts.geom.util.GeometryCombiner.extractFactory(t),this.inputGeoms=t},jsts.geom.util.GeometryCombiner.combine=function(t){if(arguments.length>1)return this.combine2.apply(this,arguments);var e=new jsts.geom.util.GeometryCombiner(t);return e.combine()},jsts.geom.util.GeometryCombiner.combine2=function(){var t=new javascript.util.ArrayList;Array.prototype.slice.call(arguments).forEach(function(e){t.add(e)});var e=new jsts.geom.util.GeometryCombiner(t);return e.combine()},jsts.geom.util.GeometryCombiner.prototype.geomFactory=null,jsts.geom.util.GeometryCombiner.prototype.skipEmpty=!1,jsts.geom.util.GeometryCombiner.prototype.inputGeoms,jsts.geom.util.GeometryCombiner.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},jsts.geom.util.GeometryCombiner.prototype.combine=function(){var t,e=new javascript.util.ArrayList;for(t=this.inputGeoms.iterator();t.hasNext();){var o=t.next();this.extractElements(o,e)}return 0===e.size()?null!==this.geomFactory?this.geomFactory.createGeometryCollection(null):null:this.geomFactory.buildGeometry(e)},jsts.geom.util.GeometryCombiner.prototype.extractElements=function(t,e){if(null!==t)for(var o=0;o<t.getNumGeometries();o++){var n=t.getGeometryN(o);this.skipEmpty&&n.isEmpty()||e.add(n)}},jsts.geom.PrecisionModel=function(t){return"number"==typeof t?(this.modelType=jsts.geom.PrecisionModel.FIXED,void(this.scale=t)):(this.modelType=t||jsts.geom.PrecisionModel.FLOATING,void(this.modelType===jsts.geom.PrecisionModel.FIXED&&(this.scale=1)))},jsts.geom.PrecisionModel.FLOATING="FLOATING",jsts.geom.PrecisionModel.FIXED="FIXED",jsts.geom.PrecisionModel.FLOATING_SINGLE="FLOATING_SINGLE",jsts.geom.PrecisionModel.prototype.scale=null,jsts.geom.PrecisionModel.prototype.modelType=null,jsts.geom.PrecisionModel.prototype.isFloating=function(){return this.modelType===jsts.geom.PrecisionModel.FLOATING||this.modelType===jsts.geom.PrecisionModel.FLOATING_SINLGE},jsts.geom.PrecisionModel.prototype.getScale=function(){return this.scale},jsts.geom.PrecisionModel.prototype.getType=function(){return this.modelType},jsts.geom.PrecisionModel.prototype.equals=function(t){return!0},jsts.geom.PrecisionModel.prototype.makePrecise=function(t){return t instanceof jsts.geom.Coordinate?void this.makePrecise2(t):isNaN(t)?t:this.modelType===jsts.geom.PrecisionModel.FIXED?Math.round(t*this.scale)/this.scale:t},jsts.geom.PrecisionModel.prototype.makePrecise2=function(t){this.modelType!==jsts.geom.PrecisionModel.FLOATING&&(t.x=this.makePrecise(t.x),t.y=this.makePrecise(t.y))},jsts.geom.PrecisionModel.prototype.compareTo=function(t){return 0},jsts.geom.CoordinateFilter=function(){},jsts.geom.CoordinateFilter.prototype.filter=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.simplify.DouglasPeuckerLineSimplifier=function(t){this.pts=t,this.seg=new jsts.geom.LineSegment},jsts.simplify.DouglasPeuckerLineSimplifier.prototype.pts=null,jsts.simplify.DouglasPeuckerLineSimplifier.prototype.usePt=null,jsts.simplify.DouglasPeuckerLineSimplifier.prototype.distanceTolerance=null,jsts.simplify.DouglasPeuckerLineSimplifier.simplify=function(t,e){var o=new jsts.simplify.DouglasPeuckerLineSimplifier(t);return o.setDistanceTolerance(e),o.simplify()},jsts.simplify.DouglasPeuckerLineSimplifier.prototype.setDistanceTolerance=function(t){this.distanceTolerance=t},jsts.simplify.DouglasPeuckerLineSimplifier.prototype.simplify=function(){this.usePt=[];for(var t=0;t<this.pts.length;t++)this.usePt[t]=!0;this.simplifySection(0,this.pts.length-1);for(var e=new jsts.geom.CoordinateList,o=0;o<this.pts.length;o++)this.usePt[o]&&e.add(new jsts.geom.Coordinate(this.pts[o]));return e.toCoordinateArray()},jsts.simplify.DouglasPeuckerLineSimplifier.prototype.seg=null,jsts.simplify.DouglasPeuckerLineSimplifier.prototype.simplifySection=function(t,e){if(t+1!=e){this.seg.p0=this.pts[t],this.seg.p1=this.pts[e];for(var o=-1,n=t,r=t+1;e>r;r++){var i=this.seg.distance(this.pts[r]);i>o&&(o=i,n=r)}if(o<=this.distanceTolerance)for(var s=t+1;e>s;s++)this.usePt[s]=!1;else this.simplifySection(t,n),this.simplifySection(n,e)}},jsts.geomgraph.EdgeIntersection=function(t,e,o){this.coord=new jsts.geom.Coordinate(t),this.segmentIndex=e,this.dist=o},jsts.geomgraph.EdgeIntersection.prototype.coord=null,jsts.geomgraph.EdgeIntersection.prototype.segmentIndex=null,jsts.geomgraph.EdgeIntersection.prototype.dist=null,jsts.geomgraph.EdgeIntersection.prototype.getCoordinate=function(){return this.coord},jsts.geomgraph.EdgeIntersection.prototype.getSegmentIndex=function(){return this.segmentIndex},jsts.geomgraph.EdgeIntersection.prototype.getDistance=function(){return this.dist},jsts.geomgraph.EdgeIntersection.prototype.compareTo=function(t){return this.compare(t.segmentIndex,t.dist)},jsts.geomgraph.EdgeIntersection.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},jsts.geomgraph.EdgeIntersection.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&0===this.dist?!0:this.segmentIndex===t?!0:!1},jsts.geomgraph.EdgeIntersection.prototype.toString=function(){return""+this.segmentIndex+this.dist},function(){var t=jsts.geomgraph.EdgeIntersection,e=javascript.util.TreeMap;jsts.geomgraph.EdgeIntersectionList=function(t){this.nodeMap=new e,this.edge=t},jsts.geomgraph.EdgeIntersectionList.prototype.nodeMap=null,jsts.geomgraph.EdgeIntersectionList.prototype.edge=null,jsts.geomgraph.EdgeIntersectionList.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){var o=e.next();if(o.coord.equals(t))return!0}return!1},jsts.geomgraph.EdgeIntersectionList.prototype.add=function(e,o,n){var r=new t(e,o,n),i=this.nodeMap.get(r);return null!==i?i:(this.nodeMap.put(r,r),r)},jsts.geomgraph.EdgeIntersectionList.prototype.iterator=function(){return this.nodeMap.values().iterator()},jsts.geomgraph.EdgeIntersectionList.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},jsts.geomgraph.EdgeIntersectionList.prototype.addSplitEdges=function(t){this.addEndpoints();for(var e=this.iterator(),o=e.next();e.hasNext();){var n=e.next(),r=this.createSplitEdge(o,n);t.add(r),o=n}},jsts.geomgraph.EdgeIntersectionList.prototype.createSplitEdge=function(t,e){var o=e.segmentIndex-t.segmentIndex+2,n=this.edge.pts[e.segmentIndex],r=e.dist>0||!e.coord.equals2D(n);r||o--;var i=[],s=0;i[s++]=new jsts.geom.Coordinate(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)i[s++]=this.edge.pts[a];return r&&(i[s]=e.coord),new jsts.geomgraph.Edge(i,new jsts.geomgraph.Label(this.edge.label))}}(),function(){var t=function(t){this.message=t};t.prototype=new Error,t.prototype.name="AssertionFailedException",jsts.util.AssertionFailedException=t}(),function(){var t=jsts.util.AssertionFailedException;jsts.util.Assert=function(){},jsts.util.Assert.isTrue=function(e,o){if(!e)throw null===o?new t:new t(o)},jsts.util.Assert.equals=function(e,o,n){if(!o.equals(e))throw new t("Expected "+e+" but encountered "+o+(null!=n?": "+n:""))},jsts.util.Assert.shouldNeverReachHere=function(e){throw new t("Should never reach here"+(null!=e?": "+e:""))}}(),function(){var t=jsts.geom.Location,e=jsts.util.Assert,o=javascript.util.ArrayList;jsts.operation.relate.RelateComputer=function(t){this.li=new jsts.algorithm.RobustLineIntersector,this.ptLocator=new jsts.algorithm.PointLocator,this.nodes=new jsts.geomgraph.NodeMap(new jsts.operation.relate.RelateNodeFactory),this.isolatedEdges=new o,this.arg=t},jsts.operation.relate.RelateComputer.prototype.li=null,jsts.operation.relate.RelateComputer.prototype.ptLocator=null,jsts.operation.relate.RelateComputer.prototype.arg=null,jsts.operation.relate.RelateComputer.prototype.nodes=null,jsts.operation.relate.RelateComputer.prototype.im=null,jsts.operation.relate.RelateComputer.prototype.isolatedEdges=null,jsts.operation.relate.RelateComputer.prototype.invalidPoint=null,jsts.operation.relate.RelateComputer.prototype.computeIM=function(){var e=new jsts.geom.IntersectionMatrix;if(e.set(t.EXTERIOR,t.EXTERIOR,2),!this.arg[0].getGeometry().getEnvelopeInternal().intersects(this.arg[1].getGeometry().getEnvelopeInternal()))return this.computeDisjointIM(e),e;this.arg[0].computeSelfNodes(this.li,!1),this.arg[1].computeSelfNodes(this.li,!1);var o=this.arg[0].computeEdgeIntersections(this.arg[1],this.li,!1);this.computeIntersectionNodes(0),this.computeIntersectionNodes(1),this.copyNodesAndLabels(0),this.copyNodesAndLabels(1),this.labelIsolatedNodes(),this.computeProperIntersectionIM(o,e);var n=new jsts.operation.relate.EdgeEndBuilder,r=n.computeEdgeEnds(this.arg[0].getEdgeIterator());this.insertEdgeEnds(r);var i=n.computeEdgeEnds(this.arg[1].getEdgeIterator());return this.insertEdgeEnds(i),this.labelNodeEdges(),this.labelIsolatedEdges(0,1),this.labelIsolatedEdges(1,0),this.updateIM(e),e},jsts.operation.relate.RelateComputer.prototype.insertEdgeEnds=function(t){for(var e=t.iterator();e.hasNext();){var o=e.next();this.nodes.add(o)}},jsts.operation.relate.RelateComputer.prototype.computeProperIntersectionIM=function(t,e){var o=this.arg[0].getGeometry().getDimension(),n=this.arg[1].getGeometry().getDimension(),r=t.hasProperIntersection(),i=t.hasProperInteriorIntersection();2===o&&2===n?r&&e.setAtLeast("212101212"):2===o&&1===n?(r&&e.setAtLeast("FFF0FFFF2"),i&&e.setAtLeast("1FFFFF1FF")):1===o&&2===n?(r&&e.setAtLeast("F0FFFFFF2"),i&&e.setAtLeast("1F1FFFFFF")):1===o&&1===n&&i&&e.setAtLeast("0FFFFFFFF")},jsts.operation.relate.RelateComputer.prototype.copyNodesAndLabels=function(t){for(var e=this.arg[t].getNodeIterator();e.hasNext();){var o=e.next(),n=this.nodes.addNode(o.getCoordinate());n.setLabel(t,o.getLabel().getLocation(t))}},jsts.operation.relate.RelateComputer.prototype.computeIntersectionNodes=function(e){for(var o=this.arg[e].getEdgeIterator();o.hasNext();)for(var n=o.next(),r=n.getLabel().getLocation(e),i=n.getEdgeIntersectionList().iterator();i.hasNext();){var s=i.next(),a=this.nodes.addNode(s.coord);r===t.BOUNDARY?a.setLabelBoundary(e):a.getLabel().isNull(e)&&a.setLabel(e,t.INTERIOR)}},jsts.operation.relate.RelateComputer.prototype.labelIntersectionNodes=function(e){for(var o=this.arg[e].getEdgeIterator();o.hasNext();)for(var n=o.next(),r=n.getLabel().getLocation(e),i=n.getEdgeIntersectionList().iterator();i.hasNext();){var s=i.next(),a=this.nodes.find(s.coord);a.getLabel().isNull(e)&&(r===t.BOUNDARY?a.setLabelBoundary(e):a.setLabel(e,t.INTERIOR))}},jsts.operation.relate.RelateComputer.prototype.computeDisjointIM=function(e){var o=this.arg[0].getGeometry();o.isEmpty()||(e.set(t.INTERIOR,t.EXTERIOR,o.getDimension()),e.set(t.BOUNDARY,t.EXTERIOR,o.getBoundaryDimension()));var n=this.arg[1].getGeometry();n.isEmpty()||(e.set(t.EXTERIOR,t.INTERIOR,n.getDimension()),e.set(t.EXTERIOR,t.BOUNDARY,n.getBoundaryDimension()))},jsts.operation.relate.RelateComputer.prototype.labelNodeEdges=function(){for(var t=this.nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().computeLabelling(this.arg)}},jsts.operation.relate.RelateComputer.prototype.updateIM=function(t){for(var e=this.isolatedEdges.iterator();e.hasNext();){var o=e.next();o.updateIM(t)}for(var n=this.nodes.iterator();n.hasNext();){var r=n.next();r.updateIM(t),r.updateIMFromEdges(t)}},jsts.operation.relate.RelateComputer.prototype.labelIsolatedEdges=function(t,e){for(var o=this.arg[t].getEdgeIterator();o.hasNext();){var n=o.next();n.isIsolated()&&(this.labelIsolatedEdge(n,e,this.arg[e].getGeometry()),this.isolatedEdges.add(n))}},jsts.operation.relate.RelateComputer.prototype.labelIsolatedEdge=function(e,o,n){if(n.getDimension()>0){var r=this.ptLocator.locate(e.getCoordinate(),n);e.getLabel().setAllLocations(o,r)}else e.getLabel().setAllLocations(o,t.EXTERIOR)},jsts.operation.relate.RelateComputer.prototype.labelIsolatedNodes=function(){for(var t=this.nodes.iterator();t.hasNext();){var o=t.next(),n=o.getLabel();e.isTrue(n.getGeometryCount()>0,"node with empty label found"),o.isIsolated()&&(n.isNull(0)?this.labelIsolatedNode(o,0):this.labelIsolatedNode(o,1))}},jsts.operation.relate.RelateComputer.prototype.labelIsolatedNode=function(t,e){var o=this.ptLocator.locate(t.getCoordinate(),this.arg[e].getGeometry());t.getLabel().setAllLocations(e,o)}}(),function(){var t=jsts.util.Assert;jsts.geomgraph.GraphComponent=function(t){this.label=t},jsts.geomgraph.GraphComponent.prototype.label=null,jsts.geomgraph.GraphComponent.prototype._isInResult=!1,jsts.geomgraph.GraphComponent.prototype._isCovered=!1,jsts.geomgraph.GraphComponent.prototype._isCoveredSet=!1,jsts.geomgraph.GraphComponent.prototype._isVisited=!1,jsts.geomgraph.GraphComponent.prototype.getLabel=function(){return this.label},jsts.geomgraph.GraphComponent.prototype.setLabel=function(t){return 2===arguments.length?void this.setLabel2.apply(this,arguments):void(this.label=t)},jsts.geomgraph.GraphComponent.prototype.setInResult=function(t){this._isInResult=t},jsts.geomgraph.GraphComponent.prototype.isInResult=function(){return this._isInResult},jsts.geomgraph.GraphComponent.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},jsts.geomgraph.GraphComponent.prototype.isCovered=function(){return this._isCovered},jsts.geomgraph.GraphComponent.prototype.isCoveredSet=function(){return this._isCoveredSet},jsts.geomgraph.GraphComponent.prototype.isVisited=function(){return this._isVisited},jsts.geomgraph.GraphComponent.prototype.setVisited=function(t){this._isVisited=t},jsts.geomgraph.GraphComponent.prototype.getCoordinate=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geomgraph.GraphComponent.prototype.computeIM=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geomgraph.GraphComponent.prototype.isIsolated=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geomgraph.GraphComponent.prototype.updateIM=function(e){t.isTrue(this.label.getGeometryCount()>=2,"found partial label"),this.computeIM(e)}}(),jsts.geomgraph.Node=function(t,e){this.coord=t,this.edges=e,this.label=new jsts.geomgraph.Label(0,jsts.geom.Location.NONE)},jsts.geomgraph.Node.prototype=new jsts.geomgraph.GraphComponent,jsts.geomgraph.Node.prototype.coord=null,jsts.geomgraph.Node.prototype.edges=null,jsts.geomgraph.Node.prototype.isIsolated=function(){return 1==this.label.getGeometryCount()},jsts.geomgraph.Node.prototype.setLabel2=function(t,e){null===this.label?this.label=new jsts.geomgraph.Label(t,e):this.label.setLocation(t,e)},jsts.geomgraph.Node.prototype.setLabelBoundary=function(t){var e=jsts.geom.Location.NONE;null!==this.label&&(e=this.label.getLocation(t));var o;switch(e){case jsts.geom.Location.BOUNDARY:o=jsts.geom.Location.INTERIOR;break;case jsts.geom.Location.INTERIOR:o=jsts.geom.Location.BOUNDARY;break;default:o=jsts.geom.Location.BOUNDARY}this.label.setLocation(t,o)},jsts.geomgraph.Node.prototype.add=function(t){this.edges.insert(t),t.setNode(this)},jsts.geomgraph.Node.prototype.getCoordinate=function(){return this.coord},jsts.geomgraph.Node.prototype.getEdges=function(){return this.edges},jsts.geomgraph.Node.prototype.isIncidentEdgeInResult=function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();){var e=t.next();if(e.getEdge().isInResult())return!0}return!1},jsts.geom.Point=function(t,e){this.factory=e,void 0!==t&&(this.coordinate=t)},jsts.geom.Point.prototype=new jsts.geom.Geometry,jsts.geom.Point.constructor=jsts.geom.Point,jsts.geom.Point.CLASS_NAME="jsts.geom.Point",jsts.geom.Point.prototype.coordinate=null,jsts.geom.Point.prototype.getX=function(){return this.coordinate.x},jsts.geom.Point.prototype.getY=function(){return this.coordinate.y},jsts.geom.Point.prototype.getCoordinate=function(){return this.coordinate},jsts.geom.Point.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.coordinate]},jsts.geom.Point.prototype.getCoordinateSequence=function(){return this.isEmpty()?[]:[this.coordinate]},jsts.geom.Point.prototype.isEmpty=function(){return null===this.coordinate},jsts.geom.Point.prototype.equalsExact=function(t,e){return this.isEquivalentClass(t)?this.isEmpty()&&t.isEmpty()?!0:this.equal(t.getCoordinate(),this.getCoordinate(),e):!1},jsts.geom.Point.prototype.getNumPoints=function(){return this.isEmpty()?0:1},jsts.geom.Point.prototype.isSimple=function(){return!0},jsts.geom.Point.prototype.getBoundary=function(){return new jsts.geom.GeometryCollection(null)},jsts.geom.Point.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new jsts.geom.Envelope:new jsts.geom.Envelope(this.coordinate)},jsts.geom.Point.prototype.apply=function(t){if(t instanceof jsts.geom.GeometryFilter||t instanceof jsts.geom.GeometryComponentFilter)t.filter(this);else if(t instanceof jsts.geom.CoordinateFilter){if(this.isEmpty())return;t.filter(this.getCoordinate())}},jsts.geom.Point.prototype.clone=function(){return new jsts.geom.Point(this.coordinate.clone(),this.factory)},jsts.geom.Point.prototype.getDimension=function(){return 0},jsts.geom.Point.prototype.getBoundaryDimension=function(){return jsts.geom.Dimension.FALSE},jsts.geom.Point.prototype.reverse=function(){return this.clone()},jsts.geom.Point.prototype.isValid=function(){return jsts.operation.valid.IsValidOp.isValid(this.getCoordinate())?!0:!1},jsts.geom.Point.prototype.normalize=function(){},jsts.geom.Point.prototype.compareToSameClass=function(t){var e=t;return this.getCoordinate().compareTo(e.getCoordinate())},jsts.geom.Point.prototype.getGeometryType=function(){return"Point"},jsts.geom.Point.prototype.hashCode=function(){return"Point_"+this.coordinate.hashCode()},jsts.geom.Point.prototype.CLASS_NAME="jsts.geom.Point",jsts.geom.Dimension=function(){},jsts.geom.Dimension.P=0,jsts.geom.Dimension.L=1,jsts.geom.Dimension.A=2,jsts.geom.Dimension.FALSE=-1,jsts.geom.Dimension.TRUE=-2,jsts.geom.Dimension.DONTCARE=-3,jsts.geom.Dimension.toDimensionSymbol=function(t){switch(t){case jsts.geom.Dimension.FALSE:return"F";case jsts.geom.Dimension.TRUE:return"T";case jsts.geom.Dimension.DONTCARE:return"*";case jsts.geom.Dimension.P:return"0";case jsts.geom.Dimension.L:return"1";case jsts.geom.Dimension.A:return"2"}throw new jsts.IllegalArgumentError("Unknown dimension value: "+t)},jsts.geom.Dimension.toDimensionValue=function(t){switch(t.toUpperCase()){case"F":return jsts.geom.Dimension.FALSE;case"T":return jsts.geom.Dimension.TRUE;case"*":return jsts.geom.Dimension.DONTCARE;case"0":return jsts.geom.Dimension.P;case"1":return jsts.geom.Dimension.L;case"2":return jsts.geom.Dimension.A
}throw new jsts.error.IllegalArgumentError("Unknown dimension symbol: "+t)},function(){var t=jsts.geom.Dimension;jsts.geom.LineString=function(t,e){this.factory=e,this.points=t||[]},jsts.geom.LineString.prototype=new jsts.geom.Geometry,jsts.geom.LineString.constructor=jsts.geom.LineString,jsts.geom.LineString.prototype.points=null,jsts.geom.LineString.prototype.getCoordinates=function(){return this.points},jsts.geom.LineString.prototype.getCoordinateSequence=function(){return this.points},jsts.geom.LineString.prototype.getCoordinateN=function(t){return this.points[t]},jsts.geom.LineString.prototype.getCoordinate=function(){return this.isEmpty()?null:this.getCoordinateN(0)},jsts.geom.LineString.prototype.getDimension=function(){return 1},jsts.geom.LineString.prototype.getBoundaryDimension=function(){return this.isClosed()?t.FALSE:0},jsts.geom.LineString.prototype.isEmpty=function(){return 0===this.points.length},jsts.geom.LineString.prototype.getNumPoints=function(){return this.points.length},jsts.geom.LineString.prototype.getPointN=function(t){return this.getFactory().createPoint(this.points[t])},jsts.geom.LineString.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},jsts.geom.LineString.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},jsts.geom.LineString.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.points.length-1))},jsts.geom.LineString.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},jsts.geom.LineString.prototype.getGeometryType=function(){return"LineString"},jsts.geom.LineString.prototype.getLength=function(){return jsts.algorithm.CGAlgorithms.computeLength(this.points)},jsts.geom.LineString.prototype.getBoundary=function(){return new jsts.operation.BoundaryOp(this).getBoundary()},jsts.geom.LineString.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new jsts.geom.Envelope;var t=new jsts.geom.Envelope;return this.points.forEach(function(e){t.expandToInclude(e)}),t},jsts.geom.LineString.prototype.equalsExact=function(t,e){return this.isEquivalentClass(t)?this.points.length!==t.points.length?!1:this.isEmpty()&&t.isEmpty()?!0:this.points.reduce(function(o,n,r){return o&&jsts.geom.Geometry.prototype.equal(n,t.points[r],e)}):!1},jsts.geom.LineString.prototype.isEquivalentClass=function(t){return t instanceof jsts.geom.LineString},jsts.geom.LineString.prototype.compareToSameClass=function(t){for(var e=t,o=0,n=this.points.length,r=0,i=e.points.length;n>o&&i>r;){var s=this.points[o].compareTo(e.points[r]);if(0!==s)return s;o++,r++}return n>o?1:i>r?-1:0},jsts.geom.LineString.prototype.apply=function(t){if(t instanceof jsts.geom.GeometryFilter||t instanceof jsts.geom.GeometryComponentFilter)t.filter(this);else if(t instanceof jsts.geom.CoordinateFilter)for(var e=0,o=this.points.length;o>e;e++)t.filter(this.points[e]);else t instanceof jsts.geom.CoordinateSequenceFilter&&this.apply2.apply(this,arguments)},jsts.geom.LineString.prototype.apply2=function(t){if(0!==this.points.length){for(var e=0;e<this.points.length&&(t.filter(this.points,e),!t.isDone());e++);t.isGeometryChanged()}},jsts.geom.LineString.prototype.clone=function(){for(var t=[],e=0,o=this.points.length;o>e;e++)t.push(this.points[e].clone());return this.factory.createLineString(t)},jsts.geom.LineString.prototype.normalize=function(){var t,e,o,n,r,i;for(i=this.points.length,e=parseInt(i/2),t=0;e>t;t++)if(o=i-1-t,n=this.points[t],r=this.points[o],!n.equals(r))return void(n.compareTo(r)>0&&this.points.reverse())},jsts.geom.LineString.prototype.CLASS_NAME="jsts.geom.LineString"}(),function(){jsts.geom.Polygon=function(t,e,o){this.shell=t||o.createLinearRing(null),this.holes=e||[],this.factory=o},jsts.geom.Polygon.prototype=new jsts.geom.Geometry,jsts.geom.Polygon.constructor=jsts.geom.Polygon,jsts.geom.Polygon.prototype.getCoordinate=function(){return this.shell.getCoordinate()},jsts.geom.Polygon.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var t=[],e=-1,o=this.shell.getCoordinates(),n=0;n<o.length;n++)e++,t[e]=o[n];for(var r=0;r<this.holes.length;r++)for(var i=this.holes[r].getCoordinates(),s=0;s<i.length;s++)e++,t[e]=i[s];return t},jsts.geom.Polygon.prototype.getNumPoints=function(){for(var t=this.shell.getNumPoints(),e=0;e<this.holes.length;e++)t+=this.holes[e].getNumPoints();return t},jsts.geom.Polygon.prototype.isEmpty=function(){return this.shell.isEmpty()},jsts.geom.Polygon.prototype.isRectangle=function(){if(0!=this.getNumInteriorRing())return!1;if(null==this.shell)return!1;if(5!=this.shell.getNumPoints())return!1;for(var t=this.shell.getCoordinateSequence(),e=this.getEnvelopeInternal(),o=0;5>o;o++){var n=t[o].x;if(n!=e.getMinX()&&n!=e.getMaxX())return!1;var r=t[o].y;if(r!=e.getMinY()&&r!=e.getMaxY())return!1}for(var i=t[0].x,s=t[0].y,o=1;4>=o;o++){var n=t[o].x,r=t[o].y,a=n!=i,u=r!=s;if(a==u)return!1;i=n,s=r}return!0},jsts.geom.Polygon.prototype.getExteriorRing=function(){return this.shell},jsts.geom.Polygon.prototype.getInteriorRingN=function(t){return this.holes[t]},jsts.geom.Polygon.prototype.getNumInteriorRing=function(){return this.holes.length},jsts.geom.Polygon.prototype.getArea=function(){var t=0;t+=Math.abs(jsts.algorithm.CGAlgorithms.signedArea(this.shell.getCoordinateSequence()));for(var e=0;e<this.holes.length;e++)t-=Math.abs(jsts.algorithm.CGAlgorithms.signedArea(this.holes[e].getCoordinateSequence()));return t},jsts.geom.Polygon.prototype.getLength=function(){var t=0;t+=this.shell.getLength();for(var e=0;e<this.holes.length;e++)t+=this.holes[e].getLength();return t},jsts.geom.Polygon.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString(null);var t=[];t[0]=this.shell.clone();for(var e=0,o=this.holes.length;o>e;e++)t[e+1]=this.holes[e].clone();return t.length<=1?t[0]:this.getFactory().createMultiLineString(t)},jsts.geom.Polygon.prototype.computeEnvelopeInternal=function(){return this.shell.getEnvelopeInternal()},jsts.geom.Polygon.prototype.getDimension=function(){return 2},jsts.geom.Polygon.prototype.getBoundaryDimension=function(){return 1},jsts.geom.Polygon.prototype.equalsExact=function(t,e){if(!this.isEquivalentClass(t))return!1;if(this.isEmpty()&&t.isEmpty())return!0;if(this.isEmpty()!==t.isEmpty())return!1;if(!this.shell.equalsExact(t.shell,e))return!1;if(this.holes.length!==t.holes.length)return!1;if(this.holes.length!==t.holes.length)return!1;for(var o=0;o<this.holes.length;o++)if(!this.holes[o].equalsExact(t.holes[o],e))return!1;return!0},jsts.geom.Polygon.prototype.compareToSameClass=function(t){return this.shell.compareToSameClass(t.shell)},jsts.geom.Polygon.prototype.apply=function(t){if(t instanceof jsts.geom.GeometryComponentFilter){t.filter(this),this.shell.apply(t);for(var e=0,o=this.holes.length;o>e;e++)this.holes[e].apply(t)}else if(t instanceof jsts.geom.GeometryFilter)t.filter(this);else if(t instanceof jsts.geom.CoordinateFilter){this.shell.apply(t);for(var e=0,o=this.holes.length;o>e;e++)this.holes[e].apply(t)}else t instanceof jsts.geom.CoordinateSequenceFilter&&this.apply2.apply(this,arguments)},jsts.geom.Polygon.prototype.apply2=function(t){if(this.shell.apply(t),!t.isDone())for(var e=0;e<this.holes.length&&(this.holes[e].apply(t),!t.isDone());e++);t.isGeometryChanged()},jsts.geom.Polygon.prototype.clone=function(){for(var t=[],e=0,o=this.holes.length;o>e;e++)t.push(this.holes[e].clone());return this.factory.createPolygon(this.shell.clone(),t)},jsts.geom.Polygon.prototype.normalize=function(){this.normalize2(this.shell,!0);for(var t=0,e=this.holes.length;e>t;t++)this.normalize2(this.holes[t],!1);this.holes.sort()},jsts.geom.Polygon.prototype.normalize2=function(t,e){if(!t.isEmpty()){var o=t.points.slice(0,t.points.length-1),n=jsts.geom.CoordinateArrays.minCoordinate(t.points);jsts.geom.CoordinateArrays.scroll(o,n),t.points=o.concat(),t.points[o.length]=o[0],jsts.algorithm.CGAlgorithms.isCCW(t.points)===e&&t.points.reverse()}},jsts.geom.Polygon.prototype.getGeometryType=function(){return"Polygon"},jsts.geom.Polygon.prototype.CLASS_NAME="jsts.geom.Polygon"}(),function(){var t=jsts.geom.Geometry,e=javascript.util.TreeSet,o=javascript.util.Arrays;jsts.geom.GeometryCollection=function(t,e){this.geometries=t||[],this.factory=e},jsts.geom.GeometryCollection.prototype=new t,jsts.geom.GeometryCollection.constructor=jsts.geom.GeometryCollection,jsts.geom.GeometryCollection.prototype.isEmpty=function(){for(var t=0,e=this.geometries.length;e>t;t++){var o=this.getGeometryN(t);if(!o.isEmpty())return!1}return!0},jsts.geom.GeometryCollection.prototype.getArea=function(){for(var t=0,e=0,o=this.geometries.length;o>e;e++)t+=this.getGeometryN(e).getArea();return t},jsts.geom.GeometryCollection.prototype.getLength=function(){for(var t=0,e=0,o=this.geometries.length;o>e;e++)t+=this.getGeometryN(e).getLength();return t},jsts.geom.GeometryCollection.prototype.getCoordinate=function(){return this.isEmpty()?null:this.getGeometryN(0).getCoordinate()},jsts.geom.GeometryCollection.prototype.getCoordinates=function(){for(var t=[],e=-1,o=0,n=this.geometries.length;n>o;o++)for(var r=this.getGeometryN(o),i=r.getCoordinates(),s=0;s<i.length;s++)e++,t[e]=i[s];return t},jsts.geom.GeometryCollection.prototype.getNumGeometries=function(){return this.geometries.length},jsts.geom.GeometryCollection.prototype.getGeometryN=function(t){var e=this.geometries[t];return e instanceof jsts.geom.Coordinate&&(e=new jsts.geom.Point(e)),e},jsts.geom.GeometryCollection.prototype.getNumPoints=function(){for(var t=0,e=0;e<this.geometries.length;e++)t+=this.geometries[e].getNumPoints();return t},jsts.geom.GeometryCollection.prototype.equalsExact=function(t,e){if(!this.isEquivalentClass(t))return!1;if(this.geometries.length!==t.geometries.length)return!1;for(var o=0,n=this.geometries.length;n>o;o++){var r=this.getGeometryN(o);if(!r.equalsExact(t.getGeometryN(o),e))return!1}return!0},jsts.geom.GeometryCollection.prototype.clone=function(){for(var t=[],e=0,o=this.geometries.length;o>e;e++)t.push(this.geometries[e].clone());return this.factory.createGeometryCollection(t)},jsts.geom.GeometryCollection.prototype.normalize=function(){for(var t=0,e=this.geometries.length;e>t;t++)this.getGeometryN(t).normalize();this.geometries.sort()},jsts.geom.GeometryCollection.prototype.compareToSameClass=function(t){var n=new e(o.asList(this.geometries)),r=new e(o.asList(t.geometries));return this.compare(n,r)},jsts.geom.GeometryCollection.prototype.apply=function(t){if(t instanceof jsts.geom.GeometryFilter||t instanceof jsts.geom.GeometryComponentFilter){t.filter(this);for(var e=0,o=this.geometries.length;o>e;e++)this.getGeometryN(e).apply(t)}else if(t instanceof jsts.geom.CoordinateFilter)for(var e=0,o=this.geometries.length;o>e;e++)this.getGeometryN(e).apply(t);else t instanceof jsts.geom.CoordinateSequenceFilter&&this.apply2.apply(this,arguments)},jsts.geom.GeometryCollection.prototype.apply2=function(t){if(0!=this.geometries.length){for(var e=0;e<this.geometries.length&&(this.geometries[e].apply(t),!t.isDone());e++);t.isGeometryChanged()}},jsts.geom.GeometryCollection.prototype.getDimension=function(){for(var t=jsts.geom.Dimension.FALSE,e=0,o=this.geometries.length;o>e;e++){var n=this.getGeometryN(e);t=Math.max(t,n.getDimension())}return t},jsts.geom.GeometryCollection.prototype.computeEnvelopeInternal=function(){for(var t=new jsts.geom.Envelope,e=0,o=this.geometries.length;o>e;e++){var n=this.getGeometryN(e);t.expandToInclude(n.getEnvelopeInternal())}return t},jsts.geom.GeometryCollection.prototype.CLASS_NAME="jsts.geom.GeometryCollection"}(),jsts.algorithm.Centroid=function(t){this.areaBasePt=null,this.triangleCent3=new jsts.geom.Coordinate,this.areasum2=0,this.cg3=new jsts.geom.Coordinate,this.lineCentSum=new jsts.geom.Coordinate,this.totalLength=0,this.ptCount=0,this.ptCentSum=new jsts.geom.Coordinate,this.add(t)},jsts.algorithm.Centroid.getCentroid=function(t){var e=new jsts.algorithm.Centroid(t);return e.getCentroid()},jsts.algorithm.Centroid.centroid3=function(t,e,o,n){n.x=t.x+e.x+o.x,n.y=t.y+e.y+o.y},jsts.algorithm.Centroid.area2=function(t,e,o){return(e.x-t.x)*(o.y-t.y)-(o.x-t.x)*(e.y-t.y)},jsts.algorithm.Centroid.prototype.add=function(t){if(!t.isEmpty())if(t instanceof jsts.geom.Point)this.addPoint(t.getCoordinate());else if(t instanceof jsts.geom.LineString)this.addLineSegments(t.getCoordinates());else if(t instanceof jsts.geom.Polygon)this.addPolygon(t);else if(t instanceof jsts.geom.GeometryCollection)for(var e=0;e<t.getNumGeometries();e++)this.add(t.getGeometryN(e))},jsts.algorithm.Centroid.prototype.getCentroid=function(){var t=new jsts.geom.Coordinate;if(Math.abs(this.areasum2)>0)t.x=this.cg3.x/3/this.areasum2,t.y=this.cg3.y/3/this.areasum2;else if(this.totalLength>0)t.x=this.lineCentSum.x/this.totalLength,t.y=this.lineCentSum.y/this.totalLength;else{if(!(this.ptCount>0))return null;t.x=this.ptCentSum.x/this.ptCount,t.y=this.ptCentSum.y/this.ptCount}return t},jsts.algorithm.Centroid.prototype.setBasePoint=function(t){null===this.areaBasePt&&(this.areaBasePt=t)},jsts.algorithm.Centroid.prototype.addPolygon=function(t){this.addShell(t.getExteriorRing().getCoordinates());for(var e=0;e<t.getNumInteriorRing();e++)this.addHole(t.getInteriorRingN(e).getCoordinates())},jsts.algorithm.Centroid.prototype.addShell=function(t){t.length>0&&this.setBasePoint(t[0]);for(var e=!jsts.algorithm.CGAlgorithms.isCCW(t),o=0;o<t.length-1;o++)this.addTriangle(this.areaBasePt,t[o],t[o+1],e);this.addLineSegments(t)},jsts.algorithm.Centroid.prototype.addHole=function(t){for(var e=jsts.algorithm.CGAlgorithms.isCCW(t),o=0;o<t.length-1;o++)this.addTriangle(this.areaBasePt,t[o],t[o+1],e);this.addLineSegments(t)},jsts.algorithm.Centroid.prototype.addTriangle=function(t,e,o,n){var r=n?1:-1;jsts.algorithm.Centroid.centroid3(t,e,o,this.triangleCent3);var i=jsts.algorithm.Centroid.area2(t,e,o);this.cg3.x+=r*i*this.triangleCent3.x,this.cg3.y+=r*i*this.triangleCent3.y,this.areasum2+=r*i},jsts.algorithm.Centroid.prototype.addLineSegments=function(t){for(var e=0,o=0;o<t.length-1;o++){var n=t[o].distance(t[o+1]);if(0!==n){e+=n;var r=(t[o].x+t[o+1].x)/2;this.lineCentSum.x+=n*r;var i=(t[o].y+t[o+1].y)/2;this.lineCentSum.y+=n*i}}this.totalLength+=e,0===e&&t.length>0&&this.addPoint(t[0])},jsts.algorithm.Centroid.prototype.addPoint=function(t){this.ptCount+=1,this.ptCentSum.x+=t.x,this.ptCentSum.y+=t.y},function(){var t=function(t){this.deList=new javascript.util.ArrayList,this.factory=t};t.findEdgeRingContaining=function(t,e){for(var o=t.getRing(),n=o.getEnvelopeInternal(),r=o.getCoordinateN(0),i=null,s=null,a=e.iterator();a.hasNext();){var u=a.next(),p=u.getRing(),g=p.getEnvelopeInternal();null!=i&&(s=i.getRing().getEnvelopeInternal());var l=!1;g.equals(n)||(r=jsts.geom.CoordinateArrays.ptNotInList(o.getCoordinates(),p.getCoordinates()),g.contains(n)&&jsts.algorithm.CGAlgorithms.isPointInRing(r,p.getCoordinates())&&(l=!0),l&&(null==i||s.contains(g))&&(i=u))}return i},t.ptNotInList=function(t,e){for(var o=0;o<t.length;o++){var n=t[o];if(!isInList(n,e))return n}return null},t.isInList=function(t,e){for(var o=0;o<e.length;o++)if(t.equals(e[o]))return!0;return!1},t.prototype.factory=null,t.prototype.deList=null,t.prototype.ring=null,t.prototype.ringPts=null,t.prototype.holes=null,t.prototype.add=function(t){this.deList.add(t)},t.prototype.isHole=function(){var t=this.getRing();return jsts.algorithm.CGAlgorithms.isCCW(t.getCoordinates())},t.prototype.addHole=function(t){null==this.holes&&(this.holes=new javascript.util.ArrayList),this.holes.add(t)},t.prototype.getPolygon=function(){var t=null;if(null!=this.holes){t=[];for(var e=0;e<this.holes.size();e++)t[e]=this.holes.get(e)}var o=this.factory.createPolygon(this.ring,t);return o},t.prototype.isValid=function(){return this.getCoordinates(),this.ringPts.length<=3?!1:(this.getRing(),this.ring.isValid())},t.prototype.getCoordinates=function(){if(null==this.ringPts){for(var e=new jsts.geom.CoordinateList,o=this.deList.iterator();o.hasNext();){var n=o.next(),r=n.getEdge();t.addEdge(r.getLine().getCoordinates(),n.getEdgeDirection(),e)}this.ringPts=e.toCoordinateArray()}return this.ringPts},t.prototype.getLineString=function(){return this.getCoordinates(),this.factory.createLineString(this.ringPts)},t.prototype.getRing=function(){if(null!=this.ring)return this.ring;this.getCoordinates(),this.ringPts.length<3&&console.log(this.ringPts);try{this.ring=this.factory.createLinearRing(this.ringPts)}catch(t){console.log(this.ringPts)}return this.ring},t.addEdge=function(t,e,o){if(e)for(var n=0;n<t.length;n++)o.add(t[n],!1);else for(var n=t.length-1;n>=0;n--)o.add(t[n],!1)},jsts.operation.polygonize.EdgeRing=t}(),function(){var t=function(){};t.setVisited=function(t,e){for(;t.hasNext();){var o=t.next();o.setVisited(e)}},t.setMarked=function(t,e){for(;t.hasNext();){var o=t.next();o.setMarked(e)}},t.getComponentWithVisitedState=function(t,e){for(;t.hasNext();){var o=t.next();if(o.isVisited()==e)return o}return null},t.prototype._isMarked=!1,t.prototype._isVisited=!1,t.prototype.data,t.prototype.isVisited=function(){return this._isVisited},t.prototype.setVisited=function(t){this._isVisited=t},t.prototype.isMarked=function(){return this._isMarked},t.prototype.setMarked=function(t){this._isMarked=t},t.prototype.setContext=function(t){this.data=t},t.prototype.getContext=function(){return data},t.prototype.setData=function(t){this.data=t},t.prototype.getData=function(){return data},t.prototype.isRemoved=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.planargraph.GraphComponent=t}(),function(){var t=jsts.planargraph.GraphComponent,e=function(t,e){void 0!==t&&this.setDirectedEdges(t,e)};e.prototype=new t,e.prototype.dirEdge=null,e.prototype.setDirectedEdges=function(t,e){this.dirEdge=[t,e],t.setEdge(this),e.setEdge(this),t.setSym(e),e.setSym(t),t.getFromNode().addOutEdge(t),e.getFromNode().addOutEdge(e)},e.prototype.getDirEdge=function(t){return t instanceof jsts.planargraph.Node&&this.getDirEdge2(t),this.dirEdge[t]},e.prototype.getDirEdge2=function(t){return this.dirEdge[0].getFromNode()==t?this.dirEdge[0]:this.dirEdge[1].getFromNode()==t?this.dirEdge[1]:null},e.prototype.getOppositeNode=function(t){return this.dirEdge[0].getFromNode()==t?this.dirEdge[0].getToNode():this.dirEdge[1].getFromNode()==t?this.dirEdge[1].getToNode():null},e.prototype.remove=function(){this.dirEdge=null},e.prototype.isRemoved=function(){return null==dirEdge},jsts.planargraph.Edge=e}(),jsts.operation.polygonize.PolygonizeEdge=function(t){this.line=t},jsts.operation.polygonize.PolygonizeEdge.prototype=new jsts.planargraph.Edge,jsts.operation.polygonize.PolygonizeEdge.prototype.line=null,jsts.operation.polygonize.PolygonizeEdge.prototype.getLine=function(){return this.line},function(){var t=javascript.util.ArrayList,e=jsts.planargraph.GraphComponent,o=function(t,e,o,n){if(void 0!==t){this.from=t,this.to=e,this.edgeDirection=n,this.p0=t.getCoordinate(),this.p1=o;var r=this.p1.x-this.p0.x,i=this.p1.y-this.p0.y;this.quadrant=jsts.geomgraph.Quadrant.quadrant(r,i),this.angle=Math.atan2(i,r)}};o.prototype=new e,o.toEdges=function(e){for(var o=new t,n=e.iterator();n.hasNext();)o.add(n.next().parentEdge);return o},o.prototype.parentEdge=null,o.prototype.from=null,o.prototype.to=null,o.prototype.p0=null,o.prototype.p1=null,o.prototype.sym=null,o.prototype.edgeDirection=null,o.prototype.quadrant=null,o.prototype.angle=null,o.prototype.getEdge=function(){return this.parentEdge},o.prototype.setEdge=function(t){this.parentEdge=t},o.prototype.getQuadrant=function(){return this.quadrant},o.prototype.getDirectionPt=function(){return this.p1},o.prototype.getEdgeDirection=function(){return this.edgeDirection},o.prototype.getFromNode=function(){return this.from},o.prototype.getToNode=function(){return this.to},o.prototype.getCoordinate=function(){return this.from.getCoordinate()},o.prototype.getAngle=function(){return this.angle},o.prototype.getSym=function(){return this.sym},o.prototype.setSym=function(t){this.sym=t},o.prototype.remove=function(){this.sym=null,this.parentEdge=null},o.prototype.isRemoved=function(){return null==this.parentEdge},o.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},o.prototype.compareDirection=function(t){return this.quadrant>t.quadrant?1:this.quadrant<t.quadrant?-1:jsts.algorithm.CGAlgorithms.computeOrientation(t.p0,t.p1,this.p1)},jsts.planargraph.DirectedEdge=o}(),function(){var t=jsts.planargraph.DirectedEdge,e=function(){t.apply(this,arguments)};e.prototype=new t,e.prototype.edgeRing=null,e.prototype.next=null,e.prototype.label=-1,e.prototype.getLabel=function(){return this.label},e.prototype.setLabel=function(t){this.label=t},e.prototype.getNext=function(){return this.next},e.prototype.setNext=function(t){this.next=t},e.prototype.isInRing=function(){return null!=this.edgeRing},e.prototype.setRing=function(t){this.edgeRing=t},jsts.operation.polygonize.PolygonizeDirectedEdge=e}(),function(){var t=javascript.util.ArrayList,e=function(){this.outEdges=new t};e.prototype.outEdges=null,e.prototype.sorted=!1,e.prototype.add=function(t){this.outEdges.add(t),this.sorted=!1},e.prototype.remove=function(t){this.outEdges.remove(t)},e.prototype.iterator=function(){return this.sortEdges(),this.outEdges.iterator()},e.prototype.getDegree=function(){return this.outEdges.size()},e.prototype.getCoordinate=function(){var t=iterator();if(!t.hasNext())return null;var e=t.next();return e.getCoordinate()},e.prototype.getEdges=function(){return this.sortEdges(),this.outEdges},e.prototype.sortEdges=function(){if(!this.sorted){var t=this.outEdges.toArray();t.sort(function(t,e){return t.compareTo(e)}),this.outEdges=javascript.util.Arrays.asList(t),this.sorted=!0}},e.prototype.getIndex=function(t){if(t instanceof jsts.planargraph.DirectedEdge)return this.getIndex2(t);if("number"==typeof t)return this.getIndex3(t);this.sortEdges();for(var e=0;e<this.outEdges.size();e++){var o=this.outEdges.get(e);if(o.getEdge()==t)return e}return-1},e.prototype.getIndex2=function(t){this.sortEdges();for(var e=0;e<this.outEdges.size();e++){var o=this.outEdges.get(e);if(o==t)return e}return-1},e.prototype.getIndex3=function(t){var e=toInt(t%this.outEdges.size());return 0>e&&(e+=this.outEdges.size()),e},e.prototype.getNextEdge=function(t){var e=this.getIndex(t);return this.outEdges.get(getIndex(e+1))},e.prototype.getNextCWEdge=function(t){var e=this.getIndex(t);return this.outEdges.get(getIndex(e-1))},jsts.planargraph.DirectedEdgeStar=e}(),function(){var t=jsts.planargraph.GraphComponent,e=jsts.planargraph.DirectedEdgeStar,o=function(t,o){this.pt=t,this.deStar=o||new e};o.prototype=new t,o.getEdgesBetween=function(t,e){var o=DirectedEdge.toEdges(t.getOutEdges().getEdges()),n=new javascript.util.HashSet(o),r=DirectedEdge.toEdges(e.getOutEdges().getEdges());return n.retainAll(r),n},o.prototype.pt=null,o.prototype.deStar=null,o.prototype.getCoordinate=function(){return this.pt},o.prototype.addOutEdge=function(t){this.deStar.add(t)},o.prototype.getOutEdges=function(){return this.deStar},o.prototype.getDegree=function(){return this.deStar.getDegree()},o.prototype.getIndex=function(t){return this.deStar.getIndex(t)},o.prototype.remove=function(t){return void 0===t?this.remove2():void this.deStar.remove(t)},o.prototype.remove2=function(){this.pt=null},o.prototype.isRemoved=function(){return null==this.pt},jsts.planargraph.Node=o}(),function(){var t=function(){this.nodeMap=new javascript.util.TreeMap};t.prototype.nodeMap=null,t.prototype.add=function(t){return this.nodeMap.put(t.getCoordinate(),t),t},t.prototype.remove=function(t){return this.nodeMap.remove(t)},t.prototype.find=function(t){return this.nodeMap.get(t)},t.prototype.iterator=function(){return this.nodeMap.values().iterator()},t.prototype.values=function(){return this.nodeMap.values()},jsts.planargraph.NodeMap=t}(),function(){var t=javascript.util.ArrayList,e=function(){this.edges=new javascript.util.HashSet,this.dirEdges=new javascript.util.HashSet,this.nodeMap=new jsts.planargraph.NodeMap};e.prototype.edges=null,e.prototype.dirEdges=null,e.prototype.nodeMap=null,e.prototype.findNode=function(t){return this.nodeMap.find(t)},e.prototype.add=function(t){return t instanceof jsts.planargraph.Edge?this.add2(t):t instanceof jsts.planargraph.DirectedEdge?this.add3(t):void this.nodeMap.add(t)},e.prototype.add2=function(t){this.edges.add(t),this.add(t.getDirEdge(0)),this.add(t.getDirEdge(1))},e.prototype.add3=function(t){this.dirEdges.add(t)},e.prototype.nodeIterator=function(){return this.nodeMap.iterator()},e.prototype.contains=function(t){return t instanceof jsts.planargraph.DirectedEdge?this.contains2(t):this.edges.contains(t)},e.prototype.contains2=function(t){return this.dirEdges.contains(t)},e.prototype.getNodes=function(){return this.nodeMap.values()},e.prototype.dirEdgeIterator=function(){return this.dirEdges.iterator()},e.prototype.edgeIterator=function(){return this.edges.iterator()},e.prototype.getEdges=function(){return this.edges},e.prototype.remove=function(t){return t instanceof jsts.planargraph.DirectedEdge?this.remove2(t):(this.remove(t.getDirEdge(0)),this.remove(t.getDirEdge(1)),this.edges.remove(t),void this.edge.remove())},e.prototype.remove2=function(t){if(t instanceof jsts.planargraph.Node)return this.remove3(t);var e=t.getSym();null!=e&&e.setSym(null),t.getFromNode().remove(t),t.remove(),this.dirEdges.remove(t)},e.prototype.remove3=function(t){for(var e=t.getOutEdges().getEdges(),o=e.iterator();o.hasNext();){var n=o.next(),r=n.getSym();null!=r&&this.remove(r),this.dirEdges.remove(n);var i=n.getEdge();null!=i&&this.edges.remove(i)}this.nodeMap.remove(t.getCoordinate()),t.remove()},e.prototype.findNodesOfDegree=function(e){for(var o=new t,n=this.nodeIterator();n.hasNext();){var r=n.next();r.getDegree()==e&&o.add(r)}return o},jsts.planargraph.PlanarGraph=e}(),function(){var t=javascript.util.ArrayList,e=javascript.util.Stack,o=javascript.util.HashSet,n=jsts.util.Assert,r=jsts.operation.polygonize.EdgeRing,i=jsts.operation.polygonize.PolygonizeEdge,s=jsts.operation.polygonize.PolygonizeDirectedEdge,a=jsts.planargraph.PlanarGraph,u=jsts.planargraph.Node,p=function(t){a.apply(this),this.factory=t};p.prototype=new a,p.getDegreeNonDeleted=function(t){for(var e=t.getOutEdges().getEdges(),o=0,n=e.iterator();n.hasNext();){var r=n.next();r.isMarked()||o++}return o},p.getDegree=function(t,e){for(var o=t.getOutEdges().getEdges(),n=0,r=o.iterator();r.hasNext();){var i=r.next();i.getLabel()==e&&n++}return n},p.deleteAllEdges=function(t){for(var e=t.getOutEdges().getEdges(),o=e.iterator();o.hasNext();){var n=o.next();n.setMarked(!0);var r=n.getSym();null!=r&&r.setMarked(!0)}},p.prototype.factory=null,p.prototype.addEdge=function(t){if(!t.isEmpty()){var e=jsts.geom.CoordinateArrays.removeRepeatedPoints(t.getCoordinates());if(!(e.length<2)){var o=e[0],n=e[e.length-1],r=this.getNode(o),a=this.getNode(n),u=new s(r,a,e[1],!0),p=new s(a,r,e[e.length-2],!1),g=new i(t);g.setDirectedEdges(u,p),this.add(g)}}},p.prototype.getNode=function(t){var e=this.findNode(t);return null==e&&(e=new u(t),this.add(e)),e},p.prototype.computeNextCWEdges=function(){for(var t=this.nodeIterator();t.hasNext();){var e=t.next();p.computeNextCWEdges(e)}},p.prototype.convertMaximalToMinimalEdgeRings=function(t){for(var e=t.iterator();e.hasNext();){var o=e.next(),n=o.getLabel(),r=p.findIntersectionNodes(o,n);if(null!=r)for(var i=r.iterator();i.hasNext();){var s=i.next();p.computeNextCCWEdges(s,n)}}},p.findIntersectionNodes=function(e,o){var r=e,i=null;do{var s=r.getFromNode();p.getDegree(s,o)>1&&(null==i&&(i=new t),i.add(s)),r=r.getNext(),n.isTrue(null!=r,"found null DE in ring"),n.isTrue(r==e||!r.isInRing(),"found DE already in ring")}while(r!=e);return i},p.prototype.getEdgeRings=function(){this.computeNextCWEdges(),p.label(this.dirEdges,-1);var e=p.findLabeledEdgeRings(this.dirEdges);this.convertMaximalToMinimalEdgeRings(e);for(var o=new t,n=this.dirEdges.iterator();n.hasNext();){var r=n.next();if(!r.isMarked()&&!r.isInRing()){var i=this.findEdgeRing(r);o.add(i)}}return o},p.findLabeledEdgeRings=function(e){for(var o=new t,n=1,r=e.iterator();r.hasNext();){var i=r.next();if(!(i.isMarked()||i.getLabel()>=0)){o.add(i);var s=p.findDirEdgesInRing(i);p.label(s,n),n++}}return o},p.prototype.deleteCutEdges=function(){this.computeNextCWEdges(),p.findLabeledEdgeRings(this.dirEdges);for(var e=new t,o=this.dirEdges.iterator();o.hasNext();){var n=o.next();if(!n.isMarked()){var r=n.getSym();if(n.getLabel()==r.getLabel()){n.setMarked(!0),r.setMarked(!0);var i=n.getEdge();e.add(i.getLine())}}}return e},p.label=function(t,e){for(var o=t.iterator();o.hasNext();){var n=o.next();n.setLabel(e)}},p.computeNextCWEdges=function(t){for(var e=t.getOutEdges(),o=null,n=null,r=e.getEdges().iterator();r.hasNext();){var i=r.next();if(!i.isMarked()){if(null==o&&(o=i),null!=n){var s=n.getSym();s.setNext(i)}n=i}}if(null!=n){var s=n.getSym();s.setNext(o)}},p.computeNextCCWEdges=function(t,e){for(var o=t.getOutEdges(),r=null,i=null,s=o.getEdges(),a=s.size()-1;a>=0;a--){var u=s.get(a),p=u.getSym(),g=null;u.getLabel()==e&&(g=u);var l=null;p.getLabel()==e&&(l=p),(null!=g||null!=l)&&(null!=l&&(i=l),null!=g&&(null!=i&&(i.setNext(g),i=null),null==r&&(r=g)))}null!=i&&(n.isTrue(null!=r),i.setNext(r))},p.findDirEdgesInRing=function(e){var o=e,r=new t;do r.add(o),o=o.getNext(),n.isTrue(null!=o,"found null DE in ring"),n.isTrue(o==e||!o.isInRing(),"found DE already in ring");while(o!=e);return r},p.prototype.findEdgeRing=function(t){var e=t,o=new r(this.factory);do o.add(e),e.setRing(o),e=e.getNext(),n.isTrue(null!=e,"found null DE in ring"),n.isTrue(e==t||!e.isInRing(),"found DE already in ring");while(e!=t);return o},p.prototype.deleteDangles=function(){for(var t=this.findNodesOfDegree(1),n=new o,r=new e,i=t.iterator();i.hasNext();)r.push(i.next());for(;!r.isEmpty();){var s=r.pop();p.deleteAllEdges(s);for(var a=s.getOutEdges().getEdges(),i=a.iterator();i.hasNext();){var u=i.next();u.setMarked(!0);var g=u.getSym();null!=g&&g.setMarked(!0);var l=u.getEdge();n.add(l.getLine());var h=u.getToNode();1==p.getDegreeNonDeleted(h)&&r.push(h)}}return n},p.prototype.computeDepthParity=function(){for(;;){var t=null;if(null==t)return;this.computeDepthParity(t)}},p.prototype.computeDepthParity=function(){},jsts.operation.polygonize.PolygonizeGraph=p}(),jsts.index.strtree.Interval=function(){var t;return 1===arguments.length?(t=arguments[0],jsts.index.strtree.Interval(t.min,t.max)):void(2===arguments.length&&(jsts.util.Assert.isTrue(this.min<=this.max),this.min=arguments[0],this.max=arguments[1]))},jsts.index.strtree.Interval.prototype.min=null,jsts.index.strtree.Interval.prototype.max=null,jsts.index.strtree.Interval.prototype.getCentre=function(){return(this.min+this.max)/2},jsts.index.strtree.Interval.prototype.expandToInclude=function(t){return this.max=Math.max(this.max,t.max),this.min=Math.min(this.min,t.min),this},jsts.index.strtree.Interval.prototype.intersects=function(t){return!(t.min>this.max||t.max<this.min)},jsts.index.strtree.Interval.prototype.equals=function(t){return t instanceof jsts.index.strtree.Interval?(other=t,this.min===other.min&&this.max===other.max):!1},jsts.geom.GeometryFactory=function(t){this.precisionModel=t||new jsts.geom.PrecisionModel},jsts.geom.GeometryFactory.prototype.precisionModel=null,jsts.geom.GeometryFactory.prototype.getPrecisionModel=function(){return this.precisionModel},jsts.geom.GeometryFactory.prototype.createPoint=function(t){var e=new jsts.geom.Point(t,this);return e},jsts.geom.GeometryFactory.prototype.createLineString=function(t){var e=new jsts.geom.LineString(t,this);return e},jsts.geom.GeometryFactory.prototype.createLinearRing=function(t){var e=new jsts.geom.LinearRing(t,this);return e},jsts.geom.GeometryFactory.prototype.createPolygon=function(t,e){var o=new jsts.geom.Polygon(t,e,this);return o},jsts.geom.GeometryFactory.prototype.createMultiPoint=function(t){if(t&&t[0]instanceof jsts.geom.Coordinate){var e,o=[];
for(e=0;e<t.length;e++)o.push(this.createPoint(t[e]));t=o}return new jsts.geom.MultiPoint(t,this)},jsts.geom.GeometryFactory.prototype.createMultiLineString=function(t){return new jsts.geom.MultiLineString(t,this)},jsts.geom.GeometryFactory.prototype.createMultiPolygon=function(t){return new jsts.geom.MultiPolygon(t,this)},jsts.geom.GeometryFactory.prototype.buildGeometry=function(t){for(var e=null,o=!1,n=!1,r=t.iterator();r.hasNext();){var i=r.next(),s=i.CLASS_NAME;null===e&&(e=s),s!==e&&(o=!0),i.isGeometryCollectionBase()&&(n=!0)}if(null===e)return this.createGeometryCollection(null);if(o||n)return this.createGeometryCollection(t.toArray());var a=t.get(0),u=t.size()>1;if(u){if(a instanceof jsts.geom.Polygon)return this.createMultiPolygon(t.toArray());if(a instanceof jsts.geom.LineString)return this.createMultiLineString(t.toArray());if(a instanceof jsts.geom.Point)return this.createMultiPoint(t.toArray());jsts.util.Assert.shouldNeverReachHere("Unhandled class: "+a)}return a},jsts.geom.GeometryFactory.prototype.createGeometryCollection=function(t){return new jsts.geom.GeometryCollection(t,this)},jsts.geom.GeometryFactory.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new jsts.geom.Coordinate(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new jsts.geom.Coordinate(t.getMinX(),t.getMinY()),new jsts.geom.Coordinate(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new jsts.geom.Coordinate(t.getMinX(),t.getMinY()),new jsts.geom.Coordinate(t.getMinX(),t.getMaxY()),new jsts.geom.Coordinate(t.getMaxX(),t.getMaxY()),new jsts.geom.Coordinate(t.getMaxX(),t.getMinY()),new jsts.geom.Coordinate(t.getMinX(),t.getMinY())]),null)},jsts.geomgraph.NodeFactory=function(){},jsts.geomgraph.NodeFactory.prototype.createNode=function(t){return new jsts.geomgraph.Node(t,null)},function(){jsts.geomgraph.Position=function(){},jsts.geomgraph.Position.ON=0,jsts.geomgraph.Position.LEFT=1,jsts.geomgraph.Position.RIGHT=2,jsts.geomgraph.Position.opposite=function(t){return t===jsts.geomgraph.Position.LEFT?jsts.geomgraph.Position.RIGHT:t===jsts.geomgraph.Position.RIGHT?jsts.geomgraph.Position.LEFT:t}}(),jsts.geomgraph.TopologyLocation=function(){if(this.location=[],3===arguments.length){var t=arguments[0],e=arguments[1],o=arguments[2];this.init(3),this.location[jsts.geomgraph.Position.ON]=t,this.location[jsts.geomgraph.Position.LEFT]=e,this.location[jsts.geomgraph.Position.RIGHT]=o}else if(arguments[0]instanceof jsts.geomgraph.TopologyLocation){var n=arguments[0];if(this.init(n.location.length),null!=n)for(var r=0;r<this.location.length;r++)this.location[r]=n.location[r]}else if("number"==typeof arguments[0]){var t=arguments[0];this.init(1),this.location[jsts.geomgraph.Position.ON]=t}else if(arguments[0]instanceof Array){var i=arguments[0];this.init(i.length)}},jsts.geomgraph.TopologyLocation.prototype.location=null,jsts.geomgraph.TopologyLocation.prototype.init=function(t){this.location[t-1]=null,this.setAllLocations(jsts.geom.Location.NONE)},jsts.geomgraph.TopologyLocation.prototype.get=function(t){return t<this.location.length?this.location[t]:jsts.geom.Location.NONE},jsts.geomgraph.TopologyLocation.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==jsts.geom.Location.NONE)return!1;return!0},jsts.geomgraph.TopologyLocation.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===jsts.geom.Location.NONE)return!0;return!1},jsts.geomgraph.TopologyLocation.prototype.isEqualOnSide=function(t,e){return this.location[e]==t.location[e]},jsts.geomgraph.TopologyLocation.prototype.isArea=function(){return this.location.length>1},jsts.geomgraph.TopologyLocation.prototype.isLine=function(){return 1===this.location.length},jsts.geomgraph.TopologyLocation.prototype.flip=function(){if(!(this.location.length<=1)){var t=this.location[jsts.geomgraph.Position.LEFT];this.location[jsts.geomgraph.Position.LEFT]=this.location[jsts.geomgraph.Position.RIGHT],this.location[jsts.geomgraph.Position.RIGHT]=t}},jsts.geomgraph.TopologyLocation.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},jsts.geomgraph.TopologyLocation.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===jsts.geom.Location.NONE&&(this.location[e]=t)},jsts.geomgraph.TopologyLocation.prototype.setLocation=function(t,e){void 0!==e?this.location[t]=e:this.setLocation(jsts.geomgraph.Position.ON,t)},jsts.geomgraph.TopologyLocation.prototype.getLocations=function(){return location},jsts.geomgraph.TopologyLocation.prototype.setLocations=function(t,e,o){this.location[jsts.geomgraph.Position.ON]=t,this.location[jsts.geomgraph.Position.LEFT]=e,this.location[jsts.geomgraph.Position.RIGHT]=o},jsts.geomgraph.TopologyLocation.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},jsts.geomgraph.TopologyLocation.prototype.merge=function(t){if(t.location.length>this.location.length){var e=[];e[jsts.geomgraph.Position.ON]=this.location[jsts.geomgraph.Position.ON],e[jsts.geomgraph.Position.LEFT]=jsts.geom.Location.NONE,e[jsts.geomgraph.Position.RIGHT]=jsts.geom.Location.NONE,this.location=e}for(var o=0;o<this.location.length;o++)this.location[o]===jsts.geom.Location.NONE&&o<t.location.length&&(this.location[o]=t.location[o])},jsts.geomgraph.Label=function(){this.elt=[];var t,e,o,n,r;4===arguments.length?(t=arguments[0],e=arguments[1],o=arguments[2],r=arguments[3],this.elt[0]=new jsts.geomgraph.TopologyLocation(jsts.geom.Location.NONE,jsts.geom.Location.NONE,jsts.geom.Location.NONE),this.elt[1]=new jsts.geomgraph.TopologyLocation(jsts.geom.Location.NONE,jsts.geom.Location.NONE,jsts.geom.Location.NONE),this.elt[t].setLocations(e,o,r)):3===arguments.length?(e=arguments[0],o=arguments[1],r=arguments[2],this.elt[0]=new jsts.geomgraph.TopologyLocation(e,o,r),this.elt[1]=new jsts.geomgraph.TopologyLocation(e,o,r)):2===arguments.length?(t=arguments[0],e=arguments[1],this.elt[0]=new jsts.geomgraph.TopologyLocation(jsts.geom.Location.NONE),this.elt[1]=new jsts.geomgraph.TopologyLocation(jsts.geom.Location.NONE),this.elt[t].setLocation(e)):arguments[0]instanceof jsts.geomgraph.Label?(n=arguments[0],this.elt[0]=new jsts.geomgraph.TopologyLocation(n.elt[0]),this.elt[1]=new jsts.geomgraph.TopologyLocation(n.elt[1])):"number"==typeof arguments[0]&&(e=arguments[0],this.elt[0]=new jsts.geomgraph.TopologyLocation(e),this.elt[1]=new jsts.geomgraph.TopologyLocation(e))},jsts.geomgraph.Label.toLineLabel=function(t){var e,o=new jsts.geomgraph.Label(jsts.geom.Location.NONE);for(e=0;2>e;e++)o.setLocation(e,t.getLocation(e));return o},jsts.geomgraph.Label.prototype.elt=null,jsts.geomgraph.Label.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},jsts.geomgraph.Label.prototype.getLocation=function(t,e){return 1==arguments.length?this.getLocation2.apply(this,arguments):this.elt[t].get(e)},jsts.geomgraph.Label.prototype.getLocation2=function(t){return this.elt[t].get(jsts.geomgraph.Position.ON)},jsts.geomgraph.Label.prototype.setLocation=function(t,e,o){return 2==arguments.length?void this.setLocation2.apply(this,arguments):void this.elt[t].setLocation(e,o)},jsts.geomgraph.Label.prototype.setLocation2=function(t,e){this.elt[t].setLocation(jsts.geomgraph.Position.ON,e)},jsts.geomgraph.Label.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},jsts.geomgraph.Label.prototype.setAllLocationsIfNull=function(t,e){return 1==arguments.length?void this.setAllLocationsIfNull2.apply(this,arguments):void this.elt[t].setAllLocationsIfNull(e)},jsts.geomgraph.Label.prototype.setAllLocationsIfNull2=function(t){this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)},jsts.geomgraph.Label.prototype.merge=function(t){var e;for(e=0;2>e;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new jsts.geomgraph.TopologyLocation(t.elt[e]):this.elt[e].merge(t.elt[e])},jsts.geomgraph.Label.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},jsts.geomgraph.Label.prototype.isNull=function(t){return this.elt[t].isNull()},jsts.geomgraph.Label.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},jsts.geomgraph.Label.prototype.isArea=function(){return 1==arguments.length?this.isArea2(arguments[0]):this.elt[0].isArea()||this.elt[1].isArea()},jsts.geomgraph.Label.prototype.isArea2=function(t){return this.elt[t].isArea()},jsts.geomgraph.Label.prototype.isLine=function(t){return this.elt[t].isLine()},jsts.geomgraph.Label.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},jsts.geomgraph.Label.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},jsts.geomgraph.Label.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new jsts.geomgraph.TopologyLocation(this.elt[t].location[0]))},jsts.geomgraph.EdgeRing=function(t,e){this.edges=[],this.pts=[],this.holes=[],this.label=new jsts.geomgraph.Label(jsts.geom.Location.NONE),this.geometryFactory=e,t&&(this.computePoints(t),this.computeRing())},jsts.geomgraph.EdgeRing.prototype.startDe=null,jsts.geomgraph.EdgeRing.prototype.maxNodeDegree=-1,jsts.geomgraph.EdgeRing.prototype.edges=null,jsts.geomgraph.EdgeRing.prototype.pts=null,jsts.geomgraph.EdgeRing.prototype.label=null,jsts.geomgraph.EdgeRing.prototype.ring=null,jsts.geomgraph.EdgeRing.prototype._isHole=null,jsts.geomgraph.EdgeRing.prototype.shell=null,jsts.geomgraph.EdgeRing.prototype.holes=null,jsts.geomgraph.EdgeRing.prototype.geometryFactory=null,jsts.geomgraph.EdgeRing.prototype.isIsolated=function(){return 1==this.label.getGeometryCount()},jsts.geomgraph.EdgeRing.prototype.isHole=function(){return this._isHole},jsts.geomgraph.EdgeRing.prototype.getCoordinate=function(t){return this.pts[t]},jsts.geomgraph.EdgeRing.prototype.getLinearRing=function(){return this.ring},jsts.geomgraph.EdgeRing.prototype.getLabel=function(){return this.label},jsts.geomgraph.EdgeRing.prototype.isShell=function(){return null===this.shell},jsts.geomgraph.EdgeRing.prototype.getShell=function(){return this.shell},jsts.geomgraph.EdgeRing.prototype.setShell=function(t){this.shell=t,null!==t&&t.addHole(this)},jsts.geomgraph.EdgeRing.prototype.addHole=function(t){this.holes.push(t)},jsts.geomgraph.EdgeRing.prototype.toPolygon=function(){for(var t=[],e=0;e<this.holes.length;e++)t[e]=this.holes[e].getLinearRing();var o=this.geometryFactory.createPolygon(this.getLinearRing(),t);return o},jsts.geomgraph.EdgeRing.prototype.computeRing=function(){if(null===this.ring){for(var t=[],e=0;e<this.pts.length;e++)t[e]=this.pts[e];this.ring=this.geometryFactory.createLinearRing(t),this._isHole=jsts.algorithm.CGAlgorithms.isCCW(this.ring.getCoordinates())}},jsts.geomgraph.EdgeRing.prototype.getNext=function(){throw new jsts.error.AbstractInvocationError},jsts.geomgraph.EdgeRing.prototype.setEdgeRing=function(){throw new jsts.error.AbstractInvocationError},jsts.geomgraph.EdgeRing.prototype.getEdges=function(){return this.edges},jsts.geomgraph.EdgeRing.prototype.computePoints=function(t){this.startDe=t;var e=t,o=!0;do{if(null===e)throw new jsts.error.TopologyError("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new jsts.error.TopologyError("Directed Edge visited twice during ring-building at "+e.getCoordinate());this.edges.push(e);var n=e.getLabel();jsts.util.Assert.isTrue(n.isArea()),this.mergeLabel(n),this.addPoints(e.getEdge(),e.isForward(),o),o=!1,this.setEdgeRing(e,this),e=this.getNext(e)}while(e!==this.startDe)},jsts.geomgraph.EdgeRing.prototype.getMaxNodeDegree=function(){return this.maxNodeDegree<0&&this.computeMaxNodeDegree(),this.maxNodeDegree},jsts.geomgraph.EdgeRing.prototype.computeMaxNodeDegree=function(){this.maxNodeDegree=0;var t=this.startDe;do{var e=t.getNode(),o=e.getEdges().getOutgoingDegree(this);o>this.maxNodeDegree&&(this.maxNodeDegree=o),t=this.getNext(t)}while(t!==this.startDe);this.maxNodeDegree*=2},jsts.geomgraph.EdgeRing.prototype.setInResult=function(){var t=this.startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!=this.startDe)},jsts.geomgraph.EdgeRing.prototype.mergeLabel=function(t){this.mergeLabel2(t,0),this.mergeLabel2(t,1)},jsts.geomgraph.EdgeRing.prototype.mergeLabel2=function(t,e){var o=t.getLocation(e,jsts.geomgraph.Position.RIGHT);if(o!=jsts.geom.Location.NONE)return this.label.getLocation(e)===jsts.geom.Location.NONE?void this.label.setLocation(e,o):void 0},jsts.geomgraph.EdgeRing.prototype.addPoints=function(t,e,o){var n=t.getCoordinates();if(e){var r=1;o&&(r=0);for(var i=r;i<n.length;i++)this.pts.push(n[i])}else{var r=n.length-2;o&&(r=n.length-1);for(var i=r;i>=0;i--)this.pts.push(n[i])}},jsts.geomgraph.EdgeRing.prototype.containsPoint=function(t){var e=this.getLinearRing(),o=e.getEnvelopeInternal();if(!o.contains(t))return!1;if(!jsts.algorithm.CGAlgorithms.isPointInRing(t,e.getCoordinates()))return!1;for(var n=0;n<this.holes.length;n++){var r=this.holes[n];if(r.containsPoint(t))return!1}return!0},function(){jsts.geom.LinearRing=function(){jsts.geom.LineString.apply(this,arguments)},jsts.geom.LinearRing.prototype=new jsts.geom.LineString,jsts.geom.LinearRing.constructor=jsts.geom.LinearRing,jsts.geom.LinearRing.prototype.getBoundaryDimension=function(){return jsts.geom.Dimension.FALSE},jsts.geom.LinearRing.prototype.isSimple=function(){return!0},jsts.geom.LinearRing.prototype.getGeometryType=function(){return"LinearRing"},jsts.geom.LinearRing.MINIMUM_VALID_SIZE=4,jsts.geom.LinearRing.prototype.CLASS_NAME="jsts.geom.LinearRing"}(),jsts.index.strtree.Boundable=function(){},jsts.index.strtree.Boundable.prototype.getBounds=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.index.strtree.AbstractNode=function(t){this.level=t,this.childBoundables=[]},jsts.index.strtree.AbstractNode.prototype=new jsts.index.strtree.Boundable,jsts.index.strtree.AbstractNode.constructor=jsts.index.strtree.AbstractNode,jsts.index.strtree.AbstractNode.prototype.childBoundables=null,jsts.index.strtree.AbstractNode.prototype.bounds=null,jsts.index.strtree.AbstractNode.prototype.level=null,jsts.index.strtree.AbstractNode.prototype.getChildBoundables=function(){return this.childBoundables},jsts.index.strtree.AbstractNode.prototype.computeBounds=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.index.strtree.AbstractNode.prototype.getBounds=function(){return null===this.bounds&&(this.bounds=this.computeBounds()),this.bounds},jsts.index.strtree.AbstractNode.prototype.getLevel=function(){return this.level},jsts.index.strtree.AbstractNode.prototype.addChildBoundable=function(t){this.childBoundables.push(t)},function(){jsts.noding.Noder=function(){},jsts.noding.Noder.prototype.computeNodes=jsts.abstractFunc,jsts.noding.Noder.prototype.getNodedSubstrings=jsts.abstractFunc}(),function(){var t=jsts.noding.Noder;jsts.noding.SinglePassNoder=function(){},jsts.noding.SinglePassNoder.prototype=new t,jsts.noding.SinglePassNoder.constructor=jsts.noding.SinglePassNoder,jsts.noding.SinglePassNoder.prototype.segInt=null,jsts.noding.SinglePassNoder.prototype.setSegmentIntersector=function(t){this.segInt=t}}(),jsts.index.SpatialIndex=function(){},jsts.index.SpatialIndex.prototype.insert=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.index.SpatialIndex.prototype.query=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.index.SpatialIndex.prototype.remove=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.index.strtree.AbstractSTRtree=function(t){void 0!==t&&(this.itemBoundables=[],jsts.util.Assert.isTrue(t>1,"Node capacity must be greater than 1"),this.nodeCapacity=t)},jsts.index.strtree.AbstractSTRtree.IntersectsOp=function(){},jsts.index.strtree.AbstractSTRtree.IntersectsOp.prototype.intersects=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.index.strtree.AbstractSTRtree.prototype.root=null,jsts.index.strtree.AbstractSTRtree.prototype.built=!1,jsts.index.strtree.AbstractSTRtree.prototype.itemBoundables=null,jsts.index.strtree.AbstractSTRtree.prototype.nodeCapacity=null,jsts.index.strtree.AbstractSTRtree.prototype.build=function(){jsts.util.Assert.isTrue(!this.built),this.root=0===this.itemBoundables.length?this.createNode(0):this.createHigherLevels(this.itemBoundables,-1),this.built=!0},jsts.index.strtree.AbstractSTRtree.prototype.createNode=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.index.strtree.AbstractSTRtree.prototype.createParentBoundables=function(t,e){jsts.util.Assert.isTrue(!(0===t.length));var o=[];o.push(this.createNode(e));for(var n=[],r=0;r<t.length;r++)n.push(t[r]);n.sort(this.getComparator());for(var r=0;r<n.length;r++){var i=n[r];this.lastNode(o).getChildBoundables().length===this.getNodeCapacity()&&o.push(this.createNode(e)),this.lastNode(o).addChildBoundable(i)}return o},jsts.index.strtree.AbstractSTRtree.prototype.lastNode=function(t){return t[t.length-1]},jsts.index.strtree.AbstractSTRtree.prototype.compareDoubles=function(t,e){return t>e?1:e>t?-1:0},jsts.index.strtree.AbstractSTRtree.prototype.createHigherLevels=function(t,e){jsts.util.Assert.isTrue(!(0===t.length));var o=this.createParentBoundables(t,e+1);return 1===o.length?o[0]:this.createHigherLevels(o,e+1)},jsts.index.strtree.AbstractSTRtree.prototype.getRoot=function(){return this.built||this.build(),this.root},jsts.index.strtree.AbstractSTRtree.prototype.getNodeCapacity=function(){return this.nodeCapacity},jsts.index.strtree.AbstractSTRtree.prototype.size=function(){return 1===arguments.length?this.size2(arguments[0]):(this.built||this.build(),0===this.itemBoundables.length?0:this.size2(root))},jsts.index.strtree.AbstractSTRtree.prototype.size2=function(t){for(var e=0,o=t.getChildBoundables(),n=0;n<o.length;n++){var r=o[n];r instanceof jsts.index.strtree.AbstractNode?e+=this.size(r):r instanceof jsts.index.strtree.ItemBoundable&&(e+=1)}return e},jsts.index.strtree.AbstractSTRtree.prototype.depth=function(){return 1===arguments.length?this.depth2(arguments[0]):(this.built||this.build(),0===this.itemBoundables.length?0:this.depth2(root))},jsts.index.strtree.AbstractSTRtree.prototype.depth2=function(){for(var t=0,e=node.getChildBoundables(),o=0;o<e.length;o++){var n=e[o];if(n instanceof jsts.index.strtree.AbstractNode){var r=this.depth(n);r>t&&(t=r)}}return t+1},jsts.index.strtree.AbstractSTRtree.prototype.insert=function(t,e){jsts.util.Assert.isTrue(!this.built,"Cannot insert items into an STR packed R-tree after it has been built."),this.itemBoundables.push(new jsts.index.strtree.ItemBoundable(t,e))},jsts.index.strtree.AbstractSTRtree.prototype.query=function(t){arguments.length>1&&this.query2.apply(this,arguments),this.built||this.build();var e=[];return 0===this.itemBoundables.length?(jsts.util.Assert.isTrue(null===this.root.getBounds()),e):(this.getIntersectsOp().intersects(this.root.getBounds(),t)&&this.query3(t,this.root,e),e)},jsts.index.strtree.AbstractSTRtree.prototype.query2=function(t,e){arguments.length>2&&this.query3.apply(this,arguments),this.built||this.build(),0===this.itemBoundables.length&&jsts.util.Assert.isTrue(null===this.root.getBounds()),this.getIntersectsOp().intersects(this.root.getBounds(),t)&&this.query4(t,this.root,e)},jsts.index.strtree.AbstractSTRtree.prototype.query3=function(t,e,o){arguments[2]instanceof Array||this.query4.apply(this,arguments);for(var n=e.getChildBoundables(),r=0;r<n.length;r++){var i=n[r];this.getIntersectsOp().intersects(i.getBounds(),t)&&(i instanceof jsts.index.strtree.AbstractNode?this.query3(t,i,o):i instanceof jsts.index.strtree.ItemBoundable?o.push(i.getItem()):jsts.util.Assert.shouldNeverReachHere())}},jsts.index.strtree.AbstractSTRtree.prototype.query4=function(t,e,o){for(var n=e.getChildBoundables(),r=0;r<n.length;r++){var i=n[r];this.getIntersectsOp().intersects(i.getBounds(),t)&&(i instanceof jsts.index.strtree.AbstractNode?this.query4(t,i,o):i instanceof jsts.index.strtree.ItemBoundable?o.visitItem(i.getItem()):jsts.util.Assert.shouldNeverReachHere())}},jsts.index.strtree.AbstractSTRtree.prototype.getIntersectsOp=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.index.strtree.AbstractSTRtree.prototype.itemsTree=function(){if(1===arguments.length)return this.itemsTree2.apply(this,arguments);this.built||this.build();var t=this.itemsTree2(this.root);return null===t?[]:t},jsts.index.strtree.AbstractSTRtree.prototype.itemsTree2=function(t){for(var e=[],o=t.getChildBoundables(),n=0;n<o.length;n++){var r=o[n];if(r instanceof jsts.index.strtree.AbstractNode){var i=this.itemsTree(r);null!=i&&e.push(i)}else r instanceof jsts.index.strtree.ItemBoundable?e.push(r.getItem()):jsts.util.Assert.shouldNeverReachHere()}return e.length<=0?null:e},jsts.index.strtree.AbstractSTRtree.prototype.remove=function(t,e){return this.built||this.build(),0===this.itemBoundables.length&&jsts.util.Assert.isTrue(null==this.root.getBounds()),this.getIntersectsOp().intersects(this.root.getBounds(),t)?this.remove2(t,this.root,e):!1},jsts.index.strtree.AbstractSTRtree.prototype.remove2=function(t,e,o){var n=this.removeItem(e,o);if(n)return!0;for(var r=null,i=e.getChildBoundables(),s=0;s<i.length;s++){var a=i[s];if(this.getIntersectsOp().intersects(a.getBounds(),t)&&a instanceof jsts.index.strtree.AbstractNode&&(n=this.remove(t,a,o))){r=a;break}}return null!=r&&0===r.getChildBoundables().length&&i.splice(i.indexOf(r),1),n},jsts.index.strtree.AbstractSTRtree.prototype.removeItem=function(t,e){for(var o=null,n=t.getChildBoundables(),r=0;r<n.length;r++){var i=n[r];i instanceof jsts.index.strtree.ItemBoundable&&i.getItem()===e&&(o=i)}return null!==o?(n.splice(n.indexOf(o),1),!0):!1},jsts.index.strtree.AbstractSTRtree.prototype.boundablesAtLevel=function(t){if(arguments.length>1)return void this.boundablesAtLevel2.apply(this,arguments);var e=[];return this.boundablesAtLevel2(t,this.root,e),e},jsts.index.strtree.AbstractSTRtree.prototype.boundablesAtLevel2=function(t,e,o){if(jsts.util.Assert.isTrue(t>-2),e.getLevel()===t)return void o.add(e);for(var n=node.getChildBoundables(),r=0;r<n.length;r++){var i=n[r];i instanceof jsts.index.strtree.AbstractNode?this.boundablesAtLevel(t,i,o):(jsts.util.Assert.isTrue(i instanceof jsts.index.strtree.ItemBoundable),-1===t&&o.add(i))}},jsts.index.strtree.AbstractSTRtree.prototype.getComparator=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.index.strtree.STRtree=function(t){t=t||jsts.index.strtree.STRtree.DEFAULT_NODE_CAPACITY,jsts.index.strtree.AbstractSTRtree.call(this,t)},jsts.index.strtree.STRtree.prototype=new jsts.index.strtree.AbstractSTRtree,jsts.index.strtree.STRtree.constructor=jsts.index.strtree.STRtree,jsts.index.strtree.STRtree.prototype.xComparator=function(t,e){return jsts.index.strtree.AbstractSTRtree.prototype.compareDoubles(jsts.index.strtree.STRtree.prototype.centreX(t.getBounds()),jsts.index.strtree.STRtree.prototype.centreX(e.getBounds()))},jsts.index.strtree.STRtree.prototype.yComparator=function(t,e){return jsts.index.strtree.AbstractSTRtree.prototype.compareDoubles(jsts.index.strtree.STRtree.prototype.centreY(t.getBounds()),jsts.index.strtree.STRtree.prototype.centreY(e.getBounds()))},jsts.index.strtree.STRtree.prototype.centreX=function(t){return jsts.index.strtree.STRtree.prototype.avg(t.getMinX(),t.getMaxX())},jsts.index.strtree.STRtree.prototype.centreY=function(t){return jsts.index.strtree.STRtree.prototype.avg(t.getMinY(),t.getMaxY())},jsts.index.strtree.STRtree.prototype.avg=function(t,e){return(t+e)/2},jsts.index.strtree.STRtree.prototype.intersectsOp={intersects:function(t,e){return t.intersects(e)}},jsts.index.strtree.STRtree.prototype.createParentBoundables=function(t,e){jsts.util.Assert.isTrue(!(0===t.length));for(var o=Math.ceil(t.length/this.getNodeCapacity()),n=[],r=0;r<t.length;r++)n.push(t[r]);n.sort(this.xComparator);var i=this.verticalSlices(n,Math.ceil(Math.sqrt(o)));return this.createParentBoundablesFromVerticalSlices(i,e)},jsts.index.strtree.STRtree.prototype.createParentBoundablesFromVerticalSlices=function(t,e){jsts.util.Assert.isTrue(t.length>0);for(var o=[],n=0;n<t.length;n++)o=o.concat(this.createParentBoundablesFromVerticalSlice(t[n],e));return o},jsts.index.strtree.STRtree.prototype.createParentBoundablesFromVerticalSlice=function(t,e){return jsts.index.strtree.AbstractSTRtree.prototype.createParentBoundables.call(this,t,e)},jsts.index.strtree.STRtree.prototype.verticalSlices=function(t,e){for(var o,n,r=Math.ceil(t.length/e),i=[],s=0,a=0;e>a;a++)for(i[a]=[],o=0;s<t.length&&r>o;)n=t[s++],i[a].push(n),o++;return i},jsts.index.strtree.STRtree.DEFAULT_NODE_CAPACITY=10,jsts.index.strtree.STRtree.prototype.createNode=function(t){var e=new jsts.index.strtree.AbstractNode(t);return e.computeBounds=function(){for(var t=null,e=this.getChildBoundables(),o=0;o<e.length;o++){var n=e[o];null===t?t=new jsts.geom.Envelope(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e},jsts.index.strtree.STRtree.prototype.getIntersectsOp=function(){return this.intersectsOp},jsts.index.strtree.STRtree.prototype.insert=function(t,e){t.isNull()||jsts.index.strtree.AbstractSTRtree.prototype.insert.call(this,t,e)},jsts.index.strtree.STRtree.prototype.query=function(){return jsts.index.strtree.AbstractSTRtree.prototype.query.apply(this,arguments)},jsts.index.strtree.STRtree.prototype.remove=function(t,e){return jsts.index.strtree.AbstractSTRtree.prototype.remove.call(this,t,e)},jsts.index.strtree.STRtree.prototype.size=function(){return jsts.index.strtree.AbstractSTRtree.prototype.size.call(this)},jsts.index.strtree.STRtree.prototype.depth=function(){return jsts.index.strtree.AbstractSTRtree.prototype.depth.call(this)},jsts.index.strtree.STRtree.prototype.getComparator=function(){return this.yComparator},jsts.index.strtree.STRtree.prototype.nearestNeighbour=function(t){var e=new jsts.index.strtree.BoundablePair(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour4(e)},jsts.index.strtree.STRtree.prototype.nearestNeighbour2=function(t,e,o){var n=new jsts.index.strtree.ItemBoundable(t,e),r=new jsts.index.strtree.BoundablePair(this.getRoot(),n,o);return this.nearestNeighbour4(r)[0]},jsts.index.strtree.STRtree.prototype.nearestNeighbour3=function(t,e){var o=new jsts.index.strtree.BoundablePair(this.getRoot(),t.getRoot(),e);return this.nearestNeighbour4(o)},jsts.index.strtree.STRtree.prototype.nearestNeighbour4=function(t){return this.nearestNeighbour5(t,Double.POSITIVE_INFINITY)},jsts.index.strtree.STRtree.prototype.nearestNeighbour5=function(t,e){var o=e,n=null,r=[];for(r.push(t);!r.isEmpty()&&o>0;){var i=r.pop(),s=i.getDistance();if(s>=o)break;i.isLeaves()?(o=s,n=i):i.expandToQueue(r,o)}return[n.getBoundable(0).getItem(),n.getBoundable(1).getItem()]},jsts.noding.SegmentString=function(){},jsts.noding.SegmentString.prototype.getData=jsts.abstractFunc,jsts.noding.SegmentString.prototype.setData=jsts.abstractFunc,jsts.noding.SegmentString.prototype.size=jsts.abstractFunc,jsts.noding.SegmentString.prototype.getCoordinate=jsts.abstractFunc,jsts.noding.SegmentString.prototype.getCoordinates=jsts.abstractFunc,jsts.noding.SegmentString.prototype.isClosed=jsts.abstractFunc,jsts.noding.NodableSegmentString=function(){},jsts.noding.NodableSegmentString.prototype=new jsts.noding.SegmentString,jsts.noding.NodableSegmentString.prototype.addIntersection=jsts.abstractFunc,jsts.noding.NodedSegmentString=function(t,e){this.nodeList=new jsts.noding.SegmentNodeList(this),this.pts=t,this.data=e},jsts.noding.NodedSegmentString.prototype=new jsts.noding.NodableSegmentString,jsts.noding.NodedSegmentString.constructor=jsts.noding.NodedSegmentString,jsts.noding.NodedSegmentString.getNodedSubstrings=function(t){if(2===arguments.length)return void jsts.noding.NodedSegmentString.getNodedSubstrings2.apply(this,arguments);var e=new javascript.util.ArrayList;return jsts.noding.NodedSegmentString.getNodedSubstrings2(t,e),e},jsts.noding.NodedSegmentString.getNodedSubstrings2=function(t,e){for(var o=t.iterator();o.hasNext();){var n=o.next();n.getNodeList().addSplitEdges(e)}},jsts.noding.NodedSegmentString.prototype.nodeList=null,jsts.noding.NodedSegmentString.prototype.pts=null,jsts.noding.NodedSegmentString.prototype.data=null,jsts.noding.NodedSegmentString.prototype.getData=function(){return this.data},jsts.noding.NodedSegmentString.prototype.setData=function(t){this.data=t},jsts.noding.NodedSegmentString.prototype.getNodeList=function(){return this.nodeList},jsts.noding.NodedSegmentString.prototype.size=function(){return this.pts.length},jsts.noding.NodedSegmentString.prototype.getCoordinate=function(t){return this.pts[t]},jsts.noding.NodedSegmentString.prototype.getCoordinates=function(){return this.pts},jsts.noding.NodedSegmentString.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},jsts.noding.NodedSegmentString.prototype.getSegmentOctant=function(t){return t===this.pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},jsts.noding.NodedSegmentString.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:jsts.noding.Octant.octant(t,e)},jsts.noding.NodedSegmentString.prototype.addIntersections=function(t,e,o){for(var n=0;n<t.getIntersectionNum();n++)this.addIntersection(t,e,o,n)},jsts.noding.NodedSegmentString.prototype.addIntersection=function(t,e,o,n){if(t instanceof jsts.geom.Coordinate)return void this.addIntersection2.apply(this,arguments);var r=new jsts.geom.Coordinate(t.getIntersection(n));this.addIntersection2(r,e)},jsts.noding.NodedSegmentString.prototype.addIntersection2=function(t,e){this.addIntersectionNode(t,e)},jsts.noding.NodedSegmentString.prototype.addIntersectionNode=function(t,e){var o=e,n=o+1;if(n<this.pts.length){var r=this.pts[n];t.equals2D(r)&&(o=n)}var i=this.nodeList.add(t,o);return i},jsts.noding.NodedSegmentString.prototype.toString=function(){var t=new jsts.geom.GeometryFactory;return(new jsts.io.WKTWriter).write(t.createLineString(this.pts))},jsts.index.chain.MonotoneChainBuilder=function(){},jsts.index.chain.MonotoneChainBuilder.toIntArray=function(t){for(var e=[],o=0;o<t.length;o++)e[o]=t[o];return e},jsts.index.chain.MonotoneChainBuilder.getChains=function(t){return 2===arguments.length?jsts.index.chain.MonotoneChainBuilder.getChains2.apply(this,arguments):jsts.index.chain.MonotoneChainBuilder.getChains2(t,null)},jsts.index.chain.MonotoneChainBuilder.getChains2=function(t,e){for(var o=[],n=jsts.index.chain.MonotoneChainBuilder.getChainStartIndices(t),r=0;r<n.length-1;r++){var i=new jsts.index.chain.MonotoneChain(t,n[r],n[r+1],e);o.push(i)}return o},jsts.index.chain.MonotoneChainBuilder.getChainStartIndices=function(t){var e=0,o=[];o.push(e);do{var n=jsts.index.chain.MonotoneChainBuilder.findChainEnd(t,e);o.push(n),e=n}while(e<t.length-1);var r=jsts.index.chain.MonotoneChainBuilder.toIntArray(o);return r},jsts.index.chain.MonotoneChainBuilder.findChainEnd=function(t,e){for(var o=e;o<t.length-1&&t[o].equals2D(t[o+1]);)o++;if(o>=t.length-1)return t.length-1;for(var n=jsts.geomgraph.Quadrant.quadrant(t[o],t[o+1]),r=e+1;r<t.length;){if(!t[r-1].equals2D(t[r])){var i=jsts.geomgraph.Quadrant.quadrant(t[r-1],t[r]);if(i!==n)break}r++}return r-1},jsts.algorithm.LineIntersector=function(){this.inputLines=[[],[]],this.intPt=[null,null],this.pa=this.intPt[0],this.pb=this.intPt[1],this.result=jsts.algorithm.LineIntersector.NO_INTERSECTION},jsts.algorithm.LineIntersector.NO_INTERSECTION=0,jsts.algorithm.LineIntersector.POINT_INTERSECTION=1,jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION=2,jsts.algorithm.LineIntersector.prototype.setPrecisionModel=function(t){this.precisionModel=t},jsts.algorithm.LineIntersector.prototype.getEndpoint=function(t,e){return this.inputLines[t][e]},jsts.algorithm.LineIntersector.computeEdgeDistance=function(t,e,o){var n=Math.abs(o.x-e.x),r=Math.abs(o.y-e.y),i=-1;if(t.equals(e))i=0;
else if(t.equals(o))i=n>r?n:r;else{var s=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y);i=n>r?s:a,0!==i||t.equals(e)||(i=Math.max(s,a))}if(0===i&&!t.equals(e))throw new jsts.error.IllegalArgumentError("Bad distance calculation");return i},jsts.algorithm.LineIntersector.nonRobustComputeEdgeDistance=function(t,e){var o=t.x-e.x,n=t.y-e.y,r=Math.sqrt(o*o+n*n);if(0!==r||t.equals(e))throw new jsts.error.IllegalArgumentError("Invalid distance calculation");return r},jsts.algorithm.LineIntersector.prototype.result=null,jsts.algorithm.LineIntersector.prototype.inputLines=null,jsts.algorithm.LineIntersector.prototype.intPt=null,jsts.algorithm.LineIntersector.prototype.intLineIndex=null,jsts.algorithm.LineIntersector.prototype._isProper=null,jsts.algorithm.LineIntersector.prototype.pa=null,jsts.algorithm.LineIntersector.prototype.pb=null,jsts.algorithm.LineIntersector.prototype.precisionModel=null,jsts.algorithm.LineIntersector.prototype.computeIntersection=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.algorithm.LineIntersector.prototype.isCollinear=function(){return this.result===jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION},jsts.algorithm.LineIntersector.prototype.computeIntersection=function(t,e,o,n){this.inputLines[0][0]=t,this.inputLines[0][1]=e,this.inputLines[1][0]=o,this.inputLines[1][1]=n,this.result=this.computeIntersect(t,e,o,n)},jsts.algorithm.LineIntersector.prototype.computeIntersect=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.algorithm.LineIntersector.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},jsts.algorithm.LineIntersector.prototype.hasIntersection=function(){return this.result!==jsts.algorithm.LineIntersector.NO_INTERSECTION},jsts.algorithm.LineIntersector.prototype.getIntersectionNum=function(){return this.result},jsts.algorithm.LineIntersector.prototype.getIntersection=function(t){return this.intPt[t]},jsts.algorithm.LineIntersector.prototype.computeIntLineIndex=function(){null===this.intLineIndex&&(this.intLineIndex=[[],[]],this.computeIntLineIndex(0),this.computeIntLineIndex(1))},jsts.algorithm.LineIntersector.prototype.isIntersection=function(t){var e;for(e=0;e<this.result;e++)if(this.intPt[e].equals2D(t))return!0;return!1},jsts.algorithm.LineIntersector.prototype.isInteriorIntersection=function(){return 1===arguments.length?this.isInteriorIntersection2.apply(this,arguments):this.isInteriorIntersection(0)?!0:this.isInteriorIntersection(1)?!0:!1},jsts.algorithm.LineIntersector.prototype.isInteriorIntersection2=function(t){var e;for(e=0;e<this.result;e++)if(!this.intPt[e].equals2D(this.inputLines[t][0])&&!this.intPt[e].equals2D(this.inputLines[t][1]))return!0;return!1},jsts.algorithm.LineIntersector.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},jsts.algorithm.LineIntersector.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this.intPt[intLineIndex[t][e]]},jsts.algorithm.LineIntersector.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this.intLineIndex[t][e]},jsts.algorithm.LineIntersector.prototype.computeIntLineIndex=function(t){var e=this.getEdgeDistance(t,0),o=this.getEdgeDistance(t,1);e>o?(this.intLineIndex[t][0]=0,this.intLineIndex[t][1]=1):(this.intLineIndex[t][0]=1,this.intLineIndex[t][1]=0)},jsts.algorithm.LineIntersector.prototype.getEdgeDistance=function(t,e){var o=jsts.algorithm.LineIntersector.computeEdgeDistance(this.intPt[e],this.inputLines[t][0],this.inputLines[t][1]);return o},jsts.algorithm.RobustLineIntersector=function(){jsts.algorithm.RobustLineIntersector.prototype.constructor.call(this)},jsts.algorithm.RobustLineIntersector.prototype=new jsts.algorithm.LineIntersector,jsts.algorithm.RobustLineIntersector.prototype.computeIntersection=function(t,e,o){return 4===arguments.length?void jsts.algorithm.LineIntersector.prototype.computeIntersection.apply(this,arguments):(this._isProper=!1,jsts.geom.Envelope.intersects(e,o,t)&&0===jsts.algorithm.CGAlgorithms.orientationIndex(e,o,t)&&0===jsts.algorithm.CGAlgorithms.orientationIndex(o,e,t)?(this._isProper=!0,(t.equals(e)||t.equals(o))&&(this._isProper=!1),void(this.result=jsts.algorithm.LineIntersector.POINT_INTERSECTION)):void(this.result=jsts.algorithm.LineIntersector.NO_INTERSECTION))},jsts.algorithm.RobustLineIntersector.prototype.computeIntersect=function(t,e,o,n){if(this._isProper=!1,!jsts.geom.Envelope.intersects(t,e,o,n))return jsts.algorithm.LineIntersector.NO_INTERSECTION;var r=jsts.algorithm.CGAlgorithms.orientationIndex(t,e,o),i=jsts.algorithm.CGAlgorithms.orientationIndex(t,e,n);if(r>0&&i>0||0>r&&0>i)return jsts.algorithm.LineIntersector.NO_INTERSECTION;var s=jsts.algorithm.CGAlgorithms.orientationIndex(o,n,t),a=jsts.algorithm.CGAlgorithms.orientationIndex(o,n,e);if(s>0&&a>0||0>s&&0>a)return jsts.algorithm.LineIntersector.NO_INTERSECTION;var u=0===r&&0===i&&0===s&&0===a;return u?this.computeCollinearIntersection(t,e,o,n):(0===r||0===i||0===s||0===a?(this._isProper=!1,t.equals2D(o)||t.equals2D(n)?this.intPt[0]=t:e.equals2D(o)||e.equals2D(n)?this.intPt[0]=e:0===r?this.intPt[0]=new jsts.geom.Coordinate(o):0===i?this.intPt[0]=new jsts.geom.Coordinate(n):0===s?this.intPt[0]=new jsts.geom.Coordinate(t):0===a&&(this.intPt[0]=new jsts.geom.Coordinate(e))):(this._isProper=!0,this.intPt[0]=this.intersection(t,e,o,n)),jsts.algorithm.LineIntersector.POINT_INTERSECTION)},jsts.algorithm.RobustLineIntersector.prototype.computeCollinearIntersection=function(t,e,o,n){var r=jsts.geom.Envelope.intersects(t,e,o),i=jsts.geom.Envelope.intersects(t,e,n),s=jsts.geom.Envelope.intersects(o,n,t),a=jsts.geom.Envelope.intersects(o,n,e);return r&&i?(this.intPt[0]=o,this.intPt[1]=n,jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION):s&&a?(this.intPt[0]=t,this.intPt[1]=e,jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION):r&&s?(this.intPt[0]=o,this.intPt[1]=t,!o.equals(t)||i||a?jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION:jsts.algorithm.LineIntersector.POINT_INTERSECTION):r&&a?(this.intPt[0]=o,this.intPt[1]=e,!o.equals(e)||i||s?jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION:jsts.algorithm.LineIntersector.POINT_INTERSECTION):i&&s?(this.intPt[0]=n,this.intPt[1]=t,!n.equals(t)||r||a?jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION:jsts.algorithm.LineIntersector.POINT_INTERSECTION):i&&a?(this.intPt[0]=n,this.intPt[1]=e,!n.equals(e)||r||s?jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION:jsts.algorithm.LineIntersector.POINT_INTERSECTION):jsts.algorithm.LineIntersector.NO_INTERSECTION},jsts.algorithm.RobustLineIntersector.prototype.intersection=function(t,e,o,n){var r=this.intersectionWithNormalization(t,e,o,n);return this.isInSegmentEnvelopes(r)||(r=jsts.algorithm.CentralEndpointIntersector.getIntersection(t,e,o,n)),null!==this.precisionModel&&this.precisionModel.makePrecise(r),r},jsts.algorithm.RobustLineIntersector.prototype.intersectionWithNormalization=function(t,e,o,n){var r=new jsts.geom.Coordinate(t),i=new jsts.geom.Coordinate(e),s=new jsts.geom.Coordinate(o),a=new jsts.geom.Coordinate(n),u=new jsts.geom.Coordinate;this.normalizeToEnvCentre(r,i,s,a,u);var p=this.safeHCoordinateIntersection(r,i,s,a);return p.x+=u.x,p.y+=u.y,p},jsts.algorithm.RobustLineIntersector.prototype.safeHCoordinateIntersection=function(t,e,o,n){var r=null;try{r=jsts.algorithm.HCoordinate.intersection(t,e,o,n)}catch(i){if(!(i instanceof jsts.error.NotRepresentableError))throw i;r=jsts.algorithm.CentralEndpointIntersector.getIntersection(t,e,o,n)}return r},jsts.algorithm.RobustLineIntersector.prototype.normalizeToMinimum=function(t,e,o,n,r){r.x=this.smallestInAbsValue(t.x,e.x,o.x,n.x),r.y=this.smallestInAbsValue(t.y,e.y,o.y,n.y),t.x-=r.x,t.y-=r.y,e.x-=r.x,e.y-=r.y,o.x-=r.x,o.y-=r.y,n.x-=r.x,n.y-=r.y},jsts.algorithm.RobustLineIntersector.prototype.normalizeToEnvCentre=function(t,e,o,n,r){var i=t.x<e.x?t.x:e.x,s=t.y<e.y?t.y:e.y,a=t.x>e.x?t.x:e.x,u=t.y>e.y?t.y:e.y,p=o.x<n.x?o.x:n.x,g=o.y<n.y?o.y:n.y,l=o.x>n.x?o.x:n.x,h=o.y>n.y?o.y:n.y,d=i>p?i:p,c=l>a?a:l,m=s>g?s:g,f=h>u?u:h,y=(d+c)/2,j=(m+f)/2;r.x=y,r.y=j,t.x-=r.x,t.y-=r.y,e.x-=r.x,e.y-=r.y,o.x-=r.x,o.y-=r.y,n.x-=r.x,n.y-=r.y},jsts.algorithm.RobustLineIntersector.prototype.smallestInAbsValue=function(t,e,o,n){var r=t,i=Math.abs(r);return Math.abs(e)<i&&(r=e,i=Math.abs(e)),Math.abs(o)<i&&(r=o,i=Math.abs(o)),Math.abs(n)<i&&(r=n),r},jsts.algorithm.RobustLineIntersector.prototype.isInSegmentEnvelopes=function(t){var e=new jsts.geom.Envelope(this.inputLines[0][0],this.inputLines[0][1]),o=new jsts.geom.Envelope(this.inputLines[1][0],this.inputLines[1][1]);return e.contains(t)&&o.contains(t)},jsts.algorithm.HCoordinate=function(){this.x=0,this.y=0,this.w=1,1===arguments.length?this.initFrom1Coordinate(arguments[0]):2===arguments.length&&arguments[0]instanceof jsts.geom.Coordinate?this.initFrom2Coordinates(arguments[0],arguments[1]):2===arguments.length&&arguments[0]instanceof jsts.algorithm.HCoordinate?this.initFrom2HCoordinates(arguments[0],arguments[1]):2===arguments.length?this.initFromXY(arguments[0],arguments[1]):3===arguments.length?this.initFromXYW(arguments[0],arguments[1],arguments[2]):4===arguments.length&&this.initFromXYW(arguments[0],arguments[1],arguments[2],arguments[3])},jsts.algorithm.HCoordinate.intersection=function(t,e,o,n){var r,i,s,a,u,p,g,l,h,d,c;if(r=t.y-e.y,i=e.x-t.x,s=t.x*e.y-e.x*t.y,a=o.y-n.y,u=n.x-o.x,p=o.x*n.y-n.x*o.y,g=i*p-u*s,l=a*s-r*p,h=r*u-a*i,d=g/h,c=l/h,!isFinite(d)||!isFinite(c))throw new jsts.error.NotRepresentableError;return new jsts.geom.Coordinate(d,c)},jsts.algorithm.HCoordinate.prototype.initFrom1Coordinate=function(t){this.x=t.x,this.y=t.y,this.w=1},jsts.algorithm.HCoordinate.prototype.initFrom2Coordinates=function(t,e){this.x=t.y-e.y,this.y=e.x-t.x,this.w=t.x*e.y-e.x*t.y},jsts.algorithm.HCoordinate.prototype.initFrom2HCoordinates=function(t,e){this.x=t.y*e.w-e.y*t.w,this.y=e.x*t.w-t.x*e.w,this.w=t.x*e.y-e.x*t.y},jsts.algorithm.HCoordinate.prototype.initFromXYW=function(t,e,o){this.x=t,this.y=e,this.w=o},jsts.algorithm.HCoordinate.prototype.initFromXY=function(t,e){this.x=t,this.y=e,this.w=1},jsts.algorithm.HCoordinate.prototype.initFrom4Coordinates=function(t,e,o,n){var r,i,s,a,u,p;r=t.y-e.y,i=e.x-t.x,s=t.x*e.y-e.x*t.y,a=o.y-n.y,u=n.x-o.x,p=o.x*n.y-n.x*o.y,this.x=i*p-u*s,this.y=a*s-r*p,this.w=r*u-a*i},jsts.algorithm.HCoordinate.prototype.getX=function(){var t=this.x/this.w;if(!isFinite(t))throw new jsts.error.NotRepresentableError;return t},jsts.algorithm.HCoordinate.prototype.getY=function(){var t=this.y/this.w;if(!isFinite(t))throw new jsts.error.NotRepresentableError;return t},jsts.algorithm.HCoordinate.prototype.getCoordinate=function(){var t=new jsts.geom.Coordinate;return t.x=this.getX(),t.y=this.getY(),t},jsts.geom.LineSegment=function(){0===arguments.length?(this.p0=new jsts.geom.Coordinate,this.p1=new jsts.geom.Coordinate):1===arguments.length?(this.p0=arguments[0].p0,this.p1=arguments[0].p1):2===arguments.length?(this.p0=arguments[0],this.p1=arguments[1]):4===arguments.length&&(this.p0=new jsts.geom.Coordinate(arguments[0],arguments[1]),this.p1=new jsts.geom.Coordinate(arguments[2],arguments[3]))},jsts.geom.LineSegment.prototype.p0=null,jsts.geom.LineSegment.prototype.p1=null,jsts.geom.LineSegment.midPoint=function(t,e){return new jsts.geom.Coordinate((t.x+e.x)/2,(t.y+e.y)/2)},jsts.geom.LineSegment.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},jsts.geom.LineSegment.prototype.getLength=function(){return this.p0.distance(this.p1)},jsts.geom.LineSegment.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},jsts.geom.LineSegment.prototype.isVertical=function(){return this.p0.x===this.p1.x},jsts.geom.LineSegment.prototype.orientationIndex=function(t){return t instanceof jsts.geom.LineSegment?this.orientationIndex1(t):t instanceof jsts.geom.Coordinate?this.orientationIndex2(t):void 0},jsts.geom.LineSegment.prototype.orientationIndex1=function(t){var e=jsts.algorithm.CGAlgorithms.orientationIndex(this.p0,this.p1,t.p0),o=jsts.algorithm.CGAlgorithms.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&o>=0?Math.max(e,o):0>=e&&0>=o?Math.max(e,o):0},jsts.geom.LineSegment.prototype.orientationIndex2=function(t){return jsts.algorithm.CGAlgorithms.orientationIndex(this.p0,this.p1,t)},jsts.geom.LineSegment.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},jsts.geom.LineSegment.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},jsts.geom.LineSegment.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},jsts.geom.LineSegment.prototype.midPoint=function(){return jsts.geom.LineSegment.midPoint(this.p0,this.p1)},jsts.geom.LineSegment.prototype.distance=function(t){return t instanceof jsts.geom.LineSegment?this.distance1(t):t instanceof jsts.geom.Coordinate?this.distance2(t):void 0},jsts.geom.LineSegment.prototype.distance1=function(t){return jsts.algorithm.CGAlgorithms.distanceLineLine(this.p0,this.p1,t.p0,t.p1)},jsts.geom.LineSegment.prototype.distance2=function(t){return jsts.algorithm.CGAlgorithms.distancePointLine(t,this.p0,this.p1)},jsts.geom.LineSegment.prototype.pointAlong=function(t){var e=new jsts.geom.Coordinate;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},jsts.geom.LineSegment.prototype.pointAlongOffset=function(t,e){var o=this.p0.x+t*(this.p1.x-this.p0.x),n=this.p0.y+t*(this.p1.y-this.p0.y),r=this.p1.x-this.p0.x,i=this.p1.y-this.p0.y,s=Math.sqrt(r*r+i*i),a=0,u=0;if(0!==e){if(0>=s)throw"Cannot compute offset from zero-length line segment";a=e*r/s,u=e*i/s}var p=o-u,g=n+a,l=new jsts.geom.Coordinate(p,g);return l},jsts.geom.LineSegment.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,n=e*e+o*o,r=((t.x-this.p0.x)*e+(t.y-this.p0.y)*o)/n;return r},jsts.geom.LineSegment.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return 0>e?e=0:(e>1||isNaN(e))&&(e=1),e},jsts.geom.LineSegment.prototype.project=function(t){return t instanceof jsts.geom.Coordinate?this.project1(t):t instanceof jsts.geom.LineSegment?this.project2(t):void 0},jsts.geom.LineSegment.prototype.project1=function(t){if(t.equals(this.p0)||t.equals(this.p1))return new jsts.geom.Coordinate(t);var e=this.projectionFactor(t),o=new jsts.geom.Coordinate;return o.x=this.p0.x+e*(this.p1.x-this.p0.x),o.y=this.p0.y+e*(this.p1.y-this.p0.y),o},jsts.geom.LineSegment.prototype.project2=function(t){var e=this.projectionFactor(t.p0),o=this.projectionFactor(t.p1);if(e>=1&&o>=1)return null;if(0>=e&&0>=o)return null;var n=this.project(t.p0);0>e&&(n=p0),e>1&&(n=p1);var r=this.project(t.p1);return 0>o&&(r=p0),o>1&&(r=p1),new jsts.geom.LineSegment(n,r)},jsts.geom.LineSegment.prototype.closestPoint=function(t){var e=this.projectionFactor(t);if(e>0&&1>e)return this.project(t);var o=this.p0.distance(t),n=this.p1.distance(t);return n>o?this.p0:this.p1},jsts.geom.LineSegment.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var o,n=[],r=Number.MAX_VALUE,i=this.closestPoint(t.p0);r=i.distance(t.p0),n[0]=i,n[1]=t.p0;var s=this.closestPoint(t.p1);o=s.distance(t.p1),r>o&&(r=o,n[0]=s,n[1]=t.p1);var a=t.closestPoint(this.p0);o=a.distance(this.p0),r>o&&(r=o,n[0]=this.p0,n[1]=a);var u=t.closestPoint(this.p1);return o=u.distance(this.p1),r>o&&(r=o,n[0]=this.p1,n[1]=u),n},jsts.geom.LineSegment.prototype.intersection=function(t){var e=new jsts.algorithm.RobustLineIntersector;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},jsts.geom.LineSegment.prototype.setCoordinates=function(t){return t instanceof jsts.geom.Coordinate?void this.setCoordinates2.apply(this,arguments):void this.setCoordinates2(t.p0,t.p1)},jsts.geom.LineSegment.prototype.setCoordinates2=function(t,e){this.p0.x=t.x,this.p0.y=t.y,this.p1.x=e.x,this.p1.y=e.y},jsts.geom.LineSegment.prototype.distancePerpendicular=function(t){return jsts.algorithm.CGAlgorithms.distancePointLinePerpendicular(t,this.p0,this.p1)},jsts.geom.LineSegment.prototype.lineIntersection=function(t){try{var e=jsts.algorithm.HCoordinate.intersection(this.p0,this.p1,t.p0,t.p1);return e}catch(o){}return null},jsts.geom.LineSegment.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},jsts.geom.LineSegment.prototype.equals=function(t){return t instanceof jsts.geom.LineSegment?this.p0.equals(t.p0)&&this.p1.equals(t.p1):!1},jsts.geom.LineSegment.prototype.compareTo=function(t){var e=this.p0.compareTo(t.p0);return 0!==e?e:this.p1.compareTo(t.p1)},jsts.geom.LineSegment.prototype.equalsTopo=function(t){return this.p0.equals(t.p0)&&this.p1.equals(t.p1)||this.p0.equals(t.p1)&&this.p1.equals(t.p0)},jsts.geom.LineSegment.prototype.toString=function(){return"LINESTRING("+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},jsts.index.chain.MonotoneChainOverlapAction=function(){this.tempEnv1=new jsts.geom.Envelope,this.tempEnv2=new jsts.geom.Envelope,this.overlapSeg1=new jsts.geom.LineSegment,this.overlapSeg2=new jsts.geom.LineSegment},jsts.index.chain.MonotoneChainOverlapAction.prototype.tempEnv1=null,jsts.index.chain.MonotoneChainOverlapAction.prototype.tempEnv2=null,jsts.index.chain.MonotoneChainOverlapAction.prototype.overlapSeg1=null,jsts.index.chain.MonotoneChainOverlapAction.prototype.overlapSeg2=null,jsts.index.chain.MonotoneChainOverlapAction.prototype.overlap=function(t,e,o,n){this.mc1.getLineSegment(e,this.overlapSeg1),this.mc2.getLineSegment(n,this.overlapSeg2),this.overlap2(this.overlapSeg1,this.overlapSeg2)},jsts.index.chain.MonotoneChainOverlapAction.prototype.overlap2=function(){},function(){var t=jsts.index.chain.MonotoneChainOverlapAction,e=jsts.noding.SinglePassNoder,o=jsts.index.strtree.STRtree,n=jsts.noding.NodedSegmentString,r=jsts.index.chain.MonotoneChainBuilder,i=function(t){this.si=t};i.prototype=new t,i.constructor=i,i.prototype.si=null,i.prototype.overlap=function(t,e,o,n){var r=t.getContext(),i=o.getContext();this.si.processIntersections(r,e,i,n)},jsts.noding.MCIndexNoder=function(){this.monoChains=[],this.index=new o},jsts.noding.MCIndexNoder.prototype=new e,jsts.noding.MCIndexNoder.constructor=jsts.noding.MCIndexNoder,jsts.noding.MCIndexNoder.prototype.monoChains=null,jsts.noding.MCIndexNoder.prototype.index=null,jsts.noding.MCIndexNoder.prototype.idCounter=0,jsts.noding.MCIndexNoder.prototype.nodedSegStrings=null,jsts.noding.MCIndexNoder.prototype.nOverlaps=0,jsts.noding.MCIndexNoder.prototype.getMonotoneChains=function(){return this.monoChains},jsts.noding.MCIndexNoder.prototype.getIndex=function(){return this.index},jsts.noding.MCIndexNoder.prototype.getNodedSubstrings=function(){return n.getNodedSubstrings(this.nodedSegStrings)},jsts.noding.MCIndexNoder.prototype.computeNodes=function(t){this.nodedSegStrings=t;for(var e=t.iterator();e.hasNext();)this.add(e.next());this.intersectChains()},jsts.noding.MCIndexNoder.prototype.intersectChains=function(){for(var t=new i(this.segInt),e=0;e<this.monoChains.length;e++)for(var o=this.monoChains[e],n=this.index.query(o.getEnvelope()),r=0;r<n.length;r++){var s=n[r];if(s.getId()>o.getId()&&(o.computeOverlaps(s,t),this.nOverlaps++),this.segInt.isDone())return}},jsts.noding.MCIndexNoder.prototype.add=function(t){for(var e=r.getChains(t.getCoordinates(),t),o=0;o<e.length;o++){var n=e[o];n.setId(this.idCounter++),this.index.insert(n.getEnvelope(),n),this.monoChains.push(n)}}}(),jsts.simplify.LineSegmentIndex=function(){this.index=new jsts.index.quadtree.Quadtree},jsts.simplify.LineSegmentIndex.prototype.index=null,jsts.simplify.LineSegmentIndex.prototype.add=function(t){if(t instanceof jsts.geom.LineSegment)return void this.add2(t);for(var e=t.getSegments(),o=0;o<e.length;o++){var n=e[o];this.add2(n)}},jsts.simplify.LineSegmentIndex.prototype.add2=function(t){this.index.insert(new jsts.geom.Envelope(t.p0,t.p1),t)},jsts.simplify.LineSegmentIndex.prototype.remove=function(t){this.index.remove(new jsts.geom.Envelope(t.p0,t.p1),t)},jsts.simplify.LineSegmentIndex.prototype.query=function(t){var e=new jsts.geom.Envelope(t.p0,t.p1),o=new jsts.simplify.LineSegmentIndex.LineSegmentVisitor(t);this.index.query(e,o);var n=o.getItems();return n},jsts.simplify.LineSegmentIndex.LineSegmentVisitor=function(t){this.items=[],this.querySeg=t},jsts.simplify.LineSegmentIndex.LineSegmentVisitor.prototype=new jsts.index.ItemVisitor,jsts.simplify.LineSegmentIndex.LineSegmentVisitor.prototype.querySeg=null,jsts.simplify.LineSegmentIndex.LineSegmentVisitor.prototype.items=null,jsts.simplify.LineSegmentIndex.LineSegmentVisitor.prototype.visitItem=function(t){var e=t;jsts.geom.Envelope.intersects(e.p0,e.p1,this.querySeg.p0,this.querySeg.p1)&&this.items.push(t)},jsts.simplify.LineSegmentIndex.LineSegmentVisitor.prototype.getItems=function(){return this.items},jsts.geomgraph.EdgeEndStar=function(){this.edgeMap=new javascript.util.TreeMap,this.edgeList=null,this.ptInAreaLocation=[jsts.geom.Location.NONE,jsts.geom.Location.NONE]},jsts.geomgraph.EdgeEndStar.prototype.edgeMap=null,jsts.geomgraph.EdgeEndStar.prototype.edgeList=null,jsts.geomgraph.EdgeEndStar.prototype.ptInAreaLocation=null,jsts.geomgraph.EdgeEndStar.prototype.insert=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geomgraph.EdgeEndStar.prototype.insertEdgeEnd=function(t,e){this.edgeMap.put(t,e),this.edgeList=null},jsts.geomgraph.EdgeEndStar.prototype.getCoordinate=function(){var t=this.iterator();if(!t.hasNext())return null;var e=t.next();return e.getCoordinate()},jsts.geomgraph.EdgeEndStar.prototype.getDegree=function(){return this.edgeMap.size()},jsts.geomgraph.EdgeEndStar.prototype.iterator=function(){return this.getEdges().iterator()},jsts.geomgraph.EdgeEndStar.prototype.getEdges=function(){return null===this.edgeList&&(this.edgeList=new javascript.util.ArrayList(this.edgeMap.values())),this.edgeList},jsts.geomgraph.EdgeEndStar.prototype.getNextCW=function(t){this.getEdges();var e=this.edgeList.indexOf(t),o=e-1;return 0===e&&(o=this.edgeList.length-1),this.edgeList[o]},jsts.geomgraph.EdgeEndStar.prototype.computeLabelling=function(t){this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var e=[!1,!1],o=this.iterator();o.hasNext();)for(var n=o.next(),r=n.getLabel(),i=0;2>i;i++)r.isLine(i)&&r.getLocation(i)===jsts.geom.Location.BOUNDARY&&(e[i]=!0);for(var o=this.iterator();o.hasNext();)for(var n=o.next(),r=n.getLabel(),i=0;2>i;i++)if(r.isAnyNull(i)){var s=jsts.geom.Location.NONE;if(e[i])s=jsts.geom.Location.EXTERIOR;else{var a=n.getCoordinate();s=this.getLocation(i,a,t)}r.setAllLocationsIfNull(i,s)}},jsts.geomgraph.EdgeEndStar.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();){var o=e.next();o.computeLabel(t)}},jsts.geomgraph.EdgeEndStar.prototype.getLocation=function(t,e,o){return this.ptInAreaLocation[t]===jsts.geom.Location.NONE&&(this.ptInAreaLocation[t]=jsts.algorithm.locate.SimplePointInAreaLocator.locate(e,o[t].getGeometry())),this.ptInAreaLocation[t]},jsts.geomgraph.EdgeEndStar.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},jsts.geomgraph.EdgeEndStar.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var o=e.size()-1,n=e.get(o).getLabel(),r=n.getLocation(t,jsts.geomgraph.Position.LEFT);jsts.util.Assert.isTrue(r!=jsts.geom.Location.NONE,"Found unlabelled area edge");for(var i=r,s=this.iterator();s.hasNext();){var a=s.next(),u=a.getLabel();jsts.util.Assert.isTrue(u.isArea(t),"Found non-area edge");var p=u.getLocation(t,jsts.geomgraph.Position.LEFT),g=u.getLocation(t,jsts.geomgraph.Position.RIGHT);if(p===g)return!1;if(g!==i)return!1;i=p}return!0},jsts.geomgraph.EdgeEndStar.prototype.propagateSideLabels=function(t){for(var e=jsts.geom.Location.NONE,o=this.iterator();o.hasNext();){var n=o.next(),r=n.getLabel();r.isArea(t)&&r.getLocation(t,jsts.geomgraph.Position.LEFT)!==jsts.geom.Location.NONE&&(e=r.getLocation(t,jsts.geomgraph.Position.LEFT))}if(e!==jsts.geom.Location.NONE)for(var i=e,o=this.iterator();o.hasNext();){var n=o.next(),r=n.getLabel();if(r.getLocation(t,jsts.geomgraph.Position.ON)===jsts.geom.Location.NONE&&r.setLocation(t,jsts.geomgraph.Position.ON,i),r.isArea(t)){var s=r.getLocation(t,jsts.geomgraph.Position.LEFT),a=r.getLocation(t,jsts.geomgraph.Position.RIGHT);if(a!==jsts.geom.Location.NONE){if(a!==i)throw new jsts.error.TopologyError("side location conflict",n.getCoordinate());s===jsts.geom.Location.NONE&&jsts.util.Assert.shouldNeverReachHere("found single null side (at "+n.getCoordinate()+")"),i=s}else jsts.util.Assert.isTrue(r.getLocation(t,jsts.geomgraph.Position.LEFT)===jsts.geom.Location.NONE,"found single null side"),r.setLocation(t,jsts.geomgraph.Position.RIGHT,i),r.setLocation(t,jsts.geomgraph.Position.LEFT,i)}}},jsts.geomgraph.EdgeEndStar.prototype.findIndex=function(t){this.iterator();for(var e=0;e<this.edgeList.size();e++){var o=this.edgeList.get(e);if(o===t)return e}return-1},jsts.operation.relate.EdgeEndBundleStar=function(){jsts.geomgraph.EdgeEndStar.apply(this,arguments)},jsts.operation.relate.EdgeEndBundleStar.prototype=new jsts.geomgraph.EdgeEndStar,jsts.operation.relate.EdgeEndBundleStar.prototype.insert=function(t){var e=this.edgeMap.get(t);null===e?(e=new jsts.operation.relate.EdgeEndBundle(t),this.insertEdgeEnd(t,e)):e.insert(t)},jsts.operation.relate.EdgeEndBundleStar.prototype.updateIM=function(t){for(var e=this.iterator();e.hasNext();){var o=e.next();o.updateIM(t)}},jsts.index.ArrayListVisitor=function(){this.items=[]},jsts.index.ArrayListVisitor.prototype.visitItem=function(t){this.items.push(t)},jsts.index.ArrayListVisitor.prototype.getItems=function(){return this.items},jsts.algorithm.distance.DistanceToPoint=function(){},jsts.algorithm.distance.DistanceToPoint.computeDistance=function(t,e,o){if(t instanceof jsts.geom.LineString)jsts.algorithm.distance.DistanceToPoint.computeDistance2(t,e,o);else if(t instanceof jsts.geom.Polygon)jsts.algorithm.distance.DistanceToPoint.computeDistance4(t,e,o);else if(t instanceof jsts.geom.GeometryCollection)for(var n=t,r=0;r<n.getNumGeometries();r++){var i=n.getGeometryN(r);jsts.algorithm.distance.DistanceToPoint.computeDistance(i,e,o)}else o.setMinimum(t.getCoordinate(),e)},jsts.algorithm.distance.DistanceToPoint.computeDistance2=function(t,e,o){for(var n=new jsts.geom.LineSegment,r=t.getCoordinates(),i=0;i<r.length-1;i++){n.setCoordinates(r[i],r[i+1]);var s=n.closestPoint(e);o.setMinimum(s,e)}},jsts.algorithm.distance.DistanceToPoint.computeDistance3=function(t,e,o){var n=t.closestPoint(e);o.setMinimum(n,e)},jsts.algorithm.distance.DistanceToPoint.computeDistance4=function(t,e,o){jsts.algorithm.distance.DistanceToPoint.computeDistance2(t.getExteriorRing(),e,o);for(var n=0;n<t.getNumInteriorRing();n++)jsts.algorithm.distance.DistanceToPoint.computeDistance2(t.getInteriorRingN(n),e,o)},jsts.index.strtree.ItemBoundable=function(t,e){this.bounds=t,this.item=e},jsts.index.strtree.ItemBoundable.prototype=new jsts.index.strtree.Boundable,jsts.index.strtree.ItemBoundable.constructor=jsts.index.strtree.ItemBoundable,jsts.index.strtree.ItemBoundable.prototype.bounds=null,jsts.index.strtree.ItemBoundable.prototype.item=null,jsts.index.strtree.ItemBoundable.prototype.getBounds=function(){return this.bounds},jsts.index.strtree.ItemBoundable.prototype.getItem=function(){return this.item},function(){var t=javascript.util.ArrayList,e=javascript.util.TreeMap;jsts.geomgraph.EdgeList=function(){this.edges=new t,this.ocaMap=new e},jsts.geomgraph.EdgeList.prototype.edges=null,jsts.geomgraph.EdgeList.prototype.ocaMap=null,jsts.geomgraph.EdgeList.prototype.add=function(t){this.edges.add(t);var e=new jsts.noding.OrientedCoordinateArray(t.getCoordinates());this.ocaMap.put(e,t)},jsts.geomgraph.EdgeList.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},jsts.geomgraph.EdgeList.prototype.getEdges=function(){return this.edges},jsts.geomgraph.EdgeList.prototype.findEqualEdge=function(t){var e=new jsts.noding.OrientedCoordinateArray(t.getCoordinates()),o=this.ocaMap.get(e);return o},jsts.geomgraph.EdgeList.prototype.getEdges=function(){return this.edges},jsts.geomgraph.EdgeList.prototype.iterator=function(){return this.edges.iterator()},jsts.geomgraph.EdgeList.prototype.get=function(t){return this.edges.get(t)},jsts.geomgraph.EdgeList.prototype.findEdgeIndex=function(t){for(var e=0;e<this.edges.size();e++)if(this.edges.get(e).equals(t))return e;return-1}}(),jsts.operation.IsSimpleOp=function(t){this.geom=t},jsts.operation.IsSimpleOp.prototype.geom=null,jsts.operation.IsSimpleOp.prototype.isClosedEndpointsInInterior=!0,jsts.operation.IsSimpleOp.prototype.nonSimpleLocation=null,jsts.operation.IsSimpleOp.prototype.IsSimpleOp=function(t){this.geom=t},jsts.operation.IsSimpleOp.prototype.isSimple=function(){return this.nonSimpleLocation=null,this.geom instanceof jsts.geom.LineString?this.isSimpleLinearGeometry(this.geom):this.geom instanceof jsts.geom.MultiLineString?this.isSimpleLinearGeometry(this.geom):this.geom instanceof jsts.geom.MultiPoint?this.isSimpleMultiPoint(this.geom):!0},jsts.operation.IsSimpleOp.prototype.isSimpleMultiPoint=function(t){if(t.isEmpty())return!0;for(var e=[],o=0;o<t.getNumGeometries();o++){for(var n=t.getGeometryN(o),r=n.getCoordinate(),i=0;i<e.length;i++){var s=e[i];if(r.equals2D(s))return this.nonSimpleLocation=r,!1}e.push(r)}return!0},jsts.operation.IsSimpleOp.prototype.isSimpleLinearGeometry=function(t){if(t.isEmpty())return!0;var e=new jsts.geomgraph.GeometryGraph(0,t),o=new jsts.algorithm.RobustLineIntersector,n=e.computeSelfNodes(o,!0);return n.hasIntersection()?n.hasProperIntersection()?(this.nonSimpleLocation=n.getProperIntersectionPoint(),!1):this.hasNonEndpointIntersection(e)?!1:this.isClosedEndpointsInInterior&&this.hasClosedEndpointIntersection(e)?!1:!0:!0},jsts.operation.IsSimpleOp.prototype.hasNonEndpointIntersection=function(t){for(var e=t.getEdgeIterator();e.hasNext();)for(var o=e.next(),n=o.getMaximumSegmentIndex(),r=o.getEdgeIntersectionList().iterator();r.hasNext();){var i=r.next();if(!i.isEndPoint(n))return this.nonSimpleLocation=i.getCoordinate(),!0}return!1},jsts.operation.IsSimpleOp.prototype.hasClosedEndpointIntersection=function(t){for(var e=new javascript.util.TreeMap,o=t.getEdgeIterator();o.hasNext();){var n=o.next(),r=(n.getMaximumSegmentIndex(),n.isClosed()),i=n.getCoordinate(0);this.addEndpoint(e,i,r);var s=n.getCoordinate(n.getNumPoints()-1);this.addEndpoint(e,s,r)}for(var o=e.values().iterator();o.hasNext();){var a=o.next();if(a.isClosed&&2!=a.degree)return this.nonSimpleLocation=a.getCoordinate(),!0}return!1},jsts.operation.IsSimpleOp.EndpointInfo=function(t){this.pt=t,this.isClosed=!1,this.degree=0},jsts.operation.IsSimpleOp.EndpointInfo.prototype.pt=null,jsts.operation.IsSimpleOp.EndpointInfo.prototype.isClosed=null,jsts.operation.IsSimpleOp.EndpointInfo.prototype.degree=null,jsts.operation.IsSimpleOp.EndpointInfo.prototype.getCoordinate=function(){return this.pt},jsts.operation.IsSimpleOp.EndpointInfo.prototype.addEndpoint=function(t){this.degree++,this.isClosed=this.isClosed||t},jsts.operation.IsSimpleOp.prototype.addEndpoint=function(t,e,o){var n=t.get(e);null===n&&(n=new jsts.operation.IsSimpleOp.EndpointInfo(e),t.put(e,n)),n.addEndpoint(o)},function(){var t=function(){this.snapTolerance=0,this.seg=new jsts.geom.LineSegment,this.allowSnappingToSourceVertices=!1,this.isClosed=!1,this.srcPts=[],arguments[0]instanceof jsts.geom.LineString?this.initFromLine.apply(this,arguments):this.initFromPoints.apply(this,arguments)};t.prototype.initFromLine=function(t,e){this.initFromPoints(t.getCoordinates(),e)},t.prototype.initFromPoints=function(t,e){this.srcPts=t,this.isClosed=this.calcIsClosed(t),this.snapTolerance=e},t.prototype.setAllowSnappingToSourceVertices=function(t){this.allowSnappingToSourceVertices=t},t.prototype.calcIsClosed=function(t){return t.length<=1?!1:t[0].equals(t[t.length-1])
},t.prototype.snapTo=function(t){var e=new jsts.geom.CoordinateList(this.srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},t.prototype.snapVertices=function(t,e){var o,n,r=this.isClosed?t.size()-1:t.size(),i=0;for(i;r>i;i++)o=t.get(i),n=this.findSnapForVertex(o,e),null!==n&&(t.set(i,new jsts.geom.Coordinate(n)),0===i&&this.isClosed&&t.set(t.size()-1,new jsts.geom.Coordinate(n)))},t.prototype.findSnapForVertex=function(t,e){var o=0,n=e.length;for(o=0;n>o;o++){if(t.equals(e[o]))return null;if(t.distance(e[o])<this.snapTolerance)return e[o]}return null},t.prototype.snapSegments=function(t,e){if(0!==e.length){var o,n,r,i=e.length;for(e.length>1&&e[0].equals2D(e[e.length-1])&&(i=e.length-1),o=0;i>o;o++)n=e[o],r=this.findSegmentIndexToSnap(n,t),r>=0&&t.add(r+1,new jsts.geom.Coordinate(n),!1)}},t.prototype.findSegmentIndexToSnap=function(t,e){var o,n=Number.MAX_VALUE,r=-1,i=0;for(i;i<e.size()-1;i++){if(this.seg.p0=e.get(i),this.seg.p1=e.get(i+1),this.seg.p0.equals(t)||this.seg.p1.equals(t)){if(this.allowSnappingToSourceVertices)continue;return-1}o=this.seg.distance(t),o<this.snapTolerance&&n>o&&(n=o,r=i)}return r},jsts.operation.overlay.snap.LineStringSnapper=t}(),function(){var t=javascript.util.ArrayList,e=jsts.geom.GeometryComponentFilter,o=jsts.geom.LineString,n=jsts.operation.polygonize.EdgeRing,r=jsts.operation.polygonize.PolygonizeGraph,i=function(){var n=this,r=function(){};r.prototype=new e,r.prototype.filter=function(t){t instanceof o&&n.add(t)},this.lineStringAdder=new r,this.dangles=new t,this.cutEdges=new t,this.invalidRingLines=new t};i.prototype.lineStringAdder=null,i.prototype.graph=null,i.prototype.dangles=null,i.prototype.cutEdges=null,i.prototype.invalidRingLines=null,i.prototype.holeList=null,i.prototype.shellList=null,i.prototype.polyList=null,i.prototype.add=function(t){if(t instanceof jsts.geom.LineString)return this.add3(t);if(t instanceof jsts.geom.Geometry)return this.add2(t);for(var e=t.iterator();e.hasNext();){var o=e.next();this.add2(o)}},i.prototype.add2=function(t){t.apply(this.lineStringAdder)},i.prototype.add3=function(t){null==this.graph&&(this.graph=new r(t.getFactory())),this.graph.addEdge(t)},i.prototype.getPolygons=function(){return this.polygonize(),this.polyList},i.prototype.getDangles=function(){return this.polygonize(),this.dangles},i.prototype.getCutEdges=function(){return this.polygonize(),this.cutEdges},i.prototype.getInvalidRingLines=function(){return this.polygonize(),this.invalidRingLines},i.prototype.polygonize=function(){if(null==this.polyList&&(this.polyList=new t,null!=this.graph)){this.dangles=this.graph.deleteDangles(),this.cutEdges=this.graph.deleteCutEdges();var e=this.graph.getEdgeRings(),o=new t;this.invalidRingLines=new t,this.findValidRings(e,o,this.invalidRingLines),this.findShellsAndHoles(o),i.assignHolesToShells(this.holeList,this.shellList),this.polyList=new t;for(var n=this.shellList.iterator();n.hasNext();){var r=n.next();this.polyList.add(r.getPolygon())}}},i.prototype.findValidRings=function(t,e,o){for(var n=t.iterator();n.hasNext();){var r=n.next();r.isValid()?e.add(r):o.add(r.getLineString())}},i.prototype.findShellsAndHoles=function(e){this.holeList=new t,this.shellList=new t;for(var o=e.iterator();o.hasNext();){var n=o.next();n.isHole()?this.holeList.add(n):this.shellList.add(n)}},i.assignHolesToShells=function(t,e){for(var o=t.iterator();o.hasNext();){var n=o.next();i.assignHoleToShell(n,e)}},i.assignHoleToShell=function(t,e){var o=n.findEdgeRingContaining(t,e);null!=o&&o.addHole(t.getRing())},jsts.operation.polygonize.Polygonizer=i}(),function(){var t=javascript.util.ArrayList,e=function(){};e.prototype.inputGeom=null,e.prototype.factory=null,e.prototype.pruneEmptyGeometry=!0,e.prototype.preserveGeometryCollectionType=!0,e.prototype.preserveCollections=!1,e.prototype.reserveType=!1,e.prototype.getInputGeometry=function(){return this.inputGeom},e.prototype.transform=function(t){if(this.inputGeom=t,this.factory=t.getFactory(),t instanceof jsts.geom.Point)return this.transformPoint(t,null);if(t instanceof jsts.geom.MultiPoint)return this.transformMultiPoint(t,null);if(t instanceof jsts.geom.LinearRing)return this.transformLinearRing(t,null);if(t instanceof jsts.geom.LineString)return this.transformLineString(t,null);if(t instanceof jsts.geom.MultiLineString)return this.transformMultiLineString(t,null);if(t instanceof jsts.geom.Polygon)return this.transformPolygon(t,null);if(t instanceof jsts.geom.MultiPolygon)return this.transformMultiPolygon(t,null);if(t instanceof jsts.geom.GeometryCollection)return this.transformGeometryCollection(t,null);throw new jsts.error.IllegalArgumentException("Unknown Geometry subtype: "+t.getClass().getName())},e.prototype.createCoordinateSequence=function(t){return this.factory.getCoordinateSequenceFactory().create(t)},e.prototype.copy=function(t){return t.clone()},e.prototype.transformCoordinates=function(t){return this.copy(t)},e.prototype.transformPoint=function(t){return this.factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},e.prototype.transformMultiPoint=function(e){for(var o=new t,n=0;n<e.getNumGeometries();n++){var r=this.transformPoint(e.getGeometryN(n),e);null!=r&&(r.isEmpty()||o.add(r))}return this.factory.buildGeometry(o)},e.prototype.transformLinearRing=function(t){var e=this.transformCoordinates(t.getCoordinateSequence(),t),o=e.length;return o>0&&4>o&&!this.preserveType?this.factory.createLineString(e):this.factory.createLinearRing(e)},e.prototype.transformLineString=function(t){return this.factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},e.prototype.transformMultiLineString=function(e){for(var o=new t,n=0;n<e.getNumGeometries();n++){var r=this.transformLineString(e.getGeometryN(n),e);null!=r&&(r.isEmpty()||o.add(r))}return this.factory.buildGeometry(o)},e.prototype.transformPolygon=function(e){var o=!0,n=this.transformLinearRing(e.getExteriorRing(),e);null!=n&&n instanceof jsts.geom.LinearRing&&!n.isEmpty()||(o=!1);for(var r=new t,i=0;i<e.getNumInteriorRing();i++){var s=this.transformLinearRing(e.getInteriorRingN(i),e);null==s||s.isEmpty()||(s instanceof jsts.geom.LinearRing||(o=!1),r.add(s))}if(o)return this.factory.createPolygon(n,r.toArray());var a=new t;return null!=n&&a.add(n),a.addAll(r),this.factory.buildGeometry(a)},e.prototype.transformMultiPolygon=function(e){for(var o=new t,n=0;n<e.getNumGeometries();n++){var r=this.transformPolygon(e.getGeometryN(n),e);null!=r&&(r.isEmpty()||o.add(r))}return this.factory.buildGeometry(o)},e.prototype.transformGeometryCollection=function(e){for(var o=new t,n=0;n<e.getNumGeometries();n++){var r=this.transform(e.getGeometryN(n));null!=r&&(this.pruneEmptyGeometry&&r.isEmpty()||o.add(r))}return this.preserveGeometryCollectionType?this.factory.createGeometryCollection(GeometryFactory.toGeometryArray(o)):this.factory.buildGeometry(o)},jsts.geom.util.GeometryTransformer=e}(),function(){var t=jsts.operation.overlay.snap.LineStringSnapper,e=jsts.geom.PrecisionModel,o=javascript.util.TreeSet,n=function(t,e,o){this.snapTolerance=t,this.snapPts=e,this.isSelfSnap=o||!1};n.prototype=new jsts.geom.util.GeometryTransformer,n.prototype.snapTolerance=null,n.prototype.snapPts=null,n.prototype.isSelfSnap=!1,n.prototype.transformCoordinates=function(t){var e=t,o=this.snapLine(e,this.snapPts);return o},n.prototype.snapLine=function(e,o){var n=new t(e,this.snapTolerance);return n.setAllowSnappingToSourceVertices(this.isSelfSnap),n.snapTo(o)};var r=function(t){this.srcGeom=t};r.SNAP_PRECISION_FACTOR=1e-9,r.computeOverlaySnapTolerance=function(t){if(2===arguments.length)return r.computeOverlaySnapTolerance2.apply(this,arguments);var o=this.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()==e.FIXED){var i=1/n.getScale()*2/1.415;i>o&&(o=i)}return o},r.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),o=Math.min(e.getHeight(),e.getWidth()),n=o*r.SNAP_PRECISION_FACTOR;return n},r.computeOverlaySnapTolerance2=function(t,e){return Math.min(this.computeOverlaySnapTolerance(t),this.computeOverlaySnapTolerance(e))},r.snap=function(t,e,o){var n=[],i=new r(t);n[0]=i.snapTo(e,o);var s=new r(e);return n[1]=s.snapTo(n[0],o),n},r.snapToSelf=function(t,e,o){var n=new r(t);return n.snapToSelf(e,o)},r.prototype.srcGeom=null,r.prototype.snapTo=function(t,e){var o=this.extractTargetCoordinates(t),r=new n(e,o);return r.transform(this.srcGeom)},r.prototype.snapToSelf=function(t,e){var o=this.extractTargetCoordinates(srcGeom),r=new n(t,o,!0),i=r.transform(srcGeom),s=i;return e&&s instanceof Polygonal&&(s=i.buffer(0)),s},r.prototype.extractTargetCoordinates=function(t){for(var e=new o,n=t.getCoordinates(),r=0;r<n.length;r++)e.add(n[r]);return e.toArray()},r.prototype.computeSnapTolerance=function(t){var e=this.computeMinimumSegmentLength(t),o=e/10;return o},r.prototype.computeMinimumSegmentLength=function(t){for(var e=Number.MAX_VALUE,o=0;o<t.length-1;o++){var n=t[o].distance(t[o+1]);e>n&&(e=n)}return e},jsts.operation.overlay.snap.GeometrySnapper=r}(),jsts.algorithm.PointLocator=function(t){this.boundaryRule=t?t:jsts.algorithm.BoundaryNodeRule.OGC_SFS_BOUNDARY_RULE},jsts.algorithm.PointLocator.prototype.boundaryRule=null,jsts.algorithm.PointLocator.prototype.isIn=null,jsts.algorithm.PointLocator.prototype.numBoundaries=null,jsts.algorithm.PointLocator.prototype.intersects=function(t,e){return this.locate(t,e)!==jsts.geom.Location.EXTERIOR},jsts.algorithm.PointLocator.prototype.locate=function(t,e){return e.isEmpty()?jsts.geom.Location.EXTERIOR:e instanceof jsts.geom.Point?this.locate2(t,e):e instanceof jsts.geom.LineString?this.locate3(t,e):e instanceof jsts.geom.Polygon?this.locate4(t,e):(this.isIn=!1,this.numBoundaries=0,this.computeLocation(t,e),this.boundaryRule.isInBoundary(this.numBoundaries)?jsts.geom.Location.BOUNDARY:this.numBoundaries>0||this.isIn?jsts.geom.Location.INTERIOR:jsts.geom.Location.EXTERIOR)},jsts.algorithm.PointLocator.prototype.computeLocation=function(t,e){if(e instanceof jsts.geom.Point||e instanceof jsts.geom.LineString||e instanceof jsts.geom.Polygon)this.updateLocationInfo(this.locate(t,e));else if(e instanceof jsts.geom.MultiLineString)for(var o=e,n=0;n<o.getNumGeometries();n++){var r=o.getGeometryN(n);this.updateLocationInfo(this.locate(t,r))}else if(e instanceof jsts.geom.MultiPolygon)for(var i=e,n=0;n<i.getNumGeometries();n++){var s=i.getGeometryN(n);this.updateLocationInfo(this.locate(t,s))}else if(e instanceof jsts.geom.MultiPoint||e instanceof jsts.geom.GeometryCollection)for(var n=0;n<e.getNumGeometries();n++){var a=e.getGeometryN(n);a!==e&&this.computeLocation(t,a)}},jsts.algorithm.PointLocator.prototype.updateLocationInfo=function(t){t===jsts.geom.Location.INTERIOR&&(this.isIn=!0),t===jsts.geom.Location.BOUNDARY&&this.numBoundaries++},jsts.algorithm.PointLocator.prototype.locate2=function(t,e){var o=e.getCoordinate();return o.equals2D(t)?jsts.geom.Location.INTERIOR:jsts.geom.Location.EXTERIOR},jsts.algorithm.PointLocator.prototype.locate3=function(t,e){if(!e.getEnvelopeInternal().intersects(t))return jsts.geom.Location.EXTERIOR;var o=e.getCoordinates();return e.isClosed()||!t.equals(o[0])&&!t.equals(o[o.length-1])?jsts.algorithm.CGAlgorithms.isOnLine(t,o)?jsts.geom.Location.INTERIOR:jsts.geom.Location.EXTERIOR:jsts.geom.Location.BOUNDARY},jsts.algorithm.PointLocator.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?jsts.algorithm.CGAlgorithms.locatePointInRing(t,e.getCoordinates()):jsts.geom.Location.EXTERIOR},jsts.algorithm.PointLocator.prototype.locate4=function(t,e){if(e.isEmpty())return jsts.geom.Location.EXTERIOR;var o=e.getExteriorRing(),n=this.locateInPolygonRing(t,o);if(n===jsts.geom.Location.EXTERIOR)return jsts.geom.Location.EXTERIOR;if(n===jsts.geom.Location.BOUNDARY)return jsts.geom.Location.BOUNDARY;for(var r=0;r<e.getNumInteriorRing();r++){var i=e.getInteriorRingN(r),s=this.locateInPolygonRing(t,i);if(s===jsts.geom.Location.INTERIOR)return jsts.geom.Location.EXTERIOR;if(s===jsts.geom.Location.BOUNDARY)return jsts.geom.Location.BOUNDARY}return jsts.geom.Location.INTERIOR},function(){var t=jsts.geom.Location,e=javascript.util.ArrayList,o=javascript.util.TreeMap;jsts.geomgraph.NodeMap=function(t){this.nodeMap=new o,this.nodeFact=t},jsts.geomgraph.NodeMap.prototype.nodeMap=null,jsts.geomgraph.NodeMap.prototype.nodeFact=null,jsts.geomgraph.NodeMap.prototype.addNode=function(t){var e,o;if(t instanceof jsts.geom.Coordinate)return o=t,e=this.nodeMap.get(o),null===e&&(e=this.nodeFact.createNode(o),this.nodeMap.put(o,e)),e;if(t instanceof jsts.geomgraph.Node){var n=t;return o=n.getCoordinate(),e=this.nodeMap.get(o),null===e?(this.nodeMap.put(o,n),n):(e.mergeLabel(n),e)}},jsts.geomgraph.NodeMap.prototype.add=function(t){var e=t.getCoordinate(),o=this.addNode(e);o.add(t)},jsts.geomgraph.NodeMap.prototype.find=function(t){return this.nodeMap.get(t)},jsts.geomgraph.NodeMap.prototype.values=function(){return this.nodeMap.values()},jsts.geomgraph.NodeMap.prototype.iterator=function(){return this.values().iterator()},jsts.geomgraph.NodeMap.prototype.getBoundaryNodes=function(o){for(var n=new e,r=this.iterator();r.hasNext();){var i=r.next();i.getLabel().getLocation(o)===t.BOUNDARY&&n.add(i)}return n}}(),function(){var t=javascript.util.ArrayList;jsts.geomgraph.PlanarGraph=function(e){this.edges=new t,this.edgeEndList=new t,this.nodes=new jsts.geomgraph.NodeMap(e||new jsts.geomgraph.NodeFactory)},jsts.geomgraph.PlanarGraph.prototype.edges=null,jsts.geomgraph.PlanarGraph.prototype.nodes=null,jsts.geomgraph.PlanarGraph.prototype.edgeEndList=null,jsts.geomgraph.PlanarGraph.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();){var o=e.next();o.getEdges().linkResultDirectedEdges()}},jsts.geomgraph.PlanarGraph.prototype.getEdgeIterator=function(){return this.edges.iterator()},jsts.geomgraph.PlanarGraph.prototype.getEdgeEnds=function(){return this.edgeEndList},jsts.geomgraph.PlanarGraph.prototype.isBoundaryNode=function(t,e){var o=this.nodes.find(e);if(null===o)return!1;var n=o.getLabel();return null!==n&&n.getLocation(t)===jsts.geom.Location.BOUNDARY?!0:!1},jsts.geomgraph.PlanarGraph.prototype.insertEdge=function(t){this.edges.add(t)},jsts.geomgraph.PlanarGraph.prototype.add=function(t){this.nodes.add(t),this.edgeEndList.add(t)},jsts.geomgraph.PlanarGraph.prototype.getNodeIterator=function(){return this.nodes.iterator()},jsts.geomgraph.PlanarGraph.prototype.getNodes=function(){return this.nodes.values()},jsts.geomgraph.PlanarGraph.prototype.addNode=function(t){return this.nodes.addNode(t)},jsts.geomgraph.PlanarGraph.prototype.addEdges=function(t){for(var e=t.iterator();e.hasNext();){var o=e.next();this.edges.add(o);var n=new jsts.geomgraph.DirectedEdge(o,!0),r=new jsts.geomgraph.DirectedEdge(o,!1);n.setSym(r),r.setSym(n),this.add(n),this.add(r)}},jsts.geomgraph.PlanarGraph.prototype.linkResultDirectedEdges=function(){for(var t=this.nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkResultDirectedEdges()}},jsts.geomgraph.PlanarGraph.prototype.findEdgeInSameDirection=function(t,e){var o,n,r=0,i=this.edges.size();for(r;i>r;r++){if(o=this.edges.get(r),n=o.getCoordinates(),this.matchInSameDirection(t,e,n[0],n[1]))return o;if(this.matchInSameDirection(t,e,n[n.length-1],n[n.length-2]))return o}return null},jsts.geomgraph.PlanarGraph.prototype.matchInSameDirection=function(t,e,o,n){return t.equals(o)&&jsts.algorithm.CGAlgorithms.computeOrientation(t,e,n)===jsts.algorithm.CGAlgorithms.COLLINEAR&&jsts.geomgraph.Quadrant.quadrant(t,e)===jsts.geomgraph.Quadrant.quadrant(o,n)?!0:!1},jsts.geomgraph.PlanarGraph.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var o=e.next();if(o.getEdge()===t)return o}return null}}(),jsts.noding.SegmentIntersector=function(){},jsts.noding.SegmentIntersector.prototype.processIntersections=jsts.abstractFunc,jsts.noding.SegmentIntersector.prototype.isDone=jsts.abstractFunc,function(){var t=jsts.noding.SegmentIntersector,e=javascript.util.ArrayList;jsts.noding.InteriorIntersectionFinder=function(t){this.li=t,this.intersections=new e,this.interiorIntersection=null},jsts.noding.InteriorIntersectionFinder.prototype=new t,jsts.noding.InteriorIntersectionFinder.constructor=jsts.noding.InteriorIntersectionFinder,jsts.noding.InteriorIntersectionFinder.prototype.findAllIntersections=!1,jsts.noding.InteriorIntersectionFinder.prototype.isCheckEndSegmentsOnly=!1,jsts.noding.InteriorIntersectionFinder.prototype.li=null,jsts.noding.InteriorIntersectionFinder.prototype.interiorIntersection=null,jsts.noding.InteriorIntersectionFinder.prototype.intSegments=null,jsts.noding.InteriorIntersectionFinder.prototype.intersections=null,jsts.noding.InteriorIntersectionFinder.prototype.setFindAllIntersections=function(t){this.findAllIntersections=t},jsts.noding.InteriorIntersectionFinder.prototype.getIntersections=function(){return intersections},jsts.noding.InteriorIntersectionFinder.prototype.setCheckEndSegmentsOnly=function(t){this.isCheckEndSegmentsOnly=t},jsts.noding.InteriorIntersectionFinder.prototype.hasIntersection=function(){return null!=this.interiorIntersection},jsts.noding.InteriorIntersectionFinder.prototype.getInteriorIntersection=function(){return this.interiorIntersection},jsts.noding.InteriorIntersectionFinder.prototype.getIntersectionSegments=function(){return this.intSegments},jsts.noding.InteriorIntersectionFinder.prototype.processIntersections=function(t,e,o,n){if(!this.hasIntersection()&&(t!=o||e!=n)){if(this.isCheckEndSegmentsOnly){var r=this.isEndSegment(t,e)||isEndSegment(o,n);if(!r)return}var i=t.getCoordinates()[e],s=t.getCoordinates()[e+1],a=o.getCoordinates()[n],u=o.getCoordinates()[n+1];this.li.computeIntersection(i,s,a,u),this.li.hasIntersection()&&this.li.isInteriorIntersection()&&(this.intSegments=[],this.intSegments[0]=i,this.intSegments[1]=s,this.intSegments[2]=a,this.intSegments[3]=u,this.interiorIntersection=this.li.getIntersection(0),this.intersections.add(this.interiorIntersection))}},jsts.noding.InteriorIntersectionFinder.prototype.isEndSegment=function(t,e){return 0==e?!0:e>=t.size()-2?!0:!1},jsts.noding.InteriorIntersectionFinder.prototype.isDone=function(){return this.findAllIntersections?!1:null!=this.interiorIntersection}}(),function(){var t=jsts.algorithm.RobustLineIntersector,e=jsts.noding.InteriorIntersectionFinder,o=jsts.noding.MCIndexNoder;jsts.noding.FastNodingValidator=function(e){this.li=new t,this.segStrings=e},jsts.noding.FastNodingValidator.prototype.li=null,jsts.noding.FastNodingValidator.prototype.segStrings=null,jsts.noding.FastNodingValidator.prototype.findAllIntersections=!1,jsts.noding.FastNodingValidator.prototype.segInt=null,jsts.noding.FastNodingValidator.prototype._isValid=!0,jsts.noding.FastNodingValidator.prototype.setFindAllIntersections=function(t){this.findAllIntersections=t},jsts.noding.FastNodingValidator.prototype.getIntersections=function(){return segInt.getIntersections()},jsts.noding.FastNodingValidator.prototype.isValid=function(){return this.execute(),this._isValid},jsts.noding.FastNodingValidator.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this.segInt.getIntersectionSegments();return"found non-noded intersection between "+jsts.io.WKTWriter.toLineString(t[0],t[1])+" and "+jsts.io.WKTWriter.toLineString(t[2],t[3])},jsts.noding.FastNodingValidator.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new jsts.error.TopologyError(this.getErrorMessage(),this.segInt.getInteriorIntersection())},jsts.noding.FastNodingValidator.prototype.execute=function(){null==this.segInt&&this.checkInteriorIntersections()},jsts.noding.FastNodingValidator.prototype.checkInteriorIntersections=function(){this._isValid=!0,this.segInt=new e(this.li),this.segInt.setFindAllIntersections(this.findAllIntersections);var t=new o;return t.setSegmentIntersector(this.segInt),t.computeNodes(this.segStrings),this.segInt.hasIntersection()?void(this._isValid=!1):void 0}}(),function(){jsts.noding.BasicSegmentString=function(t,e){this.pts=t,this.data=e},jsts.noding.BasicSegmentString.prototype=new jsts.noding.SegmentString,jsts.noding.BasicSegmentString.prototype.pts=null,jsts.noding.BasicSegmentString.prototype.data=null,jsts.noding.BasicSegmentString.prototype.getData=function(){return this.data},jsts.noding.BasicSegmentString.prototype.setData=function(t){this.data=t},jsts.noding.BasicSegmentString.prototype.size=function(){return this.pts.length},jsts.noding.BasicSegmentString.prototype.getCoordinate=function(t){return this.pts[t]},jsts.noding.BasicSegmentString.prototype.getCoordinates=function(){return this.pts},jsts.noding.BasicSegmentString.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},jsts.noding.BasicSegmentString.prototype.getSegmentOctant=function(t){return t==this.pts.length-1?-1:jsts.noding.Octant.octant(this.getCoordinate(t),this.getCoordinate(t+1))}}(),function(){var t=jsts.noding.FastNodingValidator,e=jsts.noding.BasicSegmentString,o=javascript.util.ArrayList;jsts.geomgraph.EdgeNodingValidator=function(e){this.nv=new t(jsts.geomgraph.EdgeNodingValidator.toSegmentStrings(e))},jsts.geomgraph.EdgeNodingValidator.checkValid=function(t){var e=new jsts.geomgraph.EdgeNodingValidator(t);e.checkValid()},jsts.geomgraph.EdgeNodingValidator.toSegmentStrings=function(t){for(var n=new o,r=t.iterator();r.hasNext();){var i=r.next();n.add(new e(i.getCoordinates(),i))}return n},jsts.geomgraph.EdgeNodingValidator.prototype.nv=null,jsts.geomgraph.EdgeNodingValidator.prototype.checkValid=function(){this.nv.checkValid()}}(),jsts.operation.GeometryGraphOperation=function(t,e,o){if(this.li=new jsts.algorithm.RobustLineIntersector,this.arg=[],void 0!==t){if(void 0===e)return this.setComputationPrecision(t.getPrecisionModel()),void(this.arg[0]=new jsts.geomgraph.GeometryGraph(0,t));o=o||jsts.algorithm.BoundaryNodeRule.OGC_SFS_BOUNDARY_RULE,this.setComputationPrecision(t.getPrecisionModel().compareTo(e.getPrecisionModel())>=0?t.getPrecisionModel():e.getPrecisionModel()),this.arg[0]=new jsts.geomgraph.GeometryGraph(0,t,o),this.arg[1]=new jsts.geomgraph.GeometryGraph(1,e,o)}},jsts.operation.GeometryGraphOperation.prototype.li=null,jsts.operation.GeometryGraphOperation.prototype.resultPrecisionModel=null,jsts.operation.GeometryGraphOperation.prototype.arg=null,jsts.operation.GeometryGraphOperation.prototype.getArgGeometry=function(t){return arg[t].getGeometry()},jsts.operation.GeometryGraphOperation.prototype.setComputationPrecision=function(t){this.resultPrecisionModel=t,this.li.setPrecisionModel(this.resultPrecisionModel)},jsts.operation.overlay.OverlayNodeFactory=function(){},jsts.operation.overlay.OverlayNodeFactory.prototype=new jsts.geomgraph.NodeFactory,jsts.operation.overlay.OverlayNodeFactory.constructor=jsts.operation.overlay.OverlayNodeFactory,jsts.operation.overlay.OverlayNodeFactory.prototype.createNode=function(t){return new jsts.geomgraph.Node(t,new jsts.geomgraph.DirectedEdgeStar)},jsts.operation.overlay.PolygonBuilder=function(t){this.shellList=[],this.geometryFactory=t},jsts.operation.overlay.PolygonBuilder.prototype.geometryFactory=null,jsts.operation.overlay.PolygonBuilder.prototype.shellList=null,jsts.operation.overlay.PolygonBuilder.prototype.add=function(t){return 2===arguments.length?void this.add2.apply(this,arguments):void this.add2(t.getEdgeEnds(),t.getNodes())},jsts.operation.overlay.PolygonBuilder.prototype.add2=function(t,e){jsts.geomgraph.PlanarGraph.linkResultDirectedEdges(e);var o=this.buildMaximalEdgeRings(t),n=[],r=this.buildMinimalEdgeRings(o,this.shellList,n);this.sortShellsAndHoles(r,this.shellList,n),this.placeFreeHoles(this.shellList,n)},jsts.operation.overlay.PolygonBuilder.prototype.getPolygons=function(){var t=this.computePolygons(this.shellList);return t},jsts.operation.overlay.PolygonBuilder.prototype.buildMaximalEdgeRings=function(t){for(var e=[],o=t.iterator();o.hasNext();){var n=o.next();if(n.isInResult()&&n.getLabel().isArea()&&null==n.getEdgeRing()){var r=new jsts.operation.overlay.MaximalEdgeRing(n,this.geometryFactory);e.push(r),r.setInResult()}}return e},jsts.operation.overlay.PolygonBuilder.prototype.buildMinimalEdgeRings=function(t,e,o){for(var n=[],r=0;r<t.length;r++){var i=t[r];if(i.getMaxNodeDegree()>2){i.linkDirectedEdgesForMinimalEdgeRings();var s=i.buildMinimalRings(),a=this.findShell(s);null!==a?(this.placePolygonHoles(a,s),e.push(a)):o=o.concat(s)}else n.push(i)}return n},jsts.operation.overlay.PolygonBuilder.prototype.findShell=function(t){for(var e=0,o=null,n=0;n<t.length;n++){var r=t[n];r.isHole()||(o=r,e++)}return jsts.util.Assert.isTrue(1>=e,"found two shells in MinimalEdgeRing list"),o},jsts.operation.overlay.PolygonBuilder.prototype.placePolygonHoles=function(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.isHole()&&n.setShell(t)}},jsts.operation.overlay.PolygonBuilder.prototype.sortShellsAndHoles=function(t,e,o){for(var n=0;n<t.length;n++){var r=t[n];r.isHole()?o.push(r):e.push(r)}},jsts.operation.overlay.PolygonBuilder.prototype.placeFreeHoles=function(t,e){for(var o=0;o<e.length;o++){var n=e[o];if(null==n.getShell()){var r=this.findEdgeRingContaining(n,t);if(null===r)throw new jsts.error.TopologyError("unable to assign hole to a shell",n.getCoordinate(0));n.setShell(r)}}},jsts.operation.overlay.PolygonBuilder.prototype.findEdgeRingContaining=function(t,e){for(var o=t.getLinearRing(),n=o.getEnvelopeInternal(),r=o.getCoordinateN(0),i=null,s=null,a=0;a<e.length;a++){var u=e[a],p=u.getLinearRing(),g=p.getEnvelopeInternal();null!==i&&(s=i.getLinearRing().getEnvelopeInternal());var l=!1;g.contains(n)&&jsts.algorithm.CGAlgorithms.isPointInRing(r,p.getCoordinates())&&(l=!0),l&&(null==i||s.contains(g))&&(i=u)}return i},jsts.operation.overlay.PolygonBuilder.prototype.computePolygons=function(t){for(var e=new javascript.util.ArrayList,o=0;o<t.length;o++){var n=t[o],r=n.toPolygon(this.geometryFactory);e.add(r)}return e},jsts.operation.overlay.PolygonBuilder.prototype.containsPoint=function(t){for(var e=0;e<this.shellList.length;e++){var o=this.shellList[e];if(o.containsPoint(t))return!0}return!1},function(){var t=jsts.util.Assert,e=javascript.util.ArrayList,o=function(t,o,n){this.lineEdgesList=new e,this.resultLineList=new e,this.op=t,this.geometryFactory=o,this.ptLocator=n};o.prototype.op=null,o.prototype.geometryFactory=null,o.prototype.ptLocator=null,o.prototype.lineEdgesList=null,o.prototype.resultLineList=null,o.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this.resultLineList},o.prototype.findCoveredLineEdges=function(){for(var t=this.op.getGraph().getNodes().iterator();t.hasNext();){var e=t.next();e.getEdges().findCoveredLineEdges()}for(var o=this.op.getGraph().getEdgeEnds().iterator();o.hasNext();){var n=o.next(),r=n.getEdge();if(n.isLineEdge()&&!r.isCoveredSet()){var i=this.op.isCoveredByA(n.getCoordinate());r.setCovered(i)}}},o.prototype.collectLines=function(t){for(var e=this.op.getGraph().getEdgeEnds().iterator();e.hasNext();){var o=e.next();this.collectLineEdge(o,t,this.lineEdgesList),this.collectBoundaryTouchEdge(o,t,this.lineEdgesList)}},o.prototype.collectLineEdge=function(t,e,o){var n=t.getLabel(),r=t.getEdge();t.isLineEdge()&&(t.isVisited()||!jsts.operation.overlay.OverlayOp.isResultOfOp(n,e)||r.isCovered()||(o.add(r),t.setVisitedEdge(!0)))},o.prototype.collectBoundaryTouchEdge=function(e,o,n){var r=e.getLabel();e.isLineEdge()||e.isVisited()||e.isInteriorAreaEdge()||e.getEdge().isInResult()||(t.isTrue(!(e.isInResult()||e.getSym().isInResult())||!e.getEdge().isInResult()),jsts.operation.overlay.OverlayOp.isResultOfOp(r,o)&&o===jsts.operation.overlay.OverlayOp.INTERSECTION&&(n.add(e.getEdge()),e.setVisitedEdge(!0)))},o.prototype.buildLines=function(){for(var t=this.lineEdgesList.iterator();t.hasNext();){var e=t.next(),o=(e.getLabel(),this.geometryFactory.createLineString(e.getCoordinates()));this.resultLineList.add(o),e.setInResult(!0)}},o.prototype.labelIsolatedLines=function(t){for(var e=t.iterator();e.hasNext();){var o=e.next(),n=o.getLabel();o.isIsolated()&&(n.isNull(0)?this.labelIsolatedLine(o,0):this.labelIsolatedLine(o,1))}},o.prototype.labelIsolatedLine=function(t,e){var o=ptLocator.locate(t.getCoordinate(),op.getArgGeometry(e));t.getLabel().setLocation(e,o)},jsts.operation.overlay.LineBuilder=o}(),function(){var t=javascript.util.ArrayList,e=function(e,o){this.resultPointList=new t,this.op=e,this.geometryFactory=o};e.prototype.op=null,e.prototype.geometryFactory=null,e.prototype.resultPointList=null,e.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this.resultPointList},e.prototype.extractNonCoveredResultNodes=function(t){for(var e=this.op.getGraph().getNodes().iterator();e.hasNext();){var o=e.next();if(!(o.isInResult()||o.isIncidentEdgeInResult()||0!==o.getEdges().getDegree()&&t!==jsts.operation.overlay.OverlayOp.INTERSECTION)){var n=o.getLabel();jsts.operation.overlay.OverlayOp.isResultOfOp(n,t)&&this.filterCoveredNodeToPoint(o)}}},e.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this.op.isCoveredByLA(e)){var o=this.geometryFactory.createPoint(e);this.resultPointList.add(o)}},jsts.operation.overlay.PointBuilder=e}(),function(){var t=jsts.algorithm.PointLocator,e=jsts.geom.Location,o=jsts.geomgraph.EdgeList,n=jsts.geomgraph.Label,r=jsts.geomgraph.PlanarGraph,i=jsts.geomgraph.Position,s=jsts.geomgraph.EdgeNodingValidator,a=jsts.operation.GeometryGraphOperation,u=jsts.operation.overlay.OverlayNodeFactory,p=jsts.operation.overlay.PolygonBuilder,g=jsts.operation.overlay.LineBuilder,l=jsts.operation.overlay.PointBuilder,h=jsts.util.Assert,d=javascript.util.ArrayList;jsts.operation.overlay.OverlayOp=function(e,n){this.ptLocator=new t,this.edgeList=new o,this.resultPolyList=new d,this.resultLineList=new d,this.resultPointList=new d,a.call(this,e,n),this.graph=new r(new u),this.geomFact=e.getFactory()},jsts.operation.overlay.OverlayOp.prototype=new a,jsts.operation.overlay.OverlayOp.constructor=jsts.operation.overlay.OverlayOp,jsts.operation.overlay.OverlayOp.INTERSECTION=1,jsts.operation.overlay.OverlayOp.UNION=2,jsts.operation.overlay.OverlayOp.DIFFERENCE=3,jsts.operation.overlay.OverlayOp.SYMDIFFERENCE=4,jsts.operation.overlay.OverlayOp.overlayOp=function(t,e,o){var n=new jsts.operation.overlay.OverlayOp(t,e),r=n.getResultGeometry(o);return r},jsts.operation.overlay.OverlayOp.isResultOfOp=function(t,e){if(3===arguments.length)return jsts.operation.overlay.OverlayOp.isResultOfOp2.apply(this,arguments);var o=t.getLocation(0),n=t.getLocation(1);return jsts.operation.overlay.OverlayOp.isResultOfOp2(o,n,e)},jsts.operation.overlay.OverlayOp.isResultOfOp2=function(t,o,n){switch(t==e.BOUNDARY&&(t=e.INTERIOR),o==e.BOUNDARY&&(o=e.INTERIOR),n){case jsts.operation.overlay.OverlayOp.INTERSECTION:return t==e.INTERIOR&&o==e.INTERIOR;case jsts.operation.overlay.OverlayOp.UNION:return t==e.INTERIOR||o==e.INTERIOR;case jsts.operation.overlay.OverlayOp.DIFFERENCE:return t==e.INTERIOR&&o!=e.INTERIOR;case jsts.operation.overlay.OverlayOp.SYMDIFFERENCE:return t==e.INTERIOR&&o!=e.INTERIOR||t!=e.INTERIOR&&o==e.INTERIOR}return!1},jsts.operation.overlay.OverlayOp.prototype.ptLocator=null,jsts.operation.overlay.OverlayOp.prototype.geomFact=null,jsts.operation.overlay.OverlayOp.prototype.resultGeom=null,jsts.operation.overlay.OverlayOp.prototype.graph=null,jsts.operation.overlay.OverlayOp.prototype.edgeList=null,jsts.operation.overlay.OverlayOp.prototype.resultPolyList=null,jsts.operation.overlay.OverlayOp.prototype.resultLineList=null,jsts.operation.overlay.OverlayOp.prototype.resultPointList=null,jsts.operation.overlay.OverlayOp.prototype.getResultGeometry=function(t){return this.computeOverlay(t),this.resultGeom},jsts.operation.overlay.OverlayOp.prototype.getGraph=function(){return this.graph},jsts.operation.overlay.OverlayOp.prototype.computeOverlay=function(t){this.copyPoints(0),this.copyPoints(1),this.arg[0].computeSelfNodes(this.li,!1),this.arg[1].computeSelfNodes(this.li,!1),this.arg[0].computeEdgeIntersections(this.arg[1],this.li,!0);
var e=new d;this.arg[0].computeSplitEdges(e),this.arg[1].computeSplitEdges(e);this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),s.checkValid(this.edgeList.getEdges()),this.graph.addEdges(this.edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var o=new p(this.geomFact);o.add(this.graph),this.resultPolyList=o.getPolygons();var n=new g(this,this.geomFact,this.ptLocator);this.resultLineList=n.build(t);var r=new l(this,this.geomFact,this.ptLocator);this.resultPointList=r.build(t),this.resultGeom=this.computeGeometry(this.resultPointList,this.resultLineList,this.resultPolyList,t)},jsts.operation.overlay.OverlayOp.prototype.insertUniqueEdges=function(t){for(var e=t.iterator();e.hasNext();){var o=e.next();this.insertUniqueEdge(o)}},jsts.operation.overlay.OverlayOp.prototype.insertUniqueEdge=function(t){var e=this.edgeList.findEqualEdge(t);if(null!==e){var o=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new n(t.getLabel()),r.flip());var i=e.getDepth();i.isNull()&&i.add(o),i.add(r),o.merge(r)}else this.edgeList.add(t)},jsts.operation.overlay.OverlayOp.prototype.computeLabelsFromDepths=function(){for(var t=this.edgeList.iterator();t.hasNext();){var e=t.next(),o=e.getLabel(),n=e.getDepth();if(!n.isNull()){n.normalize();for(var r=0;2>r;r++)o.isNull(r)||!o.isArea()||n.isNull(r)||(0==n.getDelta(r)?o.toLine(r):(h.isTrue(!n.isNull(r,i.LEFT),"depth of LEFT side has not been initialized"),o.setLocation(r,i.LEFT,n.getLocation(r,i.LEFT)),h.isTrue(!n.isNull(r,i.RIGHT),"depth of RIGHT side has not been initialized"),o.setLocation(r,i.RIGHT,n.getLocation(r,i.RIGHT))))}}},jsts.operation.overlay.OverlayOp.prototype.replaceCollapsedEdges=function(){for(var t=new d,e=this.edgeList.iterator();e.hasNext();){var o=e.next();o.isCollapsed()&&(e.remove(),t.add(o.getCollapsedEdge()))}this.edgeList.addAll(t)},jsts.operation.overlay.OverlayOp.prototype.copyPoints=function(t){for(var e=this.arg[t].getNodeIterator();e.hasNext();){var o=e.next(),n=this.graph.addNode(o.getCoordinate());n.setLabel(t,o.getLabel().getLocation(t))}},jsts.operation.overlay.OverlayOp.prototype.computeLabelling=function(){for(var t=this.graph.getNodes().iterator();t.hasNext();){var e=t.next();e.getEdges().computeLabelling(this.arg)}this.mergeSymLabels(),this.updateNodeLabelling()},jsts.operation.overlay.OverlayOp.prototype.mergeSymLabels=function(){for(var t=this.graph.getNodes().iterator();t.hasNext();){var e=t.next();e.getEdges().mergeSymLabels()}},jsts.operation.overlay.OverlayOp.prototype.updateNodeLabelling=function(){for(var t=this.graph.getNodes().iterator();t.hasNext();){var e=t.next(),o=e.getEdges().getLabel();e.getLabel().merge(o)}},jsts.operation.overlay.OverlayOp.prototype.labelIncompleteNodes=function(){for(var t=0,e=this.graph.getNodes().iterator();e.hasNext();){var o=e.next(),n=o.getLabel();o.isIsolated()&&(t++,n.isNull(0)?this.labelIncompleteNode(o,0):this.labelIncompleteNode(o,1)),o.getEdges().updateLabelling(n)}},jsts.operation.overlay.OverlayOp.prototype.labelIncompleteNode=function(t,e){var o=this.ptLocator.locate(t.getCoordinate(),this.arg[e].getGeometry());t.getLabel().setLocation(e,o)},jsts.operation.overlay.OverlayOp.prototype.findResultAreaEdges=function(t){for(var e=this.graph.getEdgeEnds().iterator();e.hasNext();){var o=e.next(),n=o.getLabel();n.isArea()&&!o.isInteriorAreaEdge()&&jsts.operation.overlay.OverlayOp.isResultOfOp(n.getLocation(0,i.RIGHT),n.getLocation(1,i.RIGHT),t)&&o.setInResult(!0)}},jsts.operation.overlay.OverlayOp.prototype.cancelDuplicateResultEdges=function(){for(var t=this.graph.getEdgeEnds().iterator();t.hasNext();){var e=t.next(),o=e.getSym();e.isInResult()&&o.isInResult()&&(e.setInResult(!1),o.setInResult(!1))}},jsts.operation.overlay.OverlayOp.prototype.isCoveredByLA=function(t){return this.isCovered(t,this.resultLineList)?!0:this.isCovered(t,this.resultPolyList)?!0:!1},jsts.operation.overlay.OverlayOp.prototype.isCoveredByA=function(t){return this.isCovered(t,this.resultPolyList)?!0:!1},jsts.operation.overlay.OverlayOp.prototype.isCovered=function(t,o){for(var n=o.iterator();n.hasNext();){var r=n.next(),i=this.ptLocator.locate(t,r);if(i!=e.EXTERIOR)return!0}return!1},jsts.operation.overlay.OverlayOp.prototype.computeGeometry=function(t,e,o){var n=new d;return n.addAll(t),n.addAll(e),n.addAll(o),this.geomFact.buildGeometry(n)},jsts.operation.overlay.OverlayOp.prototype.createEmptyResult=function(t){var e=null;switch(resultDimension(t,this.arg[0].getGeometry(),this.arg[1].getGeometry())){case-1:e=geomFact.createGeometryCollection();break;case 0:e=geomFact.createPoint(null);break;case 1:e=geomFact.createLineString(null);break;case 2:e=geomFact.createPolygon(null,null)}return e},jsts.operation.overlay.OverlayOp.prototype.resultDimension=function(t,e,o){var n=e.getDimension(),r=o.getDimension(),i=-1;switch(t){case jsts.operation.overlay.OverlayOp.INTERSECTION:i=Math.min(n,r);break;case jsts.operation.overlay.OverlayOp.UNION:i=Math.max(n,r);break;case jsts.operation.overlay.OverlayOp.DIFFERENCE:i=n;break;case jsts.operation.overlay.OverlayOp.SYMDIFFERENCE:i=Math.max(n,r)}return i}}(),function(){var t=jsts.operation.overlay.OverlayOp,e=jsts.operation.overlay.snap.GeometrySnapper,o=function(t,e){this.geom=[],this.geom[0]=t,this.geom[1]=e,this.computeSnapTolerance()};o.overlayOp=function(t,e,n){var r=new o(t,e);return r.getResultGeometry(n)},o.intersection=function(e,o){return this.overlayOp(e,o,t.INTERSECTION)},o.union=function(e,o){return this.overlayOp(e,o,t.UNION)},o.difference=function(e,o){return overlayOp(e,o,t.DIFFERENCE)},o.symDifference=function(e,o){return overlayOp(e,o,t.SYMDIFFERENCE)},o.prototype.geom=null,o.prototype.snapTolerance=null,o.prototype.computeSnapTolerance=function(){this.snapTolerance=e.computeOverlaySnapTolerance(this.geom[0],this.geom[1])},o.prototype.getResultGeometry=function(e){var o=this.snap(this.geom),n=t.overlayOp(o[0],o[1],e);return this.prepareResult(n)},o.prototype.selfSnap=function(t){var o=new e(t),n=o.snapTo(t,this.snapTolerance);return n},o.prototype.snap=function(t){var o=t,n=e.snap(o[0],o[1],this.snapTolerance);return n},o.prototype.prepareResult=function(t){return t},o.prototype.cbr=null,o.prototype.removeCommonBits=function(){this.cbr=new jsts.precision.CommonBitsRemover,this.cbr.add(this.geom[0]),this.cbr.add(this.geom[1]);var t=[];return t[0]=cbr.removeCommonBits(this.geom[0].clone()),t[1]=cbr.removeCommonBits(this.geom[1].clone()),t},jsts.operation.overlay.snap.SnapOverlayOp=o}(),jsts.geomgraph.index.EdgeSetIntersector=function(){},jsts.geomgraph.index.EdgeSetIntersector.prototype.computeIntersections=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geomgraph.index.EdgeSetIntersector.prototype.computeIntersections2=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geomgraph.index.SimpleMCSweepLineIntersector=function(){this.events=[]},jsts.geomgraph.index.SimpleMCSweepLineIntersector.prototype=new jsts.geomgraph.index.EdgeSetIntersector,jsts.geomgraph.index.SimpleMCSweepLineIntersector.prototype.events=null,jsts.geomgraph.index.SimpleMCSweepLineIntersector.prototype.nOverlaps=0,jsts.geomgraph.index.SimpleMCSweepLineIntersector.prototype.computeIntersections=function(t,e,o){return e instanceof javascript.util.List?void this.computeIntersections2.apply(this,arguments):(o?this.addList2(t,null):this.addList(t),void this.computeIntersections3(e))},jsts.geomgraph.index.SimpleMCSweepLineIntersector.prototype.computeIntersections2=function(t,e,o){this.addList2(t,t),this.addList2(e,e),this.computeIntersections3(o)},jsts.geomgraph.index.SimpleMCSweepLineIntersector.prototype.add=function(t,e){if(t instanceof javascript.util.List)return void this.addList.apply(this,arguments);for(var o=t.getMonotoneChainEdge(),n=o.getStartIndexes(),r=0;r<n.length-1;r++){var i=new jsts.geomgraph.index.MonotoneChain(o,r),s=new jsts.geomgraph.index.SweepLineEvent(o.getMinX(r),i,e);this.events.push(s),this.events.push(new jsts.geomgraph.index.SweepLineEvent(o.getMaxX(r),s))}},jsts.geomgraph.index.SimpleMCSweepLineIntersector.prototype.addList=function(t){for(var e=t.iterator();e.hasNext();){var o=e.next();this.add(o,o)}},jsts.geomgraph.index.SimpleMCSweepLineIntersector.prototype.addList2=function(t,e){for(var o=t.iterator();o.hasNext();){var n=o.next();this.add(n,e)}},jsts.geomgraph.index.SimpleMCSweepLineIntersector.prototype.prepareEvents=function(){this.events.sort(function(t,e){return t.compareTo(e)});for(var t=0;t<this.events.length;t++){var e=this.events[t];e.isDelete()&&e.getInsertEvent().setDeleteEventIndex(t)}},jsts.geomgraph.index.SimpleMCSweepLineIntersector.prototype.computeIntersections3=function(t){this.nOverlaps=0,this.prepareEvents();for(var e=0;e<this.events.length;e++){var o=this.events[e];o.isInsert()&&this.processOverlaps(e,o.getDeleteEventIndex(),o,t)}},jsts.geomgraph.index.SimpleMCSweepLineIntersector.prototype.processOverlaps=function(t,e,o,n){for(var r=o.getObject(),i=t;e>i;i++){var s=this.events[i];if(s.isInsert()){var a=s.getObject();o.isSameLabel(s)||(r.computeIntersections(a,n),this.nOverlaps++)}}},jsts.algorithm.locate.SimplePointInAreaLocator=function(t){this.geom=t},jsts.algorithm.locate.SimplePointInAreaLocator.locate=function(t,e){return e.isEmpty()?jsts.geom.Location.EXTERIOR:jsts.algorithm.locate.SimplePointInAreaLocator.containsPoint(t,e)?jsts.geom.Location.INTERIOR:jsts.geom.Location.EXTERIOR},jsts.algorithm.locate.SimplePointInAreaLocator.containsPoint=function(t,e){if(e instanceof jsts.geom.Polygon)return jsts.algorithm.locate.SimplePointInAreaLocator.containsPointInPolygon(t,e);if(e instanceof jsts.geom.GeometryCollection||e instanceof jsts.geom.MultiPoint||e instanceof jsts.geom.MultiLineString||e instanceof jsts.geom.MultiPolygon)for(var o=0;o<e.geometries.length;o++){var n=e.geometries[o];if(n!==e&&jsts.algorithm.locate.SimplePointInAreaLocator.containsPoint(t,n))return!0}return!1},jsts.algorithm.locate.SimplePointInAreaLocator.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var o=e.getExteriorRing();if(!jsts.algorithm.locate.SimplePointInAreaLocator.isPointInRing(t,o))return!1;for(var n=0;n<e.getNumInteriorRing();n++){var r=e.getInteriorRingN(n);if(jsts.algorithm.locate.SimplePointInAreaLocator.isPointInRing(t,r))return!1}return!0},jsts.algorithm.locate.SimplePointInAreaLocator.isPointInRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?jsts.algorithm.CGAlgorithms.isPointInRing(t,e.getCoordinates()):!1},jsts.algorithm.locate.SimplePointInAreaLocator.prototype.geom=null,jsts.algorithm.locate.SimplePointInAreaLocator.prototype.locate=function(t){return jsts.algorithm.locate.SimplePointInAreaLocator.locate(t,geom)},function(){var t=jsts.geom.Location,e=jsts.geomgraph.Position,o=jsts.geomgraph.EdgeEndStar,n=jsts.util.Assert;jsts.geomgraph.DirectedEdgeStar=function(){jsts.geomgraph.EdgeEndStar.call(this)},jsts.geomgraph.DirectedEdgeStar.prototype=new o,jsts.geomgraph.DirectedEdgeStar.constructor=jsts.geomgraph.DirectedEdgeStar,jsts.geomgraph.DirectedEdgeStar.prototype.resultAreaEdgeList=null,jsts.geomgraph.DirectedEdgeStar.prototype.label=null,jsts.geomgraph.DirectedEdgeStar.prototype.insert=function(t){var e=t;this.insertEdgeEnd(e,e)},jsts.geomgraph.DirectedEdgeStar.prototype.getLabel=function(){return this.label},jsts.geomgraph.DirectedEdgeStar.prototype.getOutgoingDegree=function(){for(var t=0,e=this.iterator();e.hasNext();){var o=e.next();o.isInResult()&&t++}return t},jsts.geomgraph.DirectedEdgeStar.prototype.getOutgoingDegree=function(t){for(var e=0,o=this.iterator();o.hasNext();){var n=o.next();n.getEdgeRing()===t&&e++}return e},jsts.geomgraph.DirectedEdgeStar.prototype.getRightmostEdge=function(){var t=this.getEdges(),e=t.size();if(1>e)return null;var o=t.get(0);if(1==e)return o;var r=t.get(e-1),i=o.getQuadrant(),s=r.getQuadrant();if(jsts.geomgraph.Quadrant.isNorthern(i)&&jsts.geomgraph.Quadrant.isNorthern(s))return o;if(!jsts.geomgraph.Quadrant.isNorthern(i)&&!jsts.geomgraph.Quadrant.isNorthern(s))return r;return 0!=o.getDy()?o:0!=r.getDy()?r:(n.shouldNeverReachHere("found two horizontal edges incident on node"),null)},jsts.geomgraph.DirectedEdgeStar.prototype.computeLabelling=function(e){o.prototype.computeLabelling.call(this,e),this.label=new jsts.geomgraph.Label(t.NONE);for(var n=this.iterator();n.hasNext();)for(var r=n.next(),i=r.getEdge(),s=i.getLabel(),a=0;2>a;a++){var u=s.getLocation(a);(u===t.INTERIOR||u===t.BOUNDARY)&&this.label.setLocation(a,t.INTERIOR)}},jsts.geomgraph.DirectedEdgeStar.prototype.mergeSymLabels=function(){for(var t=this.iterator();t.hasNext();){var e=t.next(),o=e.getLabel();o.merge(e.getSym().getLabel())}},jsts.geomgraph.DirectedEdgeStar.prototype.updateLabelling=function(t){for(var e=this.iterator();e.hasNext();){var o=e.next(),n=o.getLabel();n.setAllLocationsIfNull(0,t.getLocation(0)),n.setAllLocationsIfNull(1,t.getLocation(1))}},jsts.geomgraph.DirectedEdgeStar.prototype.getResultAreaEdges=function(){if(null!==this.resultAreaEdgeList)return this.resultAreaEdgeList;this.resultAreaEdgeList=new javascript.util.ArrayList;for(var t=this.iterator();t.hasNext();){var e=t.next();(e.isInResult()||e.getSym().isInResult())&&this.resultAreaEdgeList.add(e)}return this.resultAreaEdgeList},jsts.geomgraph.DirectedEdgeStar.prototype.SCANNING_FOR_INCOMING=1,jsts.geomgraph.DirectedEdgeStar.prototype.LINKING_TO_OUTGOING=2,jsts.geomgraph.DirectedEdgeStar.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var t=null,e=null,o=this.SCANNING_FOR_INCOMING,r=0;r<this.resultAreaEdgeList.size();r++){var i=this.resultAreaEdgeList.get(r),s=i.getSym();if(i.getLabel().isArea())switch(null===t&&i.isInResult()&&(t=i),o){case this.SCANNING_FOR_INCOMING:if(!s.isInResult())continue;e=s,o=this.LINKING_TO_OUTGOING;break;case this.LINKING_TO_OUTGOING:if(!i.isInResult())continue;e.setNext(i),o=this.SCANNING_FOR_INCOMING}}if(o===this.LINKING_TO_OUTGOING){if(null===t)throw new jsts.error.TopologyError("no outgoing dirEdge found",this.getCoordinate());n.isTrue(t.isInResult(),"unable to link last incoming dirEdge"),e.setNext(t)}},jsts.geomgraph.DirectedEdgeStar.prototype.linkMinimalDirectedEdges=function(t){for(var e=null,o=null,r=this.SCANNING_FOR_INCOMING,i=this.resultAreaEdgeList.size()-1;i>=0;i--){var s=this.resultAreaEdgeList.get(i),a=s.getSym();switch(null===e&&s.getEdgeRing()===t&&(e=s),r){case this.SCANNING_FOR_INCOMING:if(a.getEdgeRing()!=t)continue;o=a,r=this.LINKING_TO_OUTGOING;break;case this.LINKING_TO_OUTGOING:if(s.getEdgeRing()!==t)continue;o.setNextMin(s),r=this.SCANNING_FOR_INCOMING}}r===this.LINKING_TO_OUTGOING&&(n.isTrue(null!==e,"found null for first outgoing dirEdge"),n.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),o.setNextMin(e))},jsts.geomgraph.DirectedEdgeStar.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var t=null,e=null,o=this.edgeList.size()-1;o>=0;o--){var n=this.edgeList.get(o),r=n.getSym();null===e&&(e=r),null!==t&&r.setNext(t),t=n}e.setNext(t)},jsts.geomgraph.DirectedEdgeStar.prototype.findCoveredLineEdges=function(){for(var e=t.NONE,o=this.iterator();o.hasNext();){var n=o.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){e=t.INTERIOR;break}if(r.isInResult()){e=t.EXTERIOR;break}}}if(e!==t.NONE)for(var i=e,o=this.iterator();o.hasNext();){var n=o.next(),r=n.getSym();n.isLineEdge()?n.getEdge().setCovered(i===t.INTERIOR):(n.isInResult()&&(i=t.EXTERIOR),r.isInResult()&&(i=t.INTERIOR))}},jsts.geomgraph.DirectedEdgeStar.prototype.computeDepths=function(t){if(2===arguments.length)return void this.computeDepths2.apply(this,arguments);var o=this.findIndex(t),n=(t.getLabel(),t.getDepth(e.LEFT)),r=t.getDepth(e.RIGHT),i=this.computeDepths2(o+1,this.edgeList.size(),n),s=this.computeDepths2(0,o,i);if(s!=r)throw new jsts.error.TopologyError("depth mismatch at "+t.getCoordinate())},jsts.geomgraph.DirectedEdgeStar.prototype.computeDepths2=function(t,o,n){for(var r=n,i=t;o>i;i++){{var s=this.edgeList.get(i);s.getLabel()}s.setEdgeDepths(e.RIGHT,r),r=s.getDepth(e.LEFT)}return r}}(),jsts.algorithm.CentroidLine=function(){this.centSum=new jsts.geom.Coordinate},jsts.algorithm.CentroidLine.prototype.centSum=null,jsts.algorithm.CentroidLine.prototype.totalLength=0,jsts.algorithm.CentroidLine.prototype.add=function(t){if(t instanceof Array)return void this.add2.apply(this,arguments);if(t instanceof jsts.geom.LineString)this.add(t.getCoordinates());else if(t instanceof jsts.geom.Polygon){var e=t;this.add(e.getExteriorRing().getCoordinates());for(var o=0;o<e.getNumInteriorRing();o++)this.add(e.getInteriorRingN(o).getCoordinates())}else if(t instanceof jsts.geom.GeometryCollection||t instanceof jsts.geom.MultiPoint||t instanceof jsts.geom.MultiLineString||t instanceof jsts.geom.MultiPolygon)for(var n=t,o=0;o<n.getNumGeometries();o++)this.add(n.getGeometryN(o))},jsts.algorithm.CentroidLine.prototype.getCentroid=function(){var t=new jsts.geom.Coordinate;return t.x=this.centSum.x/this.totalLength,t.y=this.centSum.y/this.totalLength,t},jsts.algorithm.CentroidLine.prototype.add2=function(t){for(var e=0;e<t.length-1;e++){var o=t[e].distance(t[e+1]);this.totalLength+=o;var n=(t[e].x+t[e+1].x)/2;this.centSum.x+=o*n;var r=(t[e].y+t[e+1].y)/2;this.centSum.y+=o*r}},jsts.index.IntervalSize=function(){},jsts.index.IntervalSize.MIN_BINARY_EXPONENT=-50,jsts.index.IntervalSize.isZeroWidth=function(t,e){var o=e-t;if(0===o)return!0;var n,r,i;return n=Math.max(Math.abs(t),Math.abs(e)),r=o/n,i=jsts.index.DoubleBits.exponent(r),i<=jsts.index.IntervalSize.MIN_BINARY_EXPONENT},jsts.geomgraph.index.SimpleEdgeSetIntersector=function(){},jsts.geomgraph.index.SimpleEdgeSetIntersector.prototype=new jsts.geomgraph.index.EdgeSetIntersector,jsts.geomgraph.index.SimpleEdgeSetIntersector.prototype.nOverlaps=0,jsts.geomgraph.index.SimpleEdgeSetIntersector.prototype.computeIntersections=function(t,e,o){if(e instanceof javascript.util.List)return void this.computeIntersections2.apply(this,arguments);this.nOverlaps=0;for(var n=t.iterator();n.hasNext();)for(var r=n.next(),i=t.iterator();i.hasNext();){var s=i.next();(o||r!=s)&&this.computeIntersects(r,s,e)}},jsts.geomgraph.index.SimpleEdgeSetIntersector.prototype.computeIntersections2=function(t,e,o){this.nOverlaps=0;for(var n=t.iterator();n.hasNext();)for(var r=n.next(),i=e.iterator();i.hasNext();){var s=i.next();this.computeIntersects(r,s,o)}},jsts.geomgraph.index.SimpleEdgeSetIntersector.prototype.computeIntersects=function(t,e,o){var n,r,i=t.getCoordinates(),s=e.getCoordinates();for(n=0;n<i.length-1;n++)for(r=0;r<s.length-1;r++)o.addIntersections(t,n,e,r)},jsts.geomgraph.Edge=function(t,e){this.pts=t,this.label=e,this.eiList=new jsts.geomgraph.EdgeIntersectionList(this),this.depth=new jsts.geomgraph.Depth},jsts.geomgraph.Edge.prototype=new jsts.geomgraph.GraphComponent,jsts.geomgraph.Edge.constructor=jsts.geomgraph.Edge,jsts.geomgraph.Edge.updateIM=function(t,e){e.setAtLeastIfValid(t.getLocation(0,jsts.geomgraph.Position.ON),t.getLocation(1,jsts.geomgraph.Position.ON),1),t.isArea()&&(e.setAtLeastIfValid(t.getLocation(0,jsts.geomgraph.Position.LEFT),t.getLocation(1,jsts.geomgraph.Position.LEFT),2),e.setAtLeastIfValid(t.getLocation(0,jsts.geomgraph.Position.RIGHT),t.getLocation(1,jsts.geomgraph.Position.RIGHT),2))},jsts.geomgraph.Edge.prototype.pts=null,jsts.geomgraph.Edge.prototype.env=null,jsts.geomgraph.Edge.prototype.name=null,jsts.geomgraph.Edge.prototype.mce=null,jsts.geomgraph.Edge.prototype._isIsolated=!0,jsts.geomgraph.Edge.prototype.depth=null,jsts.geomgraph.Edge.prototype.depthDelta=0,jsts.geomgraph.Edge.prototype.eiList=null,jsts.geomgraph.Edge.prototype.getNumPoints=function(){return this.pts.length},jsts.geomgraph.Edge.prototype.getEnvelope=function(){if(null===this.env){this.env=new jsts.geom.Envelope;for(var t=0;t<this.pts.length;t++)this.env.expandToInclude(pts[t])}return env},jsts.geomgraph.Edge.prototype.getDepth=function(){return this.depth},jsts.geomgraph.Edge.prototype.getDepthDelta=function(){return this.depthDelta},jsts.geomgraph.Edge.prototype.setDepthDelta=function(t){this.depthDelta=t},jsts.geomgraph.Edge.prototype.getCoordinates=function(){return this.pts},jsts.geomgraph.Edge.prototype.getCoordinate=function(t){return void 0===t?this.pts.length>0?this.pts[0]:null:this.pts[t]},jsts.geomgraph.Edge.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},jsts.geomgraph.Edge.prototype.setIsolated=function(t){this._isIsolated=t},jsts.geomgraph.Edge.prototype.isIsolated=function(){return this._isIsolated},jsts.geomgraph.Edge.prototype.addIntersections=function(t,e,o){for(var n=0;n<t.getIntersectionNum();n++)this.addIntersection(t,e,o,n)},jsts.geomgraph.Edge.prototype.addIntersection=function(t,e,o,n){var r=new jsts.geom.Coordinate(t.getIntersection(n)),i=e,s=t.getEdgeDistance(o,n),a=i+1;if(a<this.pts.length){var u=this.pts[a];r.equals2D(u)&&(i=a,s=0)}this.eiList.add(r,i,s)},jsts.geomgraph.Edge.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},jsts.geomgraph.Edge.prototype.getEdgeIntersectionList=function(){return this.eiList},jsts.geomgraph.Edge.prototype.getMonotoneChainEdge=function(){return null==this.mce&&(this.mce=new jsts.geomgraph.index.MonotoneChainEdge(this)),this.mce},jsts.geomgraph.Edge.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},jsts.geomgraph.Edge.prototype.isCollapsed=function(){return this.label.isArea()?3!=this.pts.length?!1:this.pts[0].equals(this.pts[2])?!0:!1:!1},jsts.geomgraph.Edge.prototype.getCollapsedEdge=function(){var t=[];t[0]=this.pts[0],t[1]=this.pts[1];var e=new jsts.geomgraph.Edge(t,jsts.geomgraph.Label.toLineLabel(this.label));return e},jsts.geomgraph.Edge.prototype.computeIM=function(t){jsts.geomgraph.Edge.updateIM(this.label,t)},jsts.geomgraph.Edge.prototype.isPointwiseEqual=function(t){if(this.pts.length!=t.pts.length)return!1;for(var e=0;e<this.pts.length;e++)if(!this.pts[e].equals2D(t.pts[e]))return!1;return!0},jsts.noding.Octant=function(){throw jsts.error.AbstractMethodInvocationError()},jsts.noding.Octant.octant=function(t,e){if(t instanceof jsts.geom.Coordinate)return jsts.noding.Octant.octant2.apply(this,arguments);if(0===t&&0===e)throw new jsts.error.IllegalArgumentError("Cannot compute the octant for point ( "+t+", "+e+" )");var o=Math.abs(t),n=Math.abs(e);return t>=0?e>=0?o>=n?0:1:o>=n?7:6:e>=0?o>=n?3:2:o>=n?4:5},jsts.noding.Octant.octant2=function(t,e){var o=e.x-t.x,n=e.y-t.y;if(0===o&&0===n)throw new jsts.error.IllegalArgumentError("Cannot compute the octant for two identical points "+t);return jsts.noding.Octant.octant(o,n)},jsts.operation.union.UnionInteracting=function(t,e){this.g0=t,this.g1=e,this.geomFactory=t.getFactory(),this.interacts0=[],this.interacts1=[]},jsts.operation.union.UnionInteracting.union=function(t,e){var o=new jsts.operation.union.UnionInteracting(t,e);return o.union()},jsts.operation.union.UnionInteracting.prototype.geomFactory=null,jsts.operation.union.UnionInteracting.prototype.g0=null,jsts.operation.union.UnionInteracting.prototype.g1=null,jsts.operation.union.UnionInteracting.prototype.interacts0=null,jsts.operation.union.UnionInteracting.prototype.interacts1=null,jsts.operation.union.UnionInteracting.prototype.union=function(){this.computeInteracting();var t=this.extractElements(this.g0,this.interacts0,!0),e=this.extractElements(this.g1,this.interacts1,!0);t.isEmpty()||e.isEmpty();var o=in0.union(e),n=this.extractElements(this.g0,this.interacts0,!1),r=this.extractElements(this.g1,this.interacts1,!1),i=jsts.geom.util.GeometryCombiner.combine(o,n,r);return i},jsts.operation.union.UnionInteracting.prototype.bufferUnion=function(t,e){var o=t.getFactory(),n=o.createGeometryCollection([t,e]),r=n.buffer(0);return r},jsts.operation.union.UnionInteracting.prototype.computeInteracting=function(t){if(t){for(var e=!1,o=0,n=g1.getNumGeometries();n>o;o++){var r=this.g1.getGeometryN(o),i=r.getEnvelopeInternal().intersects(t.getEnvelopeInternal());i&&(this.interacts1[o]=!0,e=!0)}return e}for(var o=0,n=this.g0.getNumGeometries();n>o;o++){var s=this.g0.getGeometryN(o);this.interacts0[o]=this.computeInteracting(s)}},jsts.operation.union.UnionInteracting.prototype.extractElements=function(t,e,o){for(var n=[],r=0,i=t.getNumGeometries();i>r;r++){var s=t.getGeometryN(r);e[r]===o&&n.push(s)}return this.geomFactory.buildGeometry(n)},jsts.triangulate.quadedge.TrianglePredicate=function(){},jsts.triangulate.quadedge.TrianglePredicate.isInCircleNonRobust=function(t,e,o,n){var r=(t.x*t.x+t.y*t.y)*jsts.triangulate.quadedge.TrianglePredicate.triArea(e,o,n)-(e.x*e.x+e.y*e.y)*jsts.triangulate.quadedge.TrianglePredicate.triArea(t,o,n)+(o.x*o.x+o.y*o.y)*jsts.triangulate.quadedge.TrianglePredicate.triArea(t,e,n)-(n.x*n.x+n.y*n.y)*jsts.triangulate.quadedge.TrianglePredicate.triArea(t,e,o)>0;return r},jsts.triangulate.quadedge.TrianglePredicate.isInCircleNormalized=function(t,e,o,n){var r,i,s,a,u,p,g,l,h,d,c,m,f;return r=t.x-n.x,i=t.y-n.y,s=e.x-n.x,a=e.y-n.y,u=o.x-n.x,p=o.y-n.y,g=r*a-s*i,l=s*p-u*a,h=u*i-r*p,d=r*r+i*i,c=s*s+a*a,m=u*u+p*p,f=d*l+c*h+m*g,f>0},jsts.triangulate.quadedge.TrianglePredicate.triArea=function(t,e,o){return(e.x-t.x)*(o.y-t.y)-(e.y-t.y)*(o.x-t.x)},jsts.triangulate.quadedge.TrianglePredicate.isInCircleRobust=function(t,e,o,n){return jsts.triangulate.quadedge.TrianglePredicate.isInCircleNormalized(t,e,o,n)},jsts.triangulate.quadedge.TrianglePredicate.isInCircleDDSlow=function(t,e,o,n){var r,i,s,a,u,p,g,l,h,d,c,m,f,y;return r=jsts.math.DD.valueOf(n.x),i=jsts.math.DD.valueOf(n.y),s=jsts.math.DD.valueOf(t.x),a=jsts.math.DD.valueOf(t.y),u=jsts.math.DD.valueOf(e.x),p=jsts.math.DD.valueOf(e.y),g=jsts.math.DD.valueOf(o.x),l=jsts.math.DD.valueOf(o.y),h=s.multiply(s).add(a.multiply(a)).multiply(jsts.triangulate.quadedge.TrianglePredicate.triAreaDDSlow(u,p,g,l,r,i)),d=u.multiply(u).add(p.multiply(p)).multiply(jsts.triangulate.quadedge.TrianglePredicate.triAreaDDSlow(s,a,g,l,r,i)),c=g.multiply(g).add(l.multiply(l)).multiply(jsts.triangulate.quadedge.TrianglePredicate.triAreaDDSlow(s,a,u,p,r,i)),m=r.multiply(r).add(i.multiply(i)).multiply(jsts.triangulate.quadedge.TrianglePredicate.triAreaDDSlow(s,a,u,p,g,l)),f=h.subtract(d).add(c).subtract(m),y=f.doubleValue()>0},jsts.triangulate.quadedge.TrianglePredicate.triAreaDDSlow=function(t,e,o,n,r,i){return o.subtract(t).multiply(i.subtract(e)).subtract(n.subtract(e).multiply(r.subtract(t)))},jsts.triangulate.quadedge.TrianglePredicate.isInCircleDDFast=function(t,e,o,n){var r,i,s,a,u,p;return r=jsts.math.DD.sqr(t.x).selfAdd(jsts.math.DD.sqr(t.y)).selfMultiply(jsts.triangulate.quadedge.TrianglePredicate.triAreaDDFast(e,o,n)),i=jsts.math.DD.sqr(e.x).selfAdd(jsts.math.DD.sqr(e.y)).selfMultiply(jsts.triangulate.quadedge.TrianglePredicate.triAreaDDFast(t,o,n)),s=jsts.math.DD.sqr(o.x).selfAdd(jsts.math.DD.sqr(o.y)).selfMultiply(jsts.triangulate.quadedge.TrianglePredicate.triAreaDDFast(t,e,n)),a=jsts.math.DD.sqr(n.x).selfAdd(jsts.math.DD.sqr(n.y)).selfMultiply(jsts.triangulate.quadedge.TrianglePredicate.triAreaDDFast(t,e,o)),u=r.selfSubtract(i).selfAdd(s).selfSubtract(a),p=u.doubleValue()>0},jsts.triangulate.quadedge.TrianglePredicate.triAreaDDFast=function(t,e,o){var n,r;return n=jsts.math.DD.valueOf(e.x).selfSubtract(t.x).selfMultiply(jsts.math.DD.valueOf(o.y).selfSubtract(t.y)),r=jsts.math.DD.valueOf(e.y).selSubtract(t.y).selfMultiply(jsts.math.DD.valueOf(o.x).selfSubtract(t.x)),n.selfSubtract(r)},jsts.triangulate.quadedge.TrianglePredicate.isInCircleDDNormalized=function(t,e,o,n){var r,i,s,a,u,p,g,l,h,d,c,m,f,y;return r=jsts.math.DD.valueOf(t.x).selfSubtract(n.x),i=jsts.math.DD.valueOf(t.y).selfSubtract(n.y),s=jsts.math.DD.valueOf(e.x).selfSubtract(n.x),s=jsts.math.DD.valueOf(e.y).selfSubtract(n.y),u=jsts.math.DD.valueOf(o.x).selfSubtract(n.x),u=jsts.math.DD.valueOf(o.y).selfSubtract(n.y),g=r.multiply(a).selfSubtract(s.multiply(i)),l=s.multiply(p).selfSubtract(u.multiply(a)),h=u.multiply(i).selfSubtract(r.multiply(p)),d=r.multiply(r).selfAdd(i.multiply(i)),c=s.multiply(s).selfAdd(a.multiply(a)),m=u.multiply(u).selfAdd(p.multiply(p)),f=d.selfMultiply(l).selfAdd(c.selfMultiply(h)).selfAdd(m.selfMultiply(g)),y=f.doubleValue()>0},jsts.triangulate.quadedge.TrianglePredicate.isInCircleCC=function(t,e,o,n){var r,i,s;return r=jsts.geom.Triangle.circumcentre(t,e,o),i=t.distance(r),s=n.distance(r)-i,0>=s},jsts.operation.union.PointGeometryUnion=function(t,e){this.pointGeom=t,this.otherGeom=e,this.geomFact=e.getFactory()},jsts.operation.union.PointGeometryUnion.union=function(t,e){var o=new jsts.operation.union.PointGeometryUnion(t,e);return o.union()},jsts.operation.union.PointGeometryUnion.prototype.pointGeom=null,jsts.operation.union.PointGeometryUnion.prototype.otherGeom=null,jsts.operation.union.PointGeometryUnion.prototype.geomFact=null,jsts.operation.union.PointGeometryUnion.prototype.union=function(){for(var t=new jsts.algorithm.PointLocator,e=[],o=0,n=this.pointGeom.getNumGeometries();n>o;o++){var r=this.pointGeom.getGeometryN(o),i=r.getCoordinate(),s=t.locate(i,this.otherGeom);if(s===jsts.geom.Location.EXTERIOR){for(var a=!0,u=e.length;o--;)if(e[u].equals(i)){a=!1;break}a&&e.push(i)}}if(e.sort(function(t,e){return t.compareTo(e)}),0===e.length)return this.otherGeom;var p=null,g=jsts.geom.CoordinateArrays.toCoordinateArray(e);return p=1===g.length?this.geomFact.createPoint(g[0]):this.geomFact.createMultiPoint(g),jsts.geom.util.GeometryCombiner.combine(p,this.otherGeom)},jsts.noding.IntersectionFinderAdder=function(t){this.li=t,this.interiorIntersections=new javascript.util.ArrayList},jsts.noding.IntersectionFinderAdder.prototype=new jsts.noding.SegmentIntersector,jsts.noding.IntersectionFinderAdder.constructor=jsts.noding.IntersectionFinderAdder,jsts.noding.IntersectionFinderAdder.prototype.li=null,jsts.noding.IntersectionFinderAdder.prototype.interiorIntersections=null,jsts.noding.IntersectionFinderAdder.prototype.getInteriorIntersections=function(){return this.interiorIntersections},jsts.noding.IntersectionFinderAdder.prototype.processIntersections=function(t,e,o,n){if(t!==o||e!==n){var r=t.getCoordinates()[e],i=t.getCoordinates()[e+1],s=o.getCoordinates()[n],a=o.getCoordinates()[n+1];if(this.li.computeIntersection(r,i,s,a),this.li.hasIntersection()&&this.li.isInteriorIntersection()){for(var u=0;u<this.li.getIntersectionNum();u++)this.interiorIntersections.add(this.li.getIntersection(u));t.addIntersections(this.li,e,0),o.addIntersections(this.li,n,1)}}},jsts.noding.IntersectionFinderAdder.prototype.isDone=function(){return!1},jsts.noding.snapround.MCIndexSnapRounder=function(t){this.pm=t,this.li=new jsts.algorithm.RobustLineIntersector,this.li.setPrecisionModel(t),this.scaleFactor=t.getScale()},jsts.noding.snapround.MCIndexSnapRounder.prototype=new jsts.noding.Noder,jsts.noding.snapround.MCIndexSnapRounder.constructor=jsts.noding.snapround.MCIndexSnapRounder,jsts.noding.snapround.MCIndexSnapRounder.prototype.pm=null,jsts.noding.snapround.MCIndexSnapRounder.prototype.li=null,jsts.noding.snapround.MCIndexSnapRounder.prototype.scaleFactor=null,jsts.noding.snapround.MCIndexSnapRounder.prototype.noder=null,jsts.noding.snapround.MCIndexSnapRounder.prototype.pointSnapper=null,jsts.noding.snapround.MCIndexSnapRounder.prototype.nodedSegStrings=null,jsts.noding.snapround.MCIndexSnapRounder.prototype.getNodedSubstrings=function(){return jsts.noding.NodedSegmentString.getNodedSubstrings(this.nodedSegStrings)},jsts.noding.snapround.MCIndexSnapRounder.prototype.computeNodes=function(t){this.nodedSegStrings=t,this.noder=new jsts.noding.MCIndexNoder,this.pointSnapper=new jsts.noding.snapround.MCIndexPointSnapper(this.noder.getIndex()),this.snapRound(t,this.li)},jsts.noding.snapround.MCIndexSnapRounder.prototype.snapRound=function(t,e){var o=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(o),this.computeVertexSnaps(t)},jsts.noding.snapround.MCIndexSnapRounder.prototype.findInteriorIntersections=function(t,e){var o=new jsts.noding.IntersectionFinderAdder(e);return this.noder.setSegmentIntersector(o),this.noder.computeNodes(t),o.getInteriorIntersections()
},jsts.noding.snapround.MCIndexSnapRounder.prototype.computeIntersectionSnaps=function(t){for(var e=t.iterator();e.hasNext();){var o=e.next(),n=new jsts.noding.snapround.HotPixel(o,this.scaleFactor,this.li);this.pointSnapper.snap(n)}},jsts.noding.snapround.MCIndexSnapRounder.prototype.computeVertexSnaps=function(t){if(t instanceof jsts.noding.NodedSegmentString)return void this.computeVertexSnaps2.apply(this,arguments);for(var e=t.iterator();e.hasNext();){var o=e.next();this.computeVertexSnaps(o)}},jsts.noding.snapround.MCIndexSnapRounder.prototype.computeVertexSnaps2=function(t){for(var e=t.getCoordinates(),o=0;o<e.length-1;o++){var n=new jsts.noding.snapround.HotPixel(e[o],this.scaleFactor,this.li),r=this.pointSnapper.snap(n,t,o);r&&t.addIntersection(e[o],o)}},jsts.operation.valid.ConnectedInteriorTester=function(t){this.geomGraph=t,this.geometryFactory=new jsts.geom.GeometryFactory,this.disconnectedRingcoord=null},jsts.operation.valid.ConnectedInteriorTester.findDifferentPoint=function(t,e){var o=0,n=t.length;for(o;n>o;o++)if(!t[o].equals(e))return t[o];return null},jsts.operation.valid.ConnectedInteriorTester.prototype.getCoordinate=function(){return this.disconnectedRingcoord},jsts.operation.valid.ConnectedInteriorTester.prototype.isInteriorsConnected=function(){var t=new javascript.util.ArrayList;this.geomGraph.computeSplitEdges(t);var e=new jsts.geomgraph.PlanarGraph(new jsts.operation.overlay.OverlayNodeFactory);e.addEdges(t),this.setInteriorEdgesInResult(e),e.linkResultDirectedEdges();var o=this.buildEdgeRings(e.getEdgeEnds());return this.visitShellInteriors(this.geomGraph.getGeometry(),e),!this.hasUnvisitedShellEdge(o)},jsts.operation.valid.ConnectedInteriorTester.prototype.setInteriorEdgesInResult=function(t){for(var e,o=t.getEdgeEnds().iterator();o.hasNext();)e=o.next(),e.getLabel().getLocation(0,jsts.geomgraph.Position.RIGHT)==jsts.geom.Location.INTERIOR&&e.setInResult(!0)},jsts.operation.valid.ConnectedInteriorTester.prototype.buildEdgeRings=function(t){for(var e=new javascript.util.ArrayList,o=t.iterator();o.hasNext();){var n=o.next();if(n.isInResult()&&null==n.getEdgeRing()){var r=new jsts.operation.overlay.MaximalEdgeRing(n,this.geometryFactory);r.linkDirectedEdgesForMinimalEdgeRings();var i=r.buildMinimalRings(),s=0,a=i.length;for(s;a>s;s++)e.add(i[s])}}return e},jsts.operation.valid.ConnectedInteriorTester.prototype.visitShellInteriors=function(t,e){if(t instanceof jsts.geom.Polygon){var o=t;this.visitInteriorRing(o.getExteriorRing(),e)}if(t instanceof jsts.geom.MultiPolygon)for(var n=t,r=0;r<n.getNumGeometries();r++){var o=n.getGeometryN(r);this.visitInteriorRing(o.getExteriorRing(),e)}},jsts.operation.valid.ConnectedInteriorTester.prototype.visitInteriorRing=function(t,e){var o=t.getCoordinates(),n=o[0],r=jsts.operation.valid.ConnectedInteriorTester.findDifferentPoint(o,n),i=e.findEdgeInSameDirection(n,r),s=e.findEdgeEnd(i),a=null;s.getLabel().getLocation(0,jsts.geomgraph.Position.RIGHT)==jsts.geom.Location.INTERIOR?a=s:s.getSym().getLabel().getLocation(0,jsts.geomgraph.Position.RIGHT)==jsts.geom.Location.INTERIOR&&(a=s.getSym()),this.visitLinkedDirectedEdges(a)},jsts.operation.valid.ConnectedInteriorTester.prototype.visitLinkedDirectedEdges=function(t){var e=t,o=t;do o.setVisited(!0),o=o.getNext();while(o!=e)},jsts.operation.valid.ConnectedInteriorTester.prototype.hasUnvisitedShellEdge=function(t){for(var e=0;e<t.size();e++){var o=t.get(e);if(!o.isHole()){var n=o.getEdges(),r=n[0];if(r.getLabel().getLocation(0,jsts.geomgraph.Position.RIGHT)==jsts.geom.Location.INTERIOR)for(var i=0;i<n.length;i++)if(r=n[i],!r.isVisited())return disconnectedRingcoord=r.getCoordinate(),!0}}return!1},jsts.algorithm.InteriorPointLine=function(t){this.centroid,this.minDistance=Number.MAX_VALUE,this.interiorPoint=null,this.centroid=t.getCentroid().getCoordinate(),this.addInterior(t),null==this.interiorPoint&&this.addEndpoints(t)},jsts.algorithm.InteriorPointLine.prototype.getInteriorPoint=function(){return this.interiorPoint},jsts.algorithm.InteriorPointLine.prototype.addInterior=function(t){if(t instanceof jsts.geom.LineString)this.addInteriorCoord(t.getCoordinates());else if(t instanceof jsts.geom.GeometryCollection)for(var e=0;e<t.getNumGeometries();e++)this.addInterior(t.getGeometryN(e))},jsts.algorithm.InteriorPointLine.prototype.addInteriorCoord=function(t){for(var e=1;e<t.length-1;e++)this.add(t[e])},jsts.algorithm.InteriorPointLine.prototype.addEndpoints=function(t){if(t instanceof jsts.geom.LineString)this.addEndpointsCoord(t.getCoordinates());else if(t instanceof jsts.geom.GeometryCollection)for(var e=0;e<t.getNumGeometries();e++)this.addEndpoints(t.getGeometryN(e))},jsts.algorithm.InteriorPointLine.prototype.addEndpointsCoord=function(t){this.add(t[0]),this.add(t[t.length-1])},jsts.algorithm.InteriorPointLine.prototype.add=function(t){var e=t.distance(this.centroid);e<this.minDistance&&(this.interiorPoint=new jsts.geom.Coordinate(t),this.minDistance=e)},jsts.index.chain.MonotoneChainSelectAction=function(){this.tempEnv1=new jsts.geom.Envelope,this.selectedSegment=new jsts.geom.LineSegment},jsts.index.chain.MonotoneChainSelectAction.prototype.tempEnv1=null,jsts.index.chain.MonotoneChainSelectAction.prototype.selectedSegment=null,jsts.index.chain.MonotoneChainSelectAction.prototype.select=function(t,e){t.getLineSegment(e,this.selectedSegment),this.select2(this.selectedSegment)},jsts.index.chain.MonotoneChainSelectAction.prototype.select2=function(){},jsts.algorithm.MCPointInRing=function(t){this.ring=t,this.tree=null,this.crossings=0,this.interval=new jsts.index.bintree.Interval,this.buildIndex()},jsts.algorithm.MCPointInRing.MCSelecter=function(t,e){this.parent=e,this.p=t},jsts.algorithm.MCPointInRing.MCSelecter.prototype=new jsts.index.chain.MonotoneChainSelectAction,jsts.algorithm.MCPointInRing.MCSelecter.prototype.constructor=jsts.algorithm.MCPointInRing.MCSelecter,jsts.algorithm.MCPointInRing.MCSelecter.prototype.select2=function(t){this.parent.testLineSegment.apply(this.parent,[this.p,t])},jsts.algorithm.MCPointInRing.prototype.buildIndex=function(){this.tree=new jsts.index.bintree.Bintree;for(var t=jsts.geom.CoordinateArrays.removeRepeatedPoints(this.ring.getCoordinates()),e=jsts.index.chain.MonotoneChainBuilder.getChains(t),o=0;o<e.length;o++){var n=e[o],r=n.getEnvelope();this.interval.min=r.getMinY(),this.interval.max=r.getMaxY(),this.tree.insert(this.interval,n)}},jsts.algorithm.MCPointInRing.prototype.isInside=function(t){this.crossings=0;var e=new jsts.geom.Envelope(-Number.MAX_VALUE,Number.MAX_VALUE,t.y,t.y);this.interval.min=t.y,this.interval.max=t.y;for(var o=this.tree.query(this.interval),n=new jsts.algorithm.MCPointInRing.MCSelecter(t,this),r=o.iterator();r.hasNext();){var i=r.next();this.testMonotoneChain(e,n,i)}return this.crossings%2==1?!0:!1},jsts.algorithm.MCPointInRing.prototype.testMonotoneChain=function(t,e,o){o.select(t,e)},jsts.algorithm.MCPointInRing.prototype.testLineSegment=function(t,e){var o,n,r,i,s,a,u;a=e.p0,u=e.p1,n=a.x-t.x,r=a.y-t.y,i=u.x-t.x,s=u.y-t.y,(r>0&&0>=s||s>0&&0>=r)&&(o=jsts.algorithm.RobustDeterminant.signOfDet2x2(n,r,i,s)/(s-r),o>0&&this.crossings++)},jsts.operation.valid.TopologyValidationError=function(t,e){this.errorType=t,this.pt=null,null!=e&&(this.pt=e.clone())},jsts.operation.valid.TopologyValidationError.HOLE_OUTSIDE_SHELL=2,jsts.operation.valid.TopologyValidationError.NESTED_HOLES=3,jsts.operation.valid.TopologyValidationError.DISCONNECTED_INTERIOR=4,jsts.operation.valid.TopologyValidationError.SELF_INTERSECTION=5,jsts.operation.valid.TopologyValidationError.RING_SELF_INTERSECTION=6,jsts.operation.valid.TopologyValidationError.NESTED_SHELLS=7,jsts.operation.valid.TopologyValidationError.DUPLICATE_RINGS=8,jsts.operation.valid.TopologyValidationError.TOO_FEW_POINTS=9,jsts.operation.valid.TopologyValidationError.INVALID_COORDINATE=10,jsts.operation.valid.TopologyValidationError.RING_NOT_CLOSED=11,jsts.operation.valid.TopologyValidationError.prototype.errMsg=["Topology Validation Error","Repeated Point","Hole lies outside shell","Holes are nested","Interior is disconnected","Self-intersection","Ring Self-intersection","Nested shells","Duplicate Rings","Too few distinct points in geometry component","Invalid Coordinate","Ring is not closed"],jsts.operation.valid.TopologyValidationError.prototype.getCoordinate=function(){return this.pt},jsts.operation.valid.TopologyValidationError.prototype.getErrorType=function(){return this.errorType},jsts.operation.valid.TopologyValidationError.prototype.getMessage=function(){return this.errMsg[this.errorType]},jsts.operation.valid.TopologyValidationError.prototype.toString=function(){var t="";return null!=this.pt?(t=" at or near point "+this.pt,this.getMessage()+t):t},function(){jsts.geom.MultiPolygon=function(t,e){this.geometries=t||[],this.factory=e},jsts.geom.MultiPolygon.prototype=new jsts.geom.GeometryCollection,jsts.geom.MultiPolygon.constructor=jsts.geom.MultiPolygon,jsts.geom.MultiPolygon.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString(null);for(var t=[],e=0;e<this.geometries.length;e++)for(var o=this.geometries[e],n=o.getBoundary(),r=0;r<n.getNumGeometries();r++)t.push(n.getGeometryN(r));return this.getFactory().createMultiLineString(t)},jsts.geom.MultiPolygon.prototype.equalsExact=function(t,e){return this.isEquivalentClass(t)?jsts.geom.GeometryCollection.prototype.equalsExact.call(this,t,e):!1},jsts.geom.MultiPolygon.prototype.CLASS_NAME="jsts.geom.MultiPolygon"}(),jsts.geom.CoordinateSequenceFilter=function(){},jsts.geom.CoordinateSequenceFilter.prototype.filter=jsts.abstractFunc,jsts.geom.CoordinateSequenceFilter.prototype.isDone=jsts.abstractFunc,jsts.geom.CoordinateSequenceFilter.prototype.isGeometryChanged=jsts.abstractFunc,function(){var t=function(){if(this.min=0,this.max=0,1===arguments.length){var t=arguments[0];this.init(t.min,t.max)}else 2===arguments.length&&this.init(arguments[0],arguments[1])};t.prototype.init=function(t,e){this.min=t,this.max=e,t>e&&(this.min=e,this.max=t)},t.prototype.getMin=function(){return this.min},t.prototype.getMax=function(){return this.max},t.prototype.getWidth=function(){return this.max-this.min},t.prototype.expandToInclude=function(t){t.max>this.max&&(this.max=t.max),t.min<this.min&&(this.min=t.min)},t.prototype.overlaps=function(){return 1===arguments.length?this.overlapsInterval.apply(this,arguments):this.overlapsMinMax.apply(this,arguments)},t.prototype.overlapsInterval=function(t){return this.overlaps(t.min,t.max)},t.prototype.overlapsMinMax=function(t,e){return this.min>e||this.max<t?!1:!0},t.prototype.contains=function(){var t;return arguments[0]instanceof jsts.index.bintree.Interval?(t=arguments[0],this.containsMinMax(t.min,t.max)):1===arguments.length?this.containsPoint(arguments[0]):this.containsMinMax(arguments[0],arguments[1])},t.prototype.containsMinMax=function(t,e){return t>=this.min&&e<=this.max},t.prototype.containsPoint=function(t){return t>=this.min&&t<=this.max},jsts.index.bintree.Interval=t}(),jsts.index.DoubleBits=function(){},jsts.index.DoubleBits.powerOf2=function(t){return Math.pow(2,t)},jsts.index.DoubleBits.exponent=function(t){return jsts.index.DoubleBits.CVTFWD(64,t)-1023},jsts.index.DoubleBits.CVTFWD=function(t,e){var o,n,r,i,s="",a={32:{d:127,c:128,b:0,a:0},64:{d:32752,c:0,b:0,a:0}},u={32:8,64:11}[t];if(i||(o=0>e||0>1/e,isFinite(e)||(i=a[t],o&&(i.d+=1<<t/4-1),n=Math.pow(2,u)-1,r=0)),!i){for(n={32:127,64:1023}[t],r=Math.abs(e);r>=2;)n++,r/=2;for(;1>r&&n>0;)n--,r*=2;0>=n&&(r/=2,s="Zero or Denormal"),32===t&&n>254&&(s="Too big for Single",i={d:o?255:127,c:128,b:0,a:0},n=Math.pow(2,u)-1,r=0)}return n},function(){var t=jsts.index.DoubleBits,e=jsts.index.bintree.Interval,o=function(t){this.pt=0,this.level=0,this.computeKey(t)};o.computeLevel=function(e){var o,n=e.getWidth();return o=t.exponent(n)+1},o.prototype.getPoint=function(){return this.pt},o.prototype.getLevel=function(){return this.level},o.prototype.getInterval=function(){return this.interval},o.prototype.computeKey=function(t){for(this.level=o.computeLevel(t),this.interval=new e,this.computeInterval(this.level,t);!this.interval.contains(t);)this.level+=1,this.computeInterval(this.level,t)},o.prototype.computeInterval=function(e,o){var n=t.powerOf2(e);this.pt=Math.floor(o.getMin()/n)*n,this.interval.init(this.pt,this.pt+n)},jsts.index.bintree.Key=o}(),jsts.operation.buffer.SubgraphDepthLocater=function(t){this.subgraphs=[],this.seg=new jsts.geom.LineSegment,this.subgraphs=t},jsts.operation.buffer.SubgraphDepthLocater.prototype.subgraphs=null,jsts.operation.buffer.SubgraphDepthLocater.prototype.seg=null,jsts.operation.buffer.SubgraphDepthLocater.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);if(0===e.length)return 0;e.sort();var o=e[0];return o.leftDepth},jsts.operation.buffer.SubgraphDepthLocater.prototype.findStabbedSegments=function(t){if(3===arguments.length)return void this.findStabbedSegments2.apply(this,arguments);for(var e=[],o=0;o<this.subgraphs.length;o++){var n=this.subgraphs[o],r=n.getEnvelope();t.y<r.getMinY()||t.y>r.getMaxY()||this.findStabbedSegments2(t,n.getDirectedEdges(),e)}return e},jsts.operation.buffer.SubgraphDepthLocater.prototype.findStabbedSegments2=function(t,e,o){if(arguments[1]instanceof jsts.geomgraph.DirectedEdge)return void this.findStabbedSegments3(t,e,o);for(var n=e.iterator();n.hasNext();){var r=n.next();r.isForward()&&this.findStabbedSegments3(t,r,o)}},jsts.operation.buffer.SubgraphDepthLocater.prototype.findStabbedSegments3=function(t,e,o){for(var n=e.getEdge().getCoordinates(),r=0;r<n.length-1;r++){this.seg.p0=n[r],this.seg.p1=n[r+1],this.seg.p0.y>this.seg.p1.y&&this.seg.reverse();var i=Math.max(this.seg.p0.x,this.seg.p1.x);if(!(i<t.x||this.seg.isHorizontal()||t.y<this.seg.p0.y||t.y>this.seg.p1.y||jsts.algorithm.CGAlgorithms.computeOrientation(this.seg.p0,this.seg.p1,t)===jsts.algorithm.CGAlgorithms.RIGHT)){var s=e.getDepth(jsts.geomgraph.Position.LEFT);this.seg.p0.equals(n[r])||(s=e.getDepth(jsts.geomgraph.Position.RIGHT));var a=new jsts.operation.buffer.SubgraphDepthLocater.DepthSegment(this.seg,s);o.push(a)}}},jsts.operation.buffer.SubgraphDepthLocater.DepthSegment=function(t,e){this.upwardSeg=new jsts.geom.LineSegment(t),this.leftDepth=e},jsts.operation.buffer.SubgraphDepthLocater.DepthSegment.prototype.upwardSeg=null,jsts.operation.buffer.SubgraphDepthLocater.DepthSegment.prototype.leftDepth=null,jsts.operation.buffer.SubgraphDepthLocater.DepthSegment.prototype.compareTo=function(t){var e=t,o=this.upwardSeg.orientationIndex(e.upwardSeg);return 0===o&&(o=-1*e.upwardSeg.orientationIndex(upwardSeg)),0!==o?o:this.compareX(this.upwardSeg,e.upwardSeg)},jsts.operation.buffer.SubgraphDepthLocater.DepthSegment.prototype.compareX=function(t,e){var o=t.p0.compareTo(e.p0);return 0!==o?o:t.p1.compareTo(e.p1)},jsts.noding.snapround.HotPixel=function(t,e,o){this.corner=[],this.originalPt=t,this.pt=t,this.scaleFactor=e,this.li=o,1!==this.scaleFactor&&(this.pt=new jsts.geom.Coordinate(this.scale(t.x),this.scale(t.y)),this.p0Scaled=new jsts.geom.Coordinate,this.p1Scaled=new jsts.geom.Coordinate),this.initCorners(this.pt)},jsts.noding.snapround.HotPixel.prototype.li=null,jsts.noding.snapround.HotPixel.prototype.pt=null,jsts.noding.snapround.HotPixel.prototype.originalPt=null,jsts.noding.snapround.HotPixel.prototype.ptScaled=null,jsts.noding.snapround.HotPixel.prototype.p0Scaled=null,jsts.noding.snapround.HotPixel.prototype.p1Scaled=null,jsts.noding.snapround.HotPixel.prototype.scaleFactor=void 0,jsts.noding.snapround.HotPixel.prototype.minx=void 0,jsts.noding.snapround.HotPixel.prototype.maxx=void 0,jsts.noding.snapround.HotPixel.prototype.miny=void 0,jsts.noding.snapround.HotPixel.prototype.maxy=void 0,jsts.noding.snapround.HotPixel.prototype.corner=null,jsts.noding.snapround.HotPixel.prototype.safeEnv=null,jsts.noding.snapround.HotPixel.prototype.getCoordinate=function(){return this.originalPt},jsts.noding.snapround.HotPixel.SAFE_ENV_EXPANSION_FACTOR=.75,jsts.noding.snapround.HotPixel.prototype.getSafeEnvelope=function(){if(null===this.safeEnv){var t=jsts.noding.snapround.HotPixel.SAFE_ENV_EXPANSION_FACTOR/this.scaleFactor;this.safeEnv=new jsts.geom.Envelope(this.originalPt.x-t,this.originalPt.x+t,this.originalPt.y-t,this.originalPt.y+t)}return this.safeEnv},jsts.noding.snapround.HotPixel.prototype.initCorners=function(t){var e=.5;this.minx=t.x-e,this.maxx=t.x+e,this.miny=t.y-e,this.maxy=t.y+e,this.corner[0]=new jsts.geom.Coordinate(this.maxx,this.maxy),this.corner[1]=new jsts.geom.Coordinate(this.minx,this.maxy),this.corner[2]=new jsts.geom.Coordinate(this.minx,this.miny),this.corner[3]=new jsts.geom.Coordinate(this.maxx,this.miny)},jsts.noding.snapround.HotPixel.prototype.scale=function(t){return Math.round(t*this.scaleFactor)},jsts.noding.snapround.HotPixel.prototype.intersects=function(t,e){return 1===this.scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this.p0Scaled),this.copyScaled(e,this.p1Scaled),this.intersectsScaled(this.p0Scaled,this.p1Scaled))},jsts.noding.snapround.HotPixel.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},jsts.noding.snapround.HotPixel.prototype.intersectsScaled=function(t,e){var o=Math.min(t.x,e.x),n=Math.max(t.x,e.x),r=Math.min(t.y,e.y),i=Math.max(t.y,e.y),s=this.maxx<o||this.minx>n||this.maxy<r||this.miny>i;if(s)return!1;var a=this.intersectsToleranceSquare(t,e);return jsts.util.Assert.isTrue(!(s&&a),"Found bad envelope test"),a},jsts.noding.snapround.HotPixel.prototype.intersectsToleranceSquare=function(t,e){var o=!1,n=!1;return this.li.computeIntersection(t,e,this.corner[0],this.corner[1]),this.li.isProper()?!0:(this.li.computeIntersection(t,e,this.corner[1],this.corner[2]),this.li.isProper()?!0:(this.li.hasIntersection()&&(o=!0),this.li.computeIntersection(t,e,this.corner[2],this.corner[3]),this.li.isProper()?!0:(this.li.hasIntersection()&&(n=!0),this.li.computeIntersection(t,e,this.corner[3],this.corner[0]),this.li.isProper()?!0:o&&n?!0:t.equals(this.pt)?!0:e.equals(this.pt)?!0:!1)))},jsts.noding.snapround.HotPixel.prototype.intersectsPixelClosure=function(t,e){return this.li.computeIntersection(t,e,this.corner[0],this.corner[1]),this.li.hasIntersection()?!0:(this.li.computeIntersection(t,e,this.corner[1],this.corner[2]),this.li.hasIntersection()?!0:(this.li.computeIntersection(t,e,this.corner[2],this.corner[3]),this.li.hasIntersection()?!0:(this.li.computeIntersection(t,e,this.corner[3],this.corner[0]),this.li.hasIntersection()?!0:!1)))},jsts.noding.snapround.HotPixel.prototype.addSnappedNode=function(t,e){var o=t.getCoordinate(e),n=t.getCoordinate(e+1);return this.intersects(o,n)?(t.addIntersection(this.getCoordinate(),e),!0):!1},jsts.operation.buffer.BufferInputLineSimplifier=function(t){this.inputLine=t},jsts.operation.buffer.BufferInputLineSimplifier.simplify=function(t,e){var o=new jsts.operation.buffer.BufferInputLineSimplifier(t);return o.simplify(e)},jsts.operation.buffer.BufferInputLineSimplifier.INIT=0,jsts.operation.buffer.BufferInputLineSimplifier.DELETE=1,jsts.operation.buffer.BufferInputLineSimplifier.KEEP=1,jsts.operation.buffer.BufferInputLineSimplifier.prototype.inputLine=null,jsts.operation.buffer.BufferInputLineSimplifier.prototype.distanceTol=null,jsts.operation.buffer.BufferInputLineSimplifier.prototype.isDeleted=null,jsts.operation.buffer.BufferInputLineSimplifier.prototype.angleOrientation=jsts.algorithm.CGAlgorithms.COUNTERCLOCKWISE,jsts.operation.buffer.BufferInputLineSimplifier.prototype.simplify=function(t){this.distanceTol=Math.abs(t),0>t&&(this.angleOrientation=jsts.algorithm.CGAlgorithms.CLOCKWISE),this.isDeleted=[],this.isDeleted.length=this.inputLine.length;var e=!1;do e=this.deleteShallowConcavities();while(e);return this.collapseLine()},jsts.operation.buffer.BufferInputLineSimplifier.prototype.deleteShallowConcavities=function(){for(var t=1,e=(this.inputLine.length-1,this.findNextNonDeletedIndex(t)),o=this.findNextNonDeletedIndex(e),n=!1;o<this.inputLine.length;){var r=!1;this.isDeletable(t,e,o,this.distanceTol)&&(this.isDeleted[e]=jsts.operation.buffer.BufferInputLineSimplifier.DELETE,r=!0,n=!0),t=r?o:e,e=this.findNextNonDeletedIndex(t),o=this.findNextNonDeletedIndex(e)}return n},jsts.operation.buffer.BufferInputLineSimplifier.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this.inputLine.length&&this.isDeleted[e]===jsts.operation.buffer.BufferInputLineSimplifier.DELETE;)e++;return e},jsts.operation.buffer.BufferInputLineSimplifier.prototype.collapseLine=function(){for(var t=[],e=0;e<this.inputLine.length;e++)this.isDeleted[e]!==jsts.operation.buffer.BufferInputLineSimplifier.DELETE&&t.push(this.inputLine[e]);return t},jsts.operation.buffer.BufferInputLineSimplifier.prototype.isDeletable=function(t,e,o,n){var r=this.inputLine[t],i=this.inputLine[e],s=this.inputLine[o];return this.isConcave(r,i,s)&&this.isShallow(r,i,s,n)?this.isShallowSampled(r,i,t,o,n):!1},jsts.operation.buffer.BufferInputLineSimplifier.prototype.isShallowConcavity=function(t,e,o,n){var r=jsts.algorithm.CGAlgorithms.computeOrientation(t,e,o),i=r===this.angleOrientation;if(!i)return!1;var s=jsts.algorithm.CGAlgorithms.distancePointLine(e,t,o);return n>s},jsts.operation.buffer.BufferInputLineSimplifier.NUM_PTS_TO_CHECK=10,jsts.operation.buffer.BufferInputLineSimplifier.prototype.isShallowSampled=function(t,e,o,n,r){var i=parseInt((n-o)/jsts.operation.buffer.BufferInputLineSimplifier.NUM_PTS_TO_CHECK);0>=i&&(i=1);for(var s=o;n>s;s+=i)if(!this.isShallow(t,e,this.inputLine[s],r))return!1;return!0},jsts.operation.buffer.BufferInputLineSimplifier.prototype.isShallow=function(t,e,o,n){var r=jsts.algorithm.CGAlgorithms.distancePointLine(e,t,o);return n>r},jsts.operation.buffer.BufferInputLineSimplifier.prototype.isConcave=function(t,e,o){var n=jsts.algorithm.CGAlgorithms.computeOrientation(t,e,o),r=n===this.angleOrientation;return r},jsts.geomgraph.index.SweepLineEvent=function(t,e,o){return e instanceof jsts.geomgraph.index.SweepLineEvent?(this.eventType=jsts.geomgraph.index.SweepLineEvent.DELETE,this.xValue=t,void(this.insertEvent=e)):(this.eventType=jsts.geomgraph.index.SweepLineEvent.INSERT,this.label=o,this.xValue=t,void(this.obj=e))},jsts.geomgraph.index.SweepLineEvent.INSERT=1,jsts.geomgraph.index.SweepLineEvent.DELETE=2,jsts.geomgraph.index.SweepLineEvent.prototype.label=null,jsts.geomgraph.index.SweepLineEvent.prototype.xValue=null,jsts.geomgraph.index.SweepLineEvent.prototype.eventType=null,jsts.geomgraph.index.SweepLineEvent.prototype.insertEvent=null,jsts.geomgraph.index.SweepLineEvent.prototype.deleteEventIndex=null,jsts.geomgraph.index.SweepLineEvent.prototype.obj=null,jsts.geomgraph.index.SweepLineEvent.prototype.isInsert=function(){return this.eventType==jsts.geomgraph.index.SweepLineEvent.INSERT},jsts.geomgraph.index.SweepLineEvent.prototype.isDelete=function(){return this.eventType==jsts.geomgraph.index.SweepLineEvent.DELETE},jsts.geomgraph.index.SweepLineEvent.prototype.getInsertEvent=function(){return this.insertEvent},jsts.geomgraph.index.SweepLineEvent.prototype.getDeleteEventIndex=function(){return this.deleteEventIndex},jsts.geomgraph.index.SweepLineEvent.prototype.setDeleteEventIndex=function(t){this.deleteEventIndex=t},jsts.geomgraph.index.SweepLineEvent.prototype.getObject=function(){return this.obj},jsts.geomgraph.index.SweepLineEvent.prototype.isSameLabel=function(t){return null==this.label?!1:this.label==t.label},jsts.geomgraph.index.SweepLineEvent.prototype.compareTo=function(t){return this.xValue<t.xValue?-1:this.xValue>t.xValue?1:this.eventType<t.eventType?-1:this.eventType>t.eventType?1:0},jsts.geom.CoordinateList=function(t,e){this.array=[],e=void 0===e?!0:e,void 0!==t&&this.add(t,e)},jsts.geom.CoordinateList.prototype=new javascript.util.ArrayList,jsts.geom.CoordinateList.prototype.iterator=null,jsts.geom.CoordinateList.prototype.remove=null,jsts.geom.CoordinateList.prototype.get=function(t){return this.array[t]},jsts.geom.CoordinateList.prototype.set=function(t,e){var o=this.array[t];return this.array[t]=e,o},jsts.geom.CoordinateList.prototype.size=function(){return this.array.length},jsts.geom.CoordinateList.prototype.add=function(){return arguments.length>1?this.addCoordinates.apply(this,arguments):this.array.push(arguments[0])},jsts.geom.CoordinateList.prototype.addCoordinates=function(t,e,o){if(t instanceof jsts.geom.Coordinate)return this.addCoordinate.apply(this,arguments);if("number"==typeof t)return this.insertCoordinate.apply(this,arguments);if(o=o||!0)for(var n=0;n<t.length;n++)this.addCoordinate(t[n],e);else for(var n=t.length-1;n>=0;n--)this.addCoordinate(t[n],e);return!0},jsts.geom.CoordinateList.prototype.addCoordinate=function(t,e){if(!e&&this.size()>=1){var o=this.get(this.size()-1);if(o.equals2D(t))return}this.add(t)},jsts.geom.CoordinateList.prototype.insertCoordinate=function(t,e,o){if(!o){var n=t>0?t-1:-1;if(-1!==n&&this.get(n).equals2D(e))return;var r=t<this.size()-1?t+1:-1;if(-1!==r&&this.get(r).equals2D(e))return}this.array.splice(t,0,e)},jsts.geom.CoordinateList.prototype.closeRing=function(){this.size()>0&&this.addCoordinate(new jsts.geom.Coordinate(this.get(0)),!1)},jsts.geom.CoordinateList.prototype.toArray=function(){return this.array},jsts.geom.CoordinateList.prototype.toCoordinateArray=function(){return this.array},jsts.operation.buffer.OffsetSegmentGenerator=function(t,e,o){this.seg0=new jsts.geom.LineSegment,this.seg1=new jsts.geom.LineSegment,this.offset0=new jsts.geom.LineSegment,this.offset1=new jsts.geom.LineSegment,this.precisionModel=t,this.bufParams=e,this.li=new jsts.algorithm.RobustLineIntersector,this.filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),this.bufParams.getQuadrantSegments()>=8&&this.bufParams.getJoinStyle()===jsts.operation.buffer.BufferParameters.JOIN_ROUND&&(this.closingSegLengthFactor=jsts.operation.buffer.OffsetSegmentGenerator.MAX_CLOSING_SEG_LEN_FACTOR),this.init(o)},jsts.operation.buffer.OffsetSegmentGenerator.OFFSET_SEGMENT_SEPARATION_FACTOR=.001,jsts.operation.buffer.OffsetSegmentGenerator.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR=.001,jsts.operation.buffer.OffsetSegmentGenerator.CURVE_VERTEX_SNAP_DISTANCE_FACTOR=1e-6,jsts.operation.buffer.OffsetSegmentGenerator.MAX_CLOSING_SEG_LEN_FACTOR=80,jsts.operation.buffer.OffsetSegmentGenerator.prototype.maxCurveSegmentError=0,jsts.operation.buffer.OffsetSegmentGenerator.prototype.filletAngleQuantum=null,jsts.operation.buffer.OffsetSegmentGenerator.prototype.closingSegLengthFactor=1,jsts.operation.buffer.OffsetSegmentGenerator.prototype.segList=null,jsts.operation.buffer.OffsetSegmentGenerator.prototype.distance=0,jsts.operation.buffer.OffsetSegmentGenerator.prototype.precisionModel=null,jsts.operation.buffer.OffsetSegmentGenerator.prototype.bufParams=null,jsts.operation.buffer.OffsetSegmentGenerator.prototype.li=null,jsts.operation.buffer.OffsetSegmentGenerator.prototype.s0=null,jsts.operation.buffer.OffsetSegmentGenerator.prototype.s1=null,jsts.operation.buffer.OffsetSegmentGenerator.prototype.s2=null,jsts.operation.buffer.OffsetSegmentGenerator.prototype.seg0=null,jsts.operation.buffer.OffsetSegmentGenerator.prototype.seg1=null,jsts.operation.buffer.OffsetSegmentGenerator.prototype.offset0=null,jsts.operation.buffer.OffsetSegmentGenerator.prototype.offset1=null,jsts.operation.buffer.OffsetSegmentGenerator.prototype.side=0,jsts.operation.buffer.OffsetSegmentGenerator.prototype.hasNarrowConcaveAngle=!1,jsts.operation.buffer.OffsetSegmentGenerator.prototype.hasNarrowConcaveAngle=function(){return this.hasNarrowConcaveAngle},jsts.operation.buffer.OffsetSegmentGenerator.prototype.init=function(t){this.distance=t,this.maxCurveSegmentError=this.distance*(1-Math.cos(this.filletAngleQuantum/2)),this.segList=new jsts.operation.buffer.OffsetSegmentString,this.segList.setPrecisionModel(this.precisionModel),this.segList.setMinimumVertexDistance(this.distance*jsts.operation.buffer.OffsetSegmentGenerator.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},jsts.operation.buffer.OffsetSegmentGenerator.prototype.initSideSegments=function(t,e,o){this.s1=t,this.s2=e,this.side=o,this.seg1.setCoordinates(this.s1,this.s2),this.computeOffsetSegment(this.seg1,this.side,this.distance,this.offset1)},jsts.operation.buffer.OffsetSegmentGenerator.prototype.getCoordinates=function(){return this.segList.getCoordinates()},jsts.operation.buffer.OffsetSegmentGenerator.prototype.closeRing=function(){this.segList.closeRing()},jsts.operation.buffer.OffsetSegmentGenerator.prototype.addSegments=function(t,e){this.segList.addPts(t,e)},jsts.operation.buffer.OffsetSegmentGenerator.prototype.addFirstSegment=function(){this.segList.addPt(this.offset1.p0)},jsts.operation.buffer.OffsetSegmentGenerator.prototype.addLastSegment=function(){this.segList.addPt(this.offset1.p1)},jsts.operation.buffer.OffsetSegmentGenerator.prototype.addNextSegment=function(t,e){if(this.s0=this.s1,this.s1=this.s2,this.s2=t,this.seg0.setCoordinates(this.s0,this.s1),this.computeOffsetSegment(this.seg0,this.side,this.distance,this.offset0),this.seg1.setCoordinates(this.s1,this.s2),this.computeOffsetSegment(this.seg1,this.side,this.distance,this.offset1),!this.s1.equals(this.s2)){var o=jsts.algorithm.CGAlgorithms.computeOrientation(this.s0,this.s1,this.s2),n=o===jsts.algorithm.CGAlgorithms.CLOCKWISE&&this.side===jsts.geomgraph.Position.LEFT||o===jsts.algorithm.CGAlgorithms.COUNTERCLOCKWISE&&this.side===jsts.geomgraph.Position.RIGHT;0==o?this.addCollinear(e):n?this.addOutsideTurn(o,e):this.addInsideTurn(o,e)}},jsts.operation.buffer.OffsetSegmentGenerator.prototype.addCollinear=function(t){this.li.computeIntersection(this.s0,this.s1,this.s1,this.s2);var e=this.li.getIntersectionNum();e>=2&&(this.bufParams.getJoinStyle()===jsts.operation.buffer.BufferParameters.JOIN_BEVEL||this.bufParams.getJoinStyle()===jsts.operation.buffer.BufferParameters.JOIN_MITRE?(t&&this.segList.addPt(this.offset0.p1),this.segList.addPt(this.offset1.p0)):this.addFillet(this.s1,this.offset0.p1,this.offset1.p0,jsts.algorithm.CGAlgorithms.CLOCKWISE,this.distance))},jsts.operation.buffer.OffsetSegmentGenerator.prototype.addOutsideTurn=function(t,e){return this.offset0.p1.distance(this.offset1.p0)<this.distance*jsts.operation.buffer.OffsetSegmentGenerator.OFFSET_SEGMENT_SEPARATION_FACTOR?void this.segList.addPt(this.offset0.p1):void(this.bufParams.getJoinStyle()===jsts.operation.buffer.BufferParameters.JOIN_MITRE?this.addMitreJoin(this.s1,this.offset0,this.offset1,this.distance):this.bufParams.getJoinStyle()===jsts.operation.buffer.BufferParameters.JOIN_BEVEL?this.addBevelJoin(this.offset0,this.offset1):(e&&this.segList.addPt(this.offset0.p1),this.addFillet(this.s1,this.offset0.p1,this.offset1.p0,t,this.distance),this.segList.addPt(this.offset1.p0)))},jsts.operation.buffer.OffsetSegmentGenerator.prototype.addInsideTurn=function(){if(this.li.computeIntersection(this.offset0.p0,this.offset0.p1,this.offset1.p0,this.offset1.p1),this.li.hasIntersection())this.segList.addPt(this.li.getIntersection(0));else if(this.hasNarrowConcaveAngle=!0,this.offset0.p1.distance(this.offset1.p0)<this.distance*jsts.operation.buffer.OffsetSegmentGenerator.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this.segList.addPt(this.offset0.p1);else{if(this.segList.addPt(this.offset0.p1),this.closingSegLengthFactor>0){var t=new jsts.geom.Coordinate((this.closingSegLengthFactor*this.offset0.p1.x+this.s1.x)/(this.closingSegLengthFactor+1),(this.closingSegLengthFactor*this.offset0.p1.y+this.s1.y)/(this.closingSegLengthFactor+1));this.segList.addPt(t);var e=new jsts.geom.Coordinate((this.closingSegLengthFactor*this.offset1.p0.x+this.s1.x)/(this.closingSegLengthFactor+1),(this.closingSegLengthFactor*this.offset1.p0.y+this.s1.y)/(this.closingSegLengthFactor+1));this.segList.addPt(e)}else this.segList.addPt(this.s1);this.segList.addPt(this.offset1.p0)}},jsts.operation.buffer.OffsetSegmentGenerator.prototype.computeOffsetSegment=function(t,e,o,n){var r=e===jsts.geomgraph.Position.LEFT?1:-1,i=t.p1.x-t.p0.x,s=t.p1.y-t.p0.y,a=Math.sqrt(i*i+s*s),u=r*o*i/a,p=r*o*s/a;n.p0.x=t.p0.x-p,n.p0.y=t.p0.y+u,n.p1.x=t.p1.x-p,n.p1.y=t.p1.y+u
},jsts.operation.buffer.OffsetSegmentGenerator.prototype.addLineEndCap=function(t,e){var o=new jsts.geom.LineSegment(t,e),n=new jsts.geom.LineSegment;this.computeOffsetSegment(o,jsts.geomgraph.Position.LEFT,this.distance,n);var r=new jsts.geom.LineSegment;this.computeOffsetSegment(o,jsts.geomgraph.Position.RIGHT,this.distance,r);var i=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,i);switch(this.bufParams.getEndCapStyle()){case jsts.operation.buffer.BufferParameters.CAP_ROUND:this.segList.addPt(n.p1),this.addFillet(e,a+Math.PI/2,a-Math.PI/2,jsts.algorithm.CGAlgorithms.CLOCKWISE,this.distance),this.segList.addPt(r.p1);break;case jsts.operation.buffer.BufferParameters.CAP_FLAT:this.segList.addPt(n.p1),this.segList.addPt(r.p1);break;case jsts.operation.buffer.BufferParameters.CAP_SQUARE:var u=new jsts.geom.Coordinate;u.x=Math.abs(this.distance)*Math.cos(a),u.y=Math.abs(this.distance)*Math.sin(a);var p=new jsts.geom.Coordinate(n.p1.x+u.x,n.p1.y+u.y),g=new jsts.geom.Coordinate(r.p1.x+u.x,r.p1.y+u.y);this.segList.addPt(p),this.segList.addPt(g)}},jsts.operation.buffer.OffsetSegmentGenerator.prototype.addMitreJoin=function(t,e,o,n){var r=!0,i=null;try{i=jsts.algorithm.HCoordinate.intersection(e.p0,e.p1,o.p0,o.p1);var s=0>=n?1:i.distance(t)/Math.abs(n);s>this.bufParams.getMitreLimit()&&(this.isMitreWithinLimit=!1)}catch(a){a instanceof jsts.error.NotRepresentableError&&(i=new jsts.geom.Coordinate(0,0),this.isMitreWithinLimit=!1)}r?this.segList.addPt(i):this.addLimitedMitreJoin(e,o,n,bufParams.getMitreLimit())},jsts.operation.buffer.OffsetSegmentGenerator.prototype.addLimitedMitreJoin=function(t,e,o,n){var r=this.seg0.p1,i=jsts.algorithm.Angle.angle(r,this.seg0.p0),s=(jsts.algorithm.Angle.angle(r,this.seg1.p1),jsts.algorithm.Angle.angleBetweenOriented(this.seg0.p0,r,this.seg1.p1)),a=s/2,u=jsts.algorithm.Angle.normalize(i+a),p=jsts.algorithm.Angle.normalize(u+Math.PI),g=n*o,l=g*Math.abs(Math.sin(a)),h=o-l,d=r.x+g*Math.cos(p),c=r.y+g*Math.sin(p),m=new jsts.geom.Coordinate(d,c),f=new jsts.geom.LineSegment(r,m),y=f.pointAlongOffset(1,h),j=f.pointAlongOffset(1,-h);this.side==jsts.geomgraph.Position.LEFT?(this.segList.addPt(y),this.segList.addPt(j)):(this.segList.addPt(j),this.segList.addPt(y))},jsts.operation.buffer.OffsetSegmentGenerator.prototype.addBevelJoin=function(t,e){this.segList.addPt(t.p1),this.segList.addPt(e.p0)},jsts.operation.buffer.OffsetSegmentGenerator.prototype.addFillet=function(t,e,o,n,r){if(!(o instanceof jsts.geom.Coordinate))return void this.addFillet2.apply(this,arguments);var i=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,i),u=o.x-t.x,p=o.y-t.y,g=Math.atan2(p,u);n===jsts.algorithm.CGAlgorithms.CLOCKWISE?g>=a&&(a+=2*Math.PI):a>=g&&(a-=2*Math.PI),this.segList.addPt(e),this.addFillet(t,a,g,n,r),this.segList.addPt(o)},jsts.operation.buffer.OffsetSegmentGenerator.prototype.addFillet2=function(t,e,o,n,r){var i=n===jsts.algorithm.CGAlgorithms.CLOCKWISE?-1:1,s=Math.abs(e-o),a=parseInt(s/this.filletAngleQuantum+.5);if(!(1>a)){var u,p;u=0,p=s/a;for(var g=u,l=new jsts.geom.Coordinate;s>g;){var h=e+i*g;l.x=t.x+r*Math.cos(h),l.y=t.y+r*Math.sin(h),this.segList.addPt(l),g+=p}}},jsts.operation.buffer.OffsetSegmentGenerator.prototype.createCircle=function(t){var e=new jsts.geom.Coordinate(t.x+this.distance,t.y);this.segList.addPt(e),this.addFillet(t,0,2*Math.PI,-1,this.distance),this.segList.closeRing()},jsts.operation.buffer.OffsetSegmentGenerator.prototype.createSquare=function(t){this.segList.addPt(new jsts.geom.Coordinate(t.x+distance,t.y+distance)),this.segList.addPt(new jsts.geom.Coordinate(t.x+distance,t.y-distance)),this.segList.addPt(new jsts.geom.Coordinate(t.x-distance,t.y-distance)),this.segList.addPt(new jsts.geom.Coordinate(t.x-distance,t.y+distance)),this.segList.closeRing()},jsts.operation.overlay.MaximalEdgeRing=function(t,e){jsts.geomgraph.EdgeRing.call(this,t,e)},jsts.operation.overlay.MaximalEdgeRing.prototype=new jsts.geomgraph.EdgeRing,jsts.operation.overlay.MaximalEdgeRing.constructor=jsts.operation.overlay.MaximalEdgeRing,jsts.operation.overlay.MaximalEdgeRing.prototype.getNext=function(t){return t.getNext()},jsts.operation.overlay.MaximalEdgeRing.prototype.setEdgeRing=function(t,e){t.setEdgeRing(e)},jsts.operation.overlay.MaximalEdgeRing.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var t=this.startDe;do{var e=t.getNode();e.getEdges().linkMinimalDirectedEdges(this),t=t.getNext()}while(t!=this.startDe)},jsts.operation.overlay.MaximalEdgeRing.prototype.buildMinimalRings=function(){var t=[],e=this.startDe;do{if(null===e.getMinEdgeRing()){var o=new jsts.operation.overlay.MinimalEdgeRing(e,this.geometryFactory);t.push(o)}e=e.getNext()}while(e!=this.startDe);return t},jsts.algorithm.CentroidPoint=function(){this.centSum=new jsts.geom.Coordinate},jsts.algorithm.CentroidPoint.prototype.ptCount=0,jsts.algorithm.CentroidPoint.prototype.centSum=null,jsts.algorithm.CentroidPoint.prototype.add=function(t){if(t instanceof jsts.geom.Point)this.add2(t.getCoordinate());else if(t instanceof jsts.geom.GeometryCollection||t instanceof jsts.geom.MultiPoint||t instanceof jsts.geom.MultiLineString||t instanceof jsts.geom.MultiPolygon)for(var e=t,o=0;o<e.getNumGeometries();o++)this.add(e.getGeometryN(o))},jsts.algorithm.CentroidPoint.prototype.add2=function(t){this.ptCount+=1,this.centSum.x+=t.x,this.centSum.y+=t.y},jsts.algorithm.CentroidPoint.prototype.getCentroid=function(){var t=new jsts.geom.Coordinate;return t.x=this.centSum.x/this.ptCount,t.y=this.centSum.y/this.ptCount,t},jsts.operation.distance.ConnectedElementLocationFilter=function(t){this.locations=t},jsts.operation.distance.ConnectedElementLocationFilter.prototype=new jsts.geom.GeometryFilter,jsts.operation.distance.ConnectedElementLocationFilter.prototype.locations=null,jsts.operation.distance.ConnectedElementLocationFilter.getLocations=function(t){var e=[];return t.apply(new jsts.operation.distance.ConnectedElementLocationFilter(e)),e},jsts.operation.distance.ConnectedElementLocationFilter.prototype.filter=function(t){(t instanceof jsts.geom.Point||t instanceof jsts.geom.LineString||t instanceof jsts.geom.Polygon)&&this.locations.push(new jsts.operation.distance.GeometryLocation(t,0,t.getCoordinate()))},jsts.geomgraph.index.MonotoneChainEdge=function(t){this.e=t,this.pts=t.getCoordinates();var e=new jsts.geomgraph.index.MonotoneChainIndexer;this.startIndex=e.getChainStartIndices(this.pts)},jsts.geomgraph.index.MonotoneChainEdge.prototype.e=null,jsts.geomgraph.index.MonotoneChainEdge.prototype.pts=null,jsts.geomgraph.index.MonotoneChainEdge.prototype.startIndex=null,jsts.geomgraph.index.MonotoneChainEdge.prototype.env1=new jsts.geom.Envelope,jsts.geomgraph.index.MonotoneChainEdge.prototype.env2=new jsts.geom.Envelope,jsts.geomgraph.index.MonotoneChainEdge.prototype.getCoordinates=function(){return this.pts},jsts.geomgraph.index.MonotoneChainEdge.prototype.getStartIndexes=function(){return this.startIndex},jsts.geomgraph.index.MonotoneChainEdge.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,o=this.pts[this.startIndex[t+1]].x;return o>e?e:o},jsts.geomgraph.index.MonotoneChainEdge.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,o=this.pts[this.startIndex[t+1]].x;return e>o?e:o},jsts.geomgraph.index.MonotoneChainEdge.prototype.computeIntersects=function(t,e){for(var o=0;o<this.startIndex.length-1;o++)for(var n=0;n<t.startIndex.length-1;n++)this.computeIntersectsForChain(o,t,n,e)},jsts.geomgraph.index.MonotoneChainEdge.prototype.computeIntersectsForChain=function(t,e,o,n){this.computeIntersectsForChain2(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[o],e.startIndex[o+1],n)},jsts.geomgraph.index.MonotoneChainEdge.prototype.computeIntersectsForChain2=function(t,e,o,n,r,i){var s=this.pts[t],a=this.pts[e],u=o.pts[n],p=o.pts[r];if(e-t==1&&r-n==1)return void i.addIntersections(this.e,t,o.e,n);if(this.env1.init(s,a),this.env2.init(u,p),this.env1.intersects(this.env2)){var g=Math.floor((t+e)/2),l=Math.floor((n+r)/2);g>t&&(l>n&&this.computeIntersectsForChain2(t,g,o,n,l,i),r>l&&this.computeIntersectsForChain2(t,g,o,l,r,i)),e>g&&(l>n&&this.computeIntersectsForChain2(g,e,o,n,l,i),r>l&&this.computeIntersectsForChain2(g,e,o,l,r,i))}},function(){var t=javascript.util.ArrayList;jsts.operation.relate.EdgeEndBuilder=function(){},jsts.operation.relate.EdgeEndBuilder.prototype.computeEdgeEnds=function(e){if(2==arguments.length)return void this.computeEdgeEnds2.apply(this,arguments);for(var o=new t,n=e;n.hasNext();){var r=n.next();this.computeEdgeEnds2(r,o)}return o},jsts.operation.relate.EdgeEndBuilder.prototype.computeEdgeEnds2=function(t,e){var o=t.getEdgeIntersectionList();o.addEndpoints();var n=o.iterator(),r=null,i=null;if(n.hasNext()){var s=n.next();do r=i,i=s,s=null,n.hasNext()&&(s=n.next()),null!==i&&(this.createEdgeEndForPrev(t,e,i,r),this.createEdgeEndForNext(t,e,i,s));while(null!==i)}},jsts.operation.relate.EdgeEndBuilder.prototype.createEdgeEndForPrev=function(t,e,o,n){var r=o.segmentIndex;if(0===o.dist){if(0===r)return;r--}var i=t.getCoordinate(r);null!==n&&n.segmentIndex>=r&&(i=n.coord);var s=new jsts.geomgraph.Label(t.getLabel());s.flip();var a=new jsts.geomgraph.EdgeEnd(t,o.coord,i,s);e.add(a)},jsts.operation.relate.EdgeEndBuilder.prototype.createEdgeEndForNext=function(t,e,o,n){var r=o.segmentIndex+1;if(!(r>=t.getNumPoints()&&null===n)){var i=t.getCoordinate(r);null!==n&&n.segmentIndex===o.segmentIndex&&(i=n.coord);var s=new jsts.geomgraph.EdgeEnd(t,o.coord,i,new jsts.geomgraph.Label(t.getLabel()));e.add(s)}}}(),function(){var t=javascript.util.ArrayList,e=javascript.util.TreeSet,o=jsts.geom.CoordinateFilter;jsts.util.UniqueCoordinateArrayFilter=function(){this.treeSet=new e,this.list=new t},jsts.util.UniqueCoordinateArrayFilter.prototype=new o,jsts.util.UniqueCoordinateArrayFilter.prototype.treeSet=null,jsts.util.UniqueCoordinateArrayFilter.prototype.list=null,jsts.util.UniqueCoordinateArrayFilter.prototype.getCoordinates=function(){return this.list.toArray()},jsts.util.UniqueCoordinateArrayFilter.prototype.filter=function(t){this.treeSet.contains(t)||(this.list.add(t),this.treeSet.add(t))}}(),function(){var t=jsts.algorithm.CGAlgorithms,e=jsts.util.UniqueCoordinateArrayFilter,o=jsts.util.Assert,n=javascript.util.Stack,r=javascript.util.ArrayList,i=javascript.util.Arrays,s=function(t){this.origin=t};s.prototype.origin=null,s.prototype.compare=function(t,e){var o=t,n=e;return s.polarCompare(this.origin,o,n)},s.polarCompare=function(e,o,n){var r=o.x-e.x,i=o.y-e.y,s=n.x-e.x,a=n.y-e.y,u=t.computeOrientation(e,o,n);if(u==t.COUNTERCLOCKWISE)return 1;if(u==t.CLOCKWISE)return-1;var p=r*r+i*i,g=s*s+a*a;return g>p?-1:p>g?1:0},jsts.algorithm.ConvexHull=function(){if(1===arguments.length){var t=arguments[0];this.inputPts=jsts.algorithm.ConvexHull.extractCoordinates(t),this.geomFactory=t.getFactory()}else this.pts=arguments[0],this.geomFactory=arguments[1]},jsts.algorithm.ConvexHull.prototype.geomFactory=null,jsts.algorithm.ConvexHull.prototype.inputPts=null,jsts.algorithm.ConvexHull.extractCoordinates=function(t){var o=new e;return t.apply(o),o.getCoordinates()},jsts.algorithm.ConvexHull.prototype.getConvexHull=function(){if(0==this.inputPts.length)return this.geomFactory.createGeometryCollection(null);if(1==this.inputPts.length)return this.geomFactory.createPoint(this.inputPts[0]);if(2==this.inputPts.length)return this.geomFactory.createLineString(this.inputPts);var t=this.inputPts;this.inputPts.length>50&&(t=this.reduce(this.inputPts));var e=this.preSort(t),o=this.grahamScan(e),n=o.toArray();return this.lineOrPolygon(n)},jsts.algorithm.ConvexHull.prototype.reduce=function(e){var o=this.computeOctRing(e);if(null==o)return this.inputPts;for(var n=new javascript.util.TreeSet,r=0;r<o.length;r++)n.add(o[r]);for(var r=0;r<e.length;r++)t.isPointInRing(e[r],o)||n.add(e[r]);var i=n.toArray();return i.length<3?this.padArray3(i):i},jsts.algorithm.ConvexHull.prototype.padArray3=function(t){for(var e=[],o=0;o<e.length;o++)e[o]=o<t.length?t[o]:t[0];return e},jsts.algorithm.ConvexHull.prototype.preSort=function(t){for(var e,o=1;o<t.length;o++)(t[o].y<t[0].y||t[o].y==t[0].y&&t[o].x<t[0].x)&&(e=t[0],t[0]=t[o],t[o]=e);return i.sort(t,1,t.length,new s(t[0])),t},jsts.algorithm.ConvexHull.prototype.grahamScan=function(e){var o,r=new n;o=r.push(e[0]),o=r.push(e[1]),o=r.push(e[2]);for(var i=3;i<e.length;i++){for(o=r.pop();!r.empty()&&t.computeOrientation(r.peek(),o,e[i])>0;)o=r.pop();o=r.push(o),o=r.push(e[i])}return o=r.push(e[0]),r},jsts.algorithm.ConvexHull.prototype.isBetween=function(e,o,n){if(0!==t.computeOrientation(e,o,n))return!1;if(e.x!=n.x){if(e.x<=o.x&&o.x<=n.x)return!0;if(n.x<=o.x&&o.x<=e.x)return!0}if(e.y!=n.y){if(e.y<=o.y&&o.y<=n.y)return!0;if(n.y<=o.y&&o.y<=e.y)return!0}return!1},jsts.algorithm.ConvexHull.prototype.computeOctRing=function(t){var e=this.computeOctPts(t),o=new jsts.geom.CoordinateList;return o.add(e,!1),o.size()<3?null:(o.closeRing(),o.toCoordinateArray())},jsts.algorithm.ConvexHull.prototype.computeOctPts=function(t){for(var e=[],o=0;8>o;o++)e[o]=t[0];for(var n=1;n<t.length;n++)t[n].x<e[0].x&&(e[0]=t[n]),t[n].x-t[n].y<e[1].x-e[1].y&&(e[1]=t[n]),t[n].y>e[2].y&&(e[2]=t[n]),t[n].x+t[n].y>e[3].x+e[3].y&&(e[3]=t[n]),t[n].x>e[4].x&&(e[4]=t[n]),t[n].x-t[n].y>e[5].x-e[5].y&&(e[5]=t[n]),t[n].y<e[6].y&&(e[6]=t[n]),t[n].x+t[n].y<e[7].x+e[7].y&&(e[7]=t[n]);return e},jsts.algorithm.ConvexHull.prototype.lineOrPolygon=function(t){if(t=this.cleanRing(t),3==t.length)return this.geomFactory.createLineString([t[0],t[1]]);var e=this.geomFactory.createLinearRing(t);return this.geomFactory.createPolygon(e,null)},jsts.algorithm.ConvexHull.prototype.cleanRing=function(t){o.equals(t[0],t[t.length-1]);for(var e=new r,n=null,i=0;i<=t.length-2;i++){var s=t[i],a=t[i+1];s.equals(a)||null!=n&&this.isBetween(n,s,a)||(e.add(s),n=s)}e.add(t[t.length-1]);var u=[];return e.toArray(u)}}(),jsts.algorithm.MinimumDiameter=function(t,e){this.convexHullPts=null,this.minBaseSeg=new jsts.geom.LineSegment,this.minWidthPt=null,this.minPtIndex=0,this.minWidth=0,jsts.algorithm.MinimumDiameter.inputGeom=t,jsts.algorithm.MinimumDiameter.isConvex=e||!1},jsts.algorithm.MinimumDiameter.inputGeom=null,jsts.algorithm.MinimumDiameter.isConvex=!1,jsts.algorithm.MinimumDiameter.nextIndex=function(t,e){return e++,e>=t.length&&(e=0),e},jsts.algorithm.MinimumDiameter.computeC=function(t,e,o){return t*o.y-e*o.x},jsts.algorithm.MinimumDiameter.computeSegmentForLine=function(t,e,o){var n,r;return Math.abs(e)>Math.abs(t)?(n=new jsts.geom.Coordinate(0,o/e),r=new jsts.geom.Coordinate(1,o/e-t/e)):(n=new jsts.geom.Coordinate(o/t,0),r=new jsts.geom.Coordinate(o/t-e/t,1)),new jsts.geom.LineSegment(n,r)},jsts.algorithm.MinimumDiameter.prototype.getLength=function(){return this.computeMinimumDiameter(),this.minWidth},jsts.algorithm.MinimumDiameter.prototype.getWidthCoordinate=function(){return this.computeMinimumDiameter(),this.minWidthPt},jsts.algorithm.MinimumDiameter.prototype.getSupportingSegment=function(){this.computeMinimumDiameter();var t=[this.minBaseSeg.p0,this.minBaseSeg.p1];return jsts.algorithm.MinimumDiameter.inputGeom.getFactory().createLineString(t)},jsts.algorithm.MinimumDiameter.prototype.getDiameter=function(){if(this.computeMinimumDiameter(),null===this.minWidthPt)return jsts.algorithm.MinimumDiameter.inputGeom.getFactory().createLineString(null);var t=this.minBaseSeg.project(this.minWidthPt);return jsts.algorithm.MinimumDiameter.inputGeom.getFactory().createLineString([t,this.minWidthPt])},jsts.algorithm.MinimumDiameter.prototype.computeMinimumDiameter=function(){if(null===this.minWidthPt)if(jsts.algorithm.MinimumDiameter.isConvex)this.computeWidthConvex(jsts.algorithm.MinimumDiameter.inputGeom);else{var t=new jsts.algorithm.ConvexHull(jsts.algorithm.MinimumDiameter.inputGeom).getConvexHull();this.computeWidthConvex(t)}},jsts.algorithm.MinimumDiameter.prototype.computeWidthConvex=function(t){this.convexHullPts=t instanceof jsts.geom.Polygon?t.getExteriorRing().getCoordinates():t.getCoordinates(),0===this.convexHullPts.length?(this.minWidth=0,this.minWidthPt=null,this.minBaseSeg=null):1===this.convexHullPts.length?(this.minWidth=0,this.minWidthPt=this.convexHullPts[0],this.minBaseSeg.p0=this.convexHullPts[0],this.minBaseSeg.p1=this.convexHullPts[0]):2===this.convexHullPts.length||3===this.convexHullPts.length?(this.minWidth=0,this.minWidthPt=this.convexHullPts[0],this.minBaseSeg.p0=this.convexHullPts[0],this.minBaseSeg.p1=this.convexHullPts[1]):this.computeConvexRingMinDiameter(this.convexHullPts)},jsts.algorithm.MinimumDiameter.prototype.computeConvexRingMinDiameter=function(t){this.minWidth=Number.MAX_VALUE;for(var e=1,o=new jsts.geom.LineSegment,n=0;n<t.length-1;n++)o.p0=t[n],o.p1=t[n+1],e=this.findMaxPerpDistance(t,o,e)},jsts.algorithm.MinimumDiameter.prototype.findMaxPerpDistance=function(t,e,o){for(var n=e.distancePerpendicular(t[o]),r=n,i=o,s=i;r>=n;)n=r,i=s,s=jsts.algorithm.MinimumDiameter.nextIndex(t,i),r=e.distancePerpendicular(t[s]);return n<this.minWidth&&(this.minPtIndex=i,this.minWidth=n,this.minWidthPt=t[this.minPtIndex],this.minBaseSeg=new jsts.geom.LineSegment(e)),i},jsts.algorithm.MinimumDiameter.prototype.getMinimumRectangle=function(){if(this.computeMinimumDiameter(),0===this.minWidth)return this.minBaseSeg.p0.equals2D(this.minBaseSeg.p1)?jsts.algorithm.MinimumDiameter.inputGeom.getFactory().createPoint(this.minBaseSeg.p0):this.minBaseSeg.toGeometry(jsts.algorithm.MinimumDiameter.inputGeom.getFactory());for(var t=this.minBaseSeg.p1.x-this.minBaseSeg.p0.x,e=this.minBaseSeg.p1.y-this.minBaseSeg.p0.y,o=Number.MAX_VALUE,n=-Number.MAX_VALUE,r=Number.MAX_VALUE,i=-Number.MAX_VALUE,s=0;s<this.convexHullPts.length;s++){var a=jsts.algorithm.MinimumDiameter.computeC(t,e,this.convexHullPts[s]);a>n&&(n=a),o>a&&(o=a);var u=jsts.algorithm.MinimumDiameter.computeC(-e,t,this.convexHullPts[s]);u>i&&(i=u),r>u&&(r=u)}var p=jsts.algorithm.MinimumDiameter.computeSegmentForLine(-t,-e,i),g=jsts.algorithm.MinimumDiameter.computeSegmentForLine(-t,-e,r),l=jsts.algorithm.MinimumDiameter.computeSegmentForLine(-e,t,n),h=jsts.algorithm.MinimumDiameter.computeSegmentForLine(-e,t,o),d=l.lineIntersection(p),c=h.lineIntersection(p),m=h.lineIntersection(g),f=l.lineIntersection(g),y=jsts.algorithm.MinimumDiameter.inputGeom.getFactory().createLinearRing([d,c,m,f,d]);return jsts.algorithm.MinimumDiameter.inputGeom.getFactory().createPolygon(y,null)},function(){jsts.io.GeoJSONParser=function(t){this.geometryFactory=t||new jsts.geom.GeometryFactory,this.geometryTypes=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"]},jsts.io.GeoJSONParser.prototype.read=function(t){var e;e="string"==typeof t?JSON.parse(t):t;var o=e.type;if(!this.parse[o])throw new Error("Unknown GeoJSON type: "+e.type);return-1!=this.geometryTypes.indexOf(o)?this.parse[o].apply(this,[e.coordinates]):"GeometryCollection"===o?this.parse[o].apply(this,[e.geometries]):this.parse[o].apply(this,[e])},jsts.io.GeoJSONParser.prototype.parse={Feature:function(t){var e={};for(var o in t)e[o]=t[o];if(t.geometry){var n=t.geometry.type;if(!this.parse[n])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=this.parse.bbox.apply(this,[t.bbox])),e},FeatureCollection:function(t){var e={};if(t.features){e.features=[];for(var o=0;o<t.features.length;++o)e.features.push(this.read(t.features[o]))}return t.bbox&&(e.bbox=this.parse.bbox.apply(this,[t.bbox])),e},coordinates:function(t){for(var e=[],o=0;o<t.length;++o){var n=t[o];e.push(new jsts.geom.Coordinate(n[0],n[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new jsts.geom.Coordinate(t[0],t[1]),new jsts.geom.Coordinate(t[2],t[1]),new jsts.geom.Coordinate(t[2],t[3]),new jsts.geom.Coordinate(t[0],t[3]),new jsts.geom.Coordinate(t[0],t[1])])},Point:function(t){var e=new jsts.geom.Coordinate(t[0],t[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],o=0;o<t.length;++o)e.push(this.parse.Point.apply(this,[t[o]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=this.parse.coordinates.apply(this,[t]);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],o=0;o<t.length;++o)e.push(this.parse.LineString.apply(this,[t[o]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=this.parse.coordinates.apply(this,[t[0]]),o=this.geometryFactory.createLinearRing(e),n=[],r=1;r<t.length;++r){var i=t[r],s=this.parse.coordinates.apply(this,[i]),a=this.geometryFactory.createLinearRing(s);n.push(a)}return this.geometryFactory.createPolygon(o,n)},MultiPolygon:function(t){for(var e=[],o=0;o<t.length;++o){var n=t[o];e.push(this.parse.Polygon.apply(this,[n]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(t){for(var e=[],o=0;o<t.length;++o){var n=t[o];e.push(this.read(n))}return this.geometryFactory.createGeometryCollection(e)}},jsts.io.GeoJSONParser.prototype.write=function(t){var e=t.CLASS_NAME.slice(10);if(!this.extract[e])throw new Error("Geometry is not supported");return this.extract[e].apply(this,[t])},jsts.io.GeoJSONParser.prototype.extract={coordinate:function(t){return[t.x,t.y]},Point:function(t){var e=this.extract.coordinate.apply(this,[t.coordinate]);return{type:"Point",coordinates:e}},MultiPoint:function(t){for(var e=[],o=0;o<t.geometries.length;++o){var n=t.geometries[o],r=this.extract.Point.apply(this,[n]);e.push(r.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(t){for(var e=[],o=0;o<t.points.length;++o){var n=t.points[o];e.push(this.extract.coordinate.apply(this,[n]))}return{type:"LineString",coordinates:e}},MultiLineString:function(t){for(var e=[],o=0;o<t.geometries.length;++o){var n=t.geometries[o],r=this.extract.LineString.apply(this,[n]);e.push(r.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],o=this.extract.LineString.apply(this,[t.shell]);e.push(o.coordinates);for(var n=0;n<t.holes.length;++n){var r=t.holes[n],i=this.extract.LineString.apply(this,[r]);e.push(i.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(t){for(var e=[],o=0;o<t.geometries.length;++o){var n=t.geometries[o],r=this.extract.Polygon.apply(this,[n]);e.push(r.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(t){for(var e=[],o=0;o<t.geometries.length;++o){var n=t.geometries[o],r=n.CLASS_NAME.slice(10);e.push(this.extract[r].apply(this,[n]))}return{type:"GeometryCollection",geometries:e}}}}(),jsts.triangulate.quadedge.Vertex=function(){1===arguments.length?this.initFromCoordinate(arguments[0]):this.initFromXY(arguments[0],arguments[1])},jsts.triangulate.quadedge.Vertex.LEFT=0,jsts.triangulate.quadedge.Vertex.RIGHT=1,jsts.triangulate.quadedge.Vertex.BEYOND=2,jsts.triangulate.quadedge.Vertex.BEHIND=3,jsts.triangulate.quadedge.Vertex.BETWEEN=4,jsts.triangulate.quadedge.Vertex.ORIGIN=5,jsts.triangulate.quadedge.Vertex.DESTINATION=6,jsts.triangulate.quadedge.Vertex.prototype.initFromXY=function(t,e){this.p=new jsts.geom.Coordinate(t,e)},jsts.triangulate.quadedge.Vertex.prototype.initFromCoordinate=function(t){this.p=new jsts.geom.Coordinate(t)},jsts.triangulate.quadedge.Vertex.prototype.getX=function(){return this.p.x},jsts.triangulate.quadedge.Vertex.prototype.getY=function(){return this.p.y},jsts.triangulate.quadedge.Vertex.prototype.getZ=function(){return this.p.z},jsts.triangulate.quadedge.Vertex.prototype.setZ=function(t){this.p.z=t},jsts.triangulate.quadedge.Vertex.prototype.getCoordinate=function(){return this.p},jsts.triangulate.quadedge.Vertex.prototype.toString=function(){return"POINT ("+this.p.x+" "+this.p.y+")"},jsts.triangulate.quadedge.Vertex.prototype.equals=function(){return 1===arguments.length?this.equalsExact(arguments[0]):this.equalsWithTolerance(arguments[0],arguments[1])},jsts.triangulate.quadedge.Vertex.prototype.equalsExact=function(t){return this.p.x===t.getX()&&this.p.y===t.getY()},jsts.triangulate.quadedge.Vertex.prototype.equalsWithTolerance=function(t,e){return this.p.distance(t.getCoordinate())<e},jsts.triangulate.quadedge.Vertex.prototype.classify=function(t,e){var o,n,r,i;return o=this,n=e.sub(t),r=o.sub(t),i=n.crossProduct(r),i>0?jsts.triangulate.quadedge.Vertex.LEFT:0>i?jsts.triangulate.quadedge.Vertex.RIGHT:n.getX()*r.getX()<0||n.getY()*r.getY()<0?jsts.triangulate.quadedge.Vertex.BEHIND:n.magn()<r.magn()?jsts.triangulate.quadedge.Vertex.BEYOND:t.equals(o)?jsts.triangulate.quadedge.Vertex.ORIGIN:e.equals(o)?jsts.triangulate.quadedge.Vertex.DESTINATION:jsts.triangulate.quadedge.Vertex.BETWEEN},jsts.triangulate.quadedge.Vertex.prototype.crossProduct=function(t){return this.p.x*t.getY()-this.p.y*t.getX()},jsts.triangulate.quadedge.Vertex.prototype.dot=function(t){return this.p.x*t.getX()+this.p.y*t.getY()},jsts.triangulate.quadedge.Vertex.prototype.times=function(t){return new jsts.triangulate.quadedge.Vertex(t*this.p.x,t*this.p.y)},jsts.triangulate.quadedge.Vertex.prototype.sum=function(t){return new jsts.triangulate.quadedge.Vertex(this.p.x+t.getX(),this.p.y+t.getY())},jsts.triangulate.quadedge.Vertex.prototype.sub=function(t){return new jsts.triangulate.quadedge.Vertex(this.p.x-t.getX(),this.p.y-t.getY())},jsts.triangulate.quadedge.Vertex.prototype.magn=function(){return Math.sqrt(this.p.x*this.p.x+this.p.y*this.p.y)},jsts.triangulate.quadedge.Vertex.prototype.cross=function(){return new Vertex(this.p.y,-this.p.x)},jsts.triangulate.quadedge.Vertex.prototype.isInCircle=function(t,e,o){return jsts.triangulate.quadedge.TrianglePredicate.isInCircleRobust(t.p,e.p,o.p,this.p)},jsts.triangulate.quadedge.Vertex.prototype.isCCW=function(t,e){return(t.p.x-this.p.x)*(e.p.y-this.p.y)-(t.p.y-this.p.y)*(e.p.x-this.p.x)>0},jsts.triangulate.quadedge.Vertex.prototype.rightOf=function(t){return this.isCCW(t.dest(),t.orig())},jsts.triangulate.quadedge.Vertex.prototype.leftOf=function(t){return this.isCCW(t.orig(),t.dest())},jsts.triangulate.quadedge.Vertex.prototype.bisector=function(t,e){var o,n,r,i;return o=e.getX()-t.getX(),n=e.getY()-t.getY(),r=new jsts.algorithm.HCoordinate(t.getX()+o/2,t.getY()+n/2,1),i=new jsts.algorithm.HCoordinate(t.getX()-n+o/2,t.getY()+o+n/2,1),new jsts.algorithm.HCoordinate(r,i)},jsts.triangulate.quadedge.Vertex.prototype.distance=function(t,e){return t.p.distance(e.p)},jsts.triangulate.quadedge.Vertex.prototype.circumRadiusRatio=function(t,e){var o,n,r,i;return o=this.circleCenter(t,e),n=this.distance(o,t),r=this.distance(this,t),i=this.distance(t,e),r>i&&(r=i),i=this.distance(e,this),r>i&&(r=i),n/r},jsts.triangulate.quadedge.Vertex.prototype.midPoint=function(t){var e,o;return e=(this.p.x+t.getX())/2,o=(this.p.y+t.getY())/2,new jsts.triangulate.quadedge.Vertex(e,o)},jsts.triangulate.quadedge.Vertex.prototype.circleCenter=function(t,e){var o,n,r,i,s;o=new jsts.triangulate.quadedge.Vertex(this.getX(),this.getY()),n=this.bisector(o,t),r=this.bisector(t,e),i=new jsts.algorithm.HCoordinate(n,r),s=null;try{s=new jsts.triangulate.quadedge.Vertex(i.getX(),i.getY())}catch(a){}return s},jsts.operation.valid.IsValidOp=function(t){this.parentGeometry=t,this.isSelfTouchingRingFormingHoleValid=!1,this.validErr=null},jsts.operation.valid.IsValidOp.isValid=function(t){if(arguments[0]instanceof jsts.geom.Coordinate)return isNaN(t.x)?!1:isFinite(t.x)||isNaN(t.x)?isNaN(t.y)?!1:isFinite(t.y)||isNaN(t.y)?!0:!1:!1;var e=new jsts.operation.valid.IsValidOp(t);return e.isValid()},jsts.operation.valid.IsValidOp.findPtNotNode=function(t,e,o){for(var n=o.findEdge(e),r=n.getEdgeIntersectionList(),i=0;i<t.length;i++){var s=t[i];if(!r.isIntersection(s))return s}return null},jsts.operation.valid.IsValidOp.prototype.setSelfTouchingRingFormingHoleValid=function(t){this.isSelfTouchingRingFormingHoleValid=t},jsts.operation.valid.IsValidOp.prototype.isValid=function(){return this.checkValid(this.parentGeometry),null==this.validErr},jsts.operation.valid.IsValidOp.prototype.getValidationError=function(){return this.checkValid(this.parentGeometry),this.validErr},jsts.operation.valid.IsValidOp.prototype.checkValid=function(t){if(this.validErr=null,!t.isEmpty())if(t instanceof jsts.geom.Point)this.checkValidPoint(t);else if(t instanceof jsts.geom.MultiPoint)this.checkValidMultiPoint(t);else if(t instanceof jsts.geom.LinearRing)this.checkValidLinearRing(t);else if(t instanceof jsts.geom.LineString)this.checkValidLineString(t);else if(t instanceof jsts.geom.Polygon)this.checkValidPolygon(t);else if(t instanceof jsts.geom.MultiPolygon)this.checkValidMultiPolygon(t);else{if(!(t instanceof jsts.geom.GeometryCollection))throw t.constructor;this.checkValidGeometryCollection(t)}},jsts.operation.valid.IsValidOp.prototype.checkValidPoint=function(t){this.checkInvalidCoordinates(t.getCoordinates())},jsts.operation.valid.IsValidOp.prototype.checkValidMultiPoint=function(t){this.checkInvalidCoordinates(t.getCoordinates())},jsts.operation.valid.IsValidOp.prototype.checkValidLineString=function(t){if(this.checkInvalidCoordinates(t.getCoordinates()),null==this.validErr){var e=new jsts.geomgraph.GeometryGraph(0,t);this.checkTooFewPoints(e)}},jsts.operation.valid.IsValidOp.prototype.checkValidLinearRing=function(t){if(this.checkInvalidCoordinates(t.getCoordinates()),null==this.validErr&&(this.checkClosedRing(t),null==this.validErr)){var e=new jsts.geomgraph.GeometryGraph(0,t);if(this.checkTooFewPoints(e),null==this.validErr){var o=new jsts.algorithm.RobustLineIntersector;e.computeSelfNodes(o,!0),this.checkNoSelfIntersectingRings(e)}}},jsts.operation.valid.IsValidOp.prototype.checkValidPolygon=function(t){if(this.checkInvalidCoordinates(t),null==this.validErr&&(this.checkClosedRings(t),null==this.validErr)){var e=new jsts.geomgraph.GeometryGraph(0,t);this.checkTooFewPoints(e),null==this.validErr&&(this.checkConsistentArea(e),null==this.validErr&&(this.isSelfTouchingRingFormingHoleValid||(this.checkNoSelfIntersectingRings(e),null==this.validErr))&&(this.checkHolesInShell(t,e),null==this.validErr&&(this.checkHolesNotNested(t,e),null==this.validErr&&this.checkConnectedInteriors(e))))}},jsts.operation.valid.IsValidOp.prototype.checkValidMultiPolygon=function(t){for(var e=t.getNumGeometries(),o=0;e>o;o++){var n=t.getGeometryN(o);if(this.checkInvalidCoordinates(n),null!=this.validErr)return;if(this.checkClosedRings(n),null!=this.validErr)return}var r=new jsts.geomgraph.GeometryGraph(0,t);if(this.checkTooFewPoints(r),null==this.validErr&&(this.checkConsistentArea(r),null==this.validErr&&(this.isSelfTouchingRingFormingHoleValid||(this.checkNoSelfIntersectingRings(r),null==this.validErr)))){for(var o=0;o<t.getNumGeometries();o++){var n=t.getGeometryN(o);if(this.checkHolesInShell(n,r),null!=this.validErr)return}for(var o=0;o<t.getNumGeometries();o++){var n=t.getGeometryN(o);if(this.checkHolesNotNested(n,r),null!=this.validErr)return}this.checkShellsNotNested(t,r),null==this.validErr&&this.checkConnectedInteriors(r)}},jsts.operation.valid.IsValidOp.prototype.checkValidGeometryCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var o=t.getGeometryN(e);if(this.checkValid(o),null!=this.validErr)return}},jsts.operation.valid.IsValidOp.prototype.checkInvalidCoordinates=function(t){if(t instanceof jsts.geom.Polygon){var e=t;if(this.checkInvalidCoordinates(e.getExteriorRing().getCoordinates()),null!=this.validErr)return;for(var o=0;o<e.getNumInteriorRing();o++)if(this.checkInvalidCoordinates(e.getInteriorRingN(o).getCoordinates()),null!=this.validErr)return}else for(var n=t,o=0;o<n.length;o++)if(!jsts.operation.valid.IsValidOp.isValid(n[o]))return void(this.validErr=new jsts.operation.valid.TopologyValidationError(jsts.operation.valid.TopologyValidationError.INVALID_COORDINATE,n[o]))},jsts.operation.valid.IsValidOp.prototype.checkClosedRings=function(t){if(this.checkClosedRing(t.getExteriorRing()),null==this.validErr)for(var e=0;e<t.getNumInteriorRing();e++)if(this.checkClosedRing(t.getInteriorRingN(e)),null!=this.validErr)return},jsts.operation.valid.IsValidOp.prototype.checkClosedRing=function(t){if(!t.isClosed()){var e=null;t.getNumPoints()>=1&&(e=t.getCoordinateN(0)),this.validErr=new jsts.operation.valid.TopologyValidationError(jsts.operation.valid.TopologyValidationError.RING_NOT_CLOSED,e)
}},jsts.operation.valid.IsValidOp.prototype.checkTooFewPoints=function(t){return t.hasTooFewPoints?void(this.validErr=new jsts.operation.valid.TopologyValidationError(jsts.operation.valid.TopologyValidationError.TOO_FEW_POINTS,t.getInvalidPoint())):void 0},jsts.operation.valid.IsValidOp.prototype.checkConsistentArea=function(t){var e=new jsts.operation.valid.ConsistentAreaTester(t),o=e.isNodeConsistentArea();return o?void(e.hasDuplicateRings()&&(this.validErr=new jsts.operation.valid.TopologyValidationError(jsts.operation.valid.TopologyValidationError.DUPLICATE_RINGS,e.getInvalidPoint()))):void(this.validErr=new jsts.operation.valid.TopologyValidationError(jsts.operation.valid.TopologyValidationError.SELF_INTERSECTION,e.getInvalidPoint()))},jsts.operation.valid.IsValidOp.prototype.checkNoSelfIntersectingRings=function(t){for(var e=t.getEdgeIterator();e.hasNext();){var o=e.next();if(this.checkNoSelfIntersectingRing(o.getEdgeIntersectionList()),null!=this.validErr)return}},jsts.operation.valid.IsValidOp.prototype.checkNoSelfIntersectingRing=function(t){for(var e=[],o=!0,n=t.iterator();n.hasNext();){var r=n.next();if(o)o=!1;else{if(e.indexOf(r.coord)>=0)return void(this.validErr=new jsts.operation.valid.TopologyValidationError(jsts.operation.valid.TopologyValidationError.RING_SELF_INTERSECTION,r.coord));e.push(r.coord)}}},jsts.operation.valid.IsValidOp.prototype.checkHolesInShell=function(t,e){for(var o=t.getExteriorRing(),n=new jsts.algorithm.MCPointInRing(o),r=0;r<t.getNumInteriorRing();r++){var i=t.getInteriorRingN(r),s=jsts.operation.valid.IsValidOp.findPtNotNode(i.getCoordinates(),o,e);if(null==s)return;var a=!n.isInside(s);if(a)return void(this.validErr=new jsts.operation.valid.TopologyValidationError(jsts.operation.valid.TopologyValidationError.HOLE_OUTSIDE_SHELL,s))}},jsts.operation.valid.IsValidOp.prototype.checkHolesNotNested=function(t,e){for(var o=new jsts.operation.valid.IndexedNestedRingTester(e),n=0;n<t.getNumInteriorRing();n++){var r=t.getInteriorRingN(n);o.add(r)}var i=o.isNonNested();i||(this.validErr=new jsts.operation.valid.TopologyValidationError(jsts.operation.valid.TopologyValidationError.NESTED_HOLES,o.getNestedPoint()))},jsts.operation.valid.IsValidOp.prototype.checkShellsNotNested=function(t,e){for(var o=0;o<t.getNumGeometries();o++)for(var n=t.getGeometryN(o),r=n.getExteriorRing(),i=0;i<t.getNumGeometries();i++)if(o!=i){var s=t.getGeometryN(i);if(this.checkShellNotNested(r,s,e),null!=this.validErr)return}},jsts.operation.valid.IsValidOp.prototype.checkShellNotNested=function(t,e,o){var n=t.getCoordinates(),r=e.getExteriorRing(),i=r.getCoordinates(),s=jsts.operation.valid.IsValidOp.findPtNotNode(n,r,o);if(null!=s){var a=jsts.algorithm.CGAlgorithms.isPointInRing(s,i);if(a){if(e.getNumInteriorRing()<=0)return void(this.validErr=new jsts.operation.valid.TopologyValidationError(jsts.operation.valid.TopologyValidationError.NESTED_SHELLS,s));for(var u=null,p=0;p<e.getNumInteriorRing();p++){var g=e.getInteriorRingN(p);if(u=this.checkShellInsideHole(t,g,o),null==u)return}this.validErr=new jsts.operation.valid.TopologyValidationError(jsts.operation.valid.TopologyValidationError.NESTED_SHELLS,u)}}},jsts.operation.valid.IsValidOp.prototype.checkShellInsideHole=function(t,e,o){var n=t.getCoordinates(),r=e.getCoordinates(),i=jsts.operation.valid.IsValidOp.findPtNotNode(n,e,o);if(null!=i){var s=jsts.algorithm.CGAlgorithms.isPointInRing(i,r);if(!s)return i}var a=jsts.operation.valid.IsValidOp.findPtNotNode(r,t,o);if(null!=a){var u=jsts.algorithm.CGAlgorithms.isPointInRing(a,n);return u?a:null}return jsts.util.Assert.shouldNeverReachHere("points in shell and hole appear to be equal"),null},jsts.operation.valid.IsValidOp.prototype.checkConnectedInteriors=function(t){var e=new jsts.operation.valid.ConnectedInteriorTester(t);e.isInteriorsConnected()||(this.validErr=new jsts.operation.valid.TopologyValidationError(jsts.operation.valid.TopologyValidationError.DISCONNECTED_INTERIOR,e.getCoordinate()))},jsts.algorithm.RobustDeterminant=function(){},jsts.algorithm.RobustDeterminant.signOfDet2x2=function(t,e,o,n){var r,i,s,a;if(a=0,r=1,0===t||0===n)return 0===e||0===o?0:e>0?o>0?-r:r:o>0?r:-r;if(0===e||0===o)return n>0?t>0?r:-r:t>0?-r:r;if(e>0?n>0?e>n&&(r=-r,i=t,t=o,o=i,i=e,e=n,n=i):-n>=e?(r=-r,o=-o,n=-n):(i=t,t=-o,o=i,i=e,e=-n,n=i):n>0?n>=-e?(r=-r,t=-t,e=-e):(i=-t,t=o,o=i,i=-e,e=n,n=i):e>=n?(t=-t,e=-e,o=-o,n=-n):(r=-r,i=-t,t=-o,o=i,i=-e,e=-n,n=i),t>0){if(!(o>0))return r;if(t>o)return r}else{if(o>0)return-r;if(!(t>=o))return-r;r=-r,t=-t,o=-o}for(;;){if(a+=1,s=Math.floor(o/t),o-=s*t,n-=s*e,0>n)return-r;if(n>e)return r;if(t>o+o){if(n+n>e)return r}else{if(e>n+n)return-r;o=t-o,n=e-n,r=-r}if(0===n)return 0===o?0:-r;if(0===o)return r;if(s=Math.floor(t/o),t-=s*o,e-=s*n,0>e)return r;if(e>n)return-r;if(o>t+t){if(e+e>n)return-r}else{if(n>e+e)return r;t=o-t,e=n-e,r=-r}if(0===e)return 0===t?0:r;if(0===t)return-r}},jsts.algorithm.RobustDeterminant.orientationIndex=function(t,e,o){var n=e.x-t.x,r=e.y-t.y,i=o.x-e.x,s=o.y-e.y;return jsts.algorithm.RobustDeterminant.signOfDet2x2(n,r,i,s)},jsts.index.quadtree.NodeBase=function(){this.subnode=new Array(4),this.subnode[0]=null,this.subnode[1]=null,this.subnode[2]=null,this.subnode[3]=null,this.items=[]},jsts.index.quadtree.NodeBase.prototype.getSubnodeIndex=function(t,e){var o=-1;return t.getMinX()>=e.x&&(t.getMinY()>=e.y&&(o=3),t.getMaxY()<=e.y&&(o=1)),t.getMaxX()<=e.x&&(t.getMinY()>=e.y&&(o=2),t.getMaxY()<=e.y&&(o=0)),o},jsts.index.quadtree.NodeBase.prototype.getItems=function(){return this.items},jsts.index.quadtree.NodeBase.prototype.hasItems=function(){return this.items.length>0},jsts.index.quadtree.NodeBase.prototype.add=function(t){this.items.push(t)},jsts.index.quadtree.NodeBase.prototype.remove=function(t,e){if(!this.isSearchMatch(t))return!1;var o=!1,n=0;for(n;4>n;n++)if(null!==this.subnode[n]&&(o=this.subnode[n].remove(t,e))){this.subnode[n].isPrunable()&&(this.subnode[n]=null);break}if(o)return o;if(-1!==this.items.indexOf(e)){for(var n=this.items.length-1;n>=0;n--)this.items[n]===e&&this.items.splice(n,1);o=!0}return o},jsts.index.quadtree.NodeBase.prototype.isPrunable=function(){return!(this.hasChildren()||this.hasItems())},jsts.index.quadtree.NodeBase.prototype.hasChildren=function(){var t=0;for(t;4>t;t++)if(null!==this.subnode[t])return!0;return!1},jsts.index.quadtree.NodeBase.prototype.isEmpty=function(){var t=!0;this.items.length>0&&(t=!1);var e=0;for(e;4>e;e++)null!==this.subnode[e]&&(this.subnode[e].isEmpty()||(t=!1));return t},jsts.index.quadtree.NodeBase.prototype.addAllItems=function(t){t=t.concat(this.items);var e=0;for(e;4>e;e++)null!==this.subnode[e]&&(t=this.subnode[e].addAllItems(t));return t},jsts.index.quadtree.NodeBase.prototype.addAllItemsFromOverlapping=function(t,e){if(this.isSearchMatch(t)){e=e.concat(this.items);var o=0;for(o;4>o;o++)null!==this.subnode[o]&&(e=this.subnode[o].addAllItemsFromOverlapping(t,e))}},jsts.index.quadtree.NodeBase.prototype.visit=function(t,e){if(this.isSearchMatch(t)){this.visitItems(t,e);var o=0;for(o;4>o;o++)null!==this.subnode[o]&&this.subnode[o].visit(t,e)}},jsts.index.quadtree.NodeBase.prototype.visitItems=function(t,e){var o=0,n=this.items.length;for(o;n>o;o++)e.visitItem(this.items[o])},jsts.index.quadtree.NodeBase.prototype.depth=function(){var t,e=0,o=0;for(o;4>o;o++)null!==this.subnode[o]&&(t=this.subnode[o].depth(),t>e&&(e=t));return e+1},jsts.index.quadtree.NodeBase.prototype.size=function(){var t=0,e=0;for(e;4>e;e++)null!==this.subnode[e]&&(t+=this.subnode[e].size());return t+this.items.length},jsts.index.quadtree.NodeBase.prototype.getNodeCount=function(){var t=0,e=0;for(e;4>e;e++)null!==this.subnode[e]&&(t+=this.subnode[e].size());return t+1},jsts.index.quadtree.Node=function(t,e){jsts.index.quadtree.NodeBase.prototype.constructor.apply(this,arguments),this.env=t,this.level=e,this.centre=new jsts.geom.Coordinate,this.centre.x=(t.getMinX()+t.getMaxX())/2,this.centre.y=(t.getMinY()+t.getMaxY())/2},jsts.index.quadtree.Node.prototype=new jsts.index.quadtree.NodeBase,jsts.index.quadtree.Node.createNode=function(t){var e,o;return e=new jsts.index.quadtree.Key(t),o=new jsts.index.quadtree.Node(e.getEnvelope(),e.getLevel())},jsts.index.quadtree.Node.createExpanded=function(t,e){var o,n=new jsts.geom.Envelope(e);return null!==t&&n.expandToInclude(t.env),o=jsts.index.quadtree.Node.createNode(n),null!==t&&o.insertNode(t),o},jsts.index.quadtree.Node.prototype.getEnvelope=function(){return this.env},jsts.index.quadtree.Node.prototype.isSearchMatch=function(t){return this.env.intersects(t)},jsts.index.quadtree.Node.prototype.getNode=function(t){var e,o=this.getSubnodeIndex(t,this.centre);return-1!==o?(e=this.getSubnode(o),e.getNode(t)):this},jsts.index.quadtree.Node.prototype.find=function(t){var e,o=this.getSubnodeIndex(t,this.centre);return-1===o?this:null!==this.subnode[o]?(e=this.subnode[o],e.find(t)):this},jsts.index.quadtree.Node.prototype.insertNode=function(t){var e,o=this.getSubnodeIndex(t.env,this.centre);t.level===this.level-1?this.subnode[o]=t:(e=this.createSubnode(o),e.insertNode(t),this.subnode[o]=e)},jsts.index.quadtree.Node.prototype.getSubnode=function(t){return null===this.subnode[t]&&(this.subnode[t]=this.createSubnode(t)),this.subnode[t]},jsts.index.quadtree.Node.prototype.createSubnode=function(t){var e,o,n=0,r=0,i=0,s=0;switch(t){case 0:n=this.env.getMinX(),r=this.centre.x,i=this.env.getMinY(),s=this.centre.y;break;case 1:n=this.centre.x,r=this.env.getMaxX(),i=this.env.getMinY(),s=this.centre.y;break;case 2:n=this.env.getMinX(),r=this.centre.x,i=this.centre.y,s=this.env.getMaxY();break;case 3:n=this.centre.x,r=this.env.getMaxX(),i=this.centre.y,s=this.env.getMaxY()}return e=new jsts.geom.Envelope(n,r,i,s),o=new jsts.index.quadtree.Node(e,this.level-1)},function(){jsts.triangulate.quadedge.QuadEdge=function(){this.rot=null,this.vertex=null,this.next=null,this.data=null};var t=jsts.triangulate.quadedge.QuadEdge;jsts.triangulate.quadedge.QuadEdge.makeEdge=function(e,o){var n,r,i,s,a;return n=new t,r=new t,i=new t,s=new t,n.rot=r,r.rot=i,i.rot=s,s.rot=n,n.setNext(n),r.setNext(s),i.setNext(i),s.setNext(r),a=n,a.setOrig(e),a.setDest(o),a},jsts.triangulate.quadedge.QuadEdge.connect=function(e,o){var n=t.makeEdge(e.dest(),o.orig());return t.splice(n,e.lNext()),t.splice(n.sym(),o),n},jsts.triangulate.quadedge.QuadEdge.splice=function(t,e){var o,n,r,i,s,a;o=t.oNext().rot,n=e.oNext().rot,r=e.oNext(),i=t.oNext(),s=n.oNext(),a=o.oNext(),t.setNext(r),e.setNext(i),o.setNext(s),n.setNext(a)},jsts.triangulate.quadedge.QuadEdge.swap=function(e){var o,n;o=e.oPrev(),n=e.sym().oPrev(),t.splice(e,o),t.splice(e.sym(),n),t.splice(e,o.lNext()),t.splice(e.sym(),n.lNext()),e.setOrig(o.dest()),e.setDest(n.dest())},jsts.triangulate.quadedge.QuadEdge.prototype.getPrimary=function(){return this.orig().getCoordinate().compareTo(this.dest().getCoordinate())<=0?this:this.sym()},jsts.triangulate.quadedge.QuadEdge.prototype.setData=function(t){this.data=t},jsts.triangulate.quadedge.QuadEdge.prototype.getData=function(){return this.data},jsts.triangulate.quadedge.QuadEdge.prototype.delete_jsts=function(){this.rot=null},jsts.triangulate.quadedge.QuadEdge.prototype.isLive=function(){return null!==this.rot},jsts.triangulate.quadedge.QuadEdge.prototype.setNext=function(t){this.next=t},jsts.triangulate.quadedge.QuadEdge.prototype.invRot=function(){return this.rot.sym()},jsts.triangulate.quadedge.QuadEdge.prototype.sym=function(){return this.rot.rot},jsts.triangulate.quadedge.QuadEdge.prototype.oNext=function(){return this.next},jsts.triangulate.quadedge.QuadEdge.prototype.oPrev=function(){return this.rot.next.rot},jsts.triangulate.quadedge.QuadEdge.prototype.dNext=function(){return this.sym().oNext().sym()},jsts.triangulate.quadedge.QuadEdge.prototype.dPrev=function(){return this.invRot().oNext().invRot()},jsts.triangulate.quadedge.QuadEdge.prototype.lNext=function(){return this.invRot().oNext().rot},jsts.triangulate.quadedge.QuadEdge.prototype.lPrev=function(){return this.next.sym()},jsts.triangulate.quadedge.QuadEdge.prototype.rNext=function(){return this.rot.next.invRot()},jsts.triangulate.quadedge.QuadEdge.prototype.rPrev=function(){return this.sym().oNext()},jsts.triangulate.quadedge.QuadEdge.prototype.setOrig=function(t){this.vertex=t},jsts.triangulate.quadedge.QuadEdge.prototype.setDest=function(t){this.sym().setOrig(t)},jsts.triangulate.quadedge.QuadEdge.prototype.orig=function(){return this.vertex},jsts.triangulate.quadedge.QuadEdge.prototype.dest=function(){return this.sym().orig()},jsts.triangulate.quadedge.QuadEdge.prototype.getLength=function(){return this.orig().getCoordinate().distance(dest().getCoordinate())},jsts.triangulate.quadedge.QuadEdge.prototype.equalsNonOriented=function(t){return this.equalsOriented(t)?!0:this.equalsOriented(t.sym())?!0:!1},jsts.triangulate.quadedge.QuadEdge.prototype.equalsOriented=function(t){return this.orig().getCoordinate().equals2D(t.orig().getCoordinate())&&this.dest().getCoordinate().equals2D(t.dest().getCoordinate())?!0:!1},jsts.triangulate.quadedge.QuadEdge.prototype.toLineSegment=function(){return new jsts.geom.LineSegment(this.vertex.getCoordinate(),this.dest().getCoordinate())},jsts.triangulate.quadedge.QuadEdge.prototype.toString=function(){var t,e;return t=this.vertex.getCoordinate(),e=this.dest().getCoordinate(),jsts.io.WKTWriter.toLineString(t,e)}}(),function(){var t=jsts.util.Assert;jsts.geomgraph.EdgeEnd=function(t,e,o,n){this.edge=t,e&&o&&this.init(e,o),n&&(this.label=n||null)},jsts.geomgraph.EdgeEnd.prototype.edge=null,jsts.geomgraph.EdgeEnd.prototype.label=null,jsts.geomgraph.EdgeEnd.prototype.node=null,jsts.geomgraph.EdgeEnd.prototype.p0=null,jsts.geomgraph.EdgeEnd.prototype.p1=null,jsts.geomgraph.EdgeEnd.prototype.dx=null,jsts.geomgraph.EdgeEnd.prototype.dy=null,jsts.geomgraph.EdgeEnd.prototype.quadrant=null,jsts.geomgraph.EdgeEnd.prototype.init=function(e,o){this.p0=e,this.p1=o,this.dx=o.x-e.x,this.dy=o.y-e.y,this.quadrant=jsts.geomgraph.Quadrant.quadrant(this.dx,this.dy),t.isTrue(!(0===this.dx&&0===this.dy),"EdgeEnd with identical endpoints found")},jsts.geomgraph.EdgeEnd.prototype.getEdge=function(){return this.edge},jsts.geomgraph.EdgeEnd.prototype.getLabel=function(){return this.label},jsts.geomgraph.EdgeEnd.prototype.getCoordinate=function(){return this.p0},jsts.geomgraph.EdgeEnd.prototype.getDirectedCoordinate=function(){return this.p1},jsts.geomgraph.EdgeEnd.prototype.getQuadrant=function(){return this.quadrant},jsts.geomgraph.EdgeEnd.prototype.getDx=function(){return this.dx},jsts.geomgraph.EdgeEnd.prototype.getDy=function(){return this.dy},jsts.geomgraph.EdgeEnd.prototype.setNode=function(t){this.node=t},jsts.geomgraph.EdgeEnd.prototype.getNode=function(){return this.node},jsts.geomgraph.EdgeEnd.prototype.compareTo=function(t){return this.compareDirection(t)},jsts.geomgraph.EdgeEnd.prototype.compareDirection=function(t){return this.dx===t.dx&&this.dy===t.dy?0:this.quadrant>t.quadrant?1:this.quadrant<t.quadrant?-1:jsts.algorithm.CGAlgorithms.computeOrientation(t.p0,t.p1,this.p1)},jsts.geomgraph.EdgeEnd.prototype.computeLabel=function(){}}(),jsts.operation.buffer.RightmostEdgeFinder=function(){},jsts.operation.buffer.RightmostEdgeFinder.prototype.minIndex=-1,jsts.operation.buffer.RightmostEdgeFinder.prototype.minCoord=null,jsts.operation.buffer.RightmostEdgeFinder.prototype.minDe=null,jsts.operation.buffer.RightmostEdgeFinder.prototype.orientedDe=null,jsts.operation.buffer.RightmostEdgeFinder.prototype.getEdge=function(){return this.orientedDe},jsts.operation.buffer.RightmostEdgeFinder.prototype.getCoordinate=function(){return this.minCoord},jsts.operation.buffer.RightmostEdgeFinder.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var o=e.next();o.isForward()&&this.checkForRightmostCoordinate(o)}jsts.util.Assert.isTrue(0!==this.minIndex||this.minCoord.equals(this.minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this.minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this.orientedDe=this.minDe;var n=this.getRightmostSide(this.minDe,this.minIndex);n==jsts.geomgraph.Position.LEFT&&(this.orientedDe=this.minDe.getSym())},jsts.operation.buffer.RightmostEdgeFinder.prototype.findRightmostEdgeAtNode=function(){var t=this.minDe.getNode(),e=t.getEdges();this.minDe=e.getRightmostEdge(),this.minDe.isForward()||(this.minDe=this.minDe.getSym(),this.minIndex=this.minDe.getEdge().getCoordinates().length-1)},jsts.operation.buffer.RightmostEdgeFinder.prototype.findRightmostEdgeAtVertex=function(){var t=this.minDe.getEdge().getCoordinates();jsts.util.Assert.isTrue(this.minIndex>0&&this.minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this.minIndex-1],o=t[this.minIndex+1],n=jsts.algorithm.CGAlgorithms.computeOrientation(this.minCoord,o,e),r=!1;e.y<this.minCoord.y&&o.y<this.minCoord.y&&n===jsts.algorithm.CGAlgorithms.COUNTERCLOCKWISE?r=!0:e.y>this.minCoord.y&&o.y>this.minCoord.y&&n===jsts.algorithm.CGAlgorithms.CLOCKWISE&&(r=!0),r&&(this.minIndex=this.minIndex-1)},jsts.operation.buffer.RightmostEdgeFinder.prototype.checkForRightmostCoordinate=function(t){for(var e=t.getEdge().getCoordinates(),o=0;o<e.length-1;o++)(null===this.minCoord||e[o].x>this.minCoord.x)&&(this.minDe=t,this.minIndex=o,this.minCoord=e[o])},jsts.operation.buffer.RightmostEdgeFinder.prototype.getRightmostSide=function(t,e){var o=this.getRightmostSideOfSegment(t,e);return 0>o&&(o=this.getRightmostSideOfSegment(t,e-1)),0>o&&(this.minCoord=null,this.checkForRightmostCoordinate(t)),o},jsts.operation.buffer.RightmostEdgeFinder.prototype.getRightmostSideOfSegment=function(t,e){var o=t.getEdge(),n=o.getCoordinates();if(0>e||e+1>=n.length)return-1;if(n[e].y==n[e+1].y)return-1;var r=jsts.geomgraph.Position.LEFT;return n[e].y<n[e+1].y&&(r=jsts.geomgraph.Position.RIGHT),r},function(){jsts.triangulate.IncrementalDelaunayTriangulator=function(t){this.subdiv=t,this.isUsingTolerance=t.getTolerance()>0},jsts.triangulate.IncrementalDelaunayTriangulator.prototype.insertSites=function(t){var e,o=0,n=t.length;for(o;n>o;o++)e=t[o],this.insertSite(e)},jsts.triangulate.IncrementalDelaunayTriangulator.prototype.insertSite=function(t){var e,o,n,r;if(e=this.subdiv.locate(t),this.subdiv.isVertexOfEdge(e,t))return e;this.subdiv.isOnEdge(e,t.getCoordinate())&&(e=e.oPrev(),this.subdiv.delete_jsts(e.oNext())),o=this.subdiv.makeEdge(e.orig(),t),jsts.triangulate.quadedge.QuadEdge.splice(o,e),n=o;do o=this.subdiv.connect(e,o.sym()),e=o.oPrev();while(e.lNext()!=n);for(;;)if(r=e.oPrev(),r.dest().rightOf(e)&&t.isInCircle(e.orig(),r.dest(),e.dest()))jsts.triangulate.quadedge.QuadEdge.swap(e),e=e.oPrev();else{if(e.oNext()==n)return o;e=e.oNext().lPrev()}}}(),jsts.algorithm.CentroidArea=function(){this.basePt=null,this.triangleCent3=new jsts.geom.Coordinate,this.centSum=new jsts.geom.Coordinate,this.cg3=new jsts.geom.Coordinate},jsts.algorithm.CentroidArea.prototype.basePt=null,jsts.algorithm.CentroidArea.prototype.triangleCent3=null,jsts.algorithm.CentroidArea.prototype.areasum2=0,jsts.algorithm.CentroidArea.prototype.cg3=null,jsts.algorithm.CentroidArea.prototype.centSum=null,jsts.algorithm.CentroidArea.prototype.totalLength=0,jsts.algorithm.CentroidArea.prototype.add=function(t){if(t instanceof jsts.geom.Polygon){var e=t;this.setBasePoint(e.getExteriorRing().getCoordinateN(0)),this.add3(e)}else if(t instanceof jsts.geom.GeometryCollection||t instanceof jsts.geom.MultiPolygon)for(var o=t,n=0;n<o.getNumGeometries();n++)this.add(o.getGeometryN(n));else t instanceof Array&&this.add2(t)},jsts.algorithm.CentroidArea.prototype.add2=function(t){this.setBasePoint(t[0]),this.addShell(t)},jsts.algorithm.CentroidArea.prototype.getCentroid=function(){var t=new jsts.geom.Coordinate;return Math.abs(this.areasum2)>0?(t.x=this.cg3.x/3/this.areasum2,t.y=this.cg3.y/3/this.areasum2):(t.x=this.centSum.x/this.totalLength,t.y=this.centSum.y/this.totalLength),t},jsts.algorithm.CentroidArea.prototype.setBasePoint=function(t){null==this.basePt&&(this.basePt=t)},jsts.algorithm.CentroidArea.prototype.add3=function(t){this.addShell(t.getExteriorRing().getCoordinates());for(var e=0;e<t.getNumInteriorRing();e++)this.addHole(t.getInteriorRingN(e).getCoordinates())},jsts.algorithm.CentroidArea.prototype.addShell=function(t){for(var e=!jsts.algorithm.CGAlgorithms.isCCW(t),o=0;o<t.length-1;o++)this.addTriangle(this.basePt,t[o],t[o+1],e);this.addLinearSegments(t)},jsts.algorithm.CentroidArea.prototype.addHole=function(t){for(var e=jsts.algorithm.CGAlgorithms.isCCW(t),o=0;o<t.length-1;o++)this.addTriangle(this.basePt,t[o],t[o+1],e);this.addLinearSegments(t)},jsts.algorithm.CentroidArea.prototype.addTriangle=function(t,e,o,n){var r=n?1:-1;jsts.algorithm.CentroidArea.centroid3(t,e,o,this.triangleCent3);var i=jsts.algorithm.CentroidArea.area2(t,e,o);this.cg3.x+=r*i*this.triangleCent3.x,this.cg3.y+=r*i*this.triangleCent3.y,this.areasum2+=r*i},jsts.algorithm.CentroidArea.centroid3=function(t,e,o,n){n.x=t.x+e.x+o.x,n.y=t.y+e.y+o.y},jsts.algorithm.CentroidArea.area2=function(t,e,o){return(e.x-t.x)*(o.y-t.y)-(o.x-t.x)*(e.y-t.y)},jsts.algorithm.CentroidArea.prototype.addLinearSegments=function(t){for(var e=0;e<t.length-1;e++){var o=t[e].distance(t[e+1]);this.totalLength+=o;var n=(t[e].x+t[e+1].x)/2;this.centSum.x+=o*n;var r=(t[e].y+t[e+1].y)/2;this.centSum.y+=o*r}},jsts.geomgraph.index.SweepLineSegment=function(t,e){this.edge=t,this.ptIndex=e,this.pts=t.getCoordinates()},jsts.geomgraph.index.SweepLineSegment.prototype.edge=null,jsts.geomgraph.index.SweepLineSegment.prototype.pts=null,jsts.geomgraph.index.SweepLineSegment.prototype.ptIndex=null,jsts.geomgraph.index.SweepLineSegment.prototype.getMinX=function(){var t=this.pts[this.ptIndex].x,e=this.pts[this.ptIndex+1].x;return e>t?t:e},jsts.geomgraph.index.SweepLineSegment.prototype.getMaxX=function(){var t=this.pts[this.ptIndex].x,e=this.pts[this.ptIndex+1].x;return t>e?t:e},jsts.geomgraph.index.SweepLineSegment.prototype.computeIntersections=function(t,e){e.addIntersections(this.edge,this.ptIndex,t.edge,t.ptIndex)},jsts.index.quadtree.Root=function(){jsts.index.quadtree.NodeBase.prototype.constructor.apply(this,arguments),this.origin=new jsts.geom.Coordinate(0,0)},jsts.index.quadtree.Root.prototype=new jsts.index.quadtree.NodeBase,jsts.index.quadtree.Root.prototype.insert=function(t,e){var o=this.getSubnodeIndex(t,this.origin);if(-1===o)return void this.add(e);var n=this.subnode[o];if(null===n||!n.getEnvelope().contains(t)){var r=jsts.index.quadtree.Node.createExpanded(n,t);this.subnode[o]=r}this.insertContained(this.subnode[o],t,e)},jsts.index.quadtree.Root.prototype.insertContained=function(t,e,o){var n,r,i;n=jsts.index.IntervalSize.isZeroWidth(e.getMinX(),e.getMaxX()),r=jsts.index.IntervalSize.isZeroWidth(e.getMinY(),e.getMaxY()),i=n||r?t.find(e):t.getNode(e),i.add(o)},jsts.index.quadtree.Root.prototype.isSearchMatch=function(){return!0},jsts.geomgraph.index.MonotoneChainIndexer=function(){},jsts.geomgraph.index.MonotoneChainIndexer.toIntArray=function(t){for(var e=[],o=t.iterator();o.hasNext();){var n=o.next();e.push(n)}return e},jsts.geomgraph.index.MonotoneChainIndexer.prototype.getChainStartIndices=function(t){var e=0,o=new javascript.util.ArrayList;o.add(e);do{var n=this.findChainEnd(t,e);o.add(n),e=n}while(e<t.length-1);var r=jsts.geomgraph.index.MonotoneChainIndexer.toIntArray(o);return r},jsts.geomgraph.index.MonotoneChainIndexer.prototype.findChainEnd=function(t,e){for(var o=jsts.geomgraph.Quadrant.quadrant(t[e],t[e+1]),n=e+1;n<t.length;){var r=jsts.geomgraph.Quadrant.quadrant(t[n-1],t[n]);if(r!=o)break;n++}return n-1},jsts.noding.IntersectionAdder=function(t){this.li=t},jsts.noding.IntersectionAdder.prototype=new jsts.noding.SegmentIntersector,jsts.noding.IntersectionAdder.constructor=jsts.noding.IntersectionAdder,jsts.noding.IntersectionAdder.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)},jsts.noding.IntersectionAdder.prototype._hasIntersection=!1,jsts.noding.IntersectionAdder.prototype.hasProper=!1,jsts.noding.IntersectionAdder.prototype.hasProperInterior=!1,jsts.noding.IntersectionAdder.prototype.hasInterior=!1,jsts.noding.IntersectionAdder.prototype.properIntersectionPoint=null,jsts.noding.IntersectionAdder.prototype.li=null,jsts.noding.IntersectionAdder.prototype.isSelfIntersection=null,jsts.noding.IntersectionAdder.prototype.numIntersections=0,jsts.noding.IntersectionAdder.prototype.numInteriorIntersections=0,jsts.noding.IntersectionAdder.prototype.numProperIntersections=0,jsts.noding.IntersectionAdder.prototype.numTests=0,jsts.noding.IntersectionAdder.prototype.getLineIntersector=function(){return this.li},jsts.noding.IntersectionAdder.prototype.getProperIntersectionPoint=function(){return this.properIntersectionPoint},jsts.noding.IntersectionAdder.prototype.hasIntersection=function(){return this._hasIntersection},jsts.noding.IntersectionAdder.prototype.hasProperIntersection=function(){return this.hasProper},jsts.noding.IntersectionAdder.prototype.hasProperInteriorIntersection=function(){return this.hasProperInterior},jsts.noding.IntersectionAdder.prototype.hasInteriorIntersection=function(){return this.hasInterior},jsts.noding.IntersectionAdder.prototype.isTrivialIntersection=function(t,e,o,n){if(t==o&&1==this.li.getIntersectionNum()){if(jsts.noding.IntersectionAdder.isAdjacentSegments(e,n))return!0;if(t.isClosed()){var r=t.size()-1;if(0===e&&n===r||0===n&&e===r)return!0}}return!1},jsts.noding.IntersectionAdder.prototype.processIntersections=function(t,e,o,n){if(t!==o||e!==n){this.numTests++;var r=t.getCoordinates()[e],i=t.getCoordinates()[e+1],s=o.getCoordinates()[n],a=o.getCoordinates()[n+1];this.li.computeIntersection(r,i,s,a),this.li.hasIntersection()&&(this.numIntersections++,this.li.isInteriorIntersection()&&(this.numInteriorIntersections++,this.hasInterior=!0),this.isTrivialIntersection(t,e,o,n)||(this._hasIntersection=!0,t.addIntersections(this.li,e,0),o.addIntersections(this.li,n,1),this.li.isProper()&&(this.numProperIntersections++,this.hasProper=!0,this.hasProperInterior=!0)))}},jsts.noding.IntersectionAdder.prototype.isDone=function(){return!1},jsts.operation.union.CascadedPolygonUnion=function(t){this.inputPolys=t},jsts.operation.union.CascadedPolygonUnion.union=function(t){var e=new jsts.operation.union.CascadedPolygonUnion(t);return e.union()},jsts.operation.union.CascadedPolygonUnion.prototype.inputPolys,jsts.operation.union.CascadedPolygonUnion.prototype.geomFactory=null,jsts.operation.union.CascadedPolygonUnion.prototype.STRTREE_NODE_CAPACITY=4,jsts.operation.union.CascadedPolygonUnion.prototype.union=function(){if(0===this.inputPolys.length)return null;this.geomFactory=this.inputPolys[0].getFactory();for(var t=new jsts.index.strtree.STRtree(this.STRTREE_NODE_CAPACITY),e=0,o=this.inputPolys.length;o>e;e++){var n=this.inputPolys[e];t.insert(n.getEnvelopeInternal(),n)}var r=t.itemsTree(),i=this.unionTree(r);return i},jsts.operation.union.CascadedPolygonUnion.prototype.unionTree=function(t){var e=this.reduceToGeometries(t),o=this.binaryUnion(e);return o},jsts.operation.union.CascadedPolygonUnion.prototype.binaryUnion=function(t,e,o){if(e=e||0,o=o||t.length,1>=o-e){var n=this.getGeometry(t,e);return this.unionSafe(n,null)}if(o-e===2)return this.unionSafe(this.getGeometry(t,e),this.getGeometry(t,e+1));var r=parseInt((o+e)/2),n=this.binaryUnion(t,e,r),i=this.binaryUnion(t,r,o);return this.unionSafe(n,i)},jsts.operation.union.CascadedPolygonUnion.prototype.getGeometry=function(t,e){return e>=t.length?null:t[e]},jsts.operation.union.CascadedPolygonUnion.prototype.reduceToGeometries=function(t){for(var e=[],o=0,n=t.length;n>o;o++){var r=t[o],i=null;r instanceof Array?i=this.unionTree(r):r instanceof jsts.geom.Geometry&&(i=r),e.push(i)}return e},jsts.operation.union.CascadedPolygonUnion.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.clone():null===e?t.clone():this.unionOptimized(t,e)},jsts.operation.union.CascadedPolygonUnion.prototype.unionOptimized=function(t,e){var o=t.getEnvelopeInternal(),n=e.getEnvelopeInternal();if(!o.intersects(n)){var r=jsts.geom.util.GeometryCombiner.combine(t,e);return r}if(t.getNumGeometries<=1&&e.getNumGeometries<=1)return this.unionActual(t,e);var i=o.intersection(n);return this.unionUsingEnvelopeIntersection(t,e,i)},jsts.operation.union.CascadedPolygonUnion.prototype.unionUsingEnvelopeIntersection=function(t,e,o){var n=new javascript.util.ArrayList,r=this.extractByEnvelope(o,t,n),i=this.extractByEnvelope(o,e,n),s=this.unionActual(r,i);n.add(s);var a=jsts.geom.util.GeometryCombiner.combine(n);return a},jsts.operation.union.CascadedPolygonUnion.prototype.extractByEnvelope=function(t,e,o){for(var n=new javascript.util.ArrayList,r=0;r<e.getNumGeometries();r++){var i=e.getGeometryN(r);i.getEnvelopeInternal().intersects(t)?n.add(i):o.add(i)}return this.geomFactory.buildGeometry(n)},jsts.operation.union.CascadedPolygonUnion.prototype.unionActual=function(t,e){return t.union(e)},function(){jsts.geom.MultiPoint=function(t,e){this.geometries=t||[],this.factory=e},jsts.geom.MultiPoint.prototype=new jsts.geom.GeometryCollection,jsts.geom.MultiPoint.constructor=jsts.geom.MultiPoint,jsts.geom.MultiPoint.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},jsts.geom.MultiPoint.prototype.getGeometryN=function(t){return this.geometries[t]},jsts.geom.MultiPoint.prototype.equalsExact=function(t,e){return this.isEquivalentClass(t)?jsts.geom.GeometryCollection.prototype.equalsExact.call(this,t,e):!1},jsts.geom.MultiPoint.prototype.CLASS_NAME="jsts.geom.MultiPoint"}(),jsts.operation.buffer.OffsetCurveBuilder=function(t,e){this.precisionModel=t,this.bufParams=e},jsts.operation.buffer.OffsetCurveBuilder.prototype.distance=0,jsts.operation.buffer.OffsetCurveBuilder.prototype.precisionModel=null,jsts.operation.buffer.OffsetCurveBuilder.prototype.bufParams=null,jsts.operation.buffer.OffsetCurveBuilder.prototype.getBufferParameters=function(){return this.bufParams},jsts.operation.buffer.OffsetCurveBuilder.prototype.getLineCurve=function(t,e){if(this.distance=e,this.distance<0&&!this.bufParams.isSingleSided())return null;if(0==this.distance)return null;var o=Math.abs(this.distance),n=this.getSegGen(o);if(t.length<=1)this.computePointCurve(t[0],n);else if(this.bufParams.isSingleSided()){var r=0>e;this.computeSingleSidedBufferCurve(t,r,n)}else this.computeLineBufferCurve(t,n);var i=n.getCoordinates();return i},jsts.operation.buffer.OffsetCurveBuilder.prototype.getRingCurve=function(t,e,o){if(this.distance=o,t.length<=2)return this.getLineCurve(t,o);if(0==this.distance)return jsts.operation.buffer.OffsetCurveBuilder.copyCoordinates(t);var n=this.getSegGen(this.distance);return this.computeRingBufferCurve(t,e,n),n.getCoordinates()},jsts.operation.buffer.OffsetCurveBuilder.prototype.getOffsetCurve=function(t,e){if(this.distance=e,0===this.distance)return null;var o=this.distance<0,n=Math.abs(this.distance),r=this.getSegGen(n);t.length<=1?this.computePointCurve(t[0],r):this.computeOffsetCurve(t,o,r);var i=r.getCoordinates();return o&&i.reverse(),i},jsts.operation.buffer.OffsetCurveBuilder.copyCoordinates=function(t){for(var e=[],o=0;o<t.length;o++)e.push(t[o].clone());return e},jsts.operation.buffer.OffsetCurveBuilder.prototype.getSegGen=function(t){return new jsts.operation.buffer.OffsetSegmentGenerator(this.precisionModel,this.bufParams,t)},jsts.operation.buffer.OffsetCurveBuilder.SIMPLIFY_FACTOR=100,jsts.operation.buffer.OffsetCurveBuilder.simplifyTolerance=function(t){return t/jsts.operation.buffer.OffsetCurveBuilder.SIMPLIFY_FACTOR},jsts.operation.buffer.OffsetCurveBuilder.prototype.computePointCurve=function(t,e){switch(this.bufParams.getEndCapStyle()){case jsts.operation.buffer.BufferParameters.CAP_ROUND:e.createCircle(t);break;case jsts.operation.buffer.BufferParameters.CAP_SQUARE:e.createSquare(t)}},jsts.operation.buffer.OffsetCurveBuilder.prototype.computeLineBufferCurve=function(t,e){var o=jsts.operation.buffer.OffsetCurveBuilder.simplifyTolerance(this.distance),n=jsts.operation.buffer.BufferInputLineSimplifier.simplify(t,o),r=n.length-1;
e.initSideSegments(n[0],n[1],jsts.geomgraph.Position.LEFT);for(var i=2;r>=i;i++)e.addNextSegment(n[i],!0);e.addLastSegment(),e.addLineEndCap(n[r-1],n[r]);var s=jsts.operation.buffer.BufferInputLineSimplifier.simplify(t,-o),a=s.length-1;e.initSideSegments(s[a],s[a-1],jsts.geomgraph.Position.LEFT);for(var i=a-2;i>=0;i--)e.addNextSegment(s[i],!0);e.addLastSegment(),e.addLineEndCap(s[1],s[0]),e.closeRing()},jsts.operation.buffer.OffsetCurveBuilder.prototype.computeSingleSidedBufferCurve=function(t,e,o){var n=jsts.operation.buffer.OffsetCurveBuilder.simplifyTolerance(this.distance);if(e){o.addSegments(t,!0);var r=jsts.operation.buffer.BufferInputLineSimplifier.simplify(t,-n),i=r.length-1;o.initSideSegments(r[i],r[i-1],jsts.geomgraph.Position.LEFT),o.addFirstSegment();for(var s=i-2;s>=0;s--)o.addNextSegment(r[s],!0)}else{o.addSegments(t,!1);var a=jsts.operation.buffer.BufferInputLineSimplifier.simplify(t,n),u=a.length-1;o.initSideSegments(a[0],a[1],jsts.geomgraph.Position.LEFT),o.addFirstSegment();for(var s=2;u>=s;s++)o.addNextSegment(a[s],!0)}o.addLastSegment(),o.closeRing()},jsts.operation.buffer.OffsetCurveBuilder.prototype.computeOffsetCurve=function(t,e,o){var n=jsts.operation.buffer.OffsetCurveBuilder.simplifyTolerance(this.distance);if(e){var r=jsts.operation.buffer.BufferInputLineSimplifier.simplify(t,-n),i=r.length-1;o.initSideSegments(r[i],r[i-1],jsts.geomgraph.Position.LEFT),o.addFirstSegment();for(var s=i-2;s>=0;s--)o.addNextSegment(r[s],!0)}else{var a=jsts.operation.buffer.BufferInputLineSimplifier.simplify(t,n),u=a.length-1;o.initSideSegments(a[0],a[1],jsts.geomgraph.Position.LEFT),o.addFirstSegment();for(var s=2;u>=s;s++)o.addNextSegment(a[s],!0)}o.addLastSegment()},jsts.operation.buffer.OffsetCurveBuilder.prototype.computeRingBufferCurve=function(t,e,o){var n=jsts.operation.buffer.OffsetCurveBuilder.simplifyTolerance(this.distance);e===jsts.geomgraph.Position.RIGHT&&(n=-n);var r=jsts.operation.buffer.BufferInputLineSimplifier.simplify(t,n),i=r.length-1;o.initSideSegments(r[i-1],r[0],e);for(var s=1;i>=s;s++){var a=1!==s;o.addNextSegment(r[s],a)}o.closeRing()},function(){var t=function(t,e,o){this.hotPixel=t,this.parentEdge=e,this.vertexIndex=o};t.prototype=new jsts.index.chain.MonotoneChainSelectAction,t.constructor=t,t.prototype.hotPixel=null,t.prototype.parentEdge=null,t.prototype.vertexIndex=null,t.prototype._isNodeAdded=!1,t.prototype.isNodeAdded=function(){return this._isNodeAdded},t.prototype.select=function(t,e){var o=t.getContext();(null===this.parentEdge||o!==this.parentEdge||e!==this.vertexIndex)&&(this._isNodeAdded=this.hotPixel.addSnappedNode(o,e))},jsts.noding.snapround.MCIndexPointSnapper=function(t){this.index=t},jsts.noding.snapround.MCIndexPointSnapper.prototype.index=null,jsts.noding.snapround.MCIndexPointSnapper.prototype.snap=function(e,o,n){if(1===arguments.length)return void this.snap2.apply(this,arguments);var r=e.getSafeEnvelope(),i=new t(e,o,n);return this.index.query(r,{visitItem:function(t){t.select(r,i)}}),i.isNodeAdded()},jsts.noding.snapround.MCIndexPointSnapper.prototype.snap2=function(t){return this.snap(t,null,-1)}}(),function(){var t=function(){this.items=new javascript.util.ArrayList,this.subnode=[null,null]};t.getSubnodeIndex=function(t,e){var o=-1;return t.min>=e&&(o=1),t.max<=e&&(o=0),o},t.prototype.getItems=function(){return this.items},t.prototype.add=function(t){this.items.add(t)},t.prototype.addAllItems=function(t){t.addAll(this.items);var e=0,o=2;for(e;o>e;e++)null!==this.subnode[e]&&this.subnode[e].addAllItems(t);return t},t.prototype.addAllItemsFromOverlapping=function(t,e){(null===t||this.isSearchMatch(t))&&(e.addAll(this.items),null!==this.subnode[0]&&this.subnode[0].addAllItemsFromOverlapping(t,e),null!==this.subnode[1]&&this.subnode[1].addAllItemsFromOverlapping(t,e))},t.prototype.remove=function(t,e){if(!this.isSearchMatch(t))return!1;var o=!1,n=0,r=2;for(n;r>n;n++)if(null!==this.subnode[n]&&(o=this.subnode[n].remove(t,e))){this.subnode[n].isPrunable()&&(this.subnode[n]=null);break}return o?o:o=this.items.remove(e)},t.prototype.isPrunable=function(){return!(this.hasChildren()||this.hasItems())},t.prototype.hasChildren=function(){var t=0,e=2;for(t;e>t;t++)if(null!==this.subnode[t])return!0;return!1},t.prototype.hasItems=function(){return!this.items.isEmpty()},t.prototype.depth=function(){var t,e=0,o=0,n=2;for(o;n>o;o++)null!==this.subnode[o]&&(t=this.subnode[o].depth(),t>e&&(e=t));return e+1},t.prototype.size=function(){var t=0,e=0,o=2;for(e;o>e;e++)null!==this.subnode[e]&&(t+=this.subnode[e].size());return t+this.items.size()},t.prototype.nodeSize=function(){var t=0,e=0,o=2;for(e;o>e;e++)null!==this.subnode[e]&&(t+=this.subnode[e].nodeSize());return t+1},jsts.index.bintree.NodeBase=t}(),function(){var t=jsts.index.bintree.NodeBase,e=jsts.index.bintree.Key,o=jsts.index.bintree.Interval,n=function(t,e){this.items=new javascript.util.ArrayList,this.subnode=[null,null],this.interval=t,this.level=e,this.centre=(t.getMin()+t.getMax())/2};n.prototype=new t,n.constructor=n,n.createNode=function(t){var o,r;return o=new e(t),r=new n(o.getInterval(),o.getLevel())},n.createExpanded=function(t,e){var r,i;return r=new o(e),null!==t&&r.expandToInclude(t.interval),i=n.createNode(r),null!==t&&i.insert(t),i},n.prototype.getInterval=function(){return this.interval},n.prototype.isSearchMatch=function(t){return t.overlaps(this.interval)},n.prototype.getNode=function(e){var o,n=t.getSubnodeIndex(e,this.centre);return-1!=n?(o=this.getSubnode(n),o.getNode(e)):this},n.prototype.find=function(e){var o,n=t.getSubnodeIndex(e,this.centre);return-1===n?this:null!==this.subnode[n]?(o=this.subnode[n],o.find(e)):this},n.prototype.insert=function(e){var o,n=t.getSubnodeIndex(e.interval,this.centre);e.level===this.level-1?this.subnode[n]=e:(o=this.createSubnode(n),o.insert(e),this.subnode[n]=o)},n.prototype.getSubnode=function(t){return null===this.subnode[t]&&(this.subnode[t]=this.createSubnode(t)),this.subnode[t]},n.prototype.createSubnode=function(t){var e,r,i,s;switch(e=0,r=0,t){case 0:e=this.interval.getMin(),r=this.centre;break;case 1:e=this.centre,r=this.interval.getMax()}return i=new o(e,r),s=new n(i,this.level-1)},jsts.index.bintree.Node=n}(),function(){var t=jsts.index.bintree.Node,e=jsts.index.bintree.NodeBase,o=function(){this.subnode=[null,null],this.items=new javascript.util.ArrayList};o.prototype=new jsts.index.bintree.NodeBase,o.constructor=o,o.origin=0,o.prototype.insert=function(n,r){var i,s,a=e.getSubnodeIndex(n,o.origin);return-1===a?void this.add(r):(i=this.subnode[a],null!==i&&i.getInterval().contains(n)||(s=t.createExpanded(i,n),this.subnode[a]=s),void this.insertContained(this.subnode[a],n,r))},o.prototype.insertContained=function(t,e,o){var n,r;n=jsts.index.IntervalSize.isZeroWidth(e.getMin(),e.getMax()),r=n?t.find(e):t.getNode(e),r.add(o)},o.prototype.isSearchMatch=function(){return!0},jsts.index.bintree.Root=o}(),jsts.geomgraph.Quadrant=function(){},jsts.geomgraph.Quadrant.NE=0,jsts.geomgraph.Quadrant.NW=1,jsts.geomgraph.Quadrant.SW=2,jsts.geomgraph.Quadrant.SE=3,jsts.geomgraph.Quadrant.quadrant=function(t,e){if(t instanceof jsts.geom.Coordinate)return jsts.geomgraph.Quadrant.quadrant2.apply(this,arguments);if(0===t&&0===e)throw new jsts.error.IllegalArgumentError("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?jsts.geomgraph.Quadrant.NE:jsts.geomgraph.Quadrant.SE:e>=0?jsts.geomgraph.Quadrant.NW:jsts.geomgraph.Quadrant.SW},jsts.geomgraph.Quadrant.quadrant2=function(t,e){if(e.x===t.x&&e.y===t.y)throw new jsts.error.IllegalArgumentError("Cannot compute the quadrant for two identical points "+t);return e.x>=t.x?e.y>=t.y?jsts.geomgraph.Quadrant.NE:jsts.geomgraph.Quadrant.SE:e.y>=t.y?jsts.geomgraph.Quadrant.NW:jsts.geomgraph.Quadrant.SW},jsts.geomgraph.Quadrant.isOpposite=function(t,e){if(t===e)return!1;var o=(t-e+4)%4;return 2===o?!0:!1},jsts.geomgraph.Quadrant.commonHalfPlane=function(t,e){if(t===e)return t;var o=(t-e+4)%4;if(2===o)return-1;var n=e>t?t:e,r=t>e?t:e;return 0===n&&3===r?3:n},jsts.geomgraph.Quadrant.isInHalfPlane=function(t,e){return e===jsts.geomgraph.Quadrant.SE?t===jsts.geomgraph.Quadrant.SE||t===jsts.geomgraph.Quadrant.SW:t===e||t===e+1},jsts.geomgraph.Quadrant.isNorthern=function(t){return t===jsts.geomgraph.Quadrant.NE||t===jsts.geomgraph.Quadrant.NW},jsts.operation.valid.ConsistentAreaTester=function(t){this.geomGraph=t,this.li=new jsts.algorithm.RobustLineIntersector,this.nodeGraph=new jsts.operation.relate.RelateNodeGraph,this.invalidPoint=null},jsts.operation.valid.ConsistentAreaTester.prototype.getInvalidPoint=function(){return this.invalidPoint},jsts.operation.valid.ConsistentAreaTester.prototype.isNodeConsistentArea=function(){var t=this.geomGraph.computeSelfNodes(this.li,!0);return t.hasProperIntersection()?(this.invalidPoint=t.getProperIntersectionPoint(),!1):(this.nodeGraph.build(this.geomGraph),this.isNodeEdgeAreaLabelsConsistent())},jsts.operation.valid.ConsistentAreaTester.prototype.isNodeEdgeAreaLabelsConsistent=function(){for(var t=this.nodeGraph.getNodeIterator();t.hasNext();){var e=t.next();if(!e.getEdges().isAreaLabelsConsistent(this.geomGraph))return this.invalidPoint=e.getCoordinate().clone(),!1}return!0},jsts.operation.valid.ConsistentAreaTester.prototype.hasDuplicateRings=function(){for(var t=this.nodeGraph.getNodeIterator();t.hasNext();)for(var e=t.next(),o=e.getEdges().iterator();o.hasNext();){var n=o.next();if(n.getEdgeEnds().length>1)return invalidPoint=n.getEdge().getCoordinate(0),!0}return!1},jsts.operation.relate.RelateNode=function(){jsts.geomgraph.Node.apply(this,arguments)},jsts.operation.relate.RelateNode.prototype=new jsts.geomgraph.Node,jsts.operation.relate.RelateNode.prototype.computeIM=function(t){t.setAtLeastIfValid(this.label.getLocation(0),this.label.getLocation(1),0)},jsts.operation.relate.RelateNode.prototype.updateIMFromEdges=function(t){this.edges.updateIM(t)},function(){var t=jsts.geom.Location,e=jsts.geomgraph.Position,o=jsts.geomgraph.EdgeEnd;jsts.geomgraph.DirectedEdge=function(t,e){if(o.call(this,t),this.depth=[0,-999,-999],this._isForward=e,e)this.init(t.getCoordinate(0),t.getCoordinate(1));else{var n=t.getNumPoints()-1;this.init(t.getCoordinate(n),t.getCoordinate(n-1))}this.computeDirectedLabel()},jsts.geomgraph.DirectedEdge.prototype=new o,jsts.geomgraph.DirectedEdge.constructor=jsts.geomgraph.DirectedEdge,jsts.geomgraph.DirectedEdge.depthFactor=function(e,o){return e===t.EXTERIOR&&o===t.INTERIOR?1:e===t.INTERIOR&&o===t.EXTERIOR?-1:0},jsts.geomgraph.DirectedEdge.prototype._isForward=null,jsts.geomgraph.DirectedEdge.prototype._isInResult=!1,jsts.geomgraph.DirectedEdge.prototype._isVisited=!1,jsts.geomgraph.DirectedEdge.prototype.sym=null,jsts.geomgraph.DirectedEdge.prototype.next=null,jsts.geomgraph.DirectedEdge.prototype.nextMin=null,jsts.geomgraph.DirectedEdge.prototype.edgeRing=null,jsts.geomgraph.DirectedEdge.prototype.minEdgeRing=null,jsts.geomgraph.DirectedEdge.prototype.depth=null,jsts.geomgraph.DirectedEdge.prototype.getEdge=function(){return this.edge},jsts.geomgraph.DirectedEdge.prototype.setInResult=function(t){this._isInResult=t},jsts.geomgraph.DirectedEdge.prototype.isInResult=function(){return this._isInResult},jsts.geomgraph.DirectedEdge.prototype.isVisited=function(){return this._isVisited},jsts.geomgraph.DirectedEdge.prototype.setVisited=function(t){this._isVisited=t},jsts.geomgraph.DirectedEdge.prototype.setEdgeRing=function(t){this.edgeRing=t},jsts.geomgraph.DirectedEdge.prototype.getEdgeRing=function(){return this.edgeRing},jsts.geomgraph.DirectedEdge.prototype.setMinEdgeRing=function(t){this.minEdgeRing=t},jsts.geomgraph.DirectedEdge.prototype.getMinEdgeRing=function(){return this.minEdgeRing},jsts.geomgraph.DirectedEdge.prototype.getDepth=function(t){return this.depth[t]},jsts.geomgraph.DirectedEdge.prototype.setDepth=function(t,e){if(-999!==this.depth[t]&&this.depth[t]!==e)throw new jsts.error.TopologyError("assigned depths do not match",this.getCoordinate());this.depth[t]=e},jsts.geomgraph.DirectedEdge.prototype.getDepthDelta=function(){var t=this.edge.getDepthDelta();return this._isForward||(t=-t),t},jsts.geomgraph.DirectedEdge.prototype.setVisitedEdge=function(t){this.setVisited(t),this.sym.setVisited(t)},jsts.geomgraph.DirectedEdge.prototype.getSym=function(){return this.sym},jsts.geomgraph.DirectedEdge.prototype.isForward=function(){return this._isForward},jsts.geomgraph.DirectedEdge.prototype.setSym=function(t){this.sym=t},jsts.geomgraph.DirectedEdge.prototype.getNext=function(){return this.next},jsts.geomgraph.DirectedEdge.prototype.setNext=function(t){this.next=t},jsts.geomgraph.DirectedEdge.prototype.getNextMin=function(){return this.nextMin},jsts.geomgraph.DirectedEdge.prototype.setNextMin=function(t){this.nextMin=t},jsts.geomgraph.DirectedEdge.prototype.isLineEdge=function(){var e=this.label.isLine(0)||this.label.isLine(1),o=!this.label.isArea(0)||this.label.allPositionsEqual(0,t.EXTERIOR),n=!this.label.isArea(1)||this.label.allPositionsEqual(1,t.EXTERIOR);return e&&o&&n},jsts.geomgraph.DirectedEdge.prototype.isInteriorAreaEdge=function(){for(var o=!0,n=0;2>n;n++)this.label.isArea(n)&&this.label.getLocation(n,e.LEFT)===t.INTERIOR&&this.label.getLocation(n,e.RIGHT)===t.INTERIOR||(o=!1);return o},jsts.geomgraph.DirectedEdge.prototype.computeDirectedLabel=function(){this.label=new jsts.geomgraph.Label(this.edge.getLabel()),this._isForward||this.label.flip()},jsts.geomgraph.DirectedEdge.prototype.setEdgeDepths=function(t,o){var n=this.getEdge().getDepthDelta();this._isForward||(n=-n);var r=1;t===e.LEFT&&(r=-1);var i=e.opposite(t),s=n*r,a=o+s;this.setDepth(t,o),this.setDepth(i,a)}}(),jsts.operation.distance.DistanceOp=function(t,e,o){this.ptLocator=new jsts.algorithm.PointLocator,this.geom=[],this.geom[0]=t,this.geom[1]=e,this.terminateDistance=o},jsts.operation.distance.DistanceOp.prototype.geom=null,jsts.operation.distance.DistanceOp.prototype.terminateDistance=0,jsts.operation.distance.DistanceOp.prototype.ptLocator=null,jsts.operation.distance.DistanceOp.prototype.minDistanceLocation=null,jsts.operation.distance.DistanceOp.prototype.minDistance=Number.MAX_VALUE,jsts.operation.distance.DistanceOp.distance=function(t,e){var o=new jsts.operation.distance.DistanceOp(t,e,0);return o.distance()},jsts.operation.distance.DistanceOp.isWithinDistance=function(t,e,o){var n=new jsts.operation.distance.DistanceOp(t,e,o);return n.distance()<=o},jsts.operation.distance.DistanceOp.nearestPoints=function(t,e){var o=new jsts.operation.distance.DistanceOp(t,e,0);return o.nearestPoints()},jsts.operation.distance.DistanceOp.prototype.distance=function(){if(null===this.geom[0]||null===this.geom[1])throw new jsts.error.IllegalArgumentError("null geometries are not supported");return this.geom[0].isEmpty()||this.geom[1].isEmpty()?0:(this.computeMinDistance(),this.minDistance)},jsts.operation.distance.DistanceOp.prototype.nearestPoints=function(){this.computeMinDistance();var t=[this.minDistanceLocation[0].getCoordinate(),this.minDistanceLocation[1].getCoordinate()];return t},jsts.operation.distance.DistanceOp.prototype.nearestLocations=function(){return this.computeMinDistance(),this.minDistanceLocation},jsts.operation.distance.DistanceOp.prototype.updateMinDistance=function(t,e){null!==t[0]&&(e?(this.minDistanceLocation[0]=t[1],this.minDistanceLocation[1]=t[0]):(this.minDistanceLocation[0]=t[0],this.minDistanceLocation[1]=t[1]))},jsts.operation.distance.DistanceOp.prototype.computeMinDistance=function(){return arguments.length>0?void this.computeMinDistance2.apply(this,arguments):void(null===this.minDistanceLocation&&(this.minDistanceLocation=[],this.computeContainmentDistance(),this.minDistance<=this.terminateDistance||this.computeFacetDistance()))},jsts.operation.distance.DistanceOp.prototype.computeContainmentDistance=function(){if(2===arguments.length)return void this.computeContainmentDistance2.apply(this,arguments);if(3===arguments.length&&!arguments[0]instanceof jsts.operation.distance.GeometryLocation)return void this.computeContainmentDistance3.apply(this,arguments);if(3===arguments.length)return void this.computeContainmentDistance4.apply(this,arguments);var t=[];this.computeContainmentDistance2(0,t),this.minDistance<=this.terminateDistance||this.computeContainmentDistance2(1,t)},jsts.operation.distance.DistanceOp.prototype.computeContainmentDistance2=function(t,e){var o=1-t,n=jsts.geom.util.PolygonExtracter.getPolygons(this.geom[t]);if(n.length>0){var r=jsts.operation.distance.ConnectedElementLocationFilter.getLocations(this.geom[o]);if(this.computeContainmentDistance3(r,n,e),this.minDistance<=this.terminateDistance)return this.minDistanceLocation[o]=e[0],void(this.minDistanceLocation[t]=e[1])}},jsts.operation.distance.DistanceOp.prototype.computeContainmentDistance3=function(t,e,o){for(var n=0;n<t.length;n++)for(var r=t[n],i=0;i<e.length;i++)if(this.computeContainmentDistance4(r,e[i],o),this.minDistance<=this.terminateDistance)return},jsts.operation.distance.DistanceOp.prototype.computeContainmentDistance4=function(t,e,o){var n=t.getCoordinate();return jsts.geom.Location.EXTERIOR!==this.ptLocator.locate(n,e)?(this.minDistance=0,o[0]=t,void(o[1]=new jsts.operation.distance.GeometryLocation(e,n))):void 0},jsts.operation.distance.DistanceOp.prototype.computeFacetDistance=function(){var t=[],e=jsts.geom.util.LinearComponentExtracter.getLines(this.geom[0]),o=jsts.geom.util.LinearComponentExtracter.getLines(this.geom[1]),n=jsts.geom.util.PointExtracter.getPoints(this.geom[0]),r=jsts.geom.util.PointExtracter.getPoints(this.geom[1]);this.computeMinDistanceLines(e,o,t),this.updateMinDistance(t,!1),this.minDistance<=this.terminateDistance||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,r,t),this.updateMinDistance(t,!1),this.minDistance<=this.terminateDistance||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(o,n,t),this.updateMinDistance(t,!0),this.minDistance<=this.terminateDistance||(t[0]=null,t[1]=null,this.computeMinDistancePoints(n,r,t),this.updateMinDistance(t,!1))))},jsts.operation.distance.DistanceOp.prototype.computeMinDistanceLines=function(t,e,o){for(var n=0;n<t.length;n++)for(var r=t[n],i=0;i<e.length;i++){var s=e[i];if(this.computeMinDistance(r,s,o),this.minDistance<=this.terminateDistance)return}},jsts.operation.distance.DistanceOp.prototype.computeMinDistancePoints=function(t,e,o){for(var n=0;n<t.length;n++)for(var r=t[n],i=0;i<e.length;i++){var s=e[i],a=r.getCoordinate().distance(s.getCoordinate());if(a<this.minDistance&&(this.minDistance=a,o[0]=new jsts.operation.distance.GeometryLocation(r,0,r.getCoordinate()),o[1]=new jsts.operation.distance.GeometryLocation(s,0,s.getCoordinate())),this.minDistance<=this.terminateDistance)return}},jsts.operation.distance.DistanceOp.prototype.computeMinDistanceLinesPoints=function(t,e,o){for(var n=0;n<t.length;n++)for(var r=t[n],i=0;i<e.length;i++){var s=e[i];if(this.computeMinDistance(r,s,o),this.minDistance<=this.terminateDistance)return}},jsts.operation.distance.DistanceOp.prototype.computeMinDistance2=function(t,e,o){if(e instanceof jsts.geom.Point)return void this.computeMinDistance3(t,e,o);if(!(t.getEnvelopeInternal().distance(e.getEnvelopeInternal())>this.minDistance))for(var n=t.getCoordinates(),r=e.getCoordinates(),i=0;i<n.length-1;i++)for(var s=0;s<r.length-1;s++){var a=jsts.algorithm.CGAlgorithms.distanceLineLine(n[i],n[i+1],r[s],r[s+1]);if(a<this.minDistance){this.minDistance=a;var u=new jsts.geom.LineSegment(n[i],n[i+1]),p=new jsts.geom.LineSegment(r[s],r[s+1]),g=u.closestPoints(p);o[0]=new jsts.operation.distance.GeometryLocation(t,i,g[0]),o[1]=new jsts.operation.distance.GeometryLocation(e,s,g[1])}if(this.minDistance<=this.terminateDistance)return}},jsts.operation.distance.DistanceOp.prototype.computeMinDistance3=function(t,e,o){if(!(t.getEnvelopeInternal().distance(e.getEnvelopeInternal())>this.minDistance))for(var n=t.getCoordinates(),r=e.getCoordinate(),i=0;i<n.length-1;i++){var s=jsts.algorithm.CGAlgorithms.distancePointLine(r,n[i],n[i+1]);if(s<this.minDistance){this.minDistance=s;var a=new jsts.geom.LineSegment(n[i],n[i+1]),u=a.closestPoint(r);o[0]=new jsts.operation.distance.GeometryLocation(t,i,u),o[1]=new jsts.operation.distance.GeometryLocation(e,0,r)}if(this.minDistance<=this.terminateDistance)return}},jsts.index.strtree.SIRtree=function(t){t=t||10,jsts.index.strtree.AbstractSTRtree.call(this,t)},jsts.index.strtree.SIRtree.prototype=new jsts.index.strtree.AbstractSTRtree,jsts.index.strtree.SIRtree.constructor=jsts.index.strtree.SIRtree,jsts.index.strtree.SIRtree.prototype.comperator={compare:function(t,e){return t.getBounds().getCentre()-e.getBounds().getCentre()}},jsts.index.strtree.SIRtree.prototype.intersectionOp={intersects:function(t,e){return t.intersects(e)}},jsts.index.strtree.SIRtree.prototype.createNode=function(){var t=function(){jsts.index.strtree.AbstractNode.apply(this,arguments)};return t.prototype=new jsts.index.strtree.AbstractNode,t.constructor=t,t.prototype.computeBounds=function(){for(var t,e=null,o=this.getChildBoundables(),n=0,r=o.length;r>n;n++)t=o[n],null===e?e=new jsts.index.strtree.Interval(t.getBounds()):e.expandToInclude(t.getBounds());return e},t},jsts.index.strtree.SIRtree.prototype.insert=function(t,e,o){jsts.index.strtree.AbstractSTRtree.prototype.insert(new jsts.index.strtree.Interval(Math.min(t,e),Math.max(t,e)),o)},jsts.index.strtree.SIRtree.prototype.query=function(t,e){e=e||t,jsts.index.strtree.AbstractSTRtree.prototype.query(new jsts.index.strtree.Interval(Math.min(t,e),Math.max(t,e)))},jsts.index.strtree.SIRtree.prototype.getIntersectsOp=function(){return this.intersectionOp},jsts.index.strtree.SIRtree.prototype.getComparator=function(){return this.comperator},jsts.simplify.DouglasPeuckerSimplifier=function(t){this.inputGeom=t,this.isEnsureValidTopology=!0},jsts.simplify.DouglasPeuckerSimplifier.prototype.inputGeom=null,jsts.simplify.DouglasPeuckerSimplifier.prototype.distanceTolerance=null,jsts.simplify.DouglasPeuckerSimplifier.prototype.isEnsureValidTopology=null,jsts.simplify.DouglasPeuckerSimplifier.simplify=function(t,e){var o=new jsts.simplify.DouglasPeuckerSimplifier(t);return o.setDistanceTolerance(e),o.getResultGeometry()},jsts.simplify.DouglasPeuckerSimplifier.prototype.setDistanceTolerance=function(t){if(0>t)throw"Tolerance must be non-negative";this.distanceTolerance=t},jsts.simplify.DouglasPeuckerSimplifier.prototype.setEnsureValid=function(t){this.isEnsureValidTopology=t},jsts.simplify.DouglasPeuckerSimplifier.prototype.getResultGeometry=function(){return this.inputGeom.isEmpty()?this.inputGeom.clone():new jsts.simplify.DPTransformer(this.distanceTolerance,this.isEnsureValidTopology).transform(this.inputGeom)},function(){jsts.operation.predicate.RectangleContains=function(t){this.rectEnv=t.getEnvelopeInternal()},jsts.operation.predicate.RectangleContains.contains=function(t,e){var o=new jsts.operation.predicate.RectangleContains(t);return o.contains(e)},jsts.operation.predicate.RectangleContains.prototype.rectEnv=null,jsts.operation.predicate.RectangleContains.prototype.contains=function(t){return this.rectEnv.contains(t.getEnvelopeInternal())?this.isContainedInBoundary(t)?!1:!0:!1},jsts.operation.predicate.RectangleContains.prototype.isContainedInBoundary=function(t){if(t instanceof jsts.geom.Polygon)return!1;if(t instanceof jsts.geom.Point)return this.isPointContainedInBoundary(t.getCoordinate());if(t instanceof jsts.geom.LineString)return this.isLineStringContainedInBoundary(t);for(var e=0;e<t.getNumGeometries();e++){var o=t.getGeometryN(e);if(!this.isContainedInBoundary(o))return!1}return!0},jsts.operation.predicate.RectangleContains.prototype.isPointContainedInBoundary=function(t){return t.x==this.rectEnv.getMinX()||t.x==this.rectEnv.getMaxX()||t.y==this.rectEnv.getMinY()||t.y==this.rectEnv.getMaxY()},jsts.operation.predicate.RectangleContains.prototype.isLineStringContainedInBoundary=function(t){for(var e=t.getCoordinateSequence(),o=0;o<e.length-1;o++){var n=e[o],r=e[o+1];if(!this.isLineSegmentContainedInBoundary(n,r))return!1}return!0},jsts.operation.predicate.RectangleContains.prototype.isLineSegmentContainedInBoundary=function(t,e){if(t.equals(e))return this.isPointContainedInBoundary(t);if(t.x==e.x){if(t.x==this.rectEnv.getMinX()||t.x==this.rectEnv.getMaxX())return!0}else if(t.y==e.y&&(t.y==this.rectEnv.getMinY()||t.y==this.rectEnv.getMaxY()))return!0;return!1}}(),function(){var t=jsts.geom.Location,e=jsts.geomgraph.Position;jsts.geomgraph.Depth=function(){this.depth=[[],[]];for(var t=0;2>t;t++)for(var e=0;3>e;e++)this.depth[t][e]=jsts.geomgraph.Depth.NULL_VALUE},jsts.geomgraph.Depth.NULL_VALUE=-1,jsts.geomgraph.Depth.depthAtLocation=function(e){return e===t.EXTERIOR?0:e===t.INTERIOR?1:jsts.geomgraph.Depth.NULL_VALUE},jsts.geomgraph.Depth.prototype.depth=null,jsts.geomgraph.Depth.prototype.getDepth=function(t,e){return this.depth[t][e]},jsts.geomgraph.Depth.prototype.setDepth=function(t,e,o){this.depth[t][e]=o},jsts.geomgraph.Depth.prototype.getLocation=function(e,o){return this.depth[e][o]<=0?t.EXTERIOR:t.INTERIOR},jsts.geomgraph.Depth.prototype.add=function(e,o,n){n===t.INTERIOR&&this.depth[e][o]++},jsts.geomgraph.Depth.prototype.isNull=function(){if(arguments.length>0)return this.isNull2.apply(this,arguments);for(var t=0;2>t;t++)for(var e=0;3>e;e++)if(this.depth[t][e]!==jsts.geomgraph.Depth.NULL_VALUE)return!1;return!0},jsts.geomgraph.Depth.prototype.isNull2=function(t){return arguments.length>1?this.isNull3.apply(this,arguments):this.depth[t][1]==jsts.geomgraph.Depth.NULL_VALUE},jsts.geomgraph.Depth.prototype.isNull3=function(t,e){return this.depth[t][e]==jsts.geomgraph.Depth.NULL_VALUE},jsts.geomgraph.Depth.prototype.add=function(e){for(var o=0;2>o;o++)for(var n=1;3>n;n++){var r=e.getLocation(o,n);(r===t.EXTERIOR||r===t.INTERIOR)&&(this.isNull(o,n)?this.depth[o][n]=jsts.geomgraph.Depth.depthAtLocation(r):this.depth[o][n]+=jsts.geomgraph.Depth.depthAtLocation(r))}},jsts.geomgraph.Depth.prototype.getDelta=function(t){return this.depth[t][e.RIGHT]-this.depth[t][e.LEFT]},jsts.geomgraph.Depth.prototype.normalize=function(){for(var t=0;2>t;t++)if(!this.isNull(t)){var e=this.depth[t][1];this.depth[t][2]<e&&(e=this.depth[t][2]),0>e&&(e=0);for(var o=1;3>o;o++){var n=0;this.depth[t][o]>e&&(n=1),this.depth[t][o]=n}}},jsts.geomgraph.Depth.prototype.toString=function(){return"A: "+this.depth[0][1]+","+this.depth[0][2]+" B: "+this.depth[1][1]+","+this.depth[1][2]}}(),jsts.algorithm.BoundaryNodeRule=function(){},jsts.algorithm.BoundaryNodeRule.prototype.isInBoundary=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.algorithm.Mod2BoundaryNodeRule=function(){},jsts.algorithm.Mod2BoundaryNodeRule.prototype=new jsts.algorithm.BoundaryNodeRule,jsts.algorithm.Mod2BoundaryNodeRule.prototype.isInBoundary=function(t){return t%2===1},jsts.algorithm.BoundaryNodeRule.MOD2_BOUNDARY_RULE=new jsts.algorithm.Mod2BoundaryNodeRule,jsts.algorithm.BoundaryNodeRule.OGC_SFS_BOUNDARY_RULE=jsts.algorithm.BoundaryNodeRule.MOD2_BOUNDARY_RULE,jsts.operation.distance.GeometryLocation=function(t,e,o){this.component=t,this.segIndex=e,this.pt=o},jsts.operation.distance.GeometryLocation.INSIDE_AREA=-1,jsts.operation.distance.GeometryLocation.prototype.component=null,jsts.operation.distance.GeometryLocation.prototype.segIndex=null,jsts.operation.distance.GeometryLocation.prototype.pt=null,jsts.operation.distance.GeometryLocation.prototype.getGeometryComponent=function(){return this.component},jsts.operation.distance.GeometryLocation.prototype.getSegmentIndex=function(){return this.segIndex},jsts.operation.distance.GeometryLocation.prototype.getCoordinate=function(){return this.pt},jsts.operation.distance.GeometryLocation.prototype.isInsideArea=function(){return this.segIndex===jsts.operation.distance.GeometryLocation.INSIDE_AREA},jsts.geom.util.PointExtracter=function(t){this.pts=t},jsts.geom.util.PointExtracter.prototype=new jsts.geom.GeometryFilter,jsts.geom.util.PointExtracter.prototype.pts=null,jsts.geom.util.PointExtracter.getPoints=function(t,e){return void 0===e&&(e=[]),t instanceof jsts.geom.Point?e.push(t):(t instanceof jsts.geom.GeometryCollection||t instanceof jsts.geom.MultiPoint||t instanceof jsts.geom.MultiLineString||t instanceof jsts.geom.MultiPolygon)&&t.apply(new jsts.geom.util.PointExtracter(e)),e},jsts.geom.util.PointExtracter.prototype.filter=function(t){t instanceof jsts.geom.Point&&this.pts.push(t)},function(){var t=jsts.geom.Location;jsts.operation.relate.RelateNodeGraph=function(){this.nodes=new jsts.geomgraph.NodeMap(new jsts.operation.relate.RelateNodeFactory)},jsts.operation.relate.RelateNodeGraph.prototype.nodes=null,jsts.operation.relate.RelateNodeGraph.prototype.build=function(t){this.computeIntersectionNodes(t,0),this.copyNodesAndLabels(t,0);var e=new jsts.operation.relate.EdgeEndBuilder,o=e.computeEdgeEnds(t.getEdgeIterator());this.insertEdgeEnds(o)},jsts.operation.relate.RelateNodeGraph.prototype.computeIntersectionNodes=function(e,o){for(var n=e.getEdgeIterator();n.hasNext();)for(var r=n.next(),i=r.getLabel().getLocation(o),s=r.getEdgeIntersectionList().iterator();s.hasNext();){var a=s.next(),u=this.nodes.addNode(a.coord);i===t.BOUNDARY?u.setLabelBoundary(o):u.getLabel().isNull(o)&&u.setLabel(o,t.INTERIOR)}},jsts.operation.relate.RelateNodeGraph.prototype.copyNodesAndLabels=function(t,e){for(var o=t.getNodeIterator();o.hasNext();){var n=o.next(),r=this.nodes.addNode(n.getCoordinate());r.setLabel(e,n.getLabel().getLocation(e))}},jsts.operation.relate.RelateNodeGraph.prototype.insertEdgeEnds=function(t){for(var e=t.iterator();e.hasNext();){var o=e.next();this.nodes.add(o)}},jsts.operation.relate.RelateNodeGraph.prototype.getNodeIterator=function(){return this.nodes.iterator()}}(),jsts.geomgraph.index.SimpleSweepLineIntersector=function(){},jsts.geomgraph.index.SimpleSweepLineIntersector.prototype=new jsts.geomgraph.index.EdgeSetIntersector,jsts.geomgraph.index.SimpleSweepLineIntersector.prototype.events=[],jsts.geomgraph.index.SimpleSweepLineIntersector.prototype.nOverlaps=null,jsts.geomgraph.index.SimpleSweepLineIntersector.prototype.computeIntersections=function(t,e,o){return e instanceof javascript.util.List?void this.computeIntersections2.apply(this,arguments):(o?this.add(t,null):this.add(t),void this.computeIntersections3(e))},jsts.geomgraph.index.SimpleSweepLineIntersector.prototype.computeIntersections2=function(t,e,o){this.add(t,t),this.add(e,e),this.computeIntersections3(o)},jsts.geomgraph.index.SimpleSweepLineIntersector.prototype.add=function(t,e){if(t instanceof javascript.util.List)return void this.add2.apply(this,arguments);for(var o=t.getCoordinates(),n=0;n<o.length-1;n++){var r=new jsts.geomgraph.index.SweepLineSegment(t,n),i=new jsts.geomgraph.index.SweepLineEvent(r.getMinX(),r,e);this.events.push(i),this.events.push(new jsts.geomgraph.index.SweepLineEvent(r.getMaxX(),i))}},jsts.geomgraph.index.SimpleSweepLineIntersector.prototype.add2=function(t,e){for(var o=t.iterator();o.hasNext();){var n=o.next();e?this.add(n,e):this.add(n,n)}},jsts.geomgraph.index.SimpleSweepLineIntersector.prototype.prepareEvents=function(){this.events.sort(function(t,e){return t.compareTo(e)});for(var t=0;t<this.events.length;t++){var e=this.events[t];e.isDelete()&&e.getInsertEvent().setDeleteEventIndex(t)}},jsts.geomgraph.index.SimpleSweepLineIntersector.prototype.computeIntersections3=function(t){this.nOverlaps=0,this.prepareEvents();for(var e=0;e<this.events.length;e++){var o=this.events[e];o.isInsert()&&this.processOverlaps(e,o.getDeleteEventIndex(),o,t)}},jsts.geomgraph.index.SimpleSweepLineIntersector.prototype.processOverlaps=function(t,e,o,n){for(var r=o.getObject(),i=t;e>i;i++){var s=this.events[i];if(s.isInsert()){var a=s.getObject();o.isSameLabel(s)||(r.computeIntersections(a,n),this.nOverlaps++)}}},jsts.triangulate.VoronoiDiagramBuilder=function(){this.siteCoords=null,this.tolerance=0,this.subdiv=null,this.clipEnv=null,this.diagramEnv=null},jsts.triangulate.VoronoiDiagramBuilder.prototype.setSites=function(){var t=arguments[0];t instanceof jsts.geom.Geometry||t instanceof jsts.geom.Coordinate||t instanceof jsts.geom.Point||t instanceof jsts.geom.MultiPoint||t instanceof jsts.geom.LineString||t instanceof jsts.geom.MultiLineString||t instanceof jsts.geom.LinearRing||t instanceof jsts.geom.Polygon||t instanceof jsts.geom.MultiPolygon?this.setSitesByGeometry(t):this.setSitesByArray(t)
},jsts.triangulate.VoronoiDiagramBuilder.prototype.setSitesByGeometry=function(t){this.siteCoords=jsts.triangulate.DelaunayTriangulationBuilder.extractUniqueCoordinates(t)},jsts.triangulate.VoronoiDiagramBuilder.prototype.setSitesByArray=function(t){this.siteCoords=jsts.triangulate.DelaunayTriangulationBuilder.unique(t)},jsts.triangulate.VoronoiDiagramBuilder.prototype.setClipEnvelope=function(t){this.clipEnv=t},jsts.triangulate.VoronoiDiagramBuilder.prototype.setTolerance=function(t){this.tolerance=t},jsts.triangulate.VoronoiDiagramBuilder.prototype.create=function(){if(null===this.subdiv){var t,e,o,n;t=jsts.triangulate.DelaunayTriangulationBuilder.envelope(this.siteCoords),this.diagramEnv=t,e=Math.max(this.diagramEnv.getWidth(),this.diagramEnv.getHeight()),this.diagramEnv.expandBy(e),null!==this.clipEnv&&this.diagramEnv.expandToInclude(this.clipEnv),o=jsts.triangulate.DelaunayTriangulationBuilder.toVertices(this.siteCoords),this.subdiv=new jsts.triangulate.quadedge.QuadEdgeSubdivision(t,this.tolerance),n=new jsts.triangulate.IncrementalDelaunayTriangulator(this.subdiv),n.insertSites(o)}},jsts.triangulate.VoronoiDiagramBuilder.prototype.getSubdivision=function(){return this.create(),this.subdiv},jsts.triangulate.VoronoiDiagramBuilder.prototype.getDiagram=function(t){this.create();var e=this.subdiv.getVoronoiDiagram(t);return this.clipGeometryCollection(e,this.diagramEnv)},jsts.triangulate.VoronoiDiagramBuilder.prototype.clipGeometryCollection=function(t,e){var o,n,r,i,s,a;for(o=t.getFactory().toGeometry(e),n=[],r=0,i=t.getNumGeometries(),r;i>r;r++)s=t.getGeometryN(r),a=null,e.contains(s.getEnvelopeInternal())?a=s:e.intersects(s.getEnvelopeInternal())&&(a=o.intersection(s)),null===a||a.isEmpty()||n.push(a);return t.getFactory().createGeometryCollection(n)},jsts.operation.valid.IndexedNestedRingTester=function(t){this.graph=t,this.rings=new javascript.util.ArrayList,this.totalEnv=new jsts.geom.Envelope,this.index=null,this.nestedPt=null},jsts.operation.valid.IndexedNestedRingTester.prototype.getNestedPoint=function(){return this.nestedPt},jsts.operation.valid.IndexedNestedRingTester.prototype.add=function(t){this.rings.add(t),this.totalEnv.expandToInclude(t.getEnvelopeInternal())},jsts.operation.valid.IndexedNestedRingTester.prototype.isNonNested=function(){this.buildIndex();for(var t=0;t<this.rings.size();t++)for(var e=this.rings.get(t),o=e.getCoordinates(),n=this.index.query(e.getEnvelopeInternal()),r=0;r<n.length;r++){var i=n[r],s=i.getCoordinates();if(e!=i&&e.getEnvelopeInternal().intersects(i.getEnvelopeInternal())){var a=jsts.operation.valid.IsValidOp.findPtNotNode(o,i,this.graph);if(null!=a){var u=jsts.algorithm.CGAlgorithms.isPointInRing(a,s);if(u)return this.nestedPt=a,!1}}}return!0},jsts.operation.valid.IndexedNestedRingTester.prototype.buildIndex=function(){this.index=new jsts.index.strtree.STRtree;for(var t=0;t<this.rings.size();t++){var e=this.rings.get(t),o=e.getEnvelopeInternal();this.index.insert(o,e)}},jsts.geomgraph.index.MonotoneChain=function(t,e){this.mce=t,this.chainIndex=e},jsts.geomgraph.index.MonotoneChain.prototype.mce=null,jsts.geomgraph.index.MonotoneChain.prototype.chainIndex=null,jsts.geomgraph.index.MonotoneChain.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},jsts.noding.SegmentNode=function(t,e,o,n){this.segString=t,this.coord=new jsts.geom.Coordinate(e),this.segmentIndex=o,this.segmentOctant=n,this._isInterior=!e.equals2D(t.getCoordinate(o))},jsts.noding.SegmentNode.prototype.segString=null,jsts.noding.SegmentNode.prototype.coord=null,jsts.noding.SegmentNode.prototype.segmentIndex=null,jsts.noding.SegmentNode.prototype.segmentOctant=null,jsts.noding.SegmentNode.prototype._isInterior=null,jsts.noding.SegmentNode.prototype.getCoordinate=function(){return this.coord},jsts.noding.SegmentNode.prototype.isInterior=function(){return this._isInterior},jsts.noding.SegmentNode.prototype.isEndPoint=function(){return 0!==this.segmentIndex||this._isInterior?this.segmentIndex===this.maxSegmentIndex?!0:!1:!0},jsts.noding.SegmentNode.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:jsts.noding.SegmentPointComparator.compare(this.segmentOctant,this.coord,e.coord)},function(){jsts.io.GeoJSONWriter=function(){this.parser=new jsts.io.GeoJSONParser(this.geometryFactory)},jsts.io.GeoJSONWriter.prototype.write=function(t){var e=this.parser.write(t);return e}}(),jsts.io.OpenLayersParser=function(t){this.geometryFactory=t||new jsts.geom.GeometryFactory},jsts.io.OpenLayersParser.prototype.read=function(t){return"OpenLayers.Geometry.Point"===t.CLASS_NAME?this.convertFromPoint(t):"OpenLayers.Geometry.LineString"===t.CLASS_NAME?this.convertFromLineString(t):"OpenLayers.Geometry.LinearRing"===t.CLASS_NAME?this.convertFromLinearRing(t):"OpenLayers.Geometry.Polygon"===t.CLASS_NAME?this.convertFromPolygon(t):"OpenLayers.Geometry.MultiPoint"===t.CLASS_NAME?this.convertFromMultiPoint(t):"OpenLayers.Geometry.MultiLineString"===t.CLASS_NAME?this.convertFromMultiLineString(t):"OpenLayers.Geometry.MultiPolygon"===t.CLASS_NAME?this.convertFromMultiPolygon(t):"OpenLayers.Geometry.Collection"===t.CLASS_NAME?this.convertFromCollection(t):void 0},jsts.io.OpenLayersParser.prototype.convertFromPoint=function(t){return this.geometryFactory.createPoint(new jsts.geom.Coordinate(t.x,t.y))},jsts.io.OpenLayersParser.prototype.convertFromLineString=function(t){var e,o=[];for(e=0;e<t.components.length;e++)o.push(new jsts.geom.Coordinate(t.components[e].x,t.components[e].y));return this.geometryFactory.createLineString(o)},jsts.io.OpenLayersParser.prototype.convertFromLinearRing=function(t){var e,o=[];for(e=0;e<t.components.length;e++)o.push(new jsts.geom.Coordinate(t.components[e].x,t.components[e].y));return this.geometryFactory.createLinearRing(o)},jsts.io.OpenLayersParser.prototype.convertFromPolygon=function(t){var e,o=null,n=[];for(e=0;e<t.components.length;e++){var r=this.convertFromLinearRing(t.components[e]);0===e?o=r:n.push(r)}return this.geometryFactory.createPolygon(o,n)},jsts.io.OpenLayersParser.prototype.convertFromMultiPoint=function(t){var e,o=[];for(e=0;e<t.components.length;e++)o.push(this.convertFromPoint(t.components[e]));return this.geometryFactory.createMultiPoint(o)},jsts.io.OpenLayersParser.prototype.convertFromMultiLineString=function(t){var e,o=[];for(e=0;e<t.components.length;e++)o.push(this.convertFromLineString(t.components[e]));return this.geometryFactory.createMultiLineString(o)},jsts.io.OpenLayersParser.prototype.convertFromMultiPolygon=function(t){var e,o=[];for(e=0;e<t.components.length;e++)o.push(this.convertFromPolygon(t.components[e]));return this.geometryFactory.createMultiPolygon(o)},jsts.io.OpenLayersParser.prototype.convertFromCollection=function(t){var e,o=[];for(e=0;e<t.components.length;e++)o.push(this.read(t.components[e]));return this.geometryFactory.createGeometryCollection(o)},jsts.io.OpenLayersParser.prototype.write=function(t){return"jsts.geom.Point"===t.CLASS_NAME?this.convertToPoint(t.coordinate):"jsts.geom.LineString"===t.CLASS_NAME?this.convertToLineString(t):"jsts.geom.LinearRing"===t.CLASS_NAME?this.convertToLinearRing(t):"jsts.geom.Polygon"===t.CLASS_NAME?this.convertToPolygon(t):"jsts.geom.MultiPoint"===t.CLASS_NAME?this.convertToMultiPoint(t):"jsts.geom.MultiLineString"===t.CLASS_NAME?this.convertToMultiLineString(t):"jsts.geom.MultiPolygon"===t.CLASS_NAME?this.convertToMultiPolygon(t):"jsts.geom.GeometryCollection"===t.CLASS_NAME?this.convertToCollection(t):void 0},jsts.io.OpenLayersParser.prototype.convertToPoint=function(t){return new OpenLayers.Geometry.Point(t.x,t.y)},jsts.io.OpenLayersParser.prototype.convertToLineString=function(t){var e,o=[];for(e=0;e<t.points.length;e++){var n=t.points[e];o.push(this.convertToPoint(n))}return new OpenLayers.Geometry.LineString(o)},jsts.io.OpenLayersParser.prototype.convertToLinearRing=function(t){var e,o=[];for(e=0;e<t.points.length;e++){var n=t.points[e];o.push(this.convertToPoint(n))}return new OpenLayers.Geometry.LinearRing(o)},jsts.io.OpenLayersParser.prototype.convertToPolygon=function(t){var e,o=[];for(o.push(this.convertToLinearRing(t.shell)),e=0;e<t.holes.length;e++){var n=t.holes[e];o.push(this.convertToLinearRing(n))}return new OpenLayers.Geometry.Polygon(o)},jsts.io.OpenLayersParser.prototype.convertToMultiPoint=function(t){var e,o=[];for(e=0;e<t.geometries.length;e++){var n=t.geometries[e].coordinate;o.push(new OpenLayers.Geometry.Point(n.x,n.y))}return new OpenLayers.Geometry.MultiPoint(o)},jsts.io.OpenLayersParser.prototype.convertToMultiLineString=function(t){var e,o=[];for(e=0;e<t.geometries.length;e++)o.push(this.convertToLineString(t.geometries[e]));return new OpenLayers.Geometry.MultiLineString(o)},jsts.io.OpenLayersParser.prototype.convertToMultiPolygon=function(t){var e,o=[];for(e=0;e<t.geometries.length;e++)o.push(this.convertToPolygon(t.geometries[e]));return new OpenLayers.Geometry.MultiPolygon(o)},jsts.io.OpenLayersParser.prototype.convertToCollection=function(t){var e,o=[];for(e=0;e<t.geometries.length;e++){var n=t.geometries[e],r=this.write(n);o.push(r)}return new OpenLayers.Geometry.Collection(o)},jsts.index.quadtree.Quadtree=function(){this.root=new jsts.index.quadtree.Root,this.minExtent=1},jsts.index.quadtree.Quadtree.ensureExtent=function(t,e){var o,n,r,i;return o=t.getMinX(),n=t.getMaxX(),r=t.getMinY(),i=t.getMaxY(),o!==n&&r!==i?t:(o===n&&(o-=e/2,n=o+e/2),r===i&&(r-=e/2,i=r+e/2),new jsts.geom.Envelope(o,n,r,i))},jsts.index.quadtree.Quadtree.prototype.depth=function(){return this.root.depth()},jsts.index.quadtree.Quadtree.prototype.size=function(){return this.root.size()},jsts.index.quadtree.Quadtree.prototype.insert=function(t,e){this.collectStats(t);var o=jsts.index.quadtree.Quadtree.ensureExtent(t,this.minExtent);this.root.insert(o,e)},jsts.index.quadtree.Quadtree.prototype.remove=function(t,e){var o=jsts.index.quadtree.Quadtree.ensureExtent(t,this.minExtent);return this.root.remove(o,e)},jsts.index.quadtree.Quadtree.prototype.query=function(){return 1===arguments.length?jsts.index.quadtree.Quadtree.prototype.queryByEnvelope.apply(this,arguments):void jsts.index.quadtree.Quadtree.prototype.queryWithVisitor.apply(this,arguments)},jsts.index.quadtree.Quadtree.prototype.queryByEnvelope=function(t){var e=new jsts.index.ArrayListVisitor;return this.query(t,e),e.getItems()},jsts.index.quadtree.Quadtree.prototype.queryWithVisitor=function(t,e){this.root.visit(t,e)},jsts.index.quadtree.Quadtree.prototype.queryAll=function(){var t=[];return t=this.root.addAllItems(t)},jsts.index.quadtree.Quadtree.prototype.collectStats=function(t){var e=t.getWidth();e<this.minExtent&&e>0&&(this.minExtent=e);var o=t.getHeight();o<this.minExtent&&o>0&&(this.minExtent=o)},jsts.operation.relate.RelateNodeFactory=function(){},jsts.operation.relate.RelateNodeFactory.prototype=new jsts.geomgraph.NodeFactory,jsts.operation.relate.RelateNodeFactory.prototype.createNode=function(t){return new jsts.operation.relate.RelateNode(t,new jsts.operation.relate.EdgeEndBundleStar)},jsts.index.quadtree.Key=function(t){this.pt=new jsts.geom.Coordinate,this.level=0,this.env=null,this.computeKey(t)},jsts.index.quadtree.Key.computeQuadLevel=function(t){var e,o,n,r;return e=t.getWidth(),o=t.getHeight(),n=e>o?e:o,r=jsts.index.DoubleBits.exponent(n)+1},jsts.index.quadtree.Key.prototype.getPoint=function(){return this.pt},jsts.index.quadtree.Key.prototype.getLevel=function(){return this.level},jsts.index.quadtree.Key.prototype.getEnvelope=function(){return this.env},jsts.index.quadtree.Key.prototype.getCentre=function(){var t,e;return t=(this.env.getMinX()+this.env.getMaxX())/2,e=(this.env.getMinY()+this.env.getMaxY())/2,new jsts.geom.Coordinate(t,e)},jsts.index.quadtree.Key.prototype.computeKey=function(){arguments[0]instanceof jsts.geom.Envelope?this.computeKeyFromEnvelope(arguments[0]):this.computeKeyFromLevel(arguments[0],arguments[1])},jsts.index.quadtree.Key.prototype.computeKeyFromEnvelope=function(t){for(this.level=jsts.index.quadtree.Key.computeQuadLevel(t),this.env=new jsts.geom.Envelope,this.computeKey(this.level,t);!this.env.contains(t);)this.level+=1,this.computeKey(this.level,t)},jsts.index.quadtree.Key.prototype.computeKeyFromLevel=function(t,e){var o=jsts.index.DoubleBits.powerOf2(t);this.pt.x=Math.floor(e.getMinX()/o)*o,this.pt.y=Math.floor(e.getMinY()/o)*o,this.env.init(this.pt.x,this.pt.x+o,this.pt.y,this.pt.y+o)},jsts.geom.CoordinateArrays=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.geom.CoordinateArrays.copyDeep=function(){return 1===arguments.length?jsts.geom.CoordinateArrays.copyDeep1(arguments[0]):void(5===arguments.length&&jsts.geom.CoordinateArrays.copyDeep2(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4]))},jsts.geom.CoordinateArrays.copyDeep1=function(t){for(var e=[],o=0;o<t.length;o++)e[o]=new jsts.geom.Coordinate(t[o]);return e},jsts.geom.CoordinateArrays.copyDeep2=function(t,e,o,n,r){for(var i=0;r>i;i++)o[n+i]=new jsts.geom.Coordinate(t[e+i])},jsts.geom.CoordinateArrays.removeRepeatedPoints=function(t){var e;return this.hasRepeatedPoints(t)?(e=new jsts.geom.CoordinateList(t,!1),e.toCoordinateArray()):t},jsts.geom.CoordinateArrays.hasRepeatedPoints=function(t){var e;for(e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},jsts.geom.CoordinateArrays.ptNotInList=function(t,e){for(var o=0;o<t.length;o++){var n=t[o];if(jsts.geom.CoordinateArrays.indexOf(n,e)<0)return n}return null},jsts.geom.CoordinateArrays.increasingDirection=function(t){for(var e=0;e<parseInt(t.length/2);e++){var o=t.length-1-e,n=t[e].compareTo(t[o]);if(0!=n)return n}return 1},jsts.geom.CoordinateArrays.minCoordinate=function(t){for(var e=null,o=0;o<t.length;o++)(null===e||e.compareTo(t[o])>0)&&(e=t[o]);return e},jsts.geom.CoordinateArrays.scroll=function(t,e){var o=jsts.geom.CoordinateArrays.indexOf(e,t);if(!(0>o)){var n=t.slice(o).concat(t.slice(0,o));for(o=0;o<n.length;o++)t[o]=n[o]}},jsts.geom.CoordinateArrays.indexOf=function(t,e){for(var o=0;o<e.length;o++)if(t.equals(e[o]))return o;return-1},jsts.operation.overlay.MinimalEdgeRing=function(t,e){jsts.geomgraph.EdgeRing.call(this,t,e)},jsts.operation.overlay.MinimalEdgeRing.prototype=new jsts.geomgraph.EdgeRing,jsts.operation.overlay.MinimalEdgeRing.constructor=jsts.operation.overlay.MinimalEdgeRing,jsts.operation.overlay.MinimalEdgeRing.prototype.getNext=function(t){return t.getNextMin()},jsts.operation.overlay.MinimalEdgeRing.prototype.setEdgeRing=function(t,e){t.setMinEdgeRing(e)},jsts.triangulate.DelaunayTriangulationBuilder=function(){this.siteCoords=null,this.tolerance=0,this.subdiv=null},jsts.triangulate.DelaunayTriangulationBuilder.extractUniqueCoordinates=function(t){if(void 0===t||null===t)return new jsts.geom.CoordinateList([],!1).toArray();var e=t.getCoordinates();return jsts.triangulate.DelaunayTriangulationBuilder.unique(e)},jsts.triangulate.DelaunayTriangulationBuilder.unique=function(t){t.sort(function(t,e){return t.compareTo(e)});var e=new jsts.geom.CoordinateList(t,!1);return e.toArray()},jsts.triangulate.DelaunayTriangulationBuilder.toVertices=function(t){var e,o=new Array(t.length),n=0,r=t.length;for(n;r>n;n++)e=t[n],o[n]=new jsts.triangulate.quadedge.Vertex(e);return o},jsts.triangulate.DelaunayTriangulationBuilder.envelope=function(t){var e=new jsts.geom.Envelope,o=0,n=t.length;for(o;n>o;o++)e.expandToInclude(t[o]);return e},jsts.triangulate.DelaunayTriangulationBuilder.prototype.setSites=function(){var t=arguments[0];t instanceof jsts.geom.Geometry||t instanceof jsts.geom.Coordinate||t instanceof jsts.geom.Point||t instanceof jsts.geom.MultiPoint||t instanceof jsts.geom.LineString||t instanceof jsts.geom.MultiLineString||t instanceof jsts.geom.LinearRing||t instanceof jsts.geom.Polygon||t instanceof jsts.geom.MultiPolygon?this.setSitesFromGeometry(t):this.setSitesFromCollection(t)},jsts.triangulate.DelaunayTriangulationBuilder.prototype.setSitesFromGeometry=function(t){this.siteCoords=jsts.triangulate.DelaunayTriangulationBuilder.extractUniqueCoordinates(t)},jsts.triangulate.DelaunayTriangulationBuilder.prototype.setSitesFromCollection=function(t){this.siteCoords=jsts.triangulate.DelaunayTriangulationBuilder.unique(t)},jsts.triangulate.DelaunayTriangulationBuilder.prototype.setTolerance=function(t){this.tolerance=t},jsts.triangulate.DelaunayTriangulationBuilder.prototype.create=function(){if(null===this.subdiv){var t,e,o;t=jsts.triangulate.DelaunayTriangulationBuilder.envelope(this.siteCoords),e=jsts.triangulate.DelaunayTriangulationBuilder.toVertices(this.siteCoords),this.subdiv=new jsts.triangulate.quadedge.QuadEdgeSubdivision(t,this.tolerance),o=new jsts.triangulate.IncrementalDelaunayTriangulator(this.subdiv),o.insertSites(e)}},jsts.triangulate.DelaunayTriangulationBuilder.prototype.getSubdivision=function(){return this.create(),this.subdiv},jsts.triangulate.DelaunayTriangulationBuilder.prototype.getEdges=function(t){return this.create(),this.subdiv.getEdges(t)},jsts.triangulate.DelaunayTriangulationBuilder.prototype.getTriangles=function(t){return this.create(),this.subdiv.getTriangles(t)},jsts.algorithm.RayCrossingCounter=function(t){this.p=t},jsts.algorithm.RayCrossingCounter.locatePointInRing=function(t,e){for(var o=new jsts.algorithm.RayCrossingCounter(t),n=1;n<e.length;n++){var r=e[n],i=e[n-1];if(o.countSegment(r,i),o.isOnSegment())return o.getLocation()}return o.getLocation()},jsts.algorithm.RayCrossingCounter.prototype.p=null,jsts.algorithm.RayCrossingCounter.prototype.crossingCount=0,jsts.algorithm.RayCrossingCounter.prototype.isPointOnSegment=!1,jsts.algorithm.RayCrossingCounter.prototype.countSegment=function(t,e){if(!(t.x<this.p.x&&e.x<this.p.x)){if(this.p.x==e.x&&this.p.y===e.y)return void(this.isPointOnSegment=!0);if(t.y===this.p.y&&e.y===this.p.y){var o=t.x,n=e.x;return o>n&&(o=e.x,n=t.x),void(this.p.x>=o&&this.p.x<=n&&(this.isPointOnSegment=!0))}if(t.y>this.p.y&&e.y<=this.p.y||e.y>this.p.y&&t.y<=this.p.y){var r=t.x-this.p.x,i=t.y-this.p.y,s=e.x-this.p.x,a=e.y-this.p.y,u=jsts.algorithm.RobustDeterminant.signOfDet2x2(r,i,s,a);if(0===u)return void(this.isPointOnSegment=!0);i>a&&(u=-u),u>0&&this.crossingCount++}}},jsts.algorithm.RayCrossingCounter.prototype.isOnSegment=function(){return jsts.geom.isPointOnSegment},jsts.algorithm.RayCrossingCounter.prototype.getLocation=function(){return this.isPointOnSegment?jsts.geom.Location.BOUNDARY:this.crossingCount%2===1?jsts.geom.Location.INTERIOR:jsts.geom.Location.EXTERIOR},jsts.algorithm.RayCrossingCounter.prototype.isPointInPolygon=function(){return this.getLocation()!==jsts.geom.Location.EXTERIOR},jsts.operation.BoundaryOp=function(t,e){this.geom=t,this.geomFact=t.getFactory(),this.bnRule=e||jsts.algorithm.BoundaryNodeRule.MOD2_BOUNDARY_RULE},jsts.operation.BoundaryOp.prototype.geom=null,jsts.operation.BoundaryOp.prototype.geomFact=null,jsts.operation.BoundaryOp.prototype.bnRule=null,jsts.operation.BoundaryOp.prototype.getBoundary=function(){return this.geom instanceof jsts.geom.LineString?this.boundaryLineString(this.geom):this.geom instanceof jsts.geom.MultiLineString?this.boundaryMultiLineString(this.geom):this.geom.getBoundary()},jsts.operation.BoundaryOp.prototype.getEmptyMultiPoint=function(){return this.geomFact.createMultiPoint(null)},jsts.operation.BoundaryOp.prototype.boundaryMultiLineString=function(t){if(this.geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return 1==e.length?this.geomFact.createPoint(e[0]):this.geomFact.createMultiPoint(e)},jsts.operation.BoundaryOp.prototype.endpoints=null,jsts.operation.BoundaryOp.prototype.computeBoundaryCoordinates=function(t){var e,o,n,r=[];for(this.endpoints=[],e=0;e<t.getNumGeometries();e++)o=t.getGeometryN(e),0!=o.getNumPoints()&&(this.addEndpoint(o.getCoordinateN(0)),this.addEndpoint(o.getCoordinateN(o.getNumPoints()-1)));for(e=0;e<this.endpoints.length;e++)n=this.endpoints[e],this.bnRule.isInBoundary(n.count)&&r.push(n.coordinate);return r},jsts.operation.BoundaryOp.prototype.addEndpoint=function(t){var e,o,n=!1;for(e=0;e<this.endpoints.length;e++)if(o=this.endpoints[e],o.coordinate.equals(t)){n=!0;break}n||(o={},o.coordinate=t,o.count=0,this.endpoints.push(o)),o.count++},jsts.operation.BoundaryOp.prototype.boundaryLineString=function(t){if(this.geom.isEmpty())return this.getEmptyMultiPoint();if(t.isClosed()){var e=this.bnRule.isInBoundary(2);return e?t.getStartPoint():this.geomFact.createMultiPoint(null)}return this.geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},jsts.operation.buffer.OffsetCurveSetBuilder=function(t,e,o){this.inputGeom=t,this.distance=e,this.curveBuilder=o,this.curveList=new javascript.util.ArrayList},jsts.operation.buffer.OffsetCurveSetBuilder.prototype.inputGeom=null,jsts.operation.buffer.OffsetCurveSetBuilder.prototype.distance=null,jsts.operation.buffer.OffsetCurveSetBuilder.prototype.curveBuilder=null,jsts.operation.buffer.OffsetCurveSetBuilder.prototype.curveList=null,jsts.operation.buffer.OffsetCurveSetBuilder.prototype.getCurves=function(){return this.add(this.inputGeom),this.curveList},jsts.operation.buffer.OffsetCurveSetBuilder.prototype.addCurve=function(t,e,o){if(!(null==t||t.length<2)){var n=new jsts.noding.NodedSegmentString(t,new jsts.geomgraph.Label(0,jsts.geom.Location.BOUNDARY,e,o));this.curveList.add(n)}},jsts.operation.buffer.OffsetCurveSetBuilder.prototype.add=function(t){if(!t.isEmpty())if(t instanceof jsts.geom.Polygon)this.addPolygon(t);else if(t instanceof jsts.geom.LineString)this.addLineString(t);else if(t instanceof jsts.geom.Point)this.addPoint(t);else if(t instanceof jsts.geom.MultiPoint)this.addCollection(t);else if(t instanceof jsts.geom.MultiLineString)this.addCollection(t);else if(t instanceof jsts.geom.MultiPolygon)this.addCollection(t);else{if(!(t instanceof jsts.geom.GeometryCollection))throw new jsts.error.IllegalArgumentError;this.addCollection(t)}},jsts.operation.buffer.OffsetCurveSetBuilder.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var o=t.getGeometryN(e);this.add(o)}},jsts.operation.buffer.OffsetCurveSetBuilder.prototype.addPoint=function(t){if(!(this.distance<=0)){var e=t.getCoordinates(),o=this.curveBuilder.getLineCurve(e,this.distance);this.addCurve(o,jsts.geom.Location.EXTERIOR,jsts.geom.Location.INTERIOR)}},jsts.operation.buffer.OffsetCurveSetBuilder.prototype.addLineString=function(t){if(!(this.distance<=0)||this.curveBuilder.getBufferParameters().isSingleSided()){var e=jsts.geom.CoordinateArrays.removeRepeatedPoints(t.getCoordinates()),o=this.curveBuilder.getLineCurve(e,this.distance);this.addCurve(o,jsts.geom.Location.EXTERIOR,jsts.geom.Location.INTERIOR)}},jsts.operation.buffer.OffsetCurveSetBuilder.prototype.addPolygon=function(t){var e=this.distance,o=jsts.geomgraph.Position.LEFT;this.distance<0&&(e=-this.distance,o=jsts.geomgraph.Position.RIGHT);var n=t.getExteriorRing(),r=jsts.geom.CoordinateArrays.removeRepeatedPoints(n.getCoordinates());if(!(this.distance<0&&this.isErodedCompletely(n,this.distance)||this.distance<=0&&r.length<3)){this.addPolygonRing(r,e,o,jsts.geom.Location.EXTERIOR,jsts.geom.Location.INTERIOR);for(var i=0;i<t.getNumInteriorRing();i++){var s=t.getInteriorRingN(i),a=jsts.geom.CoordinateArrays.removeRepeatedPoints(s.getCoordinates());this.distance>0&&this.isErodedCompletely(s,-this.distance)||this.addPolygonRing(a,e,jsts.geomgraph.Position.opposite(o),jsts.geom.Location.INTERIOR,jsts.geom.Location.EXTERIOR)}}},jsts.operation.buffer.OffsetCurveSetBuilder.prototype.addPolygonRing=function(t,e,o,n,r){if(!(0==e&&t.length<jsts.geom.LinearRing.MINIMUM_VALID_SIZE)){var i=n,s=r;t.length>=jsts.geom.LinearRing.MINIMUM_VALID_SIZE&&jsts.algorithm.CGAlgorithms.isCCW(t)&&(i=r,s=n,o=jsts.geomgraph.Position.opposite(o));var a=this.curveBuilder.getRingCurve(t,o,e);this.addCurve(a,i,s)}},jsts.operation.buffer.OffsetCurveSetBuilder.prototype.isErodedCompletely=function(t,e){var o=t.getCoordinates();if(o.length<4)return 0>e;if(4==o.length)return this.isTriangleErodedCompletely(o,e);var n=t.getEnvelopeInternal(),r=Math.min(n.getHeight(),n.getWidth());return 0>e&&2*Math.abs(e)>r?!0:!1},jsts.operation.buffer.OffsetCurveSetBuilder.prototype.isTriangleErodedCompletely=function(t,e){var o=new jsts.geom.Triangle(t[0],t[1],t[2]),n=o.inCentre(),r=jsts.algorithm.CGAlgorithms.distancePointLine(n,o.p0,o.p1);return r<Math.abs(e)},jsts.operation.buffer.BufferSubgraph=function(){this.dirEdgeList=new javascript.util.ArrayList,this.nodes=new javascript.util.ArrayList,this.finder=new jsts.operation.buffer.RightmostEdgeFinder},jsts.operation.buffer.BufferSubgraph.prototype.finder=null,jsts.operation.buffer.BufferSubgraph.prototype.dirEdgeList=null,jsts.operation.buffer.BufferSubgraph.prototype.nodes=null,jsts.operation.buffer.BufferSubgraph.prototype.rightMostCoord=null,jsts.operation.buffer.BufferSubgraph.prototype.env=null,jsts.operation.buffer.BufferSubgraph.prototype.getDirectedEdges=function(){return this.dirEdgeList},jsts.operation.buffer.BufferSubgraph.prototype.getNodes=function(){return this.nodes},jsts.operation.buffer.BufferSubgraph.prototype.getEnvelope=function(){if(null===this.env){for(var t=new jsts.geom.Envelope,e=this.dirEdgeList.iterator();e.hasNext();)for(var o=e.next(),n=o.getEdge().getCoordinates(),r=0;r<n.length-1;r++)t.expandToInclude(n[r]);this.env=t}return this.env},jsts.operation.buffer.BufferSubgraph.prototype.getRightmostCoordinate=function(){return this.rightMostCoord},jsts.operation.buffer.BufferSubgraph.prototype.create=function(t){this.addReachable(t),this.finder.findEdge(this.dirEdgeList),this.rightMostCoord=this.finder.getCoordinate()},jsts.operation.buffer.BufferSubgraph.prototype.addReachable=function(t){var e=[];for(e.push(t);0!==e.length;){var o=e.pop();this.add(o,e)}},jsts.operation.buffer.BufferSubgraph.prototype.add=function(t,e){t.setVisited(!0),this.nodes.add(t);for(var o=t.getEdges().iterator();o.hasNext();){var n=o.next();this.dirEdgeList.add(n);var r=n.getSym(),i=r.getNode();i.isVisited()||e.push(i)}},jsts.operation.buffer.BufferSubgraph.prototype.clearVisitedEdges=function(){for(var t=this.dirEdgeList.iterator();t.hasNext();){var e=t.next();e.setVisited(!1)}},jsts.operation.buffer.BufferSubgraph.prototype.computeDepth=function(t){this.clearVisitedEdges();{var e=this.finder.getEdge();e.getNode(),e.getLabel()}e.setEdgeDepths(jsts.geomgraph.Position.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},jsts.operation.buffer.BufferSubgraph.prototype.computeDepths=function(t){var e=[],o=[],n=t.getNode();for(o.push(n),e.push(n),t.setVisited(!0);0!==o.length;){var r=o.shift();e.push(r),this.computeNodeDepth(r);for(var i=r.getEdges().iterator();i.hasNext();){var s=i.next(),a=s.getSym();if(!a.isVisited()){var u=a.getNode();-1===e.indexOf(u)&&(o.push(u),e.push(u))}}}},jsts.operation.buffer.BufferSubgraph.prototype.computeNodeDepth=function(t){for(var e=null,o=t.getEdges().iterator();o.hasNext();){var n=o.next();if(n.isVisited()||n.getSym().isVisited()){e=n;break}}if(null==e)throw new jsts.error.TopologyError("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var o=t.getEdges().iterator();o.hasNext();){var n=o.next();n.setVisited(!0),this.copySymDepths(n)}},jsts.operation.buffer.BufferSubgraph.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(jsts.geomgraph.Position.LEFT,t.getDepth(jsts.geomgraph.Position.RIGHT)),e.setDepth(jsts.geomgraph.Position.RIGHT,t.getDepth(jsts.geomgraph.Position.LEFT))},jsts.operation.buffer.BufferSubgraph.prototype.findResultEdges=function(){for(var t=this.dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(jsts.geomgraph.Position.RIGHT)>=1&&e.getDepth(jsts.geomgraph.Position.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},jsts.operation.buffer.BufferSubgraph.prototype.compareTo=function(t){var e=t;return this.rightMostCoord.x<e.rightMostCoord.x?-1:this.rightMostCoord.x>e.rightMostCoord.x?1:0},jsts.simplify.DPTransformer=function(t,e){this.distanceTolerance=t,this.isEnsureValidTopology=e},jsts.simplify.DPTransformer.prototype=new jsts.geom.util.GeometryTransformer,jsts.simplify.DPTransformer.prototype.distanceTolerance=null,jsts.simplify.DPTransformer.prototype.isEnsureValidTopology=null,jsts.simplify.DPTransformer.prototype.transformCoordinates=function(t){var e=t,o=null;return o=0==e.length?[]:jsts.simplify.DouglasPeuckerLineSimplifier.simplify(e,this.distanceTolerance)},jsts.simplify.DPTransformer.prototype.transformPolygon=function(t,e){if(t.isEmpty())return null;var o=jsts.geom.util.GeometryTransformer.prototype.transformPolygon.apply(this,arguments);return e instanceof jsts.geom.MultiPolygon?o:this.createValidArea(o)},jsts.simplify.DPTransformer.prototype.transformLinearRing=function(t,e){var o=e instanceof jsts.geom.Polygon,n=jsts.geom.util.GeometryTransformer.prototype.transformLinearRing.apply(this,arguments);return!o||n instanceof jsts.geom.LinearRing?n:null},jsts.simplify.DPTransformer.prototype.transformMultiPolygon=function(){var t=jsts.geom.util.GeometryTransformer.prototype.transformMultiPolygon.apply(this,arguments);return this.createValidArea(t)},jsts.simplify.DPTransformer.prototype.createValidArea=function(t){return this.isEnsureValidTopology?t.buffer(0):t},jsts.geom.util.GeometryExtracter=function(t,e){this.clz=t,this.comps=e},jsts.geom.util.GeometryExtracter.prototype=new jsts.geom.GeometryFilter,jsts.geom.util.GeometryExtracter.prototype.clz=null,jsts.geom.util.GeometryExtracter.prototype.comps=null,jsts.geom.util.GeometryExtracter.extract=function(t,e,o){return o=o||new javascript.util.ArrayList,t instanceof e?o.add(t):(t instanceof jsts.geom.GeometryCollection||t instanceof jsts.geom.MultiPoint||t instanceof jsts.geom.MultiLineString||t instanceof jsts.geom.MultiPolygon)&&t.apply(new jsts.geom.util.GeometryExtracter(e,o)),o},jsts.geom.util.GeometryExtracter.prototype.filter=function(t){(null===this.clz||t instanceof this.clz)&&this.comps.add(t)},function(){var t=jsts.operation.overlay.OverlayOp,e=jsts.operation.overlay.snap.SnapOverlayOp,o=function(t,e){this.geom=[],this.geom[0]=t,this.geom[1]=e};o.overlayOp=function(t,e,n){var r=new o(t,e);return r.getResultGeometry(n)},o.intersection=function(e,o){return overlayOp(e,o,t.INTERSECTION)},o.union=function(e,o){return overlayOp(e,o,t.UNION)},o.difference=function(e,o){return overlayOp(e,o,t.DIFFERENCE)},o.symDifference=function(e,o){return overlayOp(e,o,t.SYMDIFFERENCE)},o.prototype.geom=null,o.prototype.getResultGeometry=function(o){var n=null,r=!1,i=null;try{n=t.overlayOp(this.geom[0],this.geom[1],o);var s=!0;s&&(r=!0)}catch(a){i=a}if(!r)try{n=e.overlayOp(this.geom[0],this.geom[1],o)}catch(a){throw i}return n},jsts.operation.overlay.snap.SnapIfNeededOverlayOp=o}(),function(){var t=jsts.geom.util.GeometryExtracter,e=jsts.operation.union.CascadedPolygonUnion,o=jsts.operation.union.PointGeometryUnion,n=jsts.operation.overlay.OverlayOp,r=jsts.operation.overlay.snap.SnapIfNeededOverlayOp,i=javascript.util.ArrayList;jsts.operation.union.UnaryUnionOp=function(t,e){this.polygons=new i,this.lines=new i,this.points=new i,e&&(this.geomFact=e),this.extract(t)},jsts.operation.union.UnaryUnionOp.union=function(t,e){var o=new jsts.operation.union.UnaryUnionOp(t,e);return o.union()},jsts.operation.union.UnaryUnionOp.prototype.polygons=null,jsts.operation.union.UnaryUnionOp.prototype.lines=null,jsts.operation.union.UnaryUnionOp.prototype.points=null,jsts.operation.union.UnaryUnionOp.prototype.geomFact=null,jsts.operation.union.UnaryUnionOp.prototype.extract=function(e){if(e instanceof i)for(var o=e.iterator();o.hasNext();){var n=o.next();this.extract(n)}else null===this.geomFact&&(this.geomFact=e.getFactory()),t.extract(e,jsts.geom.Polygon,this.polygons),t.extract(e,jsts.geom.LineString,this.lines),t.extract(e,jsts.geom.Point,this.points)},jsts.operation.union.UnaryUnionOp.prototype.union=function(){if(null===this.geomFact)return null;var t=null;if(this.points.size()>0){var n=this.geomFact.buildGeometry(this.points);
t=this.unionNoOpt(n)}var r=null;if(this.lines.size()>0){var i=this.geomFact.buildGeometry(this.lines);r=this.unionNoOpt(i)}var s=null;this.polygons.size()>0&&(s=e.union(this.polygons));var a=this.unionWithNull(r,s),u=null;return u=null===t?a:null===a?t:o(t,a),null===u?this.geomFact.createGeometryCollection(null):u},jsts.operation.union.UnaryUnionOp.prototype.unionWithNull=function(t,e){return null===t&&null===e?null:null===e?t:null===t?e:t.union(e)},jsts.operation.union.UnaryUnionOp.prototype.unionNoOpt=function(t){var e=this.geomFact.createPoint(null);return r.overlayOp(t,e,n.UNION)}}(),jsts.index.kdtree.KdNode=function(){this.left=null,this.right=null,this.count=1,2===arguments.length?this.initializeFromCoordinate.apply(this,arguments[0],arguments[1]):3===arguments.length&&this.initializeFromXY.apply(this,arguments[0],arguments[1],arguments[2])},jsts.index.kdtree.KdNode.prototype.initializeFromXY=function(t,e,o){this.p=new jsts.geom.Coordinate(t,e),this.data=o},jsts.index.kdtree.KdNode.prototype.initializeFromCoordinate=function(t,e){this.p=t,this.data=e},jsts.index.kdtree.KdNode.prototype.getX=function(){return this.p.x},jsts.index.kdtree.KdNode.prototype.getY=function(){return this.p.y},jsts.index.kdtree.KdNode.prototype.getCoordinate=function(){return this.p},jsts.index.kdtree.KdNode.prototype.getData=function(){return this.data},jsts.index.kdtree.KdNode.prototype.getLeft=function(){return this.left},jsts.index.kdtree.KdNode.prototype.getRight=function(){return this.right},jsts.index.kdtree.KdNode.prototype.increment=function(){this.count+=1},jsts.index.kdtree.KdNode.prototype.getCount=function(){return this.count},jsts.index.kdtree.KdNode.prototype.isRepeated=function(){return count>1},jsts.index.kdtree.KdNode.prototype.setLeft=function(t){this.left=t},jsts.index.kdtree.KdNode.prototype.setRight=function(t){this.right=t},jsts.algorithm.InteriorPointPoint=function(t){this.minDistance=Number.MAX_VALUE,this.interiorPoint=null,this.centroid=t.getCentroid().getCoordinate(),this.add(t)},jsts.algorithm.InteriorPointPoint.prototype.add=function(t){if(t instanceof jsts.geom.Point)this.addPoint(t.getCoordinate());else if(t instanceof jsts.geom.GeometryCollection)for(var e=0;e<t.getNumGeometries();e++)this.add(t.getGeometryN(e))},jsts.algorithm.InteriorPointPoint.prototype.addPoint=function(t){var e=t.distance(this.centroid);e<this.minDistance&&(this.interiorPoint=new jsts.geom.Coordinate(t),this.minDistance=e)},jsts.algorithm.InteriorPointPoint.prototype.getInteriorPoint=function(){return this.interiorPoint},function(){jsts.geom.MultiLineString=function(t,e){this.geometries=t||[],this.factory=e},jsts.geom.MultiLineString.prototype=new jsts.geom.GeometryCollection,jsts.geom.MultiLineString.constructor=jsts.geom.MultiLineString,jsts.geom.MultiLineString.prototype.getBoundary=function(){return new jsts.operation.BoundaryOp(this).getBoundary()},jsts.geom.MultiLineString.prototype.equalsExact=function(t,e){return this.isEquivalentClass(t)?jsts.geom.GeometryCollection.prototype.equalsExact.call(this,t,e):!1},jsts.geom.MultiLineString.prototype.CLASS_NAME="jsts.geom.MultiLineString"}(),function(){var t=jsts.index.bintree.Interval,e=jsts.index.bintree.Root,o=function(){this.root=new e,this.minExtent=1};o.ensureExtent=function(e,o){var n,r;return n=e.getMin(),r=e.getMax(),n!==r?e:(n===r&&(n-=o/2,r=n+o/2),new t(n,r))},o.prototype.depth=function(){return null!==this.root?this.root.depth():0},o.prototype.size=function(){return null!==this.root?this.root.size():0},o.prototype.nodeSize=function(){return null!==this.root?this.root.nodeSize():0},o.prototype.insert=function(t,e){this.collectStats(t);var n=o.ensureExtent(t,this.minExtent);this.root.insert(n,e)},o.prototype.remove=function(t,e){var n=o.ensureExtent(t,this.minExtent);return this.root.remove(n,e)},o.prototype.iterator=function(){var t=new javascript.util.ArrayList;return this.root.addAllItems(t),t.iterator()},o.prototype.query=function(){if(2!==arguments.length){var e=arguments[0];return!e instanceof t&&(e=new t(e,e)),this.queryInterval(e)}this.queryAndAdd(arguments[0],arguments[1])},o.prototype.queryInterval=function(t){var e=new javascript.util.ArrayList;return this.query(t,e),e},o.prototype.queryAndAdd=function(t,e){this.root.addAllItemsFromOverlapping(t,e)},o.prototype.collectStats=function(t){var e=t.getWidth();e<this.minExtent&&e>0&&(this.minExtent=e)},jsts.index.bintree.Bintree=o}(),jsts.algorithm.InteriorPointArea=function(t){this.factory,this.interiorPoint=null,this.maxWidth=0,this.factory=t.getFactory(),this.add(t)},jsts.algorithm.InteriorPointArea.avg=function(t,e){return(t+e)/2},jsts.algorithm.InteriorPointArea.prototype.getInteriorPoint=function(){return this.interiorPoint},jsts.algorithm.InteriorPointArea.prototype.add=function(t){if(t instanceof jsts.geom.Polygon)this.addPolygon(t);else if(t instanceof jsts.geom.GeometryCollection)for(var e=0;e<t.getNumGeometries();e++)this.add(t.getGeometryN(e))},jsts.algorithm.InteriorPointArea.prototype.addPolygon=function(t){if(!t.isEmpty()){var e,o=0,n=this.horizontalBisector(t);if(0==n.getLength())o=0,e=n.getCoordinate();else{var r=n.intersection(t),i=this.widestGeometry(r);o=i.getEnvelopeInternal().getWidth(),e=this.centre(i.getEnvelopeInternal())}(null==this.interiorPoint||o>this.maxWidth)&&(this.interiorPoint=e,this.maxWidth=o)}},jsts.algorithm.InteriorPointArea.prototype.widestGeometry=function(t){if(t instanceof jsts.geom.GeometryCollection){var e=t;if(e.isEmpty())return e;for(var o=e.getGeometryN(0),n=1;n<e.getNumGeometries();n++)e.getGeometryN(n).getEnvelopeInternal().getWidth()>o.getEnvelopeInternal().getWidth()&&(o=e.getGeometryN(n));return o}return t instanceof jsts.geom.Geometry?t:void 0},jsts.algorithm.InteriorPointArea.prototype.horizontalBisector=function(t){var e=t.getEnvelopeInternal(),o=jsts.algorithm.SafeBisectorFinder.getBisectorY(t);return this.factory.createLineString([new jsts.geom.Coordinate(e.getMinX(),o),new jsts.geom.Coordinate(e.getMaxX(),o)])},jsts.algorithm.InteriorPointArea.prototype.centre=function(t){return new jsts.geom.Coordinate(jsts.algorithm.InteriorPointArea.avg(t.getMinX(),t.getMaxX()),jsts.algorithm.InteriorPointArea.avg(t.getMinY(),t.getMaxY()))},jsts.algorithm.SafeBisectorFinder=function(t){this.poly,this.centreY,this.hiY=Number.MAX_VALUE,this.loY=-Number.MAX_VALUE,this.poly=t,this.hiY=t.getEnvelopeInternal().getMaxY(),this.loY=t.getEnvelopeInternal().getMinY(),this.centreY=jsts.algorithm.InteriorPointArea.avg(this.loY,this.hiY)},jsts.algorithm.SafeBisectorFinder.getBisectorY=function(t){var e=new jsts.algorithm.SafeBisectorFinder(t);return e.getBisectorY()},jsts.algorithm.SafeBisectorFinder.prototype.getBisectorY=function(){this.process(this.poly.getExteriorRing());for(var t=0;t<this.poly.getNumInteriorRing();t++)this.process(this.poly.getInteriorRingN(t));var e=jsts.algorithm.InteriorPointArea.avg(this.hiY,this.loY);return e},jsts.algorithm.SafeBisectorFinder.prototype.process=function(t){for(var e=t.getCoordinateSequence(),o=0;o<e.length;o++){var n=e[o].y;this.updateInterval(n)}},jsts.algorithm.SafeBisectorFinder.prototype.updateInterval=function(t){t<=this.centreY?t>this.loY&&(this.loY=t):t>this.centreY&&t<this.hiY&&(this.hiY=t)},jsts.operation.buffer.BufferParameters=function(t,e,o,n){t&&this.setQuadrantSegments(t),e&&this.setEndCapStyle(e),o&&this.setJoinStyle(o),n&&this.setMitreLimit(n)},jsts.operation.buffer.BufferParameters.CAP_ROUND=1,jsts.operation.buffer.BufferParameters.CAP_FLAT=2,jsts.operation.buffer.BufferParameters.CAP_SQUARE=3,jsts.operation.buffer.BufferParameters.JOIN_ROUND=1,jsts.operation.buffer.BufferParameters.JOIN_MITRE=2,jsts.operation.buffer.BufferParameters.JOIN_BEVEL=3,jsts.operation.buffer.BufferParameters.DEFAULT_QUADRANT_SEGMENTS=8,jsts.operation.buffer.BufferParameters.DEFAULT_MITRE_LIMIT=5,jsts.operation.buffer.BufferParameters.prototype.quadrantSegments=jsts.operation.buffer.BufferParameters.DEFAULT_QUADRANT_SEGMENTS,jsts.operation.buffer.BufferParameters.prototype.endCapStyle=jsts.operation.buffer.BufferParameters.CAP_ROUND,jsts.operation.buffer.BufferParameters.prototype.joinStyle=jsts.operation.buffer.BufferParameters.JOIN_ROUND,jsts.operation.buffer.BufferParameters.prototype.mitreLimit=jsts.operation.buffer.BufferParameters.DEFAULT_MITRE_LIMIT,jsts.operation.buffer.BufferParameters.prototype._isSingleSided=!1,jsts.operation.buffer.BufferParameters.prototype.getQuadrantSegments=function(){return this.quadrantSegments},jsts.operation.buffer.BufferParameters.prototype.setQuadrantSegments=function(t){this.quadrantSegments=t},jsts.operation.buffer.BufferParameters.prototype.setQuadrantSegments=function(t){this.quadrantSegments=t,0===this.quadrantSegments&&(this.joinStyle=jsts.operation.buffer.BufferParameters.JOIN_BEVEL),this.quadrantSegments<0&&(this.joinStyle=jsts.operation.buffer.BufferParameters.JOIN_MITRE,this.mitreLimit=Math.abs(this.quadrantSegments)),0>=t&&(this.quadrantSegments=1),this.joinStyle!==jsts.operation.buffer.BufferParameters.JOIN_ROUND&&(this.quadrantSegments=jsts.operation.buffer.BufferParameters.DEFAULT_QUADRANT_SEGMENTS)},jsts.operation.buffer.BufferParameters.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},jsts.operation.buffer.BufferParameters.prototype.getEndCapStyle=function(){return this.endCapStyle},jsts.operation.buffer.BufferParameters.prototype.setEndCapStyle=function(t){this.endCapStyle=t},jsts.operation.buffer.BufferParameters.prototype.getJoinStyle=function(){return this.joinStyle},jsts.operation.buffer.BufferParameters.prototype.setJoinStyle=function(t){this.joinStyle=t},jsts.operation.buffer.BufferParameters.prototype.getMitreLimit=function(){return this.mitreLimit},jsts.operation.buffer.BufferParameters.prototype.setMitreLimit=function(t){this.mitreLimit=t},jsts.operation.buffer.BufferParameters.prototype.setSingleSided=function(t){this._isSingleSided=t},jsts.operation.buffer.BufferParameters.prototype.isSingleSided=function(){return this._isSingleSided},function(){jsts.geom.util.ShortCircuitedGeometryVisitor=function(){},jsts.geom.util.ShortCircuitedGeometryVisitor.prototype.isDone=!1,jsts.geom.util.ShortCircuitedGeometryVisitor.prototype.applyTo=function(t){for(var e=0;e<t.getNumGeometries()&&!this.isDone;e++){var o=t.getGeometryN(e);if(o instanceof jsts.geom.GeometryCollection)this.applyTo(o);else if(this.visit(o),this.isDone())return void(this.isDone=!0)}},jsts.geom.util.ShortCircuitedGeometryVisitor.prototype.visit=function(){},jsts.geom.util.ShortCircuitedGeometryVisitor.prototype.isDone=function(){}}(),function(){var t=function(t){this.rectEnv=t};t.prototype=new jsts.geom.util.ShortCircuitedGeometryVisitor,t.constructor=t,t.prototype.rectEnv=null,t.prototype.intersects=!1,t.prototype.intersects=function(){return this.intersects},t.prototype.visit=function(t){var e=t.getEnvelopeInternal();if(this.rectEnv.intersects(e))return this.rectEnv.contains(e)?void(this.intersects=!0):e.getMinX()>=rectEnv.getMinX()&&e.getMaxX()<=rectEnv.getMaxX()?void(this.intersects=!0):e.getMinY()>=rectEnv.getMinY()&&e.getMaxY()<=rectEnv.getMaxY()?void(this.intersects=!0):void 0},t.prototype.isDone=function(){return 1==this.intersects};var e=function(t){this.rectSeq=t.getExteriorRing().getCoordinateSequence(),this.rectEnv=t.getEnvelopeInternal()};e.prototype=new jsts.geom.util.ShortCircuitedGeometryVisitor,e.constructor=e,e.prototype.rectSeq=null,e.prototype.rectEnv=null,e.prototype.containsPoint=!1,e.prototype.containsPoint=function(){return this.containsPoint},e.prototype.visit=function(t){if(t instanceof jsts.geom.Polygon){var e=t.getEnvelopeInternal();if(this.rectEnv.intersects(e))for(var o=new jsts.geom.Coordinate,n=0;4>n;n++)if(this.rectSeq.getCoordinate(n,o),e.contains(o)&&SimplePointInAreaLocator.containsPointInPolygon(o,t))return void(this.containsPoint=!0)}},e.prototype.isDone=function(){return 1==this.containsPoint};var o=function(t){this.rectEnv=t.getEnvelopeInternal(),this.rectIntersector=new RectangleLineIntersector(rectEnv)};o.prototype=new jsts.geom.util.ShortCircuitedGeometryVisitor,o.constructor=o,o.prototype.rectEnv=null,o.prototype.rectIntersector=null,o.prototype.hasIntersection=!1,o.prototype.p0=null,o.prototype.p1=null,o.prototype.intersects=function(){return this.hasIntersection},o.prototype.visit=function(t){var e=t.getEnvelopeInternal();if(this.rectEnv.intersects(e)){var o=LinearComponentExtracter.getLines(t);this.checkIntersectionWithLineStrings(o)}},o.prototype.checkIntersectionWithLineStrings=function(t){for(var e=t.iterator();e.hasNext();){var o=e.next();if(this.checkIntersectionWithSegments(o),this.hasIntersection)return}},o.prototype.checkIntersectionWithSegments=function(t){for(var e=t.getCoordinateSequence(),o=1;o<e.length;o++)if(this.p0=e[o-1],this.p1=e[o],rectIntersector.intersects(p0,p1))return void(this.hasIntersection=!0)},o.prototype.isDone=function(){return 1==this.hasIntersection},jsts.operation.predicate.RectangleIntersects=function(t){this.rectangle=t,this.rectEnv=t.getEnvelopeInternal()},jsts.operation.predicate.RectangleIntersects.intersects=function(t,e){var o=new jsts.operation.predicate.RectangleIntersects(t);return o.intersects(e)},jsts.operation.predicate.RectangleIntersects.prototype.rectangle=null,jsts.operation.predicate.RectangleIntersects.prototype.rectEnv=null,jsts.operation.predicate.RectangleIntersects.prototype.intersects=function(n){if(!this.rectEnv.intersects(n.getEnvelopeInternal()))return!1;var r=new t(this.rectEnv);if(r.applyTo(n),r.intersects())return!0;var i=new e(rectangle);if(i.applyTo(n),i.containsPoint())return!0;var s=new o(rectangle);return s.applyTo(n),s.intersects()?!0:!1}}(),jsts.operation.buffer.BufferBuilder=function(t){this.bufParams=t,this.edgeList=new jsts.geomgraph.EdgeList},jsts.operation.buffer.BufferBuilder.depthDelta=function(t){var e=t.getLocation(0,jsts.geomgraph.Position.LEFT),o=t.getLocation(0,jsts.geomgraph.Position.RIGHT);return e===jsts.geom.Location.INTERIOR&&o===jsts.geom.Location.EXTERIOR?1:e===jsts.geom.Location.EXTERIOR&&o===jsts.geom.Location.INTERIOR?-1:0},jsts.operation.buffer.BufferBuilder.prototype.bufParams=null,jsts.operation.buffer.BufferBuilder.prototype.workingPrecisionModel=null,jsts.operation.buffer.BufferBuilder.prototype.workingNoder=null,jsts.operation.buffer.BufferBuilder.prototype.geomFact=null,jsts.operation.buffer.BufferBuilder.prototype.graph=null,jsts.operation.buffer.BufferBuilder.prototype.edgeList=null,jsts.operation.buffer.BufferBuilder.prototype.setWorkingPrecisionModel=function(t){this.workingPrecisionModel=t},jsts.operation.buffer.BufferBuilder.prototype.setNoder=function(t){this.workingNoder=t},jsts.operation.buffer.BufferBuilder.prototype.buffer=function(t,e){var o=this.workingPrecisionModel;null===o&&(o=t.getPrecisionModel()),this.geomFact=t.getFactory();var n=new jsts.operation.buffer.OffsetCurveBuilder(o,this.bufParams),r=new jsts.operation.buffer.OffsetCurveSetBuilder(t,e,n),i=r.getCurves();if(i.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(i,o),this.graph=new jsts.geomgraph.PlanarGraph(new jsts.operation.overlay.OverlayNodeFactory),this.graph.addEdges(this.edgeList.getEdges());var s=this.createSubgraphs(this.graph),a=new jsts.operation.overlay.PolygonBuilder(this.geomFact);this.buildSubgraphs(s,a);var u=a.getPolygons();if(u.size()<=0)return this.createEmptyResultGeometry();var p=this.geomFact.buildGeometry(u);return p},jsts.operation.buffer.BufferBuilder.prototype.getNoder=function(t){if(null!==this.workingNoder)return this.workingNoder;var e=new jsts.noding.MCIndexNoder,o=new jsts.algorithm.RobustLineIntersector;return o.setPrecisionModel(t),e.setSegmentIntersector(new jsts.noding.IntersectionAdder(o)),e},jsts.operation.buffer.BufferBuilder.prototype.computeNodedEdges=function(t,e){var o=this.getNoder(e);o.computeNodes(t);for(var n=o.getNodedSubstrings(),r=n.iterator();r.hasNext();){var i=r.next(),s=i.getData(),a=new jsts.geomgraph.Edge(i.getCoordinates(),new jsts.geomgraph.Label(s));this.insertUniqueEdge(a)}},jsts.operation.buffer.BufferBuilder.prototype.insertUniqueEdge=function(t){var e=this.edgeList.findEqualEdge(t);if(null!=e){var o=e.getLabel(),n=t.getLabel();e.isPointwiseEqual(t)||(n=new jsts.geomgraph.Label(t.getLabel()),n.flip()),o.merge(n);var r=jsts.operation.buffer.BufferBuilder.depthDelta(n),i=e.getDepthDelta(),s=i+r;e.setDepthDelta(s)}else this.edgeList.add(t),t.setDepthDelta(jsts.operation.buffer.BufferBuilder.depthDelta(t.getLabel()))},jsts.operation.buffer.BufferBuilder.prototype.createSubgraphs=function(t){for(var e=[],o=t.getNodes().iterator();o.hasNext();){var n=o.next();if(!n.isVisited()){var r=new jsts.operation.buffer.BufferSubgraph;r.create(n),e.push(r)}}var i=function(t,e){return t.compareTo(e)};return e.sort(i),e.reverse(),e},jsts.operation.buffer.BufferBuilder.prototype.buildSubgraphs=function(t,e){for(var o=[],n=0;n<t.length;n++){var r=t[n],i=r.getRightmostCoordinate(),s=new jsts.operation.buffer.SubgraphDepthLocater(o),a=s.getDepth(i);r.computeDepth(a),r.findResultEdges(),o.push(r),e.add(r.getDirectedEdges(),r.getNodes())}},jsts.operation.buffer.BufferBuilder.convertSegStrings=function(t){for(var e=new jsts.geom.GeometryFactory,o=new javascript.util.ArrayList;t.hasNext();){var n=t.next(),r=e.createLineString(n.getCoordinates());o.add(r)}return e.buildGeometry(o)},jsts.operation.buffer.BufferBuilder.prototype.createEmptyResultGeometry=function(){var t=this.geomFact.createPolygon(null,null);return t},jsts.noding.SegmentPointComparator=function(){},jsts.noding.SegmentPointComparator.compare=function(t,e,o){if(e.equals2D(o))return 0;var n=jsts.noding.SegmentPointComparator.relativeSign(e.x,o.x),r=jsts.noding.SegmentPointComparator.relativeSign(e.y,o.y);switch(t){case 0:return jsts.noding.SegmentPointComparator.compareValue(n,r);case 1:return jsts.noding.SegmentPointComparator.compareValue(r,n);case 2:return jsts.noding.SegmentPointComparator.compareValue(r,-n);case 3:return jsts.noding.SegmentPointComparator.compareValue(-n,r);case 4:return jsts.noding.SegmentPointComparator.compareValue(-n,-r);case 5:return jsts.noding.SegmentPointComparator.compareValue(-r,-n);case 6:return jsts.noding.SegmentPointComparator.compareValue(-r,n);case 7:return jsts.noding.SegmentPointComparator.compareValue(n,-r)}return 0},jsts.noding.SegmentPointComparator.relativeSign=function(t,e){return e>t?-1:t>e?1:0},jsts.noding.SegmentPointComparator.compareValue=function(t,e){return 0>t?-1:t>0?1:0>e?-1:e>0?1:0},jsts.operation.relate.RelateOp=function(){jsts.operation.GeometryGraphOperation.apply(this,arguments),this._relate=new jsts.operation.relate.RelateComputer(this.arg)},jsts.operation.relate.RelateOp.prototype=new jsts.operation.GeometryGraphOperation,jsts.operation.relate.RelateOp.relate=function(t,e,o){var n=new jsts.operation.relate.RelateOp(t,e,o),r=n.getIntersectionMatrix();return r},jsts.operation.relate.RelateOp.prototype._relate=null,jsts.operation.relate.RelateOp.prototype.getIntersectionMatrix=function(){return this._relate.computeIM()},jsts.index.chain.MonotoneChain=function(t,e,o,n){this.pts=t,this.start=e,this.end=o,this.context=n},jsts.index.chain.MonotoneChain.prototype.pts=null,jsts.index.chain.MonotoneChain.prototype.start=null,jsts.index.chain.MonotoneChain.prototype.end=null,jsts.index.chain.MonotoneChain.prototype.env=null,jsts.index.chain.MonotoneChain.prototype.context=null,jsts.index.chain.MonotoneChain.prototype.id=null,jsts.index.chain.MonotoneChain.prototype.setId=function(t){this.id=t},jsts.index.chain.MonotoneChain.prototype.getId=function(){return this.id},jsts.index.chain.MonotoneChain.prototype.getContext=function(){return this.context},jsts.index.chain.MonotoneChain.prototype.getEnvelope=function(){if(null==this.env){var t=this.pts[this.start],e=this.pts[this.end];this.env=new jsts.geom.Envelope(t,e)}return this.env},jsts.index.chain.MonotoneChain.prototype.getStartIndex=function(){return this.start},jsts.index.chain.MonotoneChain.prototype.getEndIndex=function(){return this.end},jsts.index.chain.MonotoneChain.prototype.getLineSegment=function(t,e){e.p0=this.pts[t],e.p1=this.pts[t+1]},jsts.index.chain.MonotoneChain.prototype.getCoordinates=function(){for(var t=[],e=0,o=this.start;o<=this.end;o++)t[e++]=this.pts[o];return t},jsts.index.chain.MonotoneChain.prototype.select=function(t,e){this.computeSelect2(t,this.start,this.end,e)},jsts.index.chain.MonotoneChain.prototype.computeSelect2=function(t,e,o,n){var r=this.pts[e],i=this.pts[o];if(n.tempEnv1.init(r,i),o-e===1)return void n.select(this,e);if(t.intersects(n.tempEnv1)){var s=parseInt((e+o)/2);s>e&&this.computeSelect2(t,e,s,n),o>s&&this.computeSelect2(t,s,o,n)}},jsts.index.chain.MonotoneChain.prototype.computeOverlaps=function(t,e){return 6===arguments.length?this.computeOverlaps2.apply(this,arguments):void this.computeOverlaps2(this.start,this.end,t,t.start,t.end,e)},jsts.index.chain.MonotoneChain.prototype.computeOverlaps2=function(t,e,o,n,r,i){var s=this.pts[t],a=this.pts[e],u=o.pts[n],p=o.pts[r];if(e-t===1&&r-n===1)return void i.overlap(this,t,o,n);if(i.tempEnv1.init(s,a),i.tempEnv2.init(u,p),i.tempEnv1.intersects(i.tempEnv2)){var g=parseInt((t+e)/2),l=parseInt((n+r)/2);g>t&&(l>n&&this.computeOverlaps2(t,g,o,n,l,i),r>l&&this.computeOverlaps2(t,g,o,l,r,i)),e>g&&(l>n&&this.computeOverlaps2(g,e,o,n,l,i),r>l&&this.computeOverlaps2(g,e,o,l,r,i))}},function(){var t=jsts.geom.Location,e=jsts.geom.Dimension;jsts.geom.IntersectionMatrix=function(o){var n=o;void 0===o||null===o?(this.matrix=[[],[],[]],this.setAll(e.FALSE)):"string"==typeof o?this.set(o):n instanceof jsts.geom.IntersectionMatrix&&(this.matrix[t.INTERIOR][t.INTERIOR]=n.matrix[t.INTERIOR][t.INTERIOR],this.matrix[t.INTERIOR][t.BOUNDARY]=n.matrix[t.INTERIOR][t.BOUNDARY],this.matrix[t.INTERIOR][t.EXTERIOR]=n.matrix[t.INTERIOR][t.EXTERIOR],this.matrix[t.BOUNDARY][t.INTERIOR]=n.matrix[t.BOUNDARY][t.INTERIOR],this.matrix[t.BOUNDARY][t.BOUNDARY]=n.matrix[t.BOUNDARY][t.BOUNDARY],this.matrix[t.BOUNDARY][t.EXTERIOR]=n.matrix[t.BOUNDARY][t.EXTERIOR],this.matrix[t.EXTERIOR][t.INTERIOR]=n.matrix[t.EXTERIOR][t.INTERIOR],this.matrix[t.EXTERIOR][t.BOUNDARY]=n.matrix[t.EXTERIOR][t.BOUNDARY],this.matrix[t.EXTERIOR][t.EXTERIOR]=n.matrix[t.EXTERIOR][t.EXTERIOR])},jsts.geom.IntersectionMatrix.prototype.matrix=null,jsts.geom.IntersectionMatrix.prototype.add=function(t){var e,o;for(e=0;3>e;e++)for(o=0;3>o;o++)this.setAtLeast(e,o,t.get(e,o))},jsts.geom.IntersectionMatrix.matches=function(t,o){return"string"==typeof t?jsts.geom.IntersectionMatrix.matches2.call(this,arguments):"*"===o?!0:"T"===o&&(t>=0||t===e.TRUE)?!0:"F"===o&&t===e.FALSE?!0:"0"===o&&t===e.P?!0:"1"===o&&t===e.L?!0:"2"===o&&t===e.A?!0:!1},jsts.geom.IntersectionMatrix.matches2=function(t,e){var o=new jsts.geom.IntersectionMatrix(t);return o.matches(e)},jsts.geom.IntersectionMatrix.prototype.set=function(t,e,o){return"string"==typeof t?void this.set2(t):void(this.matrix[t][e]=o)},jsts.geom.IntersectionMatrix.prototype.set2=function(t){for(var o=0;o<t.length();o++){var n=o/3,r=o%3;this.matrix[n][r]=e.toDimensionValue(t.charAt(o))}},jsts.geom.IntersectionMatrix.prototype.setAtLeast=function(t,e,o){return 1===arguments.length?void this.setAtLeast2(arguments[0]):void(this.matrix[t][e]<o&&(this.matrix[t][e]=o))},jsts.geom.IntersectionMatrix.prototype.setAtLeastIfValid=function(t,e,o){t>=0&&e>=0&&this.setAtLeast(t,e,o)},jsts.geom.IntersectionMatrix.prototype.setAtLeast2=function(t){var e;for(e=0;e<t.length;e++){var o=parseInt(e/3),n=parseInt(e%3);this.setAtLeast(o,n,jsts.geom.Dimension.toDimensionValue(t.charAt(e)))}},jsts.geom.IntersectionMatrix.prototype.setAll=function(t){var e,o;for(e=0;3>e;e++)for(o=0;3>o;o++)this.matrix[e][o]=t},jsts.geom.IntersectionMatrix.prototype.get=function(t,e){return this.matrix[t][e]},jsts.geom.IntersectionMatrix.prototype.isDisjoint=function(){return this.matrix[t.INTERIOR][t.INTERIOR]===e.FALSE&&this.matrix[t.INTERIOR][t.BOUNDARY]===e.FALSE&&this.matrix[t.BOUNDARY][t.INTERIOR]===e.FALSE&&this.matrix[t.BOUNDARY][t.BOUNDARY]===e.FALSE},jsts.geom.IntersectionMatrix.prototype.isIntersects=function(){return!this.isDisjoint()},jsts.geom.IntersectionMatrix.prototype.isTouches=function(o,n){return o>n?this.isTouches(n,o):o==e.A&&n==e.A||o==e.L&&n==e.L||o==e.L&&n==e.A||o==e.P&&n==e.A||o==e.P&&n==e.L?this.matrix[t.INTERIOR][t.INTERIOR]===e.FALSE&&(jsts.geom.IntersectionMatrix.matches(this.matrix[t.INTERIOR][t.BOUNDARY],"T")||jsts.geom.IntersectionMatrix.matches(this.matrix[t.BOUNDARY][t.INTERIOR],"T")||jsts.geom.IntersectionMatrix.matches(this.matrix[t.BOUNDARY][t.BOUNDARY],"T")):!1},jsts.geom.IntersectionMatrix.prototype.isCrosses=function(o,n){return o==e.P&&n==e.L||o==e.P&&n==e.A||o==e.L&&n==e.A?jsts.geom.IntersectionMatrix.matches(this.matrix[t.INTERIOR][t.INTERIOR],"T")&&jsts.geom.IntersectionMatrix.matches(this.matrix[t.INTERIOR][t.EXTERIOR],"T"):o==e.L&&n==e.P||o==e.A&&n==e.P||o==e.A&&n==e.L?jsts.geom.IntersectionMatrix.matches(matrix[t.INTERIOR][t.INTERIOR],"T")&&jsts.geom.IntersectionMatrix.matches(this.matrix[t.EXTERIOR][t.INTERIOR],"T"):o===e.L&&n===e.L?0===this.matrix[t.INTERIOR][t.INTERIOR]:!1},jsts.geom.IntersectionMatrix.prototype.isWithin=function(){return jsts.geom.IntersectionMatrix.matches(this.matrix[t.INTERIOR][t.INTERIOR],"T")&&this.matrix[t.INTERIOR][t.EXTERIOR]==e.FALSE&&this.matrix[t.BOUNDARY][t.EXTERIOR]==e.FALSE},jsts.geom.IntersectionMatrix.prototype.isContains=function(){return jsts.geom.IntersectionMatrix.matches(this.matrix[t.INTERIOR][t.INTERIOR],"T")&&this.matrix[t.EXTERIOR][t.INTERIOR]==e.FALSE&&this.matrix[t.EXTERIOR][t.BOUNDARY]==e.FALSE},jsts.geom.IntersectionMatrix.prototype.isCovers=function(){var o=jsts.geom.IntersectionMatrix.matches(this.matrix[t.INTERIOR][t.INTERIOR],"T")||jsts.geom.IntersectionMatrix.matches(this.matrix[t.INTERIOR][t.BOUNDARY],"T")||jsts.geom.IntersectionMatrix.matches(this.matrix[t.BOUNDARY][t.INTERIOR],"T")||jsts.geom.IntersectionMatrix.matches(this.matrix[t.BOUNDARY][t.BOUNDARY],"T");return o&&this.matrix[t.EXTERIOR][t.INTERIOR]==e.FALSE&&this.matrix[t.EXTERIOR][t.BOUNDARY]==e.FALSE},jsts.geom.IntersectionMatrix.prototype.isCoveredBy=function(){var o=jsts.geom.IntersectionMatrix.matches(this.matrix[t.INTERIOR][t.INTERIOR],"T")||jsts.geom.IntersectionMatrix.matches(this.matrix[t.INTERIOR][t.BOUNDARY],"T")||jsts.geom.IntersectionMatrix.matches(this.matrix[t.BOUNDARY][t.INTERIOR],"T")||jsts.geom.IntersectionMatrix.matches(this.matrix[t.BOUNDARY][t.BOUNDARY],"T");return o&&this.matrix[t.INTERIOR][t.EXTERIOR]===e.FALSE&&this.matrix[t.BOUNDARY][t.EXTERIOR]===e.FALSE},jsts.geom.IntersectionMatrix.prototype.isEquals=function(o,n){return o!==n?!1:jsts.geom.IntersectionMatrix.matches(this.matrix[t.INTERIOR][t.INTERIOR],"T")&&this.matrix[t.EXTERIOR][t.INTERIOR]===e.FALSE&&this.matrix[t.INTERIOR][t.EXTERIOR]===e.FALSE&&this.matrix[t.EXTERIOR][t.BOUNDARY]===e.FALSE&&this.matrix[t.BOUNDARY][t.EXTERIOR]===e.FALSE},jsts.geom.IntersectionMatrix.prototype.isOverlaps=function(o,n){return o==e.P&&n===e.P||o==e.A&&n===e.A?jsts.geom.IntersectionMatrix.matches(this.matrix[t.INTERIOR][t.INTERIOR],"T")&&jsts.geom.IntersectionMatrix.matches(this.matrix[t.INTERIOR][t.EXTERIOR],"T")&&jsts.geom.IntersectionMatrix.matches(this.matrix[t.EXTERIOR][t.INTERIOR],"T"):o===e.L&&n===e.L?1==this.matrix[t.INTERIOR][t.INTERIOR]&&jsts.geom.IntersectionMatrix.matches(this.matrix[t.INTERIOR][t.EXTERIOR],"T")&&jsts.geom.IntersectionMatrix.matches(this.matrix[t.EXTERIOR][t.INTERIOR],"T"):!1},jsts.geom.IntersectionMatrix.prototype.matches=function(t){if(9!=t.length)throw new jsts.error.IllegalArgumentException("Should be length 9: "+t);for(var e=0;3>e;e++)for(var o=0;3>o;o++)if(!jsts.geom.IntersectionMatrix.matches(this.matrix[e][o],t.charAt(3*e+o)))return!1;return!0},jsts.geom.IntersectionMatrix.prototype.transpose=function(){var t=matrix[1][0];return this.matrix[1][0]=this.matrix[0][1],this.matrix[0][1]=t,t=this.matrix[2][0],this.matrix[2][0]=this.matrix[0][2],this.matrix[0][2]=t,t=this.matrix[2][1],this.matrix[2][1]=this.matrix[1][2],this.matrix[1][2]=t,this},jsts.geom.IntersectionMatrix.prototype.toString=function(){var t,o,n="";for(t=0;3>t;t++)for(o=0;3>o;o++)n+=e.toDimensionSymbol(this.matrix[t][o]);return n}}(),jsts.triangulate.quadedge.LastFoundQuadEdgeLocator=function(t){this.subdiv=t,this.lastEdge=null,this.init()},jsts.triangulate.quadedge.LastFoundQuadEdgeLocator.prototype.init=function(){this.lastEdge=this.findEdge()},jsts.triangulate.quadedge.LastFoundQuadEdgeLocator.prototype.findEdge=function(){var t=this.subdiv.getEdges();return t[0]},jsts.triangulate.quadedge.LastFoundQuadEdgeLocator.prototype.locate=function(t){this.lastEdge.isLive()||this.init();var e=this.subdiv.locateFromEdge(t,this.lastEdge);return this.lastEdge=e,e},jsts.noding.SegmentNodeList=function(t){this.nodeMap=new javascript.util.TreeMap,this.edge=t},jsts.noding.SegmentNodeList.prototype.nodeMap=null,jsts.noding.SegmentNodeList.prototype.iterator=function(){return this.nodeMap.values().iterator()},jsts.noding.SegmentNodeList.prototype.edge=null,jsts.noding.SegmentNodeList.prototype.getEdge=function(){return this.edge},jsts.noding.SegmentNodeList.prototype.add=function(t,e){var o=new jsts.noding.SegmentNode(this.edge,t,e,this.edge.getSegmentOctant(e)),n=this.nodeMap.get(o);return null!==n?(jsts.util.Assert.isTrue(n.coord.equals2D(t),"Found equal nodes with different coordinates"),n):(this.nodeMap.put(o,o),o)},jsts.noding.SegmentNodeList.prototype.addEndpoints=function(){var t=this.edge.size()-1;this.add(this.edge.getCoordinate(0),0),this.add(this.edge.getCoordinate(t),t)},jsts.noding.SegmentNodeList.prototype.addCollapsedNodes=function(){var t=[];this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=0;e<t.length;e++){var o=t[e];this.add(this.edge.getCoordinate(o),o)}},jsts.noding.SegmentNodeList.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e<this.edge.size()-2;e++){var o=this.edge.getCoordinate(e),n=(this.edge.getCoordinate(e+1),this.edge.getCoordinate(e+2));o.equals2D(n)&&t.push(e+1)}},jsts.noding.SegmentNodeList.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=[null],o=this.iterator(),n=o.next();o.hasNext();){var r=o.next(),i=this.findCollapseIndex(n,r,e);i&&t.push(e[0]),n=r}},jsts.noding.SegmentNodeList.prototype.findCollapseIndex=function(t,e,o){if(!t.coord.equals2D(e.coord))return!1;var n=e.segmentIndex-t.segmentIndex;return e.isInterior()||n--,1===n?(o[0]=t.segmentIndex+1,!0):!1},jsts.noding.SegmentNodeList.prototype.addSplitEdges=function(t){this.addEndpoints(),this.addCollapsedNodes();for(var e=this.iterator(),o=e.next();e.hasNext();){var n=e.next(),r=this.createSplitEdge(o,n);t.add(r),o=n}},jsts.noding.SegmentNodeList.prototype.checkSplitEdgesCorrectness=function(t){var e=edge.getCoordinates(),o=t[0],n=o.getCoordinate(0);if(!n.equals2D(e[0]))throw new Error("bad split edge start point at "+n);var r=t[t.length-1],i=r.getCoordinates(),s=i[i.length-1];if(!s.equals2D(e[e.length-1]))throw new Error("bad split edge end point at "+s)},jsts.noding.SegmentNodeList.prototype.createSplitEdge=function(t,e){var o=e.segmentIndex-t.segmentIndex+2,n=this.edge.getCoordinate(e.segmentIndex),r=e.isInterior()||!e.coord.equals2D(n);r||o--;var i=[],s=0;i[s++]=new jsts.geom.Coordinate(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)i[s++]=this.edge.getCoordinate(a);return r&&(i[s]=e.coord),new jsts.noding.NodedSegmentString(i,this.edge.getData())},jsts.io.WKTWriter=function(){this.parser=new jsts.io.WKTParser(this.geometryFactory)},jsts.io.WKTWriter.prototype.write=function(t){var e=this.parser.write(t);return e},jsts.io.WKTWriter.toLineString=function(t,e){if(2!==arguments.length)throw new jsts.error.NotImplementedError;return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"},jsts.io.WKTReader=function(t){this.geometryFactory=t||new jsts.geom.GeometryFactory,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new jsts.io.WKTParser(this.geometryFactory)},jsts.io.WKTReader.prototype.read=function(t){var e=this.parser.read(t);
return this.precisionModel.getType()===jsts.geom.PrecisionModel.FIXED&&this.reducePrecision(e),e},jsts.io.WKTReader.prototype.reducePrecision=function(t){var e,o;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(e=0,o=t.points.length;o>e;e++)this.precisionModel.makePrecise(t.points[e]);else if(t.geometries)for(e=0,o=t.geometries.length;o>e;e++)this.reducePrecision(t.geometries[e])},jsts.triangulate.quadedge.QuadEdgeSubdivision=function(t,e){this.tolerance=e,this.edgeCoincidenceTolerance=e/jsts.triangulate.quadedge.QuadEdgeSubdivision.EDGE_COINCIDENCE_TOL_FACTOR,this.visitedKey=0,this.quadEdges=[],this.startingEdge,this.tolerance,this.edgeCoincidenceTolerance,this.frameEnv,this.locator=null,this.seg=new jsts.geom.LineSegment,this.triEdges=new Array(3),this.frameVertex=new Array(3),this.createFrame(t),this.startingEdge=this.initSubdiv(),this.locator=new jsts.triangulate.quadedge.LastFoundQuadEdgeLocator(this)},jsts.triangulate.quadedge.QuadEdgeSubdivision.EDGE_COINCIDENCE_TOL_FACTOR=1e3,jsts.triangulate.quadedge.QuadEdgeSubdivision.getTriangleEdges=function(t,e){if(e[0]=t,e[1]=e[0].lNext(),e[2]=e[1].lNext(),e[2].lNext()!=e[0])throw new jsts.IllegalArgumentError("Edges do not form a triangle")},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.createFrame=function(t){var e,o,n;e=t.getWidth(),o=t.getHeight(),n=0,n=e>o?10*e:10*o,this.frameVertex[0]=new jsts.triangulate.quadedge.Vertex((t.getMaxX()+t.getMinX())/2,t.getMaxY()+n),this.frameVertex[1]=new jsts.triangulate.quadedge.Vertex(t.getMinX()-n,t.getMinY()-n),this.frameVertex[2]=new jsts.triangulate.quadedge.Vertex(t.getMaxX()+n,t.getMinY()-n),this.frameEnv=new jsts.geom.Envelope(this.frameVertex[0].getCoordinate(),this.frameVertex[1].getCoordinate()),this.frameEnv.expandToInclude(this.frameVertex[2].getCoordinate())},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.initSubdiv=function(){var t,e,o;return t=this.makeEdge(this.frameVertex[0],this.frameVertex[1]),e=this.makeEdge(this.frameVertex[1],this.frameVertex[2]),jsts.triangulate.quadedge.QuadEdge.splice(t.sym(),e),o=this.makeEdge(this.frameVertex[2],this.frameVertex[0]),jsts.triangulate.quadedge.QuadEdge.splice(e.sym(),o),jsts.triangulate.quadedge.QuadEdge.splice(o.sym(),t),t},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getTolerance=function(){return this.tolerance},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getEnvelope=function(){return new jsts.geom.Envelope(this.frameEnv)},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getEdges=function(){return arguments.length>0?this.getEdgesByFactory(arguments[0]):this.quadEdges},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.setLocator=function(t){this.locator=t},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.makeEdge=function(t,e){var o=jsts.triangulate.quadedge.QuadEdge.makeEdge(t,e);return this.quadEdges.push(o),o},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.connect=function(t,e){var o=jsts.triangulate.quadedge.QuadEdge.connect(t,e);return this.quadEdges.push(o),o},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.delete_jsts=function(t){jsts.triangulate.quadedge.QuadEdge.splice(t,t.oPrev()),jsts.triangulate.quadedge.QuadEdge.splice(t.sym(),t.sym().oPrev());var e,o,n;t.eSym=t.sym(),o=t.rot,n=t.rot.sym();var r=this.quadEdges.indexOf(t);-1!==r&&this.quadEdges.splice(r,1),r=this.quadEdges.indexOf(e),-1!==r&&this.quadEdges.splice(r,1),r=this.quadEdges.indexOf(o),-1!==r&&this.quadEdges.splice(r,1),r=this.quadEdges.indexOf(n),-1!==r&&this.quadEdges.splice(r,1),t.delete_jsts(),e.delete_jsts(),o.delete_jsts(),n.delete_jsts()},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.locateFromEdge=function(t,e){var o,n=0,r=this.quadEdges.length;for(o=e;;){if(n++,n>r)throw new jsts.error.LocateFailureError(o.toLineSegment());if(t.equals(o.orig())||t.equals(o.dest()))break;if(t.rightOf(o))o=o.sym();else if(t.rightOf(o.oNext())){if(t.rightOf(o.dPrev()))break;o=o.dPrev()}else o=o.oNext()}return o},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.locate=function(){return 1===arguments.length?arguments[0]instanceof jsts.triangulate.quadedge.Vertex?this.locateByVertex(arguments[0]):this.locateByCoordinate(arguments[0]):this.locateByCoordinates(arguments[0],arguments[1])},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.locateByVertex=function(t){return this.locator.locate(t)},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.locateByCoordinate=function(t){return this.locator.locate(new jsts.triangulate.quadedge.Vertex(t))},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.locateByCoordinates=function(t,e){var o,n,r,o=this.locator.locate(new jsts.triangulate.quadedge.Vertex(t));if(null===o)return null;n=o,o.dest().getCoordinate().equals2D(t)&&(n=o.sym()),r=n;do{if(r.dest().getCoordinate().equals2D(e))return r;r=r.oNext()}while(r!=n);return null},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.insertSite=function(t){var e,o,n;if(e=this.locate(t),t.equals(e.orig(),this.tolerance)||t.equals(e.dest(),this.tolerance))return e;o=this.makeEdge(e.orig(),t),jsts.triangulate.quadedge.QuadEdge.splice(o,e),n=o;do o=this.connect(e,o.sym()),e=o.oPrev();while(e.lNext()!=n);return n},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.isFrameEdge=function(t){return this.isFrameVertex(t.orig())||this.isFrameVertex(t.dest())?!0:!1},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.isFrameBorderEdge=function(t){var e,o,n,r;return e=new Array(3),this.getTriangleEdges(t,e),o=new Array(3),this.getTriangleEdges(t.sym(),o),n=t.lNext().dest(),this.isFrameVertex(n)?!0:(r=t.sym().lNext().dest(),this.isFrameVertex(r)?!0:!1)},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.isFrameVertex=function(t){return t.equals(this.frameVertex[0])?!0:t.equals(this.frameVertex[1])?!0:t.equals(this.frameVertex[2])?!0:!1},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.isOnEdge=function(t,e){this.seg.setCoordinates(t.orig().getCoordinate(),t.dest().getCoordinate());var o=this.seg.distance(e);return o<this.edgeCoincidenceTolerance},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.isVertexOfEdge=function(t,e){return e.equals(t.orig(),this.tolerance)||e.equals(t.dest(),this.tolerance)?!0:!1},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getVertices=function(t){var e,o,n,r,i,s=[];for(e=0,o=this.quadEdges.length,e;o>e;e++)n=this.quadEdges[e],r=n.orig(),(t||!this.isFrameVertex(r))&&s.push(r),i=n.dest(),(t||!this.isFrameVertex(i))&&s.push(i);return s},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getVertexUniqueEdges=function(t){var e,o,n,r,i,s,a,u;for(e=[],o=[],n=0,r=this.quadEdges.length,n;r>n;n++)i=this.quadEdges[n],s=i.orig(),-1===o.indexOf(s)&&(o.push(s),(t||!this.isFrameVertex(s))&&e.push(i)),a=i.sym(),u=a.orig(),-1===o.indexOf(u)&&(o.push(u),(t||!this.isFrameVertex(u))&&e.push(a));return e},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getPrimaryEdges=function(t){this.visitedKey++;var e,o,n,r,i;for(e=[],o=[],o.push(this.startingEdge),n=[];o.length>0;)r=o.pop(),-1===n.indexOf(r)&&(i=r.getPrimary(),(t||!this.isFrameEdge(i))&&e.push(i),o.push(r.oNext()),o.push(r.sym().oNext()),n.push(r),n.push(r.sym()));return e},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.visitTriangles=function(t,e){this.visitedKey++;var o,n,r,i;for(o=[],o.push(this.startingEdge),n=[];o.length>0;)r=o.pop(),-1===n.indexOf(r)&&(i=this.fetchTriangleToVisit(r,o,e,n),null!==i&&t.visit(i))},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.fetchTriangleToVisit=function(t,e,o,n){var r,i,s,a;r=t,i=0,s=!1;do this.triEdges[i]=r,this.isFrameEdge(r)&&(s=!0),a=r.sym(),-1===n.indexOf(a)&&e.push(a),n.push(r),i++,r=r.lNext();while(r!==t);return s&&!o?null:this.triEdges},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getTriangleEdges=function(t){var e=new jsts.triangulate.quadedge.TriangleEdgesListVisitor;return this.visitTriangles(e,t),e.getTriangleEdges()},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getTriangleVertices=function(t){var e=new TriangleVertexListVisitor;return this.visitTriangles(e,t),e.getTriangleVertices()},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getTriangleCoordinates=function(t){var e=new jsts.triangulate.quadedge.TriangleCoordinatesVisitor;return this.visitTriangles(e,t),e.getTriangles()},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getEdgesByFactory=function(t){var e,o,n,r,i,s;for(e=this.getPrimaryEdges(!1),o=[],n=0,r=e.length,n;r>n;n++)i=e[n],s=[],s[0]=i.orig().getCoordinate(),s[1]=i.dest().getCoordinate(),o[n]=t.createLineString(s);return t.createMultiLineString(o)},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getTriangles=function(t){var e,o,n,r,i;for(e=this.getTriangleCoordinates(!1),o=new Array(e.length),r=0,i=e.length,r;i>r;r++)n=e[r],o[r]=t.createPolygon(t.createLinearRing(n,null));return t.createGeometryCollection(o)},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getVoronoiDiagram=function(t){var e=this.getVoronoiCellPolygons(t);return t.createGeometryCollection(e)},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getVoronoiCellPolygons=function(t){this.visitTriangles(new jsts.triangulate.quadedge.TriangleCircumcentreVisitor,!0);var e,o,n,r,i;for(e=[],o=this.getVertexUniqueEdges(!1),n=0,r=o.length,n;r>n;n++)i=o[n],e.push(this.getVoronoiCellPolygon(i,t));return e},jsts.triangulate.quadedge.QuadEdgeSubdivision.prototype.getVoronoiCellPolygon=function(t,e){var o,n,r,i,s;o=[],startQE=t;do n=t.rot.orig().getCoordinate(),o.push(n),t=t.oPrev();while(t!==startQE);return r=new jsts.geom.CoordinateList([],!1),r.add(o,!1),r.closeRing(),r.size()<4&&r.add(r.get(r.size()-1),!0),i=e.createPolygon(e.createLinearRing(r.toArray()),null),s=startQE.orig(),i},jsts.triangulate.quadedge.TriangleCircumcentreVisitor=function(){},jsts.triangulate.quadedge.TriangleCircumcentreVisitor.prototype.visit=function(t){var e,o,n,r,i,s;for(e=t[0].orig().getCoordinate(),o=t[1].orig().getCoordinate(),n=t[2].orig().getCoordinate(),r=jsts.geom.Triangle.circumcentre(e,o,n),i=new jsts.triangulate.quadedge.Vertex(r),s=0;3>s;s++)t[s].rot.setOrig(i)},jsts.triangulate.quadedge.TriangleEdgesListVisitor=function(){this.triList=[]},jsts.triangulate.quadedge.TriangleEdgesListVisitor.prototype.visit=function(t){var e=t.concat();this.triList.push(e)},jsts.triangulate.quadedge.TriangleEdgesListVisitor.prototype.getTriangleEdges=function(){return this.triList},jsts.triangulate.quadedge.TriangleVertexListVisitor=function(){this.triList=[]},jsts.triangulate.quadedge.TriangleVertexListVisitor.prototype.visit=function(){var t=[];t.push(trieEdges[0].orig()),t.push(trieEdges[1].orig()),t.push(trieEdges[2].orig()),this.triList.push(t)},jsts.triangulate.quadedge.TriangleVertexListVisitor.prototype.getTriangleVertices=function(){return this.triList},jsts.triangulate.quadedge.TriangleCoordinatesVisitor=function(){this.coordList=new jsts.geom.CoordinateList([],!1),this.triCoords=[]},jsts.triangulate.quadedge.TriangleCoordinatesVisitor.prototype.visit=function(t){this.coordList=new jsts.geom.CoordinateList([],!1);var e,o,n=0;for(n;3>n;n++)e=t[n].orig(),this.coordList.add(e.getCoordinate());if(this.coordList.size()>0){if(this.coordList.closeRing(),o=this.coordList.toArray(),4!==o.length)return;this.triCoords.push(o)}},jsts.triangulate.quadedge.TriangleCoordinatesVisitor.prototype.getTriangles=function(){return this.triCoords},jsts.operation.relate.EdgeEndBundle=function(){this.edgeEnds=[];var t=arguments[0]instanceof jsts.geomgraph.EdgeEnd?arguments[0]:arguments[1],e=t.getEdge(),o=t.getCoordinate(),n=t.getDirectedCoordinate(),r=new jsts.geomgraph.Label(t.getLabel());jsts.geomgraph.EdgeEnd.call(this,e,o,n,r),this.insert(t)},jsts.operation.relate.EdgeEndBundle.prototype=new jsts.geomgraph.EdgeEnd,jsts.operation.relate.EdgeEndBundle.prototype.edgeEnds=null,jsts.operation.relate.EdgeEndBundle.prototype.getLabel=function(){return this.label},jsts.operation.relate.EdgeEndBundle.prototype.getEdgeEnds=function(){return this.edgeEnds},jsts.operation.relate.EdgeEndBundle.prototype.insert=function(t){this.edgeEnds.push(t)},jsts.operation.relate.EdgeEndBundle.prototype.computeLabel=function(t){for(var e=!1,o=0;o<this.edgeEnds.length;o++){var n=this.edgeEnds[o];n.getLabel().isArea()&&(e=!0)}this.label=e?new jsts.geomgraph.Label(jsts.geom.Location.NONE,jsts.geom.Location.NONE,jsts.geom.Location.NONE):new jsts.geomgraph.Label(jsts.geom.Location.NONE);for(var o=0;2>o;o++)this.computeLabelOn(o,t),e&&this.computeLabelSides(o)},jsts.operation.relate.EdgeEndBundle.prototype.computeLabelOn=function(t,e){for(var o=0,n=!1,r=0;r<this.edgeEnds.length;r++){var i=this.edgeEnds[r],s=i.getLabel().getLocation(t);s==jsts.geom.Location.BOUNDARY&&o++,s==jsts.geom.Location.INTERIOR&&(n=!0)}var s=jsts.geom.Location.NONE;n&&(s=jsts.geom.Location.INTERIOR),o>0&&(s=jsts.geomgraph.GeometryGraph.determineBoundary(e,o)),this.label.setLocation(t,s)},jsts.operation.relate.EdgeEndBundle.prototype.computeLabelSides=function(t){this.computeLabelSide(t,jsts.geomgraph.Position.LEFT),this.computeLabelSide(t,jsts.geomgraph.Position.RIGHT)},jsts.operation.relate.EdgeEndBundle.prototype.computeLabelSide=function(t,e){for(var o=0;o<this.edgeEnds.length;o++){var n=this.edgeEnds[o];if(n.getLabel().isArea()){var r=n.getLabel().getLocation(t,e);if(r===jsts.geom.Location.INTERIOR)return void this.label.setLocation(t,e,jsts.geom.Location.INTERIOR);r===jsts.geom.Location.EXTERIOR&&this.label.setLocation(t,e,jsts.geom.Location.EXTERIOR)}}},jsts.operation.relate.EdgeEndBundle.prototype.updateIM=function(t){jsts.geomgraph.Edge.updateIM(this.label,t)},jsts.index.kdtree.KdTree=function(t){var e=0;void 0!==t&&(e=t),this.root=null,this.last=null,this.numberOfNodes=0,this.tolerance=e},jsts.index.kdtree.KdTree.prototype.insert=function(){return 1===arguments.length?this.insertCoordinate.apply(this,arguments[0]):this.insertWithData.apply(this,arguments[0],arguments[1])},jsts.index.kdtree.KdTree.prototype.insertCoordinate=function(t){return this.insertWithData(t,null)},jsts.index.kdtree.KdTree.prototype.insertWithData=function(t,e){if(null===this.root)return this.root=new jsts.index.kdtree.KdNode(t,e),this.root;for(var o=this.root,n=this.root,r=!0,i=!0;o!==last;){if(i=r?t.x<o.getX():t.y<o.getY(),n=o,o=i?o.getLeft():o.getRight(),null!==o){var s=t.distance(o.getCoordinate())<=this.tolerance;if(s)return o.increment(),o}r=!r}this.numberOfNodes=numberOfNodes+1;var a=new jsts.index.kdtree.KdNode(t,e);return a.setLeft(this.last),a.setRight(this.last),i?n.setLeft(a):n.setRight(a),a},jsts.index.kdtree.KdTree.prototype.queryNode=function(t,e,o,n,r){if(t!==e){var i,s,a;n?(i=o.getMinX(),s=o.getMaxX(),a=t.getX()):(i=o.getMinY(),s=o.getMaxY(),a=t.getY());var u=a>i,p=s>=a;u&&this.queryNode(t.getLeft(),e,o,!n,r),o.contains(t.getCoordinate())&&r.add(t),p&&this.queryNode(t.getRight(),e,o,!n,r)}},jsts.index.kdtree.KdTree.prototype.query=function(){return 1===arguments.length?this.queryByEnvelope.apply(this,arguments[0]):this.queryWithArray.apply(this,arguments[0],arguments[1])},jsts.index.kdtree.KdTree.prototype.queryByEnvelope=function(t){var e=[];return this.queryNode(this.root,this.last,t,!0,e),e},jsts.index.kdtree.KdTree.prototype.queryWithArray=function(t,e){this.queryNode(this.root,this.last,t,!0,e)},jsts.geom.Triangle=function(t,e,o){this.p0=t,this.p1=e,this.p2=o},jsts.geom.Triangle.isAcute=function(t,e,o){return jsts.algorithm.Angle.isAcute(t,e,o)&&jsts.algorithm.Angle.isAcute(e,o,t)&&jsts.algorithm.Angle.isAcute(o,t,e)?!0:!1},jsts.geom.Triangle.perpendicularBisector=function(t,e){var o,n,r,i;return o=e.x-t.x,n=e.y-t.y,r=new jsts.algorithm.HCoordinate(t.x+o/2,t.y+n/2,1),i=new jsts.algorithm.HCoordinate(t.x-n+o/2,t.y+o+n/2,1),new jsts.algorithm.HCoordinate(r,i)},jsts.geom.Triangle.circumcentre=function(t,e,o){var n,r,i,s,a,u,p,g,l,h,d;return n=o.x,r=o.y,i=t.x-n,s=t.y-r,a=e.x-n,u=e.y-r,p=2*jsts.geom.Triangle.det(i,s,a,u),g=jsts.geom.Triangle.det(s,i*i+s*s,u,a*a+u*u),l=jsts.geom.Triangle.det(i,i*i+s*s,a,a*a+u*u),h=n-g/p,d=r+l/p,new jsts.geom.Coordinate(h,d)},jsts.geom.Triangle.det=function(t,e,o,n){return t*n-e*o},jsts.geom.Triangle.inCentre=function(t,e,o){var n,r,i,s,a,u;return n=e.distance(o),r=t.distance(o),i=t.distance(e),s=n+r+i,a=(n*t.x+r*e.x+i*o.x)/s,u=(n*t.y+r*e.y+i*o.y)/s,new jsts.geom.Coordinate(a,u)},jsts.geom.Triangle.centroid=function(t,e,o){var n,r;return n=(t.x+e.x+o.x)/3,r=(t.y+e.y+o.y)/3,new jsts.geom.Coordinate(n,r)},jsts.geom.Triangle.longestSideLength=function(t,e,o){var n,r,i,s;return n=t.distance(e),r=e.distance(o),i=o.distance(t),s=n,r>s&&(s=r),i>s&&(s=i),s},jsts.geom.Triangle.angleBisector=function(t,e,o){var n,r,i,s,a,u;return n=e.distance(t),r=e.distance(o),i=n/(n+r),s=o.x-t.x,a=o.y-t.y,u=new jsts.geom.Coordinate(t.x+i*s,t.y+i*a)},jsts.geom.Triangle.area=function(t,e,o){return Math.abs(((o.x-t.x)*(e.y-t.y)-(e.x-t.x)*(o.y-t.y))/2)},jsts.geom.Triangle.signedArea=function(t,e,o){return((o.x-t.x)*(e.y-t.y)-(e.x-t.x)*(o.y-t.y))/2},jsts.geom.Triangle.prototype.inCentre=function(){return jsts.geom.Triangle.inCentre(this.p0,this.p1,this.p2)},jsts.noding.OrientedCoordinateArray=function(t){this.pts=t,this._orientation=jsts.noding.OrientedCoordinateArray.orientation(t)},jsts.noding.OrientedCoordinateArray.prototype.pts=null,jsts.noding.OrientedCoordinateArray.prototype._orientation=void 0,jsts.noding.OrientedCoordinateArray.orientation=function(t){return 1===jsts.geom.CoordinateArrays.increasingDirection(t)},jsts.noding.OrientedCoordinateArray.prototype.compareTo=function(t){var e=t,o=jsts.noding.OrientedCoordinateArray.compareOriented(this.pts,this._orientation,e.pts,e._orientation);return o},jsts.noding.OrientedCoordinateArray.compareOriented=function(t,e,o,n){for(var r=e?1:-1,i=n?1:-1,s=e?t.length:-1,a=n?o.length:-1,u=e?0:t.length-1,p=n?0:o.length-1;;){var g=t[u].compareTo(o[p]);if(0!==g)return g;u+=r,p+=i;var l=u===s,h=p===a;if(l&&!h)return-1;if(!l&&h)return 1;if(l&&h)return 0}},jsts.algorithm.CentralEndpointIntersector=function(t,e,o,n){this.pts=[t,e,o,n],this.compute()},jsts.algorithm.CentralEndpointIntersector.getIntersection=function(t,e,o,n){var r=new jsts.algorithm.CentralEndpointIntersector(t,e,o,n);return r.getIntersection()},jsts.algorithm.CentralEndpointIntersector.prototype.pts=null,jsts.algorithm.CentralEndpointIntersector.prototype.intPt=null,jsts.algorithm.CentralEndpointIntersector.prototype.compute=function(){var t=jsts.algorithm.CentralEndpointIntersector.average(this.pts);this.intPt=this.findNearestPoint(t,this.pts)},jsts.algorithm.CentralEndpointIntersector.prototype.getIntersection=function(){return this.intPt},jsts.algorithm.CentralEndpointIntersector.average=function(t){var e,o=new jsts.geom.Coordinate,n=t.length;for(e=0;n>e;e++)o.x+=t[e].x,o.y+=t[e].y;return n>0&&(o.x/=n,o.y/=n),o},jsts.algorithm.CentralEndpointIntersector.prototype.findNearestPoint=function(t,e){var o,n,r=Number.MAX_VALUE,i=null;for(o=0;o<e.length;o++)n=t.distance(e[o]),r>n&&(r=n,i=e[o]);return i},jsts.operation.buffer.BufferOp=function(t,e){this.argGeom=t,this.bufParams=e?e:new jsts.operation.buffer.BufferParameters},jsts.operation.buffer.BufferOp.MAX_PRECISION_DIGITS=12,jsts.operation.buffer.BufferOp.precisionScaleFactor=function(t,e,o){var n=t.getEnvelopeInternal(),r=Math.max(n.getHeight(),n.getWidth()),i=e>0?e:0,s=r+2*i,a=Math.log(s)/Math.log(10)+1,u=a-o,p=Math.pow(10,-u);return p},jsts.operation.buffer.BufferOp.bufferOp=function(t,e){if(arguments.length>2)return jsts.operation.buffer.BufferOp.bufferOp2.apply(this,arguments);var o=new jsts.operation.buffer.BufferOp(t),n=o.getResultGeometry(e);return n},jsts.operation.buffer.BufferOp.bufferOp2=function(t,e,o){if(arguments.length>3)return jsts.operation.buffer.BufferOp.bufferOp3.apply(this,arguments);var n=new jsts.operation.buffer.BufferOp(t,o),r=n.getResultGeometry(e);return r},jsts.operation.buffer.BufferOp.bufferOp3=function(t,e,o){if(arguments.length>4)return jsts.operation.buffer.BufferOp.bufferOp4.apply(this,arguments);var n=new jsts.operation.buffer.BufferOp(t);n.setQuadrantSegments(o);var r=n.getResultGeometry(e);return r},jsts.operation.buffer.BufferOp.bufferOp4=function(t,e,o,n){var r=new jsts.operation.buffer.BufferOp(t);r.setQuadrantSegments(o),r.setEndCapStyle(n);var i=r.getResultGeometry(e);return i},jsts.operation.buffer.BufferOp.prototype.argGeom=null,jsts.operation.buffer.BufferOp.prototype.distance=null,jsts.operation.buffer.BufferOp.prototype.bufParams=null,jsts.operation.buffer.BufferOp.prototype.resultGeometry=null,jsts.operation.buffer.BufferOp.prototype.setEndCapStyle=function(t){this.bufParams.setEndCapStyle(t)},jsts.operation.buffer.BufferOp.prototype.setQuadrantSegments=function(t){this.bufParams.setQuadrantSegments(t)},jsts.operation.buffer.BufferOp.prototype.getResultGeometry=function(t){return this.distance=t,this.computeGeometry(),this.resultGeometry},jsts.operation.buffer.BufferOp.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null===this.resultGeometry){var t=this.argGeom.getPrecisionModel();t.getType()===jsts.geom.PrecisionModel.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()}},jsts.operation.buffer.BufferOp.prototype.bufferReducedPrecision=function(){var t,e=null;for(t=jsts.operation.buffer.BufferOp.MAX_PRECISION_DIGITS;t>=0;t--){try{this.bufferReducedPrecision2(t)}catch(o){e=o}if(null!==this.resultGeometry)return}throw e},jsts.operation.buffer.BufferOp.prototype.bufferOriginalPrecision=function(){try{var t=new jsts.operation.buffer.BufferBuilder(this.bufParams);this.resultGeometry=t.buffer(this.argGeom,this.distance)}catch(e){}},jsts.operation.buffer.BufferOp.prototype.bufferReducedPrecision2=function(t){var e=jsts.operation.buffer.BufferOp.precisionScaleFactor(this.argGeom,this.distance,t),o=new jsts.geom.PrecisionModel(e);this.bufferFixedPrecision(o)},jsts.operation.buffer.BufferOp.prototype.bufferFixedPrecision=function(t){var e=new jsts.noding.ScaledNoder(new jsts.noding.snapround.MCIndexSnapRounder(new jsts.geom.PrecisionModel(1)),t.getScale()),o=new jsts.operation.buffer.BufferBuilder(this.bufParams);o.setWorkingPrecisionModel(t),o.setNoder(e),this.resultGeometry=o.buffer(this.argGeom,this.distance)},function(){var t=jsts.geom.Location,e=jsts.geomgraph.Position,o=jsts.util.Assert;jsts.geomgraph.GeometryGraph=function(t,e,o){jsts.geomgraph.PlanarGraph.call(this),this.lineEdgeMap=new javascript.util.HashMap,this.ptLocator=new jsts.algorithm.PointLocator,this.argIndex=t,this.parentGeom=e,this.boundaryNodeRule=o||jsts.algorithm.BoundaryNodeRule.OGC_SFS_BOUNDARY_RULE,null!==e&&this.add(e)},jsts.geomgraph.GeometryGraph.prototype=new jsts.geomgraph.PlanarGraph,jsts.geomgraph.GeometryGraph.constructor=jsts.geomgraph.GeometryGraph,jsts.geomgraph.GeometryGraph.prototype.createEdgeSetIntersector=function(){return new jsts.geomgraph.index.SimpleMCSweepLineIntersector},jsts.geomgraph.GeometryGraph.determineBoundary=function(e,o){return e.isInBoundary(o)?t.BOUNDARY:t.INTERIOR},jsts.geomgraph.GeometryGraph.prototype.parentGeom=null,jsts.geomgraph.GeometryGraph.prototype.lineEdgeMap=null,jsts.geomgraph.GeometryGraph.prototype.boundaryNodeRule=null,jsts.geomgraph.GeometryGraph.prototype.useBoundaryDeterminationRule=!0,jsts.geomgraph.GeometryGraph.prototype.argIndex=null,jsts.geomgraph.GeometryGraph.prototype.boundaryNodes=null,jsts.geomgraph.GeometryGraph.prototype.hasTooFewPoints=!1,jsts.geomgraph.GeometryGraph.prototype.invalidPoint=null,jsts.geomgraph.GeometryGraph.prototype.areaPtLocator=null,jsts.geomgraph.GeometryGraph.prototype.ptLocator=null,jsts.geomgraph.GeometryGraph.prototype.getGeometry=function(){return this.parentGeom},jsts.geomgraph.GeometryGraph.prototype.getBoundaryNodes=function(){return null===this.boundaryNodes&&(this.boundaryNodes=this.nodes.getBoundaryNodes(this.argIndex)),this.boundaryNodes},jsts.geomgraph.GeometryGraph.prototype.getBoundaryNodeRule=function(){return this.boundaryNodeRule},jsts.geomgraph.GeometryGraph.prototype.findEdge=function(t){return this.lineEdgeMap.get(t)},jsts.geomgraph.GeometryGraph.prototype.computeSplitEdges=function(t){for(var e=this.edges.iterator();e.hasNext();){var o=e.next();o.eiList.addSplitEdges(t)}},jsts.geomgraph.GeometryGraph.prototype.add=function(t){if(!t.isEmpty())if(t instanceof jsts.geom.MultiPolygon&&(this.useBoundaryDeterminationRule=!1),t instanceof jsts.geom.Polygon)this.addPolygon(t);else if(t instanceof jsts.geom.LineString)this.addLineString(t);else if(t instanceof jsts.geom.Point)this.addPoint(t);else if(t instanceof jsts.geom.MultiPoint)this.addCollection(t);else if(t instanceof jsts.geom.MultiLineString)this.addCollection(t);else if(t instanceof jsts.geom.MultiPolygon)this.addCollection(t);else{if(!(t instanceof jsts.geom.GeometryCollection))throw new jsts.error.IllegalArgumentError("Geometry type not supported.");this.addCollection(t)}},jsts.geomgraph.GeometryGraph.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var o=t.getGeometryN(e);this.add(o)}},jsts.geomgraph.GeometryGraph.prototype.addEdge=function(e){this.insertEdge(e);var o=e.getCoordinates();this.insertPoint(this.argIndex,o[0],t.BOUNDARY),this.insertPoint(this.argIndex,o[o.length-1],t.BOUNDARY)},jsts.geomgraph.GeometryGraph.prototype.addPoint=function(e){var o=e.getCoordinate();this.insertPoint(this.argIndex,o,t.INTERIOR)},jsts.geomgraph.GeometryGraph.prototype.addLineString=function(e){var n=jsts.geom.CoordinateArrays.removeRepeatedPoints(e.getCoordinates());if(n.length<2)return this.hasTooFewPoints=!0,void(this.invalidPoint=coords[0]);var r=new jsts.geomgraph.Edge(n,new jsts.geomgraph.Label(this.argIndex,t.INTERIOR));this.lineEdgeMap.put(e,r),this.insertEdge(r),o.isTrue(n.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this.argIndex,n[0]),this.insertBoundaryPoint(this.argIndex,n[n.length-1])},jsts.geomgraph.GeometryGraph.prototype.addPolygonRing=function(e,o,n){if(!e.isEmpty()){var r=jsts.geom.CoordinateArrays.removeRepeatedPoints(e.getCoordinates());if(r.length<4)return this.hasTooFewPoints=!0,void(this.invalidPoint=r[0]);var i=o,s=n;jsts.algorithm.CGAlgorithms.isCCW(r)&&(i=n,s=o);var a=new jsts.geomgraph.Edge(r,new jsts.geomgraph.Label(this.argIndex,t.BOUNDARY,i,s));this.lineEdgeMap.put(e,a),this.insertEdge(a),this.insertPoint(this.argIndex,r[0],t.BOUNDARY)}},jsts.geomgraph.GeometryGraph.prototype.addPolygon=function(e){this.addPolygonRing(e.getExteriorRing(),t.EXTERIOR,t.INTERIOR);for(var o=0;o<e.getNumInteriorRing();o++){var n=e.getInteriorRingN(o);this.addPolygonRing(n,t.INTERIOR,t.EXTERIOR)}},jsts.geomgraph.GeometryGraph.prototype.computeEdgeIntersections=function(t,e,o){var n=new jsts.geomgraph.index.SegmentIntersector(e,o,!0);n.setBoundaryNodes(this.getBoundaryNodes(),t.getBoundaryNodes());var r=this.createEdgeSetIntersector();return r.computeIntersections(this.edges,t.edges,n),n},jsts.geomgraph.GeometryGraph.prototype.computeSelfNodes=function(t,e){var o=new jsts.geomgraph.index.SegmentIntersector(t,!0,!1),n=this.createEdgeSetIntersector();return!e&&(this.parentGeom instanceof jsts.geom.LinearRing||this.parentGeom instanceof jsts.geom.Polygon||this.parentGeom instanceof jsts.geom.MultiPolygon)?n.computeIntersections(this.edges,o,!1):n.computeIntersections(this.edges,o,!0),this.addSelfIntersectionNodes(this.argIndex),o},jsts.geomgraph.GeometryGraph.prototype.insertPoint=function(t,e,o){var n=this.nodes.addNode(e),r=n.getLabel();null==r?n.label=new jsts.geomgraph.Label(t,o):r.setLocation(t,o)},jsts.geomgraph.GeometryGraph.prototype.insertBoundaryPoint=function(o,n){var r=this.nodes.addNode(n),i=r.getLabel(),s=1,a=t.NONE;null!==i&&(a=i.getLocation(o,e.ON)),a===t.BOUNDARY&&s++;var u=jsts.geomgraph.GeometryGraph.determineBoundary(this.boundaryNodeRule,s);i.setLocation(o,u)},jsts.geomgraph.GeometryGraph.prototype.addSelfIntersectionNodes=function(t){for(var e=this.edges.iterator();e.hasNext();)for(var o=e.next(),n=o.getLabel().getLocation(t),r=o.eiList.iterator();r.hasNext();){var i=r.next();this.addSelfIntersectionNode(t,i.coord,n)}},jsts.geomgraph.GeometryGraph.prototype.addSelfIntersectionNode=function(e,o,n){this.isBoundaryNode(e,o)||(n===t.BOUNDARY&&this.useBoundaryDeterminationRule?this.insertBoundaryPoint(e,o):this.insertPoint(e,o,n))},jsts.geomgraph.GeometryGraph.prototype.getInvalidPoint=function(){return this.invalidPoint}}(),jsts.operation.buffer.OffsetSegmentString=function(){this.ptList=[]},jsts.operation.buffer.OffsetSegmentString.prototype.ptList=null,jsts.operation.buffer.OffsetSegmentString.prototype.precisionModel=null,jsts.operation.buffer.OffsetSegmentString.prototype.minimimVertexDistance=0,jsts.operation.buffer.OffsetSegmentString.prototype.setPrecisionModel=function(t){this.precisionModel=t},jsts.operation.buffer.OffsetSegmentString.prototype.setMinimumVertexDistance=function(t){this.minimimVertexDistance=t},jsts.operation.buffer.OffsetSegmentString.prototype.addPt=function(t){var e=new jsts.geom.Coordinate(t);this.precisionModel.makePrecise(e),this.isRedundant(e)||this.ptList.push(e)},jsts.operation.buffer.OffsetSegmentString.prototype.addPts=function(t,e){if(e)for(var o=0;o<t.length;o++)this.addPt(t[o]);else for(var o=t.length-1;o>=0;o--)this.addPt(t[o])},jsts.operation.buffer.OffsetSegmentString.prototype.isRedundant=function(t){if(this.ptList.length<1)return!1;var e=this.ptList[this.ptList.length-1],o=t.distance(e);return o<this.minimimVertexDistance?!0:!1},jsts.operation.buffer.OffsetSegmentString.prototype.closeRing=function(){if(!(this.ptList.length<1)){var t=new jsts.geom.Coordinate(this.ptList[0]),e=this.ptList[this.ptList.length-1],o=null;this.ptList.length>=2&&(o=this.ptList[this.ptList.length-2]),t.equals(e)||this.ptList.push(t)}},jsts.operation.buffer.OffsetSegmentString.prototype.reverse=function(){},jsts.operation.buffer.OffsetSegmentString.prototype.getCoordinates=function(){return this.ptList},jsts.algorithm.distance.PointPairDistance=function(){this.pt=[new jsts.geom.Coordinate,new jsts.geom.Coordinate]},jsts.algorithm.distance.PointPairDistance.prototype.pt=null,jsts.algorithm.distance.PointPairDistance.prototype.distance=0/0,jsts.algorithm.distance.PointPairDistance.prototype.isNull=!0,jsts.algorithm.distance.PointPairDistance.prototype.initialize=function(t,e,o){return void 0===t?void(this.isNull=!0):(this.pt[0].setCoordinate(t),this.pt[1].setCoordinate(e),this.distance=void 0!==o?o:t.distance(e),void(this.isNull=!1))},jsts.algorithm.distance.PointPairDistance.prototype.getDistance=function(){return this.distance},jsts.algorithm.distance.PointPairDistance.prototype.getCoordinates=function(){return this.pt},jsts.algorithm.distance.PointPairDistance.prototype.getCoordinate=function(t){return this.pt[t]},jsts.algorithm.distance.PointPairDistance.prototype.setMaximum=function(t){return 2===arguments.length?void this.setMaximum2.apply(this,arguments):void this.setMaximum(t.pt[0],t.pt[1])},jsts.algorithm.distance.PointPairDistance.prototype.setMaximum2=function(t,e){if(this.isNull)return void this.initialize(t,e);var o=t.distance(e);o>this.distance&&this.initialize(t,e,o)},jsts.algorithm.distance.PointPairDistance.prototype.setMinimum=function(t){return 2===arguments.length?void this.setMinimum2.apply(this,arguments):void this.setMinimum(t.pt[0],t.pt[1])},jsts.algorithm.distance.PointPairDistance.prototype.setMinimum2=function(t,e){if(this.isNull)return void this.initialize(t,e);var o=t.distance(e);o<this.distance&&this.initialize(t,e,o)},function(){var t=jsts.algorithm.distance.PointPairDistance,e=jsts.algorithm.distance.DistanceToPoint,o=function(o){this.maxPtDist=new t,this.minPtDist=new t,this.euclideanDist=new e,this.geom=o};o.prototype=new jsts.geom.CoordinateFilter,o.prototype.maxPtDist=new t,o.prototype.minPtDist=new t,o.prototype.euclideanDist=new e,o.prototype.geom,o.prototype.filter=function(t){this.minPtDist.initialize(),e.computeDistance(this.geom,t,this.minPtDist),this.maxPtDist.setMaximum(this.minPtDist)},o.prototype.getMaxPointDistance=function(){return this.maxPtDist};var n=function(e,o){this.maxPtDist=new t,this.minPtDist=new t,this.geom=e,this.numSubSegs=Math.round(1/o)
};n.prototype=new jsts.geom.CoordinateSequenceFilter,n.prototype.maxPtDist=new t,n.prototype.minPtDist=new t,n.prototype.geom,n.prototype.numSubSegs=0,n.prototype.filter=function(t,o){if(0!=o)for(var n=t[o-1],r=t[o],i=(r.x-n.x)/this.numSubSegs,s=(r.y-n.y)/this.numSubSegs,a=0;a<this.numSubSegs;a++){var u=n.x+a*i,p=n.y+a*s,g=new jsts.geom.Coordinate(u,p);this.minPtDist.initialize(),e.computeDistance(this.geom,g,this.minPtDist),this.maxPtDist.setMaximum(this.minPtDist)}},n.prototype.isGeometryChanged=function(){return!1},n.prototype.isDone=function(){return!1},n.prototype.getMaxPointDistance=function(){return this.maxPtDist},jsts.algorithm.distance.DiscreteHausdorffDistance=function(t,e){this.g0=t,this.g1=e,this.ptDist=new jsts.algorithm.distance.PointPairDistance},jsts.algorithm.distance.DiscreteHausdorffDistance.prototype.g0=null,jsts.algorithm.distance.DiscreteHausdorffDistance.prototype.g1=null,jsts.algorithm.distance.DiscreteHausdorffDistance.prototype.ptDist=null,jsts.algorithm.distance.DiscreteHausdorffDistance.prototype.densifyFrac=0,jsts.algorithm.distance.DiscreteHausdorffDistance.distance=function(t,e,o){var n=new jsts.algorithm.distance.DiscreteHausdorffDistance(t,e);return void 0!==o&&n.setDensifyFraction(o),n.distance()},jsts.algorithm.distance.DiscreteHausdorffDistance.prototype.setDensifyFraction=function(t){if(t>1||0>=t)throw new jsts.error.IllegalArgumentError("Fraction is not in range (0.0 - 1.0]");this.densifyFrac=t},jsts.algorithm.distance.DiscreteHausdorffDistance.prototype.distance=function(){return this.compute(this.g0,this.g1),ptDist.getDistance()},jsts.algorithm.distance.DiscreteHausdorffDistance.prototype.orientedDistance=function(){return this.computeOrientedDistance(this.g0,this.g1,this.ptDist),this.ptDist.getDistance()},jsts.algorithm.distance.DiscreteHausdorffDistance.prototype.getCoordinates=function(){return ptDist.getCoordinates()},jsts.algorithm.distance.DiscreteHausdorffDistance.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this.ptDist),this.computeOrientedDistance(e,t,this.ptDist)},jsts.algorithm.distance.DiscreteHausdorffDistance.prototype.computeOrientedDistance=function(t,e,r){var i=new o(e);if(t.apply(i),r.setMaximum(i.getMaxPointDistance()),this.densifyFrac>0){var s=new n(e,this.densifyFrac);t.apply(s),r.setMaximum(s.getMaxPointDistance())}}}(),jsts.algorithm.MinimumBoundingCircle=function(t){this.input=null,this.extremalPts=null,this.centre=null,this.radius=0,this.input=t},jsts.algorithm.MinimumBoundingCircle.prototype.getCircle=function(){if(this.compute(),null===this.centre)return this.input.getFactory().createPolygon(null,null);var t=this.input.getFactory().createPoint(this.centre);return 0===this.radius?t:t.buffer(this.radius)},jsts.algorithm.MinimumBoundingCircle.prototype.getExtremalPoints=function(){return this.compute(),this.extremalPts},jsts.algorithm.MinimumBoundingCircle.prototype.getCentre=function(){return this.compute(),this.centre},jsts.algorithm.MinimumBoundingCircle.prototype.getRadius=function(){return this.compute(),this.radius},jsts.algorithm.MinimumBoundingCircle.prototype.computeCentre=function(){switch(this.extremalPts.length){case 0:this.centre=null;break;case 1:this.centre=this.extremalPts[0];break;case 2:this.centre=new jsts.geom.Coordinate((this.extremalPts[0].x+this.extremalPts[1].x)/2,(this.extremalPts[0].y+this.extremalPts[1].y)/2);break;case 3:this.centre=jsts.geom.Triangle.circumcentre(this.extremalPts[0],this.extremalPts[1],this.extremalPts[2])}},jsts.algorithm.MinimumBoundingCircle.prototype.compute=function(){null===this.extremalPts&&(this.computeCirclePoints(),this.computeCentre(),null!==this.centre&&(this.radius=this.centre.distance(this.extremalPts[0])))},jsts.algorithm.MinimumBoundingCircle.prototype.computeCirclePoints=function(){if(this.input.isEmpty())return void(this.extremalPts=[]);var t;if(1===this.input.getNumPoints())return t=this.input.getCoordinates(),void(this.extremalPts=[new jsts.geom.Coordinate(t[0])]);var e=this.input.convexHull(),o=e.getCoordinates();if(t=o,o[0].equals2D(o[o.length-1])&&(t=[],jsts.geom.CoordinateArrays.copyDeep(o,0,t,0,o.length-1)),t.length<=2)return void(this.extremalPts=jsts.geom.CoordinateArrays.copyDeep(t));for(var n=jsts.algorithm.MinimumBoundingCircle.lowestPoint(t),r=jsts.algorithm.MinimumBoundingCircle.pointWitMinAngleWithX(t,n),i=0;i<t.length;i++){var s=jsts.algorithm.MinimumBoundingCircle.pointWithMinAngleWithSegment(t,n,r);if(jsts.algorithm.Angle.isObtuse(n,s,r))return void(this.extremalPts=[new jsts.geom.Coordinate(n),new jsts.geom.Coordinate(r)]);if(jsts.algorithm.Angle.isObtuse(s,n,r))n=s;else{if(!jsts.algorithm.Angle.isObtuse(s,r,n))return void(this.extremalPts=[new jsts.geom.Coordinate(n),new jsts.geom.Coordinate(r),new jsts.geom.Coordinate(s)]);r=s}}throw new Error("Logic failure in Minimum Bounding Circle algorithm!")},jsts.algorithm.MinimumBoundingCircle.lowestPoint=function(t){for(var e=t[0],o=1;o<t.length;o++)t[o].y<e.y&&(e=t[o]);return e},jsts.algorithm.MinimumBoundingCircle.pointWitMinAngleWithX=function(t,e){for(var o=Number.MAX_VALUE,n=null,r=0;r<t.length;r++){var i=t[r];if(i!==e){var s=i.x-e.x,a=i.y-e.y;0>a&&(a=-a);var u=Math.sqrt(s*s+a*a),p=a/u;o>p&&(o=p,n=i)}}return n},jsts.algorithm.MinimumBoundingCircle.pointWithMinAngleWithSegment=function(t,e,o){for(var n=Number.MAX_VALUE,r=null,i=0;i<t.length;i++){var s=t[i];if(s!==e&&s!==o){var a=jsts.algorithm.Angle.angleBetween(e,s,o);n>a&&(n=a,r=s)}}return r},jsts.noding.ScaledNoder=function(t,e,o,n){this.offsetX=o?o:0,this.offsetY=n?n:0,this.noder=t,this.scaleFactor=e,this.isScaled=!this.isIntegerPrecision()},jsts.noding.ScaledNoder.prototype=new jsts.noding.Noder,jsts.noding.ScaledNoder.constructor=jsts.noding.ScaledNoder,jsts.noding.ScaledNoder.prototype.noder=null,jsts.noding.ScaledNoder.prototype.scaleFactor=void 0,jsts.noding.ScaledNoder.prototype.offsetX=void 0,jsts.noding.ScaledNoder.prototype.offsetY=void 0,jsts.noding.ScaledNoder.prototype.isScaled=!1,jsts.noding.ScaledNoder.prototype.isIntegerPrecision=function(){return 1===this.scaleFactor},jsts.noding.ScaledNoder.prototype.getNodedSubstrings=function(){var t=this.noder.getNodedSubstrings();return this.isScaled&&this.rescale(t),t},jsts.noding.ScaledNoder.prototype.computeNodes=function(t){var e=t;this.isScaled&&(e=this.scale(t)),this.noder.computeNodes(e)},jsts.noding.ScaledNoder.prototype.scale=function(t){if(t instanceof Array)return this.scale2(t);for(var e=new javascript.util.ArrayList,o=t.iterator();o.hasNext();){var n=o.next();e.add(new jsts.noding.NodedSegmentString(this.scale(n.getCoordinates()),n.getData()))}return e},jsts.noding.ScaledNoder.prototype.scale2=function(t){for(var e=[],o=0;o<t.length;o++)e[o]=new jsts.geom.Coordinate(Math.round((t[o].x-this.offsetX)*this.scaleFactor),Math.round((t[o].y-this.offsetY)*this.scaleFactor));var n=jsts.geom.CoordinateArrays.removeRepeatedPoints(e);return n},jsts.noding.ScaledNoder.prototype.rescale=function(t){if(t instanceof Array)return void this.rescale2(t);for(var e=t.iterator();e.hasNext();){var o=e.next();this.rescale(o.getCoordinates())}},jsts.noding.ScaledNoder.prototype.rescale2=function(t){for(var e=0;e<t.length;e++)t[e].x=t[e].x/this.scaleFactor+this.offsetX,t[e].y=t[e].y/this.scaleFactor+this.offsetY},function(){javascript.util.ArrayList;jsts.geomgraph.index.SegmentIntersector=function(t,e,o){this.li=t,this.includeProper=e,this.recordIsolated=o},jsts.geomgraph.index.SegmentIntersector.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)},jsts.geomgraph.index.SegmentIntersector.prototype._hasIntersection=!1,jsts.geomgraph.index.SegmentIntersector.prototype.hasProper=!1,jsts.geomgraph.index.SegmentIntersector.prototype.hasProperInterior=!1,jsts.geomgraph.index.SegmentIntersector.prototype.properIntersectionPoint=null,jsts.geomgraph.index.SegmentIntersector.prototype.li=null,jsts.geomgraph.index.SegmentIntersector.prototype.includeProper=null,jsts.geomgraph.index.SegmentIntersector.prototype.recordIsolated=null,jsts.geomgraph.index.SegmentIntersector.prototype.isSelfIntersection=null,jsts.geomgraph.index.SegmentIntersector.prototype.numIntersections=0,jsts.geomgraph.index.SegmentIntersector.prototype.numTests=0,jsts.geomgraph.index.SegmentIntersector.prototype.bdyNodes=null,jsts.geomgraph.index.SegmentIntersector.prototype.setBoundaryNodes=function(t,e){this.bdyNodes=[],this.bdyNodes[0]=t,this.bdyNodes[1]=e},jsts.geomgraph.index.SegmentIntersector.prototype.getProperIntersectionPoint=function(){return this.properIntersectionPoint},jsts.geomgraph.index.SegmentIntersector.prototype.hasIntersection=function(){return this._hasIntersection},jsts.geomgraph.index.SegmentIntersector.prototype.hasProperIntersection=function(){return this.hasProper},jsts.geomgraph.index.SegmentIntersector.prototype.hasProperInteriorIntersection=function(){return this.hasProperInterior},jsts.geomgraph.index.SegmentIntersector.prototype.isTrivialIntersection=function(t,e,o,n){if(t===o&&1===this.li.getIntersectionNum()){if(jsts.geomgraph.index.SegmentIntersector.isAdjacentSegments(e,n))return!0;if(t.isClosed()){var r=t.getNumPoints()-1;if(0===e&&n===r||0===n&&e===r)return!0}}return!1},jsts.geomgraph.index.SegmentIntersector.prototype.addIntersections=function(t,e,o,n){if(t!==o||e!==n){this.numTests++;var r=t.getCoordinates()[e],i=t.getCoordinates()[e+1],s=o.getCoordinates()[n],a=o.getCoordinates()[n+1];this.li.computeIntersection(r,i,s,a),this.li.hasIntersection()&&(this.recordIsolated&&(t.setIsolated(!1),o.setIsolated(!1)),this.numIntersections++,this.isTrivialIntersection(t,e,o,n)||(this._hasIntersection=!0,(this.includeProper||!this.li.isProper())&&(t.addIntersections(this.li,e,0),o.addIntersections(this.li,n,1)),this.li.isProper()&&(this.properIntersectionPoint=this.li.getIntersection(0).clone(),this.hasProper=!0,this.isBoundaryPoint(this.li,this.bdyNodes)||(this.hasProperInterior=!0))))}},jsts.geomgraph.index.SegmentIntersector.prototype.isBoundaryPoint=function(t,e){if(null===e)return!1;if(e instanceof Array)return this.isBoundaryPoint(t,e[0])?!0:this.isBoundaryPoint(t,e[1])?!0:!1;for(var o=e.iterator();o.hasNext();){var n=o.next(),r=n.getCoordinate();if(t.isIntersection(r))return!0}return!1}}()},{}],38:[function(){(function(t){(function(){function e(t,e){var o=t.split("."),n=O;o[0]in n||!n.execScript||n.execScript("var "+o[0]);for(var r;o.length&&(r=o.shift());)o.length||void 0===e?n=n[r]?n[r]:n[r]={}:n[r]=e}function o(t,e){function o(){}o.prototype=e.prototype,t.q=e.prototype,t.prototype=new o,t.prototype.constructor=t,t.p=function(t,o){var n=Array.prototype.slice.call(arguments,2);return e.prototype[o].apply(t,n)}}function n(t){this.message=t||""}function r(t){this.message=t||""}function i(){}function s(){}function a(){}function u(){}function p(t){this.message=t||""}function g(t){this.message=t||""}function l(t){this.a=[],t instanceof s&&this.e(t)}function h(t){this.j=t}function d(){}function c(){this.i={}}function m(){}function f(t){this.a=[],t instanceof s&&this.e(t)}function y(t){this.k=t}function j(){}function v(){}function x(){this.a=[]}function E(t){return null==t?null:t.parent}function I(t,e){null!==t&&(t.color=e)}function S(t){return null==t?null:t.left}function L(t){return null==t?null:t.right}function C(){this.d=null,this.n=0}function N(t,e){if(null!=e){var o=e.right;e.right=o.left,null!=o.left&&(o.left.parent=e),o.parent=e.parent,null==e.parent?t.d=o:e.parent.left==e?e.parent.left=o:e.parent.right=o,o.left=e,e.parent=o}}function b(t,e){if(null!=e){var o=e.left;e.left=o.right,null!=o.right&&(o.right.parent=e),o.parent=e.parent,null==e.parent?t.d=o:e.parent.right==e?e.parent.right=o:e.parent.left=o,o.right=e,e.parent=o}}function P(t){if(null===t)return null;if(null!==t.right)for(var e=t.right;null!==e.left;)e=e.left;else for(e=t.parent;null!==e&&t===e.right;)t=e,e=e.parent;return e}function R(t){this.a=[],t instanceof s&&this.e(t)}function w(t){this.l=t}var O=this;o(n,Error),e("javascript.util.EmptyStackException",n),n.prototype.name="EmptyStackException",o(r,Error),e("javascript.util.IndexOutOfBoundsException",r),r.prototype.name="IndexOutOfBoundsException",e("javascript.util.Iterator",i),i.prototype.hasNext=i.prototype.c,i.prototype.next=i.prototype.next,i.prototype.remove=i.prototype.remove,e("javascript.util.Collection",s),o(a,s),e("javascript.util.List",a),e("javascript.util.Map",u),o(p,Error),e("javascript.util.NoSuchElementException",p),p.prototype.name="NoSuchElementException",o(g,Error),g.prototype.name="OperationNotSupported",o(l,a),e("javascript.util.ArrayList",l),l.prototype.a=null,l.prototype.add=function(t){return this.a.push(t),!0},l.prototype.add=l.prototype.add,l.prototype.e=function(t){for(t=t.f();t.c();)this.add(t.next());return!0},l.prototype.addAll=l.prototype.e,l.prototype.set=function(t,e){var o=this.a[t];return this.a[t]=e,o},l.prototype.set=l.prototype.set,l.prototype.f=function(){return new h(this)},l.prototype.iterator=l.prototype.f,l.prototype.get=function(t){if(0>t||t>=this.size())throw new r;return this.a[t]},l.prototype.get=l.prototype.get,l.prototype.g=function(){return 0===this.a.length},l.prototype.isEmpty=l.prototype.g,l.prototype.size=function(){return this.a.length},l.prototype.size=l.prototype.size,l.prototype.h=function(){for(var t=[],e=0,o=this.a.length;o>e;e++)t.push(this.a[e]);return t},l.prototype.toArray=l.prototype.h,l.prototype.remove=function(t){for(var e=!1,o=0,n=this.a.length;n>o;o++)if(this.a[o]===t){this.a.splice(o,1),e=!0;break}return e},l.prototype.remove=l.prototype.remove,e("$jscomp.scope.Iterator_",h),h.prototype.j=null,h.prototype.b=0,h.prototype.next=function(){if(this.b===this.j.size())throw new p;return this.j.get(this.b++)},h.prototype.next=h.prototype.next,h.prototype.c=function(){return this.b<this.j.size()?!0:!1},h.prototype.hasNext=h.prototype.c,h.prototype.remove=function(){throw new g},h.prototype.remove=h.prototype.remove,e("javascript.util.Arrays",d),d.sort=function(){var t,e,o,n=arguments[0];if(1===arguments.length)n.sort();else if(2===arguments.length)e=arguments[1],o=function(t,o){return e.compare(t,o)},n.sort(o);else if(3===arguments.length)for(t=n.slice(arguments[1],arguments[2]),t.sort(),o=n.slice(0,arguments[1]).concat(t,n.slice(arguments[2],n.length)),n.splice(0,n.length),t=0;t<o.length;t++)n.push(o[t]);else if(4===arguments.length)for(t=n.slice(arguments[1],arguments[2]),e=arguments[3],o=function(t,o){return e.compare(t,o)},t.sort(o),o=n.slice(0,arguments[1]).concat(t,n.slice(arguments[2],n.length)),n.splice(0,n.length),t=0;t<o.length;t++)n.push(o[t])},d.asList=function(t){for(var e=new l,o=0,n=t.length;n>o;o++)e.add(t[o]);return e},o(c,u),e("javascript.util.HashMap",c),c.prototype.i=null,c.prototype.get=function(t){return this.i[t]||null},c.prototype.get=c.prototype.get,c.prototype.put=function(t,e){return this.i[t]=e},c.prototype.put=c.prototype.put,c.prototype.m=function(){var t,e=new l;for(t in this.i)this.i.hasOwnProperty(t)&&e.add(this.i[t]);return e},c.prototype.values=c.prototype.m,c.prototype.size=function(){return this.m().size()},c.prototype.size=c.prototype.size,o(m,s),e("javascript.util.Set",m),o(f,m),e("javascript.util.HashSet",f),f.prototype.a=null,f.prototype.contains=function(t){for(var e=0,o=this.a.length;o>e;e++)if(this.a[e]===t)return!0;return!1},f.prototype.contains=f.prototype.contains,f.prototype.add=function(t){return this.contains(t)?!1:(this.a.push(t),!0)},f.prototype.add=f.prototype.add,f.prototype.e=function(t){for(t=t.f();t.c();)this.add(t.next());return!0},f.prototype.addAll=f.prototype.e,f.prototype.remove=function(){throw new g},f.prototype.remove=f.prototype.remove,f.prototype.size=function(){return this.a.length},f.prototype.g=function(){return 0===this.a.length},f.prototype.isEmpty=f.prototype.g,f.prototype.h=function(){for(var t=[],e=0,o=this.a.length;o>e;e++)t.push(this.a[e]);return t},f.prototype.toArray=f.prototype.h,f.prototype.f=function(){return new y(this)},f.prototype.iterator=f.prototype.f,e("$jscomp.scope.Iterator_$1",y),y.prototype.k=null,y.prototype.b=0,y.prototype.next=function(){if(this.b===this.k.size())throw new p;return this.k.a[this.b++]},y.prototype.next=y.prototype.next,y.prototype.c=function(){return this.b<this.k.size()?!0:!1},y.prototype.hasNext=y.prototype.c,y.prototype.remove=function(){throw new g},y.prototype.remove=y.prototype.remove,o(j,u),e("javascript.util.SortedMap",j),o(v,m),e("javascript.util.SortedSet",v),o(x,a),e("javascript.util.Stack",x),x.prototype.a=null,x.prototype.push=function(t){return this.a.push(t),t},x.prototype.push=x.prototype.push,x.prototype.pop=function(){if(0===this.a.length)throw new n;return this.a.pop()},x.prototype.pop=x.prototype.pop,x.prototype.o=function(){if(0===this.a.length)throw new n;return this.a[this.a.length-1]},x.prototype.peek=x.prototype.o,x.prototype.empty=function(){return 0===this.a.length?!0:!1},x.prototype.empty=x.prototype.empty,x.prototype.g=function(){return this.empty()},x.prototype.isEmpty=x.prototype.g,x.prototype.search=function(t){return this.a.indexOf(t)},x.prototype.search=x.prototype.search,x.prototype.size=function(){return this.a.length},x.prototype.size=x.prototype.size,x.prototype.h=function(){for(var t=[],e=0,o=this.a.length;o>e;e++)t.push(this.a[e]);return t},x.prototype.toArray=x.prototype.h,o(C,j),e("javascript.util.TreeMap",C),C.prototype.get=function(t){for(var e=this.d;null!==e;){var o=t.compareTo(e.key);if(0>o)e=e.left;else{if(!(o>0))return e.value;e=e.right}}return null},C.prototype.get=C.prototype.get,C.prototype.put=function(t,e){if(null===this.d)return this.d={key:t,value:e,left:null,right:null,parent:null,color:0},this.n=1,null;var o,n,r=this.d;do if(o=r,n=t.compareTo(r.key),0>n)r=r.left;else{if(!(n>0))return o=r.value,r.value=e,o;r=r.right}while(null!==r);for(r={key:t,left:null,right:null,value:e,parent:o,color:0},0>n?o.left=r:o.right=r,r.color=1;null!=r&&r!=this.d&&1==r.parent.color;)E(r)==S(E(E(r)))?(o=L(E(E(r))),1==(null==o?0:o.color)?(I(E(r),0),I(o,0),I(E(E(r)),1),r=E(E(r))):(r==L(E(r))&&(r=E(r),N(this,r)),I(E(r),0),I(E(E(r)),1),b(this,E(E(r))))):(o=S(E(E(r))),1==(null==o?0:o.color)?(I(E(r),0),I(o,0),I(E(E(r)),1),r=E(E(r))):(r==S(E(r))&&(r=E(r),b(this,r)),I(E(r),0),I(E(E(r)),1),N(this,E(E(r)))));return this.d.color=0,this.n++,null},C.prototype.put=C.prototype.put,C.prototype.m=function(){var t,e=new l;if(t=this.d,null!=t)for(;null!=t.left;)t=t.left;if(null!==t)for(e.add(t.value);null!==(t=P(t));)e.add(t.value);return e},C.prototype.values=C.prototype.m,C.prototype.size=function(){return this.n},C.prototype.size=C.prototype.size,o(R,v),e("javascript.util.TreeSet",R),R.prototype.a=null,R.prototype.contains=function(t){for(var e=0,o=this.a.length;o>e;e++)if(0===this.a[e].compareTo(t))return!0;return!1},R.prototype.contains=R.prototype.contains,R.prototype.add=function(t){if(this.contains(t))return!1;for(var e=0,o=this.a.length;o>e;e++)if(1===this.a[e].compareTo(t))return this.a.splice(e,0,t),!0;return this.a.push(t),!0},R.prototype.add=R.prototype.add,R.prototype.e=function(t){for(t=t.f();t.c();)this.add(t.next());return!0},R.prototype.addAll=R.prototype.e,R.prototype.remove=function(){throw new g},R.prototype.remove=R.prototype.remove,R.prototype.size=function(){return this.a.length},R.prototype.size=R.prototype.size,R.prototype.g=function(){return 0===this.a.length},R.prototype.isEmpty=R.prototype.g,R.prototype.h=function(){for(var t=[],e=0,o=this.a.length;o>e;e++)t.push(this.a[e]);return t},R.prototype.toArray=R.prototype.h,R.prototype.f=function(){return new w(this)},R.prototype.iterator=R.prototype.f,e("$jscomp.scope.Iterator_$2",w),w.prototype.l=null,w.prototype.b=0,w.prototype.next=function(){if(this.b===this.l.size())throw new p;return this.l.a[this.b++]},w.prototype.next=w.prototype.next,w.prototype.c=function(){return this.b<this.l.size()?!0:!1},w.prototype.hasNext=w.prototype.c,w.prototype.remove=function(){throw new g},w.prototype.remove=w.prototype.remove,"undefined"!=typeof t&&(t.javascript={},t.javascript.util={},t.javascript.util.ArrayList=l,t.javascript.util.Arrays=d,t.javascript.util.Collection=s,t.javascript.util.EmptyStackException=n,t.javascript.util.HashMap=c,t.javascript.util.HashSet=f,t.javascript.util.IndexOutOfBoundsException=r,t.javascript.util.Iterator=i,t.javascript.util.List=a,t.javascript.util.Map=u,t.javascript.util.NoSuchElementException=p,t.javascript.util.OperationNotSupported=g,t.javascript.util.Set=m,t.javascript.util.SortedMap=j,t.javascript.util.SortedSet=v,t.javascript.util.Stack=x,t.javascript.util.TreeMap=C,t.javascript.util.TreeSet=R)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],39:[function(t){t("./dist/javascript.util-node.min.js")},{"./dist/javascript.util-node.min.js":38}],40:[function(t,e){var o=t("turf-extent");e.exports=function(t){var e=o(t),n=(e[0]+e[2])/2,r=(e[1]+e[3])/2,i={type:"Feature",geometry:{type:"Point",coordinates:[n,r]}};return i}},{"turf-extent":65}],41:[function(t,e){var o=t("turf-explode"),n=t("turf-point");e.exports=function(t){for(var e=o(t).features,r=0,i=0,s=e.length,a=0;s>a;a++)r+=e[a].geometry.coordinates[0],i+=e[a].geometry.coordinates[1];return n(r/s,i/s)}},{"turf-explode":61,"turf-point":114}],42:[function(t,e){function o(t){return t.map(function(t){return t.coordinates})}e.exports=function(t){var e=t.features[0].geometry.type,n=t.features.map(function(t){return t.geometry});switch(e){case"Point":var r={type:"Feature",geometry:{type:"MultiPoint",coordinates:[]}};return r.geometry.coordinates=o(n),r;case"LineString":var i={type:"Feature",geometry:{type:"MultiLineString",coordinates:[]}};return i.geometry.coordinates=o(n),i;case"Polygon":var s={type:"Feature",geometry:{type:"MultiPolygon",coordinates:[]}};return s.geometry.coordinates=o(n),s}}},{}],43:[function(t,e){var o={};o.tin=t("turf-tin"),o.merge=t("turf-merge"),o.distance=t("turf-distance"),o.point=t("turf-point"),e.exports=function(t,e){var r,i;return r=o.tin(t,null),r instanceof Error?r:(i=n(r.features,e),r.features=i,o.merge(r))};var n=function(t,e){return t.filter(function(t){var n=o.point(t.geometry.coordinates[0][0][0],t.geometry.coordinates[0][0][1]),r=o.point(t.geometry.coordinates[0][1][0],t.geometry.coordinates[0][1][1]),i=o.point(t.geometry.coordinates[0][2][0],t.geometry.coordinates[0][2][1]),s=o.distance(n,r,"miles"),a=o.distance(r,i,"miles"),u=o.distance(n,i,"miles");return e>=s&&e>=a&&e>=u})}},{"turf-distance":50,"turf-merge":106,"turf-point":114,"turf-tin":132}],44:[function(t,e){function o(t,e,o){return(e[0]-t[0])*(o[1]-t[1])-(e[1]-t[1])*(o[0]-t[0])}e.exports=function(t){var e=t.features.map(function(t){return t.geometry.coordinates});e.sort(function(t,e){return t[0]==e[0]?t[1]-e[1]:t[0]-e[0]});for(var n=[],r=0;r<e.length;r++){for(;n.length>=2&&o(n[n.length-2],n[n.length-1],e[r])<=0;)n.pop();n.push(e[r])}for(var i=[],r=e.length-1;r>=0;r--){for(;i.length>=2&&o(i[i.length-2],i[i.length-1],e[r])<=0;)i.pop();i.push(e[r])}i.pop(),n.pop();var s=n.concat(i);return s.push(s[0]),{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[s]}}}},{}],45:[function(t,e){var o=t("turf-inside");e.exports=function(t,e,n){return t.features.forEach(function(t){t.properties||(t.properties={});var r=[];e.features.forEach(function(e){o(e,t)&&r.push(1)}),t.properties[n]=r.length}),t}},{"turf-inside":46}],46:[function(t,e){e.exports=t(8)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-aggregate/node_modules/turf-average/node_modules/turf-inside/index.js":8}],47:[function(t,e){function o(t){return t*Math.PI/180}function n(t){return 180*t/Math.PI}var r=t("turf-point");e.exports=function(t,e,i,s){var a=t.geometry.coordinates,u=o(a[0]),p=o(a[1]),g=o(i),l=0;switch(s){case"miles":l=3960;break;case"kilometers":l=6373;break;case"degrees":l=57.2957795;break;case"radians":l=1}var h=Math.asin(Math.sin(p)*Math.cos(e/l)+Math.cos(p)*Math.sin(e/l)*Math.cos(g)),d=u+Math.atan2(Math.sin(g)*Math.sin(e/l)*Math.cos(p),Math.cos(e/l)-Math.sin(p)*Math.sin(h));return r(n(d),n(h))}},{"turf-point":114}],48:[function(t,e){var o=t("simple-statistics"),n=t("turf-inside");e.exports=function(t,e,r,i){return t.features.forEach(function(t){t.properties||(t.properties={});var s=[];e.features.forEach(function(e){n(e,t)&&s.push(e.properties[r])}),t.properties[i]=o.standard_deviation(s)}),t}},{"simple-statistics":49,"turf-inside":73}],49:[function(t,e){!function(){function t(){var t={},e=[];return t.data=function(o){return arguments.length?(e=o.slice(),t):e},t.mb=function(){var t,o,n=e.length;if(1===n)t=0,o=e[0][1];else{for(var r,i,s,a=0,u=0,p=0,g=0,l=0;n>l;l++)r=e[l],i=r[0],s=r[1],a+=i,u+=s,p+=i*i,g+=i*s;t=(n*g-a*u)/(n*p-a*a),o=u/n-t*a/n}return{m:t,b:o}},t.m=function(){return t.mb().m},t.b=function(){return t.mb().b},t.line=function(){var e=t.mb(),o=e.m,n=e.b;return function(t){return n+o*t}},t}function o(t,e){if(t.length<2)return 1;for(var o,n=0,r=0;r<t.length;r++)n+=t[r][1];o=n/t.length;for(var i=0,s=0;s<t.length;s++)i+=Math.pow(o-t[s][1],2);for(var a=0,u=0;u<t.length;u++)a+=Math.pow(t[u][1]-e(t[u][0]),2);return 1-a/i}function n(){var t={},e=0,o={};return t.train=function(t,n){o[n]||(o[n]={});for(var r in t){var i=t[r];void 0===o[n][r]&&(o[n][r]={}),void 0===o[n][r][i]&&(o[n][r][i]=0),o[n][r][t[r]]++}e++},t.score=function(t){var n,r={};for(var i in t){var s=t[i];for(n in o)void 0===r[n]&&(r[n]={}),r[n][i+"_"+s]=o[n][i]?(o[n][i][s]||0)/e:0}var a={};for(n in r)for(var u in r[n])void 0===a[n]&&(a[n]=0),a[n]+=r[n][u];return a},t}function r(t){for(var e=0,o=0;o<t.length;o++)e+=t[o];return e}function i(t){return 0===t.length?null:r(t)/t.length}function s(t){if(0===t.length)return null;for(var e=1,o=0;o<t.length;o++){if(t[o]<=0)return null;e*=t[o]}return Math.pow(e,1/t.length)}function a(t){if(0===t.length)return null;for(var e=0,o=0;o<t.length;o++){if(t[o]<=0)return null;e+=1/t[o]}return t.length/e}function u(t){for(var e,o=0;o<t.length;o++)(t[o]<e||void 0===e)&&(e=t[o]);return e}function p(t){for(var e,o=0;o<t.length;o++)(t[o]>e||void 0===e)&&(e=t[o]);return e}function g(t){if(0===t.length)return null;for(var e=i(t),o=[],n=0;n<t.length;n++)o.push(Math.pow(t[n]-e,2));return i(o)}function l(t){return 0===t.length?null:Math.sqrt(g(t))}function h(t,e){for(var o=i(t),n=0,r=0;r<t.length;r++)n+=Math.pow(t[r]-o,e);return n}function d(t){if(t.length<=1)return null;var e=h(t,2);return e/(t.length-1)}function c(t){return t.length<=1?null:Math.sqrt(d(t))}function m(t,e){if(t.length<=1||t.length!=e.length)return null;for(var o=i(t),n=i(e),r=0,s=0;s<t.length;s++)r+=(t[s]-o)*(e[s]-n);return r/(t.length-1)}function f(t,e){var o=m(t,e),n=c(t),r=c(e);return null===o||null===n||null===r?null:o/n/r}function y(t){if(0===t.length)return null;var e=t.slice().sort(function(t,e){return t-e});if(e.length%2===1)return e[(e.length-1)/2];var o=e[e.length/2-1],n=e[e.length/2];return(o+n)/2}function j(t){if(0===t.length)return null;if(1===t.length)return t[0];for(var e,o=t.slice().sort(function(t,e){return t-e}),n=o[0],r=0,i=1,s=1;s<o.length+1;s++)o[s]!==n?(i>r&&(r=i,e=n),i=1,n=o[s]):i++;return e}function v(t,e){var o=i(t),n=l(t),r=Math.sqrt(t.length);return(o-e)/(n/r)}function x(t,e,o){var n=t.length,r=e.length;if(!n||!r)return null;o||(o=0);var s=i(t),a=i(e),u=((n-1)*d(t)+(r-1)*d(e))/(n+r-2);return(s-a-o)/Math.sqrt(u*(1/n+1/r))}function E(t,e){var o=[];if(0>=e)return null;for(var n=0;n<t.length;n+=e)o.push(t.slice(n,n+e));return o}function I(t,e){e=e||Math.random;for(var o,n,r=t.length;r>0;)n=Math.floor(e()*r--),o=t[r],t[r]=t[n],t[n]=o;return t}function S(t,e){return t=t.slice(),I(t.slice(),e)}function L(t,e,o){var n=S(t,o);return n.slice(0,e)}function C(t,e){if(0===t.length)return null;var o=t.slice().sort(function(t,e){return t-e});if(e.length){for(var n=[],r=0;r<e.length;r++)n[r]=N(o,e[r]);return n}return N(o,e)}function N(t,e){var o=t.length*e;return 0>e||e>1?null:1===e?t[t.length-1]:0===e?t[0]:o%1!==0?t[Math.ceil(o)-1]:t.length%2===0?(t[o-1]+t[o])/2:t[o]}function b(t){return 0===t.length?null:C(t,.75)-C(t,.25)}function P(t){if(!t||0===t.length)return null;for(var e=y(t),o=[],n=0;n<t.length;n++)o.push(Math.abs(t[n]-e));return y(o)}function R(t,e){var o,n,r=[],i=[],s=0;for(o=0;o<t.length+1;o++){var a=[],u=[];for(n=0;e+1>n;n++)a.push(0),u.push(0);r.push(a),i.push(u)}for(o=1;e+1>o;o++)for(r[1][o]=1,i[1][o]=0,n=2;n<t.length+1;n++)i[n][o]=1/0;for(var p=2;p<t.length+1;p++){for(var g=0,l=0,h=0,d=0,c=1;p+1>c;c++){var m=p-c+1,f=t[m-1];if(h++,g+=f,l+=f*f,s=l-g*g/h,d=m-1,0!==d)for(n=2;e+1>n;n++)i[p][n]>=s+i[d][n-1]&&(r[p][n]=m,i[p][n]=s+i[d][n-1])}r[p][1]=1,i[p][1]=s}return{lower_class_limits:r,variance_combinations:i}}function w(t,e,o){var n=t.length-1,r=[],i=o;for(r[o]=t[t.length-1],r[0]=t[0];i>1;)r[i-1]=t[e[n][i]-2],n=e[n][i]-1,i--;return r}function O(t,e){if(e>t.length)return null;t=t.slice().sort(function(t,e){return t-e});var o=R(t,e),n=o.lower_class_limits;return w(t,n,e)}function M(t){if(t.length<3)return null;var e=t.length,o=Math.pow(c(t),3),n=h(t,3);return e*n/((e-1)*(e-2)*o)}function T(t){var e=Math.abs(t),o=Math.floor(10*e),n=10*(Math.floor(100*e)/10-Math.floor(100*e/10)),r=Math.min(10*o+n,k.length-1);return t>=0?k[r]:+(1-k[r]).toFixed(4)}function A(t,e,o){return(t-e)/o}function D(t){if(0>t)return null;for(var e=1,o=2;t>=o;o++)e*=o;return e}function G(t){return 0>t||t>1?null:F(1,t)}function F(t,e){function o(t,e,o){return D(e)/(D(t)*D(e-t))*Math.pow(o,t)*Math.pow(1-o,e-t)}if(0>e||e>1||0>=t||t%1!==0)return null;var n=0,r=0,i={};do i[n]=o(n,t,e),r+=i[n],n++;while(1-U>r);return i}function B(t){function e(t,e){return Math.pow(Math.E,-e)*Math.pow(e,t)/D(t)}if(0>=t)return null;var o=0,n=0,r={};do r[o]=e(o,t),n+=r[o],o++;while(1-U>n);return r}function _(t,e,o){for(var n,r,s=i(t),a=0,u=1,p=e(s),g=[],l=[],h=0;h<t.length;h++)void 0===g[t[h]]&&(g[t[h]]=0),g[t[h]]++;for(h=0;h<g.length;h++)void 0===g[h]&&(g[h]=0);for(r in p)r in g&&(l[r]=p[r]*t.length);for(r=l.length-1;r>=0;r--)l[r]<3&&(l[r-1]+=l[r],l.pop(),g[r-1]+=g[r],g.pop());for(r=0;r<g.length;r++)a+=Math.pow(g[r]-l[r],2)/l[r];return n=g.length-u-1,Y[n][o]<a}function q(t){function e(t){return function(){var e=Array.prototype.slice.apply(arguments);return e.unshift(this),V[t].apply(V,e)}}var o=!(!Object.defineProperty||!Object.defineProperties);if(!o)throw new Error("without defineProperty, simple-statistics cannot be mixed in");var n,r=["median","standard_deviation","sum","sample_skewness","mean","min","max","quantile","geometric_mean","harmonic_mean"];n=t?t.slice():Array.prototype;for(var i=0;i<r.length;i++)Object.defineProperty(n,r[i],{value:e(r[i]),configurable:!0,enumerable:!1,writable:!0});return n}var V={};"undefined"!=typeof e?e.exports=V:this.ss=V;var k=[.5,.504,.508,.512,.516,.5199,.5239,.5279,.5319,.5359,.5398,.5438,.5478,.5517,.5557,.5596,.5636,.5675,.5714,.5753,.5793,.5832,.5871,.591,.5948,.5987,.6026,.6064,.6103,.6141,.6179,.6217,.6255,.6293,.6331,.6368,.6406,.6443,.648,.6517,.6554,.6591,.6628,.6664,.67,.6736,.6772,.6808,.6844,.6879,.6915,.695,.6985,.7019,.7054,.7088,.7123,.7157,.719,.7224,.7257,.7291,.7324,.7357,.7389,.7422,.7454,.7486,.7517,.7549,.758,.7611,.7642,.7673,.7704,.7734,.7764,.7794,.7823,.7852,.7881,.791,.7939,.7967,.7995,.8023,.8051,.8078,.8106,.8133,.8159,.8186,.8212,.8238,.8264,.8289,.8315,.834,.8365,.8389,.8413,.8438,.8461,.8485,.8508,.8531,.8554,.8577,.8599,.8621,.8643,.8665,.8686,.8708,.8729,.8749,.877,.879,.881,.883,.8849,.8869,.8888,.8907,.8925,.8944,.8962,.898,.8997,.9015,.9032,.9049,.9066,.9082,.9099,.9115,.9131,.9147,.9162,.9177,.9192,.9207,.9222,.9236,.9251,.9265,.9279,.9292,.9306,.9319,.9332,.9345,.9357,.937,.9382,.9394,.9406,.9418,.9429,.9441,.9452,.9463,.9474,.9484,.9495,.9505,.9515,.9525,.9535,.9545,.9554,.9564,.9573,.9582,.9591,.9599,.9608,.9616,.9625,.9633,.9641,.9649,.9656,.9664,.9671,.9678,.9686,.9693,.9699,.9706,.9713,.9719,.9726,.9732,.9738,.9744,.975,.9756,.9761,.9767,.9772,.9778,.9783,.9788,.9793,.9798,.9803,.9808,.9812,.9817,.9821,.9826,.983,.9834,.9838,.9842,.9846,.985,.9854,.9857,.9861,.9864,.9868,.9871,.9875,.9878,.9881,.9884,.9887,.989,.9893,.9896,.9898,.9901,.9904,.9906,.9909,.9911,.9913,.9916,.9918,.992,.9922,.9925,.9927,.9929,.9931,.9932,.9934,.9936,.9938,.994,.9941,.9943,.9945,.9946,.9948,.9949,.9951,.9952,.9953,.9955,.9956,.9957,.9959,.996,.9961,.9962,.9963,.9964,.9965,.9966,.9967,.9968,.9969,.997,.9971,.9972,.9973,.9974,.9974,.9975,.9976,.9977,.9977,.9978,.9979,.9979,.998,.9981,.9981,.9982,.9982,.9983,.9984,.9984,.9985,.9985,.9986,.9986,.9987,.9987,.9987,.9988,.9988,.9989,.9989,.9989,.999,.999],U=1e-4,Y={1:{.995:0,.99:0,.975:0,.95:0,.9:.02,.5:.45,.1:2.71,.05:3.84,.025:5.02,.01:6.63,.005:7.88},2:{.995:.01,.99:.02,.975:.05,.95:.1,.9:.21,.5:1.39,.1:4.61,.05:5.99,.025:7.38,.01:9.21,.005:10.6},3:{.995:.07,.99:.11,.975:.22,.95:.35,.9:.58,.5:2.37,.1:6.25,.05:7.81,.025:9.35,.01:11.34,.005:12.84},4:{.995:.21,.99:.3,.975:.48,.95:.71,.9:1.06,.5:3.36,.1:7.78,.05:9.49,.025:11.14,.01:13.28,.005:14.86},5:{.995:.41,.99:.55,.975:.83,.95:1.15,.9:1.61,.5:4.35,.1:9.24,.05:11.07,.025:12.83,.01:15.09,.005:16.75},6:{.995:.68,.99:.87,.975:1.24,.95:1.64,.9:2.2,.5:5.35,.1:10.65,.05:12.59,.025:14.45,.01:16.81,.005:18.55},7:{.995:.99,.99:1.25,.975:1.69,.95:2.17,.9:2.83,.5:6.35,.1:12.02,.05:14.07,.025:16.01,.01:18.48,.005:20.28},8:{.995:1.34,.99:1.65,.975:2.18,.95:2.73,.9:3.49,.5:7.34,.1:13.36,.05:15.51,.025:17.53,.01:20.09,.005:21.96},9:{.995:1.73,.99:2.09,.975:2.7,.95:3.33,.9:4.17,.5:8.34,.1:14.68,.05:16.92,.025:19.02,.01:21.67,.005:23.59},10:{.995:2.16,.99:2.56,.975:3.25,.95:3.94,.9:4.87,.5:9.34,.1:15.99,.05:18.31,.025:20.48,.01:23.21,.005:25.19},11:{.995:2.6,.99:3.05,.975:3.82,.95:4.57,.9:5.58,.5:10.34,.1:17.28,.05:19.68,.025:21.92,.01:24.72,.005:26.76},12:{.995:3.07,.99:3.57,.975:4.4,.95:5.23,.9:6.3,.5:11.34,.1:18.55,.05:21.03,.025:23.34,.01:26.22,.005:28.3},13:{.995:3.57,.99:4.11,.975:5.01,.95:5.89,.9:7.04,.5:12.34,.1:19.81,.05:22.36,.025:24.74,.01:27.69,.005:29.82},14:{.995:4.07,.99:4.66,.975:5.63,.95:6.57,.9:7.79,.5:13.34,.1:21.06,.05:23.68,.025:26.12,.01:29.14,.005:31.32},15:{.995:4.6,.99:5.23,.975:6.27,.95:7.26,.9:8.55,.5:14.34,.1:22.31,.05:25,.025:27.49,.01:30.58,.005:32.8},16:{.995:5.14,.99:5.81,.975:6.91,.95:7.96,.9:9.31,.5:15.34,.1:23.54,.05:26.3,.025:28.85,.01:32,.005:34.27},17:{.995:5.7,.99:6.41,.975:7.56,.95:8.67,.9:10.09,.5:16.34,.1:24.77,.05:27.59,.025:30.19,.01:33.41,.005:35.72},18:{.995:6.26,.99:7.01,.975:8.23,.95:9.39,.9:10.87,.5:17.34,.1:25.99,.05:28.87,.025:31.53,.01:34.81,.005:37.16},19:{.995:6.84,.99:7.63,.975:8.91,.95:10.12,.9:11.65,.5:18.34,.1:27.2,.05:30.14,.025:32.85,.01:36.19,.005:38.58},20:{.995:7.43,.99:8.26,.975:9.59,.95:10.85,.9:12.44,.5:19.34,.1:28.41,.05:31.41,.025:34.17,.01:37.57,.005:40},21:{.995:8.03,.99:8.9,.975:10.28,.95:11.59,.9:13.24,.5:20.34,.1:29.62,.05:32.67,.025:35.48,.01:38.93,.005:41.4},22:{.995:8.64,.99:9.54,.975:10.98,.95:12.34,.9:14.04,.5:21.34,.1:30.81,.05:33.92,.025:36.78,.01:40.29,.005:42.8},23:{.995:9.26,.99:10.2,.975:11.69,.95:13.09,.9:14.85,.5:22.34,.1:32.01,.05:35.17,.025:38.08,.01:41.64,.005:44.18},24:{.995:9.89,.99:10.86,.975:12.4,.95:13.85,.9:15.66,.5:23.34,.1:33.2,.05:36.42,.025:39.36,.01:42.98,.005:45.56},25:{.995:10.52,.99:11.52,.975:13.12,.95:14.61,.9:16.47,.5:24.34,.1:34.28,.05:37.65,.025:40.65,.01:44.31,.005:46.93},26:{.995:11.16,.99:12.2,.975:13.84,.95:15.38,.9:17.29,.5:25.34,.1:35.56,.05:38.89,.025:41.92,.01:45.64,.005:48.29},27:{.995:11.81,.99:12.88,.975:14.57,.95:16.15,.9:18.11,.5:26.34,.1:36.74,.05:40.11,.025:43.19,.01:46.96,.005:49.65},28:{.995:12.46,.99:13.57,.975:15.31,.95:16.93,.9:18.94,.5:27.34,.1:37.92,.05:41.34,.025:44.46,.01:48.28,.005:50.99},29:{.995:13.12,.99:14.26,.975:16.05,.95:17.71,.9:19.77,.5:28.34,.1:39.09,.05:42.56,.025:45.72,.01:49.59,.005:52.34},30:{.995:13.79,.99:14.95,.975:16.79,.95:18.49,.9:20.6,.5:29.34,.1:40.26,.05:43.77,.025:46.98,.01:50.89,.005:53.67},40:{.995:20.71,.99:22.16,.975:24.43,.95:26.51,.9:29.05,.5:39.34,.1:51.81,.05:55.76,.025:59.34,.01:63.69,.005:66.77},50:{.995:27.99,.99:29.71,.975:32.36,.95:34.76,.9:37.69,.5:49.33,.1:63.17,.05:67.5,.025:71.42,.01:76.15,.005:79.49},60:{.995:35.53,.99:37.48,.975:40.48,.95:43.19,.9:46.46,.5:59.33,.1:74.4,.05:79.08,.025:83.3,.01:88.38,.005:91.95},70:{.995:43.28,.99:45.44,.975:48.76,.95:51.74,.9:55.33,.5:69.33,.1:85.53,.05:90.53,.025:95.02,.01:100.42,.005:104.22},80:{.995:51.17,.99:53.54,.975:57.15,.95:60.39,.9:64.28,.5:79.33,.1:96.58,.05:101.88,.025:106.63,.01:112.33,.005:116.32},90:{.995:59.2,.99:61.75,.975:65.65,.95:69.13,.9:73.29,.5:89.33,.1:107.57,.05:113.14,.025:118.14,.01:124.12,.005:128.3},100:{.995:67.33,.99:70.06,.975:74.22,.95:77.93,.9:82.36,.5:99.33,.1:118.5,.05:124.34,.025:129.56,.01:135.81,.005:140.17}};
V.linear_regression=t,V.standard_deviation=l,V.r_squared=o,V.median=y,V.mean=i,V.mode=j,V.min=u,V.max=p,V.sum=r,V.quantile=C,V.quantile_sorted=N,V.iqr=b,V.mad=P,V.chunk=E,V.shuffle=S,V.shuffle_in_place=I,V.sample=L,V.sample_covariance=m,V.sample_correlation=f,V.sample_variance=d,V.sample_standard_deviation=c,V.sample_skewness=M,V.geometric_mean=s,V.harmonic_mean=a,V.variance=g,V.t_test=v,V.t_test_two_sample=x,V.jenksMatrices=R,V.jenksBreaks=w,V.jenks=O,V.bayesian=n,V.epsilon=U,V.factorial=D,V.bernoulli_distribution=G,V.binomial_distribution=F,V.poisson_distribution=B,V.chi_squared_goodness_of_fit=_,V.z_score=A,V.cumulative_std_normal_probability=T,V.standard_normal_table=k,V.average=i,V.interquartile_range=b,V.mixin=q,V.median_absolute_deviation=P}(this)},{}],50:[function(t,e){function o(t){return t*Math.PI/180}e.exports=function(t,e,n){var r=t.geometry.coordinates,i=e.geometry.coordinates,s=o(i[1]-r[1]),a=o(i[0]-r[0]),u=o(r[1]),p=o(i[1]),g=Math.sin(s/2)*Math.sin(s/2)+Math.sin(a/2)*Math.sin(a/2)*Math.cos(u)*Math.cos(p),l=2*Math.atan2(Math.sqrt(g),Math.sqrt(1-g)),h=0;switch(n){case"miles":h=3960;break;case"kilometers":h=6373;break;case"degrees":h=57.2957795;break;case"radians":h=1}var d=h*l;return d}},{}],51:[function(t,e){var o=t("turf-extent"),n=t("turf-bbox-polygon");e.exports=function(t){var e=o(t),r=n(e);return r}},{"turf-bbox-polygon":52,"turf-extent":54}],52:[function(t,e){var o=t("turf-polygon");e.exports=function(t){var e=[t[0],t[1]],n=[t[0],t[3]],r=[t[2],t[3]],i=[t[2],t[1]],s=o([[e,i,r,n,e]]);return s}},{"turf-polygon":53}],53:[function(t,e){e.exports=t(31)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-bbox-polygon/node_modules/turf-polygon/index.js":31}],54:[function(t,e){function o(t){var e=[];return t=n(t),t.forEach(function(o,n){n%2==0&&e.push([o,t[n+1]])}),e}var n=t("flatten");e.exports=function(t){var e=1/0,n=1/0,r=-1/0,i=-1/0;if("FeatureCollection"===t.type){for(var s in t.features){var a;switch(t.features[s].geometry.type){case"Point":a=[t.features[s].geometry.coordinates];break;case"LineString":a=t.features[s].geometry.coordinates;break;case"Polygon":a=t.features[s].geometry.coordinates,a=o(a);break;case"MultiPoint":a=t.features[s].geometry.coordinates;break;case"MultiLineString":a=t.features[s].geometry.coordinates,a=o(a);break;case"MultiPolygon":a=t.features[s].geometry.coordinates,a=o(a)}if(!t.features[s].geometry&&t.features[s].properties)return new Error("Unknown Geometry Type");for(var u in a)e>a[u][0]&&(e=a[u][0]),n>a[u][1]&&(n=a[u][1]),r<a[u][0]&&(r=a[u][0]),i<a[u][1]&&(i=a[u][1])}var p=[e,n,r,i];return p}var a,g;switch(g="Feature"===t.type?t.geometry:t,g.type){case"Point":a=[g.coordinates];break;case"LineString":a=g.coordinates;break;case"Polygon":a=g.coordinates,a=o(a);break;case"MultiPoint":a=g.coordinates;break;case"MultiLineString":a=g.coordinates,a=o(a);break;case"MultiPolygon":a=g.coordinates,a=o(a)}if(!g)return new Error("No Geometry Found");for(var u in a)e>a[u][0]&&(e=a[u][0]),n>a[u][1]&&(n=a[u][1]),r<a[u][0]&&(r=a[u][0]),i<a[u][1]&&(i=a[u][1]);var p=[e,n,r,i];return p}},{flatten:55}],55:[function(t,e){e.exports=function(t,e){function o(t,n){return t.reduce(function(t,r){return t.concat(Array.isArray(r)&&e>n?o(r,n+1):r)},[])}return e="number"==typeof e?e:1/0,o(t,1)}},{}],56:[function(t,e){var o=t("jsts");e.exports=function(t,e){"Feature"!==t.type&&(t={type:"Feature",properties:{},geometry:t}),"Feature"!==e.type&&(e={type:"Feature",properties:{},geometry:e});var n=new o.io.GeoJSONReader,r=n.read(JSON.stringify(t.geometry)),i=n.read(JSON.stringify(e.geometry)),s=r.difference(i),a=new o.io.GeoJSONParser;return s=a.write(s),t.geometry=s,"GeometryCollection"===t.geometry.type&&0===t.geometry.geometries.length?void 0:{type:"Feature",properties:t.properties,geometry:s}}},{jsts:57}],57:[function(t,e){e.exports=t(36)},{"./lib/jsts":58,"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-buffer/node_modules/jsts/index.js":36,"javascript.util":60}],58:[function(t,e){e.exports=t(37)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-buffer/node_modules/jsts/lib/jsts.js":37}],59:[function(t,e){e.exports=t(38)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-buffer/node_modules/jsts/node_modules/javascript.util/dist/javascript.util-node.min.js":38}],60:[function(t,e){e.exports=t(39)},{"./dist/javascript.util-node.min.js":59,"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-buffer/node_modules/jsts/node_modules/javascript.util/index.js":39}],61:[function(t,e){function o(t){var e=[];return t=n(t),t.forEach(function(o,n){n%2==0&&e.push([o,t[n+1]])}),e}var n=t("flatten"),r=t("turf-featurecollection"),i=t("turf-point");e.exports=function(t){if("FeatureCollection"===t.type){for(var e in t.features){var n;switch(t.features[e].geometry.type){case"Point":n=[t.features[e].geometry.coordinates];break;case"LineString":n=t.features[e].geometry.coordinates;break;case"Polygon":n=t.features[e].geometry.coordinates,n=o(n);break;case"MultiPoint":n=t.features[e].geometry.coordinates;break;case"MultiLineString":n=t.features[e].geometry.coordinates,n=o(n);break;case"MultiPolygon":n=t.features[e].geometry.coordinates,n=o(n)}if(!t.features[e].geometry&&t.features[e].properties)return new Error("Unknown Geometry Type")}var s=r([]);return n.forEach(function(t){s.features.push(i(t[0],t[1]))}),s}var n,a;switch(a="Feature"===t.type?t.geometry:t,a.type){case"Point":n=[a.coordinates];break;case"LineString":n=a.coordinates;break;case"Polygon":n=a.coordinates,n=o(n);break;case"MultiPoint":n=a.coordinates;break;case"MultiLineString":n=a.coordinates,n=o(n);break;case"MultiPolygon":n=a.coordinates,n=o(n)}if(!a)return new Error("No Geometry Found");var s=r([]);return n.forEach(function(t){s.features.push(i(t[0],t[1]))}),s}},{flatten:62,"turf-featurecollection":63,"turf-point":64}],62:[function(t,e){e.exports=t(55)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-envelope/node_modules/turf-extent/node_modules/flatten/index.js":55}],63:[function(t,e){e.exports=function(t){var e={type:"FeatureCollection",features:t};return e}},{}],64:[function(t,e){e.exports=function(t,e,o){if(isNaN(t)||isNaN(e))throw new Error("Invalid coordinates");return{type:"Feature",geometry:{type:"Point",coordinates:[t,e]},properties:o||{}}}},{}],65:[function(t,e){function o(t){var e=[];return t=n(t),t.forEach(function(o,n){n%2==0&&e.push([o,t[n+1]])}),e}var n=t("flatten");e.exports=function(t){var e=1/0,n=1/0,r=-1/0,i=-1/0;if("FeatureCollection"===t.type){for(var s in t.features){var a;switch(t.features[s].geometry.type){case"Point":a=[t.features[s].geometry.coordinates];break;case"LineString":a=t.features[s].geometry.coordinates;break;case"Polygon":a=t.features[s].geometry.coordinates,a=o(a);break;case"MultiPoint":a=t.features[s].geometry.coordinates;break;case"MultiLineString":a=t.features[s].geometry.coordinates,a=o(a);break;case"MultiPolygon":a=t.features[s].geometry.coordinates,a=o(a)}if(!t.features[s].geometry&&t.features[s].properties)return new Error("Unknown Geometry Type");for(var u in a)e>a[u][0]&&(e=a[u][0]),n>a[u][1]&&(n=a[u][1]),r<a[u][0]&&(r=a[u][0]),i<a[u][1]&&(i=a[u][1])}var p=[e,n,r,i];return p}var a,g;switch(g="Feature"===t.type?t.geometry:t,g.type){case"Point":a=[g.coordinates];break;case"LineString":a=g.coordinates;break;case"Polygon":a=g.coordinates,a=o(a);break;case"MultiPoint":a=g.coordinates;break;case"MultiLineString":a=g.coordinates,a=o(a);break;case"MultiPolygon":a=g.coordinates,a=o(a)}if(!g)return new Error("No Geometry Found");for(var u in a)e>a[u][0]&&(e=a[u][0]),n>a[u][1]&&(n=a[u][1]),r<a[u][0]&&(r=a[u][0]),i<a[u][1]&&(i=a[u][1]);var p=[e,n,r,i];return p}},{flatten:66}],66:[function(t,e){e.exports=t(55)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-envelope/node_modules/turf-extent/node_modules/flatten/index.js":55}],67:[function(t,e){e.exports=function(t){var e={type:"FeatureCollection",features:t};return e}},{}],68:[function(t,e){var o=t("turf-featurecollection");e.exports=function(t,e,n){for(var r=o([]),i=0;i<t.features.length;i++)t.features[i].properties[e]===n&&r.features.push(t.features[i]);return r}},{"turf-featurecollection":67}],69:[function(t,e){function o(t){return[t[1],t[0]]}e.exports=function(t){if("Feature"!==t.type){if("FeatureCollection"===t.type)return t.features.forEach(function(t){switch(t.geometry.type){case"Point":t.geometry.coordinates=o(t.geometry.coordinates);break;case"LineString":t.geometry.coordinates.forEach(function(e,n){e=o(e),t.geometry.coordinates[n]=e});break;case"Polygon":t.geometry.coordinates.forEach(function(e,n){e.forEach(function(e,r){e=o(e),t.geometry.coordinates[n][r]=e})})}}),t;var e=new Error("Unknown geometry type");return e}switch(t.geometry.type){case"Point":return t.geometry.coordinates=o(t.geometry.coordinates),t;case"LineString":return t.geometry.coordinates.forEach(function(e,n){e=o(e),t.geometry.coordinates[n]=e}),t;case"Polygon":return t.geometry.coordinates.forEach(function(e,n){e.forEach(function(e,r){e=o(e),t.geometry.coordinates[n][r]=e})}),t}}},{}],70:[function(t,e){var o=t("turf-point");e.exports=function(t,e){for(var n=t[0],r=t[1],i=t[2],s=(t[3],(i-n)/e),a={type:"FeatureCollection",features:[]},u=0;e>=u;u++)for(var p=0;e>=p;p++)a.features.push(o(u*s+n,p*s+r));return a}},{"turf-point":114}],71:[function(t,e){function o(t,e){for(var o=[],n=0;6>n;n++){var a=t[0]+e*i[n],u=t[1]+e*s[n];o.push([a,u])}return o.push(o[0]),r([o])}function n(t,e,n){var r=t[0],i=t[1],s=t[2],a=t[3],u={type:"FeatureCollection",features:[]},p=2*e,g=Math.sqrt(3)/2*p,l=s-r,h=a-i,d=.75*p,c=g,m=l/(p-e/2),f=Math.ceil(m);Math.round(m)===f&&f++;var y=(f*d-e/2-l)/2-e/2,j=Math.ceil(h/g),v=(h-j*g)/2,x=j*g-h>g/2;x&&(v-=g/4);for(var E=0;f>E;E++)for(var I=0;j>=I;I++){var S=E%2===1;if(!(0===I&&S||0===I&&x)){var L=E*d+r-y,C=I*c+i+v;S&&(C-=g/2),u.features.push(o([L,C],e))}}return n=n||function(){},n(null,u),u}var r=t("turf-polygon");e.exports=n;for(var i=[],s=[],a=0;6>a;a++){var u=2*Math.PI/6*a;i.push(Math.cos(u)),s.push(Math.sin(u))}},{"turf-polygon":72}],72:[function(t,e){e.exports=t(31)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-bbox-polygon/node_modules/turf-polygon/index.js":31}],73:[function(t,e){function o(t,e){for(var o=!1,n=0,r=e.length-1;n<e.length;r=n++){var i=e[n][0],s=e[n][1],a=e[r][0],u=e[r][1],p=s>t[1]!=u>t[1]&&t[0]<(a-i)*(t[1]-s)/(u-s)+i;p&&(o=!o)}return o}e.exports=function(t,e){var n=e.geometry.coordinates,r=[t.geometry.coordinates[0],t.geometry.coordinates[1]];"Polygon"===e.geometry.type&&(n=[n]);for(var i=!1,s=0;s<n.length&&!i;){if(o(r,n[s][0])){for(var a=!1,u=1;u<n[s].length&&!a;)o(r,n[s][u])&&(a=!0),u++;a||(i=!0)}s++}return i}},{}],74:[function(t,e){{var o=t("jsts");t("turf-featurecollection")}e.exports=function(t,e){"Feature"!==t.type&&(t={type:"Feature",geometry:t}),"Feature"!==e.type&&(e={type:"Feature",geometry:e});var n=new o.io.GeoJSONReader,r=n.read(JSON.stringify(t.geometry)),i=n.read(JSON.stringify(e.geometry)),s=r.intersection(i),a=new o.io.GeoJSONParser;return s=a.write(s),"GeometryCollection"===s.type&&0===s.geometries.length?void 0:{type:"Feature",properties:{},geometry:s}}},{jsts:75,"turf-featurecollection":67}],75:[function(t,e){e.exports=t(36)},{"./lib/jsts":76,"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-buffer/node_modules/jsts/index.js":36,"javascript.util":78}],76:[function(t,e){e.exports=t(37)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-buffer/node_modules/jsts/lib/jsts.js":37}],77:[function(t,e){e.exports=t(38)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-buffer/node_modules/jsts/node_modules/javascript.util/dist/javascript.util-node.min.js":38}],78:[function(t,e){e.exports=t(39)},{"./dist/javascript.util-node.min.js":77,"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-buffer/node_modules/jsts/node_modules/javascript.util/index.js":39}],79:[function(t,e){e.exports=function(t){for(var e,o,n=0,r=1,i=t.length;i>r;)e=o||t[0],o=t[r],n+=(o[0]-e[0])*(o[1]+e[1]),r++;return n>0}},{}],80:[function(t,e,o){function n(t,e,o){var n,r=h(t);if("Error"==typeof r)return r;if(n=y(r),"Error"==typeof n)return n;if(sizeBBox=j(n,.35),"Error"==typeof sizeBBox)return sizeBBox;for(var i=sizeBBox[2]-sizeBBox[0],s=i/o,a=sizeBBox[0],u=sizeBBox[1],p=sizeBBox[2],g=sizeBBox[3],l=0;o>=l;l++){var d=f(a,u+s*l);d.properties={},d.properties[e]=-100,t.features.push(d)}for(var l=0;o>=l;l++){var d=f(a+s*l,u);d.properties={},d.properties[e]=-100,t.features.push(d)}for(var l=0;o>=l;l++){var d=f(p,u+s*l);d.properties={},d.properties[e]=-100,t.features.push(d)}for(var l=0;o>=l;l++){var d=f(a+s*l,g);d.properties={},d.properties[e]=-100,t.features.push(d)}return t}function r(t){return t.reduce(function(t,e){return t.indexOf(e)<0&&t.push(e),t},[])}function i(t,e){var o=t.x-e.x,n=t.y-e.y;return v>o*o+n*n}function s(t){for(var e=t.head;e;){var o=e.next;e.next=e.prev,e.prev=o,e=o}var o=t.head;t.head=t.tail,t.tail=o}function a(t){this.level=t,this.s=null,this.count=0}function u(t){if(t)this.drawContour=t;else{var e=this;e.contours={},this.drawContour=function(t,o,n,r,i,s){var u=e.contours[s];u||(u=e.contours[s]=new a(i)),u.addSegment({x:t,y:o},{x:n,y:r})},this.contourList=function(){var t=[],o=e.contours;for(var n in o)for(var r=o[n].s,i=o[n].level;r;){var s=r.head,a=[];for(a.level=i,a.k=n;s&&s.p;)a.push(s.p),s=s.next;t.push(a),r=r.next}return t.sort(function(t,e){return t.k-e.k}),t}}this.h=new Array(5),this.sh=new Array(5),this.xh=new Array(5),this.yh=new Array(5)}var p=t("turf-tin"),g=t("turf-inside"),l=t("turf-grid"),h=t("turf-extent"),d=t("turf-planepoint"),c=t("turf-featurecollection"),m=(t("turf-linestring"),t("turf-polygon")),f=t("turf-point"),y=t("turf-square"),j=t("turf-size");e.exports=function(t,e,o,i){var s=(n(t,e,o),p(t,e)),a=h(t),f=y(a),j=l(f,o),v=[];j.features.forEach(function(t){s.features.forEach(function(o){g(t,o)&&(t.properties={},t.properties[e]=d(t,o))}),t.properties||(t.properties={},t.properties[e]=-100)});for(var x=Math.sqrt(j.features.length),E=0;x>E;E++){var I=j.features.slice(E*x,(E+1)*x),S=[];I.forEach(function(t){S.push(t.properties?t.properties[e]:0)}),v.push(S)}for(var L=(f[2]-f[0])/x,C=[],N=[],E=0;x>E;E++)C.push(E*L+f[0]),N.push(E*L+f[1]);i=i.map(function(t){return 0===t?.01:t}),i=r(i);var b=new u;b.contour(v,0,o,0,o,C,N,i.length,i);var P=b.contourList(),R=c([]);return P.forEach(function(t){if(t.length>2){var o=[];t.forEach(function(t){o.push([t.x,t.y])});var n=m([o]);n.properties={},n.properties[e]=t.level,R.features.push(n)}}),R},o.Conrec=u;var v=1e-10;a.prototype.remove_seq=function(t){t.prev?t.prev.next=t.next:this.s=t.next,t.next&&(t.next.prev=t.prev),--this.count},a.prototype.addSegment=function(t,e){for(var o=this.s,n=null,r=null,a=!1,u=!1;o&&(null==n&&(i(t,o.head.p)?(n=o,a=!0):i(t,o.tail.p)&&(n=o)),null==r&&(i(e,o.head.p)?(r=o,u=!0):i(e,o.tail.p)&&(r=o)),null==r||null==n);)o=o.next;var p=(null!=n?1:0)|(null!=r?2:0);switch(p){case 0:var g={p:t,prev:null},l={p:e,next:null};g.next=l,l.prev=g,n={head:g,tail:l,next:this.s,prev:null,closed:!1},this.s&&(this.s.prev=n),this.s=n,++this.count;break;case 1:var h={p:e};a?(h.next=n.head,h.prev=null,n.head.prev=h,n.head=h):(h.next=null,h.prev=n.tail,n.tail.next=h,n.tail=h);break;case 2:var h={p:t};u?(h.next=r.head,h.prev=null,r.head.prev=h,r.head=h):(h.next=null,h.prev=r.tail,r.tail.next=h,r.tail=h);break;case 3:if(n===r){var h={p:n.tail.p,next:n.head,prev:null};n.head.prev=h,n.head=h,n.closed=!0;break}switch((a?1:0)|(u?2:0)){case 0:s(n);case 1:r.tail.next=n.head,n.head.prev=r.tail,r.tail=n.tail,this.remove_seq(n);break;case 3:s(n);case 2:n.tail.next=r.head,r.head.prev=n.tail,n.tail=r.tail,this.remove_seq(r)}}},u.prototype.contour=function(t,e,o,n,r,i,s,a,u){var p=this.h,g=this.sh,l=this.xh,h=this.yh,d=this.drawContour;this.contours={};for(var c,m,f,y,j,x,E=function(t,e){return(p[e]*l[t]-p[t]*l[e])/(p[e]-p[t])},I=function(t,e){return(p[e]*h[t]-p[t]*h[e])/(p[e]-p[t])},S=0,L=0,C=0,N=0,b=[0,1,1,0],P=[0,0,1,1],R=[[[0,0,8],[0,2,5],[7,6,9]],[[0,3,4],[1,3,1],[4,3,0]],[[9,6,7],[5,2,0],[8,0,0]]],w=r-1;w>=n;w--)for(var O=e;o-1>=O;O++){var M,T;if(M=Math.min(t[O][w],t[O][w+1]),T=Math.min(t[O+1][w],t[O+1][w+1]),j=Math.min(M,T),M=Math.max(t[O][w],t[O][w+1]),T=Math.max(t[O+1][w],t[O+1][w+1]),x=Math.max(M,T),x>=u[0]&&j<=u[a-1])for(var A=0;a>A;A++)if(u[A]>=j&&u[A]<=x){for(var D=4;D>=0;D--)D>0?(p[D]=t[O+b[D-1]][w+P[D-1]]-u[A],l[D]=i[O+b[D-1]],h[D]=s[w+P[D-1]]):(p[0]=.25*(p[1]+p[2]+p[3]+p[4]),l[0]=.5*(i[O]+i[O+1]),h[0]=.5*(s[w]+s[w+1])),g[D]=p[D]>v?1:p[D]<-v?-1:0;for(D=1;4>=D;D++)if(c=D,m=0,f=4!=D?D+1:1,y=R[g[c]+1][g[m]+1][g[f]+1],0!=y){switch(y){case 1:S=l[c],C=h[c],L=l[m],N=h[m];break;case 2:S=l[m],C=h[m],L=l[f],N=h[f];break;case 3:S=l[f],C=h[f],L=l[c],N=h[c];break;case 4:S=l[c],C=h[c],L=E(m,f),N=I(m,f);break;case 5:S=l[m],C=h[m],L=E(f,c),N=I(f,c);break;case 6:S=l[f],C=h[f],L=E(c,m),N=I(c,m);break;case 7:S=E(c,m),C=I(c,m),L=E(m,f),N=I(m,f);break;case 8:S=E(m,f),C=I(m,f),L=E(f,c),N=I(f,c);break;case 9:S=E(f,c),C=I(f,c),L=E(c,m),N=I(c,m)}d(S,C,L,N,u[A],A)}}}}},{"turf-extent":65,"turf-featurecollection":67,"turf-grid":81,"turf-inside":73,"turf-linestring":101,"turf-planepoint":83,"turf-point":114,"turf-polygon":115,"turf-size":123,"turf-square":124,"turf-tin":84}],81:[function(t,e){var o=t("turf-point");e.exports=function(t,e,n){var r=t[0],i=t[1],s=t[2],a=(t[3],(s-r)/e),u={type:"FeatureCollection",features:[]};n=n||function(){};for(var p=0;e>=p;p++)for(var g=0;e>=g;g++)u.features.push(o(p*a+r,g*a+i));return n(null,u),u}},{"turf-point":82}],82:[function(t,e){e.exports=t(64)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-explode/node_modules/turf-point/index.js":64}],83:[function(t,e){e.exports=function(t,e){var o=t.geometry.coordinates[0];y=t.geometry.coordinates[1],x1=e.geometry.coordinates[0][0][0],y1=e.geometry.coordinates[0][0][1],z1=e.properties.a,x2=e.geometry.coordinates[0][1][0],y2=e.geometry.coordinates[0][1][1],z2=e.properties.b,x3=e.geometry.coordinates[0][2][0],y3=e.geometry.coordinates[0][2][1],z3=e.properties.c;var n=(z3*(o-x1)*(y-y2)+z1*(o-x2)*(y-y3)+z2*(o-x3)*(y-y1)-z2*(o-x1)*(y-y3)-z3*(o-x2)*(y-y1)-z1*(o-x3)*(y-y2))/((o-x1)*(y-y2)+(o-x2)*(y-y3)+(o-x3)*(y-y1)-(o-x1)*(y-y3)-(o-x2)*(y-y1)-(o-x3)*(y-y2));return n}},{}],84:[function(t,e){function o(t){return t.geometry.coordinates.forEach(function(t){var e=t[0]===t.slice(-1)[0];e||t.push(t[0])}),t}function n(t,e,o){this.a=t,this.b=e,this.c=o;var n,r,i,s,a=e.x-t.x,u=e.y-t.y,p=o.x-t.x,g=o.y-t.y,l=a*(t.x+e.x)+u*(t.y+e.y),h=p*(t.x+o.x)+g*(t.y+o.y),d=2*(a*(o.y-e.y)-u*(o.x-e.x));Math.abs(d)<1e-6?(n=Math.min(t.x,e.x,o.x),r=Math.min(t.y,e.y,o.y),i=.5*(Math.max(t.x,e.x,o.x)-n),s=.5*(Math.max(t.y,e.y,o.y)-r),this.x=n+i,this.y=r+s,this.r=i*i+s*s):(this.x=(g*l-u*h)/d,this.y=(a*h-p*l)/d,i=this.x-t.x,s=this.y-t.y,this.r=i*i+s*s)}function r(t,e){return e.x-t.x}function i(t){var e,o,n,r,i,s=t.length;t:for(;s;)for(o=t[--s],e=t[--s],n=s;n;)if(i=t[--n],r=t[--n],e===r&&o===i||e===i&&o===r){t.splice(s,2),t.splice(n,2),s-=2;continue t}}function s(t){if(t.length<3)return[];t.sort(r);for(var e=t.length-1,o=t[e].x,s=t[0].x,a=t[e].y,u=a;e--;)t[e].y<a&&(a=t[e].y),t[e].y>u&&(u=t[e].y);var p,g,l,h=s-o,d=u-a,c=h>d?h:d,m=.5*(s+o),f=.5*(u+a),y=[new n({x:m-20*c,y:f-c,__sentinel:!0},{x:m,y:f+20*c,__sentinel:!0},{x:m+20*c,y:f-c,__sentinel:!0})],j=[],v=[];for(e=t.length;e--;){for(v.length=0,p=y.length;p--;)h=t[e].x-y[p].x,h>0&&h*h>y[p].r?(j.push(y[p]),y.splice(p,1)):(d=t[e].y-y[p].y,h*h+d*d>y[p].r||(v.push(y[p].a,y[p].b,y[p].b,y[p].c,y[p].c,y[p].a),y.splice(p,1)));for(i(v),p=v.length;p;)l=v[--p],g=v[--p],y.push(new n(g,l,t[e]))}for(Array.prototype.push.apply(j,y),e=j.length;e--;)(j[e].a.__sentinel||j[e].b.__sentinel||j[e].c.__sentinel)&&j.splice(e,1);return j}var a=t("turf-polygon"),u=t("turf-nearest"),p=t("turf-point");e.exports=function(t,e,n){var r=[];t.features.forEach(function(t){r.push({x:t.geometry.coordinates[0],y:t.geometry.coordinates[1]})});var i=s(r),g={type:"FeatureCollection",features:[]};return n=n||function(){},i.forEach(function(t){var e=[[[t.a.x,t.a.y],[t.b.x,t.b.y],[t.c.x,t.c.y]]],o=a(e,{a:null,b:null,c:null});g.features.push(o)}),e&&g.features.forEach(function(o){var n=1;o.geometry.coordinates[0].forEach(function(r){var i=u(p(r[0],r[1]),t);1===n?o.properties.a=i.properties[e]:2===n?o.properties.b=i.properties[e]:3===n&&(o.properties.c=i.properties[e]),n++})}),g.features.forEach(function(t){t=o(t)}),n(null,g),g},n.prototype.draw=function(t){t.beginPath(),t.moveTo(this.a.x,this.a.y),t.lineTo(this.b.x,this.b.y),t.lineTo(this.c.x,this.c.y),t.closePath(),t.stroke()}},{"turf-nearest":85,"turf-point":87,"turf-polygon":88}],85:[function(t,e){distance=t("turf-distance"),e.exports=function(t,e){var o;return e.features.forEach(function(e){if(o){var n=distance(t,e,"miles");n<o.properties.distance&&(o=e,o.properties.distance=n)}else{o=e;var n=distance(t,e,"miles");o.properties.distance=n}}),delete o.properties.distance,o}},{"turf-distance":86}],86:[function(t,e){function o(t){return t*Math.PI/180}e.exports=function(t,e,n){var r=t.geometry.coordinates,i=e.geometry.coordinates,s=o(i[1]-r[1]),a=o(i[0]-r[0]),u=o(r[1]),p=o(i[1]),g=Math.sin(s/2)*Math.sin(s/2)+Math.sin(a/2)*Math.sin(a/2)*Math.cos(u)*Math.cos(p),l=2*Math.atan2(Math.sqrt(g),Math.sqrt(1-g)),h=0;switch(n){case"miles":h=3960;break;case"kilometers":h=6373;break;case"degrees":h=57.2957795;break;case"radians":h=1}var d=h*l;return d}},{}],87:[function(t,e){e.exports=t(64)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-explode/node_modules/turf-point/index.js":64}],88:[function(t,e){e.exports=t(31)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-bbox-polygon/node_modules/turf-polygon/index.js":31}],89:[function(t,e,o){function n(t,e){var o=t.x-e.x,n=t.y-e.y;return m>o*o+n*n}function r(t){for(var e=t.head;e;){var o=e.next;e.next=e.prev,e.prev=o,e=o}var o=t.head;t.head=t.tail,t.tail=o}function i(t){this.level=t,this.s=null,this.count=0}function s(t){if(t)this.drawContour=t;else{var e=this;e.contours={},this.drawContour=function(t,o,n,r,s,a){var u=e.contours[a];u||(u=e.contours[a]=new i(s)),u.addSegment({x:t,y:o},{x:n,y:r})},this.contourList=function(){var t=[],o=e.contours;for(var n in o)for(var r=o[n].s,i=o[n].level;r;){var s=r.head,a=[];for(a.level=i,a.k=n;s&&s.p;)a.push(s.p),s=s.next;t.push(a),r=r.next}return t.sort(function(t,e){return t.k-e.k}),t}}this.h=new Array(5),this.sh=new Array(5),this.xh=new Array(5),this.yh=new Array(5)}var a=t("turf-tin"),u=t("turf-inside"),p=t("turf-grid"),g=t("turf-extent"),l=t("turf-planepoint"),h=t("turf-featurecollection"),d=t("turf-linestring"),c=t("turf-square");e.exports=function(t,e,o,n){var r=a(t,e),i=g(t),m=c(i),f=p(m,o),y=[];f.features.forEach(function(t){r.features.forEach(function(o){u(t,o)&&(t.properties={},t.properties[e]=l(t,o))})});for(var j=Math.sqrt(f.features.length),v=0;j>v;v++){var x=f.features.slice(v*j,(v+1)*j),E=[];x.forEach(function(t){E.push(t.properties?t.properties[e]:0)}),y.push(E)}for(var I=(m[2]-m[0])/j,S=[],L=[],v=0;j>v;v++)S.push(v*I+m[0]),L.push(v*I+m[1]);var C=new s;C.contour(y,0,o,0,o,S,L,n.length,n);var N=C.contourList(),b=h([]);return N.forEach(function(t){if(t.length>2){var o=[];t.forEach(function(t){o.push([t.x,t.y])});var n=d(o);n.properties={},n.properties[e]=t.level,b.features.push(n)}}),b},o.Conrec=s;var m=1e-10;i.prototype.remove_seq=function(t){t.prev?t.prev.next=t.next:this.s=t.next,t.next&&(t.next.prev=t.prev),--this.count},i.prototype.addSegment=function(t,e){for(var o=this.s,i=null,s=null,a=!1,u=!1;o&&(null==i&&(n(t,o.head.p)?(i=o,a=!0):n(t,o.tail.p)&&(i=o)),null==s&&(n(e,o.head.p)?(s=o,u=!0):n(e,o.tail.p)&&(s=o)),null==s||null==i);)o=o.next;var p=(null!=i?1:0)|(null!=s?2:0);switch(p){case 0:var g={p:t,prev:null},l={p:e,next:null};g.next=l,l.prev=g,i={head:g,tail:l,next:this.s,prev:null,closed:!1},this.s&&(this.s.prev=i),this.s=i,++this.count;break;case 1:var h={p:e};a?(h.next=i.head,h.prev=null,i.head.prev=h,i.head=h):(h.next=null,h.prev=i.tail,i.tail.next=h,i.tail=h);break;case 2:var h={p:t};u?(h.next=s.head,h.prev=null,s.head.prev=h,s.head=h):(h.next=null,h.prev=s.tail,s.tail.next=h,s.tail=h);break;case 3:if(i===s){var h={p:i.tail.p,next:i.head,prev:null};i.head.prev=h,i.head=h,i.closed=!0;break}switch((a?1:0)|(u?2:0)){case 0:r(i);case 1:s.tail.next=i.head,i.head.prev=s.tail,s.tail=i.tail,this.remove_seq(i);break;case 3:r(i);case 2:i.tail.next=s.head,s.head.prev=i.tail,i.tail=s.tail,this.remove_seq(s)}}},s.prototype.contour=function(t,e,o,n,r,i,s,a,u){var p=this.h,g=this.sh,l=this.xh,h=this.yh,d=this.drawContour;this.contours={};for(var c,f,y,j,v,x,E=function(t,e){return(p[e]*l[t]-p[t]*l[e])/(p[e]-p[t])},I=function(t,e){return(p[e]*h[t]-p[t]*h[e])/(p[e]-p[t])},S=0,L=0,C=0,N=0,b=[0,1,1,0],P=[0,0,1,1],R=[[[0,0,8],[0,2,5],[7,6,9]],[[0,3,4],[1,3,1],[4,3,0]],[[9,6,7],[5,2,0],[8,0,0]]],w=r-1;w>=n;w--)for(var O=e;o-1>=O;O++){var M,T;if(M=Math.min(t[O][w],t[O][w+1]),T=Math.min(t[O+1][w],t[O+1][w+1]),v=Math.min(M,T),M=Math.max(t[O][w],t[O][w+1]),T=Math.max(t[O+1][w],t[O+1][w+1]),x=Math.max(M,T),x>=u[0]&&v<=u[a-1])for(var A=0;a>A;A++)if(u[A]>=v&&u[A]<=x){for(var D=4;D>=0;D--)D>0?(p[D]=t[O+b[D-1]][w+P[D-1]]-u[A],l[D]=i[O+b[D-1]],h[D]=s[w+P[D-1]]):(p[0]=.25*(p[1]+p[2]+p[3]+p[4]),l[0]=.5*(i[O]+i[O+1]),h[0]=.5*(s[w]+s[w+1])),g[D]=p[D]>m?1:p[D]<-m?-1:0;for(D=1;4>=D;D++)if(c=D,f=0,y=4!=D?D+1:1,j=R[g[c]+1][g[f]+1][g[y]+1],0!=j){switch(j){case 1:S=l[c],C=h[c],L=l[f],N=h[f];break;case 2:S=l[f],C=h[f],L=l[y],N=h[y];break;case 3:S=l[y],C=h[y],L=l[c],N=h[c];break;case 4:S=l[c],C=h[c],L=E(f,y),N=I(f,y);break;case 5:S=l[f],C=h[f],L=E(y,c),N=I(y,c);break;case 6:S=l[y],C=h[y],L=E(c,f),N=I(c,f);break;case 7:S=E(c,f),C=I(c,f),L=E(f,y),N=I(f,y);break;case 8:S=E(f,y),C=I(f,y),L=E(y,c),N=I(y,c);break;case 9:S=E(y,c),C=I(y,c),L=E(c,f),N=I(c,f)}d(S,C,L,N,u[A],A)}}}}},{"turf-extent":65,"turf-featurecollection":67,"turf-grid":90,"turf-inside":73,"turf-linestring":101,"turf-planepoint":92,"turf-square":124,"turf-tin":93}],90:[function(t,e){e.exports=t(81)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-isobands/node_modules/turf-grid/index.js":81,"turf-point":91}],91:[function(t,e){e.exports=t(64)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-explode/node_modules/turf-point/index.js":64}],92:[function(t,e){e.exports=t(83)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-isobands/node_modules/turf-planepoint/index.js":83}],93:[function(t,e){function o(t){return t.geometry.coordinates.forEach(function(t){var e=t[0]===t.slice(-1)[0];e||t.push(t[0])}),t}function n(t,e,o){this.a=t,this.b=e,this.c=o;var n,r,i,s,a=e.x-t.x,u=e.y-t.y,p=o.x-t.x,g=o.y-t.y,l=a*(t.x+e.x)+u*(t.y+e.y),h=p*(t.x+o.x)+g*(t.y+o.y),d=2*(a*(o.y-e.y)-u*(o.x-e.x));Math.abs(d)<1e-6?(n=Math.min(t.x,e.x,o.x),r=Math.min(t.y,e.y,o.y),i=.5*(Math.max(t.x,e.x,o.x)-n),s=.5*(Math.max(t.y,e.y,o.y)-r),this.x=n+i,this.y=r+s,this.r=i*i+s*s):(this.x=(g*l-u*h)/d,this.y=(a*h-p*l)/d,i=this.x-t.x,s=this.y-t.y,this.r=i*i+s*s)}function r(t,e){return e.x-t.x}function i(t){var e,o,n,r,i,s=t.length;t:for(;s;)for(o=t[--s],e=t[--s],n=s;n;)if(i=t[--n],r=t[--n],e===r&&o===i||e===i&&o===r){t.splice(s,2),t.splice(n,2),s-=2;continue t}}function s(t){if(t.length<3)return[];t.sort(r);for(var e=t.length-1,o=t[e].x,s=t[0].x,a=t[e].y,u=a;e--;)t[e].y<a&&(a=t[e].y),t[e].y>u&&(u=t[e].y);var p,g,l,h=s-o,d=u-a,c=h>d?h:d,m=.5*(s+o),f=.5*(u+a),y=[new n({x:m-20*c,y:f-c,__sentinel:!0},{x:m,y:f+20*c,__sentinel:!0},{x:m+20*c,y:f-c,__sentinel:!0})],j=[],v=[];for(e=t.length;e--;){for(v.length=0,p=y.length;p--;)h=t[e].x-y[p].x,h>0&&h*h>y[p].r?(j.push(y[p]),y.splice(p,1)):(d=t[e].y-y[p].y,h*h+d*d>y[p].r||(v.push(y[p].a,y[p].b,y[p].b,y[p].c,y[p].c,y[p].a),y.splice(p,1)));for(i(v),p=v.length;p;)l=v[--p],g=v[--p],y.push(new n(g,l,t[e]))}for(Array.prototype.push.apply(j,y),e=j.length;e--;)(j[e].a.__sentinel||j[e].b.__sentinel||j[e].c.__sentinel)&&j.splice(e,1);return j}var a=t("turf-polygon"),u=t("turf-nearest"),p=t("turf-point");e.exports=function(t,e){var n=[];t.features.forEach(function(t){n.push({x:t.geometry.coordinates[0],y:t.geometry.coordinates[1]})});var r=s(n),i={type:"FeatureCollection",features:[]};return r.forEach(function(t){var e=[[[t.a.x,t.a.y],[t.b.x,t.b.y],[t.c.x,t.c.y]]],o=a(e,{a:null,b:null,c:null});i.features.push(o)}),e&&i.features.forEach(function(o){var n=1;o.geometry.coordinates[0].forEach(function(r){var i=u(p(r[0],r[1]),t);1===n?o.properties.a=i.properties[e]:2===n?o.properties.b=i.properties[e]:3===n&&(o.properties.c=i.properties[e]),n++})}),i.features.forEach(function(t){t=o(t)}),i},n.prototype.draw=function(t){t.beginPath(),t.moveTo(this.a.x,this.a.y),t.lineTo(this.b.x,this.b.y),t.lineTo(this.c.x,this.c.y),t.closePath(),t.stroke()}},{"turf-nearest":94,"turf-point":96,"turf-polygon":97}],94:[function(t,e){e.exports=t(85)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-isobands/node_modules/turf-tin/node_modules/turf-nearest/index.js":85,"turf-distance":95}],95:[function(t,e){e.exports=t(86)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-isobands/node_modules/turf-tin/node_modules/turf-nearest/node_modules/turf-distance/index.js":86}],96:[function(t,e){e.exports=t(64)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-explode/node_modules/turf-point/index.js":64}],97:[function(t,e){e.exports=t(31)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-bbox-polygon/node_modules/turf-polygon/index.js":31}],98:[function(t,e){var o=t("simple-statistics");e.exports=function(t,e,n){var r=[],i=[];return t.features.forEach(function(t){void 0!==t.properties[e]&&r.push(t.properties[e])}),i=o.jenks(r,n)}},{"simple-statistics":99}],99:[function(t,e){e.exports=t(12)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-aggregate/node_modules/turf-deviation/node_modules/simple-statistics/src/simple_statistics.js":12}],100:[function(t,e){function o(t,e,o,n,r,i,s,a){var u,p,g,l,h,d={x:null,y:null,onLine1:!1,onLine2:!1};return u=(a-i)*(o-t)-(s-r)*(n-e),0==u?null!=d.x&&null!=d.y?d:!1:(p=e-i,g=t-r,l=(s-r)*p-(a-i)*g,h=(o-t)*p-(n-e)*g,p=l/u,g=h/u,d.x=t+p*(o-t),d.y=e+p*(n-e),p>0&&1>p&&(d.onLine1=!0),g>0&&1>g&&(d.onLine2=!0),d.onLine1&&d.onLine2?[d.x,d.y]:!1)}var n=t("turf-polygon"),r=t("turf-point"),i=t("turf-featurecollection");e.exports=function(t){var e,s={intersections:i([]),fixed:null};e="Feature"===n.type?t.geometry:t;return e.coordinates.forEach(function(t){e.coordinates.forEach(function(e){for(var n=0;n<t.length-1;n++)for(var i=0;i<e.length-1;i++){var a=o(t[n][0],t[n][1],t[n+1][0],t[n+1][1],e[i][0],e[i][1],e[i+1][0],e[i+1][1]);a&&s.intersections.features.push(r(a[0],a[1]))}})}),s}},{"turf-featurecollection":67,"turf-point":114,"turf-polygon":115}],101:[function(t,e){e.exports=t(34)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-bezier/node_modules/turf-linestring/index.js":34}],102:[function(t,e){var o=t("simple-statistics"),n=t("turf-inside");e.exports=function(t,e,r,i){return t.features.forEach(function(t){t.properties||(t.properties={});var s=[];e.features.forEach(function(e){n(e,t)&&s.push(e.properties[r])}),t.properties[i]=o.max(s)}),t}},{"simple-statistics":103,"turf-inside":73}],103:[function(t,e){e.exports=t(49)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-deviation/node_modules/simple-statistics/src/simple_statistics.js":49}],104:[function(t,e){var o=t("simple-statistics"),n=t("turf-inside");e.exports=function(t,e,r,i){return t.features.forEach(function(t){t.properties||(t.properties={});var s=[];e.features.forEach(function(e){n(e,t)&&s.push(e.properties[r])}),t.properties[i]=o.median(s)}),t}},{"simple-statistics":105,"turf-inside":73}],105:[function(t,e){e.exports=t(49)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-deviation/node_modules/simple-statistics/src/simple_statistics.js":49}],106:[function(t,e){var o=t("clone"),n=t("turf-union");e.exports=function(t){for(var e=o(t.features[0]),r=t.features,i=0,s=r.length;s>i;i++){var a=r[i];
a.geometry&&(e=n(e,a))}return e}},{clone:107,"turf-union":133}],107:[function(t,e){(function(t){"use strict";function o(t){return Object.prototype.toString.call(t)}function n(e,o,n,i){function s(e,n){if(null===e)return null;if(0==n)return e;var g,l;if("object"!=typeof e)return e;if(r.isArray(e))g=[];else if(r.isRegExp(e))g=new RegExp(e.source,r.getRegExpFlags(e)),e.lastIndex&&(g.lastIndex=e.lastIndex);else if(r.isDate(e))g=new Date(e.getTime());else{if(p&&t.isBuffer(e))return g=new t(e.length),e.copy(g),g;"undefined"==typeof i?(l=Object.getPrototypeOf(e),g=Object.create(l)):(g=Object.create(i),l=i)}if(o){var h=a.indexOf(e);if(-1!=h)return u[h];a.push(e),u.push(g)}for(var d in e){var c;l&&(c=Object.getOwnPropertyDescriptor(l,d)),c&&null==c.set||(g[d]=s(e[d],n-1))}return g}var a=[],u=[],p="undefined"!=typeof t;return"undefined"==typeof o&&(o=!0),"undefined"==typeof n&&(n=1/0),s(e,n)}var r={isArray:function(t){return Array.isArray(t)||"object"==typeof t&&"[object Array]"===o(t)},isDate:function(t){return"object"==typeof t&&"[object Date]"===o(t)},isRegExp:function(t){return"object"==typeof t&&"[object RegExp]"===o(t)},getRegExpFlags:function(t){var e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),e}};"object"==typeof e&&(e.exports=n),n.clonePrototype=function(t){if(null===t)return null;var e=function(){};return e.prototype=t,new e}}).call(this,t("buffer").Buffer)},{buffer:2}],108:[function(t,e){var o=t("turf-point");e.exports=function(t,e){if(null===t||null===e||t&&null===e)return new Error("Less than two points passed.");var n=t.geometry.coordinates[0],r=e.geometry.coordinates[0],i=t.geometry.coordinates[1],s=e.geometry.coordinates[1],a=n+r,u=a/2,p=i+s,g=p/2,l=o(u,g);return l}},{"turf-point":114}],109:[function(t,e){var o=t("simple-statistics"),n=t("turf-inside");e.exports=function(t,e,r,i){return t.features.forEach(function(t){t.properties||(t.properties={});var s=[];e.features.forEach(function(e){n(e,t)&&s.push(e.properties[r])}),t.properties[i]=o.min(s)}),t}},{"simple-statistics":110,"turf-inside":73}],110:[function(t,e){e.exports=t(49)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-deviation/node_modules/simple-statistics/src/simple_statistics.js":49}],111:[function(t,e){distance=t("turf-distance"),e.exports=function(t,e){var o;return e.features.forEach(function(e){if(o){var n=distance(t,e,"miles");n<o.properties.distance&&(o=e,o.properties.distance=n)}else{o=e;var n=distance(t,e,"miles");o.properties.distance=n}}),delete o.properties.distance,o}},{"turf-distance":50}],112:[function(t,e){e.exports=function(t,e){var o=t.geometry.coordinates[0],n=t.geometry.coordinates[1],r=e.geometry.coordinates[0][0][0],i=e.geometry.coordinates[0][0][1],s=e.properties.a,a=e.geometry.coordinates[0][1][0],u=e.geometry.coordinates[0][1][1],p=e.properties.b,g=e.geometry.coordinates[0][2][0],l=e.geometry.coordinates[0][2][1],h=e.properties.c,d=(h*(o-r)*(n-u)+s*(o-a)*(n-l)+p*(o-g)*(n-i)-p*(o-r)*(n-l)-h*(o-a)*(n-i)-s*(o-g)*(n-u))/((o-r)*(n-u)+(o-a)*(n-l)+(o-g)*(n-i)-(o-r)*(n-l)-(o-a)*(n-i)-(o-g)*(n-u));return d}},{}],113:[function(t,e){function o(t,e,o,n,r,i){var s=Math.sqrt((r-o)*(r-o)+(i-n)*(i-n)),a=Math.sqrt((t-o)*(t-o)+(e-n)*(e-n)),u=Math.sqrt((r-t)*(r-t)+(i-e)*(i-e));return s===a+u?!0:void 0}var n=t("turf-featurecollection"),r=t("turf-center"),i=t("turf-distance"),s=t("turf-inside"),a=t("turf-explode");e.exports=function(t){"FeatureCollection"!=t.type&&("Feature"!=t.type&&(t={type:"Feature",geometry:t}),t=n([t]));for(var e=r(t),u=!1,p=0;!u&&p<t.features.length;){var g=t.features[p].geometry;if("Point"===g.type)e.geometry.coordinates[0]===g.coordinates[0]&&e.geometry.coordinates[1]===g.coordinates[1]&&(u=!0);else if("MultiPoint"===g.type)for(var l=!1,h=0;!l&&h<g.coordinates.length;)e.geometry.coordinates[0]===g.coordinates[h][0]&&e.geometry.coordinates[1]===g.coordinates[h][1]&&(u=!0,l=!0),h++;else if("LineString"===g.type)for(var d=!1,h=0;!d&&h<g.coordinates.length-1;){var c=e.geometry.coordinates[0],m=e.geometry.coordinates[1],f=g.coordinates[h][0],y=g.coordinates[h][1],j=g.coordinates[h+1][0],v=g.coordinates[h+1][1];o(c,m,f,y,j,v)&&(d=!0,u=!0),h++}else if("MultiLineString"===g.type)for(var x=!1,E=0;!x&&E<g.coordinates.length;){for(var d=!1,h=0,I=g.coordinates[E];!d&&h<I.length-1;){var c=e.geometry.coordinates[0],m=e.geometry.coordinates[1],f=I[h][0],y=I[h][1],j=I[h+1][0],v=I[h+1][1];o(c,m,f,y,j,v)&&(d=!0,u=!0),h++}E++}else if("Polygon"===g.type||"MultiPolygon"===g.type){var S={type:"Feature",geometry:g};s(e,S)&&(u=!0)}p++}if(u)return e;for(var L=n([]),p=0;p<t.features.length;p++)L.features=L.features.concat(a(t.features[p]).features);for(var C,N=1/0,p=0;p<L.features.length;p++){var b=i(e,L.features[p],"miles");N>b&&(N=b,C=L.features[p])}return C}},{"turf-center":40,"turf-distance":50,"turf-explode":61,"turf-featurecollection":67,"turf-inside":73}],114:[function(t,e){e.exports=function(t,e,o){if(t instanceof Array)o=e,e=t[1],t=t[0];else if(isNaN(t)||isNaN(e))throw new Error("Invalid coordinates");return{type:"Feature",geometry:{type:"Point",coordinates:[t,e]},properties:o||{}}}},{}],115:[function(t,e){e.exports=function(t,e){if(null===t)return new Error("No coordinates passed");var o={type:"Feature",geometry:{type:"Polygon",coordinates:t},properties:e};return o.properties||(o.properties={}),o}},{}],116:[function(t,e){var o=t("simple-statistics");e.exports=function(t,e,n){var r=[],i=[];return t.features.forEach(function(t){r.push(t.properties[e])}),n.forEach(function(t){i.push(o.quantile(r,.01*t))}),i}},{"simple-statistics":117}],117:[function(t,e){e.exports=t(12)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-aggregate/node_modules/turf-deviation/node_modules/simple-statistics/src/simple_statistics.js":12}],118:[function(t,e){{var o=t("turf-featurecollection");t("./index.js")}e.exports=function(t,e,n,r){var i=o([]);return t.features.forEach(function(t){for(var o=0;o<r.length;o++)t.properties[e]>=r[o][0]&&t.properties[e]<=r[o][1]&&(t.properties[n]=r[o][2]);i.features.push(t)}),i}},{"./index.js":118,"turf-featurecollection":67}],119:[function(t,e){var o=t("turf-featurecollection");e.exports=function(t,e,n){for(var r=o([]),i=0;i<t.features.length;i++)t.features[i].properties[e]!=n&&r.features.push(t.features[i]);return r}},{"turf-featurecollection":67}],120:[function(t,e){function o(t,e){for(var o,n,r=t.slice(0),i=t.length,s=i-e;i-->s;)n=Math.floor((i+1)*Math.random()),o=r[n],r[n]=r[i],r[i]=o;return r.slice(s)}featureCollection=t("turf-featurecollection"),e.exports=function(t,e){var n=featureCollection(o(t.features,e));return n}},{"turf-featurecollection":67}],121:[function(t,e){function o(t,e){return{type:"Feature",geometry:t,properties:e}}var n=t("simplify-js");e.exports=function(t,e,r){if("LineString"===t.geometry.type){var i={type:"LineString",coordinates:[]},s=t.geometry.coordinates.map(function(t){return{x:t[0],y:t[1]}});return i.coordinates=n(s,e,r).map(function(t){return[t.x,t.y]}),o(i,t.properties)}if("Polygon"===t.geometry.type){var a={type:"Polygon",coordinates:[]};return t.geometry.coordinates.forEach(function(t){var o=t.map(function(t){return{x:t[0],y:t[1]}}),i=n(o,e,r).map(function(t){return[t.x,t.y]});a.coordinates.push(i)}),o(a,t.properties)}}},{"simplify-js":122}],122:[function(e,o){!function(){"use strict";function e(t,e){var o=t.x-e.x,n=t.y-e.y;return o*o+n*n}function n(t,e,o){var n=e.x,r=e.y,i=o.x-n,s=o.y-r;if(0!==i||0!==s){var a=((t.x-n)*i+(t.y-r)*s)/(i*i+s*s);a>1?(n=o.x,r=o.y):a>0&&(n+=i*a,r+=s*a)}return i=t.x-n,s=t.y-r,i*i+s*s}function r(t,o){for(var n,r=t[0],i=[r],s=1,a=t.length;a>s;s++)n=t[s],e(n,r)>o&&(i.push(n),r=n);return r!==n&&i.push(n),i}function i(t,e){var o,r,i,s,a=t.length,u="undefined"!=typeof Uint8Array?Uint8Array:Array,p=new u(a),g=0,l=a-1,h=[],d=[];for(p[g]=p[l]=1;l;){for(r=0,o=g+1;l>o;o++)i=n(t[o],t[g],t[l]),i>r&&(s=o,r=i);r>e&&(p[s]=1,h.push(g,s,s,l)),l=h.pop(),g=h.pop()}for(o=0;a>o;o++)p[o]&&d.push(t[o]);return d}function s(t,e,o){var n=void 0!==e?e*e:1;return t=o?t:r(t,n),t=i(t,n)}"function"==typeof t&&t.amd?t(function(){return s}):"undefined"!=typeof o?o.exports=s:"undefined"!=typeof self?self.simplify=s:window.simplify=s}()},{}],123:[function(t,e){e.exports=function(t,e){var o=t[2]-t[0],n=t[3]-t[1],r=o*e,i=n*e,s=r-o,a=i-n,u=t[0]-s/2,p=t[1]-a/2,g=s/2+t[2],l=a/2+t[3],h=[u,p,g,l];return h}},{}],124:[function(t,e){var o=t("turf-midpoint"),n=t("turf-point"),r=t("turf-distance");e.exports=function(t){var e=[0,0,0,0],i=n(t[0],t[1]),s=n(t[0],t[3]),a=(n(t[2],t[3]),n(t[2],t[1])),u=r(i,a,"miles"),p=r(i,s,"miles");if(u>=p){e[0]=t[0],e[2]=t[2];var g=o(i,s);return e[1]=g.geometry.coordinates[1]-(t[2]-t[0])/2,e[3]=g.geometry.coordinates[1]+(t[2]-t[0])/2,e}e[1]=t[1],e[3]=t[3];var l=o(i,a);return e[0]=l.geometry.coordinates[0]-(t[3]-t[1])/2,e[2]=l.geometry.coordinates[0]+(t[3]-t[1])/2,e}},{"turf-distance":125,"turf-midpoint":126,"turf-point":114}],125:[function(t,e){e.exports=t(86)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-isobands/node_modules/turf-tin/node_modules/turf-nearest/node_modules/turf-distance/index.js":86}],126:[function(t,e){var o=t("turf-point");e.exports=function(t,e){if(null===t||null===e||t&&null===e)return new Error("Less than two points passed.");var n=t.geometry.coordinates[0],r=e.geometry.coordinates[0],i=t.geometry.coordinates[1],s=e.geometry.coordinates[1],a=n+r,u=a/2,p=i+s,g=p/2,l=o(u,g);return l}},{"turf-point":127}],127:[function(t,e){e.exports=t(64)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-explode/node_modules/turf-point/index.js":64}],128:[function(t,e){var o=t("simple-statistics"),n=t("turf-inside");e.exports=function(t,e,r,i){return t.features.forEach(function(t){t.properties||(t.properties={});var s=[];e.features.forEach(function(e){n(e,t)&&s.push(e.properties[r])}),t.properties[i]=o.sum(s)}),t}},{"simple-statistics":129,"turf-inside":130}],129:[function(t,e){e.exports=t(12)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-aggregate/node_modules/turf-deviation/node_modules/simple-statistics/src/simple_statistics.js":12}],130:[function(t,e){e.exports=t(8)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-aggregate/node_modules/turf-average/node_modules/turf-inside/index.js":8}],131:[function(t,e){inside=t("turf-inside"),e.exports=function(t,e,o,n){return t.features.forEach(function(t){t.properties||(t.properties={}),e.features.forEach(function(e){if(!t.properties[n]){var r=inside(t,e);t.properties[n]=r?e.properties[o]:null}})}),t}},{"turf-inside":73}],132:[function(t,e,o){arguments[4][93][0].apply(o,arguments)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-isolines/node_modules/turf-tin/index.js":93,"turf-nearest":111,"turf-point":114,"turf-polygon":115}],133:[function(t,e){var o=t("jsts");e.exports=function(t,e){var n=new o.io.GeoJSONReader,r=n.read(JSON.stringify(t.geometry)),i=n.read(JSON.stringify(e.geometry)),s=r.union(i),a=new o.io.GeoJSONParser;return s=a.write(s),{type:"Feature",geometry:s,properties:t.properties}}},{jsts:134}],134:[function(t,e){e.exports=t(36)},{"./lib/jsts":135,"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-buffer/node_modules/jsts/index.js":36,"javascript.util":137}],135:[function(t,e){e.exports=t(37)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-buffer/node_modules/jsts/lib/jsts.js":37}],136:[function(t,e){e.exports=t(38)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-buffer/node_modules/jsts/node_modules/javascript.util/dist/javascript.util-node.min.js":38}],137:[function(t,e){e.exports=t(39)},{"./dist/javascript.util-node.min.js":136,"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-buffer/node_modules/jsts/node_modules/javascript.util/index.js":39}],138:[function(t,e){var o=t("simple-statistics"),n=t("turf-inside");e.exports=function(t,e,r,i){return t.features.forEach(function(t){t.properties||(t.properties={});var s=[];e.features.forEach(function(e){n(e,t)&&s.push(e.properties[r])}),t.properties[i]=o.variance(s)}),t}},{"simple-statistics":139,"turf-inside":73}],139:[function(t,e){e.exports=t(49)},{"/Users/morgan/Documents/projects/turfjs/turf/node_modules/turf-deviation/node_modules/simple-statistics/src/simple_statistics.js":49}],140:[function(t,e){var o=t("turf-inside"),n=t("turf-featurecollection");e.exports=function(t,e){return pointsWithin=n([]),e.features.forEach(function(e){t.features.forEach(function(t){var n=o(t,e);n&&pointsWithin.features.push(t)})}),pointsWithin}},{"turf-featurecollection":67,"turf-inside":73}]},{},[1])(1)});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment