qd-changjing/public/leaflet/libs/turf/turf.min.js

34 lines
785 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*!
* Copyright (c) 2017 TurfJS
* turf.(http://turfjs.org)
* github: https://github.com/Turfjs/turf
* license: MIT
* version: 4.6.1
*/
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.turf=t()}}(function(){var t;return function t(e,n,i){function r(s,a){if(!n[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[s]={exports:{}};e[s][0].call(c.exports,function(t){var n=e[s][1][t];return r(n||t)},c,c.exports,t,e,n,i)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<i.length;s++)r(i[s]);return r}({1:[function(t,e,n){var i=t("@turf/helpers"),r=t("@turf/invariant"),o=t("@turf/meta"),s=t("@turf/clusters"),a={isolines:t("@turf/isolines"),convex:t("@turf/convex"),within:t("@turf/within"),concave:t("@turf/concave"),difference:t("@turf/difference"),dissolve:t("@turf/dissolve"),collect:t("@turf/collect"),flip:t("@turf/flip"),simplify:t("@turf/simplify"),bezier:t("@turf/bezier"),tag:t("@turf/tag"),sample:t("@turf/sample"),envelope:t("@turf/envelope"),square:t("@turf/square"),circle:t("@turf/circle"),midpoint:t("@turf/midpoint"),buffer:t("@turf/buffer"),center:t("@turf/center"),centerOfMass:t("@turf/center-of-mass"),centroid:t("@turf/centroid"),combine:t("@turf/combine"),distance:t("@turf/distance"),explode:t("@turf/explode"),bbox:t("@turf/bbox"),tesselate:t("@turf/tesselate"),bboxPolygon:t("@turf/bbox-polygon"),inside:t("@turf/inside"),intersect:t("@turf/intersect"),nearest:t("@turf/nearest"),planepoint:t("@turf/planepoint"),random:t("@turf/random"),tin:t("@turf/tin"),union:t("@turf/union"),bearing:t("@turf/bearing"),destination:t("@turf/destination"),kinks:t("@turf/kinks"),pointOnSurface:t("@turf/point-on-surface"),area:t("@turf/area"),along:t("@turf/along"),lineDistance:t("@turf/line-distance"),lineSlice:t("@turf/line-slice"),lineSliceAlong:t("@turf/line-slice-along"),pointOnLine:t("@turf/point-on-line"),pointGrid:t("@turf/point-grid"),squareGrid:t("@turf/square-grid"),triangleGrid:t("@turf/triangle-grid"),hexGrid:t("@turf/hex-grid"),idw:t("@turf/idw"),truncate:t("@turf/truncate"),flatten:t("@turf/flatten"),lineIntersect:t("@turf/line-intersect"),mask:t("@turf/mask"),lineChunk:t("@turf/line-chunk"),unkinkPolygon:t("@turf/unkink-polygon"),greatCircle:t("@turf/great-circle"),lineSegment:t("@turf/line-segment"),lineSplit:t("@turf/line-split"),lineArc:t("@turf/line-arc"),polygonToLineString:t("@turf/polygon-to-linestring"),lineStringToPolygon:t("@turf/linestring-to-polygon"),bboxClip:t("@turf/bbox-clip"),lineOverlap:t("@turf/line-overlap"),sector:t("@turf/sector"),rhumbBearing:t("@turf/rhumb-bearing"),rhumbDistance:t("@turf/rhumb-distance"),rhumbDestination:t("@turf/rhumb-destination"),polygonTangents:t("@turf/polygon-tangents"),rewind:t("@turf/rewind"),isobands:t("@turf/isobands"),transformRotate:t("@turf/transform-rotate"),transformScale:t("@turf/transform-scale"),transformTranslate:t("@turf/transform-translate"),lineOffset:t("@turf/line-offset"),polygonize:t("@turf/polygonize"),booleanDisjoint:t("@turf/boolean-disjoint"),booleanContains:t("@turf/boolean-contains"),booleanCrosses:t("@turf/boolean-crosses"),booleanClockwise:t("@turf/boolean-clockwise"),booleanOverlap:t("@turf/boolean-overlap"),booleanPointOnLine:t("@turf/boolean-point-on-line"),booleanEqual:t("@turf/boolean-equal"),clone:t("@turf/clone"),cleanCoords:t("@turf/clean-coords"),interpolate:t("@turf/interpolate"),clustersDbscan:t("@turf/clusters-dbscan"),clustersKmeans:t("@turf/clusters-kmeans"),getCluster:s.getCluster,clusterEach:s.clusterEach,clusterReduce:s.clusterReduce,point:i.point,polygon:i.polygon,lineString:i.lineString,multiPoint:i.multiPoint,multiPolygon:i.multiPolygon,multiLineString:i.multiLineString,feature:i.feature,geometry:i.geometry,featureCollection:i.featureCollection,geometryCollection:i.geometryCollection,radiansToDistance:i.radiansToDistance,distanceToRadians:i.distanceToRadians,distanceToDegrees:i.distanceToDegrees,bearingToAngle:i.bearingToAngle,degrees2radians:i.degrees2radians,radians2degrees:i.radians2degrees,convertDistance:i.convertDistance,round:i.round,convertArea:i.convertArea,getCoord:r.getCoord,getCoords:r.getCoords,geojsonType:r.geojsonType,featureOf:r.featureOf,collectionOf:r.collectionOf,containsNumber:r.containsNumber,getGeom:r.getGeom,getGeomType:r.getGeomType,coordEach:o.coordEach,coordReduce:o.coordReduce,propEach:o.propEach,propReduce:o.propReduce,featureEach:o.featureEach,featureReduce:o.featureReduce,coordAll:o.coordAll,geomEach:o.geomEach,geomReduce:o.geomReduce,flattenEach:o.flattenEach,flattenReduce:o.flattenReduce,segmentReduce:o.segmentReduce,segmentEach:o.segmentEach};e.exports=a},{"@turf/along":2,"@turf/area":12,"@turf/bbox":22,"@turf/bbox-clip":16,"@turf/bbox-polygon":20,"@turf/bearing":24,"@turf/bezier":26,"@turf/boolean-clockwise":29,"@turf/boolean-contains":31,"@turf/boolean-crosses":37,"@turf/boolean-disjoint":57,"@turf/boolean-equal":76,"@turf/boolean-overlap":85,"@turf/boolean-point-on-line":119,"@turf/buffer":121,"@turf/center":160,"@turf/center-of-mass":131,"@turf/centroid":164,"@turf/circle":167,"@turf/clean-coords":172,"@turf/clone":175,"@turf/clusters":194,"@turf/clusters-dbscan":176,"@turf/clusters-kmeans":189,"@turf/collect":197,"@turf/combine":204,"@turf/concave":206,"@turf/convex":214,"@turf/destination":233,"@turf/difference":236,"@turf/dissolve":245,"@turf/distance":256,"@turf/envelope":259,"@turf/explode":264,"@turf/flatten":267,"@turf/flip":270,"@turf/great-circle":273,"@turf/helpers":275,"@turf/hex-grid":276,"@turf/idw":281,"@turf/inside":297,"@turf/interpolate":299,"@turf/intersect":337,"@turf/invariant":339,"@turf/isobands":340,"@turf/isolines":356,"@turf/kinks":366,"@turf/line-arc":368,"@turf/line-chunk":378,"@turf/line-distance":396,"@turf/line-intersect":401,"@turf/line-offset":413,"@turf/line-overlap":418,"@turf/line-segment":433,"@turf/line-slice":447,"@turf/line-slice-along":437,"@turf/line-split":473,"@turf/linestring-to-polygon":526,"@turf/mask":531,"@turf/meta":540,"@turf/midpoint":541,"@turf/nearest":550,"@turf/planepoint":554,"@turf/point-grid":556,"@turf/point-on-line":566,"@turf/point-on-surface":590,"@turf/polygon-tangents":604,"@turf/polygon-to-linestring":607,"@turf/polygonize":610,"@turf/random":624,"@turf/rewind":626,"@turf/rhumb-bearing":631,"@turf/rhumb-destination":643,"@turf/rhumb-distance":656,"@turf/sample":669,"@turf/sector":671,"@turf/simplify":690,"@turf/square":699,"@turf/square-grid":692,"@turf/tag":703,"@turf/tesselate":706,"@turf/tin":709,"@turf/transform-rotate":711,"@turf/transform-scale":755,"@turf/transform-translate":806,"@turf/triangle-grid":822,"@turf/truncate":827,"@turf/union":829,"@turf/unkink-polygon":831,"@turf/within":849}],2:[function(t,e,n){var i=t("@turf/distance"),r=t("@turf/helpers").point,o=t("@turf/bearing"),s=t("@turf/destination");e.exports=function(t,e,n){var a;if("Feature"===t.type)a=t.geometry.coordinates;else{if("LineString"!==t.type)throw new Error("input must be a LineString Feature or Geometry");a=t.coordinates}for(var u=0,l=0;l<a.length&&!(e>=u&&l===a.length-1);l++){if(u>=e){var c=e-u;if(c){var h=o(a[l],a[l-1])-180;return s(a[l],c,h,n)}return r(a[l])}u+=i(a[l],a[l+1],n)}return r(a[a.length-1])}},{"@turf/bearing":3,"@turf/destination":5,"@turf/distance":8,"@turf/helpers":11}],3:[function(t,e,n){function i(t,e,n){if(!0===n)return r(t,e);var i=Math.PI/180,s=180/Math.PI,a=o(t),u=o(e),l=i*a[0],c=i*u[0],h=i*a[1],f=i*u[1],p=Math.sin(c-l)*Math.cos(f),d=Math.cos(h)*Math.sin(f)-Math.sin(h)*Math.cos(f)*Math.cos(c-l);return s*Math.atan2(p,d)}function r(t,e){var n=i(e,t);return n=(n+180)%360}var o=t("@turf/invariant").getCoord;e.exports=i},{"@turf/invariant":4}],4:[function(t,e,n){function i(t){if(!t)throw new Error("obj is required");var e=r(t);if(e.length>1&&"number"==typeof e[0]&&"number"==typeof e[1])return e;throw new Error("Coordinate is not a valid Point")}function r(t){if(!t)throw new Error("obj is required");var e;if(t.length?e=t:t.coordinates?e=t.coordinates:t.geometry&&t.geometry.coordinates&&(e=t.geometry.coordinates),e)return o(e),e;throw new Error("No valid coordinates")}function o(t){if(t.length>1&&"number"==typeof t[0]&&"number"==typeof t[1])return!0;if(Array.isArray(t[0])&&t[0].length)return o(t[0]);throw new Error("coordinates must only contain numbers")}function s(t,e,n){if(!e||!n)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.type)}function a(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)}function u(t,e,n){if(!t)throw new Error("No featureCollection passed");if(!n)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+n+", FeatureCollection required");for(var i=0;i<t.features.length;i++){var r=t.features[i];if(!r||"Feature"!==r.type||!r.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!r.geometry||r.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+r.geometry.type)}}function l(t){if(!t)throw new Error("geojson is required");if(void 0!==t.geometry)return t.geometry;if(t.coordinates||t.geometries)return t;throw new Error("geojson must be a valid Feature or Geometry Object")}function c(t){if(!t)throw new Error("geojson is required");var e=l(t);if(e)return e.type}e.exports={geojsonType:s,collectionOf:u,featureOf:a,getCoord:i,getCoords:r,containsNumber:o,getGeom:l,getGeomType:c}},{}],5:[function(t,e,n){var i=t("@turf/invariant").getCoord,r=t("@turf/helpers"),o=r.point,s=r.distanceToRadians;e.exports=function(t,e,n,r){var a=Math.PI/180,u=180/Math.PI,l=i(t),c=a*l[0],h=a*l[1],f=a*n,p=s(e,r),d=Math.asin(Math.sin(h)*Math.cos(p)+Math.cos(h)*Math.sin(p)*Math.cos(f)),g=c+Math.atan2(Math.sin(f)*Math.sin(p)*Math.cos(h),Math.cos(p)-Math.sin(h)*Math.sin(d));return o([u*g,u*d])}},{"@turf/helpers":6,"@turf/invariant":7}],6:[function(t,e,n){function i(t,e,n,i){if(void 0===t)throw new Error("geometry is required");if(e&&e.constructor!==Object)throw new Error("properties must be an Object");var r={type:"Feature",properties:e||{},geometry:t};if(n){if(4!==n.length)throw new Error("bbox must be an Array of 4 numbers");r.bbox=n}return i&&(r.id=i),r}function r(t,e,n){if(!t)throw new Error("type is required");if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");var i;switch(t){case"Point":i=o(e).geometry;break;case"LineString":i=a(e).geometry;break;case"Polygon":i=s(e).geometry;break;case"MultiPoint":i=c(e).geometry;break;case"MultiLineString":i=l(e).geometry;break;case"MultiPolygon":i=h(e).geometry;break;default:throw new Error(t+" is invalid")}if(n){if(4!==n.length)throw new Error("bbox must be an Array of 4 numbers");i.bbox=n}return i}function o(t,e,n,r){if(!t)throw new Error("No coordinates passed");if(void 0===t.length)throw new Error("Coordinates must be an array");if(t.length<2)throw new Error("Coordinates must be at least 2 numbers long");if("number"!=typeof t[0]||"number"!=typeof t[1])throw new Error("Coordinates must contain numbers");return i({type:"Point",coordinates:t},e,n,r)}function s(t,e,n,r){if(!t)throw new Error("No coordinates passed");for(var o=0;o<t.length;o++){var s=t[o];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<s[s.length-1].length;a++)if(s[s.length-1][a]!==s[0][a])throw new Error("First and last Position are not equivalent.")}return i({type:"Polygon",coordinates:t},e,n,r)}function a(t,e,n,r){if(!t)throw new Error("No coordinates passed");if(t.length<2)throw new Error("Coordinates must be an array of two or more positions");return i({type:"LineString",coordinates:t},e,n,r)}function u(t,e){if(!t)throw new Error("No features passed");if(!Array.isArray(t))throw new Error("features must be an Array");var n={type:"FeatureCollection",features:t};return e&&(n.bbox=e),n}function l(t,e,n,r){if(!t)throw new Error("No coordinates passed");return i({type:"MultiLineString",coordinates:t},e,n,r)}function c(t,e,n,r){if(!t)throw new Error("No coordinates passed");return i({type:"MultiPoint",coordinates:t},e,n,r)}function h(t,e,n,r){if(!t)throw new Error("No coordinates passed");return i({type:"MultiPolygon",coordinates:t},e,n,r)}function f(t,e,n,r){if(!t)throw new Error("geometries is required");if(!Array.isArray(t))throw new Error("geometries must be an Array");return i({type:"GeometryCollection",geometries:t},e,n,r)}function p(t,e){if(void 0===t||null===t||isNaN(t))throw new Error("num is required");if(e&&!(e>=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n}function d(t,e){if(void 0===t||null===t)throw new Error("radians is required");var n=b[e||"kilometers"];if(!n)throw new Error("units is invalid");return t*n}function g(t,e){if(void 0===t||null===t)throw new Error("distance is required");var n=b[e||"kilometers"];if(!n)throw new Error("units is invalid");return t/n}function v(t,e){return m(g(t,e))}function y(t){if(null===t||void 0===t)throw new Error("bearing is required");var e=t%360;return e<0&&(e+=360),e}function m(t){if(null===t||void 0===t)throw new Error("radians is required");return t%(2*Math.PI)*180/Math.PI}function x(t){if(null===t||void 0===t)throw new Error("degrees is required");return t%360*Math.PI/180}function E(t,e,n){if(null===t||void 0===t)throw new Error("distance is required");if(!(t>=0))throw new Error("distance must be a positive number");return d(g(t,e),n||"kilometers")}function w(t,e,n){if(null===t||void 0===t)throw new Error("area is required");if(!(t>=0))throw new Error("area must be a positive number");var i=I[e||"meters"];if(!i)throw new Error("invalid original units");var r=I[n||"kilometers"];if(!r)throw new Error("invalid final units");return t/i*r}var b={miles:3960,nauticalmiles:3441.145,degrees:57.2957795,radians:1,inches:250905600,yards:6969600,meters:6373e3,metres:6373e3,centimeters:6373e5,centimetres:6373e5,kilometers:6373,kilometres:6373,feet:20908792.65},I={kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,centimetres:1e4,millimeter:1e6,acres:247105e-9,miles:3.86e-7,yards:1.195990046,feet:10.763910417,inches:1550.003100006};e.exports={feature:i,geometry:r,featureCollection:u,geometryCollection:f,point:o,multiPoint:c,lineString:a,multiLineString:l,polygon:s,multiPolygon:h,radiansToDistance:d,distanceToRadians:g,distanceToDegrees:v,radians2degrees:m,degrees2radians:x,bearingToAngle:y,convertDistance:E,convertArea:w,round:p}},{}],7:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],8:[function(t,e,n){var i=t("@turf/invariant").getCoord,r=t("@turf/helpers").radiansToDistance;e.exports=function(t,e,n){var o=Math.PI/180,s=i(t),a=i(e),u=o*(a[1]-s[1]),l=o*(a[0]-s[0]),c=o*s[1],h=o*a[1],f=Math.pow(Math.sin(u/2),2)+Math.pow(Math.sin(l/2),2)*Math.cos(c)*Math.cos(h);return r(2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f)),n)}},{"@turf/helpers":9,"@turf/invariant":10}],9:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],10:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],11:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],12:[function(t,e,n){var i=t("@mapbox/geojson-area").geometry,r=t("@turf/meta").geomReduce;e.exports=function(t){return r(t,function(t,e){return t+i(e)},0)}},{"@mapbox/geojson-area":13,"@turf/meta":14}],13:[function(t,e,n){function i(t){var e,n=0;switch(t.type){case"Polygon":return r(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)n+=r(t.coordinates[e]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(e=0;e<t.geometries.length;e++)n+=i(t.geometries[e]);return n}}function r(t){var e=0;if(t&&t.length>0){e+=Math.abs(o(t[0]));for(var n=1;n<t.length;n++)e-=Math.abs(o(t[n]))}return e}function o(t){var e,n,i,r,o,u,l,c=0,h=t.length;if(h>2){for(l=0;l<h;l++)l===h-2?(r=h-2,o=h-1,u=0):l===h-1?(r=h-1,o=0,u=1):(r=l,o=l+1,u=l+2),e=t[r],n=t[o],i=t[u],c+=(s(i[0])-s(e[0]))*Math.sin(s(n[1]));c=c*a.RADIUS*a.RADIUS/2}return c}function s(t){return t*Math.PI/180}var a=t("wgs84");e.exports.geometry=i,e.exports.ring=o},{wgs84:15}],14:[function(t,e,n){function i(t,e,n){if(null!==t){var r,o,s,a,u,l,c,h,f,p,d=0,g=0,v=t.type,y="FeatureCollection"===v,m="Feature"===v,x=y?t.features.length:1;for(r=0;r<x;r++){var E=0;for(f=y?t.features[r].geometry:m?t.geometry:t,p=!!f&&"GeometryCollection"===f.type,c=p?f.geometries.length:1,o=0;o<c;o++)if(null!==(l=p?f.geometries[o]:f)){h=l.coordinates;var w=l.type;switch(d=!n||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":e(h,g,r,E),g++,E++;break;case"LineString":case"MultiPoint":for(s=0;s<h.length;s++)e(h[s],g,r,E),g++,E++;break;case"Polygon":case"MultiLineString":for(s=0;s<h.length;s++)for(a=0;a<h[s].length-d;a++)e(h[s][a],g,r,E),g++,E++;break;case"MultiPolygon":for(s=0;s<h.length;s++)for(a=0;a<h[s].length;a++)for(u=0;u<h[s][a].length-d;u++)e(h[s][a][u],g,r,E),g++,E++;break;case"GeometryCollection":for(s=0;s<l.geometries.length;s++)i(l.geometries[s],e,n);break;default:throw new Error("Unknown Geometry Type")}}}}}function r(t,e,n,r){var o=n;return i(t,function(t,i,r,s){o=0===i&&void 0===n?t:e(o,t,i,r,s)},r),o}function o(t,e){var n;switch(t.type){case"FeatureCollection":for(n=0;n<t.features.length;n++)e(t.features[n].properties,n);break;case"Feature":e(t.properties,0)}}function s(t,e,n){var i=n;return o(t,function(t,r){i=0===r&&void 0===n?t:e(i,t,r)}),i}function a(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)e(t.features[n],n)}function u(t,e,n){var i=n;return a(t,function(t,r){i=0===r&&void 0===n?t:e(i,t,r)}),i}function l(t){var e=[];return i(t,function(t){e.push(t)}),e}function c(t,e){var n,i,r,o,s,a,u,l,c=0,h="FeatureCollection"===t.type,f="Feature"===t.type,p=h?t.features.length:1;for(n=0;n<p;n++)for(a=h?t.features[n].geometry:f?t.geometry:t,l=h?t.features[n].properties:f?t.properties:{},u=!!a&&"GeometryCollection"===a.type,s=u?a.geometries.length:1,r=0;r<s;r++)if(null!==(o=u?a.geometries[r]:a))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":e(o,c,l),c++;break;case"GeometryCollection":for(i=0;i<o.geometries.length;i++)e(o.geometries[i],c,l),c++;break;default:throw new Error("Unknown Geometry Type")}else e(null,c,l),c++}function h(t,e,n){var i=n;return c(t,function(t,r,o){i=0===r&&void 0===n?t:e(i,t,r,o)}),i}function f(t,e){c(t,function(t,n,i){var r=null===t?null:t.type;switch(r){case null:case"Point":case"LineString":case"Polygon":return void e(v(t,i),n,0)}var o;switch(r){case"MultiPoint":o="Point";break;case"MultiLineString":o="LineString";break;case"MultiPolygon":o="Polygon"}t.coordinates.forEach(function(t,r){e(v({type:o,coordinates:t},i),n,r)})})}function p(t,e,n){var i=n;return f(t,function(t,r,o){i=0===r&&0===o&&void 0===n?t:e(i,t,r,o)}),i}function d(t,e){f(t,function(t,n){var i=0;if(t.geometry){var o=t.geometry.type;"Point"!==o&&"MultiPoint"!==o&&r(t,function(r,o){var s=y([r,o],t.properties);return e(s,n,i),i++,o})}})}function g(t,e,n){var i=n;return d(t,function(t,r,o){i=0===r&&void 0===n?t:e(i,t,r,o)}),i}function v(t,e){if(void 0===t)throw new Error("No geometry passed");return{type:"Feature",properties:e||{},geometry:t}}function y(t,e){if(!t)throw new Error("No coordinates passed");if(t.length<2)throw new Error("Coordinates must be an array of two or more positions");return{type:"Feature",properties:e||{},geometry:{type:"LineString",coordinates:t}}}e.exports={coordEach:i,coordReduce:r,propEach:o,propReduce:s,featureEach:a,featureReduce:u,coordAll:l,geomEach:c,geomReduce:h,flattenEach:f,flattenReduce:p,segmentEach:d,segmentReduce:g}},{}],15:[function(t,e,n){e.exports.RADIUS=6378137,e.exports.FLATTENING=1/298.257223563,e.exports.POLAR_RADIUS=6356752.3142},{}],16:[function(t,e,n){function i(t,e){for(var n=[],i=0;i<t.length;i++){var r=s.polygon(t[i],e);r.length>0&&(r[0][0]===r[r.length-1][0]&&r[0][1]===r[r.length-1][1]||r.push(r[0]),n.push(r))}return n}function r(t){return t.geometry?t.geometry.type:t.type}var o=t("@turf/helpers"),s=t("lineclip"),a=t("@turf/invariant").getCoords,u=o.lineString,l=o.multiLineString,c=o.polygon,h=o.multiPolygon;e.exports=function(t,e){var n=r(t),o=a(t),f=t.properties;switch(n){case"LineString":case"MultiLineString":var p=[];return"LineString"===n&&(o=[o]),o.forEach(function(t){s(t,e,p)}),1===p.length?u(p[0],f):l(p,f);case"Polygon":return c(i(o,e),f);case"MultiPolygon":return h(o.map(function(t){return i(t,e)}),f);default:throw new Error("geometry "+n+" not supported")}}},{"@turf/helpers":17,"@turf/invariant":18,lineclip:19}],17:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],18:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],19:[function(t,e,n){"use strict";function i(t,e,n){var i,r,a,u,l,c=t.length,h=s(t[0],e),f=[];for(n||(n=[]),i=1;i<c;i++){for(r=t[i-1],a=t[i],u=l=s(a,e);;){if(!(h|u)){f.push(r),u!==l?(f.push(a),i<c-1&&(n.push(f),f=[])):i===c-1&&f.push(a);break}if(h&u)break;h?(r=o(r,a,h,e),h=s(r,e)):(a=o(r,a,u,e),u=s(a,e))}h=l}return f.length&&n.push(f),n}function r(t,e){var n,i,r,a,u,l,c;for(i=1;i<=8;i*=2){for(n=[],r=t[t.length-1],a=!(s(r,e)&i),u=0;u<t.length;u++)l=t[u],c=!(s(l,e)&i),c!==a&&n.push(o(r,l,i,e)),c&&n.push(l),r=l,a=c;if(t=n,!t.length)break}return n}function o(t,e,n,i){return 8&n?[t[0]+(e[0]-t[0])*(i[3]-t[1])/(e[1]-t[1]),i[3]]:4&n?[t[0]+(e[0]-t[0])*(i[1]-t[1])/(e[1]-t[1]),i[1]]:2&n?[i[2],t[1]+(e[1]-t[1])*(i[2]-t[0])/(e[0]-t[0])]:1&n?[i[0],t[1]+(e[1]-t[1])*(i[0]-t[0])/(e[0]-t[0])]:null}function s(t,e){var n=0;return t[0]<e[0]?n|=1:t[0]>e[2]&&(n|=2),t[1]<e[1]?n|=4:t[1]>e[3]&&(n|=8),n}e.exports=i,i.polyline=i,i.polygon=r},{}],20:[function(t,e,n){var i=t("@turf/helpers").polygon;e.exports=function(t){var e=[t[0],t[1]],n=[t[0],t[3]],r=[t[2],t[3]],o=[t[2],t[1]];return i([[e,o,r,n,e]])}},{"@turf/helpers":21}],21:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],22:[function(t,e,n){var i=t("@turf/meta").coordEach;e.exports=function(t){var e=[1/0,1/0,-1/0,-1/0];return i(t,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}},{"@turf/meta":23}],23:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],24:[function(t,e,n){arguments[4][3][0].apply(n,arguments)},{"@turf/invariant":25,dup:3}],25:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],26:[function(t,e,n){var i=t("@turf/helpers").lineString,r=t("./spline.js");e.exports=function(t,e,n){for(var o=[],s=new r({points:t.geometry.coordinates.map(function(t){return{x:t[0],y:t[1]}}),duration:e,sharpness:n}),a=0;a<s.duration;a+=10){var u=s.pos(a);Math.floor(a/100)%2==0&&o.push([u.x,u.y])}return i(o,t.properties)}},{"./spline.js":28,"@turf/helpers":27}],27:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],28:[function(t,e,n){var i=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 n=this.points[e],i=this.points[e+1];this.centers.push({x:(n.x+i.x)/2,y:(n.y+i.y)/2,z:(n.z+i.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var e=0;e<this.centers.length-1;e++){var n=this.centers[e],i=this.centers[e+1],r=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,o=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+o),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+o),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};i.prototype.cacheSteps=function(t){var e=[],n=this.pos(0);e.push(0);for(var i=0;i<this.duration;i+=10){var r=this.pos(i);Math.sqrt((r.x-n.x)*(r.x-n.x)+(r.y-n.y)*(r.y-n.y)+(r.z-n.z)*(r.z-n.z))>t&&(e.push(i),n=r)}return e},i.prototype.vector=function(t){var e=this.pos(t+10),n=this.pos(t-10);return{angle:180*Math.atan2(e.y-n.y,e.x-n.x)/3.14,speed:Math.sqrt((n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y)+(n.z-e.z)*(n.z-e.z))}},i.prototype.pos=function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var n=e/this.duration;if(n>=1)return this.points[this.length-1];var i=Math.floor((this.points.length-1)*n),r=(this.length-1)*n-i;return function(t,e,n,i,r){var o=function(t){var e=t*t;return[e*t,3*e*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]}(t);return{x:r.x*o[0]+i.x*o[1]+n.x*o[2]+e.x*o[3],y:r.y*o[0]+i.y*o[1]+n.y*o[2]+e.y*o[3],z:r.z*o[0]+i.z*o[1]+n.z*o[2]+e.z*o[3]}}(r,this.points[i],this.controls[i][1],this.controls[i+1][0],this.points[i+1])},e.exports=i},{}],29:[function(t,e,n){var i=t("@turf/invariant"),r=i.getCoords;e.exports=function(t){if(!t)throw new Error("line is required");var e=t.geometry?t.geometry.type:t.type;if(!Array.isArray(t)&&"LineString"!==e)throw new Error("geometry must be a LineString");for(var n,i,o=r(t),s=0,a=1;a<o.length;)n=i||o[0],i=o[a],s+=(i[0]-n[0])*(i[1]+n[1]),a++;return s>0}},{"@turf/invariant":30}],30:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],31:[function(t,e,n){function i(t,e){var n,i=!1;for(n=0;n<t.coordinates.length;n++)if(p(t.coordinates[n],e.coordinates)){i=!0;break}return i}function r(t,e){for(var n=0,i=0;i<e.coordinates.length;i++){for(var r=!1,o=0;o<t.coordinates.length;o++)if(p(e.coordinates[i],t.coordinates[o])){n++,r=!0;break}if(!r)return!1}return n>0}function o(t,e,n){for(var i=!1,r=0;r<t.coordinates.length-1;r++){var o=!0;if(0!==r&&r!==t.coordinates.length-2||!n||(o=!1),h(t.coordinates[r],t.coordinates[r+1],e.coordinates,o)){i=!0;break}}return i}function s(t,e){for(var n=!0,i=!1,r=0;r<e.coordinates.length;r++){for(var o=!1,s=0;s<t.coordinates.length-1;s++)if(h(t.coordinates[s],t.coordinates[s+1],e.coordinates[r],!0)){!i&&h(t.coordinates[s],t.coordinates[s+1],e.coordinates[r],!1)&&(i=!0),o=!0;break}if(!o){n=!1;break}}return n&&i}function a(t,e){for(var n=!0,i=0;i<e.coordinates.length;i++){if(!g(e.coordinates[1],t,!0)){n=!1;break}}return n}function u(t,e){for(var n=!0,i=0;i<e.coordinates.length;i++){if(!o(t,{type:"Point",coordinates:e.coordinates[i]},!1)){n=!1;break}}return n}function l(t,e){var n=!1,i=0,r=e.coordinates.length;if(!f(v(t),v(e)))return!1;for(i;i<r-1;i++){var o=d(e.coordinates[i],e.coordinates[i+1]);if(g({type:"Point",coordinates:o},t,!0)){n=!0;break}}return n}function c(t,e){return!!f(v(t),v(e))}function h(t,e,n,i){var r=n[0]-t[0],o=n[1]-t[1],s=e[0]-t[0],a=e[1]-t[1];return 0==r*a-o*s&&(i?Math.abs(s)>=Math.abs(a)?s>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:a>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1]:Math.abs(s)>=Math.abs(a)?s>0?t[0]<n[0]&&n[0]<e[0]:e[0]<n[0]&&n[0]<t[0]:a>0?t[1]<n[1]&&n[1]<e[1]:e[1]<n[1]&&n[1]<t[1])}function f(t,e){return!(t[0]>e[0])&&(!(t[2]<e[2])&&(!(t[1]>e[1])&&!(t[3]<e[3])))}function p(t,e){return t[0]===e[0]&&t[1]===e[1]}function d(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}var g=t("@turf/inside"),v=t("@turf/bbox"),y=t("@turf/invariant"),m=y.getGeom,x=y.getCoords,E=y.getGeomType;e.exports=function(t,e){var n=E(t),h=E(e),f=m(t),d=m(e),v=x(t),y=x(e);switch(n){case"Point":switch(h){case"Point":return p(v,y);default:throw new Error("feature2 "+h+" geometry not supported")}case"MultiPoint":switch(h){case"Point":return i(f,d);case"MultiPoint":return r(f,d);default:throw new Error("feature2 "+h+" geometry not supported")}case"LineString":switch(h){case"Point":return o(f,d,!0);case"LineString":return u(f,d);case"MultiPoint":return s(f,d);default:throw new Error("feature2 "+h+" geometry not supported")}case"Polygon":switch(h){case"Point":return g(d,f,!0);case"LineString":return l(f,d);case"Polygon":return c(f,d);case"MultiPoint":return a(f,d);default:throw new Error("feature2 "+h+" geometry not supported")}default:throw new Error("feature1 "+n+" geometry not supported")}}},{"@turf/bbox":32,"@turf/inside":34,"@turf/invariant":36}],32:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"@turf/meta":33,dup:22}],33:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],34:[function(t,e,n){function i(t,e,n){var i=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var r=0,o=e.length-1;r<e.length;o=r++){var s=e[r][0],a=e[r][1],u=e[o][0],l=e[o][1];if(t[1]*(s-u)+a*(u-t[0])+l*(t[0]-s)==0&&(s-t[0])*(u-t[0])<=0&&(a-t[1])*(l-t[1])<=0)return!n;a>t[1]!=l>t[1]&&t[0]<(u-s)*(t[1]-a)/(l-a)+s&&(i=!i)}return i}function r(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}var o=t("@turf/invariant"),s=o.getCoord,a=o.getCoords;e.exports=function(t,e,n){if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var o=s(t),u=a(e),l=e.geometry?e.geometry.type:e.type,c=e.bbox;if(c&&!1===r(o,c))return!1;"Polygon"===l&&(u=[u]);for(var h=0,f=!1;h<u.length&&!f;h++)if(i(o,u[h][0],n)){for(var p=!1,d=1;d<u[h].length&&!p;)i(o,u[h][d],!n)&&(p=!0),d++;p||(f=!0)}return f}},{"@turf/invariant":35}],35:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],36:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],37:[function(t,e,n){function i(t,e){for(var n=!1,i=!1,r=t.coordinates.length,o=0;o<r&&!n&&!i;){for(var s=0;s<e.coordinates.length-1;s++){var a=!0;0!==s&&s!==e.coordinates.length-2||(a=!1),u(e.coordinates[s],e.coordinates[s+1],t.coordinates[o],a)?n=!0:i=!0}o++}return n&&i}function r(t,e){if(h(t,e).features.length>0)for(var n=0;n<t.coordinates.length-1;n++)for(var i=0;i<e.coordinates.length-1;i++){var r=!0;if(0!==i&&i!==e.coordinates.length-2||(r=!1),u(t.coordinates[n],t.coordinates[n+1],e.coordinates[i],r))return!0}return!1}function o(t,e){return h(t,f(e)).features.length>0}function s(t,e){return c(e,t)}function a(t,e){for(var n=!1,i=!1,r=t.coordinates[0].length,o=0;o<r&&n&&i;)s(e,l.point(t.coordinates[0][o]),!0)?n=!0:i=!0,o++;return i&&i}function u(t,e,n,i){var r=n[0]-t[0],o=n[1]-t[1],s=e[0]-t[0],a=e[1]-t[1];return 0==r*a-o*s&&(i?Math.abs(s)>=Math.abs(a)?s>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:a>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1]:Math.abs(s)>=Math.abs(a)?s>0?t[0]<n[0]&&n[0]<e[0]:e[0]<n[0]&&n[0]<t[0]:a>0?t[1]<n[1]&&n[1]<e[1]:e[1]<n[1]&&n[1]<t[1])}var l=t("@turf/helpers"),c=t("@turf/inside"),h=t("@turf/line-intersect"),f=t("@turf/polygon-to-linestring"),p=t("@turf/invariant"),d=p.getGeom,g=p.getGeomType;e.exports=function(t,e){var n=g(t),s=g(e),u=d(t),l=d(e);switch(n){case"MultiPoint":switch(s){case"LineString":return i(u,l);case"Polygon":return a(u,l);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"MultiPoint":return i(l,u);case"LineString":return r(u,l);case"Polygon":return o(u,l);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"MultiPoint":return a(l,u);case"LineString":return o(l,u);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+n+" geometry not supported")}}},{"@turf/helpers":38,"@turf/inside":39,
"@turf/invariant":41,"@turf/line-intersect":42,"@turf/polygon-to-linestring":54}],38:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],39:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{"@turf/invariant":40,dup:34}],40:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],41:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],42:[function(t,e,n){function i(t,e){var n=a(t),i=a(e);if(2!==n.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==i.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var r=n[0][0],o=n[0][1],s=n[1][0],u=n[1][1],c=i[0][0],h=i[0][1],f=i[1][0],p=i[1][1],d=(p-h)*(s-r)-(f-c)*(u-o),g=(f-c)*(o-h)-(p-h)*(r-c),v=(s-r)*(o-h)-(u-o)*(r-c);if(0===d)return null;var y=g/d,m=v/d;if(y>=0&&y<=1&&m>=0&&m<=1){return l([r+y*(s-r),o+y*(u-o)])}return null}var r=t("@turf/meta"),o=t("geojson-rbush"),s=t("@turf/helpers"),a=t("@turf/invariant").getCoords,u=t("@turf/line-segment"),l=s.point,c=r.featureEach,h=s.featureCollection;e.exports=function(t,e){var n={},r=[];if("LineString"===t.type&&(t=s.feature(t)),"LineString"===e.type&&(e=s.feature(e)),"Feature"===t.type&&"Feature"===e.type&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length){var l=i(t,e);return l&&r.push(l),h(r)}var f=o();return f.load(u(e)),c(u(t),function(t){c(f.search(t),function(e){var o=i(t,e);if(o){var s=a(o).join(",");n[s]||(n[s]=!0,r.push(o))}})}),h(r)}},{"@turf/helpers":44,"@turf/invariant":45,"@turf/line-segment":46,"@turf/meta":50,"geojson-rbush":51}],43:[function(t,e,n){var i=t("@turf/meta").coordEach;e.exports=function(t){var e=[1/0,1/0,-1/0,-1/0];return i(t,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}},{"@turf/meta":50}],44:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],45:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],46:[function(t,e,n){function i(t,e){var n=[],i=t.geometry;switch(i.type){case"Polygon":n=a(i);break;case"LineString":n=[a(i)]}n.forEach(function(n){r(n,t.properties).forEach(function(t){t.id=e.length,e.push(t)})})}function r(t,e){var n=[];return t.reduce(function(t,i){var r=l([t,i],e);return r.bbox=o(t,i),n.push(r),i}),n}function o(t,e){var n=t[0],i=t[1],r=e[0],o=e[1];return[n<r?n:r,i<o?i:o,n>r?n:r,i>o?i:o]}var s=t("@turf/helpers"),a=t("@turf/invariant").getCoords,u=t("@turf/meta").flattenEach,l=s.lineString,c=s.featureCollection;e.exports=function(t){if(!t)throw new Error("geojson is required");var e=[];return u(t,function(t){i(t,e)}),c(e)}},{"@turf/helpers":47,"@turf/invariant":48,"@turf/meta":49}],47:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],48:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],49:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],50:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],51:[function(t,e,n){var i=t("@turf/bbox"),r=t("@turf/helpers").featureCollection,o=t("@turf/meta").featureEach,s=t("rbush");e.exports=function(t){var e=s(t);return e.insert=function(t){return t.bbox=t.bbox?t.bbox:i(t),s.prototype.insert.call(this,t)},e.load=function(t){var e=[];return o(t,function(t){t.bbox=t.bbox?t.bbox:i(t),e.push(t)}),s.prototype.load.call(this,e)},e.remove=function(t){return s.prototype.remove.call(this,t)},e.clear=function(){return s.prototype.clear.call(this)},e.search=function(t){var e=s.prototype.search.call(this,this.toBBox(t));return r(e)},e.collides=function(t){return s.prototype.collides.call(this,this.toBBox(t))},e.all=function(){var t=s.prototype.all.call(this);return r(t)},e.toJSON=function(){return s.prototype.toJSON.call(this)},e.fromJSON=function(t){return s.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e=t.bbox?t.bbox:i(t);return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}},{"@turf/bbox":43,"@turf/helpers":44,"@turf/meta":50,rbush:53}],52:[function(t,e,n){"use strict";function i(t,e,n,s,a){for(n=n||0,s=s||t.length-1,a=a||o;s>n;){if(s-n>600){var u=s-n+1,l=e-n+1,c=Math.log(u),h=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*h*(u-h)/u)*(l-u/2<0?-1:1);i(t,e,Math.max(n,Math.floor(e-l*h/u+f)),Math.min(s,Math.floor(e+(u-l)*h/u+f)),a)}var p=t[e],d=n,g=s;for(r(t,n,e),a(t[s],p)>0&&r(t,n,s);d<g;){for(r(t,d,g),d++,g--;a(t[d],p)<0;)d++;for(;a(t[g],p)>0;)g--}0===a(t[n],p)?r(t,n,g):(g++,r(t,g,s)),g<=e&&(n=g+1),e<=g&&(s=g-1)}}function r(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function o(t,e){return t<e?-1:t>e?1:0}e.exports=i},{}],53:[function(t,e,n){"use strict";function i(t,e){if(!(this instanceof i))return new i(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function r(t,e,n){if(!n)return e.indexOf(t);for(var i=0;i<e.length;i++)if(n(t,e[i]))return i;return-1}function o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,i,r){r||(r=v(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(var o,s=e;s<n;s++)o=t.children[s],a(r,t.leaf?i(o):o);return r}function a(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function u(t,e){return t.minX-e.minX}function l(t,e){return t.minY-e.minY}function c(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function h(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function p(t,e){var n=Math.max(t.minX,e.minX),i=Math.max(t.minY,e.minY),r=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,r-n)*Math.max(0,o-i)}function d(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function g(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function v(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(t,e,n,i,r){for(var o,s=[e,n];s.length;)n=s.pop(),e=s.pop(),n-e<=i||(o=e+Math.ceil((n-e)/i/2)*i,m(t,o,e,n,r),s.push(e,o,o,n))}e.exports=i;var m=t("quickselect");i.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],i=this.toBBox;if(!g(t,e))return n;for(var r,o,s,a,u=[];e;){for(r=0,o=e.children.length;r<o;r++)s=e.children[r],a=e.leaf?i(s):s,g(t,a)&&(e.leaf?n.push(s):d(t,a)?this._all(s,n):u.push(s));e=u.pop()}return n},collides:function(t){var e=this.data,n=this.toBBox;if(!g(t,e))return!1;for(var i,r,o,s,a=[];e;){for(i=0,r=e.children.length;i<r;i++)if(o=e.children[i],s=e.leaf?n(o):o,g(t,s)){if(e.leaf||d(t,s))return!0;a.push(o)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,n=t.length;e<n;e++)this.insert(t[e]);return this}var i=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var r=this.data;this.data=i,i=r}this._insert(i,this.data.height-i.height-1,!0)}else this.data=i;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=v([]),this},remove:function(t,e){if(!t)return this;for(var n,i,o,s,a=this.data,u=this.toBBox(t),l=[],c=[];a||l.length;){if(a||(a=l.pop(),i=l[l.length-1],n=c.pop(),s=!0),a.leaf&&-1!==(o=r(t,a.children,e)))return a.children.splice(o,1),l.push(a),this._condense(l),this;s||a.leaf||!d(a,u)?i?(n++,a=i.children[n],s=!1):a=null:(l.push(a),c.push(n),n=0,i=a,a=a.children[0])}return this},toBBox:function(t){return t},compareMinX:u,compareMinY:l,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},_build:function(t,e,n,i){var r,s=n-e+1,a=this._maxEntries;if(s<=a)return r=v(t.slice(e,n+1)),o(r,this.toBBox),r;i||(i=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,i-1))),r=v([]),r.leaf=!1,r.height=i;var u,l,c,h,f=Math.ceil(s/a),p=f*Math.ceil(Math.sqrt(a));for(y(t,e,n,p,this.compareMinX),u=e;u<=n;u+=p)for(c=Math.min(u+p-1,n),y(t,u,c,f,this.compareMinY),l=u;l<=c;l+=f)h=Math.min(l+f-1,c),r.children.push(this._build(t,l,h,i-1));return o(r,this.toBBox),r},_chooseSubtree:function(t,e,n,i){for(var r,o,s,a,u,l,h,p;;){if(i.push(e),e.leaf||i.length-1===n)break;for(h=p=1/0,r=0,o=e.children.length;r<o;r++)s=e.children[r],u=c(s),l=f(t,s)-u,l<p?(p=l,h=u<h?u:h,a=s):l===p&&u<h&&(h=u,a=s);e=a||e.children[0]}return e},_insert:function(t,e,n){var i=this.toBBox,r=n?t:i(t),o=[],s=this._chooseSubtree(r,this.data,e,o);for(s.children.push(t),a(s,r);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(r,o,e)},_split:function(t,e){var n=t[e],i=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,i);var s=this._chooseSplitIndex(n,r,i),a=v(n.children.splice(s,n.children.length-s));a.height=n.height,a.leaf=n.leaf,o(n,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)},_splitRoot:function(t,e){this.data=v([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var i,r,o,a,u,l,h,f;for(l=h=1/0,i=e;i<=n-e;i++)r=s(t,0,i,this.toBBox),o=s(t,i,n,this.toBBox),a=p(r,o),u=c(r)+c(o),a<l?(l=a,f=i,h=u<h?u:h):a===l&&u<h&&(h=u,f=i);return f},_chooseSplitAxis:function(t,e,n){var i=t.leaf?this.compareMinX:u,r=t.leaf?this.compareMinY:l;this._allDistMargin(t,e,n,i)<this._allDistMargin(t,e,n,r)&&t.children.sort(i)},_allDistMargin:function(t,e,n,i){t.children.sort(i);var r,o,u=this.toBBox,l=s(t,0,e,u),c=s(t,n-e,n,u),f=h(l)+h(c);for(r=e;r<n-e;r++)o=t.children[r],a(l,t.leaf?u(o):o),f+=h(l);for(r=n-e-1;r>=e;r--)o=t.children[r],a(c,t.leaf?u(o):o),f+=h(c);return f},_adjustParentBBoxes:function(t,e,n){for(var i=n;i>=0;i--)a(e[i],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children,e.splice(e.indexOf(t[n]),1)):this.clear():o(t[n],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},{quickselect:52}],54:[function(t,e,n){function i(t,e){return t.length>1?u(t,e):a(t[0],e)}function r(t){return t.geometry?t.geometry.type:t.type}var o=t("@turf/invariant").getCoords,s=t("@turf/helpers"),a=s.lineString,u=s.multiLineString,l=s.featureCollection;e.exports=function(t,e){var n=r(t),s=o(t);if(e=e||t.properties||{},!s.length)throw new Error("polygon must contain coordinates");switch(n){case"Polygon":return i(s,e);case"MultiPolygon":var a=[];return s.forEach(function(t){a.push(i(t,e))}),l(a);default:throw new Error("geom "+n+" not supported")}}},{"@turf/helpers":55,"@turf/invariant":56}],55:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],56:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],57:[function(t,e,n){function i(t,e){switch(t.type){case"Point":switch(e.type){case"Point":return!l(t.coordinates,e.coordinates);case"LineString":return!r(e,t);case"Polygon":return!c(t,e)}break;case"LineString":switch(e.type){case"Point":return!r(t,e);case"LineString":return!o(t,e);case"Polygon":return!s(e,t)}break;case"Polygon":switch(e.type){case"Point":return!c(e,t);case"LineString":return!s(t,e);case"Polygon":return!a(e,t)}}}function r(t,e){for(var n=0;n<t.coordinates.length-1;n++)if(u(t.coordinates[n],t.coordinates[n+1],e.coordinates))return!0;return!1}function o(t,e){return f(t,e).features.length>0}function s(t,e){return f(e,p(t)).features.length>0}function a(t,e){for(var n=0;n<t.coordinates[0].length;n++)if(c(t.coordinates[0][n],e))return!0;return!1}function u(t,e,n){var i=n[0]-t[0],r=n[1]-t[1],o=e[0]-t[0],s=e[1]-t[1];return 0==i*s-r*o&&(Math.abs(o)>=Math.abs(s)?o>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:s>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1])}function l(t,e){return t[0]===e[0]&&t[1]===e[1]}var c=t("@turf/inside"),h=t("@turf/meta").flattenEach,f=t("@turf/line-intersect"),p=t("@turf/polygon-to-linestring");e.exports=function(t,e){var n;return h(t,function(t){h(e,function(e){if(!1===n)return!1;n=i(t.geometry,e.geometry)})}),n}},{"@turf/inside":58,"@turf/line-intersect":60,"@turf/meta":72,"@turf/polygon-to-linestring":73}],58:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{"@turf/invariant":59,dup:34}],59:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],60:[function(t,e,n){arguments[4][42][0].apply(n,arguments)},{"@turf/helpers":62,"@turf/invariant":63,"@turf/line-segment":64,"@turf/meta":68,dup:42,"geojson-rbush":69}],61:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{"@turf/meta":68,dup:43}],62:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],63:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],64:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{"@turf/helpers":65,"@turf/invariant":66,"@turf/meta":67,dup:46}],65:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],66:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],67:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],68:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],69:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{"@turf/bbox":61,"@turf/helpers":62,"@turf/meta":68,dup:51,rbush:71}],70:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],71:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53,quickselect:70}],72:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],73:[function(t,e,n){arguments[4][54][0].apply(n,arguments)},{"@turf/helpers":74,"@turf/invariant":75,dup:54}],74:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],75:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],76:[function(t,e,n){var i=t("geojson-equality"),r=t("@turf/clean-coords"),o=t("@turf/invariant"),s=o.getGeomType;e.exports=function(t,e){if(!t)throw new Error("feature1 is required");if(!e)throw new Error("feature2 is required");return s(t)===s(e)&&new i({precision:6}).compare(r(t),r(e))}},{"@turf/clean-coords":77,"@turf/invariant":80,"geojson-equality":84}],77:[function(t,e,n){function i(t,e,n){var i={type:e,coordinates:n};return t.bbox&&(i.bbox=t.bbox),i}function r(t,e,n){var r=u.feature(i(t.geometry,e,n),t.properties);return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r}function o(t){var e=c(t);if(2===e.length&&!s(e[0],e[1]))return e;var n,i,r,o=[],u=e.length-1;o.push(e[0]);for(var l=1;l<u;l++)n=e[l-1],i=e[l],r=e[l+1],a(n,r,i)||o.push(i);return o.push(r),o}function s(t,e){return t[0]===e[0]&&t[1]===e[1]}function a(t,e,n){var i=n[0],r=n[1],o=t[0],s=t[1],a=e[0],u=e[1],l=i-o,c=r-s,h=a-o,f=u-s;return 0==l*f-c*h&&(Math.abs(h)>=Math.abs(f)?h>0?o<=i&&i<=a:a<=i&&i<=o:f>0?s<=r&&r<=u:u<=r&&r<=s)}var u=t("@turf/helpers"),l=t("@turf/invariant"),c=l.getCoords,h=l.getGeomType;e.exports=function(t,e){if(!t)throw new Error("geojson is required");var n=h(t),s=[];switch(n){case"LineString":s=o(t);break;case"MultiLineString":case"Polygon":c(t).forEach(function(t){s.push(o(t))});break;case"MultiPolygon":c(t).forEach(function(t){var e=[];t.forEach(function(t){e.push(o(t))}),s.push(e)});break;case"Point":return t;case"MultiPoint":var a={};c(t).forEach(function(t){var e=t.join("-");a.hasOwnProperty(e)||(s.push(t),a[e]=!0)});break;default:throw new Error(n+" geometry not supported")}return t.coordinates?!0===e?(t.coordinates=s,t):i(t,n,s):!0===e?(t.geometry.coordinates=s,t):r(t,n,s)}},{"@turf/helpers":78,"@turf/invariant":79}],78:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],79:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],80:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],81:[function(t,e,n){function i(t){return null===t||void 0===t}function r(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}function o(t,e,n){var o,c;if(i(t)||i(e))return!1;if(t.prototype!==e.prototype)return!1;if(u(t))return!!u(e)&&(t=s.call(t),e=s.call(e),l(t,e,n));if(r(t)){if(!r(e))return!1;if(t.length!==e.length)return!1;for(o=0;o<t.length;o++)if(t[o]!==e[o])return!1;return!0}try{var h=a(t),f=a(e)}catch(t){return!1}if(h.length!=f.length)return!1;for(h.sort(),f.sort(),o=h.length-1;o>=0;o--)if(h[o]!=f[o])return!1;for(o=h.length-1;o>=0;o--)if(c=h[o],!l(t[c],e[c],n))return!1;return typeof t==typeof e}var s=Array.prototype.slice,a=t("./lib/keys.js"),u=t("./lib/is_arguments.js"),l=e.exports=function(t,e,n){return n||(n={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?n.strict?t===e:t==e:o(t,e,n))}},{"./lib/is_arguments.js":82,"./lib/keys.js":83}],82:[function(t,e,n){function i(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function r(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}var o="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();n=e.exports=o?i:r,n.supported=i,n.unsupported=r},{}],83:[function(t,e,n){function i(t){var e=[];for(var n in t)e.push(n);return e}n=e.exports="function"==typeof Object.keys?Object.keys:i,n.shim=i},{}],84:[function(t,e,n){function i(t){return t.coordinates.map(function(e){return{type:t.type.replace("Multi",""),coordinates:e}})}function r(t,e){return t.hasOwnProperty("coordinates")?t.coordinates.length===e.coordinates.length:t.length===e.length}function o(t,e){return s(t,e,{strict:!0})}var s=t("deep-equal"),a=function(t){this.precision=t&&t.precision?t.precision:17,this.direction=!(!t||!t.direction)&&t.direction,this.pseudoNode=!(!t||!t.pseudoNode)&&t.pseudoNode,this.objectComparator=t&&t.objectComparator?t.objectComparator:o};a.prototype.compare=function(t,e){if(t.type!==e.type||!r(t,e))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,e.coordinates);case"LineString":return this.compareLine(t.coordinates,e.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,e);case"Feature":return this.compareFeature(t,e);default:if(0===t.type.indexOf("Multi")){var n=this,o=i(t),s=i(e);return o.every(function(t){return this.some(function(e){return n.compare(t,e)})},s)}}return!1},a.prototype.compareCoord=function(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n].toFixed(this.precision)!==e[n].toFixed(this.precision))return!1;return!0},a.prototype.compareLine=function(t,e,n,i){if(!r(t,e))return!1;var o=this.pseudoNode?t:this.removePseudo(t),s=this.pseudoNode?e:this.removePseudo(e);if(!i||this.compareCoord(o[0],s[0])||(s=this.fixStartIndex(s,o))){var a=this.compareCoord(o[n],s[n]);return this.direction||a?this.comparePath(o,s):!!this.compareCoord(o[n],s[s.length-(1+n)])&&this.comparePath(o.slice().reverse(),s)}},a.prototype.fixStartIndex=function(t,e){for(var n,i=-1,r=0;r<t.length;r++)if(this.compareCoord(t[r],e[0])){i=r;break}return i>=0&&(n=[].concat(t.slice(i,t.length),t.slice(1,i+1))),n},a.prototype.comparePath=function(t,e){var n=this;return t.every(function(t,e){return n.compareCoord(t,this[e])},e)},a.prototype.comparePolygon=function(t,e){if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){var n=t.coordinates.slice(1,t.coordinates.length),i=e.coordinates.slice(1,e.coordinates.length),r=this;return n.every(function(t){return this.some(function(e){return r.compareLine(t,e,1,!0)})},i)}return!1},a.prototype.compareFeature=function(t,e){return!(t.id!==e.id||!this.objectComparator(t.properties,e.properties)||!this.compareBBox(t,e))&&this.compare(t.geometry,e.geometry)},a.prototype.compareBBox=function(t,e){return!!(!t.bbox&&!e.bbox||t.bbox&&e.bbox&&this.compareCoord(t.bbox,e.bbox))},a.prototype.removePseudo=function(t){return t},e.exports=a},{"deep-equal":81}],85:[function(t,e,n){var i=t("@turf/meta"),r=t("@turf/invariant"),o=t("@turf/line-overlap"),s=t("@turf/line-intersect"),a=t("geojson-equality"),u=i.coordAll,l=i.segmentEach,c=r.getGeomType;e.exports=function(t,e){if(!t)throw new Error("feature1 is required");if(!e)throw new Error("feature2 is required");var n=c(t);if(n!==c(e))throw new Error("features must be of the same type");if("Point"===n)throw new Error("Point geometry not supported");if(new a({precision:6}).compare(t,e))return!1;var i=0;switch(n){case"MultiPoint":var r=u(t),h=u(e);r.forEach(function(t){h.forEach(function(e){t[0]===e[0]&&t[1]===e[1]&&i++})});break;case"LineString":case"MultiLineString":l(t,function(t){l(e,function(e){o(t,e).features.length&&i++})});break;case"Polygon":case"MultiPolygon":l(t,function(t){l(e,function(e){s(t,e).features.length&&i++})})}return i>0}},{"@turf/invariant":86,"@turf/line-intersect":87,"@turf/line-overlap":99,"@turf/meta":114,"geojson-equality":118}],86:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],87:[function(t,e,n){arguments[4][42][0].apply(n,arguments)},{"@turf/helpers":89,"@turf/invariant":90,"@turf/line-segment":91,"@turf/meta":95,dup:42,"geojson-rbush":96}],88:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{"@turf/meta":95,dup:43}],89:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],90:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],91:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{"@turf/helpers":92,"@turf/invariant":93,"@turf/meta":94,dup:46}],92:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],93:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],94:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],95:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],96:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{"@turf/bbox":88,"@turf/helpers":89,"@turf/meta":95,dup:51,rbush:98}],97:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],98:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53,quickselect:97}],99:[function(t,e,n){function i(t,e){var n=o(e),i=o(t),r=i[0],s=i[i.length-1];return a(n[0],r)?t.geometry.coordinates.unshift(n[1]):a(n[0],s)?t.geometry.coordinates.push(n[1]):a(n[1],r)?t.geometry.coordinates.unshift(n[0]):a(n[1],s)&&t.geometry.coordinates.push(n[0]),t}var r=t("@turf/line-segment"),o=t("@turf/invariant").getCoords,s=t("geojson-rbush"),a=t("deep-equal"),u=t("@turf/helpers").featureCollection,l=t("@turf/meta").featureEach;e.exports=function(t,e){var n=[],c=s();c.load(r(t));var h;return l(r(e),function(t){var e=!1;l(c.search(t),function(n){if(!1===e){var r=o(t).sort(),s=o(n).sort();a(r,s)&&(e=!0,h=h?i(h,t):t)}}),!1===e&&h&&(n.push(h),h=void 0)}),h&&n.push(h),u(n)}},{"@turf/helpers":101,"@turf/invariant":102,"@turf/line-segment":103,"@turf/meta":107,"deep-equal":108,"geojson-rbush":111}],100:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{"@turf/meta":107,dup:43}],101:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],102:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],103:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{"@turf/helpers":104,"@turf/invariant":105,"@turf/meta":106,dup:46}],104:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],105:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],106:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],107:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],108:[function(t,e,n){arguments[4][81][0].apply(n,arguments)},{"./lib/is_arguments.js":109,"./lib/keys.js":110,dup:81}],109:[function(t,e,n){arguments[4][82][0].apply(n,arguments)},{dup:82}],110:[function(t,e,n){arguments[4][83][0].apply(n,arguments)},{dup:83}],111:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{"@turf/bbox":100,"@turf/helpers":101,"@turf/meta":107,dup:51,rbush:113}],112:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],113:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53,quickselect:112}],114:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],115:[function(t,e,n){arguments[4][81][0].apply(n,arguments)},{"./lib/is_arguments.js":116,"./lib/keys.js":117,dup:81}],116:[function(t,e,n){arguments[4][82][0].apply(n,arguments)},{dup:82}],117:[function(t,e,n){arguments[4][83][0].apply(n,arguments)},{dup:83}],118:[function(t,e,n){arguments[4][84][0].apply(n,arguments)},{"deep-equal":115,dup:84}],119:[function(t,e,n){function i(t,e,n,i){var r=n[0]-t[0],o=n[1]-t[1],s=e[0]-t[0],a=e[1]-t[1];return 0==r*a-o*s&&(i?"start"===i?Math.abs(s)>=Math.abs(a)?s>0?t[0]<n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<t[0]:a>0?t[1]<n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<t[1]:"end"===i?Math.abs(s)>=Math.abs(a)?s>0?t[0]<=n[0]&&n[0]<e[0]:e[0]<n[0]&&n[0]<=t[0]:a>0?t[1]<=n[1]&&n[1]<e[1]:e[1]<n[1]&&n[1]<=t[1]:"both"===i?Math.abs(s)>=Math.abs(a)?s>0?t[0]<n[0]&&n[0]<e[0]:e[0]<n[0]&&n[0]<t[0]:a>0?t[1]<n[1]&&n[1]<e[1]:e[1]<n[1]&&n[1]<t[1]:void 0:Math.abs(s)>=Math.abs(a)?s>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:a>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1])}var r=t("@turf/invariant").getCoords;e.exports=function(t,e,n){for(var o=r(t),s=r(e),a=0;a<s.length-1;a++){var u=!1;if(n&&(0===a&&(u="start"),a===s.length-2&&(u="end"),0===a&&a+1===s.length-1&&(u="both")),i(s[a],s[a+1],o,u))return!0}return!1}},{"@turf/invariant":120}],120:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],121:[function(t,e,n){function i(t,e,n,u){var c=t.properties||{},h="Feature"===t.type?t.geometry:t;switch(h.type){case"GeometryCollection":var f=[];return d(t,function(t){var r=i(t,e,n,u);r&&f.push(r)}),v(f)}var g=y(m(e,n),"meters"),x=a(t),E={type:h.type,coordinates:o(h.coordinates,x)},w=new l.io.GeoJSONReader,b=w.read(E),I=b.buffer(g);if(I=(new l.io.GeoJSONWriter).write(I),!r(I.coordinates))return I.coordinates=s(I.coordinates,x),p(I,c)}function r(t){return Array.isArray(t[0])?r(t[0]):isNaN(t[0])}function o(t,e){return"object"!=typeof t[0]?e(t):t.map(function(t){return o(t,e)})}function s(t,e){return"object"!=typeof t[0]?e.invert(t):t.map(function(t){return s(t,e)})}function a(t){var e=h(t).geometry.coordinates.reverse(),n=e.map(function(t){return-t});return u.geoTransverseMercator().center(e).rotate(n).scale(6373e3)}var u=t("d3-geo"),l=t("jsts"),c=t("@turf/meta"),h=t("@turf/center"),f=t("@turf/helpers"),p=f.feature,d=c.geomEach,g=c.featureEach,v=f.featureCollection,y=f.radiansToDistance,m=f.distanceToRadians;e.exports=function(t,e,n,r){if(!t)throw new Error("geojson is required");if(void 0===e)throw new Error("radius is required");if(r<=0)throw new Error("steps must be greater than 0");r=r||64,n=n||"kilometers";var o=[];switch(t.type){case"GeometryCollection":return d(t,function(t){var s=i(t,e,n,r);s&&o.push(s)}),v(o);case"FeatureCollection":return g(t,function(t){var s=i(t,e,n,r);s&&g(s,function(t){t&&o.push(t)})}),v(o)}return i(t,e,n,r)}},{"@turf/center":122,"@turf/helpers":126,"@turf/meta":127,"d3-geo":129,jsts:130}],122:[function(t,e,n){var i=t("@turf/bbox"),r=t("@turf/helpers").point;e.exports=function(t,e){var n=i(t),o=(n[0]+n[2])/2,s=(n[1]+n[3])/2;return r([o,s],e)}},{"@turf/bbox":123,"@turf/helpers":125}],123:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"@turf/meta":124,dup:22}],124:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],125:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],126:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],127:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],128:[function(e,n,i){!function(e,r){"object"==typeof i&&void 0!==n?r(i):"function"==typeof t&&t.amd?t(["exports"],r):r(e.d3=e.d3||{})}(this,function(t){"use strict";function e(t){return function(e,n){return s(t(e),n)}}function n(t,e){return[t,e]}function i(t,e,n){var i=(e-t)/Math.max(0,n),r=Math.floor(Math.log(i)/Math.LN10),o=i/Math.pow(10,r);return r>=0?(o>=N?10:o>=C?5:o>=S?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(o>=N?10:o>=C?5:o>=S?2:1)}function r(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),o=i/r;return o>=N?r*=10:o>=C?r*=5:o>=S&&(r*=2),e<t?-r:r}function o(t){return t.length}var s=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN},a=function(t){return 1===t.length&&(t=e(t)),{left:function(e,n,i,r){for(null==i&&(i=0),null==r&&(r=e.length);i<r;){var o=i+r>>>1;t(e[o],n)<0?i=o+1:r=o}return i},right:function(e,n,i,r){for(null==i&&(i=0),null==r&&(r=e.length);i<r;){var o=i+r>>>1;t(e[o],n)>0?r=o:i=o+1}return i}}},u=a(s),l=u.right,c=u.left,h=function(t,e){null==e&&(e=n);for(var i=0,r=t.length-1,o=t[0],s=new Array(r<0?0:r);i<r;)s[i]=e(o,o=t[++i]);return s},f=function(t,e,i){var r,o,s,a,u=t.length,l=e.length,c=new Array(u*l);for(null==i&&(i=n),r=s=0;r<u;++r)for(a=t[r],o=0;o<l;++o,++s)c[s]=i(a,e[o]);return c},p=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},d=function(t){return null===t?NaN:+t},g=function(t,e){var n,i,r=t.length,o=0,s=-1,a=0,u=0;if(null==e)for(;++s<r;)isNaN(n=d(t[s]))||(i=n-a,a+=i/++o,u+=i*(n-a));else for(;++s<r;)isNaN(n=d(e(t[s],s,t)))||(i=n-a,a+=i/++o,u+=i*(n-a));if(o>1)return u/(o-1)},v=function(t,e){var n=g(t,e);return n?Math.sqrt(n):n},y=function(t,e){var n,i,r,o=t.length,s=-1;if(null==e){for(;++s<o;)if(null!=(n=t[s])&&n>=n)for(i=r=n;++s<o;)null!=(n=t[s])&&(i>n&&(i=n),r<n&&(r=n))}else for(;++s<o;)if(null!=(n=e(t[s],s,t))&&n>=n)for(i=r=n;++s<o;)null!=(n=e(t[s],s,t))&&(i>n&&(i=n),r<n&&(r=n));return[i,r]},m=Array.prototype,x=m.slice,E=m.map,w=function(t){return function(){return t}},b=function(t){return t},I=function(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(r);++i<r;)o[i]=t+i*n;return o},N=Math.sqrt(50),C=Math.sqrt(10),S=Math.sqrt(2),M=function(t,e,n){var r,o,s,a=e<t,u=-1;if(a&&(r=t,t=e,e=r),0===(s=i(t,e,n))||!isFinite(s))return[];if(s>0)for(t=Math.ceil(t/s),e=Math.floor(e/s),o=new Array(r=Math.ceil(e-t+1));++u<r;)o[u]=(t+u)*s;else for(t=Math.floor(t*s),e=Math.ceil(e*s),o=new Array(r=Math.ceil(t-e+1));++u<r;)o[u]=(t-u)/s;return a&&o.reverse(),o},L=function(t){return Math.ceil(Math.log(t.length)/Math.LN2)+1},R=function(){function t(t){var o,s,a=t.length,u=new Array(a);for(o=0;o<a;++o)u[o]=e(t[o],o,t);var c=n(u),h=c[0],f=c[1],p=i(u,h,f);Array.isArray(p)||(p=r(h,f,p),p=I(Math.ceil(h/p)*p,Math.floor(f/p)*p,p));for(var d=p.length;p[0]<=h;)p.shift(),--d;for(;p[d-1]>f;)p.pop(),--d;var g,v=new Array(d+1);for(o=0;o<=d;++o)g=v[o]=[],g.x0=o>0?p[o-1]:h,g.x1=o<d?p[o]:f;for(o=0;o<a;++o)s=u[o],h<=s&&s<=f&&v[l(p,s,0,d)].push(t[o]);return v}var e=b,n=y,i=L;return t.value=function(n){return arguments.length?(e="function"==typeof n?n:w(n),t):e},t.domain=function(e){return arguments.length?(n="function"==typeof e?e:w([e[0],e[1]]),t):n},t.thresholds=function(e){return arguments.length?(i="function"==typeof e?e:w(Array.isArray(e)?x.call(e):e),t):i},t},P=function(t,e,n){if(null==n&&(n=d),i=t.length){if((e=+e)<=0||i<2)return+n(t[0],0,t);if(e>=1)return+n(t[i-1],i-1,t);var i,r=(i-1)*e,o=Math.floor(r),s=+n(t[o],o,t);return s+(+n(t[o+1],o+1,t)-s)*(r-o)}},T=function(t,e,n){return t=E.call(t,d).sort(s),Math.ceil((n-e)/(2*(P(t,.75)-P(t,.25))*Math.pow(t.length,-1/3)))},O=function(t,e,n){return Math.ceil((n-e)/(3.5*v(t)*Math.pow(t.length,-1/3)))},_=function(t,e){var n,i,r=t.length,o=-1;if(null==e){for(;++o<r;)if(null!=(n=t[o])&&n>=n)for(i=n;++o<r;)null!=(n=t[o])&&n>i&&(i=n)}else for(;++o<r;)if(null!=(n=e(t[o],o,t))&&n>=n)for(i=n;++o<r;)null!=(n=e(t[o],o,t))&&n>i&&(i=n);return i},A=function(t,e){var n,i=t.length,r=i,o=-1,s=0;if(null==e)for(;++o<i;)isNaN(n=d(t[o]))?--r:s+=n;else for(;++o<i;)isNaN(n=d(e(t[o],o,t)))?--r:s+=n;if(r)return s/r},D=function(t,e){var n,i=t.length,r=-1,o=[];if(null==e)for(;++r<i;)isNaN(n=d(t[r]))||o.push(n);else for(;++r<i;)isNaN(n=d(e(t[r],r,t)))||o.push(n);return P(o.sort(s),.5)},F=function(t){
for(var e,n,i,r=t.length,o=-1,s=0;++o<r;)s+=t[o].length;for(n=new Array(s);--r>=0;)for(i=t[r],e=i.length;--e>=0;)n[--s]=i[e];return n},q=function(t,e){var n,i,r=t.length,o=-1;if(null==e){for(;++o<r;)if(null!=(n=t[o])&&n>=n)for(i=n;++o<r;)null!=(n=t[o])&&i>n&&(i=n)}else for(;++o<r;)if(null!=(n=e(t[o],o,t))&&n>=n)for(i=n;++o<r;)null!=(n=e(t[o],o,t))&&i>n&&(i=n);return i},k=function(t,e){for(var n=e.length,i=new Array(n);n--;)i[n]=t[e[n]];return i},G=function(t,e){if(n=t.length){var n,i,r=0,o=0,a=t[o];for(null==e&&(e=s);++r<n;)(e(i=t[r],a)<0||0!==e(a,a))&&(a=i,o=r);return 0===e(a,a)?o:void 0}},j=function(t,e,n){for(var i,r,o=(null==n?t.length:n)-(e=null==e?0:+e);o;)r=Math.random()*o--|0,i=t[o+e],t[o+e]=t[r+e],t[r+e]=i;return t},B=function(t,e){var n,i=t.length,r=-1,o=0;if(null==e)for(;++r<i;)(n=+t[r])&&(o+=n);else for(;++r<i;)(n=+e(t[r],r,t))&&(o+=n);return o},z=function(t){if(!(r=t.length))return[];for(var e=-1,n=q(t,o),i=new Array(n);++e<n;)for(var r,s=-1,a=i[e]=new Array(r);++s<r;)a[s]=t[s][e];return i},V=function(){return z(arguments)};t.bisect=l,t.bisectRight=l,t.bisectLeft=c,t.ascending=s,t.bisector=a,t.cross=f,t.descending=p,t.deviation=v,t.extent=y,t.histogram=R,t.thresholdFreedmanDiaconis=T,t.thresholdScott=O,t.thresholdSturges=L,t.max=_,t.mean=A,t.median=D,t.merge=F,t.min=q,t.pairs=h,t.permute=k,t.quantile=P,t.range=I,t.scan=G,t.shuffle=j,t.sum=B,t.ticks=M,t.tickIncrement=i,t.tickStep=r,t.transpose=z,t.variance=g,t.zip=V,Object.defineProperty(t,"__esModule",{value:!0})})},{}],129:[function(e,n,i){!function(r,o){"object"==typeof i&&void 0!==n?o(i,e("d3-array")):"function"==typeof t&&t.amd?t(["exports","d3-array"],o):o(r.d3=r.d3||{},r.d3)}(this,function(t,e){"use strict";function n(){this.reset()}function i(t,e,n){var i=t.s=e+n,r=i-e,o=i-r;t.t=e-o+(n-r)}function r(t){return t>1?0:t<-1?Be:Math.acos(t)}function o(t){return t>1?ze:t<-1?-ze:Math.asin(t)}function s(t){return(t=en(t/2))*t}function a(){}function u(t,e){t&&an.hasOwnProperty(t.type)&&an[t.type](t,e)}function l(t,e,n){var i,r=-1,o=t.length-n;for(e.lineStart();++r<o;)i=t[r],e.point(i[0],i[1],i[2]);e.lineEnd()}function c(t,e){var n=-1,i=t.length;for(e.polygonStart();++n<i;)l(t[n],e,1);e.polygonEnd()}function h(){hn.point=p}function f(){d(ue,le)}function p(t,e){hn.point=d,ue=t,le=e,t*=Ue,e*=Ue,ce=t,he=Ze(e=e/2+Ve),fe=en(e)}function d(t,e){t*=Ue,e*=Ue,e=e/2+Ve;var n=t-ce,i=n>=0?1:-1,r=i*n,o=Ze(e),s=en(e),a=fe*s,u=he*o+a*Ze(r),l=a*i*en(r);ln.add(Je(l,u)),ce=t,he=o,fe=s}function g(t){return[Je(t[1],t[0]),o(t[2])]}function v(t){var e=t[0],n=t[1],i=Ze(n);return[i*Ze(e),i*en(e),en(n)]}function y(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function m(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function x(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function E(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function w(t){var e=rn(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function b(t,e){we.push(be=[pe=t,ge=t]),e<de&&(de=e),e>ve&&(ve=e)}function I(t,e){var n=v([t*Ue,e*Ue]);if(Ee){var i=m(Ee,n),r=[i[1],-i[0],0],o=m(r,i);w(o),o=g(o);var s,a=t-ye,u=a>0?1:-1,l=o[0]*Ye*u,c=We(a)>180;c^(u*ye<l&&l<u*t)?(s=o[1]*Ye)>ve&&(ve=s):(l=(l+360)%360-180,c^(u*ye<l&&l<u*t)?(s=-o[1]*Ye)<de&&(de=s):(e<de&&(de=e),e>ve&&(ve=e))),c?t<ye?R(pe,t)>R(pe,ge)&&(ge=t):R(t,ge)>R(pe,ge)&&(pe=t):ge>=pe?(t<pe&&(pe=t),t>ge&&(ge=t)):t>ye?R(pe,t)>R(pe,ge)&&(ge=t):R(t,ge)>R(pe,ge)&&(pe=t)}else we.push(be=[pe=t,ge=t]);e<de&&(de=e),e>ve&&(ve=e),Ee=n,ye=t}function N(){dn.point=I}function C(){be[0]=pe,be[1]=ge,dn.point=b,Ee=null}function S(t,e){if(Ee){var n=t-ye;pn.add(We(n)>180?n+(n>0?360:-360):n)}else me=t,xe=e;hn.point(t,e),I(t,e)}function M(){hn.lineStart()}function L(){S(me,xe),hn.lineEnd(),We(pn)>je&&(pe=-(ge=180)),be[0]=pe,be[1]=ge,Ee=null}function R(t,e){return(e-=t)<0?e+360:e}function P(t,e){return t[0]-e[0]}function T(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}function O(t,e){t*=Ue,e*=Ue;var n=Ze(e);_(n*Ze(t),n*en(t),en(e))}function _(t,e,n){++Ie,Ce+=(t-Ce)/Ie,Se+=(e-Se)/Ie,Me+=(n-Me)/Ie}function A(){vn.point=D}function D(t,e){t*=Ue,e*=Ue;var n=Ze(e);Fe=n*Ze(t),qe=n*en(t),ke=en(e),vn.point=F,_(Fe,qe,ke)}function F(t,e){t*=Ue,e*=Ue;var n=Ze(e),i=n*Ze(t),r=n*en(t),o=en(e),s=Je(rn((s=qe*o-ke*r)*s+(s=ke*i-Fe*o)*s+(s=Fe*r-qe*i)*s),Fe*i+qe*r+ke*o);Ne+=s,Le+=s*(Fe+(Fe=i)),Re+=s*(qe+(qe=r)),Pe+=s*(ke+(ke=o)),_(Fe,qe,ke)}function q(){vn.point=O}function k(){vn.point=j}function G(){B(Ae,De),vn.point=O}function j(t,e){Ae=t,De=e,t*=Ue,e*=Ue,vn.point=B;var n=Ze(e);Fe=n*Ze(t),qe=n*en(t),ke=en(e),_(Fe,qe,ke)}function B(t,e){t*=Ue,e*=Ue;var n=Ze(e),i=n*Ze(t),r=n*en(t),s=en(e),a=qe*s-ke*r,u=ke*i-Fe*s,l=Fe*r-qe*i,c=rn(a*a+u*u+l*l),h=o(c),f=c&&-h/c;Te+=f*a,Oe+=f*u,_e+=f*l,Ne+=h,Le+=h*(Fe+(Fe=i)),Re+=h*(qe+(qe=r)),Pe+=h*(ke+(ke=s)),_(Fe,qe,ke)}function z(t,e){return[t>Be?t-Xe:t<-Be?t+Xe:t,e]}function V(t,e,n){return(t%=Xe)?e||n?xn(Y(t),U(e,n)):Y(t):e||n?U(e,n):z}function X(t){return function(e,n){return e+=t,[e>Be?e-Xe:e<-Be?e+Xe:e,n]}}function Y(t){var e=X(t);return e.invert=X(-t),e}function U(t,e){function n(t,e){var n=Ze(e),u=Ze(t)*n,l=en(t)*n,c=en(e),h=c*i+u*r;return[Je(l*s-h*a,u*i-c*r),o(h*s+l*a)]}var i=Ze(t),r=en(t),s=Ze(e),a=en(e);return n.invert=function(t,e){var n=Ze(e),u=Ze(t)*n,l=en(t)*n,c=en(e),h=c*s-l*a;return[Je(l*s+c*a,u*i+h*r),o(h*i-u*r)]},n}function W(t,e,n,i,r,o){if(n){var s=Ze(e),a=en(e),u=i*n;null==r?(r=e+i*Xe,o=e-u/2):(r=H(s,r),o=H(s,o),(i>0?r<o:r>o)&&(r+=i*Xe));for(var l,c=r;i>0?c>o:c<o;c-=u)l=g([s,-a*Ze(c),-a*en(c)]),t.point(l[0],l[1])}}function H(t,e){e=v(e),e[0]-=t,w(e);var n=r(-e[1]);return((-e[2]<0?-n:n)+Xe-je)%Xe}function J(t,e,n,i){this.x=t,this.z=e,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function Z(t){if(e=t.length){for(var e,n,i=0,r=t[0];++i<e;)r.n=n=t[i],n.p=r,r=n;r.n=n=t[0],n.p=r}}function K(t,n,i,r){function o(e,o){return t<=e&&e<=i&&n<=o&&o<=r}function s(e,o,s,u){var c=0,h=0;if(null==e||(c=a(e,s))!==(h=a(o,s))||l(e,o)<0^s>0)do{u.point(0===c||3===c?t:i,c>1?r:n)}while((c=(c+s+4)%4)!==h);else u.point(o[0],o[1])}function a(e,r){return We(e[0]-t)<je?r>0?0:3:We(e[0]-i)<je?r>0?2:1:We(e[1]-n)<je?r>0?1:0:r>0?3:2}function u(t,e){return l(t.x,e.x)}function l(t,e){var n=a(t,1),i=a(e,1);return n!==i?n-i:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){function l(t,e){o(t,e)&&M.point(t,e)}function c(){for(var e=0,n=0,i=y.length;n<i;++n)for(var o,s,a=y[n],u=1,l=a.length,c=a[0],h=c[0],f=c[1];u<l;++u)o=h,s=f,c=a[u],h=c[0],f=c[1],s<=r?f>r&&(h-o)*(r-s)>(f-s)*(t-o)&&++e:f<=r&&(h-o)*(r-s)<(f-s)*(t-o)&&--e;return e}function h(){M=L,v=[],y=[],S=!0}function f(){var t=c(),n=S&&t,i=(v=e.merge(v)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),s(null,null,1,a),a.lineEnd()),i&&Fn(v,u,t,s,a),a.polygonEnd()),M=a,v=y=m=null}function p(){R.point=g,y&&y.push(m=[]),C=!0,N=!1,b=I=NaN}function d(){v&&(g(x,E),w&&N&&L.rejoin(),v.push(L.result())),R.point=l,N&&M.lineEnd()}function g(e,s){var a=o(e,s);if(y&&m.push([e,s]),C)x=e,E=s,w=a,C=!1,a&&(M.lineStart(),M.point(e,s));else if(a&&N)M.point(e,s);else{var u=[b=Math.max(kn,Math.min(qn,b)),I=Math.max(kn,Math.min(qn,I))],l=[e=Math.max(kn,Math.min(qn,e)),s=Math.max(kn,Math.min(qn,s))];An(u,l,t,n,i,r)?(N||(M.lineStart(),M.point(u[0],u[1])),M.point(l[0],l[1]),a||M.lineEnd(),S=!1):a&&(M.lineStart(),M.point(e,s),S=!1)}b=e,I=s,N=a}var v,y,m,x,E,w,b,I,N,C,S,M=a,L=_n(),R={point:l,lineStart:p,lineEnd:d,polygonStart:h,polygonEnd:f};return R}}function Q(){Vn.point=tt,Vn.lineEnd=$}function $(){Vn.point=Vn.lineEnd=a}function tt(t,e){t*=Ue,e*=Ue,En=t,wn=en(e),bn=Ze(e),Vn.point=et}function et(t,e){t*=Ue,e*=Ue;var n=en(e),i=Ze(e),r=We(t-En),o=Ze(r),s=en(r),a=i*s,u=bn*n-wn*i*o,l=wn*n+bn*i*o;zn.add(Je(rn(a*a+u*u),l)),En=t,wn=n,bn=i}function nt(t,e){return!(!t||!Jn.hasOwnProperty(t.type))&&Jn[t.type](t,e)}function it(t,e){return 0===Wn(t,e)}function rt(t,e){var n=Wn(t[0],t[1]);return Wn(t[0],e)+Wn(e,t[1])<=n+je}function ot(t,e){return!!Bn(t.map(st),at(e))}function st(t){return t=t.map(at),t.pop(),t}function at(t){return[t[0]*Ue,t[1]*Ue]}function ut(t,n,i){var r=e.range(t,n-je,i).concat(n);return function(t){return r.map(function(e){return[t,e]})}}function lt(t,n,i){var r=e.range(t,n-je,i).concat(n);return function(t){return r.map(function(e){return[e,t]})}}function ct(){function t(){return{type:"MultiLineString",coordinates:n()}}function n(){return e.range(Ke(s/y)*y,o,y).map(p).concat(e.range(Ke(c/m)*m,l,m).map(d)).concat(e.range(Ke(r/g)*g,i,g).filter(function(t){return We(t%y)>je}).map(h)).concat(e.range(Ke(u/v)*v,a,v).filter(function(t){return We(t%m)>je}).map(f))}var i,r,o,s,a,u,l,c,h,f,p,d,g=10,v=g,y=90,m=360,x=2.5;return t.lines=function(){return n().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[p(s).concat(d(l).slice(1),p(o).reverse().slice(1),d(c).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.extentMajor(e).extentMinor(e):t.extentMinor()},t.extentMajor=function(e){return arguments.length?(s=+e[0][0],o=+e[1][0],c=+e[0][1],l=+e[1][1],s>o&&(e=s,s=o,o=e),c>l&&(e=c,c=l,l=e),t.precision(x)):[[s,c],[o,l]]},t.extentMinor=function(e){return arguments.length?(r=+e[0][0],i=+e[1][0],u=+e[0][1],a=+e[1][1],r>i&&(e=r,r=i,i=e),u>a&&(e=u,u=a,a=e),t.precision(x)):[[r,u],[i,a]]},t.step=function(e){return arguments.length?t.stepMajor(e).stepMinor(e):t.stepMinor()},t.stepMajor=function(e){return arguments.length?(y=+e[0],m=+e[1],t):[y,m]},t.stepMinor=function(e){return arguments.length?(g=+e[0],v=+e[1],t):[g,v]},t.precision=function(e){return arguments.length?(x=+e,h=ut(u,a,90),f=lt(r,i,x),p=ut(c,l,90),d=lt(s,o,x),t):x},t.extentMajor([[-180,-90+je],[180,90-je]]).extentMinor([[-180,-80-je],[180,80+je]])}function ht(){return ct()()}function ft(){ei.point=pt}function pt(t,e){ei.point=dt,In=Cn=t,Nn=Sn=e}function dt(t,e){ti.add(Sn*t-Cn*e),Cn=t,Sn=e}function gt(){dt(In,Nn)}function vt(t,e){t<ni&&(ni=t),t>ri&&(ri=t),e<ii&&(ii=e),e>oi&&(oi=e)}function yt(t,e){ai+=t,ui+=e,++li}function mt(){vi.point=xt}function xt(t,e){vi.point=Et,yt(Rn=t,Pn=e)}function Et(t,e){var n=t-Rn,i=e-Pn,r=rn(n*n+i*i);ci+=r*(Rn+t)/2,hi+=r*(Pn+e)/2,fi+=r,yt(Rn=t,Pn=e)}function wt(){vi.point=yt}function bt(){vi.point=Nt}function It(){Ct(Mn,Ln)}function Nt(t,e){vi.point=Ct,yt(Mn=Rn=t,Ln=Pn=e)}function Ct(t,e){var n=t-Rn,i=e-Pn,r=rn(n*n+i*i);ci+=r*(Rn+t)/2,hi+=r*(Pn+e)/2,fi+=r,r=Pn*t-Rn*e,pi+=r*(Rn+t),di+=r*(Pn+e),gi+=3*r,yt(Rn=t,Pn=e)}function St(t){this._context=t}function Mt(t,e){Ii.point=Lt,mi=Ei=t,xi=wi=e}function Lt(t,e){Ei-=t,wi-=e,bi.add(rn(Ei*Ei+wi*wi)),Ei=t,wi=e}function Rt(){this._string=[]}function Pt(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Tt(t){return t.length>1}function Ot(t,e){return((t=t.x)[0]<0?t[1]-ze-je:ze-t[1])-((e=e.x)[0]<0?e[1]-ze-je:ze-e[1])}function _t(t){var e,n=NaN,i=NaN,r=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,s){var a=o>0?Be:-Be,u=We(o-n);We(u-Be)<je?(t.point(n,i=(i+s)/2>0?ze:-ze),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(a,i),t.point(o,i),e=0):r!==a&&u>=Be&&(We(n-r)<je&&(n-=r*je),We(o-a)<je&&(o-=a*je),i=At(n,i,o,s),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(a,i),e=0),t.point(n=o,i=s),r=a},lineEnd:function(){t.lineEnd(),n=i=NaN},clean:function(){return 2-e}}}function At(t,e,n,i){var r,o,s=en(t-n);return We(s)>je?He((en(e)*(o=Ze(i))*en(n)-en(i)*(r=Ze(e))*en(t))/(r*o*s)):(e+i)/2}function Dt(t,e,n,i){var r;if(null==t)r=n*ze,i.point(-Be,r),i.point(0,r),i.point(Be,r),i.point(Be,0),i.point(Be,-r),i.point(0,-r),i.point(-Be,-r),i.point(-Be,0),i.point(-Be,r);else if(We(t[0]-e[0])>je){var o=t[0]<e[0]?Be:-Be;r=n*o/2,i.point(-o,r),i.point(0,r),i.point(o,r)}else i.point(e[0],e[1])}function Ft(t){return function(e){var n=new qt;for(var i in t)n[i]=t[i];return n.stream=e,n}}function qt(){}function kt(t,e,n){var i=e[1][0]-e[0][0],r=e[1][1]-e[0][1],o=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=o&&t.clipExtent(null),un(n,t.stream(si));var s=si.result(),a=Math.min(i/(s[1][0]-s[0][0]),r/(s[1][1]-s[0][1])),u=+e[0][0]+(i-a*(s[1][0]+s[0][0]))/2,l=+e[0][1]+(r-a*(s[1][1]+s[0][1]))/2;return null!=o&&t.clipExtent(o),t.scale(150*a).translate([u,l])}function Gt(t,e,n){return kt(t,[[0,0],e],n)}function jt(t){return Ft({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function Bt(t,e){function n(i,r,s,a,u,l,c,h,f,p,d,g,v,y){var m=c-i,x=h-r,E=m*m+x*x;if(E>4*e&&v--){var w=a+p,b=u+d,I=l+g,N=rn(w*w+b*b+I*I),C=o(I/=N),S=We(We(I)-1)<je||We(s-f)<je?(s+f)/2:Je(b,w),M=t(S,C),L=M[0],R=M[1],P=L-i,T=R-r,O=x*P-m*T;(O*O/E>e||We((m*P+x*T)/E-.5)>.3||a*p+u*d+l*g<Pi)&&(n(i,r,s,a,u,l,L,R,S,w/=N,b/=N,I,v,y),y.point(L,R),n(L,R,S,w,b,I,c,h,f,p,d,g,v,y))}}return function(e){function i(n,i){n=t(n,i),e.point(n[0],n[1])}function r(){m=NaN,I.point=o,e.lineStart()}function o(i,r){var o=v([i,r]),s=t(i,r);n(m,x,y,E,w,b,m=s[0],x=s[1],y=i,E=o[0],w=o[1],b=o[2],Ri,e),e.point(m,x)}function s(){I.point=i,e.lineEnd()}function a(){r(),I.point=u,I.lineEnd=l}function u(t,e){o(c=t,e),h=m,f=x,p=E,d=w,g=b,I.point=o}function l(){n(m,x,y,E,w,b,h,f,c,p,d,g,Ri,e),I.lineEnd=s,s()}var c,h,f,p,d,g,y,m,x,E,w,b,I={point:i,lineStart:r,lineEnd:s,polygonStart:function(){e.polygonStart(),I.lineStart=a},polygonEnd:function(){e.polygonEnd(),I.lineStart=r}};return I}}function zt(t){return Vt(function(){return t})()}function Vt(t){function e(t){return t=c(t[0]*Ue,t[1]*Ue),[t[0]*v+a,u-t[1]*v]}function n(t){return(t=c.invert((t[0]-a)/v,(u-t[1])/v))&&[t[0]*Ye,t[1]*Ye]}function i(t,e){return t=s(t,e),[t[0]*v+a,u-t[1]*v]}function r(){c=xn(l=V(w,b,I),s);var t=s(x,E);return a=y-t[0]*v,u=m+t[1]*v,o()}function o(){return d=g=null,e}var s,a,u,l,c,h,f,p,d,g,v=150,y=480,m=250,x=0,E=0,w=0,b=0,I=0,N=null,C=Si,S=null,M=Qn,L=.5,R=Ti(i,L);return e.stream=function(t){return d&&g===t?d:d=Oi(C(l,R(M(g=t))))},e.clipAngle=function(t){return arguments.length?(C=+t?Mi(N=t*Ue,6*Ue):(N=null,Si),o()):N*Ye},e.clipExtent=function(t){return arguments.length?(M=null==t?(S=h=f=p=null,Qn):K(S=+t[0][0],h=+t[0][1],f=+t[1][0],p=+t[1][1]),o()):null==S?null:[[S,h],[f,p]]},e.scale=function(t){return arguments.length?(v=+t,r()):v},e.translate=function(t){return arguments.length?(y=+t[0],m=+t[1],r()):[y,m]},e.center=function(t){return arguments.length?(x=t[0]%360*Ue,E=t[1]%360*Ue,r()):[x*Ye,E*Ye]},e.rotate=function(t){return arguments.length?(w=t[0]%360*Ue,b=t[1]%360*Ue,I=t.length>2?t[2]%360*Ue:0,r()):[w*Ye,b*Ye,I*Ye]},e.precision=function(t){return arguments.length?(R=Ti(i,L=t*t),o()):rn(L)},e.fitExtent=function(t,n){return kt(e,t,n)},e.fitSize=function(t,n){return Gt(e,t,n)},function(){return s=t.apply(this,arguments),e.invert=s.invert&&n,r()}}function Xt(t){var e=0,n=Be/3,i=Vt(t),r=i(e,n);return r.parallels=function(t){return arguments.length?i(e=t[0]*Ue,n=t[1]*Ue):[e*Ye,n*Ye]},r}function Yt(t){function e(t,e){return[t*n,en(e)/n]}var n=Ze(t);return e.invert=function(t,e){return[t/n,o(e*n)]},e}function Ut(t,e){function n(t,e){var n=rn(s-2*r*en(e))/r;return[n*en(t*=r),a-n*Ze(t)]}var i=en(t),r=(i+en(e))/2;if(We(r)<je)return Yt(t);var s=1+i*(2*r-i),a=rn(s)/r;return n.invert=function(t,e){var n=a-e;return[Je(t,We(n))/r*nn(n),o((s-(t*t+n*n)*r*r)/(2*r))]},n}function Wt(t){var e=t.length;return{point:function(n,i){for(var r=-1;++r<e;)t[r].point(n,i)},sphere:function(){for(var n=-1;++n<e;)t[n].sphere()},lineStart:function(){for(var n=-1;++n<e;)t[n].lineStart()},lineEnd:function(){for(var n=-1;++n<e;)t[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<e;)t[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<e;)t[n].polygonEnd()}}}function Ht(t){return function(e,n){var i=Ze(e),r=Ze(n),o=t(i*r);return[o*r*en(e),o*en(n)]}}function Jt(t){return function(e,n){var i=rn(e*e+n*n),r=t(i),s=en(r),a=Ze(r);return[Je(e*s,i*a),o(i&&n*s/i)]}}function Zt(t,e){return[t,$e(on((ze+e)/2))]}function Kt(t){function e(){var e=Be*a(),s=o(Tn(o.rotate()).invert([0,0]));return l(null==c?[[s[0]-e,s[1]-e],[s[0]+e,s[1]+e]]:t===Zt?[[Math.max(s[0]-e,c),n],[Math.min(s[0]+e,i),r]]:[[c,Math.max(s[1]-e,n)],[i,Math.min(s[1]+e,r)]])}var n,i,r,o=zt(t),s=o.center,a=o.scale,u=o.translate,l=o.clipExtent,c=null;return o.scale=function(t){return arguments.length?(a(t),e()):a()},o.translate=function(t){return arguments.length?(u(t),e()):u()},o.center=function(t){return arguments.length?(s(t),e()):s()},o.clipExtent=function(t){return arguments.length?(null==t?c=n=i=r=null:(c=+t[0][0],n=+t[0][1],i=+t[1][0],r=+t[1][1]),e()):null==c?null:[[c,n],[i,r]]},e()}function Qt(t){return on((ze+t)/2)}function $t(t,e){function n(t,e){o>0?e<-ze+je&&(e=-ze+je):e>ze-je&&(e=ze-je);var n=o/tn(Qt(e),r);return[n*en(r*t),o-n*Ze(r*t)]}var i=Ze(t),r=t===e?en(t):$e(i/Ze(e))/$e(Qt(e)/Qt(t)),o=i*tn(Qt(t),r)/r;return r?(n.invert=function(t,e){var n=o-e,i=nn(r)*rn(t*t+n*n);return[Je(t,We(n))/r*nn(n),2*He(tn(o/i,1/r))-ze]},n):Zt}function te(t,e){return[t,e]}function ee(t,e){function n(t,e){var n=o-e,i=r*t;return[n*en(i),o-n*Ze(i)]}var i=Ze(t),r=t===e?en(t):(i-Ze(e))/(e-t),o=i/r+t;return We(r)<je?te:(n.invert=function(t,e){var n=o-e;return[Je(t,We(n))/r*nn(n),o-nn(r)*rn(t*t+n*n)]},n)}function ne(t,e){var n=Ze(e),i=Ze(t)*n;return[n*en(t)/i,en(e)/i]}function ie(t,e,n,i){return 1===t&&1===e&&0===n&&0===i?Qn:Ft({point:function(r,o){this.stream.point(r*t+n,o*e+i)}})}function re(t,e){return[Ze(e)*en(t),en(e)]}function oe(t,e){var n=Ze(e),i=1+Ze(t)*n;return[n*en(t)/i,en(e)/i]}function se(t,e){return[$e(on((ze+e)/2)),-t]}var ae=function(){return new n};n.prototype={constructor:n,reset:function(){this.s=this.t=0},add:function(t){i(Ge,t,this.t),i(this,Ge.s,this.s),this.s?this.t+=Ge.t:this.s=Ge.t},valueOf:function(){return this.s}};var ue,le,ce,he,fe,pe,de,ge,ve,ye,me,xe,Ee,we,be,Ie,Ne,Ce,Se,Me,Le,Re,Pe,Te,Oe,_e,Ae,De,Fe,qe,ke,Ge=new n,je=1e-6,Be=Math.PI,ze=Be/2,Ve=Be/4,Xe=2*Be,Ye=180/Be,Ue=Be/180,We=Math.abs,He=Math.atan,Je=Math.atan2,Ze=Math.cos,Ke=Math.ceil,Qe=Math.exp,$e=Math.log,tn=Math.pow,en=Math.sin,nn=Math.sign||function(t){return t>0?1:t<0?-1:0},rn=Math.sqrt,on=Math.tan,sn={Feature:function(t,e){u(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i<r;)u(n[i].geometry,e)}},an={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)t=n[i],e.point(t[0],t[1],t[2])},LineString:function(t,e){l(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)l(n[i],e,0)},Polygon:function(t,e){c(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)c(n[i],e)},GeometryCollection:function(t,e){for(var n=t.geometries,i=-1,r=n.length;++i<r;)u(n[i],e)}},un=function(t,e){t&&sn.hasOwnProperty(t.type)?sn[t.type](t,e):u(t,e)},ln=ae(),cn=ae(),hn={point:a,lineStart:a,lineEnd:a,polygonStart:function(){ln.reset(),hn.lineStart=h,hn.lineEnd=f},polygonEnd:function(){var t=+ln;cn.add(t<0?Xe+t:t),this.lineStart=this.lineEnd=this.point=a},sphere:function(){cn.add(Xe)}},fn=function(t){return cn.reset(),un(t,hn),2*cn},pn=ae(),dn={point:b,lineStart:N,lineEnd:C,polygonStart:function(){dn.point=S,dn.lineStart=M,dn.lineEnd=L,pn.reset(),hn.polygonStart()},polygonEnd:function(){hn.polygonEnd(),dn.point=b,dn.lineStart=N,dn.lineEnd=C,ln<0?(pe=-(ge=180),de=-(ve=90)):pn>je?ve=90:pn<-je&&(de=-90),be[0]=pe,be[1]=ge}},gn=function(t){var e,n,i,r,o,s,a;if(ve=ge=-(pe=de=1/0),we=[],un(t,dn),n=we.length){for(we.sort(P),e=1,i=we[0],o=[i];e<n;++e)r=we[e],T(i,r[0])||T(i,r[1])?(R(i[0],r[1])>R(i[0],i[1])&&(i[1]=r[1]),R(r[0],i[1])>R(i[0],i[1])&&(i[0]=r[0])):o.push(i=r);for(s=-1/0,n=o.length-1,e=0,i=o[n];e<=n;i=r,++e)r=o[e],(a=R(i[1],r[0]))>s&&(s=a,pe=r[0],ge=i[1])}return we=be=null,pe===1/0||de===1/0?[[NaN,NaN],[NaN,NaN]]:[[pe,de],[ge,ve]]},vn={sphere:a,point:O,lineStart:A,lineEnd:q,polygonStart:function(){vn.lineStart=k,vn.lineEnd=G},polygonEnd:function(){vn.lineStart=A,vn.lineEnd=q}},yn=function(t){Ie=Ne=Ce=Se=Me=Le=Re=Pe=Te=Oe=_e=0,un(t,vn);var e=Te,n=Oe,i=_e,r=e*e+n*n+i*i;return r<1e-12&&(e=Le,n=Re,i=Pe,Ne<je&&(e=Ce,n=Se,i=Me),(r=e*e+n*n+i*i)<1e-12)?[NaN,NaN]:[Je(n,e)*Ye,o(i/rn(r))*Ye]},mn=function(t){return function(){return t}},xn=function(t,e){function n(n,i){return n=t(n,i),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,i){return(n=e.invert(n,i))&&t.invert(n[0],n[1])}),n};z.invert=z;var En,wn,bn,In,Nn,Cn,Sn,Mn,Ln,Rn,Pn,Tn=function(t){function e(e){return e=t(e[0]*Ue,e[1]*Ue),e[0]*=Ye,e[1]*=Ye,e}return t=V(t[0]*Ue,t[1]*Ue,t.length>2?t[2]*Ue:0),e.invert=function(e){return e=t.invert(e[0]*Ue,e[1]*Ue),e[0]*=Ye,e[1]*=Ye,e},e},On=function(){function t(t,e){n.push(t=i(t,e)),t[0]*=Ye,t[1]*=Ye}function e(){var t=r.apply(this,arguments),e=o.apply(this,arguments)*Ue,u=s.apply(this,arguments)*Ue;return n=[],i=V(-t[0]*Ue,-t[1]*Ue,0).invert,W(a,e,u,1),t={type:"Polygon",coordinates:[n]},n=i=null,t}var n,i,r=mn([0,0]),o=mn(90),s=mn(6),a={point:t};return e.center=function(t){return arguments.length?(r="function"==typeof t?t:mn([+t[0],+t[1]]),e):r},e.radius=function(t){return arguments.length?(o="function"==typeof t?t:mn(+t),e):o},e.precision=function(t){return arguments.length?(s="function"==typeof t?t:mn(+t),e):s},e},_n=function(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:a,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}},An=function(t,e,n,i,r,o){var s,a=t[0],u=t[1],l=e[0],c=e[1],h=0,f=1,p=l-a,d=c-u;if(s=n-a,p||!(s>0)){if(s/=p,p<0){if(s<h)return;s<f&&(f=s)}else if(p>0){if(s>f)return;s>h&&(h=s)}if(s=r-a,p||!(s<0)){if(s/=p,p<0){if(s>f)return;s>h&&(h=s)}else if(p>0){if(s<h)return;s<f&&(f=s)}if(s=i-u,d||!(s>0)){if(s/=d,d<0){if(s<h)return;s<f&&(f=s)}else if(d>0){if(s>f)return;s>h&&(h=s)}if(s=o-u,d||!(s<0)){if(s/=d,d<0){if(s>f)return;s>h&&(h=s)}else if(d>0){if(s<h)return;s<f&&(f=s)}return h>0&&(t[0]=a+h*p,t[1]=u+h*d),f<1&&(e[0]=a+f*p,e[1]=u+f*d),!0}}}}},Dn=function(t,e){return We(t[0]-e[0])<je&&We(t[1]-e[1])<je},Fn=function(t,e,n,i,r){var o,s,a=[],u=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n,i=t[0],s=t[e];if(Dn(i,s)){for(r.lineStart(),o=0;o<e;++o)r.point((i=t[o])[0],i[1]);return void r.lineEnd()}a.push(n=new J(i,t,null,!0)),u.push(n.o=new J(i,null,n,!1)),a.push(n=new J(s,t,null,!1)),u.push(n.o=new J(s,null,n,!0))}}),a.length){for(u.sort(e),Z(a),Z(u),o=0,s=u.length;o<s;++o)u[o].e=n=!n;for(var l,c,h=a[0];;){for(var f=h,p=!0;f.v;)if((f=f.n)===h)return;l=f.z,r.lineStart();do{if(f.v=f.o.v=!0,f.e){if(p)for(o=0,s=l.length;o<s;++o)r.point((c=l[o])[0],c[1]);else i(f.x,f.n.x,1,r);f=f.n}else{if(p)for(l=f.p.z,o=l.length-1;o>=0;--o)r.point((c=l[o])[0],c[1]);else i(f.x,f.p.x,-1,r);f=f.p}f=f.o,l=f.z,p=!p}while(!f.v);r.lineEnd()}}},qn=1e9,kn=-qn,Gn=function(){var t,e,n,i=0,r=0,o=960,s=500;return n={stream:function(n){return t&&e===n?t:t=K(i,r,o,s)(e=n)},extent:function(a){return arguments.length?(i=+a[0][0],r=+a[0][1],o=+a[1][0],s=+a[1][1],t=e=null,n):[[i,r],[o,s]]}}},jn=ae(),Bn=function(t,e){var n=e[0],i=e[1],r=[en(n),-Ze(n),0],s=0,a=0;jn.reset();for(var u=0,l=t.length;u<l;++u)if(h=(c=t[u]).length)for(var c,h,f=c[h-1],p=f[0],d=f[1]/2+Ve,g=en(d),y=Ze(d),x=0;x<h;++x,p=b,g=N,y=C,f=E){var E=c[x],b=E[0],I=E[1]/2+Ve,N=en(I),C=Ze(I),S=b-p,M=S>=0?1:-1,L=M*S,R=L>Be,P=g*N;if(jn.add(Je(P*M*en(L),y*C+P*Ze(L))),s+=R?S+M*Xe:S,R^p>=n^b>=n){var T=m(v(f),v(E));w(T);var O=m(r,T);w(O);var _=(R^S>=0?-1:1)*o(O[2]);(i>_||i===_&&(T[0]||T[1]))&&(a+=R^S>=0?1:-1)}}return(s<-je||s<je&&jn<-je)^1&a},zn=ae(),Vn={sphere:a,point:a,lineStart:Q,lineEnd:a,polygonStart:a,polygonEnd:a},Xn=function(t){return zn.reset(),un(t,Vn),+zn},Yn=[null,null],Un={type:"LineString",coordinates:Yn},Wn=function(t,e){return Yn[0]=t,Yn[1]=e,Xn(Un)},Hn={Feature:function(t,e){return nt(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i<r;)if(nt(n[i].geometry,e))return!0;return!1}},Jn={Sphere:function(){return!0},Point:function(t,e){return it(t.coordinates,e)},MultiPoint:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)if(it(n[i],e))return!0;return!1},LineString:function(t,e){return rt(t.coordinates,e)},MultiLineString:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)if(rt(n[i],e))return!0;return!1},Polygon:function(t,e){return ot(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)if(ot(n[i],e))return!0;return!1},GeometryCollection:function(t,e){for(var n=t.geometries,i=-1,r=n.length;++i<r;)if(nt(n[i],e))return!0;return!1}},Zn=function(t,e){return(t&&Hn.hasOwnProperty(t.type)?Hn[t.type]:nt)(t,e)},Kn=function(t,e){var n=t[0]*Ue,i=t[1]*Ue,r=e[0]*Ue,a=e[1]*Ue,u=Ze(i),l=en(i),c=Ze(a),h=en(a),f=u*Ze(n),p=u*en(n),d=c*Ze(r),g=c*en(r),v=2*o(rn(s(a-i)+u*c*s(r-n))),y=en(v),m=v?function(t){var e=en(t*=v)/y,n=en(v-t)/y,i=n*f+e*d,r=n*p+e*g,o=n*l+e*h;return[Je(r,i)*Ye,Je(o,rn(i*i+r*r))*Ye]}:function(){return[n*Ye,i*Ye]};return m.distance=v,m},Qn=function(t){return t},$n=ae(),ti=ae(),ei={point:a,lineStart:a,lineEnd:a,polygonStart:function(){ei.lineStart=ft,ei.lineEnd=gt},polygonEnd:function(){ei.lineStart=ei.lineEnd=ei.point=a,$n.add(We(ti)),ti.reset()},result:function(){var t=$n/2;return $n.reset(),t}},ni=1/0,ii=ni,ri=-ni,oi=ri,si={point:vt,lineStart:a,lineEnd:a,polygonStart:a,polygonEnd:a,result:function(){var t=[[ni,ii],[ri,oi]];return ri=oi=-(ii=ni=1/0),t}},ai=0,ui=0,li=0,ci=0,hi=0,fi=0,pi=0,di=0,gi=0,vi={point:yt,lineStart:mt,lineEnd:wt,polygonStart:function(){vi.lineStart=bt,vi.lineEnd=It},polygonEnd:function(){vi.point=yt,vi.lineStart=mt,vi.lineEnd=wt},result:function(){var t=gi?[pi/gi,di/gi]:fi?[ci/fi,hi/fi]:li?[ai/li,ui/li]:[NaN,NaN];return ai=ui=li=ci=hi=fi=pi=di=gi=0,t}};St.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Xe)}},result:a};var yi,mi,xi,Ei,wi,bi=ae(),Ii={point:a,lineStart:function(){Ii.point=Mt},lineEnd:function(){yi&&Lt(mi,xi),Ii.point=a},polygonStart:function(){yi=!0},polygonEnd:function(){yi=null},result:function(){var t=+bi;return bi.reset(),t}};Rt.prototype={_radius:4.5,_circle:Pt(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Pt(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var Ni=function(t,e){function n(t){return t&&("function"==typeof o&&r.pointRadius(+o.apply(this,arguments)),un(t,i(r))),r.result()}var i,r,o=4.5;return n.area=function(t){return un(t,i(ei)),ei.result()},n.measure=function(t){return un(t,i(Ii)),Ii.result()},n.bounds=function(t){return un(t,i(si)),si.result()},n.centroid=function(t){return un(t,i(vi)),vi.result()},n.projection=function(e){return arguments.length?(i=null==e?(t=null,Qn):(t=e).stream,n):t},n.context=function(t){return arguments.length?(r=null==t?(e=null,new Rt):new St(e=t),"function"!=typeof o&&r.pointRadius(o),n):e},n.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(r.pointRadius(+t),+t),n):o},n.projection(t).context(e)},Ci=function(t,n,i,r){return function(o,s){function a(e,n){var i=o(e,n);t(e=i[0],n=i[1])&&s.point(e,n)}function u(t,e){var n=o(t,e);y.point(n[0],n[1])}function l(){b.point=u,y.lineStart()}function c(){b.point=a,y.lineEnd()}function h(t,e){v.push([t,e]);var n=o(t,e);E.point(n[0],n[1])}function f(){E.lineStart(),v=[]}function p(){h(v[0][0],v[0][1]),E.lineEnd();var t,e,n,i,r=E.clean(),o=x.result(),a=o.length;if(v.pop(),d.push(v),v=null,a)if(1&r){if(n=o[0],(e=n.length-1)>0){for(w||(s.polygonStart(),w=!0),s.lineStart(),t=0;t<e;++t)s.point((i=n[t])[0],i[1]);s.lineEnd()}}else a>1&&2&r&&o.push(o.pop().concat(o.shift())),g.push(o.filter(Tt))}var d,g,v,y=n(s),m=o.invert(r[0],r[1]),x=_n(),E=n(x),w=!1,b={point:a,lineStart:l,lineEnd:c,polygonStart:function(){b.point=h,b.lineStart=f,b.lineEnd=p,g=[],d=[]},polygonEnd:function(){b.point=a,b.lineStart=l,b.lineEnd=c,g=e.merge(g);var t=Bn(d,m);g.length?(w||(s.polygonStart(),w=!0),Fn(g,Ot,t,i,s)):t&&(w||(s.polygonStart(),w=!0),s.lineStart(),i(null,null,1,s),s.lineEnd()),w&&(s.polygonEnd(),w=!1),g=d=null},sphere:function(){s.polygonStart(),s.lineStart(),i(null,null,1,s),s.lineEnd(),s.polygonEnd()}};return b}},Si=Ci(function(){return!0},_t,Dt,[-Be,-ze]),Mi=function(t,e){function n(n,i,r,o){W(o,t,e,r,n,i)}function i(t,e){return Ze(t)*Ze(e)>a}function r(t){var e,n,r,a,c;return{lineStart:function(){a=r=!1,c=1},point:function(h,f){var p,d=[h,f],g=i(h,f),v=u?g?0:s(h,f):g?s(h+(h<0?Be:-Be),f):0;if(!e&&(a=r=g)&&t.lineStart(),g!==r&&(!(p=o(e,d))||Dn(e,p)||Dn(d,p))&&(d[0]+=je,d[1]+=je,g=i(d[0],d[1])),g!==r)c=0,g?(t.lineStart(),p=o(d,e),t.point(p[0],p[1])):(p=o(e,d),t.point(p[0],p[1]),t.lineEnd()),e=p;else if(l&&e&&u^g){var y;v&n||!(y=o(d,e,!0))||(c=0,u?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!g||e&&Dn(e,d)||t.point(d[0],d[1]),e=d,r=g,n=v},lineEnd:function(){r&&t.lineEnd(),e=null},clean:function(){return c|(a&&r)<<1}}}function o(t,e,n){var i=v(t),r=v(e),o=[1,0,0],s=m(i,r),u=y(s,s),l=s[0],c=u-l*l;if(!c)return!n&&t;var h=a*u/c,f=-a*l/c,p=m(o,s),d=E(o,h);x(d,E(s,f));var w=p,b=y(d,w),I=y(w,w),N=b*b-I*(y(d,d)-1);if(!(N<0)){var C=rn(N),S=E(w,(-b-C)/I);if(x(S,d),S=g(S),!n)return S;var M,L=t[0],R=e[0],P=t[1],T=e[1];R<L&&(M=L,L=R,R=M);var O=R-L,_=We(O-Be)<je,A=_||O<je;if(!_&&T<P&&(M=P,P=T,T=M),A?_?P+T>0^S[1]<(We(S[0]-L)<je?P:T):P<=S[1]&&S[1]<=T:O>Be^(L<=S[0]&&S[0]<=R)){var D=E(w,(-b+C)/I);return x(D,d),[S,g(D)]}}}function s(e,n){var i=u?t:Be-t,r=0;return e<-i?r|=1:e>i&&(r|=2),n<-i?r|=4:n>i&&(r|=8),r}var a=Ze(t),u=a>0,l=We(a)>je;return Ci(i,r,n,u?[0,-t]:[-Be,t-Be])},Li=function(t){return{stream:Ft(t)}};qt.prototype={constructor:qt,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Ri=16,Pi=Ze(30*Ue),Ti=function(t,e){return+e?Bt(t,e):jt(t)},Oi=Ft({point:function(t,e){this.stream.point(t*Ue,e*Ue)}}),_i=function(){return Xt(Ut).scale(155.424).center([0,33.6442])},Ai=function(){return _i().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])},Di=function(){function t(t){var e=t[0],n=t[1];return a=null,r.point(e,n),a||(o.point(e,n),a)||(s.point(e,n),a)}function e(){return n=i=null,t}var n,i,r,o,s,a,u=Ai(),l=_i().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=_i().rotate([157,0]).center([-3,19.9]).parallels([8,18]),h={point:function(t,e){a=[t,e]}};return t.invert=function(t){var e=u.scale(),n=u.translate(),i=(t[0]-n[0])/e,r=(t[1]-n[1])/e;return(r>=.12&&r<.234&&i>=-.425&&i<-.214?l:r>=.166&&r<.234&&i>=-.214&&i<-.115?c:u).invert(t)},t.stream=function(t){return n&&i===t?n:n=Wt([u.stream(i=t),l.stream(t),c.stream(t)])},t.precision=function(t){return arguments.length?(u.precision(t),l.precision(t),c.precision(t),e()):u.precision()},t.scale=function(e){return arguments.length?(u.scale(e),l.scale(.35*e),c.scale(e),t.translate(u.translate())):u.scale()},t.translate=function(t){if(!arguments.length)return u.translate();var n=u.scale(),i=+t[0],a=+t[1];return r=u.translate(t).clipExtent([[i-.455*n,a-.238*n],[i+.455*n,a+.238*n]]).stream(h),
o=l.translate([i-.307*n,a+.201*n]).clipExtent([[i-.425*n+je,a+.12*n+je],[i-.214*n-je,a+.234*n-je]]).stream(h),s=c.translate([i-.205*n,a+.212*n]).clipExtent([[i-.214*n+je,a+.166*n+je],[i-.115*n-je,a+.234*n-je]]).stream(h),e()},t.fitExtent=function(e,n){return kt(t,e,n)},t.fitSize=function(e,n){return Gt(t,e,n)},t.scale(1070)},Fi=Ht(function(t){return rn(2/(1+t))});Fi.invert=Jt(function(t){return 2*o(t/2)});var qi=function(){return zt(Fi).scale(124.75).clipAngle(179.999)},ki=Ht(function(t){return(t=r(t))&&t/en(t)});ki.invert=Jt(function(t){return t});var Gi=function(){return zt(ki).scale(79.4188).clipAngle(179.999)};Zt.invert=function(t,e){return[t,2*He(Qe(e))-ze]};var ji=function(){return Kt(Zt).scale(961/Xe)},Bi=function(){return Xt($t).scale(109.5).parallels([30,30])};te.invert=te;var zi=function(){return zt(te).scale(152.63)},Vi=function(){return Xt(ee).scale(131.154).center([0,13.9389])};ne.invert=Jt(He);var Xi=function(){return zt(ne).scale(144.049).clipAngle(60)},Yi=function(){function t(){return r=o=null,s}var e,n,i,r,o,s,a=1,u=0,l=0,c=1,h=1,f=Qn,p=null,d=Qn;return s={stream:function(t){return r&&o===t?r:r=f(d(o=t))},clipExtent:function(r){return arguments.length?(d=null==r?(p=e=n=i=null,Qn):K(p=+r[0][0],e=+r[0][1],n=+r[1][0],i=+r[1][1]),t()):null==p?null:[[p,e],[n,i]]},scale:function(e){return arguments.length?(f=ie((a=+e)*c,a*h,u,l),t()):a},translate:function(e){return arguments.length?(f=ie(a*c,a*h,u=+e[0],l=+e[1]),t()):[u,l]},reflectX:function(e){return arguments.length?(f=ie(a*(c=e?-1:1),a*h,u,l),t()):c<0},reflectY:function(e){return arguments.length?(f=ie(a*c,a*(h=e?-1:1),u,l),t()):h<0},fitExtent:function(t,e){return kt(s,t,e)},fitSize:function(t,e){return Gt(s,t,e)}}};re.invert=Jt(o);var Ui=function(){return zt(re).scale(249.5).clipAngle(90+je)};oe.invert=Jt(function(t){return 2*He(t)});var Wi=function(){return zt(oe).scale(250).clipAngle(142)};se.invert=function(t,e){return[-e,2*He(Qe(t))-ze]};var Hi=function(){var t=Kt(se),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):(t=n(),[t[0],t[1],t[2]-90])},n([0,0,90]).scale(159.155)};t.geoArea=fn,t.geoBounds=gn,t.geoCentroid=yn,t.geoCircle=On,t.geoClipExtent=Gn,t.geoContains=Zn,t.geoDistance=Wn,t.geoGraticule=ct,t.geoGraticule10=ht,t.geoInterpolate=Kn,t.geoLength=Xn,t.geoPath=Ni,t.geoAlbers=Ai,t.geoAlbersUsa=Di,t.geoAzimuthalEqualArea=qi,t.geoAzimuthalEqualAreaRaw=Fi,t.geoAzimuthalEquidistant=Gi,t.geoAzimuthalEquidistantRaw=ki,t.geoConicConformal=Bi,t.geoConicConformalRaw=$t,t.geoConicEqualArea=_i,t.geoConicEqualAreaRaw=Ut,t.geoConicEquidistant=Vi,t.geoConicEquidistantRaw=ee,t.geoEquirectangular=zi,t.geoEquirectangularRaw=te,t.geoGnomonic=Xi,t.geoGnomonicRaw=ne,t.geoIdentity=Yi,t.geoProjection=zt,t.geoProjectionMutator=Vt,t.geoMercator=ji,t.geoMercatorRaw=Zt,t.geoOrthographic=Ui,t.geoOrthographicRaw=re,t.geoStereographic=Wi,t.geoStereographicRaw=oe,t.geoTransverseMercator=Hi,t.geoTransverseMercatorRaw=se,t.geoRotation=Tn,t.geoStream=un,t.geoTransform=Li,Object.defineProperty(t,"__esModule",{value:!0})})},{"d3-array":128}],130:[function(e,n,i){!function(e,r){"object"==typeof i&&void 0!==n?r(i):"function"==typeof t&&t.amd?t(["exports"],r):r(e.jsts=e.jsts||{})}(this,function(t){"use strict";function e(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}function n(){}function i(){}function r(){}function o(){}function s(){}function a(){}function u(){}function l(t){this.name="RuntimeException",this.message=t,this.stack=(new Error).stack,Error.call(this,t)}function c(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t}function h(){if(0===arguments.length)l.call(this);else if(1===arguments.length){var t=arguments[0];l.call(this,t)}}function f(){}function p(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)p.call(this,0,0);else if(1===arguments.length){var t=arguments[0];p.call(this,t.x,t.y,t.z)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];p.call(this,e,n,p.NULL_ORDINATE)}else if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];this.x=i,this.y=r,this.z=o}}function d(){if(this.dimensionsToTest=2,0===arguments.length)d.call(this,2);else if(1===arguments.length){var t=arguments[0];if(2!==t&&3!==t)throw new i("only 2 or 3 dimensions may be specified");this.dimensionsToTest=t}}function g(){}function v(){}function y(t){this.message=t||""}function m(){}function x(t){this.message=t||""}function E(t){this.message=t||""}function w(){this.array_=[],arguments[0]instanceof v&&this.addAll(arguments[0])}function b(){if(w.apply(this),0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.ensureCapacity(t.length),this.add(t,!0)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.ensureCapacity(e.length),this.add(e,n)}}function I(){if(this.minx=null,this.maxx=null,this.miny=null,this.maxy=null,0===arguments.length)this.init();else if(1===arguments.length){if(arguments[0]instanceof p){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof I){var e=arguments[0];this.init(e)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(4===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.init(r,o,s,a)}}function N(){}function C(){N.call(this,"Projective point not representable on the Cartesian plane.")}function S(){}function M(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1}function L(){}function R(t){this.str=t}function P(t){this.value=t}function T(){}function O(){if(this.hi=0,this.lo=0,0===arguments.length)this.init(0);else if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof O){var e=arguments[0];this.init(e)}else if("string"==typeof arguments[0]){var n=arguments[0];O.call(this,O.parse(n))}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];this.init(i,r)}}function _(){}function A(){}function D(){}function F(){if(this.x=null,this.y=null,this.w=null,0===arguments.length)this.x=0,this.y=0,this.w=1;else if(1===arguments.length){var t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(2===arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var e=arguments[0],n=arguments[1];this.x=e,this.y=n,this.w=1}else if(arguments[0]instanceof F&&arguments[1]instanceof F){var i=arguments[0],r=arguments[1];this.x=i.y*r.w-r.y*i.w,this.y=r.x*i.w-i.x*r.w,this.w=i.x*r.y-r.x*i.y}else if(arguments[0]instanceof p&&arguments[1]instanceof p){var o=arguments[0],s=arguments[1];this.x=o.y-s.y,this.y=s.x-o.x,this.w=o.x*s.y-s.x*o.y}}else if(3===arguments.length){var a=arguments[0],u=arguments[1],l=arguments[2];this.x=a,this.y=u,this.w=l}else if(4===arguments.length){var c=arguments[0],h=arguments[1],f=arguments[2],d=arguments[3],g=c.y-h.y,v=h.x-c.x,y=c.x*h.y-h.x*c.y,m=f.y-d.y,x=d.x-f.x,E=f.x*d.y-d.x*f.y;this.x=v*E-x*y,this.y=m*y-g*E,this.w=g*x-m*v}}function q(){}function k(){}function G(){this.envelope=null,this.factory=null,this.SRID=null,this.userData=null;var t=arguments[0];this.factory=t,this.SRID=t.getSRID()}function j(){}function B(){}function z(){}function V(){}function X(){}function Y(){}function U(){}function W(){}function H(){}function J(){}function Z(){}function K(){}function Q(){this.array_=[],arguments[0]instanceof v&&this.addAll(arguments[0])}function $(t){return null==t?$o:t.color}function tt(t){return null==t?null:t.parent}function et(t,e){null!==t&&(t.color=e)}function nt(t){return null==t?null:t.left}function it(t){return null==t?null:t.right}function rt(){this.root_=null,this.size_=0}function ot(){}function st(){}function at(){this.array_=[],arguments[0]instanceof v&&this.addAll(arguments[0])}function ut(){}function lt(){}function ct(){}function ht(){}function ft(){this.geometries=null;var t=arguments[0],e=arguments[1];if(G.call(this,e),null===t&&(t=[]),G.hasNullElements(t))throw new i("geometries must not contain null elements");this.geometries=t}function pt(){var t=arguments[0],e=arguments[1];ft.call(this,t,e)}function dt(){if(this.geom=null,this.geomFact=null,this.bnRule=null,this.endpointMap=null,1===arguments.length){var t=arguments[0];dt.call(this,t,B.MOD2_BOUNDARY_RULE)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.geom=e,this.geomFact=e.getFactory(),this.bnRule=n}}function gt(){this.count=null}function vt(){}function yt(){}function mt(){}function xt(){}function Et(){}function wt(){}function bt(){}function It(){}function Nt(){this.points=null;var t=arguments[0],e=arguments[1];G.call(this,e),this.init(t)}function Ct(){}function St(){this.coordinates=null;var t=arguments[0],e=arguments[1];G.call(this,e),this.init(t)}function Mt(){}function Lt(){this.shell=null,this.holes=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(G.call(this,n),null===t&&(t=this.getFactory().createLinearRing()),null===e&&(e=[]),G.hasNullElements(e))throw new i("holes must not contain null elements");if(t.isEmpty()&&G.hasNonEmptyElements(e))throw new i("shell is empty but holes are not");this.shell=t,this.holes=e}function Rt(){var t=arguments[0],e=arguments[1];ft.call(this,t,e)}function Pt(){if(arguments[0]instanceof p&&arguments[1]instanceof ne){var t=arguments[0],e=arguments[1];Pt.call(this,e.getCoordinateSequenceFactory().create(t),e)}else if(M(arguments[0],A)&&arguments[1]instanceof ne){var n=arguments[0],i=arguments[1];Nt.call(this,n,i),this.validateConstruction()}}function Tt(){var t=arguments[0],e=arguments[1];ft.call(this,t,e)}function Ot(){if(this.factory=null,this.isUserDataCopied=!1,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.factory=t}}function _t(){}function At(){}function Dt(){}function Ft(){}function qt(){if(this.dimension=3,this.coordinates=null,1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];qt.call(this,t,3)}else if(Number.isInteger(arguments[0])){var e=arguments[0];this.coordinates=new Array(e).fill(null);for(var n=0;n<e;n++)this.coordinates[n]=new p}else if(M(arguments[0],A)){var i=arguments[0];if(null===i)return this.coordinates=new Array(0).fill(null),null;this.dimension=i.getDimension(),this.coordinates=new Array(i.size()).fill(null);for(var n=0;n<this.coordinates.length;n++)this.coordinates[n]=i.getCoordinateCopy(n)}}else if(2===arguments.length)if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var r=arguments[0],o=arguments[1];this.coordinates=r,this.dimension=o,null===r&&(this.coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var s=arguments[0],a=arguments[1];this.coordinates=new Array(s).fill(null),this.dimension=a;for(var n=0;n<s;n++)this.coordinates[n]=new p}}function kt(){}function Gt(t,e){return t===e||t!==t&&e!==e}function jt(t){this.add?t.forEach(this.add,this):t.forEach(function(t){this.set(t[0],t[1])},this)}function Bt(t){return this.has(t)&&(this._keys.splice(es,1),this._values.splice(es,1),this._itp.forEach(function(t){es<t[0]&&t[0]--})),es>-1}function zt(t){return this.has(t)?this._values[es]:void 0}function Vt(t,e){if(this.objectOnly&&e!==Object(e))throw new TypeError("Invalid value used as weak collection key");if(e!==e||0===e)for(es=t.length;es--&&!Gt(t[es],e););else es=t.indexOf(e);return es>-1}function Xt(t){return Vt.call(this,this._keys,t)}function Yt(t,e){return this.has(t)?this._values[es]=e:this._values[this._keys.push(t)-1]=e,this}function Ut(){(this._keys||0).length=this._values.length=0}function Wt(){return Zt(this._itp,this._keys)}function Ht(){return Zt(this._itp,this._values)}function Jt(){return Zt(this._itp,this._keys,this._values)}function Zt(t,e,n){var i=[0],r=!1;return t.push(i),{next:function(){var o,s=i[0];return!r&&s<e.length?(o=n?[e[s],n[s]]:e[s],i[0]++):(r=!0,t.splice(t.indexOf(i),1)),{done:r,value:o}}}}function Kt(){return this._values.length}function Qt(t,e){for(var n=this.entries();;){var i=n.next();if(i.done)break;t.call(e,i.value[1],i.value[0],this)}}function $t(){this.map_=new rs}function te(){if(this.modelType=null,this.scale=null,0===arguments.length)this.modelType=te.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof ee){var t=arguments[0];this.modelType=t,t===te.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var e=arguments[0];this.modelType=te.FIXED,this.setScale(e)}else if(arguments[0]instanceof te){var n=arguments[0];this.modelType=n.modelType,this.scale=n.scale}}function ee(){this.name=null;var t=arguments[0];this.name=t,ee.nameToTypeMap.put(t,this)}function ne(){if(this.precisionModel=null,this.coordinateSequenceFactory=null,this.SRID=null,0===arguments.length)ne.call(this,new te,0);else if(1===arguments.length){if(M(arguments[0],q)){var t=arguments[0];ne.call(this,new te,0,t)}else if(arguments[0]instanceof te){var e=arguments[0];ne.call(this,e,0,ne.getDefaultCoordinateSequenceFactory())}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];ne.call(this,n,i,ne.getDefaultCoordinateSequenceFactory())}else if(3===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2];this.precisionModel=r,this.coordinateSequenceFactory=s,this.SRID=o}}function ie(t){this.geometryFactory=t||new ne}function re(t){this.parser=new ie(t)}function oe(){this.result=null,this.inputLines=Array(2).fill().map(function(){return Array(2)}),this.intPt=new Array(2).fill(null),this.intLineIndex=null,this._isProper=null,this.pa=null,this.pb=null,this.precisionModel=null,this.intPt[0]=new p,this.intPt[1]=new p,this.pa=this.intPt[0],this.pb=this.intPt[1],this.result=0}function se(){oe.apply(this)}function ae(){}function ue(){this.p=null,this.crossingCount=0,this.isPointOnSegment=!1;var t=arguments[0];this.p=t}function le(){}function ce(){if(this.p0=null,this.p1=null,0===arguments.length)ce.call(this,new p,new p);else if(1===arguments.length){var t=arguments[0];ce.call(this,t.p0,t.p1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.p0=e,this.p1=n}else if(4===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2],s=arguments[3];ce.call(this,new p(i,r),new p(o,s))}}function he(){if(this.matrix=null,0===arguments.length)this.matrix=Array(3).fill().map(function(){return Array(3)}),this.setAll(lt.FALSE);else if(1===arguments.length)if("string"==typeof arguments[0]){var t=arguments[0];he.call(this),this.set(t)}else if(arguments[0]instanceof he){var e=arguments[0];he.call(this),this.matrix[S.INTERIOR][S.INTERIOR]=e.matrix[S.INTERIOR][S.INTERIOR],this.matrix[S.INTERIOR][S.BOUNDARY]=e.matrix[S.INTERIOR][S.BOUNDARY],this.matrix[S.INTERIOR][S.EXTERIOR]=e.matrix[S.INTERIOR][S.EXTERIOR],this.matrix[S.BOUNDARY][S.INTERIOR]=e.matrix[S.BOUNDARY][S.INTERIOR],this.matrix[S.BOUNDARY][S.BOUNDARY]=e.matrix[S.BOUNDARY][S.BOUNDARY],this.matrix[S.BOUNDARY][S.EXTERIOR]=e.matrix[S.BOUNDARY][S.EXTERIOR],this.matrix[S.EXTERIOR][S.INTERIOR]=e.matrix[S.EXTERIOR][S.INTERIOR],this.matrix[S.EXTERIOR][S.BOUNDARY]=e.matrix[S.EXTERIOR][S.BOUNDARY],this.matrix[S.EXTERIOR][S.EXTERIOR]=e.matrix[S.EXTERIOR][S.EXTERIOR]}}function fe(){this.areaBasePt=null,this.triangleCent3=new p,this.areasum2=0,this.cg3=new p,this.lineCentSum=new p,this.totalLength=0,this.ptCount=0,this.ptCentSum=new p;var t=arguments[0];this.areaBasePt=null,this.add(t)}function pe(t){this.message=t||""}function de(){this.array_=[]}function ge(){this.treeSet=new at,this.list=new w}function ve(){if(this.geomFactory=null,this.inputPts=null,1===arguments.length){var t=arguments[0];ve.call(this,ve.extractCoordinates(t),t.getFactory())}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.inputPts=ge.filterCoordinates(e),this.geomFactory=n}}function ye(){this.origin=null;var t=arguments[0];this.origin=t}function me(){this.inputGeom=null,this.factory=null,this.pruneEmptyGeometry=!0,this.preserveGeometryCollectionType=!0,this.preserveCollections=!1,this.preserveType=!1}function xe(){if(this.snapTolerance=0,this.srcPts=null,this.seg=new ce,this.allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Nt&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];xe.call(this,t.getCoordinates(),e)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var n=arguments[0],i=arguments[1];this.srcPts=n,this._isClosed=xe.isClosed(n),this.snapTolerance=i}}function Ee(){this.srcGeom=null;var t=arguments[0];this.srcGeom=t}function we(){if(me.apply(this),this.snapTolerance=null,this.snapPts=null,this.isSelfSnap=!1,2===arguments.length){var t=arguments[0],e=arguments[1];this.snapTolerance=t,this.snapPts=e}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this.snapTolerance=n,this.snapPts=i,this.isSelfSnap=r}}function be(){this.isFirst=!0,this.commonMantissaBitsCount=53,this.commonBits=0,this.commonSignExp=null}function Ie(){this.commonCoord=null,this.ccFilter=new Ne}function Ne(){this.commonBitsX=new be,this.commonBitsY=new be}function Ce(){this.trans=null;var t=arguments[0];this.trans=t}function Se(){this.parent=null,this.atStart=null,this.max=null,this.index=null,this.subcollectionIterator=null;var t=arguments[0];this.parent=t,this.atStart=!0,this.index=0,this.max=t.getNumGeometries()}function Me(){if(this.boundaryRule=B.OGC_SFS_BOUNDARY_RULE,this.isIn=null,this.numBoundaries=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];if(null===t)throw new i("Rule must be non-null");this.boundaryRule=t}}function Le(){}function Re(){}function Pe(){this.pts=null,this.data=null;var t=arguments[0],e=arguments[1];this.pts=t,this.data=e}function Te(){}function Oe(){this.bounds=null,this.item=null;var t=arguments[0],e=arguments[1];this.bounds=t,this.item=e}function _e(){this._size=null,this.items=null,this._size=0,this.items=new w,this.items.add(null)}function Ae(){}function De(){}function Fe(){if(this.childBoundables=new w,this.bounds=null,this.level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.level=t}}function qe(){this.boundable1=null,this.boundable2=null,this._distance=null,this.itemDistance=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.boundable1=t,this.boundable2=e,this.itemDistance=n,this._distance=this.distance()}function ke(){if(this.root=null,this.built=!1,this.itemBoundables=new w,this.nodeCapacity=null,0===arguments.length)ke.call(this,ke.DEFAULT_NODE_CAPACITY);else if(1===arguments.length){var t=arguments[0];f.isTrue(t>1,"Node capacity must be greater than 1"),this.nodeCapacity=t}}function Ge(){}function je(){}function Be(){if(0===arguments.length)Be.call(this,Be.DEFAULT_NODE_CAPACITY);else if(1===arguments.length){var t=arguments[0];ke.call(this,t)}}function ze(){var t=arguments[0];Fe.call(this,t)}function Ve(){}function Xe(){this.segString=null,this.coord=null,this.segmentIndex=null,this.segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this.segString=t,this.coord=new p(e),this.segmentIndex=n,this.segmentOctant=i,this._isInterior=!e.equals2D(t.getCoordinate(n))}function Ye(){this.nodeMap=new rt,this.edge=null;var t=arguments[0];this.edge=t}function Ue(){this.nodeList=null,this.edge=null,this.nodeIt=null,this.currNode=null,this.nextNode=null,this.currSegIndex=0;var t=arguments[0];this.nodeList=t,this.edge=t.getEdge(),this.nodeIt=t.iterator(),this.readNextNode()}function We(){}function He(){this.nodeList=new Ye(this),this.pts=null,this.data=null;var t=arguments[0],e=arguments[1];this.pts=t,this.data=e}function Je(){this.tempEnv1=new I,this.tempEnv2=new I,this.overlapSeg1=new ce,this.overlapSeg2=new ce}function Ze(){this.pts=null,this.start=null,this.end=null,this.env=null,this.context=null,this.id=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this.pts=t,this.start=e,this.end=n,this.context=i}function Ke(){}function Qe(){}function $e(){}function tn(){if(this.segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}}function en(){if(this.monoChains=new w,this.index=new Be,this.idCounter=0,this.nodedSegStrings=null,this.nOverlaps=0,0===arguments.length);else if(1===arguments.length){var t=arguments[0];tn.call(this,t)}}function nn(){Je.apply(this),this.si=null;var t=arguments[0];this.si=t}function rn(){if(this.pt=null,1===arguments.length){var t=arguments[0];l.call(this,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];l.call(this,rn.msgWithCoord(e,n)),this.name="TopologyException",this.pt=new p(n)}}function on(){}function sn(){this.findAllIntersections=!1,this.isCheckEndSegmentsOnly=!1,this.li=null,this.interiorIntersection=null,this.intSegments=null,this.intersections=new w,this.intersectionCount=0,this.keepIntersections=!0;var t=arguments[0];this.li=t,this.interiorIntersection=null}function an(){this.li=new se,this.segStrings=null,this.findAllIntersections=!1,this.segInt=null,this._isValid=!0;var t=arguments[0];this.segStrings=t}function un(){this.nv=null;var t=arguments[0];this.nv=new an(un.toSegmentStrings(t))}function ln(){this.mapOp=null;var t=arguments[0];this.mapOp=t}function cn(){}function hn(){if(this.location=null,1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];this.init(t.length)}else if(Number.isInteger(arguments[0])){var e=arguments[0];this.init(1),this.location[cn.ON]=e}else if(arguments[0]instanceof hn){var n=arguments[0];if(this.init(n.location.length),null!==n)for(var i=0;i<this.location.length;i++)this.location[i]=n.location[i]}}else if(3===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2];this.init(3),this.location[cn.ON]=r,this.location[cn.LEFT]=o,this.location[cn.RIGHT]=s}}function fn(){if(this.elt=new Array(2).fill(null),1===arguments.length){if(Number.isInteger(arguments[0])){var t=arguments[0];this.elt[0]=new hn(t),this.elt[1]=new hn(t)}else if(arguments[0]instanceof fn){var e=arguments[0];this.elt[0]=new hn(e.elt[0]),this.elt[1]=new hn(e.elt[1])}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.elt[0]=new hn(S.NONE),this.elt[1]=new hn(S.NONE),this.elt[n].setLocation(i)}else if(3===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2];this.elt[0]=new hn(r,o,s),this.elt[1]=new hn(r,o,s)}else if(4===arguments.length){var a=arguments[0],u=arguments[1],l=arguments[2],c=arguments[3];this.elt[0]=new hn(S.NONE,S.NONE,S.NONE),this.elt[1]=new hn(S.NONE,S.NONE,S.NONE),this.elt[a].setLocations(u,l,c)}}function pn(){this.startDe=null,this.maxNodeDegree=-1,this.edges=new w,this.pts=new w,this.label=new fn(S.NONE),this.ring=null,this._isHole=null,this.shell=null,this.holes=new w,this.geometryFactory=null;var t=arguments[0],e=arguments[1];this.geometryFactory=e,this.computePoints(t),this.computeRing()}function dn(){var t=arguments[0],e=arguments[1];pn.call(this,t,e)}function gn(){var t=arguments[0],e=arguments[1];pn.call(this,t,e)}function vn(){if(this.label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.label=t}}function yn(){vn.apply(this),this.coord=null,this.edges=null;var t=arguments[0],e=arguments[1];this.coord=t,this.edges=e,this.label=new fn(0,S.NONE)}function mn(){this.nodeMap=new rt,this.nodeFact=null;var t=arguments[0];this.nodeFact=t}function xn(){if(this.edge=null,this.label=null,this.node=null,this.p0=null,this.p1=null,this.dx=null,this.dy=null,this.quadrant=null,1===arguments.length){var t=arguments[0];this.edge=t}else if(3===arguments.length){var e=arguments[0],n=arguments[1],i=arguments[2];xn.call(this,e,n,i,null)}else if(4===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];xn.call(this,r),this.init(o,s),this.label=a}}function En(){this._isForward=null,this._isInResult=!1,this._isVisited=!1,this.sym=null,this.next=null,this.nextMin=null,this.edgeRing=null,this.minEdgeRing=null,this.depth=[0,-999,-999];var t=arguments[0],e=arguments[1];if(xn.call(this,t),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()}function wn(){}function bn(){if(this.edges=new w,this.nodes=null,this.edgeEndList=new w,0===arguments.length)this.nodes=new mn(new wn);else if(1===arguments.length){var t=arguments[0];this.nodes=new mn(t)}}function In(){this.geometryFactory=null,this.shellList=new w;var t=arguments[0];this.geometryFactory=t}function Nn(){this.op=null,this.geometryFactory=null,this.ptLocator=null,this.lineEdgesList=new w,this.resultLineList=new w;var t=arguments[0],e=arguments[1],n=arguments[2];this.op=t,this.geometryFactory=e,this.ptLocator=n}function Cn(){this.op=null,this.geometryFactory=null,this.resultPointList=new w;var t=arguments[0],e=arguments[1];arguments[2],this.op=t,this.geometryFactory=e}function Sn(){}function Mn(){this.geom=null;var t=arguments[0];this.geom=t}function Ln(){this.edgeMap=new rt,this.edgeList=null,this.ptInAreaLocation=[S.NONE,S.NONE]}function Rn(){Ln.apply(this),this.resultAreaEdgeList=null,this.label=null,this.SCANNING_FOR_INCOMING=1,this.LINKING_TO_OUTGOING=2}function Pn(){wn.apply(this)}function Tn(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e}function On(){if(this.label=null,this.xValue=null,this.eventType=null,this.insertEvent=null,this.deleteEventIndex=null,this.obj=null,2===arguments.length){var t=arguments[0],e=arguments[1];this.eventType=On.DELETE,this.xValue=t,this.insertEvent=e}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this.eventType=On.INSERT,this.label=n,this.xValue=i,this.obj=r}}function _n(){}function An(){this._hasIntersection=!1,this.hasProper=!1,this.hasProperInterior=!1,this.properIntersectionPoint=null,this.li=null,this.includeProper=null,this.recordIsolated=null,this.isSelfIntersection=null,this.numIntersections=0,this.numTests=0,this.bdyNodes=null,this._isDone=!1,this.isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this.li=t,this.includeProper=e,this.recordIsolated=n}function Dn(){_n.apply(this),this.events=new w,this.nOverlaps=null}function Fn(){this.min=r.POSITIVE_INFINITY,this.max=r.NEGATIVE_INFINITY}function qn(){}function kn(){Fn.apply(this),this.item=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.min=t,this.max=e,this.item=n}function Gn(){Fn.apply(this),this.node1=null,this.node2=null;var t=arguments[0],e=arguments[1];this.node1=t,this.node2=e,this.buildExtent(this.node1,this.node2)}function jn(){this.leaves=new w,this.root=null,this.level=0}function Bn(){if(this.lines=null,this.isForcedToLineString=!1,1===arguments.length){var t=arguments[0];this.lines=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.lines=e,this.isForcedToLineString=n}}function zn(){this.items=new w}function Vn(){this.index=null;var t=arguments[0];if(!M(t,Mt))throw new i("Argument must be Polygonal");this.index=new Yn(t)}function Xn(){this.counter=null;var t=arguments[0];this.counter=t}function Yn(){this.index=new jn;var t=arguments[0];this.init(t)}function Un(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new p(t),this.segmentIndex=e,this.dist=n}function Wn(){this.nodeMap=new rt,this.edge=null;var t=arguments[0];this.edge=t}function Hn(){}function Jn(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new I,this.env2=new I;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Hn;this.startIndex=e.getChainStartIndices(this.pts)}function Zn(){this.depth=Array(2).fill().map(function(){return Array(3)});for(var t=0;t<2;t++)for(var e=0;e<3;e++)this.depth[t][e]=Zn.NULL_VALUE}function Kn(){if(vn.apply(this),this.pts=null,this.env=null,this.eiList=new Wn(this),this.name=null,this.mce=null,this._isIsolated=!0,this.depth=new Zn,this.depthDelta=0,1===arguments.length){var t=arguments[0];Kn.call(this,t,null)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.pts=e,this.label=n}}function Qn(){if(bn.apply(this),this.parentGeom=null,this.lineEdgeMap=new $t,this.boundaryNodeRule=null,this.useBoundaryDeterminationRule=!0,this.argIndex=null,this.boundaryNodes=null,this._hasTooFewPoints=!1,this.invalidPoint=null,this.areaPtLocator=null,this.ptLocator=new Me,2===arguments.length){var t=arguments[0],e=arguments[1];Qn.call(this,t,e,B.OGC_SFS_BOUNDARY_RULE)}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this.argIndex=n,this.parentGeom=i,this.boundaryNodeRule=r,null!==i&&this.add(i)}}function $n(){if(this.li=new se,this.resultPrecisionModel=null,this.arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this.arg=new Array(1).fill(null),this.arg[0]=new Qn(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];$n.call(this,e,n,B.OGC_SFS_BOUNDARY_RULE)}else if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];i.getPrecisionModel().compareTo(r.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(r.getPrecisionModel()),this.arg=new Array(2).fill(null),this.arg[0]=new Qn(0,i,o),this.arg[1]=new Qn(1,r,o)}}function ti(){this.pts=null,this._orientation=null;var t=arguments[0];this.pts=t,this._orientation=ti.orientation(t)}function ei(){this.edges=new w,this.ocaMap=new rt}function ni(){this.ptLocator=new Me,this.geomFact=null,this.resultGeom=null,this.graph=null,this.edgeList=new ei,this.resultPolyList=new w,this.resultLineList=new w,this.resultPointList=new w;var t=arguments[0],e=arguments[1];$n.call(this,t,e),this.graph=new bn(new Pn),this.geomFact=t.getFactory()}function ii(){this.geom=new Array(2).fill(null),this.snapTolerance=null,this.cbr=null;var t=arguments[0],e=arguments[1];this.geom[0]=t,this.geom[1]=e,this.computeSnapTolerance()}function ri(){this.geom=new Array(2).fill(null);var t=arguments[0],e=arguments[1];this.geom[0]=t,this.geom[1]=e}function oi(){this.factory=null,this.interiorPoint=null,this.maxWidth=0;var t=arguments[0];this.factory=t.getFactory(),this.add(t)}function si(){this.poly=null,this.centreY=null,this.hiY=r.MAX_VALUE,this.loY=-r.MAX_VALUE;var t=arguments[0];this.poly=t,this.hiY=t.getEnvelopeInternal().getMaxY(),this.loY=t.getEnvelopeInternal().getMinY(),this.centreY=oi.avg(this.loY,this.hiY)}function ai(){this.centroid=null,this.minDistance=r.MAX_VALUE,this.interiorPoint=null;var t=arguments[0];this.centroid=t.getCentroid().getCoordinate(),this.addInterior(t),null===this.interiorPoint&&this.addEndpoints(t)}function ui(){this.centroid=null,this.minDistance=r.MAX_VALUE,this.interiorPoint=null;var t=arguments[0];this.centroid=t.getCentroid().getCoordinate(),this.add(t)}function li(){this.tempEnv1=new I,this.selectedSegment=new ce}function ci(){this.items=new w,this.subnode=[null,null]}function hi(){if(this.min=null,this.max=null,0===arguments.length)this.min=0,this.max=0;else if(1===arguments.length){var t=arguments[0];this.init(t.min,t.max)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.init(e,n)}}function fi(){}function pi(t,e){var n,i,r,o,s={32:{d:127,c:128,b:0,a:0},64:{d:32752,c:0,b:0,a:0}},a={32:8,64:11}[t];if(o||(n=e<0||1/e<0,isFinite(e)||(o=s[t],n&&(o.d+=1<<t/4-1),i=Math.pow(2,a)-1,r=0)),!o){for(i={32:127,64:1023}[t],r=Math.abs(e);r>=2;)i++,r/=2;for(;r<1&&i>0;)i--,r*=2;i<=0&&(r/=2),32===t&&i>254&&(o={d:n?255:127,c:128,b:0,a:0},i=Math.pow(2,a)-1,r=0)}return i}function di(){this.pt=0,this.level=0,this.interval=null;var t=arguments[0];this.computeKey(t)}function gi(){ci.apply(this),this.interval=null,this.centre=null,this.level=null;var t=arguments[0],e=arguments[1];this.interval=t,this.level=e,this.centre=(t.getMin()+t.getMax())/2}function vi(){}function yi(){ci.apply(this)}function mi(){this.root=null,this.minExtent=1,this.root=new yi}function xi(){}function Ei(){this.ring=null,this.tree=null,this.crossings=0,
this.interval=new hi;var t=arguments[0];this.ring=t,this.buildIndex()}function wi(){li.apply(this),this.mcp=null,this.p=null;var t=arguments[0],e=arguments[1];this.mcp=t,this.p=e}function bi(){}function Ii(){this.p0=null,this.p1=null,this.p2=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.p0=t,this.p1=e,this.p2=n}function Ni(){this.input=null,this.extremalPts=null,this.centre=null,this.radius=0;var t=arguments[0];this.input=t}function Ci(){if(this.inputGeom=null,this.isConvex=null,this.convexHullPts=null,this.minBaseSeg=new ce,this.minWidthPt=null,this.minPtIndex=null,this.minWidth=0,1===arguments.length){var t=arguments[0];Ci.call(this,t,!1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.inputGeom=e,this.isConvex=n}}function Si(){this.inputGeom=null,this.distanceTolerance=null;var t=arguments[0];this.inputGeom=t}function Mi(){me.apply(this),this.distanceTolerance=null;var t=arguments[0];this.distanceTolerance=t}function Li(){this._orig=null,this._sym=null,this._next=null;var t=arguments[0];this._orig=t}function Ri(){this._isMarked=!1;var t=arguments[0];Li.call(this,t)}function Pi(){this.vertexMap=new $t}function Ti(){this._isStart=!1;var t=arguments[0];Ri.call(this,t)}function Oi(){Pi.apply(this)}function _i(){this.result=null,this.factory=null,this.graph=null,this.lines=new w,this.nodeEdgeStack=new de,this.ringStartEdge=null,this.graph=new Oi}function Ai(){this.items=new w,this.subnode=new Array(4).fill(null)}function Di(){this.pt=new p,this.level=0,this.env=null;var t=arguments[0];this.computeKey(t)}function Fi(){Ai.apply(this),this.env=null,this.centrex=null,this.centrey=null,this.level=null;var t=arguments[0],e=arguments[1];this.env=t,this.level=e,this.centrex=(t.getMinX()+t.getMaxX())/2,this.centrey=(t.getMinY()+t.getMaxY())/2}function qi(){Ai.apply(this)}function ki(){this.root=null,this.minExtent=1,this.root=new qi}function Gi(t){this.geometryFactory=t||new ne}function ji(t){this.geometryFactory=t||new ne,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new Gi(this.geometryFactory)}function Bi(){this.parser=new Gi(this.geometryFactory)}function zi(t){this.geometryFactory=t||new ne,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new ie(this.geometryFactory)}function Vi(t){return[t.x,t.y]}function Xi(t,e){this.geometryFactory=t||new ne,this.ol=e||"undefined"!=typeof ol&&ol}function Yi(){if(this.noder=null,this.scaleFactor=null,this.offsetX=null,this.offsetY=null,this.isScaled=!1,2===arguments.length){var t=arguments[0],e=arguments[1];Yi.call(this,t,e,0,0)}else if(4===arguments.length){var n=arguments[0],i=arguments[1];arguments[2],arguments[3],this.noder=n,this.scaleFactor=i,this.isScaled=!this.isIntegerPrecision()}}function Ui(){if(this.inputGeom=null,this.isClosedEndpointsInInterior=!0,this.nonSimpleLocation=null,1===arguments.length){var t=arguments[0];this.inputGeom=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.inputGeom=e,this.isClosedEndpointsInInterior=!n.isInBoundary(2)}}function Wi(){this.pt=null,this.isClosed=null,this.degree=null;var t=arguments[0];this.pt=t,this.isClosed=!1,this.degree=0}function Hi(){if(this.quadrantSegments=Hi.DEFAULT_QUADRANT_SEGMENTS,this.endCapStyle=Hi.CAP_ROUND,this.joinStyle=Hi.JOIN_ROUND,this.mitreLimit=Hi.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this.simplifyFactor=Hi.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setQuadrantSegments(t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.setQuadrantSegments(e),this.setEndCapStyle(n)}else if(4===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2],s=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(r),this.setJoinStyle(o),this.setMitreLimit(s)}}function Ji(){this.minIndex=-1,this.minCoord=null,this.minDe=null,this.orientedDe=null}function Zi(){this.array_=[]}function Ki(){this.finder=null,this.dirEdgeList=new w,this.nodes=new w,this.rightMostCoord=null,this.env=null,this.finder=new Ji}function Qi(){this.inputLine=null,this.distanceTol=null,this.isDeleted=null,this.angleOrientation=le.COUNTERCLOCKWISE;var t=arguments[0];this.inputLine=t}function $i(){this.ptList=null,this.precisionModel=null,this.minimimVertexDistance=0,this.ptList=new w}function tr(){this.maxCurveSegmentError=0,this.filletAngleQuantum=null,this.closingSegLengthFactor=1,this.segList=null,this.distance=0,this.precisionModel=null,this.bufParams=null,this.li=null,this.s0=null,this.s1=null,this.s2=null,this.seg0=new ce,this.seg1=new ce,this.offset0=new ce,this.offset1=new ce,this.side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this.precisionModel=t,this.bufParams=e,this.li=new se,this.filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===Hi.JOIN_ROUND&&(this.closingSegLengthFactor=tr.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)}function er(){this.distance=0,this.precisionModel=null,this.bufParams=null;var t=arguments[0],e=arguments[1];this.precisionModel=t,this.bufParams=e}function nr(){this.subgraphs=null,this.seg=new ce,this.cga=new le;var t=arguments[0];this.subgraphs=t}function ir(){this.upwardSeg=null,this.leftDepth=null;var t=arguments[0],e=arguments[1];this.upwardSeg=new ce(t),this.leftDepth=e}function rr(){this.inputGeom=null,this.distance=null,this.curveBuilder=null,this.curveList=new w;var t=arguments[0],e=arguments[1],n=arguments[2];this.inputGeom=t,this.distance=e,this.curveBuilder=n}function or(){this._hasIntersection=!1,this.hasProper=!1,this.hasProperInterior=!1,this.hasInterior=!1,this.properIntersectionPoint=null,this.li=null,this.isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this.li=t}function sr(){this.bufParams=null,this.workingPrecisionModel=null,this.workingNoder=null,this.geomFact=null,this.graph=null,this.edgeList=new ei;var t=arguments[0];this.bufParams=t}function ar(){this.li=new se,this.segStrings=null;var t=arguments[0];this.segStrings=t}function ur(){this.li=null,this.pt=null,this.originalPt=null,this.ptScaled=null,this.p0Scaled=null,this.p1Scaled=null,this.scaleFactor=null,this.minx=null,this.maxx=null,this.miny=null,this.maxy=null,this.corner=new Array(4).fill(null),this.safeEnv=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(this.originalPt=t,this.pt=t,this.scaleFactor=e,this.li=n,e<=0)throw new i("Scale factor must be non-zero");1!==e&&(this.pt=new p(this.scale(t.x),this.scale(t.y)),this.p0Scaled=new p,this.p1Scaled=new p),this.initCorners(this.pt)}function lr(){this.index=null;var t=arguments[0];this.index=t}function cr(){li.apply(this),this.hotPixel=null,this.parentEdge=null,this.hotPixelVertexIndex=null,this._isNodeAdded=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this.hotPixel=t,this.parentEdge=e,this.hotPixelVertexIndex=n}function hr(){this.li=null,this.interiorIntersections=null;var t=arguments[0];this.li=t,this.interiorIntersections=new w}function fr(){this.pm=null,this.li=null,this.scaleFactor=null,this.noder=null,this.pointSnapper=null,this.nodedSegStrings=null;var t=arguments[0];this.pm=t,this.li=new se,this.li.setPrecisionModel(t),this.scaleFactor=t.getScale()}function pr(){if(this.argGeom=null,this.distance=null,this.bufParams=new Hi,this.resultGeometry=null,this.saveException=null,1===arguments.length){var t=arguments[0];this.argGeom=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.argGeom=e,this.bufParams=n}}function dr(){this.comps=null;var t=arguments[0];this.comps=t}function gr(){if(this.component=null,this.segIndex=null,this.pt=null,2===arguments.length){var t=arguments[0],e=arguments[1];gr.call(this,t,gr.INSIDE_AREA,e)}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this.component=n,this.segIndex=i,this.pt=r}}function vr(){this.pts=null;var t=arguments[0];this.pts=t}function yr(){this.locations=null;var t=arguments[0];this.locations=t}function mr(){if(this.geom=null,this.terminateDistance=0,this.ptLocator=new Me,this.minDistanceLocation=null,this.minDistance=r.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];mr.call(this,t,e,0)}else if(3===arguments.length){var n=arguments[0],i=arguments[1],o=arguments[2];this.geom=new Array(2).fill(null),this.geom[0]=n,this.geom[1]=i,this.terminateDistance=o}}function xr(){this.factory=null,this.directedEdges=new w,this.coordinates=null;var t=arguments[0];this.factory=t}function Er(){this._isMarked=!1,this._isVisited=!1,this.data=null}function wr(){Er.apply(this),this.parentEdge=null,this.from=null,this.to=null,this.p0=null,this.p1=null,this.sym=null,this.edgeDirection=null,this.quadrant=null,this.angle=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this.from=t,this.to=e,this.edgeDirection=i,this.p0=t.getCoordinate(),this.p1=n;var r=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y;this.quadrant=Ke.quadrant(r,o),this.angle=Math.atan2(o,r)}function br(){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];wr.call(this,t,e,n,i)}function Ir(){if(Er.apply(this),this.dirEdge=null,0===arguments.length);else if(2===arguments.length){var t=arguments[0],e=arguments[1];this.setDirectedEdges(t,e)}}function Nr(){this.outEdges=new w,this.sorted=!1}function Cr(){if(Er.apply(this),this.pt=null,this.deStar=null,1===arguments.length){var t=arguments[0];Cr.call(this,t,new Nr)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.pt=e,this.deStar=n}}function Sr(){Ir.apply(this),this.line=null;var t=arguments[0];this.line=t}function Mr(){this.nodeMap=new rt}function Lr(){this.edges=new Q,this.dirEdges=new Q,this.nodeMap=new Mr}function Rr(){Lr.apply(this)}function Pr(){this.graph=new Rr,this.mergedLineStrings=null,this.factory=null,this.edgeStrings=null}function Tr(){this.edgeRing=null,this.next=null,this.label=-1;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];wr.call(this,t,e,n,i)}function Or(){Ir.apply(this),this.line=null;var t=arguments[0];this.line=t}function _r(){this.geometryFactory=new ne,this.geomGraph=null,this.disconnectedRingcoord=null;var t=arguments[0];this.geomGraph=t}function Ar(){}function Dr(){if(this.edgeEnds=new w,1===arguments.length){var t=arguments[0];Dr.call(this,null,t)}else if(2===arguments.length){var e=(arguments[0],arguments[1]);xn.call(this,e.getEdge(),e.getCoordinate(),e.getDirectedCoordinate(),new fn(e.getLabel())),this.insert(e)}}function Fr(){Ln.apply(this)}function qr(){var t=arguments[0],e=arguments[1];yn.call(this,t,e)}function kr(){wn.apply(this)}function Gr(){this.nodes=new mn(new kr)}function jr(){this.li=new se,this.geomGraph=null,this.nodeGraph=new Gr,this.invalidPoint=null;var t=arguments[0];this.geomGraph=t}function Br(){this.graph=null,this.rings=new w,this.totalEnv=new I,this.index=null,this.nestedPt=null;var t=arguments[0];this.graph=t}function zr(){if(this.errorType=null,this.pt=null,1===arguments.length){var t=arguments[0];zr.call(this,t,null)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.errorType=e,null!==n&&(this.pt=n.copy())}}function Vr(){this.parentGeometry=null,this.isSelfTouchingRingFormingHoleValid=!1,this.validErr=null;var t=arguments[0];this.parentGeometry=t}function Xr(){this.factory=null,this.deList=new w,this.lowestEdge=null,this.ring=null,this.ringPts=null,this.holes=null,this.shell=null,this._isHole=null,this._isProcessed=!1,this._isIncludedSet=!1,this._isIncluded=!1;var t=arguments[0];this.factory=t}function Yr(){}function Ur(){Lr.apply(this),this.factory=null;var t=arguments[0];this.factory=t}function Wr(){if(this.lineStringAdder=new Hr(this),this.graph=null,this.dangles=new w,this.cutEdges=new w,this.invalidRingLines=new w,this.holeList=null,this.shellList=null,this.polyList=null,this.isCheckingRingsValid=!0,this.extractOnlyPolygonal=null,this.geomFactory=null,0===arguments.length)Wr.call(this,!1);else if(1===arguments.length){var t=arguments[0];this.extractOnlyPolygonal=t}}function Hr(){this.p=null;var t=arguments[0];this.p=t}function Jr(){this.li=new se,this.ptLocator=new Me,this.arg=null,this.nodes=new mn(new kr),this.im=null,this.isolatedEdges=new w,this.invalidPoint=null;var t=arguments[0];this.arg=t}function Zr(){this.rectEnv=null;var t=arguments[0];this.rectEnv=t.getEnvelopeInternal()}function Kr(){this.li=new se,this.rectEnv=null,this.diagUp0=null,this.diagUp1=null,this.diagDown0=null,this.diagDown1=null;var t=arguments[0];this.rectEnv=t,this.diagUp0=new p(t.getMinX(),t.getMinY()),this.diagUp1=new p(t.getMaxX(),t.getMaxY()),this.diagDown0=new p(t.getMinX(),t.getMaxY()),this.diagDown1=new p(t.getMaxX(),t.getMinY())}function Qr(){this._isDone=!1}function $r(){this.rectangle=null,this.rectEnv=null;var t=arguments[0];this.rectangle=t,this.rectEnv=t.getEnvelopeInternal()}function to(){Qr.apply(this),this.rectEnv=null,this._intersects=!1;var t=arguments[0];this.rectEnv=t}function eo(){Qr.apply(this),this.rectSeq=null,this.rectEnv=null,this._containsPoint=!1;var t=arguments[0];this.rectSeq=t.getExteriorRing().getCoordinateSequence(),this.rectEnv=t.getEnvelopeInternal()}function no(){Qr.apply(this),this.rectEnv=null,this.rectIntersector=null,this.hasIntersection=!1,this.p0=new p,this.p1=new p;var t=arguments[0];this.rectEnv=t.getEnvelopeInternal(),this.rectIntersector=new Kr(this.rectEnv)}function io(){if(this._relate=null,2===arguments.length){var t=arguments[0],e=arguments[1];$n.call(this,t,e),this._relate=new Jr(this.arg)}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];$n.call(this,n,i,r),this._relate=new Jr(this.arg)}}function ro(){this.geomFactory=null,this.skipEmpty=!1,this.inputGeoms=null;var t=arguments[0];this.geomFactory=ro.extractFactory(t),this.inputGeoms=t}function oo(){this.pointGeom=null,this.otherGeom=null,this.geomFact=null;var t=arguments[0],e=arguments[1];this.pointGeom=t,this.otherGeom=e,this.geomFact=e.getFactory()}function so(){this.sortIndex=-1,this.comps=null;var t=arguments[0],e=arguments[1];this.sortIndex=t,this.comps=e}function ao(){this.inputPolys=null,this.geomFactory=null;var t=arguments[0];this.inputPolys=t,null===this.inputPolys&&(this.inputPolys=new w)}function uo(){if(this.polygons=new w,this.lines=new w,this.points=new w,this.geomFact=null,1===arguments.length){if(M(arguments[0],v)){var t=arguments[0];this.extract(t)}else if(arguments[0]instanceof G){var e=arguments[0];this.extract(e)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.geomFact=i,this.extract(n)}}function lo(){Ot.CoordinateOperation.apply(this),this.targetPM=null,this.removeCollapsed=!0;var t=arguments[0],e=arguments[1];this.targetPM=t,this.removeCollapsed=e}function co(){this.targetPM=null,this.removeCollapsed=!0,this.changePrecisionModel=!1,this.isPointwise=!1;var t=arguments[0];this.targetPM=t}function ho(){this.pts=null,this.usePt=null,this.distanceTolerance=null,this.seg=new ce;var t=arguments[0];this.pts=t}function fo(){this.inputGeom=null,this.distanceTolerance=null,this.isEnsureValidTopology=!0;var t=arguments[0];this.inputGeom=t}function po(){me.apply(this),this.isEnsureValidTopology=!0,this.distanceTolerance=null;var t=arguments[0],e=arguments[1];this.isEnsureValidTopology=t,this.distanceTolerance=e}function go(){if(this.parent=null,this.index=null,2===arguments.length){var t=arguments[0],e=arguments[1];go.call(this,t,e,null,-1)}else if(4===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2],o=arguments[3];ce.call(this,n,i),this.parent=r,this.index=o}}function vo(){if(this.parentLine=null,this.segs=null,this.resultSegs=new w,this.minimumSize=null,1===arguments.length){var t=arguments[0];vo.call(this,t,2)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.parentLine=e,this.minimumSize=n,this.init()}}function yo(){this.index=new ki}function mo(){this.querySeg=null,this.items=new w;var t=arguments[0];this.querySeg=t}function xo(){this.li=new se,this.inputIndex=new yo,this.outputIndex=new yo,this.line=null,this.linePts=null,this.distanceTolerance=0;var t=arguments[0],e=arguments[1];this.inputIndex=t,this.outputIndex=e}function Eo(){this.inputIndex=new yo,this.outputIndex=new yo,this.distanceTolerance=0}function wo(){this.inputGeom=null,this.lineSimplifier=new Eo,this.linestringMap=null;var t=arguments[0];this.inputGeom=t}function bo(){me.apply(this),this.linestringMap=null;var t=arguments[0];this.linestringMap=t}function Io(){this.tps=null;var t=arguments[0];this.tps=t}function No(){this.seg=null,this.segLen=null,this.splitPt=null,this.minimumLen=0;var t=arguments[0];this.seg=t,this.segLen=t.getLength()}function Co(){}function So(){}function Mo(){}function Lo(){if(this.p=null,1===arguments.length){var t=arguments[0];this.p=new p(t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.p=new p(e,n)}else if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];this.p=new p(i,r,o)}}function Ro(){this._isOnConstraint=null,this.constraint=null;var t=arguments[0];Lo.call(this,t)}function Po(){this._rot=null,this.vertex=null,this.next=null,this.data=null}function To(){this.subdiv=null,this.isUsingTolerance=!1;var t=arguments[0];this.subdiv=t,this.isUsingTolerance=t.getTolerance()>0}function Oo(){}function _o(){this.subdiv=null,this.lastEdge=null;var t=arguments[0];this.subdiv=t,this.init()}function Ao(){if(this.seg=null,1===arguments.length){if("string"==typeof arguments[0]){var t=arguments[0];l.call(this,t)}else if(arguments[0]instanceof ce){var e=arguments[0];l.call(this,"Locate failed to converge (at edge: "+e+"). Possible causes include invalid Subdivision topology or very close sites"),this.seg=new ce(e)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];l.call(this,Ao.msgWithSpatial(n,i)),this.seg=new ce(i)}}function Do(){}function Fo(){this.visitedKey=0,this.quadEdges=new w,this.startingEdge=null,this.tolerance=null,this.edgeCoincidenceTolerance=null,this.frameVertex=new Array(3).fill(null),this.frameEnv=null,this.locator=null,this.seg=new ce,this.triEdges=new Array(3).fill(null);var t=arguments[0],e=arguments[1];this.tolerance=e,this.edgeCoincidenceTolerance=e/Fo.EDGE_COINCIDENCE_TOL_FACTOR,this.createFrame(t),this.startingEdge=this.initSubdiv(),this.locator=new _o(this)}function qo(){}function ko(){this.triList=new w}function Go(){this.triList=new w}function jo(){this.coordList=new b,this.triCoords=new w}function Bo(){if(this.ls=null,this.data=null,2===arguments.length){var t=arguments[0],e=arguments[1];this.ls=new ce(t,e)}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this.ls=new ce(n,i),this.data=r}else if(6===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3],l=arguments[4],c=arguments[5];Bo.call(this,new p(o,s,a),new p(u,l,c))}else if(7===arguments.length){var h=arguments[0],f=arguments[1],d=arguments[2],g=arguments[3],v=arguments[4],y=arguments[5],m=arguments[6];Bo.call(this,new p(h,f,d),new p(g,v,y),m)}}function zo(){}function Vo(){if(this.p=null,this.data=null,this.left=null,this.right=null,this.count=null,2===arguments.length){var t=arguments[0],e=arguments[1];this.p=new p(t),this.left=null,this.right=null,this.count=1,this.data=e}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this.p=new p(n,i),this.left=null,this.right=null,this.count=1,this.data=r}}function Xo(){if(this.root=null,this.numberOfNodes=null,this.tolerance=null,0===arguments.length)Xo.call(this,0);else if(1===arguments.length){var t=arguments[0];this.tolerance=t}}function Yo(){this.tolerance=null,this.matchNode=null,this.matchDist=0,this.p=null;var t=arguments[0],e=arguments[1];this.p=t,this.tolerance=e}function Uo(){this.initialVertices=null,this.segVertices=null,this.segments=new w,this.subdiv=null,this.incDel=null,this.convexHull=null,this.splitFinder=new So,this.kdt=null,this.vertexFactory=null,this.computeAreaEnv=null,this.splitPt=null,this.tolerance=null;var t=arguments[0],e=arguments[1];this.initialVertices=new w(t),this.tolerance=e,this.kdt=new Xo(e)}function Wo(){this.siteCoords=null,this.tolerance=0,this.subdiv=null}function Ho(){this.siteCoords=null,this.constraintLines=null,this.tolerance=0,this.subdiv=null,this.constraintVertexMap=new rt}function Jo(){this.siteCoords=null,this.tolerance=0,this.subdiv=null,this.clipEnv=null,this.diagramEnv=null}function Zo(){}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(void 0===this||null===this)throw new TypeError(this+" is not an object");var e=Object(this),n=Math.max(Math.min(e.length,9007199254740991),0)||0,i=1 in arguments?parseInt(Number(arguments[1]),10)||0:0;i=i<0?Math.max(n+i,0):Math.min(i,n);var r=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:n;for(r=r<0?Math.max(n+arguments[2],0):Math.min(r,n);i<r;)e[i]=t,++i;return e},writable:!0}),Number.isFinite=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)},Number.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(t){return t!==t},Math.trunc=Math.trunc||function(t){return t<0?Math.ceil(t):Math.floor(t)},e(n.prototype,{interfaces_:function(){return[]},getClass:function(){return n}}),n.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n},r.isNaN=function(t){return Number.isNaN(t)},r.doubleToLongBits=function(t){return t},r.longBitsToDouble=function(t){return t},r.isInfinite=function(t){return!Number.isFinite(t)},r.MAX_VALUE=Number.MAX_VALUE,l.prototype=Object.create(Error.prototype),l.prototype.constructor=Error,c(h,l),e(h.prototype,{interfaces_:function(){return[]},getClass:function(){return h}}),e(f.prototype,{interfaces_:function(){return[]},getClass:function(){return f}}),f.shouldNeverReachHere=function(){if(0===arguments.length)f.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new h("Should never reach here"+(null!==t?": "+t:""))}},f.isTrue=function(){if(1===arguments.length){var t=arguments[0];f.isTrue(t,null)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!e)throw null===n?new h:new h(n)}},f.equals=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];f.equals(t,e,null)}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];if(!i.equals(n))throw new h("Expected "+n+" but encountered "+i+(null!==r?": "+r:""))}},e(p.prototype,{setOrdinate:function(t,e){switch(t){case p.X:this.x=e;break;case p.Y:this.y=e;break;case p.Z:this.z=e;break;default:throw new i("Invalid ordinate index: "+t)}},equals2D:function(){if(1===arguments.length){var t=arguments[0];return this.x===t.x&&this.y===t.y}if(2===arguments.length){var e=arguments[0],i=arguments[1];return!!n.equalsWithTolerance(this.x,e.x,i)&&!!n.equalsWithTolerance(this.y,e.y,i)}},getOrdinate:function(t){switch(t){case p.X:return this.x;case p.Y:return this.y;case p.Z:return this.z}throw new i("Invalid ordinate index: "+t)},equals3D:function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||r.isNaN(this.z)&&r.isNaN(t.z))},equals:function(t){return t instanceof p&&this.equals2D(t)},equalInZ:function(t,e){return n.equalsWithTolerance(this.z,t.z,e)},compareTo:function(t){var e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0},clone:function(){try{return null}catch(t){if(t instanceof CloneNotSupportedException)return f.shouldNeverReachHere("this shouldn't happen because this class is Cloneable"),null;throw t}},copy:function(){return new p(this)},toString:function(){return"("+this.x+", "+this.y+", "+this.z+")"},distance3D:function(t){var e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return Math.sqrt(e*e+n*n+i*i)},distance:function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},hashCode:function(){var t=17;return t=37*t+p.hashCode(this.x),t=37*t+p.hashCode(this.y)},setCoordinate:function(t){this.x=t.x,this.y=t.y,this.z=t.z},interfaces_:function(){return[o,s,u]},getClass:function(){return p}}),p.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=r.doubleToLongBits(t);return Math.trunc(e^e>>>32)}},e(d.prototype,{compare:function(t,e){var n=t,i=e,r=d.compare(n.x,i.x);if(0!==r)return r;var o=d.compare(n.y,i.y);return 0!==o?o:this.dimensionsToTest<=2?0:d.compare(n.z,i.z)},interfaces_:function(){return[a]},getClass:function(){return d}}),d.compare=function(t,e){return t<e?-1:t>e?1:r.isNaN(t)?r.isNaN(e)?0:-1:r.isNaN(e)?1:0},p.DimensionalComparator=d,p.serialVersionUID=0x5cbf2c235c7e5800,p.NULL_ORDINATE=r.NaN,p.X=0,p.Y=1,p.Z=2,g.prototype.hasNext=function(){},g.prototype.next=function(){},g.prototype.remove=function(){},v.prototype.add=function(){},v.prototype.addAll=function(){},v.prototype.isEmpty=function(){},v.prototype.iterator=function(){},v.prototype.size=function(){},v.prototype.toArray=function(){},v.prototype.remove=function(){},y.prototype=new Error,y.prototype.name="IndexOutOfBoundsException",m.prototype=Object.create(v.prototype),m.prototype.constructor=m,m.prototype.get=function(){},m.prototype.set=function(){},m.prototype.isEmpty=function(){},x.prototype=new Error,x.prototype.name="NoSuchElementException",E.prototype=new Error,E.prototype.name="OperationNotSupported",w.prototype=Object.create(m.prototype),w.prototype.constructor=w,w.prototype.ensureCapacity=function(){},w.prototype.interfaces_=function(){return[m,v]},w.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},w.prototype.clear=function(){this.array_=[]},w.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},w.prototype.set=function(t,e){var n=this.array_[t];return this.array_[t]=e,n},w.prototype.iterator=function(){return new Ko(this)},w.prototype.get=function(t){if(t<0||t>=this.size())throw new y;return this.array_[t]},w.prototype.isEmpty=function(){return 0===this.array_.length},w.prototype.size=function(){return this.array_.length},w.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},w.prototype.remove=function(t){for(var e=!1,n=0,i=this.array_.length;n<i;n++)if(this.array_[n]===t){this.array_.splice(n,1),e=!0;break}return e};var Ko=function(t){this.arrayList_=t,this.position_=0};Ko.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new x;return this.arrayList_.get(this.position_++)},Ko.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},Ko.prototype.set=function(t){return this.arrayList_.set(this.position_-1,t)},Ko.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},c(b,w),e(b.prototype,{getCoordinate:function(t){return this.get(t)},addAll:function(){if(2===arguments.length){for(var t=arguments[0],e=arguments[1],n=!1,i=t.iterator();i.hasNext();)this.add(i.next(),e),n=!0;return n}return w.prototype.addAll.apply(this,arguments)},clone:function(){for(var t=w.prototype.clone.call(this),e=0;e<this.size();e++)t.add(e,this.get(e).copy());return t},toCoordinateArray:function(){return this.toArray(b.coordArrayType)},add:function(){if(1===arguments.length){var t=arguments[0];w.prototype.add.call(this,t)}else if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var e=arguments[0],n=arguments[1];return this.add(e,n,!0),!0}if(arguments[0]instanceof p&&"boolean"==typeof arguments[1]){var i=arguments[0],r=arguments[1];if(!r&&this.size()>=1){var o=this.get(this.size()-1);if(o.equals2D(i))return null}w.prototype.add.call(this,i)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var s=arguments[0],a=arguments[1];return this.add(s,a),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var u=arguments[0],l=arguments[1],c=arguments[2];if(c)for(var h=0;h<u.length;h++)this.add(u[h],l);else for(var h=u.length-1;h>=0;h--)this.add(u[h],l);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof p){var f=arguments[0],d=arguments[1],g=arguments[2];if(!g){var v=this.size();if(v>0){if(f>0){var y=this.get(f-1);if(y.equals2D(d))return null}if(f<v){var m=this.get(f);if(m.equals2D(d))return null}}}w.prototype.add.call(this,f,d)}}else if(4===arguments.length){var x=arguments[0],E=arguments[1],b=arguments[2],I=arguments[3],N=1;b>I&&(N=-1);for(var h=b;h!==I;h+=N)this.add(x[h],E);return!0}},closeRing:function(){this.size()>0&&this.add(new p(this.get(0)),!1)},interfaces_:function(){return[]},getClass:function(){return b}}),b.coordArrayType=new Array(0).fill(null),e(I.prototype,{getArea:function(){return this.getWidth()*this.getHeight()},equals:function(t){if(!(t instanceof I))return!1;var e=t;return this.isNull()?e.isNull():this.maxx===e.getMaxX()&&this.maxy===e.getMaxY()&&this.minx===e.getMinX()&&this.miny===e.getMinY()},intersection:function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new I;var e=this.minx>t.minx?this.minx:t.minx,n=this.miny>t.miny?this.miny:t.miny;return new I(e,this.maxx<t.maxx?this.maxx:t.maxx,n,this.maxy<t.maxy?this.maxy:t.maxy)},isNull:function(){return this.maxx<this.minx},getMaxX:function(){return this.maxx},covers:function(){if(1===arguments.length){if(arguments[0]instanceof p){var t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof I){var e=arguments[0];return!this.isNull()&&!e.isNull()&&e.getMinX()>=this.minx&&e.getMaxX()<=this.maxx&&e.getMinY()>=this.miny&&e.getMaxY()<=this.maxy}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];return!this.isNull()&&n>=this.minx&&n<=this.maxx&&i>=this.miny&&i<=this.maxy}},intersects:function(){if(1===arguments.length){if(arguments[0]instanceof I){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t.minx>this.maxx||t.maxx<this.minx||t.miny>this.maxy||t.maxy<this.miny)}if(arguments[0]instanceof p){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];return!this.isNull()&&!(n>this.maxx||n<this.minx||i>this.maxy||i<this.miny)}},getMinY:function(){return this.miny},getMinX:function(){return this.minx},expandToInclude:function(){if(1===arguments.length){if(arguments[0]instanceof p){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof I){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this.minx=e.getMinX(),this.maxx=e.getMaxX(),this.miny=e.getMinY(),this.maxy=e.getMaxY()):(e.minx<this.minx&&(this.minx=e.minx),e.maxx>this.maxx&&(this.maxx=e.maxx),e.miny<this.miny&&(this.miny=e.miny),e.maxy>this.maxy&&(this.maxy=e.maxy))}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.isNull()?(this.minx=n,this.maxx=n,this.miny=i,this.maxy=i):(n<this.minx&&(this.minx=n),n>this.maxx&&(this.maxx=n),i<this.miny&&(this.miny=i),i>this.maxy&&(this.maxy=i))}},minExtent:function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},getWidth:function(){return this.isNull()?0:this.maxx-this.minx},compareTo:function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this.minx<e.minx?-1:this.minx>e.minx?1:this.miny<e.miny?-1:this.miny>e.miny?1:this.maxx<e.maxx?-1:this.maxx>e.maxx?1:this.maxy<e.maxy?-1:this.maxy>e.maxy?1:0},translate:function(t,e){return this.isNull()?null:void this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},toString:function(){return"Env["+this.minx+" : "+this.maxx+", "+this.miny+" : "+this.maxy+"]"},setToNull:function(){this.minx=0,this.maxx=-1,this.miny=0,this.maxy=-1},getHeight:function(){return this.isNull()?0:this.maxy-this.miny},maxExtent:function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},expandBy:function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1]
;if(this.isNull())return null;this.minx-=e,this.maxx+=e,this.miny-=n,this.maxy+=n,(this.minx>this.maxx||this.miny>this.maxy)&&this.setToNull()}},contains:function(){if(1===arguments.length){if(arguments[0]instanceof I){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof p){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];return this.covers(n,i)}},centre:function(){return this.isNull()?null:new p((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},init:function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof p){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof I){var e=arguments[0];this.minx=e.minx,this.maxx=e.maxx,this.miny=e.miny,this.maxy=e.maxy}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(4===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];r<o?(this.minx=r,this.maxx=o):(this.minx=o,this.maxx=r),s<a?(this.miny=s,this.maxy=a):(this.miny=a,this.maxy=s)}},getMaxY:function(){return this.maxy},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 n=0;return this.maxy<t.miny?n=t.miny-this.maxy:this.miny>t.maxy&&(n=this.miny-t.maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)},hashCode:function(){var t=17;return t=37*t+p.hashCode(this.minx),t=37*t+p.hashCode(this.maxx),t=37*t+p.hashCode(this.miny),t=37*t+p.hashCode(this.maxy)},interfaces_:function(){return[o,u]},getClass:function(){return I}}),I.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.x<e.x?t.x:e.x)&&n.x<=(t.x>e.x?t.x:e.x)&&n.y>=(t.y<e.y?t.y:e.y)&&n.y<=(t.y>e.y?t.y:e.y)}if(4===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2],s=arguments[3],a=Math.min(o.x,s.x),u=Math.max(o.x,s.x),l=Math.min(i.x,r.x),c=Math.max(i.x,r.x);return!(l>u||c<a||(a=Math.min(o.y,s.y),u=Math.max(o.y,s.y),l=Math.min(i.y,r.y),c=Math.max(i.y,r.y),l>u||c<a))}},I.serialVersionUID=0x51845cd552189800,c(C,N),e(C.prototype,{interfaces_:function(){return[]},getClass:function(){return C}}),e(S.prototype,{interfaces_:function(){return[]},getClass:function(){return S}}),S.toLocationSymbol=function(t){switch(t){case S.EXTERIOR:return"e";case S.BOUNDARY:return"b";case S.INTERIOR:return"i";case S.NONE:return"-"}throw new i("Unknown location value: "+t)},S.INTERIOR=0,S.BOUNDARY=1,S.EXTERIOR=2,S.NONE=-1,e(L.prototype,{interfaces_:function(){return[]},getClass:function(){return L}}),L.log10=function(t){var e=Math.log(t);return r.isInfinite(e)?e:r.isNaN(e)?e:e/L.LOG_10},L.min=function(t,e,n,i){var r=t;return e<r&&(r=e),n<r&&(r=n),i<r&&(r=i),r},L.clamp=function(){if("number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1],n=arguments[2];return t<e?e:t>n?n:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],r=arguments[1],o=arguments[2];return i<r?r:i>o?o:i}},L.wrap=function(t,e){return t<0?e- -t%e:t%e},L.max=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],i=t;return e>i&&(i=e),n>i&&(i=n),i}if(4===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],i=r;return o>i&&(i=o),s>i&&(i=s),a>i&&(i=a),i}},L.average=function(t,e){return(t+e)/2},L.LOG_10=Math.log(10),R.prototype.append=function(t){this.str+=t},R.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},R.prototype.toString=function(t){return this.str},P.prototype.intValue=function(){return this.value},P.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},P.isNaN=function(t){return Number.isNaN(t)},T.isWhitespace=function(t){return t<=32&&t>=0||127==t},T.toUpperCase=function(t){return t.toUpperCase()},e(O.prototype,{le:function(t){return this.hi<t.hi||this.hi===t.hi&&this.lo<=t.lo},extractSignificantDigits:function(t,e){var n=this.abs(),i=O.magnitude(n.hi),r=O.TEN.pow(i);n=n.divide(r),n.gt(O.TEN)?(n=n.divide(O.TEN),i+=1):n.lt(O.ONE)&&(n=n.multiply(O.TEN),i-=1);for(var o=i+1,s=new R,a=O.MAX_PRINT_DIGITS-1,u=0;u<=a;u++){t&&u===o&&s.append(".");var l=Math.trunc(n.hi);if(l<0)break;var c=!1,h=0;l>9?(c=!0,h="9"):h="0"+l,s.append(h),n=n.subtract(O.valueOf(l)).multiply(O.TEN),c&&n.selfAdd(O.TEN);var f=!0,p=O.magnitude(n.hi);if(p<0&&Math.abs(p)>=a-u&&(f=!1),!f)break}return e[0]=i,s.toString()},sqr:function(){return this.multiply(this)},doubleValue:function(){return this.hi+this.lo},subtract:function(){if(arguments[0]instanceof O){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},equals:function(){if(1===arguments.length){var t=arguments[0];return this.hi===t.hi&&this.lo===t.lo}},isZero:function(){return 0===this.hi&&0===this.lo},selfSubtract:function(){if(arguments[0]instanceof O){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t.hi,-t.lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},getSpecialNumberString:function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},min:function(t){return this.le(t)?this:t},selfDivide:function(){if(1===arguments.length){if(arguments[0]instanceof O){var t=arguments[0];return this.selfDivide(t.hi,t.lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1],r=null,o=null,s=null,a=null,u=null,l=null,c=null,h=null;return u=this.hi/n,l=O.SPLIT*u,r=l-u,h=O.SPLIT*n,r=l-r,o=u-r,s=h-n,c=u*n,s=h-s,a=n-s,h=r*s-c+r*a+o*s+o*a,l=(this.hi-c-h+this.lo-u*i)/n,h=u+l,this.hi=h,this.lo=u-h+l,this}},dump:function(){return"DD<"+this.hi+", "+this.lo+">"},divide:function(){if(arguments[0]instanceof O){var t=arguments[0],e=null,n=null,i=null,o=null,s=null,a=null,u=null,l=null;s=this.hi/t.hi,a=O.SPLIT*s,e=a-s,l=O.SPLIT*t.hi,e=a-e,n=s-e,i=l-t.hi,u=s*t.hi,i=l-i,o=t.hi-i,l=e*i-u+e*o+n*i+n*o,a=(this.hi-u-l+this.lo-s*t.lo)/t.hi,l=s+a;return new O(l,s-l+a)}if("number"==typeof arguments[0]){var c=arguments[0];return r.isNaN(c)?O.createNaN():O.copy(this).selfDivide(c,0)}},ge:function(t){return this.hi>t.hi||this.hi===t.hi&&this.lo>=t.lo},pow:function(t){if(0===t)return O.valueOf(1);var e=new O(this),n=O.valueOf(1),i=Math.abs(t);if(i>1)for(;i>0;)i%2==1&&n.selfMultiply(e),(i/=2)>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},ceil:function(){if(this.isNaN())return O.NaN;var t=Math.ceil(this.hi),e=0;return t===this.hi&&(e=Math.ceil(this.lo)),new O(t,e)},compareTo:function(t){var e=t;return this.hi<e.hi?-1:this.hi>e.hi?1:this.lo<e.lo?-1:this.lo>e.lo?1:0},rint:function(){return this.isNaN()?this:this.add(.5).floor()},setValue:function(){if(arguments[0]instanceof O){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},max:function(t){return this.ge(t)?this:t},sqrt:function(){if(this.isZero())return O.valueOf(0);if(this.isNegative())return O.NaN;var t=1/Math.sqrt(this.hi),e=this.hi*t,n=O.valueOf(e),i=this.subtract(n.sqr()),r=i.hi*(.5*t);return n.add(r)},selfAdd:function(){if(1===arguments.length){if(arguments[0]instanceof O){var t=arguments[0];return this.selfAdd(t.hi,t.lo)}if("number"==typeof arguments[0]){var e=arguments[0],n=null,i=null,r=null,o=null,s=null,a=null;return r=this.hi+e,s=r-this.hi,o=r-s,o=e-s+(this.hi-o),a=o+this.lo,n=r+a,i=a+(r-n),this.hi=n+i,this.lo=i+(n-this.hi),this}}else if(2===arguments.length){var u=arguments[0],l=arguments[1],n=null,i=null,c=null,h=null,r=null,o=null,s=null,a=null;r=this.hi+u,c=this.lo+l,s=r-this.hi,a=c-this.lo,o=r-s,h=c-a,o=u-s+(this.hi-o),h=l-a+(this.lo-h),s=o+c,n=r+s,i=s+(r-n),s=h+i;var f=n+s,p=s+(n-f);return this.hi=f,this.lo=p,this}},selfMultiply:function(){if(1===arguments.length){if(arguments[0]instanceof O){var t=arguments[0];return this.selfMultiply(t.hi,t.lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1],r=null,o=null,s=null,a=null,u=null,l=null;u=O.SPLIT*this.hi,r=u-this.hi,l=O.SPLIT*n,r=u-r,o=this.hi-r,s=l-n,u=this.hi*n,s=l-s,a=n-s,l=r*s-u+r*a+o*s+o*a+(this.hi*i+this.lo*n);var c=u+l;r=u-c;var h=l+r;return this.hi=c,this.lo=h,this}},selfSqr:function(){return this.selfMultiply(this)},floor:function(){if(this.isNaN())return O.NaN;var t=Math.floor(this.hi),e=0;return t===this.hi&&(e=Math.floor(this.lo)),new O(t,e)},negate:function(){return this.isNaN()?this:new O(-this.hi,-this.lo)},clone:function(){try{return null}catch(t){if(t instanceof CloneNotSupportedException)return null;throw t}},multiply:function(){if(arguments[0]instanceof O){var t=arguments[0];return t.isNaN()?O.createNaN():O.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return r.isNaN(e)?O.createNaN():O.copy(this).selfMultiply(e,0)}},isNaN:function(){return r.isNaN(this.hi)},intValue:function(){return Math.trunc(this.hi)},toString:function(){var t=O.magnitude(this.hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},toStandardNotation:function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),i=e[0]+1,r=n;if("."===n.charAt(0))r="0"+n;else if(i<0)r="0."+O.stringOfChar("0",-i)+n;else if(-1===n.indexOf(".")){var o=i-n.length,s=O.stringOfChar("0",o);r=n+s+".0"}return this.isNegative()?"-"+r:r},reciprocal:function(){var t=null,e=null,n=null,i=null,r=null,o=null,s=null,a=null;r=1/this.hi,o=O.SPLIT*r,t=o-r,a=O.SPLIT*this.hi,t=o-t,e=r-t,n=a-this.hi,s=r*this.hi,n=a-n,i=this.hi-n,a=t*n-s+t*i+e*n+e*i,o=(1-s-a-r*this.lo)/this.hi;var u=r+o;return new O(u,r-u+o)},toSciNotation:function(){if(this.isZero())return O.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),i=O.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new IllegalStateException("Found leading zero: "+n);var r="";n.length>1&&(r=n.substring(1));var o=n.charAt(0)+"."+r;return this.isNegative()?"-"+o+i:o+i},abs:function(){return this.isNaN()?O.NaN:this.isNegative()?this.negate():new O(this)},isPositive:function(){return this.hi>0||0===this.hi&&this.lo>0},lt:function(t){return this.hi<t.hi||this.hi===t.hi&&this.lo<t.lo},add:function(){if(arguments[0]instanceof O){var t=arguments[0];return O.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){var e=arguments[0];return O.copy(this).selfAdd(e)}},init:function(){if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this.hi=t,this.lo=0}else if(arguments[0]instanceof O){var e=arguments[0];this.hi=e.hi,this.lo=e.lo}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.hi=n,this.lo=i}},gt:function(t){return this.hi>t.hi||this.hi===t.hi&&this.lo>t.lo},isNegative:function(){return this.hi<0||0===this.hi&&this.lo<0},trunc:function(){return this.isNaN()?O.NaN:this.isPositive()?this.floor():this.ceil()},signum:function(){return this.hi>0?1:this.hi<0?-1:this.lo>0?1:this.lo<0?-1:0},interfaces_:function(){return[u,o,s]},getClass:function(){return O}}),O.sqr=function(t){return O.valueOf(t).selfMultiply(t)},O.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return O.parse(t)}if("number"==typeof arguments[0]){return new O(arguments[0])}},O.sqrt=function(t){return O.valueOf(t).sqrt()},O.parse=function(t){for(var e=0,n=t.length;T.isWhitespace(t.charAt(e));)e++;var i=!1;if(e<n){var r=t.charAt(e);"-"!==r&&"+"!==r||(e++,"-"===r&&(i=!0))}for(var o=new O,s=0,a=0,u=0;!(e>=n);){var l=t.charAt(e);if(e++,T.isDigit(l)){var c=l-"0";o.selfMultiply(O.TEN),o.selfAdd(c),s++}else{if("."!==l){if("e"===l||"E"===l){var h=t.substring(e);try{u=P.parseInt(h)}catch(e){throw e instanceof NumberFormatException?new NumberFormatException("Invalid exponent "+h+" in string "+t):e}break}throw new NumberFormatException("Unexpected character '"+l+"' at position "+e+" in string "+t)}a=s}}var f=o,p=s-a-u;if(0===p)f=o;else if(p>0){var d=O.TEN.pow(p);f=o.divide(d)}else if(p<0){var d=O.TEN.pow(-p);f=o.multiply(d)}return i?f.negate():f},O.createNaN=function(){return new O(r.NaN,r.NaN)},O.copy=function(t){return new O(t)},O.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),i=Math.trunc(Math.floor(n));return 10*Math.pow(10,i)<=e&&(i+=1),i},O.stringOfChar=function(t,e){for(var n=new R,i=0;i<e;i++)n.append(t);return n.toString()},O.PI=new O(3.141592653589793,1.2246467991473532e-16),O.TWO_PI=new O(6.283185307179586,2.4492935982947064e-16),O.PI_2=new O(1.5707963267948966,6.123233995736766e-17),O.E=new O(2.718281828459045,1.4456468917292502e-16),O.NaN=new O(r.NaN,r.NaN),O.EPS=1.23259516440783e-32,O.SPLIT=134217729,O.MAX_PRINT_DIGITS=32,O.TEN=O.valueOf(10),O.ONE=O.valueOf(1),O.SCI_NOT_EXPONENT_CHAR="E",O.SCI_NOT_ZERO="0.0E0",e(_.prototype,{interfaces_:function(){return[]},getClass:function(){return _}}),_.orientationIndex=function(t,e,n){var i=_.orientationIndexFilter(t,e,n);if(i<=1)return i;var r=O.valueOf(e.x).selfAdd(-t.x),o=O.valueOf(e.y).selfAdd(-t.y),s=O.valueOf(n.x).selfAdd(-e.x),a=O.valueOf(n.y).selfAdd(-e.y);return r.selfMultiply(a).selfSubtract(o.selfMultiply(s)).signum()},_.signOfDet2x2=function(t,e,n,i){return t.multiply(i).selfSubtract(e.multiply(n)).signum()},_.intersection=function(t,e,n,i){var r=O.valueOf(i.y).selfSubtract(n.y).selfMultiply(O.valueOf(e.x).selfSubtract(t.x)),o=O.valueOf(i.x).selfSubtract(n.x).selfMultiply(O.valueOf(e.y).selfSubtract(t.y)),s=r.subtract(o),a=O.valueOf(i.x).selfSubtract(n.x).selfMultiply(O.valueOf(t.y).selfSubtract(n.y)),u=O.valueOf(i.y).selfSubtract(n.y).selfMultiply(O.valueOf(t.x).selfSubtract(n.x)),l=a.subtract(u),c=l.selfDivide(s).doubleValue(),h=O.valueOf(t.x).selfAdd(O.valueOf(e.x).selfSubtract(t.x).selfMultiply(c)).doubleValue(),f=O.valueOf(e.x).selfSubtract(t.x).selfMultiply(O.valueOf(t.y).selfSubtract(n.y)),d=O.valueOf(e.y).selfSubtract(t.y).selfMultiply(O.valueOf(t.x).selfSubtract(n.x)),g=f.subtract(d),v=g.selfDivide(s).doubleValue();return new p(h,O.valueOf(n.y).selfAdd(O.valueOf(i.y).selfSubtract(n.y).selfMultiply(v)).doubleValue())},_.orientationIndexFilter=function(t,e,n){var i=null,r=(t.x-n.x)*(e.y-n.y),o=(t.y-n.y)*(e.x-n.x),s=r-o;if(r>0){if(o<=0)return _.signum(s);i=r+o}else{if(!(r<0))return _.signum(s);if(o>=0)return _.signum(s);i=-r-o}var a=_.DP_SAFE_EPSILON*i;return s>=a||-s>=a?_.signum(s):2},_.signum=function(t){return t>0?1:t<0?-1:0},_.DP_SAFE_EPSILON=1e-15,e(A.prototype,{setOrdinate:function(t,e,n){},size:function(){},getOrdinate:function(t,e){},getCoordinate:function(){1===arguments.length?arguments[0]:2===arguments.length&&(arguments[0],arguments[1])},getCoordinateCopy:function(t){},getDimension:function(){},getX:function(t){},clone:function(){},expandEnvelope:function(t){},copy:function(){},getY:function(t){},toCoordinateArray:function(){},interfaces_:function(){return[s]},getClass:function(){return A}}),A.X=0,A.Y=1,A.Z=2,A.M=3,D.arraycopy=function(t,e,n,i,r){for(var o=0,s=e;s<e+r;s++)n[i+o]=t[s],o++},D.getProperty=function(t){return{"line.separator":"\n"}[t]},e(F.prototype,{getY:function(){var t=this.y/this.w;if(r.isNaN(t)||r.isInfinite(t))throw new C;return t},getX:function(){var t=this.x/this.w;if(r.isNaN(t)||r.isInfinite(t))throw new C;return t},getCoordinate:function(){var t=new p;return t.x=this.getX(),t.y=this.getY(),t},interfaces_:function(){return[]},getClass:function(){return F}}),F.intersection=function(t,e,n,i){var o=t.y-e.y,s=e.x-t.x,a=t.x*e.y-e.x*t.y,u=n.y-i.y,l=i.x-n.x,c=n.x*i.y-i.x*n.y,h=s*c-l*a,f=u*a-o*c,d=o*l-u*s,g=h/d,v=f/d;if(r.isNaN(g)||r.isInfinite(g)||r.isNaN(v)||r.isInfinite(v))throw new C;return new p(g,v)},e(q.prototype,{create:function(){1===arguments.length?arguments[0]instanceof Array?arguments[0]:M(arguments[0],A)&&arguments[0]:2===arguments.length&&(arguments[0],arguments[1])},interfaces_:function(){return[]},getClass:function(){return q}}),e(k.prototype,{filter:function(t){},interfaces_:function(){return[]},getClass:function(){return k}}),e(G.prototype,{isGeometryCollection:function(){return this.getSortIndex()===G.SORTINDEX_GEOMETRYCOLLECTION},getFactory:function(){return this.factory},getGeometryN:function(t){return this},getArea:function(){return 0},isRectangle:function(){return!1},equals:function(){if(1===arguments.length){if(arguments[0]instanceof G){var t=arguments[0];return null!==t&&this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof G))return!1;var n=e;return this.equalsExact(n)}}},equalsExact:function(t){return this===t||this.equalsExact(t,0)},geometryChanged:function(){this.apply(G.geometryChangedFilter)},geometryChangedAction:function(){this.envelope=null},equalsNorm:function(t){return null!==t&&this.norm().equalsExact(t.norm())},getLength:function(){return 0},getNumGeometries:function(){return 1},compareTo:function(){if(1===arguments.length){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}if(2===arguments.length){var n=arguments[0],i=arguments[1],e=n;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(n,i)}},getUserData:function(){return this.userData},getSRID:function(){return this.SRID},getEnvelope:function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},checkNotGeometryCollection:function(t){if(t.getSortIndex()===G.SORTINDEX_GEOMETRYCOLLECTION)throw new i("This method does not support GeometryCollection arguments")},equal:function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n},norm:function(){var t=this.copy();return t.normalize(),t},getPrecisionModel:function(){return this.factory.getPrecisionModel()},getEnvelopeInternal:function(){return null===this.envelope&&(this.envelope=this.computeEnvelopeInternal()),new I(this.envelope)},setSRID:function(t){this.SRID=t},setUserData:function(t){this.userData=t},compare:function(t,e){for(var n=t.iterator(),i=e.iterator();n.hasNext()&&i.hasNext();){var r=n.next(),o=i.next(),s=r.compareTo(o);if(0!==s)return s}return n.hasNext()?1:i.hasNext()?-1:0},hashCode:function(){return this.getEnvelopeInternal().hashCode()},isGeometryCollectionOrDerived:function(){return this.getSortIndex()===G.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===G.SORTINDEX_MULTIPOINT||this.getSortIndex()===G.SORTINDEX_MULTILINESTRING||this.getSortIndex()===G.SORTINDEX_MULTIPOLYGON},interfaces_:function(){return[s,o,u]},getClass:function(){return G}}),G.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},G.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(null===t[e])return!0;return!1},G.serialVersionUID=0x799ea46522854c00,G.SORTINDEX_POINT=0,G.SORTINDEX_MULTIPOINT=1,G.SORTINDEX_LINESTRING=2,G.SORTINDEX_LINEARRING=3,G.SORTINDEX_MULTILINESTRING=4,G.SORTINDEX_POLYGON=5,G.SORTINDEX_MULTIPOLYGON=6,G.SORTINDEX_GEOMETRYCOLLECTION=7,G.geometryChangedFilter={interfaces_:function(){return[k]},filter:function(t){t.geometryChangedAction()}},e(j.prototype,{filter:function(t){},interfaces_:function(){return[]},getClass:function(){return j}}),e(B.prototype,{isInBoundary:function(t){},interfaces_:function(){return[]},getClass:function(){return B}}),e(z.prototype,{isInBoundary:function(t){return t%2==1},interfaces_:function(){return[B]},getClass:function(){return z}}),e(V.prototype,{isInBoundary:function(t){return t>0},interfaces_:function(){return[B]},getClass:function(){return V}}),e(X.prototype,{isInBoundary:function(t){return t>1},interfaces_:function(){return[B]},getClass:function(){return X}}),e(Y.prototype,{isInBoundary:function(t){return 1===t},interfaces_:function(){return[B]},getClass:function(){return Y}}),B.Mod2BoundaryNodeRule=z,B.EndPointBoundaryNodeRule=V,B.MultiValentEndPointBoundaryNodeRule=X,B.MonoValentEndPointBoundaryNodeRule=Y,B.MOD2_BOUNDARY_RULE=new z,B.ENDPOINT_BOUNDARY_RULE=new V,B.MULTIVALENT_ENDPOINT_BOUNDARY_RULE=new X,B.MONOVALENT_ENDPOINT_BOUNDARY_RULE=new Y,B.OGC_SFS_BOUNDARY_RULE=B.MOD2_BOUNDARY_RULE,e(U.prototype,{interfaces_:function(){return[]},getClass:function(){return U}}),U.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},U.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var i=t[n];if(U.indexOf(i,e)<0)return i}return null},U.scroll=function(t,e){var n=U.indexOf(e,t);if(n<0)return null;var i=new Array(t.length).fill(null);D.arraycopy(t,n,i,0,t.length-n),D.arraycopy(t,0,i,t.length-n,n),D.arraycopy(i,0,t,0,t.length)},U.equals=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(null===t||null===e)return!1;if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0}if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];if(i===r)return!0;if(null===i||null===r)return!1;if(i.length!==r.length)return!1;for(var n=0;n<i.length;n++)if(0!==o.compare(i[n],r[n]))return!1;return!0}},U.intersection=function(t,e){for(var n=new b,i=0;i<t.length;i++)e.intersects(t[i])&&n.add(t[i],!0);return n.toCoordinateArray()},U.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},U.removeRepeatedPoints=function(t){return U.hasRepeatedPoints(t)?new b(t,!1).toCoordinateArray():t},U.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),i=0;i<=n;i++){var r=t[i];t[i]=t[e-i],t[e-i]=r}},U.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)null!==t[n]&&e++;var i=new Array(e).fill(null);if(0===e)return i;for(var r=0,n=0;n<t.length;n++)null!==t[n]&&(i[r++]=t[n]);return i},U.copyDeep=function(){if(1===arguments.length){for(var t=arguments[0],e=new Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new p(t[n]);return e}if(5===arguments.length)for(var i=arguments[0],r=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4],n=0;n<a;n++)o[s+n]=new p(i[r+n])},U.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var i=t[n],r=e[t.length-n-1];if(0!==i.compareTo(r))return!1}return!0},U.envelope=function(t){for(var e=new I,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},U.toCoordinateArray=function(t){return t.toArray(U.coordArrayType)},U.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},U.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},U.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,i=t[e].compareTo(t[n]);if(0!==i)return i}return 1},U.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var i=t[n].compareTo(e[n]);if(0!==i)return i;n++}return n<e.length?-1:n<t.length?1:0},U.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(null===e||e.compareTo(t[n])>0)&&(e=t[n]);return e},U.extract=function(t,e,n){e=L.clamp(e,0,t.length),n=L.clamp(n,-1,t.length);var i=n-e+1;n<0&&(i=0),e>=t.length&&(i=0),n<e&&(i=0);var r=new Array(i).fill(null);if(0===i)return r;for(var o=0,s=e;s<=n;s++)r[o++]=t[s];return r},e(W.prototype,{compare:function(t,e){var n=t,i=e;return U.compare(n,i)},interfaces_:function(){return[a]},getClass:function(){return W}}),e(H.prototype,{compare:function(t,e){var n=t,i=e;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(0===n.length)return 0;var r=U.compare(n,i);return U.isEqualReversed(n,i)?0:r},OLDcompare:function(t,e){var n=t,i=e;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(0===n.length)return 0;for(var r=U.increasingDirection(n),o=U.increasingDirection(i),s=r>0?0:n.length-1,a=o>0?0:n.length-1,u=0;u<n.length;u++){var l=n[s].compareTo(i[a]);if(0!==l)return l;s+=r,a+=o}return 0},interfaces_:function(){return[a]},getClass:function(){return H}}),U.ForwardComparator=W,U.BidirectionalComparator=H,U.coordArrayType=new Array(0).fill(null),J.prototype.get=function(){},J.prototype.put=function(){},J.prototype.size=function(){},J.prototype.values=function(){},J.prototype.entrySet=function(){},Z.prototype=new J,K.prototype=new v,K.prototype.contains=function(){},Q.prototype=new K,Q.prototype.contains=function(t){for(var e=0,n=this.array_.length;e<n;e++){if(this.array_[e]===t)return!0}return!1},Q.prototype.add=function(t){return!this.contains(t)&&(this.array_.push(t),!0)},Q.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},Q.prototype.remove=function(t){throw new javascript.util.OperationNotSupported},Q.prototype.size=function(){return this.array_.length},Q.prototype.isEmpty=function(){return 0===this.array_.length},Q.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},Q.prototype.iterator=function(){return new Qo(this)};var Qo=function(t){this.hashSet_=t,this.position_=0};Qo.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new x;return this.hashSet_.array_[this.position_++]},Qo.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},Qo.prototype.remove=function(){throw new E};var $o=0;rt.prototype=new Z,rt.prototype.get=function(t){for(var e=this.root_;null!==e;){var n=t.compareTo(e.key);if(n<0)e=e.left;else{if(!(n>0))return e.value;e=e.right}}return null},rt.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:$o,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,i,r=this.root_;do{if(n=r,(i=t.compareTo(r.key))<0)r=r.left;else{if(!(i>0)){var o=r.value;return r.value=e,o}r=r.right}}while(null!==r);var s={key:t,left:null,right:null,value:e,parent:n,color:$o,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?n.left=s:n.right=s,this.fixAfterInsertion(s),this.size_++,null},rt.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!=this.root_&&1==t.parent.color;)if(tt(t)==nt(tt(tt(t)))){var e=it(tt(tt(t)));1==$(e)?(et(tt(t),$o),et(e,$o),et(tt(tt(t)),1),t=tt(tt(t))):(t==it(tt(t))&&(t=tt(t),this.rotateLeft(t)),et(tt(t),$o),et(tt(tt(t)),1),this.rotateRight(tt(tt(t))))}else{var e=nt(tt(tt(t)));1==$(e)?(et(tt(t),$o),et(e,$o),et(tt(tt(t)),1),t=tt(tt(t))):(t==nt(tt(t))&&(t=tt(t),this.rotateRight(t)),et(tt(t),$o),et(tt(tt(t)),1),this.rotateLeft(tt(tt(t))))}this.root_.color=$o},rt.prototype.values=function(){var t=new w,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=rt.successor(e));)t.add(e.value);return t},rt.prototype.entrySet=function(){var t=new Q,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=rt.successor(e));)t.add(e);return t},rt.prototype.rotateLeft=function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null==t.parent?this.root_=e:t.parent.left==t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},rt.prototype.rotateRight=function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null==t.parent?this.root_=e:t.parent.right==t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},rt.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},rt.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var e=t.parent,n=t;null!==e&&n===e.right;)n=e,e=e.parent;return e},rt.prototype.size=function(){return this.size_},e(ot.prototype,{interfaces_:function(){return[]},getClass:function(){return ot}}),st.prototype=new K,at.prototype=new st,at.prototype.contains=function(t){for(var e=0,n=this.array_.length;e<n;e++){if(0===this.array_[e].compareTo(t))return!0}return!1},at.prototype.add=function(t){if(this.contains(t))return!1;for(var e=0,n=this.array_.length;e<n;e++){if(1===this.array_[e].compareTo(t))return this.array_.splice(e,0,t),!0}return this.array_.push(t),!0},at.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},at.prototype.remove=function(t){throw new E},at.prototype.size=function(){return this.array_.length},at.prototype.isEmpty=function(){return 0===this.array_.length},at.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},at.prototype.iterator=function(){return new ts(this)};var ts=function(t){this.treeSet_=t,this.position_=0};ts.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new x;return this.treeSet_.array_[this.position_++]},ts.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},ts.prototype.remove=function(){throw new E},ut.sort=function(){var t,e,n,i,r=arguments[0];if(1===arguments.length)return i=function(t,e){return t.compareTo(e)},void r.sort(i);if(2===arguments.length)n=arguments[1],i=function(t,e){return n.compare(t,e)},r.sort(i);else{if(3===arguments.length){e=r.slice(arguments[1],arguments[2]),e.sort();var o=r.slice(0,arguments[1]).concat(e,r.slice(arguments[2],r.length));for(r.splice(0,r.length),t=0;t<o.length;t++)r.push(o[t]);return}if(4===arguments.length){for(e=r.slice(arguments[1],arguments[2]),n=arguments[3],i=function(t,e){return n.compare(t,e)},e.sort(i),o=r.slice(0,arguments[1]).concat(e,r.slice(arguments[2],r.length)),r.splice(0,r.length),t=0;t<o.length;t++)r.push(o[t]);return}}},ut.asList=function(t){for(var e=new w,n=0,i=t.length;n<i;n++)e.add(t[n]);return e},e(lt.prototype,{interfaces_:function(){return[]},getClass:function(){return lt}}),lt.toDimensionSymbol=function(t){switch(t){case lt.FALSE:return lt.SYM_FALSE;case lt.TRUE:return lt.SYM_TRUE;case lt.DONTCARE:return lt.SYM_DONTCARE;case lt.P:return lt.SYM_P;case lt.L:return lt.SYM_L;case lt.A:return lt.SYM_A}throw new i("Unknown dimension value: "+t)},lt.toDimensionValue=function(t){switch(T.toUpperCase(t)){case lt.SYM_FALSE:return lt.FALSE;case lt.SYM_TRUE:return lt.TRUE;case lt.SYM_DONTCARE:return lt.DONTCARE;case lt.SYM_P:return lt.P;case lt.SYM_L:return lt.L;case lt.SYM_A:return lt.A}throw new i("Unknown dimension symbol: "+t)},lt.P=0,lt.L=1,lt.A=2,lt.FALSE=-1,lt.TRUE=-2,lt.DONTCARE=-3,lt.SYM_FALSE="F",lt.SYM_TRUE="T",lt.SYM_DONTCARE="*",lt.SYM_P="0",lt.SYM_L="1",lt.SYM_A="2",e(ct.prototype,{filter:function(t){},interfaces_:function(){return[]},getClass:function(){return ct}}),e(ht.prototype,{filter:function(t,e){},isDone:function(){},isGeometryChanged:function(){},interfaces_:function(){return[]},getClass:function(){return ht}}),c(ft,G),e(ft.prototype,{computeEnvelopeInternal:function(){for(var t=new I,e=0;e<this.geometries.length;e++)t.expandToInclude(this.geometries[e].getEnvelopeInternal());return t},getGeometryN:function(t){return this.geometries[t]},getSortIndex:function(){return G.SORTINDEX_GEOMETRYCOLLECTION},getCoordinates:function(){for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=0;n<this.geometries.length;n++)for(var i=this.geometries[n].getCoordinates(),r=0;r<i.length;r++)e++,t[e]=i[r];return t},getArea:function(){for(var t=0,e=0;e<this.geometries.length;e++)t+=this.geometries[e].getArea();return t},equalsExact:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(!this.isEquivalentClass(t))return!1;var n=t;if(this.geometries.length!==n.geometries.length)return!1;for(var i=0;i<this.geometries.length;i++)if(!this.geometries[i].equalsExact(n.geometries[i],e))return!1;return!0}return G.prototype.equalsExact.apply(this,arguments)},normalize:function(){for(var t=0;t<this.geometries.length;t++)this.geometries[t].normalize();ut.sort(this.geometries)},getCoordinate:function(){return this.isEmpty()?null:this.geometries[0].getCoordinate()},getBoundaryDimension:function(){for(var t=lt.FALSE,e=0;e<this.geometries.length;e++)t=Math.max(t,this.geometries[e].getBoundaryDimension());return t},getDimension:function(){
for(var t=lt.FALSE,e=0;e<this.geometries.length;e++)t=Math.max(t,this.geometries[e].getDimension());return t},getLength:function(){for(var t=0,e=0;e<this.geometries.length;e++)t+=this.geometries[e].getLength();return t},getNumPoints:function(){for(var t=0,e=0;e<this.geometries.length;e++)t+=this.geometries[e].getNumPoints();return t},getNumGeometries:function(){return this.geometries.length},reverse:function(){for(var t=this.geometries.length,e=new Array(t).fill(null),n=0;n<this.geometries.length;n++)e[n]=this.geometries[n].reverse();return this.getFactory().createGeometryCollection(e)},compareToSameClass:function(){if(1===arguments.length){var t=arguments[0],e=new at(ut.asList(this.geometries)),n=new at(ut.asList(t.geometries));return this.compare(e,n)}if(2===arguments.length){for(var i=arguments[0],r=arguments[1],o=i,s=this.getNumGeometries(),a=o.getNumGeometries(),u=0;u<s&&u<a;){var l=this.getGeometryN(u),c=o.getGeometryN(u),h=l.compareToSameClass(c,r);if(0!==h)return h;u++}return u<s?1:u<a?-1:0}},apply:function(){if(M(arguments[0],j))for(var t=arguments[0],e=0;e<this.geometries.length;e++)this.geometries[e].apply(t);else if(M(arguments[0],ht)){var n=arguments[0];if(0===this.geometries.length)return null;for(var e=0;e<this.geometries.length&&(this.geometries[e].apply(n),!n.isDone());e++);n.isGeometryChanged()&&this.geometryChanged()}else if(M(arguments[0],ct)){var i=arguments[0];i.filter(this);for(var e=0;e<this.geometries.length;e++)this.geometries[e].apply(i)}else if(M(arguments[0],k)){var r=arguments[0];r.filter(this);for(var e=0;e<this.geometries.length;e++)this.geometries[e].apply(r)}},getBoundary:function(){return this.checkNotGeometryCollection(this),f.shouldNeverReachHere(),null},clone:function(){var t=G.prototype.clone.call(this);t.geometries=new Array(this.geometries.length).fill(null);for(var e=0;e<this.geometries.length;e++)t.geometries[e]=this.geometries[e].clone();return t},getGeometryType:function(){return"GeometryCollection"},copy:function(){for(var t=new Array(this.geometries.length).fill(null),e=0;e<t.length;e++)t[e]=this.geometries[e].copy();return new ft(t,this.factory)},isEmpty:function(){for(var t=0;t<this.geometries.length;t++)if(!this.geometries[t].isEmpty())return!1;return!0},interfaces_:function(){return[]},getClass:function(){return ft}}),ft.serialVersionUID=-0x4f07bcb1f857d800,c(pt,ft),e(pt.prototype,{getSortIndex:function(){return G.SORTINDEX_MULTILINESTRING},equalsExact:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return!!this.isEquivalentClass(t)&&ft.prototype.equalsExact.call(this,t,e)}return ft.prototype.equalsExact.apply(this,arguments)},getBoundaryDimension:function(){return this.isClosed()?lt.FALSE:0},isClosed:function(){if(this.isEmpty())return!1;for(var t=0;t<this.geometries.length;t++)if(!this.geometries[t].isClosed())return!1;return!0},getDimension:function(){return 1},reverse:function(){for(var t=this.geometries.length,e=new Array(t).fill(null),n=0;n<this.geometries.length;n++)e[t-1-n]=this.geometries[n].reverse();return this.getFactory().createMultiLineString(e)},getBoundary:function(){return new dt(this).getBoundary()},getGeometryType:function(){return"MultiLineString"},copy:function(){for(var t=new Array(this.geometries.length).fill(null),e=0;e<t.length;e++)t[e]=this.geometries[e].copy();return new pt(t,this.factory)},interfaces_:function(){return[ot]},getClass:function(){return pt}}),pt.serialVersionUID=0x7155d2ab4afa8000,e(dt.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.createMultiPointFromCoords(e)},getBoundary:function(){return this.geom instanceof Nt?this.boundaryLineString(this.geom):this.geom instanceof pt?this.boundaryMultiLineString(this.geom):this.geom.getBoundary()},boundaryLineString:function(t){if(this.geom.isEmpty())return this.getEmptyMultiPoint();if(t.isClosed()){return this.bnRule.isInBoundary(2)?t.getStartPoint():this.geomFact.createMultiPoint()}return this.geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},getEmptyMultiPoint:function(){return this.geomFact.createMultiPoint()},computeBoundaryCoordinates:function(t){var e=new w;this.endpointMap=new rt;for(var n=0;n<t.getNumGeometries();n++){var i=t.getGeometryN(n);0!==i.getNumPoints()&&(this.addEndpoint(i.getCoordinateN(0)),this.addEndpoint(i.getCoordinateN(i.getNumPoints()-1)))}for(var r=this.endpointMap.entrySet().iterator();r.hasNext();){var o=r.next(),s=o.getValue(),a=s.count;this.bnRule.isInBoundary(a)&&e.add(o.getKey())}return U.toCoordinateArray(e)},addEndpoint:function(t){var e=this.endpointMap.get(t);null===e&&(e=new gt,this.endpointMap.put(t,e)),e.count++},interfaces_:function(){return[]},getClass:function(){return dt}}),dt.getBoundary=function(){if(1===arguments.length){var t=arguments[0],e=new dt(t);return e.getBoundary()}if(2===arguments.length){var n=arguments[0],i=arguments[1],e=new dt(n,i);return e.getBoundary()}},e(gt.prototype,{interfaces_:function(){return[]},getClass:function(){return gt}}),e(bt.prototype,{interfaces_:function(){return[]},getClass:function(){return bt}}),bt.chars=function(t,e){for(var n=new Array(e).fill(null),i=0;i<e;i++)n[i]=t;return new String(n)},bt.getStackTrace=function(){if(1===arguments.length){var t=arguments[0],e=new xt,n=new vt(e);return t.printStackTrace(n),e.toString()}if(2===arguments.length){for(var i=arguments[0],r=arguments[1],o="",s=new yt(bt.getStackTrace(i)),a=new wt(s),u=0;u<r;u++)try{o+=a.readLine()+bt.NEWLINE}catch(t){if(!(t instanceof Et))throw t;f.shouldNeverReachHere()}return o}},bt.split=function(t,e){for(var n=e.length,i=new w,r=""+t,o=r.indexOf(e);o>=0;){var s=r.substring(0,o);i.add(s),r=r.substring(o+n),o=r.indexOf(e)}r.length>0&&i.add(r);for(var a=new Array(i.size()).fill(null),u=0;u<a.length;u++)a[u]=i.get(u);return a},bt.toString=function(){if(1===arguments.length){var t=arguments[0];return bt.SIMPLE_ORDINATE_FORMAT.format(t)}},bt.spaces=function(t){return bt.chars(" ",t)},bt.NEWLINE=D.getProperty("line.separator"),bt.SIMPLE_ORDINATE_FORMAT=new mt("0.#"),e(It.prototype,{interfaces_:function(){return[]},getClass:function(){return It}}),It.copyCoord=function(t,e,n,i){for(var r=Math.min(t.getDimension(),n.getDimension()),o=0;o<r;o++)n.setOrdinate(i,o,t.getOrdinate(e,o))},It.isRing=function(t){var e=t.size();return 0===e||!(e<=3)&&t.getOrdinate(0,A.X)===t.getOrdinate(e-1,A.X)&&t.getOrdinate(0,A.Y)===t.getOrdinate(e-1,A.Y)},It.isEqual=function(t,e){var n=t.size();if(n!==e.size())return!1;for(var i=Math.min(t.getDimension(),e.getDimension()),o=0;o<n;o++)for(var s=0;s<i;s++){var a=t.getOrdinate(o,s),u=e.getOrdinate(o,s);if(!(t.getOrdinate(o,s)===e.getOrdinate(o,s)||r.isNaN(a)&&r.isNaN(u)))return!1}return!0},It.extend=function(t,e,n){var i=t.create(n,e.getDimension()),r=e.size();if(It.copy(e,0,i,0,r),r>0)for(var o=r;o<n;o++)It.copy(e,r-1,i,o,1);return i},It.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),i=0;i<=n;i++)It.swap(t,i,e-i)},It.swap=function(t,e,n){if(e===n)return null;for(var i=0;i<t.getDimension();i++){var r=t.getOrdinate(e,i);t.setOrdinate(e,i,t.getOrdinate(n,i)),t.setOrdinate(n,i,r)}},It.copy=function(t,e,n,i,r){for(var o=0;o<r;o++)It.copyCoord(t,e+o,n,i+o)},It.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),i=new R;i.append("(");for(var r=0;r<e;r++){r>0&&i.append(" ");for(var o=0;o<n;o++)o>0&&i.append(","),i.append(bt.toString(t.getOrdinate(r,o)))}return i.append(")"),i.toString()}},It.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?It.createClosedRing(t,e,4):e.getOrdinate(0,A.X)===e.getOrdinate(n-1,A.X)&&e.getOrdinate(0,A.Y)===e.getOrdinate(n-1,A.Y)?e:It.createClosedRing(t,e,n+1)},It.createClosedRing=function(t,e,n){var i=t.create(n,e.getDimension()),r=e.size();It.copy(e,0,i,0,r);for(var o=r;o<n;o++)It.copy(e,0,i,o,1);return i},c(Nt,G),e(Nt.prototype,{computeEnvelopeInternal:function(){return this.isEmpty()?new I:this.points.expandEnvelope(new I)},isRing:function(){return this.isClosed()&&this.isSimple()},getSortIndex:function(){return G.SORTINDEX_LINESTRING},getCoordinates:function(){return this.points.toCoordinateArray()},equalsExact:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(!this.isEquivalentClass(t))return!1;var n=t;if(this.points.size()!==n.points.size())return!1;for(var i=0;i<this.points.size();i++)if(!this.equal(this.points.getCoordinate(i),n.points.getCoordinate(i),e))return!1;return!0}return G.prototype.equalsExact.apply(this,arguments)},normalize:function(){for(var t=0;t<Math.trunc(this.points.size()/2);t++){var e=this.points.size()-1-t;if(!this.points.getCoordinate(t).equals(this.points.getCoordinate(e)))return this.points.getCoordinate(t).compareTo(this.points.getCoordinate(e))>0&&It.reverse(this.points),null}},getCoordinate:function(){return this.isEmpty()?null:this.points.getCoordinate(0)},getBoundaryDimension:function(){return this.isClosed()?lt.FALSE:0},isClosed:function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},getEndPoint:function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},getDimension:function(){return 1},getLength:function(){return le.computeLength(this.points)},getNumPoints:function(){return this.points.size()},reverse:function(){var t=this.points.copy();return It.reverse(t),this.getFactory().createLineString(t)},compareToSameClass:function(){if(1===arguments.length){for(var t=arguments[0],e=t,n=0,i=0;n<this.points.size()&&i<e.points.size();){var r=this.points.getCoordinate(n).compareTo(e.points.getCoordinate(i));if(0!==r)return r;n++,i++}return n<this.points.size()?1:i<e.points.size()?-1:0}if(2===arguments.length){var o=arguments[0],s=arguments[1],e=o;return s.compare(this.points,e.points)}},apply:function(){if(M(arguments[0],j))for(var t=arguments[0],e=0;e<this.points.size();e++)t.filter(this.points.getCoordinate(e));else if(M(arguments[0],ht)){var n=arguments[0];if(0===this.points.size())return null;for(var e=0;e<this.points.size()&&(n.filter(this.points,e),!n.isDone());e++);n.isGeometryChanged()&&this.geometryChanged()}else if(M(arguments[0],ct)){var i=arguments[0];i.filter(this)}else if(M(arguments[0],k)){var r=arguments[0];r.filter(this)}},getBoundary:function(){return new dt(this).getBoundary()},isEquivalentClass:function(t){return t instanceof Nt},clone:function(){var t=G.prototype.clone.call(this);return t.points=this.points.clone(),t},getCoordinateN:function(t){return this.points.getCoordinate(t)},getGeometryType:function(){return"LineString"},copy:function(){return new Nt(this.points.copy(),this.factory)},getCoordinateSequence:function(){return this.points},isEmpty:function(){return 0===this.points.size()},init:function(t){if(null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),1===t.size())throw new i("Invalid number of points in LineString (found "+t.size()+" - must be 0 or >= 2)");this.points=t},isCoordinate:function(t){for(var e=0;e<this.points.size();e++)if(this.points.getCoordinate(e).equals(t))return!0;return!1},getStartPoint:function(){return this.isEmpty()?null:this.getPointN(0)},getPointN:function(t){return this.getFactory().createPoint(this.points.getCoordinate(t))},interfaces_:function(){return[ot]},getClass:function(){return Nt}}),Nt.serialVersionUID=0x2b2b51ba435c8e00,e(Ct.prototype,{interfaces_:function(){return[]},getClass:function(){return Ct}}),c(St,G),e(St.prototype,{computeEnvelopeInternal:function(){if(this.isEmpty())return new I;var t=new I;return t.expandToInclude(this.coordinates.getX(0),this.coordinates.getY(0)),t},getSortIndex:function(){return G.SORTINDEX_POINT},getCoordinates:function(){return this.isEmpty()?[]:[this.getCoordinate()]},equalsExact:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return!!this.isEquivalentClass(t)&&(!(!this.isEmpty()||!t.isEmpty())||this.isEmpty()===t.isEmpty()&&this.equal(t.getCoordinate(),this.getCoordinate(),e))}return G.prototype.equalsExact.apply(this,arguments)},normalize:function(){},getCoordinate:function(){return 0!==this.coordinates.size()?this.coordinates.getCoordinate(0):null},getBoundaryDimension:function(){return lt.FALSE},getDimension:function(){return 0},getNumPoints:function(){return this.isEmpty()?0:1},reverse:function(){return this.copy()},getX:function(){if(null===this.getCoordinate())throw new IllegalStateException("getX called on empty Point");return this.getCoordinate().x},compareToSameClass:function(){if(1===arguments.length){var t=arguments[0],e=t;return this.getCoordinate().compareTo(e.getCoordinate())}if(2===arguments.length){var n=arguments[0],i=arguments[1],e=n;return i.compare(this.coordinates,e.coordinates)}},apply:function(){if(M(arguments[0],j)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(M(arguments[0],ht)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this.coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else if(M(arguments[0],ct)){var n=arguments[0];n.filter(this)}else if(M(arguments[0],k)){var i=arguments[0];i.filter(this)}},getBoundary:function(){return this.getFactory().createGeometryCollection(null)},clone:function(){var t=G.prototype.clone.call(this);return t.coordinates=this.coordinates.clone(),t},getGeometryType:function(){return"Point"},copy:function(){return new St(this.coordinates.copy(),this.factory)},getCoordinateSequence:function(){return this.coordinates},getY:function(){if(null===this.getCoordinate())throw new IllegalStateException("getY called on empty Point");return this.getCoordinate().y},isEmpty:function(){return 0===this.coordinates.size()},init:function(t){null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),f.isTrue(t.size()<=1),this.coordinates=t},isSimple:function(){return!0},interfaces_:function(){return[Ct]},getClass:function(){return St}}),St.serialVersionUID=0x44077bad161cbc00,e(Mt.prototype,{interfaces_:function(){return[]},getClass:function(){return Mt}}),c(Lt,G),e(Lt.prototype,{computeEnvelopeInternal:function(){return this.shell.getEnvelopeInternal()},getSortIndex:function(){return G.SORTINDEX_POLYGON},getCoordinates:function(){if(this.isEmpty())return[];for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=this.shell.getCoordinates(),i=0;i<n.length;i++)e++,t[e]=n[i];for(var r=0;r<this.holes.length;r++)for(var o=this.holes[r].getCoordinates(),s=0;s<o.length;s++)e++,t[e]=o[s];return t},getArea:function(){var t=0;t+=Math.abs(le.signedArea(this.shell.getCoordinateSequence()));for(var e=0;e<this.holes.length;e++)t-=Math.abs(le.signedArea(this.holes[e].getCoordinateSequence()));return t},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(),n=0;n<5;n++){var i=t.getX(n);if(i!==e.getMinX()&&i!==e.getMaxX())return!1;var r=t.getY(n);if(r!==e.getMinY()&&r!==e.getMaxY())return!1}for(var o=t.getX(0),s=t.getY(0),n=1;n<=4;n++){var i=t.getX(n),r=t.getY(n);if(i!==o===(r!==s))return!1;o=i,s=r}return!0},equalsExact:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(!this.isEquivalentClass(t))return!1;var n=t,i=this.shell,r=n.shell;if(!i.equalsExact(r,e))return!1;if(this.holes.length!==n.holes.length)return!1;for(var o=0;o<this.holes.length;o++)if(!this.holes[o].equalsExact(n.holes[o],e))return!1;return!0}return G.prototype.equalsExact.apply(this,arguments)},normalize:function(){if(0===arguments.length){this.normalize(this.shell,!0);for(var t=0;t<this.holes.length;t++)this.normalize(this.holes[t],!1);ut.sort(this.holes)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(e.isEmpty())return null;var i=new Array(e.getCoordinates().length-1).fill(null);D.arraycopy(e.getCoordinates(),0,i,0,i.length);var r=U.minCoordinate(e.getCoordinates());U.scroll(i,r),D.arraycopy(i,0,e.getCoordinates(),0,i.length),e.getCoordinates()[i.length]=i[0],le.isCCW(e.getCoordinates())===n&&U.reverse(e.getCoordinates())}},getCoordinate:function(){return this.shell.getCoordinate()},getNumInteriorRing:function(){return this.holes.length},getBoundaryDimension:function(){return 1},getDimension:function(){return 2},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},getNumPoints:function(){for(var t=this.shell.getNumPoints(),e=0;e<this.holes.length;e++)t+=this.holes[e].getNumPoints();return t},reverse:function(){var t=this.copy();t.shell=this.shell.copy().reverse(),t.holes=new Array(this.holes.length).fill(null);for(var e=0;e<this.holes.length;e++)t.holes[e]=this.holes[e].copy().reverse();return t},convexHull:function(){return this.getExteriorRing().convexHull()},compareToSameClass:function(){if(1===arguments.length){var t=arguments[0],e=this.shell,n=t.shell;return e.compareToSameClass(n)}if(2===arguments.length){var i=arguments[0],r=arguments[1],o=i,e=this.shell,n=o.shell,s=e.compareToSameClass(n,r);if(0!==s)return s;for(var a=this.getNumInteriorRing(),u=o.getNumInteriorRing(),l=0;l<a&&l<u;){var c=this.getInteriorRingN(l),h=o.getInteriorRingN(l),f=c.compareToSameClass(h,r);if(0!==f)return f;l++}return l<a?1:l<u?-1:0}},apply:function(){if(M(arguments[0],j)){var t=arguments[0];this.shell.apply(t);for(var e=0;e<this.holes.length;e++)this.holes[e].apply(t)}else if(M(arguments[0],ht)){var n=arguments[0];if(this.shell.apply(n),!n.isDone())for(var e=0;e<this.holes.length&&(this.holes[e].apply(n),!n.isDone());e++);n.isGeometryChanged()&&this.geometryChanged()}else if(M(arguments[0],ct)){var i=arguments[0];i.filter(this)}else if(M(arguments[0],k)){var r=arguments[0];r.filter(this),this.shell.apply(r);for(var e=0;e<this.holes.length;e++)this.holes[e].apply(r)}},getBoundary:function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var t=new Array(this.holes.length+1).fill(null);t[0]=this.shell;for(var e=0;e<this.holes.length;e++)t[e+1]=this.holes[e];return t.length<=1?this.getFactory().createLinearRing(t[0].getCoordinateSequence()):this.getFactory().createMultiLineString(t)},clone:function(){var t=G.prototype.clone.call(this);t.shell=this.shell.clone(),t.holes=new Array(this.holes.length).fill(null);for(var e=0;e<this.holes.length;e++)t.holes[e]=this.holes[e].clone();return t},getGeometryType:function(){return"Polygon"},copy:function(){for(var t=this.shell.copy(),e=new Array(this.holes.length).fill(null),n=0;n<e.length;n++)e[n]=this.holes[n].copy();return new Lt(t,e,this.factory)},getExteriorRing:function(){return this.shell},isEmpty:function(){return this.shell.isEmpty()},getInteriorRingN:function(t){return this.holes[t]},interfaces_:function(){return[Mt]},getClass:function(){return Lt}}),Lt.serialVersionUID=-0x307ffefd8dc97200,c(Rt,ft),e(Rt.prototype,{getSortIndex:function(){return G.SORTINDEX_MULTIPOINT},isValid:function(){return!0},equalsExact:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return!!this.isEquivalentClass(t)&&ft.prototype.equalsExact.call(this,t,e)}return ft.prototype.equalsExact.apply(this,arguments)},getCoordinate:function(){if(1===arguments.length){var t=arguments[0];return this.geometries[t].getCoordinate()}return ft.prototype.getCoordinate.apply(this,arguments)},getBoundaryDimension:function(){return lt.FALSE},getDimension:function(){return 0},getBoundary:function(){return this.getFactory().createGeometryCollection(null)},getGeometryType:function(){return"MultiPoint"},copy:function(){for(var t=new Array(this.geometries.length).fill(null),e=0;e<t.length;e++)t[e]=this.geometries[e].copy();return new Rt(t,this.factory)},interfaces_:function(){return[Ct]},getClass:function(){return Rt}}),Rt.serialVersionUID=-0x6fb1ed4162e0fc00,c(Pt,Nt),e(Pt.prototype,{getSortIndex:function(){return G.SORTINDEX_LINEARRING},getBoundaryDimension:function(){return lt.FALSE},isClosed:function(){return!!this.isEmpty()||Nt.prototype.isClosed.call(this)},reverse:function(){var t=this.points.copy();return It.reverse(t),this.getFactory().createLinearRing(t)},validateConstruction:function(){if(!this.isEmpty()&&!Nt.prototype.isClosed.call(this))throw new i("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<Pt.MINIMUM_VALID_SIZE)throw new i("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},getGeometryType:function(){return"LinearRing"},copy:function(){return new Pt(this.points.copy(),this.factory)},interfaces_:function(){return[]},getClass:function(){return Pt}}),Pt.MINIMUM_VALID_SIZE=4,Pt.serialVersionUID=-0x3b229e262367a600,c(Tt,ft),e(Tt.prototype,{getSortIndex:function(){return G.SORTINDEX_MULTIPOLYGON},equalsExact:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return!!this.isEquivalentClass(t)&&ft.prototype.equalsExact.call(this,t,e)}return ft.prototype.equalsExact.apply(this,arguments)},getBoundaryDimension:function(){return 1},getDimension:function(){return 2},reverse:function(){for(var t=this.geometries.length,e=new Array(t).fill(null),n=0;n<this.geometries.length;n++)e[n]=this.geometries[n].reverse();return this.getFactory().createMultiPolygon(e)},getBoundary:function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var t=new w,e=0;e<this.geometries.length;e++)for(var n=this.geometries[e],i=n.getBoundary(),r=0;r<i.getNumGeometries();r++)t.add(i.getGeometryN(r));var o=new Array(t.size()).fill(null);return this.getFactory().createMultiLineString(t.toArray(o))},getGeometryType:function(){return"MultiPolygon"},copy:function(){for(var t=new Array(this.geometries.length).fill(null),e=0;e<t.length;e++)t[e]=this.geometries[e].copy();return new Tt(t,this.factory)},interfaces_:function(){return[Mt]},getClass:function(){return Tt}}),Tt.serialVersionUID=-0x7a5aa1369171980,e(Ot.prototype,{setCopyUserData:function(t){this.isUserDataCopied=t},edit:function(t,e){if(null===t)return null;var n=this.editInternal(t,e);return this.isUserDataCopied&&n.setUserData(t.getUserData()),n},editInternal:function(t,e){return null===this.factory&&(this.factory=t.getFactory()),t instanceof ft?this.editGeometryCollection(t,e):t instanceof Lt?this.editPolygon(t,e):t instanceof St?e.edit(t,this.factory):t instanceof Nt?e.edit(t,this.factory):(f.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},editGeometryCollection:function(t,e){for(var n=e.edit(t,this.factory),i=new w,r=0;r<n.getNumGeometries();r++){var o=this.edit(n.getGeometryN(r),e);null===o||o.isEmpty()||i.add(o)}return n.getClass()===Rt?this.factory.createMultiPoint(i.toArray([])):n.getClass()===pt?this.factory.createMultiLineString(i.toArray([])):n.getClass()===Tt?this.factory.createMultiPolygon(i.toArray([])):this.factory.createGeometryCollection(i.toArray([]))},editPolygon:function(t,e){var n=e.edit(t,this.factory);if(null===n&&(n=this.factory.createPolygon(null)),n.isEmpty())return n;var i=this.edit(n.getExteriorRing(),e);if(null===i||i.isEmpty())return this.factory.createPolygon();for(var r=new w,o=0;o<n.getNumInteriorRing();o++){var s=this.edit(n.getInteriorRingN(o),e);null===s||s.isEmpty()||r.add(s)}return this.factory.createPolygon(i,r.toArray([]))},interfaces_:function(){return[]},getClass:function(){return Ot}}),Ot.GeometryEditorOperation=_t,e(At.prototype,{edit:function(t,e){return t},interfaces_:function(){return[_t]},getClass:function(){return At}}),e(Dt.prototype,{edit:function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return null===n?t:t instanceof Pt?e.createLinearRing(n):t instanceof Nt?e.createLineString(n):t instanceof St?n.length>0?e.createPoint(n[0]):e.createPoint():t},interfaces_:function(){return[_t]},getClass:function(){return Dt}}),e(Ft.prototype,{edit:function(t,e){return t instanceof Pt?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Nt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof St?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},interfaces_:function(){return[_t]},getClass:function(){return Ft}}),Ot.NoOpGeometryOperation=At,Ot.CoordinateOperation=Dt,Ot.CoordinateSequenceOperation=Ft,e(qt.prototype,{setOrdinate:function(t,e,n){switch(e){case A.X:this.coordinates[t].x=n;break;case A.Y:this.coordinates[t].y=n;break;case A.Z:this.coordinates[t].z=n;break;default:throw new i("invalid ordinateIndex")}},size:function(){return this.coordinates.length},getOrdinate:function(t,e){switch(e){case A.X:return this.coordinates[t].x;case A.Y:return this.coordinates[t].y;case A.Z:return this.coordinates[t].z}return r.NaN},getCoordinate:function(){if(1===arguments.length){var t=arguments[0];return this.coordinates[t]}if(2===arguments.length){var e=arguments[0],n=arguments[1];n.x=this.coordinates[e].x,n.y=this.coordinates[e].y,n.z=this.coordinates[e].z}},getCoordinateCopy:function(t){return new p(this.coordinates[t])},getDimension:function(){return this.dimension},getX:function(t){return this.coordinates[t].x},clone:function(){for(var t=new Array(this.size()).fill(null),e=0;e<this.coordinates.length;e++)t[e]=this.coordinates[e].clone();return new qt(t,this.dimension)},expandEnvelope:function(t){for(var e=0;e<this.coordinates.length;e++)t.expandToInclude(this.coordinates[e]);return t},copy:function(){for(var t=new Array(this.size()).fill(null),e=0;e<this.coordinates.length;e++)t[e]=this.coordinates[e].copy();return new qt(t,this.dimension)},toString:function(){if(this.coordinates.length>0){var t=new R(17*this.coordinates.length);t.append("("),t.append(this.coordinates[0]);for(var e=1;e<this.coordinates.length;e++)t.append(", "),t.append(this.coordinates[e]);return t.append(")"),t.toString()}return"()"},getY:function(t){return this.coordinates[t].y},toCoordinateArray:function(){return this.coordinates},interfaces_:function(){return[A,u]},getClass:function(){return qt}}),qt.serialVersionUID=-0xcb44a778db18e00,e(kt.prototype,{readResolve:function(){return kt.instance()},create:function(){if(1===arguments.length){if(arguments[0]instanceof Array){return new qt(arguments[0])}if(M(arguments[0],A)){return new qt(arguments[0])}}else if(2===arguments.length){var t=arguments[0],e=arguments[1];return e>3&&(e=3),e<2?new qt(t):new qt(t,e)}},interfaces_:function(){return[q,u]},getClass:function(){return kt}}),kt.instance=function(){return kt.instanceObject},kt.serialVersionUID=-0x38e49fa6cf6f2e00,kt.instanceObject=new kt;var es,ns=Object.defineProperty,is=function(t,e){function n(t){return this&&this.constructor===n?(this._keys=[],this._values=[],this._itp=[],this.objectOnly=e,void(t&&jt.call(this,t))):new n(t)}return e||ns(t,"size",{get:Kt}),t.constructor=n,n.prototype=t,n}({delete:Bt,has:Xt,get:zt,set:Yt,keys:Wt,values:Ht,entries:Jt,forEach:Qt,clear:Ut}),rs="undefined"!=typeof Map&&Map.prototype.values?Map:is;$t.prototype=new J,$t.prototype.get=function(t){return this.map_.get(t)||null},$t.prototype.put=function(t,e){return this.map_.set(t,e),e},$t.prototype.values=function(){for(var t=new w,e=this.map_.values(),n=e.next();!n.done;)t.add(n.value),n=e.next();return t},$t.prototype.entrySet=function(){var t=new Q;return this.map_.entries().forEach(function(e){return t.add(e)}),t},$t.prototype.size=function(){return this.map_.size()},e(te.prototype,{equals:function(t){if(!(t instanceof te))return!1;var e=t;return this.modelType===e.modelType&&this.scale===e.scale},compareTo:function(t){var e=t,n=this.getMaximumSignificantDigits(),i=e.getMaximumSignificantDigits();return new P(n).compareTo(new P(i))},getScale:function(){return this.scale},isFloating:function(){return this.modelType===te.FLOATING||this.modelType===te.FLOATING_SINGLE},getType:function(){return this.modelType},toString:function(){var t="UNKNOWN";return this.modelType===te.FLOATING?t="Floating":this.modelType===te.FLOATING_SINGLE?t="Floating-Single":this.modelType===te.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},makePrecise:function(){if("number"==typeof arguments[0]){var t=arguments[0];if(r.isNaN(t))return t;if(this.modelType===te.FLOATING_SINGLE){return t}return this.modelType===te.FIXED?Math.round(t*this.scale)/this.scale:t}if(arguments[0]instanceof p){var e=arguments[0];if(this.modelType===te.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},getMaximumSignificantDigits:function(){var t=16;return this.modelType===te.FLOATING?t=16:this.modelType===te.FLOATING_SINGLE?t=6:this.modelType===te.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},setScale:function(t){this.scale=Math.abs(t)},interfaces_:function(){return[u,o]},getClass:function(){return te}}),te.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},e(ee.prototype,{readResolve:function(){return ee.nameToTypeMap.get(this.name)},toString:function(){return this.name},interfaces_:function(){return[u]},getClass:function(){return ee}}),ee.serialVersionUID=-552860263173159e4,ee.nameToTypeMap=new $t,te.Type=ee,te.serialVersionUID=0x6bee6404e9a25c00,te.FIXED=new ee("FIXED"),te.FLOATING=new ee("FLOATING"),te.FLOATING_SINGLE=new ee("FLOATING SINGLE"),te.maximumPreciseValue=9007199254740992,e(ne.prototype,{toGeometry:function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new p(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new p(t.getMinX(),t.getMinY()),new p(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new p(t.getMinX(),t.getMinY()),new p(t.getMinX(),t.getMaxY()),new p(t.getMaxX(),t.getMaxY()),new p(t.getMaxX(),t.getMinY()),new p(t.getMinX(),t.getMinY())]),null)},createLineString:function(){if(0===arguments.length)return this.createLineString(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLineString(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(M(arguments[0],A)){return new Nt(arguments[0],this)}}},createMultiLineString:function(){if(0===arguments.length)return new pt(null,this);if(1===arguments.length){return new pt(arguments[0],this)}},buildGeometry:function(t){for(var e=null,n=!1,i=!1,r=t.iterator();r.hasNext();){var o=r.next(),s=o.getClass();null===e&&(e=s),s!==e&&(n=!0),o.isGeometryCollectionOrDerived()&&(i=!0)}if(null===e)return this.createGeometryCollection();if(n||i)return this.createGeometryCollection(ne.toGeometryArray(t));var a=t.iterator().next();if(t.size()>1){if(a instanceof Lt)return this.createMultiPolygon(ne.toPolygonArray(t));if(a instanceof Nt)return this.createMultiLineString(ne.toLineStringArray(t));if(a instanceof St)return this.createMultiPoint(ne.toPointArray(t));f.shouldNeverReachHere("Unhandled class: "+a.getClass().getName())}return a},createMultiPointFromCoords:function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},createPoint:function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof p){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(M(arguments[0],A)){return new St(arguments[0],this)}}},getCoordinateSequenceFactory:function(){return this.coordinateSequenceFactory},createPolygon:function(){if(0===arguments.length)return new Lt(null,null,this);if(1===arguments.length){if(M(arguments[0],A)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof Pt){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];return new Lt(i,r,this)}},getSRID:function(){return this.SRID},
createGeometryCollection:function(){if(0===arguments.length)return new ft(null,this);if(1===arguments.length){return new ft(arguments[0],this)}},createGeometry:function(t){return new Ot(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return arguments[1],this.coordinateSequenceFactory.create(t)}}})},getPrecisionModel:function(){return this.precisionModel},createLinearRing:function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(M(arguments[0],A)){return new Pt(arguments[0],this)}}},createMultiPolygon:function(){if(0===arguments.length)return new Tt(null,this);if(1===arguments.length){return new Tt(arguments[0],this)}},createMultiPoint:function(){if(0===arguments.length)return new Rt(null,this);if(1===arguments.length){if(arguments[0]instanceof Array){return new Rt(arguments[0],this)}if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(M(arguments[0],A)){var e=arguments[0];if(null===e)return this.createMultiPoint(new Array(0).fill(null));for(var n=new Array(e.size()).fill(null),i=0;i<e.size();i++){var r=this.getCoordinateSequenceFactory().create(1,e.getDimension());It.copy(e,i,r,0,1),n[i]=this.createPoint(r)}return this.createMultiPoint(n)}}},interfaces_:function(){return[u]},getClass:function(){return ne}}),ne.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ne.toGeometryArray=function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},ne.getDefaultCoordinateSequenceFactory=function(){return kt.instance()},ne.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ne.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ne.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ne.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ne.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ne.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ne.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},ne.serialVersionUID=-0x5ea75f2051eeb400;var os={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*$/};e(ie.prototype,{read:function(t){var e,n,i;t=t.replace(/[\n\r]/g," ");var r=os.typeStr.exec(t);if(-1!==t.search("EMPTY")&&(r=os.emptyTypeStr.exec(t),r[2]=void 0),r&&(n=r[1].toLowerCase(),i=r[2],as[n]&&(e=as[n].apply(this,[i]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},write:function(t){return this.extractGeometry(t)},extractGeometry:function(t){var e=t.getGeometryType().toLowerCase();if(!ss[e])return null;var n=e.toUpperCase();return t.isEmpty()?n+" EMPTY":n+"("+ss[e].apply(this,[t])+")"}});var ss={coordinate:function(t){return t.x+" "+t.y},point:function(t){return ss.coordinate.call(this,t.coordinates.coordinates[0])},multipoint:function(t){for(var e=[],n=0,i=t.geometries.length;n<i;++n)e.push("("+ss.point.apply(this,[t.geometries[n]])+")");return e.join(",")},linestring:function(t){for(var e=[],n=0,i=t.points.coordinates.length;n<i;++n)e.push(ss.coordinate.apply(this,[t.points.coordinates[n]]));return e.join(",")},linearring:function(t){for(var e=[],n=0,i=t.points.coordinates.length;n<i;++n)e.push(ss.coordinate.apply(this,[t.points.coordinates[n]]));return e.join(",")},multilinestring:function(t){for(var e=[],n=0,i=t.geometries.length;n<i;++n)e.push("("+ss.linestring.apply(this,[t.geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+ss.linestring.apply(this,[t.shell])+")");for(var n=0,i=t.holes.length;n<i;++n)e.push("("+ss.linestring.apply(this,[t.holes[n]])+")");return e.join(",")},multipolygon:function(t){for(var e=[],n=0,i=t.geometries.length;n<i;++n)e.push("("+ss.polygon.apply(this,[t.geometries[n]])+")");return e.join(",")},geometrycollection:function(t){for(var e=[],n=0,i=t.geometries.length;n<i;++n)e.push(this.extractGeometry(t.geometries[n]));return e.join(",")}},as={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(os.spaces);return this.geometryFactory.createPoint(new p(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){if(void 0===t)return this.geometryFactory.createMultiPoint();for(var e,n=t.trim().split(","),i=[],r=0,o=n.length;r<o;++r)e=n[r].replace(os.trimParens,"$1"),i.push(as.point.apply(this,[e]));return this.geometryFactory.createMultiPoint(i)},linestring:function(t){if(void 0===t)return this.geometryFactory.createLineString();for(var e,n=t.trim().split(","),i=[],r=0,o=n.length;r<o;++r)e=n[r].trim().split(os.spaces),i.push(new p(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLineString(i)},linearring:function(t){if(void 0===t)return this.geometryFactory.createLinearRing();for(var e,n=t.trim().split(","),i=[],r=0,o=n.length;r<o;++r)e=n[r].trim().split(os.spaces),i.push(new p(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLinearRing(i)},multilinestring:function(t){if(void 0===t)return this.geometryFactory.createMultiLineString();for(var e,n=t.trim().split(os.parenComma),i=[],r=0,o=n.length;r<o;++r)e=n[r].replace(os.trimParens,"$1"),i.push(as.linestring.apply(this,[e]));return this.geometryFactory.createMultiLineString(i)},polygon:function(t){if(void 0===t)return this.geometryFactory.createPolygon();for(var e,n,i,r,o=t.trim().split(os.parenComma),s=[],a=0,u=o.length;a<u;++a)e=o[a].replace(os.trimParens,"$1"),n=as.linestring.apply(this,[e]),i=this.geometryFactory.createLinearRing(n.points),0===a?r=i:s.push(i);return this.geometryFactory.createPolygon(r,s)},multipolygon:function(t){if(void 0===t)return this.geometryFactory.createMultiPolygon();for(var e,n=t.trim().split(os.doubleParenComma),i=[],r=0,o=n.length;r<o;++r)e=n[r].replace(os.trimParens,"$1"),i.push(as.polygon.apply(this,[e]));return this.geometryFactory.createMultiPolygon(i)},geometrycollection:function(t){if(void 0===t)return this.geometryFactory.createGeometryCollection();t=t.replace(/,\s*([A-Za-z])/g,"|$1");for(var e=t.trim().split("|"),n=[],i=0,r=e.length;i<r;++i)n.push(this.read(e[i]));return this.geometryFactory.createGeometryCollection(n)}};e(re.prototype,{write:function(t){return this.parser.write(t)}}),e(re,{toLineString:function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"}}),e(oe.prototype,{getIndexAlongSegment:function(t,e){return this.computeIntLineIndex(),this.intLineIndex[t][e]},getTopologySummary:function(){var t=new R;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},computeIntersection:function(t,e,n,i){this.inputLines[0][0]=t,this.inputLines[0][1]=e,this.inputLines[1][0]=n,this.inputLines[1][1]=i,this.result=this.computeIntersect(t,e,n,i)},getIntersectionNum:function(){return this.result},computeIntLineIndex:function(){if(0===arguments.length)null===this.intLineIndex&&(this.intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(1===arguments.length){var t=arguments[0],e=this.getEdgeDistance(t,0),n=this.getEdgeDistance(t,1);e>n?(this.intLineIndex[t][0]=0,this.intLineIndex[t][1]=1):(this.intLineIndex[t][0]=1,this.intLineIndex[t][1]=0)}},isProper:function(){return this.hasIntersection()&&this._isProper},setPrecisionModel:function(t){this.precisionModel=t},isInteriorIntersection:function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],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}},getIntersection:function(t){return this.intPt[t]},isEndPoint:function(){return this.hasIntersection()&&!this._isProper},hasIntersection:function(){return this.result!==oe.NO_INTERSECTION},getEdgeDistance:function(t,e){return oe.computeEdgeDistance(this.intPt[e],this.inputLines[t][0],this.inputLines[t][1])},isCollinear:function(){return this.result===oe.COLLINEAR_INTERSECTION},toString:function(){return re.toLineString(this.inputLines[0][0],this.inputLines[0][1])+" - "+re.toLineString(this.inputLines[1][0],this.inputLines[1][1])+this.getTopologySummary()},getEndpoint:function(t,e){return this.inputLines[t][e]},isIntersection:function(t){for(var e=0;e<this.result;e++)if(this.intPt[e].equals2D(t))return!0;return!1},getIntersectionAlongSegment:function(t,e){return this.computeIntLineIndex(),this.intPt[this.intLineIndex[t][e]]},interfaces_:function(){return[]},getClass:function(){return oe}}),oe.computeEdgeDistance=function(t,e,n){var i=Math.abs(n.x-e.x),r=Math.abs(n.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(n))o=i>r?i:r;else{var s=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y);0!==(o=i>r?s:a)||t.equals(e)||(o=Math.max(s,a))}return f.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},oe.nonRobustComputeEdgeDistance=function(t,e,n){var i=t.x-e.x,r=t.y-e.y,o=Math.sqrt(i*i+r*r);return f.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},oe.DONT_INTERSECT=0,oe.DO_INTERSECT=1,oe.COLLINEAR=2,oe.NO_INTERSECTION=0,oe.POINT_INTERSECTION=1,oe.COLLINEAR_INTERSECTION=2,c(se,oe),e(se.prototype,{isInSegmentEnvelopes:function(t){var e=new I(this.inputLines[0][0],this.inputLines[0][1]),n=new I(this.inputLines[1][0],this.inputLines[1][1]);return e.contains(t)&&n.contains(t)},computeIntersection:function(){if(3!==arguments.length)return oe.prototype.computeIntersection.apply(this,arguments);var t=arguments[0],e=arguments[1],n=arguments[2];return this._isProper=!1,I.intersects(e,n,t)&&0===le.orientationIndex(e,n,t)&&0===le.orientationIndex(n,e,t)?(this._isProper=!0,(t.equals(e)||t.equals(n))&&(this._isProper=!1),this.result=oe.POINT_INTERSECTION,null):void(this.result=oe.NO_INTERSECTION)},normalizeToMinimum:function(t,e,n,i,r){r.x=this.smallestInAbsValue(t.x,e.x,n.x,i.x),r.y=this.smallestInAbsValue(t.y,e.y,n.y,i.y),t.x-=r.x,t.y-=r.y,e.x-=r.x,e.y-=r.y,n.x-=r.x,n.y-=r.y,i.x-=r.x,i.y-=r.y},safeHCoordinateIntersection:function(t,e,n,i){var r=null;try{r=F.intersection(t,e,n,i)}catch(o){if(!(o instanceof C))throw o;r=se.nearestEndpoint(t,e,n,i)}return r},intersection:function(t,e,n,i){var r=this.intersectionWithNormalization(t,e,n,i);return this.isInSegmentEnvelopes(r)||(r=new p(se.nearestEndpoint(t,e,n,i))),null!==this.precisionModel&&this.precisionModel.makePrecise(r),r},smallestInAbsValue:function(t,e,n,i){var r=t,o=Math.abs(r);return Math.abs(e)<o&&(r=e,o=Math.abs(e)),Math.abs(n)<o&&(r=n,o=Math.abs(n)),Math.abs(i)<o&&(r=i),r},checkDD:function(t,e,n,i,r){var o=_.intersection(t,e,n,i),s=this.isInSegmentEnvelopes(o);D.out.println("DD in env = "+s+" --------------------- "+o),r.distance(o)>1e-4&&D.out.println("Distance = "+r.distance(o))},intersectionWithNormalization:function(t,e,n,i){var r=new p(t),o=new p(e),s=new p(n),a=new p(i),u=new p;this.normalizeToEnvCentre(r,o,s,a,u);var l=this.safeHCoordinateIntersection(r,o,s,a);return l.x+=u.x,l.y+=u.y,l},computeCollinearIntersection:function(t,e,n,i){var r=I.intersects(t,e,n),o=I.intersects(t,e,i),s=I.intersects(n,i,t),a=I.intersects(n,i,e);return r&&o?(this.intPt[0]=n,this.intPt[1]=i,oe.COLLINEAR_INTERSECTION):s&&a?(this.intPt[0]=t,this.intPt[1]=e,oe.COLLINEAR_INTERSECTION):r&&s?(this.intPt[0]=n,this.intPt[1]=t,!n.equals(t)||o||a?oe.COLLINEAR_INTERSECTION:oe.POINT_INTERSECTION):r&&a?(this.intPt[0]=n,this.intPt[1]=e,!n.equals(e)||o||s?oe.COLLINEAR_INTERSECTION:oe.POINT_INTERSECTION):o&&s?(this.intPt[0]=i,this.intPt[1]=t,!i.equals(t)||r||a?oe.COLLINEAR_INTERSECTION:oe.POINT_INTERSECTION):o&&a?(this.intPt[0]=i,this.intPt[1]=e,!i.equals(e)||r||s?oe.COLLINEAR_INTERSECTION:oe.POINT_INTERSECTION):oe.NO_INTERSECTION},normalizeToEnvCentre:function(t,e,n,i,r){var o=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,l=n.x<i.x?n.x:i.x,c=n.y<i.y?n.y:i.y,h=n.x>i.x?n.x:i.x,f=n.y>i.y?n.y:i.y,p=o>l?o:l,d=a<h?a:h,g=s>c?s:c,v=u<f?u:f,y=(p+d)/2,m=(g+v)/2;r.x=y,r.y=m,t.x-=r.x,t.y-=r.y,e.x-=r.x,e.y-=r.y,n.x-=r.x,n.y-=r.y,i.x-=r.x,i.y-=r.y},computeIntersect:function(t,e,n,i){if(this._isProper=!1,!I.intersects(t,e,n,i))return oe.NO_INTERSECTION;var r=le.orientationIndex(t,e,n),o=le.orientationIndex(t,e,i);if(r>0&&o>0||r<0&&o<0)return oe.NO_INTERSECTION;var s=le.orientationIndex(n,i,t),a=le.orientationIndex(n,i,e);return s>0&&a>0||s<0&&a<0?oe.NO_INTERSECTION:0===r&&0===o&&0===s&&0===a?this.computeCollinearIntersection(t,e,n,i):(0===r||0===o||0===s||0===a?(this._isProper=!1,t.equals2D(n)||t.equals2D(i)?this.intPt[0]=t:e.equals2D(n)||e.equals2D(i)?this.intPt[0]=e:0===r?this.intPt[0]=new p(n):0===o?this.intPt[0]=new p(i):0===s?this.intPt[0]=new p(t):0===a&&(this.intPt[0]=new p(e))):(this._isProper=!0,this.intPt[0]=this.intersection(t,e,n,i)),oe.POINT_INTERSECTION)},interfaces_:function(){return[]},getClass:function(){return se}}),se.nearestEndpoint=function(t,e,n,i){var r=t,o=le.distancePointLine(t,n,i),s=le.distancePointLine(e,n,i);return s<o&&(o=s,r=e),s=le.distancePointLine(n,t,e),s<o&&(o=s,r=n),s=le.distancePointLine(i,t,e),s<o&&(o=s,r=i),r},e(ae.prototype,{interfaces_:function(){return[]},getClass:function(){return ae}}),ae.orientationIndex=function(t,e,n){var i=e.x-t.x,r=e.y-t.y,o=n.x-e.x,s=n.y-e.y;return ae.signOfDet2x2(i,r,o,s)},ae.signOfDet2x2=function(t,e,n,i){var r=null,o=null,s=null,a=0;if(r=1,0===t||0===i)return 0===e||0===n?0:e>0?n>0?-r:r:n>0?r:-r;if(0===e||0===n)return i>0?t>0?r:-r:t>0?-r:r;if(0<e?0<i?e<=i||(r=-r,o=t,t=n,n=o,o=e,e=i,i=o):e<=-i?(r=-r,n=-n,i=-i):(o=t,t=-n,n=o,o=e,e=-i,i=o):0<i?-e<=i?(r=-r,t=-t,e=-e):(o=-t,t=n,n=o,o=-e,e=i,i=o):e>=i?(t=-t,e=-e,n=-n,i=-i):(r=-r,o=-t,t=-n,n=o,o=-e,e=-i,i=o),0<t){if(!(0<n))return r;if(!(t<=n))return r}else{if(0<n)return-r;if(!(t>=n))return-r;r=-r,t=-t,n=-n}for(;;){if(a+=1,s=Math.floor(n/t),n-=s*t,(i-=s*e)<0)return-r;if(i>e)return r;if(t>n+n){if(e<i+i)return r}else{if(e>i+i)return-r;n=t-n,i=e-i,r=-r}if(0===i)return 0===n?0:-r;if(0===n)return r;if(s=Math.floor(t/n),t-=s*n,(e-=s*i)<0)return r;if(e>i)return-r;if(n>t+t){if(i<e+e)return-r}else{if(i>e+e)return r;t=n-t,e=i-e,r=-r}if(0===e)return 0===t?0:r;if(0===t)return-r}},e(ue.prototype,{countSegment:function(t,e){if(t.x<this.p.x&&e.x<this.p.x)return null;if(this.p.x===e.x&&this.p.y===e.y)return this.isPointOnSegment=!0,null;if(t.y===this.p.y&&e.y===this.p.y){var n=t.x,i=e.x;return n>i&&(n=e.x,i=t.x),this.p.x>=n&&this.p.x<=i&&(this.isPointOnSegment=!0),null}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,o=t.y-this.p.y,s=e.x-this.p.x,a=e.y-this.p.y,u=ae.signOfDet2x2(r,o,s,a);if(0===u)return this.isPointOnSegment=!0,null;a<o&&(u=-u),u>0&&this.crossingCount++}},isPointInPolygon:function(){return this.getLocation()!==S.EXTERIOR},getLocation:function(){return this.isPointOnSegment?S.BOUNDARY:this.crossingCount%2==1?S.INTERIOR:S.EXTERIOR},isOnSegment:function(){return this.isPointOnSegment},interfaces_:function(){return[]},getClass:function(){return ue}}),ue.locatePointInRing=function(){if(arguments[0]instanceof p&&M(arguments[1],A)){for(var t=arguments[0],e=arguments[1],n=new ue(t),i=new p,r=new p,o=1;o<e.size();o++)if(e.getCoordinate(o,i),e.getCoordinate(o-1,r),n.countSegment(i,r),n.isOnSegment())return n.getLocation();return n.getLocation()}if(arguments[0]instanceof p&&arguments[1]instanceof Array){for(var s=arguments[0],a=arguments[1],n=new ue(s),o=1;o<a.length;o++){var i=a[o],r=a[o-1];if(n.countSegment(i,r),n.isOnSegment())return n.getLocation()}return n.getLocation()}},e(le.prototype,{interfaces_:function(){return[]},getClass:function(){return le}}),le.orientationIndex=function(t,e,n){return _.orientationIndex(t,e,n)},le.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,n=t[0].x,i=1;i<t.length-1;i++){var r=t[i].x-n,o=t[i+1].y;e+=r*(t[i-1].y-o)}return e/2}if(M(arguments[0],A)){var s=arguments[0],a=s.size();if(a<3)return 0;var u=new p,l=new p,c=new p;s.getCoordinate(0,l),s.getCoordinate(1,c);var n=l.x;c.x-=n;for(var e=0,i=1;i<a-1;i++)u.y=l.y,l.x=c.x,l.y=c.y,s.getCoordinate(i+1,c),c.x-=n,e+=l.x*(u.y-c.y);return e/2}},le.distanceLineLine=function(t,e,n,i){if(t.equals(e))return le.distancePointLine(t,n,i);if(n.equals(i))return le.distancePointLine(i,t,e);var r=!1;if(I.intersects(t,e,n,i)){var o=(e.x-t.x)*(i.y-n.y)-(e.y-t.y)*(i.x-n.x);if(0===o)r=!0;else{var s=(t.y-n.y)*(i.x-n.x)-(t.x-n.x)*(i.y-n.y),a=(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y),u=a/o,l=s/o;(l<0||l>1||u<0||u>1)&&(r=!0)}}else r=!0;return r?L.min(le.distancePointLine(t,n,i),le.distancePointLine(e,n,i),le.distancePointLine(n,t,e),le.distancePointLine(i,t,e)):0},le.isPointInRing=function(t,e){return le.locatePointInRing(t,e)!==S.EXTERIOR},le.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,i=new p;t.getCoordinate(0,i);for(var r=i.x,o=i.y,s=1;s<e;s++){t.getCoordinate(s,i);var a=i.x,u=i.y,l=a-r,c=u-o;n+=Math.sqrt(l*l+c*c),r=a,o=u}return n},le.isCCW=function(t){var e=t.length-1;if(e<3)throw new i("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],r=0,o=1;o<=e;o++){var s=t[o];s.y>n.y&&(n=s,r=o)}var a=r;do{(a-=1)<0&&(a=e)}while(t[a].equals2D(n)&&a!==r);var u=r;do{u=(u+1)%e}while(t[u].equals2D(n)&&u!==r);var l=t[a],c=t[u];if(l.equals2D(n)||c.equals2D(n)||l.equals2D(c))return!1;var h=le.computeOrientation(l,n,c);return 0===h?l.x>c.x:h>0},le.locatePointInRing=function(t,e){return ue.locatePointInRing(t,e)},le.distancePointLinePerpendicular=function(t,e,n){var i=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),r=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/i;return Math.abs(r)*Math.sqrt(i)},le.computeOrientation=function(t,e,n){return le.orientationIndex(t,e,n)},le.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new i("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r<e.length-1;r++){var o=le.distancePointLine(t,e[r],e[r+1]);o<n&&(n=o)}return n}if(3===arguments.length){var s=arguments[0],a=arguments[1],u=arguments[2];if(a.x===u.x&&a.y===u.y)return s.distance(a);var l=(u.x-a.x)*(u.x-a.x)+(u.y-a.y)*(u.y-a.y),c=((s.x-a.x)*(u.x-a.x)+(s.y-a.y)*(u.y-a.y))/l;if(c<=0)return s.distance(a);if(c>=1)return s.distance(u);var h=((a.y-s.y)*(u.x-a.x)-(a.x-s.x)*(u.y-a.y))/l;return Math.abs(h)*Math.sqrt(l)}},le.isOnLine=function(t,e){for(var n=new se,i=1;i<e.length;i++){var r=e[i-1],o=e[i];if(n.computeIntersection(t,r,o),n.hasIntersection())return!0}return!1},le.CLOCKWISE=-1,le.RIGHT=le.CLOCKWISE,le.COUNTERCLOCKWISE=1,le.LEFT=le.COUNTERCLOCKWISE,le.COLLINEAR=0,le.STRAIGHT=le.COLLINEAR,e(ce.prototype,{minX:function(){return Math.min(this.p0.x,this.p1.x)},orientationIndex:function(){if(arguments[0]instanceof ce){var t=arguments[0],e=le.orientationIndex(this.p0,this.p1,t.p0),n=le.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0?Math.max(e,n):e<=0&&n<=0?Math.max(e,n):0}if(arguments[0]instanceof p){var i=arguments[0];return le.orientationIndex(this.p0,this.p1,i)}},toGeometry:function(t){return t.createLineString([this.p0,this.p1])},isVertical:function(){return this.p0.x===this.p1.x},equals:function(t){if(!(t instanceof ce))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},intersection:function(t){var e=new se;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},project:function(){if(arguments[0]instanceof p){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new p(t);var e=this.projectionFactor(t),n=new p;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}if(arguments[0]instanceof ce){var i=arguments[0],r=this.projectionFactor(i.p0),o=this.projectionFactor(i.p1);if(r>=1&&o>=1)return null;if(r<=0&&o<=0)return null;var s=this.project(i.p0);r<0&&(s=this.p0),r>1&&(s=this.p1);var a=this.project(i.p1);return o<0&&(a=this.p0),o>1&&(a=this.p1),new ce(s,a)}},normalize:function(){this.p1.compareTo(this.p0)<0&&this.reverse()},angle:function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},getCoordinate:function(t){return 0===t?this.p0:this.p1},distancePerpendicular:function(t){return le.distancePointLinePerpendicular(t,this.p0,this.p1)},minY:function(){return Math.min(this.p0.y,this.p1.y)},midPoint:function(){return ce.midPoint(this.p0,this.p1)},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,n=this.p1.y-this.p0.y,i=e*e+n*n;return i<=0?r.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/i},closestPoints:function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),i=r.MAX_VALUE,o=null,s=this.closestPoint(t.p0);i=s.distance(t.p0),n[0]=s,n[1]=t.p0;var a=this.closestPoint(t.p1);(o=a.distance(t.p1))<i&&(i=o,n[0]=a,n[1]=t.p1);var u=t.closestPoint(this.p0);(o=u.distance(this.p0))<i&&(i=o,n[0]=this.p0,n[1]=u);var l=t.closestPoint(this.p1);return o=l.distance(this.p1),o<i&&(i=o,n[0]=this.p1,n[1]=l),n},closestPoint:function(t){var e=this.projectionFactor(t);return e>0&&e<1?this.project(t):this.p0.distance(t)<this.p1.distance(t)?this.p0:this.p1},maxX:function(){return Math.max(this.p0.x,this.p1.x)},getLength:function(){return this.p0.distance(this.p1)},compareTo:function(t){var e=t,n=this.p0.compareTo(e.p0);return 0!==n?n:this.p1.compareTo(e.p1)},reverse:function(){var t=this.p0;this.p0=this.p1,this.p1=t},equalsTopo:function(t){return this.p0.equals(t.p0)&&this.p1.equals(t.p1)||this.p0.equals(t.p1)&&this.p1.equals(t.p0)},lineIntersection:function(t){try{return F.intersection(this.p0,this.p1,t.p0,t.p1)}catch(t){if(!(t instanceof C))throw t}return null},maxY:function(){return Math.max(this.p0.y,this.p1.y)},pointAlongOffset:function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),i=this.p0.y+t*(this.p1.y-this.p0.y),r=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,s=Math.sqrt(r*r+o*o),a=0,u=0;if(0!==e){if(s<=0)throw new IllegalStateException("Cannot compute offset from zero-length line segment");a=e*r/s,u=e*o/s}return new p(n-u,i+a)},setCoordinates:function(){if(1===arguments.length){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=n.x,this.p1.y=n.y}},segmentFraction:function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||r.isNaN(e))&&(e=1),e},toString:function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},isHorizontal:function(){return this.p0.y===this.p1.y},distance:function(){if(arguments[0]instanceof ce){var t=arguments[0];return le.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof p){var e=arguments[0];return le.distancePointLine(e,this.p0,this.p1)}},pointAlong:function(t){var e=new p;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},hashCode:function(){var t=java.lang.Double.doubleToLongBits(this.p0.x);t^=31*java.lang.Double.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=java.lang.Double.doubleToLongBits(this.p1.x);return n^=31*java.lang.Double.doubleToLongBits(this.p1.y),e^Math.trunc(n)^Math.trunc(n>>32)},interfaces_:function(){return[o,u]},getClass:function(){return ce}}),ce.midPoint=function(t,e){return new p((t.x+e.x)/2,(t.y+e.y)/2)},ce.serialVersionUID=0x2d2172135f411c00,e(he.prototype,{isIntersects:function(){return!this.isDisjoint()},isCovers:function(){return(he.isTrue(this.matrix[S.INTERIOR][S.INTERIOR])||he.isTrue(this.matrix[S.INTERIOR][S.BOUNDARY])||he.isTrue(this.matrix[S.BOUNDARY][S.INTERIOR])||he.isTrue(this.matrix[S.BOUNDARY][S.BOUNDARY]))&&this.matrix[S.EXTERIOR][S.INTERIOR]===lt.FALSE&&this.matrix[S.EXTERIOR][S.BOUNDARY]===lt.FALSE},isCoveredBy:function(){return(he.isTrue(this.matrix[S.INTERIOR][S.INTERIOR])||he.isTrue(this.matrix[S.INTERIOR][S.BOUNDARY])||he.isTrue(this.matrix[S.BOUNDARY][S.INTERIOR])||he.isTrue(this.matrix[S.BOUNDARY][S.BOUNDARY]))&&this.matrix[S.INTERIOR][S.EXTERIOR]===lt.FALSE&&this.matrix[S.BOUNDARY][S.EXTERIOR]===lt.FALSE},set:function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<t.length;e++){var n=Math.trunc(e/3),i=e%3;this.matrix[n][i]=lt.toDimensionValue(t.charAt(e))}else if(3===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2];this.matrix[r][o]=s}},isContains:function(){return he.isTrue(this.matrix[S.INTERIOR][S.INTERIOR])&&this.matrix[S.EXTERIOR][S.INTERIOR]===lt.FALSE&&this.matrix[S.EXTERIOR][S.BOUNDARY]===lt.FALSE},setAtLeast:function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<t.length;e++){var n=Math.trunc(e/3),i=e%3;this.setAtLeast(n,i,lt.toDimensionValue(t.charAt(e)))}else if(3===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2];this.matrix[r][o]<s&&(this.matrix[r][o]=s)}},setAtLeastIfValid:function(t,e,n){t>=0&&e>=0&&this.setAtLeast(t,e,n)},isWithin:function(){return he.isTrue(this.matrix[S.INTERIOR][S.INTERIOR])&&this.matrix[S.INTERIOR][S.EXTERIOR]===lt.FALSE&&this.matrix[S.BOUNDARY][S.EXTERIOR]===lt.FALSE},isTouches:function(t,e){return t>e?this.isTouches(e,t):(t===lt.A&&e===lt.A||t===lt.L&&e===lt.L||t===lt.L&&e===lt.A||t===lt.P&&e===lt.A||t===lt.P&&e===lt.L)&&this.matrix[S.INTERIOR][S.INTERIOR]===lt.FALSE&&(he.isTrue(this.matrix[S.INTERIOR][S.BOUNDARY])||he.isTrue(this.matrix[S.BOUNDARY][S.INTERIOR])||he.isTrue(this.matrix[S.BOUNDARY][S.BOUNDARY]))},isOverlaps:function(t,e){return t===lt.P&&e===lt.P||t===lt.A&&e===lt.A?he.isTrue(this.matrix[S.INTERIOR][S.INTERIOR])&&he.isTrue(this.matrix[S.INTERIOR][S.EXTERIOR])&&he.isTrue(this.matrix[S.EXTERIOR][S.INTERIOR]):t===lt.L&&e===lt.L&&1===this.matrix[S.INTERIOR][S.INTERIOR]&&he.isTrue(this.matrix[S.INTERIOR][S.EXTERIOR])&&he.isTrue(this.matrix[S.EXTERIOR][S.INTERIOR])},isEquals:function(t,e){return t===e&&he.isTrue(this.matrix[S.INTERIOR][S.INTERIOR])&&this.matrix[S.INTERIOR][S.EXTERIOR]===lt.FALSE&&this.matrix[S.BOUNDARY][S.EXTERIOR]===lt.FALSE&&this.matrix[S.EXTERIOR][S.INTERIOR]===lt.FALSE&&this.matrix[S.EXTERIOR][S.BOUNDARY]===lt.FALSE},toString:function(){for(var t=new R("123456789"),e=0;e<3;e++)for(var n=0;n<3;n++)t.setCharAt(3*e+n,lt.toDimensionSymbol(this.matrix[e][n]));return t.toString()},setAll:function(t){for(var e=0;e<3;e++)for(var n=0;n<3;n++)this.matrix[e][n]=t},get:function(t,e){return this.matrix[t][e]},transpose:function(){var t=this.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},matches:function(t){if(9!==t.length)throw new i("Should be length 9: "+t);for(var e=0;e<3;e++)for(var n=0;n<3;n++)if(!he.matches(this.matrix[e][n],t.charAt(3*e+n)))return!1;return!0},add:function(t){for(var e=0;e<3;e++)for(var n=0;n<3;n++)this.setAtLeast(e,n,t.get(e,n))},isDisjoint:function(){return this.matrix[S.INTERIOR][S.INTERIOR]===lt.FALSE&&this.matrix[S.INTERIOR][S.BOUNDARY]===lt.FALSE&&this.matrix[S.BOUNDARY][S.INTERIOR]===lt.FALSE&&this.matrix[S.BOUNDARY][S.BOUNDARY]===lt.FALSE},isCrosses:function(t,e){return t===lt.P&&e===lt.L||t===lt.P&&e===lt.A||t===lt.L&&e===lt.A?he.isTrue(this.matrix[S.INTERIOR][S.INTERIOR])&&he.isTrue(this.matrix[S.INTERIOR][S.EXTERIOR]):t===lt.L&&e===lt.P||t===lt.A&&e===lt.P||t===lt.A&&e===lt.L?he.isTrue(this.matrix[S.INTERIOR][S.INTERIOR])&&he.isTrue(this.matrix[S.EXTERIOR][S.INTERIOR]):t===lt.L&&e===lt.L&&0===this.matrix[S.INTERIOR][S.INTERIOR]},interfaces_:function(){return[s]},getClass:function(){return he}}),he.matches=function(){if(Number.isInteger(arguments[0])&&"string"==typeof arguments[1]){var t=arguments[0],e=arguments[1];return e===lt.SYM_DONTCARE||e===lt.SYM_TRUE&&(t>=0||t===lt.TRUE)||e===lt.SYM_FALSE&&t===lt.FALSE||e===lt.SYM_P&&t===lt.P||e===lt.SYM_L&&t===lt.L||e===lt.SYM_A&&t===lt.A}if("string"==typeof arguments[0]&&"string"==typeof arguments[1]){var n=arguments[0],i=arguments[1];return new he(n).matches(i)}},he.isTrue=function(t){return t>=0||t===lt.TRUE};var us=Object.freeze({Coordinate:p,CoordinateList:b,Envelope:I,LineSegment:ce,GeometryFactory:ne,Geometry:G,Point:St,LineString:Nt,LinearRing:Pt,Polygon:Lt,GeometryCollection:ft,MultiPoint:Rt,MultiLineString:pt,MultiPolygon:Tt,Dimension:lt,IntersectionMatrix:he,PrecisionModel:te});e(fe.prototype,{addPoint:function(t){this.ptCount+=1,this.ptCentSum.x+=t.x,this.ptCentSum.y+=t.y},setBasePoint:function(t){null===this.areaBasePt&&(this.areaBasePt=t)},addLineSegments:function(t){for(var e=0,n=0;n<t.length-1;n++){var i=t[n].distance(t[n+1]);if(0!==i){e+=i;var r=(t[n].x+t[n+1].x)/2;this.lineCentSum.x+=i*r;var o=(t[n].y+t[n+1].y)/2;this.lineCentSum.y+=i*o}}this.totalLength+=e,0===e&&t.length>0&&this.addPoint(t[0])},addHole:function(t){for(var e=le.isCCW(t),n=0;n<t.length-1;n++)this.addTriangle(this.areaBasePt,t[n],t[n+1],e);this.addLineSegments(t)},getCentroid:function(){var t=new p;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},addShell:function(t){t.length>0&&this.setBasePoint(t[0]);for(var e=!le.isCCW(t),n=0;n<t.length-1;n++)this.addTriangle(this.areaBasePt,t[n],t[n+1],e);this.addLineSegments(t)},addTriangle:function(t,e,n,i){var r=i?1:-1;fe.centroid3(t,e,n,this.triangleCent3);var o=fe.area2(t,e,n);this.cg3.x+=r*o*this.triangleCent3.x,this.cg3.y+=r*o*this.triangleCent3.y,this.areasum2+=r*o},add:function(){if(arguments[0]instanceof Lt){var t=arguments[0];this.addShell(t.getExteriorRing().getCoordinates());for(var e=0;e<t.getNumInteriorRing();e++)this.addHole(t.getInteriorRingN(e).getCoordinates())}else if(arguments[0]instanceof G){var n=arguments[0];if(n.isEmpty())return null;if(n instanceof St)this.addPoint(n.getCoordinate());else if(n instanceof Nt)this.addLineSegments(n.getCoordinates());else if(n instanceof Lt){var i=n;this.add(i)}else if(n instanceof ft)for(var r=n,e=0;e<r.getNumGeometries();e++)this.add(r.getGeometryN(e))}},interfaces_:function(){return[]},getClass:function(){return fe}}),fe.area2=function(t,e,n){return(e.x-t.x)*(n.y-t.y)-(n.x-t.x)*(e.y-t.y)},fe.centroid3=function(t,e,n,i){return i.x=t.x+e.x+n.x,i.y=t.y+e.y+n.y,null},fe.getCentroid=function(t){return new fe(t).getCentroid()},pe.prototype=new Error,pe.prototype.name="EmptyStackException",de.prototype=new m,de.prototype.add=function(t){return this.array_.push(t),!0},de.prototype.get=function(t){if(t<0||t>=this.size())throw new IndexOutOfBoundsException;return this.array_[t]},de.prototype.push=function(t){return this.array_.push(t),t},de.prototype.pop=function(t){if(0===this.array_.length)throw new pe;return this.array_.pop()},de.prototype.peek=function(){if(0===this.array_.length)throw new pe;return this.array_[this.array_.length-1]},de.prototype.empty=function(){return 0===this.array_.length},de.prototype.isEmpty=function(){return this.empty()},de.prototype.search=function(t){return this.array_.indexOf(t)},de.prototype.size=function(){return this.array_.length},de.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e(ge.prototype,{filter:function(t){this.treeSet.contains(t)||(this.list.add(t),this.treeSet.add(t))},getCoordinates:function(){var t=new Array(this.list.size()).fill(null)
;return this.list.toArray(t)},interfaces_:function(){return[j]},getClass:function(){return ge}}),ge.filterCoordinates=function(t){for(var e=new ge,n=0;n<t.length;n++)e.filter(t[n]);return e.getCoordinates()},e(ve.prototype,{preSort:function(t){for(var e=null,n=1;n<t.length;n++)(t[n].y<t[0].y||t[n].y===t[0].y&&t[n].x<t[0].x)&&(e=t[0],t[0]=t[n],t[n]=e);return ut.sort(t,1,t.length,new ye(t[0])),t},computeOctRing:function(t){var e=this.computeOctPts(t),n=new b;return n.add(e,!1),n.size()<3?null:(n.closeRing(),n.toCoordinateArray())},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)},cleanRing:function(t){f.equals(t[0],t[t.length-1]);for(var e=new w,n=null,i=0;i<=t.length-2;i++){var r=t[i],o=t[i+1];r.equals(o)||null!==n&&this.isBetween(n,r,o)||(e.add(r),n=r)}e.add(t[t.length-1]);var s=new Array(e.size()).fill(null);return e.toArray(s)},isBetween:function(t,e,n){if(0!==le.computeOrientation(t,e,n))return!1;if(t.x!==n.x){if(t.x<=e.x&&e.x<=n.x)return!0;if(n.x<=e.x&&e.x<=t.x)return!0}if(t.y!==n.y){if(t.y<=e.y&&e.y<=n.y)return!0;if(n.y<=e.y&&e.y<=t.y)return!0}return!1},reduce:function(t){var e=this.computeOctRing(t);if(null===e)return t;for(var n=new at,i=0;i<e.length;i++)n.add(e[i]);for(var i=0;i<t.length;i++)le.isPointInRing(t[i],e)||n.add(t[i]);var r=U.toCoordinateArray(n);return r.length<3?this.padArray3(r):r},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),n=this.grahamScan(e),i=this.toCoordinateArray(n);return this.lineOrPolygon(i)},padArray3:function(t){for(var e=new Array(3).fill(null),n=0;n<e.length;n++)n<t.length?e[n]=t[n]:e[n]=t[0];return e},computeOctPts:function(t){for(var e=new Array(8).fill(null),n=0;n<e.length;n++)e[n]=t[0];for(var i=1;i<t.length;i++)t[i].x<e[0].x&&(e[0]=t[i]),t[i].x-t[i].y<e[1].x-e[1].y&&(e[1]=t[i]),t[i].y>e[2].y&&(e[2]=t[i]),t[i].x+t[i].y>e[3].x+e[3].y&&(e[3]=t[i]),t[i].x>e[4].x&&(e[4]=t[i]),t[i].x-t[i].y>e[5].x-e[5].y&&(e[5]=t[i]),t[i].y<e[6].y&&(e[6]=t[i]),t[i].x+t[i].y<e[7].x+e[7].y&&(e[7]=t[i]);return e},toCoordinateArray:function(t){for(var e=new Array(t.size()).fill(null),n=0;n<t.size();n++){var i=t.get(n);e[n]=i}return e},grahamScan:function(t){var e=null,n=new de;e=n.push(t[0]),e=n.push(t[1]),e=n.push(t[2]);for(var i=3;i<t.length;i++){for(e=n.pop();!n.empty()&&le.computeOrientation(n.peek(),e,t[i])>0;)e=n.pop();e=n.push(e),e=n.push(t[i])}return e=n.push(t[0]),n},interfaces_:function(){return[]},getClass:function(){return ve}}),ve.extractCoordinates=function(t){var e=new ge;return t.apply(e),e.getCoordinates()},e(ye.prototype,{compare:function(t,e){var n=t,i=e;return ye.polarCompare(this.origin,n,i)},interfaces_:function(){return[a]},getClass:function(){return ye}}),ye.polarCompare=function(t,e,n){var i=e.x-t.x,r=e.y-t.y,o=n.x-t.x,s=n.y-t.y,a=le.computeOrientation(t,e,n);if(a===le.COUNTERCLOCKWISE)return 1;if(a===le.CLOCKWISE)return-1;var u=i*i+r*r,l=o*o+s*s;return u<l?-1:u>l?1:0},ve.RadialComparator=ye,e(me.prototype,{transformPoint:function(t,e){return this.factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},transformPolygon:function(t,e){var n=!0,i=this.transformLinearRing(t.getExteriorRing(),t);null!==i&&i instanceof Pt&&!i.isEmpty()||(n=!1);for(var r=new w,o=0;o<t.getNumInteriorRing();o++){var s=this.transformLinearRing(t.getInteriorRingN(o),t);null===s||s.isEmpty()||(s instanceof Pt||(n=!1),r.add(s))}if(n)return this.factory.createPolygon(i,r.toArray([]));var a=new w;return null!==i&&a.add(i),a.addAll(r),this.factory.buildGeometry(a)},createCoordinateSequence:function(t){return this.factory.getCoordinateSequenceFactory().create(t)},getInputGeometry:function(){return this.inputGeom},transformMultiLineString:function(t,e){for(var n=new w,i=0;i<t.getNumGeometries();i++){var r=this.transformLineString(t.getGeometryN(i),t);null!==r&&(r.isEmpty()||n.add(r))}return this.factory.buildGeometry(n)},transformCoordinates:function(t,e){return this.copy(t)},transformLineString:function(t,e){return this.factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},transformMultiPoint:function(t,e){for(var n=new w,i=0;i<t.getNumGeometries();i++){var r=this.transformPoint(t.getGeometryN(i),t);null!==r&&(r.isEmpty()||n.add(r))}return this.factory.buildGeometry(n)},transformMultiPolygon:function(t,e){for(var n=new w,i=0;i<t.getNumGeometries();i++){var r=this.transformPolygon(t.getGeometryN(i),t);null!==r&&(r.isEmpty()||n.add(r))}return this.factory.buildGeometry(n)},copy:function(t){return t.copy()},transformGeometryCollection:function(t,e){for(var n=new w,i=0;i<t.getNumGeometries();i++){var r=this.transform(t.getGeometryN(i));null!==r&&(this.pruneEmptyGeometry&&r.isEmpty()||n.add(r))}return this.preserveGeometryCollectionType?this.factory.createGeometryCollection(ne.toGeometryArray(n)):this.factory.buildGeometry(n)},transform:function(t){if(this.inputGeom=t,this.factory=t.getFactory(),t instanceof St)return this.transformPoint(t,null);if(t instanceof Rt)return this.transformMultiPoint(t,null);if(t instanceof Pt)return this.transformLinearRing(t,null);if(t instanceof Nt)return this.transformLineString(t,null);if(t instanceof pt)return this.transformMultiLineString(t,null);if(t instanceof Lt)return this.transformPolygon(t,null);if(t instanceof Tt)return this.transformMultiPolygon(t,null);if(t instanceof ft)return this.transformGeometryCollection(t,null);throw new i("Unknown Geometry subtype: "+t.getClass().getName())},transformLinearRing:function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(null===n)return this.factory.createLinearRing(null);var i=n.size();return i>0&&i<4&&!this.preserveType?this.factory.createLineString(n):this.factory.createLinearRing(n)},interfaces_:function(){return[]},getClass:function(){return me}}),e(xe.prototype,{snapVertices:function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),i=0;i<n;i++){var r=t.get(i),o=this.findSnapForVertex(r,e);null!==o&&(t.set(i,new p(o)),0===i&&this._isClosed&&t.set(t.size()-1,new p(o)))}},findSnapForVertex:function(t,e){for(var n=0;n<e.length;n++){if(t.equals2D(e[n]))return null;if(t.distance(e[n])<this.snapTolerance)return e[n]}return null},snapTo:function(t){var e=new b(this.srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},snapSegments:function(t,e){if(0===e.length)return null;var n=e.length;e[0].equals2D(e[e.length-1])&&(n=e.length-1);for(var i=0;i<n;i++){var r=e[i],o=this.findSegmentIndexToSnap(r,t);o>=0&&t.add(o+1,new p(r),!1)}},findSegmentIndexToSnap:function(t,e){for(var n=r.MAX_VALUE,i=-1,o=0;o<e.size()-1;o++){if(this.seg.p0=e.get(o),this.seg.p1=e.get(o+1),this.seg.p0.equals2D(t)||this.seg.p1.equals2D(t)){if(this.allowSnappingToSourceVertices)continue;return-1}var s=this.seg.distance(t);s<this.snapTolerance&&s<n&&(n=s,i=o)}return i},setAllowSnappingToSourceVertices:function(t){this.allowSnappingToSourceVertices=t},interfaces_:function(){return[]},getClass:function(){return xe}}),xe.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])},e(Ee.prototype,{snapTo:function(t,e){return new we(e,this.extractTargetCoordinates(t)).transform(this.srcGeom)},snapToSelf:function(t,e){var n=this.extractTargetCoordinates(this.srcGeom),i=new we(t,n,!0),r=i.transform(this.srcGeom),o=r;return e&&M(o,Mt)&&(o=r.buffer(0)),o},computeSnapTolerance:function(t){return this.computeMinimumSegmentLength(t)/10},extractTargetCoordinates:function(t){for(var e=new at,n=t.getCoordinates(),i=0;i<n.length;i++)e.add(n[i]);return e.toArray(new Array(0).fill(null))},computeMinimumSegmentLength:function(t){for(var e=r.MAX_VALUE,n=0;n<t.length-1;n++){var i=t[n].distance(t[n+1]);i<e&&(e=i)}return e},interfaces_:function(){return[]},getClass:function(){return Ee}}),Ee.snap=function(t,e,n){var i=new Array(2).fill(null),r=new Ee(t);i[0]=r.snapTo(e,n);var o=new Ee(e);return i[1]=o.snapTo(i[0],n),i},Ee.computeOverlaySnapTolerance=function(){if(1===arguments.length){var t=arguments[0],e=Ee.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===te.FIXED){var i=1/n.getScale()*2/1.415;i>e&&(e=i)}return e}if(2===arguments.length){var r=arguments[0],o=arguments[1];return Math.min(Ee.computeOverlaySnapTolerance(r),Ee.computeOverlaySnapTolerance(o))}},Ee.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Ee.SNAP_PRECISION_FACTOR},Ee.snapToSelf=function(t,e,n){return new Ee(t).snapToSelf(e,n)},Ee.SNAP_PRECISION_FACTOR=1e-9,c(we,me),e(we.prototype,{snapLine:function(t,e){var n=new xe(t,this.snapTolerance);return n.setAllowSnappingToSourceVertices(this.isSelfSnap),n.snapTo(e)},transformCoordinates:function(t,e){var n=t.toCoordinateArray(),i=this.snapLine(n,this.snapPts);return this.factory.getCoordinateSequenceFactory().create(i)},interfaces_:function(){return[]},getClass:function(){return we}}),e(be.prototype,{getCommon:function(){return r.longBitsToDouble(this.commonBits)},add:function(t){var e=r.doubleToLongBits(t);return this.isFirst?(this.commonBits=e,this.commonSignExp=be.signExpBits(this.commonBits),this.isFirst=!1,null):be.signExpBits(e)!==this.commonSignExp?(this.commonBits=0,null):(this.commonMantissaBitsCount=be.numCommonMostSigMantissaBits(this.commonBits,e),void(this.commonBits=be.zeroLowerBits(this.commonBits,64-(12+this.commonMantissaBitsCount))))},toString:function(){if(1===arguments.length){var t=arguments[0],e=r.longBitsToDouble(t),n=Long.toBinaryString(t),i="0000000000000000000000000000000000000000000000000000000000000000"+n,o=i.substring(i.length-64);return o.substring(0,1)+" "+o.substring(1,12)+"(exp) "+o.substring(12)+" [ "+e+" ]"}},interfaces_:function(){return[]},getClass:function(){return be}}),be.getBit=function(t,e){return 0!=(t&1<<e)?1:0},be.signExpBits=function(t){return t>>52},be.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},be.numCommonMostSigMantissaBits=function(t,e){for(var n=0,i=52;i>=0;i--){if(be.getBit(t,i)!==be.getBit(e,i))return n;n++}return 52},e(Ie.prototype,{addCommonBits:function(t){var e=new Ce(this.commonCoord);t.apply(e),t.geometryChanged()},removeCommonBits:function(t){if(0===this.commonCoord.x&&0===this.commonCoord.y)return t;var e=new p(this.commonCoord);e.x=-e.x,e.y=-e.y;var n=new Ce(e);return t.apply(n),t.geometryChanged(),t},getCommonCoordinate:function(){return this.commonCoord},add:function(t){t.apply(this.ccFilter),this.commonCoord=this.ccFilter.getCommonCoordinate()},interfaces_:function(){return[]},getClass:function(){return Ie}}),e(Ne.prototype,{filter:function(t){this.commonBitsX.add(t.x),this.commonBitsY.add(t.y)},getCommonCoordinate:function(){return new p(this.commonBitsX.getCommon(),this.commonBitsY.getCommon())},interfaces_:function(){return[j]},getClass:function(){return Ne}}),e(Ce.prototype,{filter:function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,i=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,i)},isDone:function(){return!1},isGeometryChanged:function(){return!0},interfaces_:function(){return[ht]},getClass:function(){return Ce}}),Ie.CommonCoordinateFilter=Ne,Ie.Translater=Ce,e(Se.prototype,{next:function(){if(this.atStart)return this.atStart=!1,Se.isAtomic(this.parent)&&this.index++,this.parent;if(null!==this.subcollectionIterator){if(this.subcollectionIterator.hasNext())return this.subcollectionIterator.next();this.subcollectionIterator=null}if(this.index>=this.max)throw new x;var t=this.parent.getGeometryN(this.index++);return t instanceof ft?(this.subcollectionIterator=new Se(t),this.subcollectionIterator.next()):t},remove:function(){throw new UnsupportedOperationException(this.getClass().getName())},hasNext:function(){if(this.atStart)return!0;if(null!==this.subcollectionIterator){if(this.subcollectionIterator.hasNext())return!0;this.subcollectionIterator=null}return!(this.index>=this.max)},interfaces_:function(){return[g]},getClass:function(){return Se}}),Se.isAtomic=function(t){return!(t instanceof ft)},e(Me.prototype,{locateInternal:function(){if(arguments[0]instanceof p&&arguments[1]instanceof Lt){var t=arguments[0],e=arguments[1];if(e.isEmpty())return S.EXTERIOR;var n=e.getExteriorRing(),i=this.locateInPolygonRing(t,n);if(i===S.EXTERIOR)return S.EXTERIOR;if(i===S.BOUNDARY)return S.BOUNDARY;for(var r=0;r<e.getNumInteriorRing();r++){var o=e.getInteriorRingN(r),s=this.locateInPolygonRing(t,o);if(s===S.INTERIOR)return S.EXTERIOR;if(s===S.BOUNDARY)return S.BOUNDARY}return S.INTERIOR}if(arguments[0]instanceof p&&arguments[1]instanceof Nt){var a=arguments[0],u=arguments[1];if(!u.getEnvelopeInternal().intersects(a))return S.EXTERIOR;var l=u.getCoordinates();return u.isClosed()||!a.equals(l[0])&&!a.equals(l[l.length-1])?le.isOnLine(a,l)?S.INTERIOR:S.EXTERIOR:S.BOUNDARY}if(arguments[0]instanceof p&&arguments[1]instanceof St){var c=arguments[0];return arguments[1].getCoordinate().equals2D(c)?S.INTERIOR:S.EXTERIOR}},locateInPolygonRing:function(t,e){return e.getEnvelopeInternal().intersects(t)?le.locatePointInRing(t,e.getCoordinates()):S.EXTERIOR},intersects:function(t,e){return this.locate(t,e)!==S.EXTERIOR},updateLocationInfo:function(t){t===S.INTERIOR&&(this.isIn=!0),t===S.BOUNDARY&&this.numBoundaries++},computeLocation:function(t,e){if(e instanceof St&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Nt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Lt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof pt)for(var n=e,i=0;i<n.getNumGeometries();i++){var r=n.getGeometryN(i);this.updateLocationInfo(this.locateInternal(t,r))}else if(e instanceof Tt)for(var o=e,i=0;i<o.getNumGeometries();i++){var s=o.getGeometryN(i);this.updateLocationInfo(this.locateInternal(t,s))}else if(e instanceof ft)for(var a=new Se(e);a.hasNext();){var u=a.next();u!==e&&this.computeLocation(t,u)}},locate:function(t,e){return e.isEmpty()?S.EXTERIOR:e instanceof Nt?this.locateInternal(t,e):e instanceof Lt?this.locateInternal(t,e):(this.isIn=!1,this.numBoundaries=0,this.computeLocation(t,e),this.boundaryRule.isInBoundary(this.numBoundaries)?S.BOUNDARY:this.numBoundaries>0||this.isIn?S.INTERIOR:S.EXTERIOR)},interfaces_:function(){return[]},getClass:function(){return Me}}),e(Le.prototype,{interfaces_:function(){return[]},getClass:function(){return Le}}),Le.octant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new i("Cannot compute the octant for point ( "+t+", "+e+" )");var n=Math.abs(t),r=Math.abs(e);return t>=0?e>=0?n>=r?0:1:n>=r?7:6:e>=0?n>=r?3:2:n>=r?4:5}if(arguments[0]instanceof p&&arguments[1]instanceof p){var o=arguments[0],s=arguments[1],a=s.x-o.x,u=s.y-o.y;if(0===a&&0===u)throw new i("Cannot compute the octant for two identical points "+o);return Le.octant(a,u)}},e(Re.prototype,{getCoordinates:function(){},size:function(){},getCoordinate:function(t){},isClosed:function(){},setData:function(t){},getData:function(){},interfaces_:function(){return[]},getClass:function(){return Re}}),e(Pe.prototype,{getCoordinates:function(){return this.pts},size:function(){return this.pts.length},getCoordinate:function(t){return this.pts[t]},isClosed:function(){return this.pts[0].equals(this.pts[this.pts.length-1])},getSegmentOctant:function(t){return t===this.pts.length-1?-1:Le.octant(this.getCoordinate(t),this.getCoordinate(t+1))},setData:function(t){this.data=t},getData:function(){return this.data},toString:function(){return re.toLineString(new qt(this.pts))},interfaces_:function(){return[Re]},getClass:function(){return Pe}}),e(Te.prototype,{getBounds:function(){},interfaces_:function(){return[]},getClass:function(){return Te}}),e(Oe.prototype,{getItem:function(){return this.item},getBounds:function(){return this.bounds},interfaces_:function(){return[Te,u]},getClass:function(){return Oe}}),e(_e.prototype,{poll:function(){if(this.isEmpty())return null;var t=this.items.get(1);return this.items.set(1,this.items.get(this._size)),this._size-=1,this.reorder(1),t},size:function(){return this._size},reorder:function(t){for(var e=null,n=this.items.get(t);2*t<=this._size&&(e=2*t,e!==this._size&&this.items.get(e+1).compareTo(this.items.get(e))<0&&e++,this.items.get(e).compareTo(n)<0);t=e)this.items.set(t,this.items.get(e));this.items.set(t,n)},clear:function(){this._size=0,this.items.clear()},isEmpty:function(){return 0===this._size},add:function(t){this.items.add(null),this._size+=1;var e=this._size;for(this.items.set(0,t);t.compareTo(this.items.get(Math.trunc(e/2)))<0;e/=2)this.items.set(e,this.items.get(Math.trunc(e/2)));this.items.set(e,t)},interfaces_:function(){return[]},getClass:function(){return _e}}),e(Ae.prototype,{visitItem:function(t){},interfaces_:function(){return[]},getClass:function(){return Ae}}),e(De.prototype,{insert:function(t,e){},remove:function(t,e){},query:function(){1===arguments.length?arguments[0]:2===arguments.length&&(arguments[0],arguments[1])},interfaces_:function(){return[]},getClass:function(){return De}}),e(Fe.prototype,{getLevel:function(){return this.level},size:function(){return this.childBoundables.size()},getChildBoundables:function(){return this.childBoundables},addChildBoundable:function(t){f.isTrue(null===this.bounds),this.childBoundables.add(t)},isEmpty:function(){return this.childBoundables.isEmpty()},getBounds:function(){return null===this.bounds&&(this.bounds=this.computeBounds()),this.bounds},interfaces_:function(){return[Te,u]},getClass:function(){return Fe}}),Fe.serialVersionUID=0x5a1e55ec41369800;var ls={reverseOrder:function(){return{compare:function(t,e){return e.compareTo(t)}}},min:function(t){return ls.sort(t),t.get(0)},sort:function(t,e){var n=t.toArray();e?ut.sort(n,e):ut.sort(n);for(var i=t.iterator(),r=0,o=n.length;r<o;r++)i.next(),i.set(n[r])},singletonList:function(t){var e=new w;return e.add(t),e}};e(qe.prototype,{expandToQueue:function(t,e){var n=qe.isComposite(this.boundable1),r=qe.isComposite(this.boundable2);if(n&&r)return qe.area(this.boundable1)>qe.area(this.boundable2)?(this.expand(this.boundable1,this.boundable2,t,e),null):(this.expand(this.boundable2,this.boundable1,t,e),null);if(n)return this.expand(this.boundable1,this.boundable2,t,e),null;if(r)return this.expand(this.boundable2,this.boundable1,t,e),null;throw new i("neither boundable is composite")},isLeaves:function(){return!(qe.isComposite(this.boundable1)||qe.isComposite(this.boundable2))},compareTo:function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},expand:function(t,e,n,i){for(var r=t.getChildBoundables(),o=r.iterator();o.hasNext();){var s=o.next(),a=new qe(s,e,this.itemDistance);a.getDistance()<i&&n.add(a)}},getBoundable:function(t){return 0===t?this.boundable1:this.boundable2},getDistance:function(){return this._distance},distance:function(){return this.isLeaves()?this.itemDistance.distance(this.boundable1,this.boundable2):this.boundable1.getBounds().distance(this.boundable2.getBounds())},interfaces_:function(){return[o]},getClass:function(){return qe}}),qe.area=function(t){return t.getBounds().getArea()},qe.isComposite=function(t){return t instanceof Fe},e(ke.prototype,{getNodeCapacity:function(){return this.nodeCapacity},lastNode:function(t){return t.get(t.size()-1)},size:function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this.root));if(1===arguments.length){for(var t=arguments[0],e=0,n=t.getChildBoundables().iterator();n.hasNext();){var i=n.next();i instanceof Fe?e+=this.size(i):i instanceof Oe&&(e+=1)}return e}},removeItem:function(t,e){for(var n=null,i=t.getChildBoundables().iterator();i.hasNext();){var r=i.next();r instanceof Oe&&r.getItem()===e&&(n=r)}return null!==n&&(t.getChildBoundables().remove(n),!0)},itemsTree:function(){if(0===arguments.length){this.build();var t=this.itemsTree(this.root);return null===t?new w:t}if(1===arguments.length){for(var e=arguments[0],n=new w,i=e.getChildBoundables().iterator();i.hasNext();){var r=i.next();if(r instanceof Fe){var o=this.itemsTree(r);null!==o&&n.add(o)}else r instanceof Oe?n.add(r.getItem()):f.shouldNeverReachHere()}return n.size()<=0?null:n}},insert:function(t,e){f.isTrue(!this.built,"Cannot insert items into an STR packed R-tree after it has been built."),this.itemBoundables.add(new Oe(t,e))},boundablesAtLevel:function(){if(1===arguments.length){var t=arguments[0],e=new w;return this.boundablesAtLevel(t,this.root,e),e}if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];if(f.isTrue(n>-2),i.getLevel()===n)return r.add(i),null;for(var o=i.getChildBoundables().iterator();o.hasNext();){var s=o.next();s instanceof Fe?this.boundablesAtLevel(n,s,r):(f.isTrue(s instanceof Oe),-1===n&&r.add(s))}return null}},query:function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new w;return this.isEmpty()?e:(this.getIntersectsOp().intersects(this.root.getBounds(),t)&&this.query(t,this.root,e),e)}if(2===arguments.length){var n=arguments[0],i=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this.root.getBounds(),n)&&this.query(n,this.root,i)}else if(3===arguments.length)if(M(arguments[2],Ae)&&arguments[0]instanceof Object&&arguments[1]instanceof Fe)for(var r=arguments[0],o=arguments[1],s=arguments[2],a=o.getChildBoundables(),u=0;u<a.size();u++){var l=a.get(u);this.getIntersectsOp().intersects(l.getBounds(),r)&&(l instanceof Fe?this.query(r,l,s):l instanceof Oe?s.visitItem(l.getItem()):f.shouldNeverReachHere())}else if(M(arguments[2],m)&&arguments[0]instanceof Object&&arguments[1]instanceof Fe)for(var c=arguments[0],h=arguments[1],p=arguments[2],a=h.getChildBoundables(),u=0;u<a.size();u++){var l=a.get(u);this.getIntersectsOp().intersects(l.getBounds(),c)&&(l instanceof Fe?this.query(c,l,p):l instanceof Oe?p.add(l.getItem()):f.shouldNeverReachHere())}},build:function(){return this.built?null:(this.root=this.itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this.itemBoundables,-1),this.itemBoundables=null,void(this.built=!0))},getRoot:function(){return this.build(),this.root},remove:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this.root.getBounds(),t)&&this.remove(t,this.root,e)}if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2],o=this.removeItem(i,r);if(o)return!0;for(var s=null,a=i.getChildBoundables().iterator();a.hasNext();){var u=a.next();if(this.getIntersectsOp().intersects(u.getBounds(),n)&&u instanceof Fe&&(o=this.remove(n,u,r))){s=u;break}}return null!==s&&s.getChildBoundables().isEmpty()&&i.getChildBoundables().remove(s),o}},createHigherLevels:function(t,e){f.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)},depth:function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this.root));if(1===arguments.length){for(var t=arguments[0],e=0,n=t.getChildBoundables().iterator();n.hasNext();){var i=n.next();if(i instanceof Fe){var r=this.depth(i);r>e&&(e=r)}}return e+1}},createParentBoundables:function(t,e){f.isTrue(!t.isEmpty());var n=new w;n.add(this.createNode(e));var i=new w(t);ls.sort(i,this.getComparator());for(var r=i.iterator();r.hasNext();){var o=r.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(e)),this.lastNode(n).addChildBoundable(o)}return n},isEmpty:function(){return this.built?this.root.isEmpty():this.itemBoundables.isEmpty()},interfaces_:function(){return[u]},getClass:function(){return ke}}),ke.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},ke.IntersectsOp=Ge,ke.serialVersionUID=-0x35ef64c82d4c5400,ke.DEFAULT_NODE_CAPACITY=10,e(je.prototype,{distance:function(t,e){},interfaces_:function(){return[]},getClass:function(){return je}}),c(Be,ke),e(Be.prototype,{createParentBoundablesFromVerticalSlices:function(t,e){f.isTrue(t.length>0);for(var n=new w,i=0;i<t.length;i++)n.addAll(this.createParentBoundablesFromVerticalSlice(t[i],e));return n},createNode:function(t){return new ze(t)},size:function(){return 0===arguments.length?ke.prototype.size.call(this):ke.prototype.size.apply(this,arguments)},insert:function(){if(2!==arguments.length)return ke.prototype.insert.apply(this,arguments);var t=arguments[0],e=arguments[1];return t.isNull()?null:void ke.prototype.insert.call(this,t,e)},getIntersectsOp:function(){return Be.intersectsOp},verticalSlices:function(t,e){for(var n=Math.trunc(Math.ceil(t.size()/e)),i=new Array(e).fill(null),r=t.iterator(),o=0;o<e;o++){i[o]=new w;for(var s=0;r.hasNext()&&s<n;){var a=r.next();i[o].add(a),s++}}return i},query:function(){if(1===arguments.length){var t=arguments[0];return ke.prototype.query.call(this,t)}if(2===arguments.length){var e=arguments[0],n=arguments[1];ke.prototype.query.call(this,e,n)}else if(3===arguments.length)if(M(arguments[2],Ae)&&arguments[0]instanceof Object&&arguments[1]instanceof Fe){var i=arguments[0],r=arguments[1],o=arguments[2];ke.prototype.query.call(this,i,r,o)}else if(M(arguments[2],m)&&arguments[0]instanceof Object&&arguments[1]instanceof Fe){var s=arguments[0],a=arguments[1],u=arguments[2];ke.prototype.query.call(this,s,a,u)}},getComparator:function(){return Be.yComparator},createParentBoundablesFromVerticalSlice:function(t,e){return ke.prototype.createParentBoundables.call(this,t,e)},remove:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return ke.prototype.remove.call(this,t,e)}return ke.prototype.remove.apply(this,arguments)},depth:function(){return 0===arguments.length?ke.prototype.depth.call(this):ke.prototype.depth.apply(this,arguments)},createParentBoundables:function(t,e){f.isTrue(!t.isEmpty());var n=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),i=new w(t);ls.sort(i,Be.xComparator);var r=this.verticalSlices(i,Math.trunc(Math.ceil(Math.sqrt(n))));return this.createParentBoundablesFromVerticalSlices(r,e)},nearestNeighbour:function(){if(1===arguments.length){if(M(arguments[0],je)){var t=arguments[0],e=new qe(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour(e)}if(arguments[0]instanceof qe){var n=arguments[0];return this.nearestNeighbour(n,r.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof Be&&M(arguments[1],je)){var i=arguments[0],o=arguments[1],e=new qe(this.getRoot(),i.getRoot(),o);return this.nearestNeighbour(e)}if(arguments[0]instanceof qe&&"number"==typeof arguments[1]){var s=arguments[0],a=arguments[1],u=a,l=null,c=new _e;for(c.add(s);!c.isEmpty()&&u>0;){var h=c.poll(),f=h.getDistance();if(f>=u)break;h.isLeaves()?(u=f,l=h):h.expandToQueue(c,u)}return[l.getBoundable(0).getItem(),l.getBoundable(1).getItem()]}}else if(3===arguments.length){var p=arguments[0],d=arguments[1],g=arguments[2],v=new Oe(p,d),e=new qe(this.getRoot(),v,g);return this.nearestNeighbour(e)[0]}},interfaces_:function(){return[De,u]},getClass:function(){return Be}}),Be.centreX=function(t){return Be.avg(t.getMinX(),t.getMaxX())},Be.avg=function(t,e){return(t+e)/2},Be.centreY=function(t){return Be.avg(t.getMinY(),t.getMaxY())},c(ze,Fe),e(ze.prototype,{computeBounds:function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new I(n.getBounds()):t.expandToInclude(n.getBounds())}return t},interfaces_:function(){return[]},getClass:function(){return ze}}),Be.STRtreeNode=ze,Be.serialVersionUID=0x39920f7d5f261e0,Be.xComparator={interfaces_:function(){return[a]},compare:function(t,e){return ke.compareDoubles(Be.centreX(t.getBounds()),Be.centreX(e.getBounds()))}},Be.yComparator={interfaces_:function(){return[a]},compare:function(t,e){return ke.compareDoubles(Be.centreY(t.getBounds()),Be.centreY(e.getBounds()))}},Be.intersectsOp={interfaces_:function(){return[IntersectsOp]},intersects:function(t,e){return t.intersects(e)}},Be.DEFAULT_NODE_CAPACITY=10,e(Ve.prototype,{interfaces_:function(){return[]},getClass:function(){return Ve}}),Ve.relativeSign=function(t,e){return t<e?-1:t>e?1:0},Ve.compare=function(t,e,n){if(e.equals2D(n))return 0;var i=Ve.relativeSign(e.x,n.x),r=Ve.relativeSign(e.y,n.y);switch(t){case 0:return Ve.compareValue(i,r);case 1:return Ve.compareValue(r,i);case 2:return Ve.compareValue(r,-i);case 3:return Ve.compareValue(-i,r);case 4:return Ve.compareValue(-i,-r);case 5:return Ve.compareValue(-r,-i);case 6:return Ve.compareValue(-r,i);case 7:return Ve.compareValue(i,-r)}return f.shouldNeverReachHere("invalid octant value"),0},Ve.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0},e(Xe.prototype,{getCoordinate:function(){return this.coord},print:function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},compareTo:function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:Ve.compare(this.segmentOctant,this.coord,e.coord)},isEndPoint:function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},isInterior:function(){return this._isInterior},interfaces_:function(){return[o]},getClass:function(){return Xe}}),e(Ye.prototype,{getSplitCoordinates:function(){var t=new b;this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var i=e.next();this.addEdgeCoordinates(n,i,t),n=i}return t.toCoordinateArray()},addCollapsedNodes:function(){var t=new w;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var n=e.next().intValue();this.add(this.edge.getCoordinate(n),n)}},print:function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){e.next().print(t)}},findCollapsesFromExistingVertices:function(t){for(var e=0;e<this.edge.size()-2;e++){var n=this.edge.getCoordinate(e),i=(this.edge.getCoordinate(e+1),this.edge.getCoordinate(e+2));n.equals2D(i)&&t.add(new P(e+1))}},addEdgeCoordinates:function(t,e,n){var i=e.segmentIndex-t.segmentIndex+2,r=this.edge.getCoordinate(e.segmentIndex),o=e.isInterior()||!e.coord.equals2D(r);o||i--,n.add(new p(t.coord),!1);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)n.add(this.edge.getCoordinate(s));o&&n.add(new p(e.coord))},iterator:function(){return this.nodeMap.values().iterator()},addSplitEdges:function(t){this.addEndpoints(),this.addCollapsedNodes();for(var e=this.iterator(),n=e.next();e.hasNext();){var i=e.next(),r=this.createSplitEdge(n,i);t.add(r),n=i}},findCollapseIndex:function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var i=e.segmentIndex-t.segmentIndex;return e.isInterior()||i--,1===i&&(n[0]=t.segmentIndex+1,!0)},findCollapsesFromInsertedNodes:function(t){for(var e=new Array(1).fill(null),n=this.iterator(),i=n.next();n.hasNext();){var r=n.next();this.findCollapseIndex(i,r,e)&&t.add(new P(e[0])),i=r}},getEdge:function(){return this.edge},addEndpoints:function(){var t=this.edge.size()-1;this.add(this.edge.getCoordinate(0),0),this.add(this.edge.getCoordinate(t),t)},createSplitEdge:function(t,e){var n=e.segmentIndex-t.segmentIndex+2,i=this.edge.getCoordinate(e.segmentIndex),r=e.isInterior()||!e.coord.equals2D(i);r||n--;var o=new Array(n).fill(null),s=0;o[s++]=new p(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this.edge.getCoordinate(a);return r&&(o[s]=new p(e.coord)),new He(o,this.edge.getData())},add:function(t,e){var n=new Xe(this.edge,t,e,this.edge.getSegmentOctant(e)),i=this.nodeMap.get(n);return null!==i?(f.isTrue(i.coord.equals2D(t),"Found equal nodes with different coordinates"),i):(this.nodeMap.put(n,n),n)},checkSplitEdgesCorrectness:function(t){var e=this.edge.getCoordinates(),n=t.get(0),i=n.getCoordinate(0);if(!i.equals2D(e[0]))throw new l("bad split edge start point at "+i)
;var r=t.get(t.size()-1),o=r.getCoordinates(),s=o[o.length-1];if(!s.equals2D(e[e.length-1]))throw new l("bad split edge end point at "+s)},interfaces_:function(){return[]},getClass:function(){return Ye}}),e(Ue.prototype,{next:function(){return null===this.currNode?(this.currNode=this.nextNode,this.currSegIndex=this.currNode.segmentIndex,this.readNextNode(),this.currNode):null===this.nextNode?null:this.nextNode.segmentIndex===this.currNode.segmentIndex?(this.currNode=this.nextNode,this.currSegIndex=this.currNode.segmentIndex,this.readNextNode(),this.currNode):(this.nextNode.segmentIndex,this.currNode.segmentIndex,null)},remove:function(){throw new UnsupportedOperationException(this.getClass().getName())},hasNext:function(){return null!==this.nextNode},readNextNode:function(){this.nodeIt.hasNext()?this.nextNode=this.nodeIt.next():this.nextNode=null},interfaces_:function(){return[g]},getClass:function(){return Ue}}),e(We.prototype,{addIntersection:function(t,e){},interfaces_:function(){return[Re]},getClass:function(){return We}}),e(He.prototype,{getCoordinates:function(){return this.pts},size:function(){return this.pts.length},getCoordinate:function(t){return this.pts[t]},isClosed:function(){return this.pts[0].equals(this.pts[this.pts.length-1])},getSegmentOctant:function(t){return t===this.pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},setData:function(t){this.data=t},safeOctant:function(t,e){return t.equals2D(e)?0:Le.octant(t,e)},getData:function(){return this.data},addIntersection:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var n=arguments[0],i=arguments[1],r=(arguments[2],arguments[3]),o=new p(n.getIntersection(r));this.addIntersection(o,i)}},toString:function(){return re.toLineString(new qt(this.pts))},getNodeList:function(){return this.nodeList},addIntersectionNode:function(t,e){var n=e,i=n+1;if(i<this.pts.length){var r=this.pts[i];t.equals2D(r)&&(n=i)}return this.nodeList.add(t,n)},addIntersections:function(t,e,n){for(var i=0;i<t.getIntersectionNum();i++)this.addIntersection(t,e,n,i)},interfaces_:function(){return[We]},getClass:function(){return He}}),He.getNodedSubstrings=function(){if(1===arguments.length){var t=arguments[0],e=new w;return He.getNodedSubstrings(t,e),e}if(2===arguments.length)for(var n=arguments[0],i=arguments[1],r=n.iterator();r.hasNext();){var o=r.next();o.getNodeList().addSplitEdges(i)}},e(Je.prototype,{overlap:function(){if(2===arguments.length)arguments[0],arguments[1];else if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];t.getLineSegment(e,this.overlapSeg1),n.getLineSegment(i,this.overlapSeg2),this.overlap(this.overlapSeg1,this.overlapSeg2)}},interfaces_:function(){return[]},getClass:function(){return Je}}),e(Ze.prototype,{getLineSegment:function(t,e){e.p0=this.pts[t],e.p1=this.pts[t+1]},computeSelect:function(t,e,n,i){var r=this.pts[e],o=this.pts[n];if(i.tempEnv1.init(r,o),n-e==1)return i.select(this,e),null;if(!t.intersects(i.tempEnv1))return null;var s=Math.trunc((e+n)/2);e<s&&this.computeSelect(t,e,s,i),s<n&&this.computeSelect(t,s,n,i)},getCoordinates:function(){for(var t=new Array(this.end-this.start+1).fill(null),e=0,n=this.start;n<=this.end;n++)t[e++]=this.pts[n];return t},computeOverlaps:function(t,e){this.computeOverlapsInternal(this.start,this.end,t,t.start,t.end,e)},setId:function(t){this.id=t},select:function(t,e){this.computeSelect(t,this.start,this.end,e)},getEnvelope:function(){if(null===this.env){var t=this.pts[this.start],e=this.pts[this.end];this.env=new I(t,e)}return this.env},getEndIndex:function(){return this.end},getStartIndex:function(){return this.start},getContext:function(){return this.context},getId:function(){return this.id},computeOverlapsInternal:function(t,e,n,i,r,o){var s=this.pts[t],a=this.pts[e],u=n.pts[i],l=n.pts[r];if(e-t==1&&r-i==1)return o.overlap(this,t,n,i),null;if(o.tempEnv1.init(s,a),o.tempEnv2.init(u,l),!o.tempEnv1.intersects(o.tempEnv2))return null;var c=Math.trunc((t+e)/2),h=Math.trunc((i+r)/2);t<c&&(i<h&&this.computeOverlapsInternal(t,c,n,i,h,o),h<r&&this.computeOverlapsInternal(t,c,n,h,r,o)),c<e&&(i<h&&this.computeOverlapsInternal(c,e,n,i,h,o),h<r&&this.computeOverlapsInternal(c,e,n,h,r,o))},interfaces_:function(){return[]},getClass:function(){return Ze}}),e(Ke.prototype,{interfaces_:function(){return[]},getClass:function(){return Ke}}),Ke.isNorthern=function(t){return t===Ke.NE||t===Ke.NW},Ke.isOpposite=function(t,e){return t!==e&&2==(t-e+4)%4},Ke.commonHalfPlane=function(t,e){if(t===e)return t;if(2==(t-e+4)%4)return-1;var n=t<e?t:e,i=t>e?t:e;return 0===n&&3===i?3:n},Ke.isInHalfPlane=function(t,e){return e===Ke.SE?t===Ke.SE||t===Ke.SW:t===e||t===e+1},Ke.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new i("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Ke.NE:Ke.SE:e>=0?Ke.NW:Ke.SW}if(arguments[0]instanceof p&&arguments[1]instanceof p){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new i("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?Ke.NE:Ke.SE:r.y>=n.y?Ke.NW:Ke.SW}},Ke.NE=0,Ke.NW=1,Ke.SW=2,Ke.SE=3,e(Qe.prototype,{interfaces_:function(){return[]},getClass:function(){return Qe}}),Qe.getChainStartIndices=function(t){var e=0,n=new w;n.add(new P(e));do{var i=Qe.findChainEnd(t,e);n.add(new P(i)),e=i}while(e<t.length-1);return Qe.toIntArray(n)},Qe.findChainEnd=function(t,e){for(var n=e;n<t.length-1&&t[n].equals2D(t[n+1]);)n++;if(n>=t.length-1)return t.length-1;for(var i=Ke.quadrant(t[n],t[n+1]),r=e+1;r<t.length;){if(!t[r-1].equals2D(t[r])){if(Ke.quadrant(t[r-1],t[r])!==i)break}r++}return r-1},Qe.getChains=function(){if(1===arguments.length){var t=arguments[0];return Qe.getChains(t,null)}if(2===arguments.length){for(var e=arguments[0],n=arguments[1],i=new w,r=Qe.getChainStartIndices(e),o=0;o<r.length-1;o++){var s=new Ze(e,r[o],r[o+1],n);i.add(s)}return i}},Qe.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e},e($e.prototype,{computeNodes:function(t){},getNodedSubstrings:function(){},interfaces_:function(){return[]},getClass:function(){return $e}}),e(tn.prototype,{setSegmentIntersector:function(t){this.segInt=t},interfaces_:function(){return[$e]},getClass:function(){return tn}}),c(en,tn),e(en.prototype,{getMonotoneChains:function(){return this.monoChains},getNodedSubstrings:function(){return He.getNodedSubstrings(this.nodedSegStrings)},getIndex:function(){return this.index},add:function(t){for(var e=Qe.getChains(t.getCoordinates(),t),n=e.iterator();n.hasNext();){var i=n.next();i.setId(this.idCounter++),this.index.insert(i.getEnvelope(),i),this.monoChains.add(i)}},computeNodes:function(t){this.nodedSegStrings=t;for(var e=t.iterator();e.hasNext();)this.add(e.next());this.intersectChains()},intersectChains:function(){for(var t=new nn(this.segInt),e=this.monoChains.iterator();e.hasNext();)for(var n=e.next(),i=this.index.query(n.getEnvelope()),r=i.iterator();r.hasNext();){var o=r.next();if(o.getId()>n.getId()&&(n.computeOverlaps(o,t),this.nOverlaps++),this.segInt.isDone())return null}},interfaces_:function(){return[]},getClass:function(){return en}}),c(nn,Je),e(nn.prototype,{overlap:function(){if(4!==arguments.length)return Je.prototype.overlap.apply(this,arguments);var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3],r=t.getContext(),o=n.getContext();this.si.processIntersections(r,e,o,i)},interfaces_:function(){return[]},getClass:function(){return nn}}),en.SegmentOverlapAction=nn,c(rn,l),e(rn.prototype,{getCoordinate:function(){return this.pt},interfaces_:function(){return[]},getClass:function(){return rn}}),rn.msgWithCoord=function(t,e){return null!==e?t+" [ "+e+" ]":t},e(on.prototype,{processIntersections:function(t,e,n,i){},isDone:function(){},interfaces_:function(){return[]},getClass:function(){return on}}),e(sn.prototype,{getInteriorIntersection:function(){return this.interiorIntersection},setCheckEndSegmentsOnly:function(t){this.isCheckEndSegmentsOnly=t},getIntersectionSegments:function(){return this.intSegments},count:function(){return this.intersectionCount},getIntersections:function(){return this.intersections},setFindAllIntersections:function(t){this.findAllIntersections=t},setKeepIntersections:function(t){this.keepIntersections=t},processIntersections:function(t,e,n,i){if(!this.findAllIntersections&&this.hasIntersection())return null;if(t===n&&e===i)return null;if(this.isCheckEndSegmentsOnly){if(!(this.isEndSegment(t,e)||this.isEndSegment(n,i)))return null}var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[i],a=n.getCoordinates()[i+1];this.li.computeIntersection(r,o,s,a),this.li.hasIntersection()&&this.li.isInteriorIntersection()&&(this.intSegments=new Array(4).fill(null),this.intSegments[0]=r,this.intSegments[1]=o,this.intSegments[2]=s,this.intSegments[3]=a,this.interiorIntersection=this.li.getIntersection(0),this.keepIntersections&&this.intersections.add(this.interiorIntersection),this.intersectionCount++)},isEndSegment:function(t,e){return 0===e||e>=t.size()-2},hasIntersection:function(){return null!==this.interiorIntersection},isDone:function(){return!this.findAllIntersections&&null!==this.interiorIntersection},interfaces_:function(){return[on]},getClass:function(){return sn}}),sn.createAllIntersectionsFinder=function(t){var e=new sn(t);return e.setFindAllIntersections(!0),e},sn.createAnyIntersectionFinder=function(t){return new sn(t)},sn.createIntersectionCounter=function(t){var e=new sn(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e},e(an.prototype,{execute:function(){return null!==this.segInt?null:void this.checkInteriorIntersections()},getIntersections:function(){return this.segInt.getIntersections()},isValid:function(){return this.execute(),this._isValid},setFindAllIntersections:function(t){this.findAllIntersections=t},checkInteriorIntersections:function(){this._isValid=!0,this.segInt=new sn(this.li),this.segInt.setFindAllIntersections(this.findAllIntersections);var t=new en;if(t.setSegmentIntersector(this.segInt),t.computeNodes(this.segStrings),this.segInt.hasIntersection())return this._isValid=!1,null},checkValid:function(){if(this.execute(),!this._isValid)throw new rn(this.getErrorMessage(),this.segInt.getInteriorIntersection())},getErrorMessage:function(){if(this._isValid)return"no intersections found";var t=this.segInt.getIntersectionSegments();return"found non-noded intersection between "+re.toLineString(t[0],t[1])+" and "+re.toLineString(t[2],t[3])},interfaces_:function(){return[]},getClass:function(){return an}}),an.computeIntersections=function(t){var e=new an(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()},e(un.prototype,{checkValid:function(){this.nv.checkValid()},interfaces_:function(){return[]},getClass:function(){return un}}),un.toSegmentStrings=function(t){for(var e=new w,n=t.iterator();n.hasNext();){var i=n.next();e.add(new Pe(i.getCoordinates(),i))}return e},un.checkValid=function(t){new un(t).checkValid()},e(ln.prototype,{map:function(t){for(var e=new w,n=0;n<t.getNumGeometries();n++){var i=this.mapOp.map(t.getGeometryN(n));i.isEmpty()||e.add(i)}return t.getFactory().createGeometryCollection(ne.toGeometryArray(e))},interfaces_:function(){return[]},getClass:function(){return ln}}),ln.map=function(t,e){return new ln(e).map(t)},e(cn.prototype,{interfaces_:function(){return[]},getClass:function(){return cn}}),cn.opposite=function(t){return t===cn.LEFT?cn.RIGHT:t===cn.RIGHT?cn.LEFT:t},cn.ON=0,cn.LEFT=1,cn.RIGHT=2,e(hn.prototype,{setAllLocations:function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},isNull:function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==S.NONE)return!1;return!0},setAllLocationsIfNull:function(t){for(var e=0;e<this.location.length;e++)this.location[e]===S.NONE&&(this.location[e]=t)},isLine:function(){return 1===this.location.length},merge:function(t){if(t.location.length>this.location.length){var e=new Array(3).fill(null);e[cn.ON]=this.location[cn.ON],e[cn.LEFT]=S.NONE,e[cn.RIGHT]=S.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===S.NONE&&n<t.location.length&&(this.location[n]=t.location[n])},getLocations:function(){return this.location},flip:function(){if(this.location.length<=1)return null;var t=this.location[cn.LEFT];this.location[cn.LEFT]=this.location[cn.RIGHT],this.location[cn.RIGHT]=t},toString:function(){var t=new R;return this.location.length>1&&t.append(S.toLocationSymbol(this.location[cn.LEFT])),t.append(S.toLocationSymbol(this.location[cn.ON])),this.location.length>1&&t.append(S.toLocationSymbol(this.location[cn.RIGHT])),t.toString()},setLocations:function(t,e,n){this.location[cn.ON]=t,this.location[cn.LEFT]=e,this.location[cn.RIGHT]=n},get:function(t){return t<this.location.length?this.location[t]:S.NONE},isArea:function(){return this.location.length>1},isAnyNull:function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===S.NONE)return!0;return!1},setLocation:function(){if(1===arguments.length){var t=arguments[0];this.setLocation(cn.ON,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.location[e]=n}},init:function(t){this.location=new Array(t).fill(null),this.setAllLocations(S.NONE)},isEqualOnSide:function(t,e){return this.location[e]===t.location[e]},allPositionsEqual:function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},interfaces_:function(){return[]},getClass:function(){return hn}}),e(fn.prototype,{getGeometryCount:function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},setAllLocations:function(t,e){this.elt[t].setAllLocations(e)},isNull:function(t){return this.elt[t].isNull()},setAllLocationsIfNull:function(){if(1===arguments.length){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.elt[e].setAllLocationsIfNull(n)}},isLine:function(t){return this.elt[t].isLine()},merge:function(t){for(var e=0;e<2;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new hn(t.elt[e]):this.elt[e].merge(t.elt[e])},flip:function(){this.elt[0].flip(),this.elt[1].flip()},getLocation:function(){if(1===arguments.length){var t=arguments[0];return this.elt[t].get(cn.ON)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},toString:function(){var t=new R;return null!==this.elt[0]&&(t.append("A:"),t.append(this.elt[0].toString())),null!==this.elt[1]&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},isArea:function(){if(0===arguments.length)return this.elt[0].isArea()||this.elt[1].isArea();if(1===arguments.length){var t=arguments[0];return this.elt[t].isArea()}},isAnyNull:function(t){return this.elt[t].isAnyNull()},setLocation:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(cn.ON,e)}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this.elt[n].setLocation(i,r)}},isEqualOnSide:function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},allPositionsEqual:function(t,e){return this.elt[t].allPositionsEqual(e)},toLine:function(t){this.elt[t].isArea()&&(this.elt[t]=new hn(this.elt[t].location[0]))},interfaces_:function(){return[]},getClass:function(){return fn}}),fn.toLineLabel=function(t){for(var e=new fn(S.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e},e(pn.prototype,{computeRing:function(){if(null!==this.ring)return null;for(var t=new Array(this.pts.size()).fill(null),e=0;e<this.pts.size();e++)t[e]=this.pts.get(e);this.ring=this.geometryFactory.createLinearRing(t),this._isHole=le.isCCW(this.ring.getCoordinates())},isIsolated:function(){return 1===this.label.getGeometryCount()},computePoints:function(t){this.startDe=t;var e=t,n=!0;do{if(null===e)throw new rn("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new rn("Directed Edge visited twice during ring-building at "+e.getCoordinate());this.edges.add(e);var i=e.getLabel();f.isTrue(i.isArea()),this.mergeLabel(i),this.addPoints(e.getEdge(),e.isForward(),n),n=!1,this.setEdgeRing(e,this),e=this.getNext(e)}while(e!==this.startDe)},getLinearRing:function(){return this.ring},getCoordinate:function(t){return this.pts.get(t)},computeMaxNodeDegree:function(){this.maxNodeDegree=0;var t=this.startDe;do{var e=t.getNode(),n=e.getEdges().getOutgoingDegree(this);n>this.maxNodeDegree&&(this.maxNodeDegree=n),t=this.getNext(t)}while(t!==this.startDe);this.maxNodeDegree*=2},addPoints:function(t,e,n){var i=t.getCoordinates();if(e){var r=1;n&&(r=0);for(var o=r;o<i.length;o++)this.pts.add(i[o])}else{var r=i.length-2;n&&(r=i.length-1);for(var o=r;o>=0;o--)this.pts.add(i[o])}},isHole:function(){return this._isHole},setInResult:function(){var t=this.startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this.startDe)},containsPoint:function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!le.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this.holes.iterator();n.hasNext();){if(n.next().containsPoint(t))return!1}return!0},addHole:function(t){this.holes.add(t)},isShell:function(){return null===this.shell},getLabel:function(){return this.label},getEdges:function(){return this.edges},getMaxNodeDegree:function(){return this.maxNodeDegree<0&&this.computeMaxNodeDegree(),this.maxNodeDegree},getShell:function(){return this.shell},mergeLabel:function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],i=e.getLocation(n,cn.RIGHT);if(i===S.NONE)return null;if(this.label.getLocation(n)===S.NONE)return this.label.setLocation(n,i),null}},setShell:function(t){this.shell=t,null!==t&&t.addHole(this)},toPolygon:function(t){for(var e=new Array(this.holes.size()).fill(null),n=0;n<this.holes.size();n++)e[n]=this.holes.get(n).getLinearRing();return t.createPolygon(this.getLinearRing(),e)},interfaces_:function(){return[]},getClass:function(){return pn}}),c(dn,pn),e(dn.prototype,{setEdgeRing:function(t,e){t.setMinEdgeRing(e)},getNext:function(t){return t.getNextMin()},interfaces_:function(){return[]},getClass:function(){return dn}}),c(gn,pn),e(gn.prototype,{buildMinimalRings:function(){var t=new w,e=this.startDe;do{if(null===e.getMinEdgeRing()){var n=new dn(e,this.geometryFactory);t.add(n)}e=e.getNext()}while(e!==this.startDe);return t},setEdgeRing:function(t,e){t.setEdgeRing(e)},linkDirectedEdgesForMinimalEdgeRings:function(){var t=this.startDe;do{t.getNode().getEdges().linkMinimalDirectedEdges(this),t=t.getNext()}while(t!==this.startDe)},getNext:function(t){return t.getNext()},interfaces_:function(){return[]},getClass:function(){return gn}}),e(vn.prototype,{setVisited:function(t){this._isVisited=t},setInResult:function(t){this._isInResult=t},isCovered:function(){return this._isCovered},isCoveredSet:function(){return this._isCoveredSet},setLabel:function(t){this.label=t},getLabel:function(){return this.label},setCovered:function(t){this._isCovered=t,this._isCoveredSet=!0},updateIM:function(t){f.isTrue(this.label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},isInResult:function(){return this._isInResult},isVisited:function(){return this._isVisited},interfaces_:function(){return[]},getClass:function(){return vn}}),c(yn,vn),e(yn.prototype,{isIncidentEdgeInResult:function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();){if(t.next().getEdge().isInResult())return!0}return!1},isIsolated:function(){return 1===this.label.getGeometryCount()},getCoordinate:function(){return this.coord},print:function(t){t.println("node "+this.coord+" lbl: "+this.label)},computeIM:function(t){},computeMergedLocation:function(t,e){var n=S.NONE;if(n=this.label.getLocation(e),!t.isNull(e)){var i=t.getLocation(e);n!==S.BOUNDARY&&(n=i)}return n},setLabel:function(){if(2!==arguments.length)return vn.prototype.setLabel.apply(this,arguments);var t=arguments[0],e=arguments[1];null===this.label?this.label=new fn(t,e):this.label.setLocation(t,e)},getEdges:function(){return this.edges},mergeLabel:function(){if(arguments[0]instanceof yn){var t=arguments[0];this.mergeLabel(t.label)}else if(arguments[0]instanceof fn)for(var e=arguments[0],n=0;n<2;n++){var i=this.computeMergedLocation(e,n),r=this.label.getLocation(n);r===S.NONE&&this.label.setLocation(n,i)}},add:function(t){this.edges.insert(t),t.setNode(this)},setLabelBoundary:function(t){if(null===this.label)return null;var e=S.NONE;null!==this.label&&(e=this.label.getLocation(t));var n=null;switch(e){case S.BOUNDARY:n=S.INTERIOR;break;case S.INTERIOR:n=S.BOUNDARY;break;default:n=S.BOUNDARY}this.label.setLocation(t,n)},interfaces_:function(){return[]},getClass:function(){return yn}}),e(mn.prototype,{find:function(t){return this.nodeMap.get(t)},addNode:function(){if(arguments[0]instanceof p){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof yn){var n=arguments[0],e=this.nodeMap.get(n.getCoordinate());return null===e?(this.nodeMap.put(n.getCoordinate(),n),n):(e.mergeLabel(n),e)}},print:function(t){for(var e=this.iterator();e.hasNext();){e.next().print(t)}},iterator:function(){return this.nodeMap.values().iterator()},values:function(){return this.nodeMap.values()},getBoundaryNodes:function(t){for(var e=new w,n=this.iterator();n.hasNext();){var i=n.next();i.getLabel().getLocation(t)===S.BOUNDARY&&e.add(i)}return e},add:function(t){var e=t.getCoordinate();this.addNode(e).add(t)},interfaces_:function(){return[]},getClass:function(){return mn}}),e(xn.prototype,{compareDirection:function(t){return this.dx===t.dx&&this.dy===t.dy?0:this.quadrant>t.quadrant?1:this.quadrant<t.quadrant?-1:le.computeOrientation(t.p0,t.p1,this.p1)},getDy:function(){return this.dy},getCoordinate:function(){return this.p0},setNode:function(t){this.node=t},print:function(t){var e=Math.atan2(this.dy,this.dx),n=this.getClass().getName(),i=n.lastIndexOf("."),r=n.substring(i+1);t.print(" "+r+": "+this.p0+" - "+this.p1+" "+this.quadrant+":"+e+" "+this.label)},compareTo:function(t){var e=t;return this.compareDirection(e)},getDirectedCoordinate:function(){return this.p1},getDx:function(){return this.dx},getLabel:function(){return this.label},getEdge:function(){return this.edge},getQuadrant:function(){return this.quadrant},getNode:function(){return this.node},toString:function(){var t=Math.atan2(this.dy,this.dx),e=this.getClass().getName(),n=e.lastIndexOf(".");return" "+e.substring(n+1)+": "+this.p0+" - "+this.p1+" "+this.quadrant+":"+t+" "+this.label},computeLabel:function(t){},init:function(t,e){this.p0=t,this.p1=e,this.dx=e.x-t.x,this.dy=e.y-t.y,this.quadrant=Ke.quadrant(this.dx,this.dy),f.isTrue(!(0===this.dx&&0===this.dy),"EdgeEnd with identical endpoints found")},interfaces_:function(){return[o]},getClass:function(){return xn}}),c(En,xn),e(En.prototype,{getNextMin:function(){return this.nextMin},getDepth:function(t){return this.depth[t]},setVisited:function(t){this._isVisited=t},computeDirectedLabel:function(){this.label=new fn(this.edge.getLabel()),this._isForward||this.label.flip()},getNext:function(){return this.next},setDepth:function(t,e){if(-999!==this.depth[t]&&this.depth[t]!==e)throw new rn("assigned depths do not match",this.getCoordinate());this.depth[t]=e},isInteriorAreaEdge:function(){for(var t=!0,e=0;e<2;e++)this.label.isArea(e)&&this.label.getLocation(e,cn.LEFT)===S.INTERIOR&&this.label.getLocation(e,cn.RIGHT)===S.INTERIOR||(t=!1);return t},setNextMin:function(t){this.nextMin=t},print:function(t){xn.prototype.print.call(this,t),t.print(" "+this.depth[cn.LEFT]+"/"+this.depth[cn.RIGHT]),t.print(" ("+this.getDepthDelta()+")"),this._isInResult&&t.print(" inResult")},setMinEdgeRing:function(t){this.minEdgeRing=t},isLineEdge:function(){var t=this.label.isLine(0)||this.label.isLine(1),e=!this.label.isArea(0)||this.label.allPositionsEqual(0,S.EXTERIOR),n=!this.label.isArea(1)||this.label.allPositionsEqual(1,S.EXTERIOR);return t&&e&&n},setEdgeRing:function(t){this.edgeRing=t},getMinEdgeRing:function(){return this.minEdgeRing},getDepthDelta:function(){var t=this.edge.getDepthDelta();return this._isForward||(t=-t),t},setInResult:function(t){this._isInResult=t},getSym:function(){return this.sym},isForward:function(){return this._isForward},getEdge:function(){return this.edge},printEdge:function(t){this.print(t),t.print(" "),this._isForward?this.edge.print(t):this.edge.printReverse(t)},setSym:function(t){this.sym=t},setVisitedEdge:function(t){this.setVisited(t),this.sym.setVisited(t)},setEdgeDepths:function(t,e){var n=this.getEdge().getDepthDelta();this._isForward||(n=-n);var i=1;t===cn.LEFT&&(i=-1);var r=cn.opposite(t),o=n*i,s=e+o;this.setDepth(t,e),this.setDepth(r,s)},getEdgeRing:function(){return this.edgeRing},isInResult:function(){return this._isInResult},setNext:function(t){this.next=t},isVisited:function(){return this._isVisited},interfaces_:function(){return[]},getClass:function(){return En}}),En.depthFactor=function(t,e){return t===S.EXTERIOR&&e===S.INTERIOR?1:t===S.INTERIOR&&e===S.EXTERIOR?-1:0},e(wn.prototype,{createNode:function(t){return new yn(t,null)},interfaces_:function(){return[]},getClass:function(){return wn}}),e(bn.prototype,{printEdges:function(t){t.println("Edges:");for(var e=0;e<this.edges.size();e++){t.println("edge "+e+":");var n=this.edges.get(e);n.print(t),n.eiList.print(t)}},find:function(t){return this.nodes.find(t)},addNode:function(){if(arguments[0]instanceof yn){var t=arguments[0];return this.nodes.addNode(t)}if(arguments[0]instanceof p){var e=arguments[0];return this.nodes.addNode(e)}},getNodeIterator:function(){return this.nodes.iterator()},linkResultDirectedEdges:function(){for(var t=this.nodes.iterator();t.hasNext();){t.next().getEdges().linkResultDirectedEdges()}},debugPrintln:function(t){D.out.println(t)},isBoundaryNode:function(t,e){var n=this.nodes.find(e);if(null===n)return!1;var i=n.getLabel();return null!==i&&i.getLocation(t)===S.BOUNDARY},linkAllDirectedEdges:function(){for(var t=this.nodes.iterator();t.hasNext();){t.next().getEdges().linkAllDirectedEdges()}},matchInSameDirection:function(t,e,n,i){return!!t.equals(n)&&le.computeOrientation(t,e,i)===le.COLLINEAR&&Ke.quadrant(t,e)===Ke.quadrant(n,i)},getEdgeEnds:function(){return this.edgeEndList},debugPrint:function(t){D.out.print(t)},getEdgeIterator:function(){return this.edges.iterator()},findEdgeInSameDirection:function(t,e){for(var n=0;n<this.edges.size();n++){var i=this.edges.get(n),r=i.getCoordinates();if(this.matchInSameDirection(t,e,r[0],r[1]))return i;if(this.matchInSameDirection(t,e,r[r.length-1],r[r.length-2]))return i}return null},insertEdge:function(t){this.edges.add(t)},findEdgeEnd:function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},addEdges:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.edges.add(n);var i=new En(n,!0),r=new En(n,!1);i.setSym(r),r.setSym(i),this.add(i),this.add(r)}},add:function(t){this.nodes.add(t),this.edgeEndList.add(t)},getNodes:function(){return this.nodes.values()},findEdge:function(t,e){for(var n=0;n<this.edges.size();n++){var i=this.edges.get(n),r=i.getCoordinates();if(t.equals(r[0])&&e.equals(r[1]))return i}return null},interfaces_:function(){return[]},getClass:function(){return bn}}),bn.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();){e.next().getEdges().linkResultDirectedEdges()}},e(In.prototype,{sortShellsAndHoles:function(t,e,n){for(var i=t.iterator();i.hasNext();){var r=i.next();r.isHole()?n.add(r):e.add(r)}},computePolygons:function(t){for(var e=new w,n=t.iterator();n.hasNext();){var i=n.next(),r=i.toPolygon(this.geometryFactory);e.add(r)}return e},placeFreeHoles:function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();if(null===i.getShell()){var r=this.findEdgeRingContaining(i,t);if(null===r)throw new rn("unable to assign hole to a shell",i.getCoordinate(0));i.setShell(r)}}},buildMinimalEdgeRings:function(t,e,n){for(var i=new w,r=t.iterator();r.hasNext();){var o=r.next();if(o.getMaxNodeDegree()>2){o.linkDirectedEdgesForMinimalEdgeRings();var s=o.buildMinimalRings(),a=this.findShell(s);null!==a?(this.placePolygonHoles(a,s),e.add(a)):n.addAll(s)}else i.add(o)}return i},containsPoint:function(t){for(var e=this.shellList.iterator();e.hasNext();){if(e.next().containsPoint(t))return!0}return!1},buildMaximalEdgeRings:function(t){for(var e=new w,n=t.iterator();n.hasNext();){var i=n.next();if(i.isInResult()&&i.getLabel().isArea()&&null===i.getEdgeRing()){var r=new gn(i,this.geometryFactory);e.add(r),r.setInResult()}}return e},placePolygonHoles:function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();i.isHole()&&i.setShell(t)}},getPolygons:function(){return this.computePolygons(this.shellList)},findEdgeRingContaining:function(t,e){for(var n=t.getLinearRing(),i=n.getEnvelopeInternal(),r=n.getCoordinateN(0),o=null,s=null,a=e.iterator();a.hasNext();){var u=a.next(),l=u.getLinearRing(),c=l.getEnvelopeInternal();null!==o&&(s=o.getLinearRing().getEnvelopeInternal());var h=!1;c.contains(i)&&le.isPointInRing(r,l.getCoordinates())&&(h=!0),h&&(null===o||s.contains(c))&&(o=u)}return o},findShell:function(t){for(var e=0,n=null,i=t.iterator();i.hasNext();){var r=i.next();r.isHole()||(n=r,e++)}return f.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},add:function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],n=arguments[1];bn.linkResultDirectedEdges(n);var i=this.buildMaximalEdgeRings(e),r=new w,o=this.buildMinimalEdgeRings(i,this.shellList,r);this.sortShellsAndHoles(o,this.shellList,r),this.placeFreeHoles(this.shellList,r)}},interfaces_:function(){return[]},getClass:function(){return In}}),e(Nn.prototype,{collectLines:function(t){for(var e=this.op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next();this.collectLineEdge(n,t,this.lineEdgesList),this.collectBoundaryTouchEdge(n,t,this.lineEdgesList)}},labelIsolatedLine:function(t,e){var n=this.ptLocator.locate(t.getCoordinate(),this.op.getArgGeometry(e));t.getLabel().setLocation(e,n)},build:function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this.resultLineList},collectLineEdge:function(t,e,n){var i=t.getLabel(),r=t.getEdge();t.isLineEdge()&&(t.isVisited()||!ni.isResultOfOp(i,e)||r.isCovered()||(n.add(r),t.setVisitedEdge(!0)))},findCoveredLineEdges:function(){for(var t=this.op.getGraph().getNodes().iterator();t.hasNext();){t.next().getEdges().findCoveredLineEdges()}for(var e=this.op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next(),i=n.getEdge();if(n.isLineEdge()&&!i.isCoveredSet()){var r=this.op.isCoveredByA(n.getCoordinate());i.setCovered(r)}}},labelIsolatedLines:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),i=n.getLabel();n.isIsolated()&&(i.isNull(0)?this.labelIsolatedLine(n,0):this.labelIsolatedLine(n,1))}},buildLines:function(t){for(var e=this.lineEdgesList.iterator();e.hasNext();){var n=e.next(),i=(n.getLabel(),this.geometryFactory.createLineString(n.getCoordinates()));this.resultLineList.add(i),n.setInResult(!0)}},collectBoundaryTouchEdge:function(t,e,n){var i=t.getLabel();return t.isLineEdge()?null:t.isVisited()?null:t.isInteriorAreaEdge()?null:t.getEdge().isInResult()?null:(f.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(ni.isResultOfOp(i,e)&&e===ni.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},interfaces_:function(){return[]},getClass:function(){return Nn}}),e(Cn.prototype,{filterCoveredNodeToPoint:function(t){var e=t.getCoordinate();if(!this.op.isCoveredByLA(e)){
var n=this.geometryFactory.createPoint(e);this.resultPointList.add(n)}},extractNonCoveredResultNodes:function(t){for(var e=this.op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();if(!(n.isInResult()||n.isIncidentEdgeInResult()||0!==n.getEdges().getDegree()&&t!==ni.INTERSECTION)){var i=n.getLabel();ni.isResultOfOp(i,t)&&this.filterCoveredNodeToPoint(n)}}},build:function(t){return this.extractNonCoveredResultNodes(t),this.resultPointList},interfaces_:function(){return[]},getClass:function(){return Cn}}),e(Sn.prototype,{locate:function(t){},interfaces_:function(){return[]},getClass:function(){return Sn}}),e(Mn.prototype,{locate:function(t){return Mn.locate(t,this.geom)},interfaces_:function(){return[Sn]},getClass:function(){return Mn}}),Mn.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&le.isPointInRing(t,e.getCoordinates())},Mn.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!Mn.isPointInRing(t,n))return!1;for(var i=0;i<e.getNumInteriorRing();i++){var r=e.getInteriorRingN(i);if(Mn.isPointInRing(t,r))return!1}return!0},Mn.containsPoint=function(t,e){if(e instanceof Lt)return Mn.containsPointInPolygon(t,e);if(e instanceof ft)for(var n=new Se(e);n.hasNext();){var i=n.next();if(i!==e&&Mn.containsPoint(t,i))return!0}return!1},Mn.locate=function(t,e){return e.isEmpty()?S.EXTERIOR:Mn.containsPoint(t,e)?S.INTERIOR:S.EXTERIOR},e(Ln.prototype,{getNextCW:function(t){this.getEdges();var e=this.edgeList.indexOf(t),n=e-1;return 0===e&&(n=this.edgeList.size()-1),this.edgeList.get(n)},propagateSideLabels:function(t){for(var e=S.NONE,n=this.iterator();n.hasNext();){var i=n.next(),r=i.getLabel();r.isArea(t)&&r.getLocation(t,cn.LEFT)!==S.NONE&&(e=r.getLocation(t,cn.LEFT))}if(e===S.NONE)return null;for(var o=e,n=this.iterator();n.hasNext();){var i=n.next(),r=i.getLabel();if(r.getLocation(t,cn.ON)===S.NONE&&r.setLocation(t,cn.ON,o),r.isArea(t)){var s=r.getLocation(t,cn.LEFT),a=r.getLocation(t,cn.RIGHT);if(a!==S.NONE){if(a!==o)throw new rn("side location conflict",i.getCoordinate());s===S.NONE&&f.shouldNeverReachHere("found single null side (at "+i.getCoordinate()+")"),o=s}else f.isTrue(r.getLocation(t,cn.LEFT)===S.NONE,"found single null side"),r.setLocation(t,cn.RIGHT,o),r.setLocation(t,cn.LEFT,o)}}},getCoordinate:function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},print:function(t){D.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){e.next().print(t)}},isAreaLabelsConsistent:function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},checkAreaLabelsConsistent:function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,i=e.get(n).getLabel(),r=i.getLocation(t,cn.LEFT);f.isTrue(r!==S.NONE,"Found unlabelled area edge");for(var o=r,s=this.iterator();s.hasNext();){var a=s.next(),u=a.getLabel();f.isTrue(u.isArea(t),"Found non-area edge");var l=u.getLocation(t,cn.LEFT),c=u.getLocation(t,cn.RIGHT);if(l===c)return!1;if(c!==o)return!1;o=l}return!0},findIndex:function(t){this.iterator();for(var e=0;e<this.edgeList.size();e++){if(this.edgeList.get(e)===t)return e}return-1},iterator:function(){return this.getEdges().iterator()},getEdges:function(){return null===this.edgeList&&(this.edgeList=new w(this.edgeMap.values())),this.edgeList},getLocation:function(t,e,n){return this.ptInAreaLocation[t]===S.NONE&&(this.ptInAreaLocation[t]=Mn.locate(e,n[t].getGeometry())),this.ptInAreaLocation[t]},toString:function(){var t=new R;t.append("EdgeEndStar: "+this.getCoordinate()),t.append("\n");for(var e=this.iterator();e.hasNext();){var n=e.next();t.append(n),t.append("\n")}return t.toString()},computeEdgeEndLabels:function(t){for(var e=this.iterator();e.hasNext();){e.next().computeLabel(t)}},computeLabelling:function(t){this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var e=[!1,!1],n=this.iterator();n.hasNext();)for(var i=n.next(),r=i.getLabel(),o=0;o<2;o++)r.isLine(o)&&r.getLocation(o)===S.BOUNDARY&&(e[o]=!0);for(var n=this.iterator();n.hasNext();)for(var i=n.next(),r=i.getLabel(),o=0;o<2;o++)if(r.isAnyNull(o)){var s=S.NONE;if(e[o])s=S.EXTERIOR;else{var a=i.getCoordinate();s=this.getLocation(o,a,t)}r.setAllLocationsIfNull(o,s)}},getDegree:function(){return this.edgeMap.size()},insertEdgeEnd:function(t,e){this.edgeMap.put(t,e),this.edgeList=null},interfaces_:function(){return[]},getClass:function(){return Ln}}),c(Rn,Ln),e(Rn.prototype,{linkResultDirectedEdges:function(){this.getResultAreaEdges();for(var t=null,e=null,n=this.SCANNING_FOR_INCOMING,i=0;i<this.resultAreaEdgeList.size();i++){var r=this.resultAreaEdgeList.get(i),o=r.getSym();if(r.getLabel().isArea())switch(null===t&&r.isInResult()&&(t=r),n){case this.SCANNING_FOR_INCOMING:if(!o.isInResult())continue;e=o,n=this.LINKING_TO_OUTGOING;break;case this.LINKING_TO_OUTGOING:if(!r.isInResult())continue;e.setNext(r),n=this.SCANNING_FOR_INCOMING}}if(n===this.LINKING_TO_OUTGOING){if(null===t)throw new rn("no outgoing dirEdge found",this.getCoordinate());f.isTrue(t.isInResult(),"unable to link last incoming dirEdge"),e.setNext(t)}},insert:function(t){var e=t;this.insertEdgeEnd(e,e)},getRightmostEdge:function(){var t=this.getEdges(),e=t.size();if(e<1)return null;var n=t.get(0);if(1===e)return n;var i=t.get(e-1),r=n.getQuadrant(),o=i.getQuadrant();return Ke.isNorthern(r)&&Ke.isNorthern(o)?n:Ke.isNorthern(r)||Ke.isNorthern(o)?0!==n.getDy()?n:0!==i.getDy()?i:(f.shouldNeverReachHere("found two horizontal edges incident on node"),null):i},print:function(t){D.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();t.print("out "),n.print(t),t.println(),t.print("in "),n.getSym().print(t),t.println()}},getResultAreaEdges:function(){if(null!==this.resultAreaEdgeList)return this.resultAreaEdgeList;this.resultAreaEdgeList=new w;for(var t=this.iterator();t.hasNext();){var e=t.next();(e.isInResult()||e.getSym().isInResult())&&this.resultAreaEdgeList.add(e)}return this.resultAreaEdgeList},updateLabelling:function(t){for(var e=this.iterator();e.hasNext();){var n=e.next(),i=n.getLabel();i.setAllLocationsIfNull(0,t.getLocation(0)),i.setAllLocationsIfNull(1,t.getLocation(1))}},linkAllDirectedEdges:function(){this.getEdges();for(var t=null,e=null,n=this.edgeList.size()-1;n>=0;n--){var i=this.edgeList.get(n),r=i.getSym();null===e&&(e=r),null!==t&&r.setNext(t),t=i}e.setNext(t)},computeDepths:function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),n=(t.getLabel(),t.getDepth(cn.LEFT)),i=t.getDepth(cn.RIGHT),r=this.computeDepths(e+1,this.edgeList.size(),n);if(this.computeDepths(0,e,r)!==i)throw new rn("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=a,l=o;l<s;l++){var c=this.edgeList.get(l);c.getLabel(),c.setEdgeDepths(cn.RIGHT,u),u=c.getDepth(cn.LEFT)}return u}},mergeSymLabels:function(){for(var t=this.iterator();t.hasNext();){var e=t.next();e.getLabel().merge(e.getSym().getLabel())}},linkMinimalDirectedEdges:function(t){for(var e=null,n=null,i=this.SCANNING_FOR_INCOMING,r=this.resultAreaEdgeList.size()-1;r>=0;r--){var o=this.resultAreaEdgeList.get(r),s=o.getSym();switch(null===e&&o.getEdgeRing()===t&&(e=o),i){case this.SCANNING_FOR_INCOMING:if(s.getEdgeRing()!==t)continue;n=s,i=this.LINKING_TO_OUTGOING;break;case this.LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;n.setNextMin(o),i=this.SCANNING_FOR_INCOMING}}i===this.LINKING_TO_OUTGOING&&(f.isTrue(null!==e,"found null for first outgoing dirEdge"),f.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))},getOutgoingDegree:function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();){var n=e.next();n.isInResult()&&t++}return t}if(1===arguments.length){for(var i=arguments[0],t=0,e=this.iterator();e.hasNext();){var n=e.next();n.getEdgeRing()===i&&t++}return t}},getLabel:function(){return this.label},findCoveredLineEdges:function(){for(var t=S.NONE,e=this.iterator();e.hasNext();){var n=e.next(),i=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=S.INTERIOR;break}if(i.isInResult()){t=S.EXTERIOR;break}}}if(t===S.NONE)return null;for(var r=t,e=this.iterator();e.hasNext();){var n=e.next(),i=n.getSym();n.isLineEdge()?n.getEdge().setCovered(r===S.INTERIOR):(n.isInResult()&&(r=S.EXTERIOR),i.isInResult()&&(r=S.INTERIOR))}},computeLabelling:function(t){Ln.prototype.computeLabelling.call(this,t),this.label=new fn(S.NONE);for(var e=this.iterator();e.hasNext();)for(var n=e.next(),i=n.getEdge(),r=i.getLabel(),o=0;o<2;o++){var s=r.getLocation(o);s!==S.INTERIOR&&s!==S.BOUNDARY||this.label.setLocation(o,S.INTERIOR)}},interfaces_:function(){return[]},getClass:function(){return Rn}}),c(Pn,wn),e(Pn.prototype,{createNode:function(t){return new yn(t,new Rn)},interfaces_:function(){return[]},getClass:function(){return Pn}}),e(Tn.prototype,{computeIntersections:function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},interfaces_:function(){return[]},getClass:function(){return Tn}}),e(On.prototype,{isDelete:function(){return this.eventType===On.DELETE},setDeleteEventIndex:function(t){this.deleteEventIndex=t},getObject:function(){return this.obj},compareTo:function(t){var e=t;return this.xValue<e.xValue?-1:this.xValue>e.xValue?1:this.eventType<e.eventType?-1:this.eventType>e.eventType?1:0},getInsertEvent:function(){return this.insertEvent},isInsert:function(){return this.eventType===On.INSERT},isSameLabel:function(t){return null!==this.label&&this.label===t.label},getDeleteEventIndex:function(){return this.deleteEventIndex},interfaces_:function(){return[o]},getClass:function(){return On}}),On.INSERT=1,On.DELETE=2,e(_n.prototype,{interfaces_:function(){return[]},getClass:function(){return _n}}),e(An.prototype,{isTrivialIntersection:function(t,e,n,i){if(t===n&&1===this.li.getIntersectionNum()){if(An.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var r=t.getNumPoints()-1;if(0===e&&i===r||0===i&&e===r)return!0}}return!1},getProperIntersectionPoint:function(){return this.properIntersectionPoint},setIsDoneIfProperInt:function(t){this.isDoneWhenProperInt=t},hasProperInteriorIntersection:function(){return this.hasProperInterior},isBoundaryPointInternal:function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next(),r=i.getCoordinate();if(t.isIntersection(r))return!0}return!1},hasProperIntersection:function(){return this.hasProper},hasIntersection:function(){return this._hasIntersection},isDone:function(){return this._isDone},isBoundaryPoint:function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},setBoundaryNodes:function(t,e){this.bdyNodes=new Array(2).fill(null),this.bdyNodes[0]=t,this.bdyNodes[1]=e},addIntersections:function(t,e,n,i){if(t===n&&e===i)return null;this.numTests++;var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[i],a=n.getCoordinates()[i+1];this.li.computeIntersection(r,o,s,a),this.li.hasIntersection()&&(this.recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this.numIntersections++,this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,!this.includeProper&&this.li.isProper()||(t.addIntersections(this.li,e,0),n.addIntersections(this.li,i,1)),this.li.isProper()&&(this.properIntersectionPoint=this.li.getIntersection(0).copy(),this.hasProper=!0,this.isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this.li,this.bdyNodes)||(this.hasProperInterior=!0))))},interfaces_:function(){return[]},getClass:function(){return An}}),An.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)},c(Dn,_n),e(Dn.prototype,{prepareEvents:function(){ls.sort(this.events);for(var t=0;t<this.events.size();t++){var e=this.events.get(t);e.isDelete()&&e.getInsertEvent().setDeleteEventIndex(t)}},computeIntersections:function(){if(1===arguments.length){var t=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var e=0;e<this.events.size();e++){var n=this.events.get(e);if(n.isInsert()&&this.processOverlaps(e,n.getDeleteEventIndex(),n,t),t.isDone())break}}else if(3===arguments.length)if(arguments[2]instanceof An&&M(arguments[0],m)&&M(arguments[1],m)){var i=arguments[0],r=arguments[1],o=arguments[2];this.addEdges(i,i),this.addEdges(r,r),this.computeIntersections(o)}else if("boolean"==typeof arguments[2]&&M(arguments[0],m)&&arguments[1]instanceof An){var s=arguments[0],a=arguments[1],u=arguments[2];u?this.addEdges(s,null):this.addEdges(s),this.computeIntersections(a)}},addEdge:function(t,e){for(var n=t.getMonotoneChainEdge(),i=n.getStartIndexes(),r=0;r<i.length-1;r++){var o=new Tn(n,r),s=new On(e,n.getMinX(r),o);this.events.add(s),this.events.add(new On(n.getMaxX(r),s))}},processOverlaps:function(t,e,n,i){for(var r=n.getObject(),o=t;o<e;o++){var s=this.events.get(o);if(s.isInsert()){var a=s.getObject();n.isSameLabel(s)||(r.computeIntersections(a,i),this.nOverlaps++)}}},addEdges:function(){if(1===arguments.length)for(var t=arguments[0],e=t.iterator();e.hasNext();){var n=e.next();this.addEdge(n,n)}else if(2===arguments.length)for(var i=arguments[0],r=arguments[1],e=i.iterator();e.hasNext();){var n=e.next();this.addEdge(n,r)}},interfaces_:function(){return[]},getClass:function(){return Dn}}),e(Fn.prototype,{getMin:function(){return this.min},intersects:function(t,e){return!(this.min>e||this.max<t)},getMax:function(){return this.max},toString:function(){return re.toLineString(new p(this.min,0),new p(this.max,0))},interfaces_:function(){return[]},getClass:function(){return Fn}}),e(qn.prototype,{compare:function(t,e){var n=t,i=e,r=(n.min+n.max)/2,o=(i.min+i.max)/2;return r<o?-1:r>o?1:0},interfaces_:function(){return[a]},getClass:function(){return qn}}),Fn.NodeComparator=qn,c(kn,Fn),e(kn.prototype,{query:function(t,e,n){return this.intersects(t,e)?void n.visitItem(this.item):null},interfaces_:function(){return[]},getClass:function(){return kn}}),c(Gn,Fn),e(Gn.prototype,{buildExtent:function(t,e){this.min=Math.min(t.min,e.min),this.max=Math.max(t.max,e.max)},query:function(t,e,n){return this.intersects(t,e)?(null!==this.node1&&this.node1.query(t,e,n),void(null!==this.node2&&this.node2.query(t,e,n))):null},interfaces_:function(){return[]},getClass:function(){return Gn}}),e(jn.prototype,{buildTree:function(){ls.sort(this.leaves,new IntervalRTreeNode.NodeComparator);for(var t=this.leaves,e=null,n=new w;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},insert:function(t,e,n){if(null!==this.root)throw new IllegalStateException("Index cannot be added to once it has been queried");this.leaves.add(new kn(t,e,n))},query:function(t,e,n){this.init(),this.root.query(t,e,n)},buildRoot:function(){return null!==this.root?null:void(this.root=this.buildTree())},printNode:function(t){D.out.println(re.toLineString(new p(t.min,this.level),new p(t.max,this.level)))},init:function(){return null!==this.root?null:void this.buildRoot()},buildLevel:function(t,e){this.level++,e.clear();for(var n=0;n<t.size();n+=2){var i=t.get(n);if(null===(n+1<t.size()?t.get(n):null))e.add(i);else{var r=new Gn(t.get(n),t.get(n+1));e.add(r)}}},interfaces_:function(){return[]},getClass:function(){return jn}}),e(Bn.prototype,{filter:function(t){if(this.isForcedToLineString&&t instanceof Pt){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this.lines.add(e),null}t instanceof Nt&&this.lines.add(t)},setForceToLineString:function(t){this.isForcedToLineString=t},interfaces_:function(){return[k]},getClass:function(){return Bn}}),Bn.getGeometry=function(){if(1===arguments.length){var t=arguments[0];return t.getFactory().buildGeometry(Bn.getLines(t))}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(Bn.getLines(e,n))}},Bn.getLines=function(){if(1===arguments.length){var t=arguments[0];return Bn.getLines(t,!1)}if(2===arguments.length){if(M(arguments[0],v)&&M(arguments[1],v)){for(var e=arguments[0],n=arguments[1],i=e.iterator();i.hasNext();){var r=i.next();Bn.getLines(r,n)}return n}if(arguments[0]instanceof G&&"boolean"==typeof arguments[1]){var o=arguments[0],s=arguments[1],a=new w;return o.apply(new Bn(a,s)),a}if(arguments[0]instanceof G&&M(arguments[1],v)){var u=arguments[0],l=arguments[1];return u instanceof Nt?l.add(u):u.apply(new Bn(l)),l}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&M(arguments[0],v)&&M(arguments[1],v)){for(var c=arguments[0],h=arguments[1],f=arguments[2],i=c.iterator();i.hasNext();){var r=i.next();Bn.getLines(r,h,f)}return h}if("boolean"==typeof arguments[2]&&arguments[0]instanceof G&&M(arguments[1],v)){var p=arguments[0],d=arguments[1],g=arguments[2];return p.apply(new Bn(d,g)),d}}},e(zn.prototype,{visitItem:function(t){this.items.add(t)},getItems:function(){return this.items},interfaces_:function(){return[Ae]},getClass:function(){return zn}}),e(Vn.prototype,{locate:function(t){var e=new ue(t),n=new Xn(e);return this.index.query(t.y,t.y,n),e.getLocation()},interfaces_:function(){return[Sn]},getClass:function(){return Vn}}),e(Xn.prototype,{visitItem:function(t){var e=t;this.counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},interfaces_:function(){return[Ae]},getClass:function(){return Xn}}),e(Yn.prototype,{init:function(t){for(var e=Bn.getLines(t),n=e.iterator();n.hasNext();){var i=n.next(),r=i.getCoordinates();this.addLine(r)}},addLine:function(t){for(var e=1;e<t.length;e++){var n=new ce(t[e-1],t[e]),i=Math.min(n.p0.y,n.p1.y),r=Math.max(n.p0.y,n.p1.y);this.index.insert(i,r,n)}},query:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new zn;return this.index.query(t,e,n),n.getItems()}if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];this.index.query(i,r,o)}},interfaces_:function(){return[]},getClass:function(){return Yn}}),Vn.SegmentVisitor=Xn,Vn.IntervalIndexedGeometry=Yn,e(Un.prototype,{getSegmentIndex:function(){return this.segmentIndex},getCoordinate:function(){return this.coord},print:function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},compareTo:function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},isEndPoint:function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t},toString:function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},getDistance:function(){return this.dist},compare:function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},interfaces_:function(){return[o]},getClass:function(){return Un}}),e(Wn.prototype,{print:function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){e.next().print(t)}},iterator:function(){return this.nodeMap.values().iterator()},addSplitEdges:function(t){this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var i=e.next(),r=this.createSplitEdge(n,i);t.add(r),n=i}},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)},createSplitEdge:function(t,e){var n=e.segmentIndex-t.segmentIndex+2,i=this.edge.pts[e.segmentIndex],r=e.dist>0||!e.coord.equals2D(i);r||n--;var o=new Array(n).fill(null),s=0;o[s++]=new p(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this.edge.pts[a];return r&&(o[s]=e.coord),new Kn(o,new fn(this.edge.label))},add:function(t,e,n){var i=new Un(t,e,n),r=this.nodeMap.get(i);return null!==r?r:(this.nodeMap.put(i,i),i)},isIntersection:function(t){for(var e=this.iterator();e.hasNext();){if(e.next().coord.equals(t))return!0}return!1},interfaces_:function(){return[]},getClass:function(){return Wn}}),e(Hn.prototype,{getChainStartIndices:function(t){var e=0,n=new w;n.add(new P(e));do{var i=this.findChainEnd(t,e);n.add(new P(i)),e=i}while(e<t.length-1);return Hn.toIntArray(n)},findChainEnd:function(t,e){for(var n=Ke.quadrant(t[e],t[e+1]),i=e+1;i<t.length;){if(Ke.quadrant(t[i-1],t[i])!==n)break;i++}return i-1},interfaces_:function(){return[]},getClass:function(){return Hn}}),Hn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e},e(Jn.prototype,{getCoordinates:function(){return this.pts},getMaxX:function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n},getMinX:function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e<n?e:n},computeIntersectsForChain:function(){if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],i)}else if(6===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=arguments[4],l=arguments[5],c=this.pts[r],h=this.pts[o],f=s.pts[a],p=s.pts[u];if(o-r==1&&u-a==1)return l.addIntersections(this.e,r,s.e,a),null;if(this.env1.init(c,h),this.env2.init(f,p),!this.env1.intersects(this.env2))return null;var d=Math.trunc((r+o)/2),g=Math.trunc((a+u)/2);r<d&&(a<g&&this.computeIntersectsForChain(r,d,s,a,g,l),g<u&&this.computeIntersectsForChain(r,d,s,g,u,l)),d<o&&(a<g&&this.computeIntersectsForChain(d,o,s,a,g,l),g<u&&this.computeIntersectsForChain(d,o,s,g,u,l))}},getStartIndexes:function(){return this.startIndex},computeIntersects:function(t,e){for(var n=0;n<this.startIndex.length-1;n++)for(var i=0;i<t.startIndex.length-1;i++)this.computeIntersectsForChain(n,t,i,e)},interfaces_:function(){return[]},getClass:function(){return Jn}}),e(Zn.prototype,{getDepth:function(t,e){return this.depth[t][e]},setDepth:function(t,e,n){this.depth[t][e]=n},isNull:function(){if(0===arguments.length){for(var t=0;t<2;t++)for(var e=0;e<3;e++)if(this.depth[t][e]!==Zn.NULL_VALUE)return!1;return!0}if(1===arguments.length){var n=arguments[0];return this.depth[n][1]===Zn.NULL_VALUE}if(2===arguments.length){var i=arguments[0],r=arguments[1];return this.depth[i][r]===Zn.NULL_VALUE}},normalize:function(){for(var t=0;t<2;t++)if(!this.isNull(t)){var e=this.depth[t][1];this.depth[t][2]<e&&(e=this.depth[t][2]),e<0&&(e=0);for(var n=1;n<3;n++){var i=0;this.depth[t][n]>e&&(i=1),this.depth[t][n]=i}}},getDelta:function(t){return this.depth[t][cn.RIGHT]-this.depth[t][cn.LEFT]},getLocation:function(t,e){return this.depth[t][e]<=0?S.EXTERIOR:S.INTERIOR},toString:function(){return"A: "+this.depth[0][1]+","+this.depth[0][2]+" B: "+this.depth[1][1]+","+this.depth[1][2]},add:function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var n=1;n<3;n++){var i=t.getLocation(e,n);i!==S.EXTERIOR&&i!==S.INTERIOR||(this.isNull(e,n)?this.depth[e][n]=Zn.depthAtLocation(i):this.depth[e][n]+=Zn.depthAtLocation(i))}else if(3===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2];s===S.INTERIOR&&this.depth[r][o]++}},interfaces_:function(){return[]},getClass:function(){return Zn}}),Zn.depthAtLocation=function(t){return t===S.EXTERIOR?0:t===S.INTERIOR?1:Zn.NULL_VALUE},Zn.NULL_VALUE=-1,c(Kn,vn),e(Kn.prototype,{getDepth:function(){return this.depth},getCollapsedEdge:function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new Kn(t,fn.toLineLabel(this.label))},isIsolated:function(){return this._isIsolated},getCoordinates:function(){return this.pts},setIsolated:function(t){this._isIsolated=t},setName:function(t){this.name=t},equals:function(t){if(!(t instanceof Kn))return!1;var e=t;if(this.pts.length!==e.pts.length)return!1;for(var n=!0,i=!0,r=this.pts.length,o=0;o<this.pts.length;o++)if(this.pts[o].equals2D(e.pts[o])||(n=!1),this.pts[o].equals2D(e.pts[--r])||(i=!1),!n&&!i)return!1;return!0},getCoordinate:function(){if(0===arguments.length)return this.pts.length>0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},print:function(t){t.print("edge "+this.name+": "),t.print("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this.label+" "+this.depthDelta)},computeIM:function(t){Kn.updateIM(this.label,t)},isCollapsed:function(){return!!this.label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},isClosed:function(){return this.pts[0].equals(this.pts[this.pts.length-1])},getMaximumSegmentIndex:function(){return this.pts.length-1},getDepthDelta:function(){return this.depthDelta},getNumPoints:function(){return this.pts.length},printReverse:function(t){t.print("edge "+this.name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},getMonotoneChainEdge:function(){return null===this.mce&&(this.mce=new Jn(this)),this.mce},getEnvelope:function(){if(null===this.env){this.env=new I;for(var t=0;t<this.pts.length;t++)this.env.expandToInclude(this.pts[t])}return this.env},addIntersection:function(t,e,n,i){var r=new p(t.getIntersection(i)),o=e,s=t.getEdgeDistance(n,i),a=o+1;if(a<this.pts.length){var u=this.pts[a];r.equals2D(u)&&(o=a,s=0)}this.eiList.add(r,o,s)},toString:function(){var t=new R;t.append("edge "+this.name+": "),t.append("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this.label+" "+this.depthDelta),t.toString()},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},setDepthDelta:function(t){this.depthDelta=t},getEdgeIntersectionList:function(){return this.eiList},addIntersections:function(t,e,n){for(var i=0;i<t.getIntersectionNum();i++)this.addIntersection(t,e,n,i)},interfaces_:function(){return[]},getClass:function(){return Kn}}),Kn.updateIM=function(){if(2!==arguments.length)return vn.prototype.updateIM.apply(this,arguments);var t=arguments[0],e=arguments[1];e.setAtLeastIfValid(t.getLocation(0,cn.ON),t.getLocation(1,cn.ON),1),t.isArea()&&(e.setAtLeastIfValid(t.getLocation(0,cn.LEFT),t.getLocation(1,cn.LEFT),2),e.setAtLeastIfValid(t.getLocation(0,cn.RIGHT),t.getLocation(1,cn.RIGHT),2))},c(Qn,bn),e(Qn.prototype,{insertBoundaryPoint:function(t,e){var n=this.nodes.addNode(e),i=n.getLabel(),r=1;S.NONE;i.getLocation(t,cn.ON)===S.BOUNDARY&&r++;var o=Qn.determineBoundary(this.boundaryNodeRule,r);i.setLocation(t,o)},computeSelfNodes:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.computeSelfNodes(t,e,!1)}if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2],o=new An(n,!0,!1);o.setIsDoneIfProperInt(r);var s=this.createEdgeSetIntersector(),a=this.parentGeom instanceof Pt||this.parentGeom instanceof Lt||this.parentGeom instanceof Tt,u=i||!a;return s.computeIntersections(this.edges,o,u),this.addSelfIntersectionNodes(this.argIndex),o}},computeSplitEdges:function(t){for(var e=this.edges.iterator();e.hasNext();){e.next().eiList.addSplitEdges(t)}},computeEdgeIntersections:function(t,e,n){var i=new An(e,n,!0);return i.setBoundaryNodes(this.getBoundaryNodes(),t.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this.edges,t.edges,i),i},getGeometry:function(){return this.parentGeom},getBoundaryNodeRule:function(){return this.boundaryNodeRule},hasTooFewPoints:function(){return this._hasTooFewPoints},addPoint:function(){if(arguments[0]instanceof St){var t=arguments[0],e=t.getCoordinate();this.insertPoint(this.argIndex,e,S.INTERIOR)}else if(arguments[0]instanceof p){var n=arguments[0];this.insertPoint(this.argIndex,n,S.INTERIOR)}},addPolygon:function(t){this.addPolygonRing(t.getExteriorRing(),S.EXTERIOR,S.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var n=t.getInteriorRingN(e);this.addPolygonRing(n,S.INTERIOR,S.EXTERIOR)}},addEdge:function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this.argIndex,e[0],S.BOUNDARY),this.insertPoint(this.argIndex,e[e.length-1],S.BOUNDARY)},addLineString:function(t){var e=U.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this.invalidPoint=e[0],null;var n=new Kn(e,new fn(this.argIndex,S.INTERIOR));this.lineEdgeMap.put(t,n),this.insertEdge(n),f.isTrue(e.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this.argIndex,e[0]),this.insertBoundaryPoint(this.argIndex,e[e.length-1])},getInvalidPoint:function(){return this.invalidPoint},getBoundaryPoints:function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),n=0,i=t.iterator();i.hasNext();){var r=i.next();e[n++]=r.getCoordinate().copy()}return e},getBoundaryNodes:function(){return null===this.boundaryNodes&&(this.boundaryNodes=this.nodes.getBoundaryNodes(this.argIndex)),this.boundaryNodes},addSelfIntersectionNode:function(t,e,n){return this.isBoundaryNode(t,e)?null:void(n===S.BOUNDARY&&this.useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,n))},addPolygonRing:function(t,e,n){if(t.isEmpty())return null;var i=U.removeRepeatedPoints(t.getCoordinates());if(i.length<4)return this._hasTooFewPoints=!0,this.invalidPoint=i[0],null;var r=e,o=n;le.isCCW(i)&&(r=n,o=e);var s=new Kn(i,new fn(this.argIndex,S.BOUNDARY,r,o));this.lineEdgeMap.put(t,s),this.insertEdge(s),this.insertPoint(this.argIndex,i[0],S.BOUNDARY)},insertPoint:function(t,e,n){var i=this.nodes.addNode(e),r=i.getLabel();null===r?i.label=new fn(t,n):r.setLocation(t,n)},createEdgeSetIntersector:function(){return new Dn},addSelfIntersectionNodes:function(t){for(var e=this.edges.iterator();e.hasNext();)for(var n=e.next(),i=n.getLabel().getLocation(t),r=n.eiList.iterator();r.hasNext();){var o=r.next();this.addSelfIntersectionNode(t,o.coord,i)}},add:function(){if(1!==arguments.length)return bn.prototype.add.apply(this,arguments);var t=arguments[0];if(t.isEmpty())return null;if(t instanceof Tt&&(this.useBoundaryDeterminationRule=!1),t instanceof Lt)this.addPolygon(t);else if(t instanceof Nt)this.addLineString(t);else if(t instanceof St)this.addPoint(t);else if(t instanceof Rt)this.addCollection(t);else if(t instanceof pt)this.addCollection(t);else if(t instanceof Tt)this.addCollection(t);else{if(!(t instanceof ft))throw new UnsupportedOperationException(t.getClass().getName());this.addCollection(t)}},addCollection:function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},locate:function(t){return M(this.parentGeom,Mt)&&this.parentGeom.getNumGeometries()>50?(null===this.areaPtLocator&&(this.areaPtLocator=new Vn(this.parentGeom)),this.areaPtLocator.locate(t)):this.ptLocator.locate(t,this.parentGeom)},findEdge:function(){if(1===arguments.length){var t=arguments[0];return this.lineEdgeMap.get(t)}return bn.prototype.findEdge.apply(this,arguments)},interfaces_:function(){return[]},getClass:function(){return Qn}}),Qn.determineBoundary=function(t,e){return t.isInBoundary(e)?S.BOUNDARY:S.INTERIOR},e($n.prototype,{getArgGeometry:function(t){return this.arg[t].getGeometry()},setComputationPrecision:function(t){this.resultPrecisionModel=t,this.li.setPrecisionModel(this.resultPrecisionModel)},interfaces_:function(){return[]},getClass:function(){return $n}}),e(ti.prototype,{compareTo:function(t){var e=t;return ti.compareOriented(this.pts,this._orientation,e.pts,e._orientation)},interfaces_:function(){return[o]},getClass:function(){return ti}}),ti.orientation=function(t){return 1===U.increasingDirection(t)},ti.compareOriented=function(t,e,n,i){for(var r=e?1:-1,o=i?1:-1,s=e?t.length:-1,a=i?n.length:-1,u=e?0:t.length-1,l=i?0:n.length-1;;){var c=t[u].compareTo(n[l]);if(0!==c)return c;u+=r,l+=o;var h=u===s,f=l===a;if(h&&!f)return-1;if(!h&&f)return 1;if(h&&f)return 0}},e(ei.prototype,{print:function(t){t.print("MULTILINESTRING ( ");for(var e=0;e<this.edges.size();e++){var n=this.edges.get(e);e>0&&t.print(","),t.print("(");for(var i=n.getCoordinates(),r=0;r<i.length;r++)r>0&&t.print(","),t.print(i[r].x+" "+i[r].y);t.println(")")}t.print(") ")},addAll:function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},findEdgeIndex:function(t){for(var e=0;e<this.edges.size();e++)if(this.edges.get(e).equals(t))return e;return-1},
iterator:function(){return this.edges.iterator()},getEdges:function(){return this.edges},get:function(t){return this.edges.get(t)},findEqualEdge:function(t){var e=new ti(t.getCoordinates());return this.ocaMap.get(e)},add:function(t){this.edges.add(t);var e=new ti(t.getCoordinates());this.ocaMap.put(e,t)},interfaces_:function(){return[]},getClass:function(){return ei}}),c(ni,$n),e(ni.prototype,{insertUniqueEdge:function(t){var e=this.edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new fn(t.getLabel()),i.flip());var r=e.getDepth();r.isNull()&&r.add(n),r.add(i),n.merge(i)}else this.edgeList.add(t)},getGraph:function(){return this.graph},cancelDuplicateResultEdges:function(){for(var t=this.graph.getEdgeEnds().iterator();t.hasNext();){var e=t.next(),n=e.getSym();e.isInResult()&&n.isInResult()&&(e.setInResult(!1),n.setInResult(!1))}},isCoveredByLA:function(t){return!!this.isCovered(t,this.resultLineList)||!!this.isCovered(t,this.resultPolyList)},computeGeometry:function(t,e,n,i){var r=new w;return r.addAll(t),r.addAll(e),r.addAll(n),r.isEmpty()?ni.createEmptyResult(i,this.arg[0].getGeometry(),this.arg[1].getGeometry(),this.geomFact):this.geomFact.buildGeometry(r)},mergeSymLabels:function(){for(var t=this.graph.getNodes().iterator();t.hasNext();){t.next().getEdges().mergeSymLabels()}},isCovered:function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();if(this.ptLocator.locate(t,i)!==S.EXTERIOR)return!0}return!1},replaceCollapsedEdges:function(){for(var t=new w,e=this.edgeList.iterator();e.hasNext();){var n=e.next();n.isCollapsed()&&(e.remove(),t.add(n.getCollapsedEdge()))}this.edgeList.addAll(t)},updateNodeLabelling:function(){for(var t=this.graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getEdges().getLabel();e.getLabel().merge(n)}},getResultGeometry:function(t){return this.computeOverlay(t),this.resultGeom},insertUniqueEdges:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.insertUniqueEdge(n)}},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 w;this.arg[0].computeSplitEdges(e),this.arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),un.checkValid(this.edgeList.getEdges()),this.graph.addEdges(this.edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new In(this.geomFact);n.add(this.graph),this.resultPolyList=n.getPolygons();var i=new Nn(this,this.geomFact,this.ptLocator);this.resultLineList=i.build(t);var r=new Cn(this,this.geomFact,this.ptLocator);this.resultPointList=r.build(t),this.resultGeom=this.computeGeometry(this.resultPointList,this.resultLineList,this.resultPolyList,t)},labelIncompleteNode:function(t,e){var n=this.ptLocator.locate(t.getCoordinate(),this.arg[e].getGeometry());t.getLabel().setLocation(e,n)},copyPoints:function(t){for(var e=this.arg[t].getNodeIterator();e.hasNext();){var n=e.next();this.graph.addNode(n.getCoordinate()).setLabel(t,n.getLabel().getLocation(t))}},findResultAreaEdges:function(t){for(var e=this.graph.getEdgeEnds().iterator();e.hasNext();){var n=e.next(),i=n.getLabel();i.isArea()&&!n.isInteriorAreaEdge()&&ni.isResultOfOp(i.getLocation(0,cn.RIGHT),i.getLocation(1,cn.RIGHT),t)&&n.setInResult(!0)}},computeLabelsFromDepths:function(){for(var t=this.edgeList.iterator();t.hasNext();){var e=t.next(),n=e.getLabel(),i=e.getDepth();if(!i.isNull()){i.normalize();for(var r=0;r<2;r++)n.isNull(r)||!n.isArea()||i.isNull(r)||(0===i.getDelta(r)?n.toLine(r):(f.isTrue(!i.isNull(r,cn.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(r,cn.LEFT,i.getLocation(r,cn.LEFT)),f.isTrue(!i.isNull(r,cn.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(r,cn.RIGHT,i.getLocation(r,cn.RIGHT))))}}},computeLabelling:function(){for(var t=this.graph.getNodes().iterator();t.hasNext();){t.next().getEdges().computeLabelling(this.arg)}this.mergeSymLabels(),this.updateNodeLabelling()},labelIncompleteNodes:function(){for(var t=0,e=this.graph.getNodes().iterator();e.hasNext();){var n=e.next(),i=n.getLabel();n.isIsolated()&&(t++,i.isNull(0)?this.labelIncompleteNode(n,0):this.labelIncompleteNode(n,1)),n.getEdges().updateLabelling(i)}},isCoveredByA:function(t){return!!this.isCovered(t,this.resultPolyList)},interfaces_:function(){return[]},getClass:function(){return ni}}),ni.overlayOp=function(t,e,n){return new ni(t,e).getResultGeometry(n)},ni.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return ni.createEmptyResult(ni.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var n=e;return ln.map(t,{interfaces_:function(){return[MapOp]},map:function(t){return t.intersection(n)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),ri.overlayOp(t,e,ni.INTERSECTION)},ni.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return ni.createEmptyResult(ni.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),ri.overlayOp(t,e,ni.SYMDIFFERENCE)},ni.resultDimension=function(t,e,n){var i=e.getDimension(),r=n.getDimension(),o=-1;switch(t){case ni.INTERSECTION:o=Math.min(i,r);break;case ni.UNION:o=Math.max(i,r);break;case ni.DIFFERENCE:o=i;break;case ni.SYMDIFFERENCE:o=Math.max(i,r)}return o},ni.createEmptyResult=function(t,e,n,i){var r=null;switch(ni.resultDimension(t,e,n)){case-1:r=i.createGeometryCollection(new Array(0).fill(null));break;case 0:r=i.createPoint();break;case 1:r=i.createLineString();break;case 2:r=i.createPolygon()}return r},ni.difference=function(t,e){return t.isEmpty()?ni.createEmptyResult(ni.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),ri.overlayOp(t,e,ni.DIFFERENCE))},ni.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),i=t.getLocation(1);return ni.isResultOfOp(n,i,e)}if(3===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2];switch(r===S.BOUNDARY&&(r=S.INTERIOR),o===S.BOUNDARY&&(o=S.INTERIOR),s){case ni.INTERSECTION:return r===S.INTERIOR&&o===S.INTERIOR;case ni.UNION:return r===S.INTERIOR||o===S.INTERIOR;case ni.DIFFERENCE:return r===S.INTERIOR&&o!==S.INTERIOR;case ni.SYMDIFFERENCE:return r===S.INTERIOR&&o!==S.INTERIOR||r!==S.INTERIOR&&o===S.INTERIOR}return!1}},ni.INTERSECTION=1,ni.UNION=2,ni.DIFFERENCE=3,ni.SYMDIFFERENCE=4,e(ii.prototype,{selfSnap:function(t){return new Ee(t).snapTo(t,this.snapTolerance)},removeCommonBits:function(t){this.cbr=new Ie,this.cbr.add(t[0]),this.cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this.cbr.removeCommonBits(t[0].copy()),e[1]=this.cbr.removeCommonBits(t[1].copy()),e},prepareResult:function(t){return this.cbr.addCommonBits(t),t},getResultGeometry:function(t){var e=this.snap(this.geom),n=ni.overlayOp(e[0],e[1],t);return this.prepareResult(n)},checkValid:function(t){t.isValid()||D.out.println("Snapped geometry is invalid")},computeSnapTolerance:function(){this.snapTolerance=Ee.computeOverlaySnapTolerance(this.geom[0],this.geom[1])},snap:function(t){var e=this.removeCommonBits(t);return Ee.snap(e[0],e[1],this.snapTolerance)},interfaces_:function(){return[]},getClass:function(){return ii}}),ii.overlayOp=function(t,e,n){return new ii(t,e).getResultGeometry(n)},ii.union=function(t,e){return ii.overlayOp(t,e,ni.UNION)},ii.intersection=function(t,e){return ii.overlayOp(t,e,ni.INTERSECTION)},ii.symDifference=function(t,e){return ii.overlayOp(t,e,ni.SYMDIFFERENCE)},ii.difference=function(t,e){return ii.overlayOp(t,e,ni.DIFFERENCE)},e(ri.prototype,{getResultGeometry:function(t){var e=null,n=!1,i=null;try{e=ni.overlayOp(this.geom[0],this.geom[1],t);n=!0}catch(t){if(!(t instanceof l))throw t;i=t}if(!n)try{e=ii.overlayOp(this.geom[0],this.geom[1],t)}catch(t){throw t instanceof l?i:t}return e},interfaces_:function(){return[]},getClass:function(){return ri}}),ri.overlayOp=function(t,e,n){return new ri(t,e).getResultGeometry(n)},ri.union=function(t,e){return ri.overlayOp(t,e,ni.UNION)},ri.intersection=function(t,e){return ri.overlayOp(t,e,ni.INTERSECTION)},ri.symDifference=function(t,e){return ri.overlayOp(t,e,ni.SYMDIFFERENCE)},ri.difference=function(t,e){return ri.overlayOp(t,e,ni.DIFFERENCE)},e(oi.prototype,{addPolygon:function(t){if(t.isEmpty())return null;var e=null,n=0,i=this.horizontalBisector(t);if(0===i.getLength())n=0,e=i.getCoordinate();else{var r=ri.overlayOp(i,t,ni.INTERSECTION),o=this.widestGeometry(r);n=o.getEnvelopeInternal().getWidth(),e=oi.centre(o.getEnvelopeInternal())}(null===this.interiorPoint||n>this.maxWidth)&&(this.interiorPoint=e,this.maxWidth=n)},getInteriorPoint:function(){return this.interiorPoint},widestGeometry:function(){if(arguments[0]instanceof ft){var t=arguments[0];if(t.isEmpty())return t;for(var e=t.getGeometryN(0),n=1;n<t.getNumGeometries();n++)t.getGeometryN(n).getEnvelopeInternal().getWidth()>e.getEnvelopeInternal().getWidth()&&(e=t.getGeometryN(n));return e}if(arguments[0]instanceof G){var i=arguments[0];return i instanceof ft?this.widestGeometry(i):i}},horizontalBisector:function(t){var e=t.getEnvelopeInternal(),n=si.getBisectorY(t);return this.factory.createLineString([new p(e.getMinX(),n),new p(e.getMaxX(),n)])},add:function(t){if(t instanceof Lt)this.addPolygon(t);else if(t instanceof ft)for(var e=t,n=0;n<e.getNumGeometries();n++)this.add(e.getGeometryN(n))},interfaces_:function(){return[]},getClass:function(){return oi}}),oi.centre=function(t){return new p(oi.avg(t.getMinX(),t.getMaxX()),oi.avg(t.getMinY(),t.getMaxY()))},oi.avg=function(t,e){return(t+e)/2},e(si.prototype,{updateInterval:function(t){t<=this.centreY?t>this.loY&&(this.loY=t):t>this.centreY&&t<this.hiY&&(this.hiY=t)},getBisectorY:function(){this.process(this.poly.getExteriorRing());for(var t=0;t<this.poly.getNumInteriorRing();t++)this.process(this.poly.getInteriorRingN(t));return oi.avg(this.hiY,this.loY)},process:function(t){for(var e=t.getCoordinateSequence(),n=0;n<e.size();n++){var i=e.getY(n);this.updateInterval(i)}},interfaces_:function(){return[]},getClass:function(){return si}}),si.getBisectorY=function(t){return new si(t).getBisectorY()},oi.SafeBisectorFinder=si,e(ai.prototype,{addEndpoints:function(){if(arguments[0]instanceof G){var t=arguments[0];if(t instanceof Nt)this.addEndpoints(t.getCoordinates());else if(t instanceof ft)for(var e=t,n=0;n<e.getNumGeometries();n++)this.addEndpoints(e.getGeometryN(n))}else if(arguments[0]instanceof Array){var i=arguments[0];this.add(i[0]),this.add(i[i.length-1])}},getInteriorPoint:function(){return this.interiorPoint},addInterior:function(){if(arguments[0]instanceof G){var t=arguments[0];if(t instanceof Nt)this.addInterior(t.getCoordinates());else if(t instanceof ft)for(var e=t,n=0;n<e.getNumGeometries();n++)this.addInterior(e.getGeometryN(n))}else if(arguments[0]instanceof Array)for(var i=arguments[0],n=1;n<i.length-1;n++)this.add(i[n])},add:function(t){var e=t.distance(this.centroid);e<this.minDistance&&(this.interiorPoint=new p(t),this.minDistance=e)},interfaces_:function(){return[]},getClass:function(){return ai}}),e(ui.prototype,{getInteriorPoint:function(){return this.interiorPoint},add:function(){if(arguments[0]instanceof G){var t=arguments[0];if(t instanceof St)this.add(t.getCoordinate());else if(t instanceof ft)for(var e=t,n=0;n<e.getNumGeometries();n++)this.add(e.getGeometryN(n))}else if(arguments[0]instanceof p){var i=arguments[0],r=i.distance(this.centroid);r<this.minDistance&&(this.interiorPoint=new p(i),this.minDistance=r)}},interfaces_:function(){return[]},getClass:function(){return ui}}),e(li.prototype,{select:function(){if(1===arguments.length)arguments[0];else if(2===arguments.length){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}},interfaces_:function(){return[]},getClass:function(){return li}}),e(ci.prototype,{hasChildren:function(){for(var t=0;t<2;t++)if(null!==this.subnode[t])return!0;return!1},isPrunable:function(){return!(this.hasChildren()||this.hasItems())},addAllItems:function(t){t.addAll(this.items);for(var e=0;e<2;e++)null!==this.subnode[e]&&this.subnode[e].addAllItems(t);return t},size:function(){for(var t=0,e=0;e<2;e++)null!==this.subnode[e]&&(t+=this.subnode[e].size());return t+this.items.size()},addAllItemsFromOverlapping:function(t,e){return null===t||this.isSearchMatch(t)?(e.addAll(this.items),null!==this.subnode[0]&&this.subnode[0].addAllItemsFromOverlapping(t,e),void(null!==this.subnode[1]&&this.subnode[1].addAllItemsFromOverlapping(t,e))):null},hasItems:function(){return!this.items.isEmpty()},remove:function(t,e){if(!this.isSearchMatch(t))return!1;for(var n=!1,i=0;i<2;i++)if(null!==this.subnode[i]&&(n=this.subnode[i].remove(t,e))){this.subnode[i].isPrunable()&&(this.subnode[i]=null);break}return n||(n=this.items.remove(e))},getItems:function(){return this.items},depth:function(){for(var t=0,e=0;e<2;e++)if(null!==this.subnode[e]){var n=this.subnode[e].depth();n>t&&(t=n)}return t+1},nodeSize:function(){for(var t=0,e=0;e<2;e++)null!==this.subnode[e]&&(t+=this.subnode[e].nodeSize());return t+1},add:function(t){this.items.add(t)},interfaces_:function(){return[]},getClass:function(){return ci}}),ci.getSubnodeIndex=function(t,e){var n=-1;return t.min>=e&&(n=1),t.max<=e&&(n=0),n},e(hi.prototype,{expandToInclude:function(t){t.max>this.max&&(this.max=t.max),t.min<this.min&&(this.min=t.min)},getWidth:function(){return this.max-this.min},overlaps:function(){if(1===arguments.length){var t=arguments[0];return this.overlaps(t.min,t.max)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return!(this.min>n||this.max<e)}},getMin:function(){return this.min},toString:function(){return"["+this.min+", "+this.max+"]"},contains:function(){if(1===arguments.length){if(arguments[0]instanceof hi){var t=arguments[0];return this.contains(t.min,t.max)}if("number"==typeof arguments[0]){var e=arguments[0];return e>=this.min&&e<=this.max}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];return n>=this.min&&i<=this.max}},init:function(t,e){this.min=t,this.max=e,t>e&&(this.min=e,this.max=t)},getMax:function(){return this.max},interfaces_:function(){return[]},getClass:function(){return hi}}),fi.exponent=function(t){return pi(64,t)-1023},fi.powerOf2=function(t){return Math.pow(2,t)},e(di.prototype,{getInterval:function(){return this.interval},getLevel:function(){return this.level},computeKey:function(t){for(this.level=di.computeLevel(t),this.interval=new hi,this.computeInterval(this.level,t);!this.interval.contains(t);)this.level+=1,this.computeInterval(this.level,t)},computeInterval:function(t,e){var n=fi.powerOf2(t);this.pt=Math.floor(e.getMin()/n)*n,this.interval.init(this.pt,this.pt+n)},getPoint:function(){return this.pt},interfaces_:function(){return[]},getClass:function(){return di}}),di.computeLevel=function(t){var e=t.getWidth();return fi.exponent(e)+1},c(gi,ci),e(gi.prototype,{getInterval:function(){return this.interval},find:function(t){var e=ci.getSubnodeIndex(t,this.centre);if(-1===e)return this;if(null!==this.subnode[e]){return this.subnode[e].find(t)}return this},insert:function(t){f.isTrue(null===this.interval||this.interval.contains(t.interval));var e=ci.getSubnodeIndex(t.interval,this.centre);if(t.level===this.level-1)this.subnode[e]=t;else{var n=this.createSubnode(e);n.insert(t),this.subnode[e]=n}},isSearchMatch:function(t){return t.overlaps(this.interval)},getSubnode:function(t){return null===this.subnode[t]&&(this.subnode[t]=this.createSubnode(t)),this.subnode[t]},getNode:function(t){var e=ci.getSubnodeIndex(t,this.centre);if(-1!==e){return this.getSubnode(e).getNode(t)}return this},createSubnode:function(t){var e=0,n=0;switch(t){case 0:e=this.interval.getMin(),n=this.centre;break;case 1:e=this.centre,n=this.interval.getMax()}return new gi(new hi(e,n),this.level-1)},interfaces_:function(){return[]},getClass:function(){return gi}}),gi.createNode=function(t){var e=new di(t);return new gi(e.getInterval(),e.getLevel())},gi.createExpanded=function(t,e){var n=new hi(e);null!==t&&n.expandToInclude(t.interval);var i=gi.createNode(n);return null!==t&&i.insert(t),i},e(vi.prototype,{interfaces_:function(){return[]},getClass:function(){return vi}});vi.isZeroWidth=function(t,e){var n=e-t;if(0===n)return!0;var i=Math.max(Math.abs(t),Math.abs(e)),r=n/i;return fi.exponent(r)<=vi.MIN_BINARY_EXPONENT},vi.MIN_BINARY_EXPONENT=-50,c(yi,ci),e(yi.prototype,{insert:function(t,e){var n=ci.getSubnodeIndex(t,yi.origin);if(-1===n)return this.add(e),null;var i=this.subnode[n];if(null===i||!i.getInterval().contains(t)){var r=gi.createExpanded(i,t);this.subnode[n]=r}this.insertContained(this.subnode[n],t,e)},isSearchMatch:function(t){return!0},insertContained:function(t,e,n){f.isTrue(t.getInterval().contains(e));var i=vi.isZeroWidth(e.getMin(),e.getMax()),r=null;r=i?t.find(e):t.getNode(e),r.add(n)},interfaces_:function(){return[]},getClass:function(){return yi}}),yi.origin=0,e(mi.prototype,{size:function(){return null!==this.root?this.root.size():0},insert:function(t,e){this.collectStats(t);var n=mi.ensureExtent(t,this.minExtent);this.root.insert(n,e)},query:function(){if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];return this.query(new hi(t,t))}if(arguments[0]instanceof hi){var e=arguments[0],n=new w;return this.query(e,n),n}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];this.root.addAllItemsFromOverlapping(i,r)}},iterator:function(){var t=new w;return this.root.addAllItems(t),t.iterator()},remove:function(t,e){var n=mi.ensureExtent(t,this.minExtent);return this.root.remove(n,e)},collectStats:function(t){var e=t.getWidth();e<this.minExtent&&e>0&&(this.minExtent=e)},depth:function(){return null!==this.root?this.root.depth():0},nodeSize:function(){return null!==this.root?this.root.nodeSize():0},interfaces_:function(){return[]},getClass:function(){return mi}}),mi.ensureExtent=function(t,e){var n=t.getMin(),i=t.getMax();return n!==i?t:(n===i&&(n-=e/2,i=n+e/2),new hi(n,i))},e(xi.prototype,{isInside:function(t){},interfaces_:function(){return[]},getClass:function(){return xi}}),e(Ei.prototype,{testLineSegment:function(t,e){var n=null,i=null,r=null,o=null,s=e.p0,a=e.p1;n=s.x-t.x,i=s.y-t.y,r=a.x-t.x,o=a.y-t.y,(i>0&&o<=0||o>0&&i<=0)&&0<ae.signOfDet2x2(n,i,r,o)/(o-i)&&this.crossings++},buildIndex:function(){this.tree=new mi;for(var t=U.removeRepeatedPoints(this.ring.getCoordinates()),e=Qe.getChains(t),n=0;n<e.size();n++){var i=e.get(n),r=i.getEnvelope();this.interval.min=r.getMinY(),this.interval.max=r.getMaxY(),this.tree.insert(this.interval,i)}},testMonotoneChain:function(t,e,n){n.select(t,e)},isInside:function(t){this.crossings=0;var e=new I(r.NEGATIVE_INFINITY,r.POSITIVE_INFINITY,t.y,t.y);this.interval.min=t.y,this.interval.max=t.y;for(var n=this.tree.query(this.interval),i=new wi(this,t),o=n.iterator();o.hasNext();){var s=o.next();this.testMonotoneChain(e,i,s)}return this.crossings%2==1},interfaces_:function(){return[xi]},getClass:function(){return Ei}}),c(wi,li),e(wi.prototype,{select:function(){if(1!==arguments.length)return li.prototype.select.apply(this,arguments);var t=arguments[0];this.mcp.testLineSegment(this.p,t)},interfaces_:function(){return[]},getClass:function(){return wi}}),Ei.MCSelecter=wi,e(bi.prototype,{interfaces_:function(){return[]},getClass:function(){return bi}}),bi.toDegrees=function(t){return 180*t/Math.PI},bi.normalize=function(t){for(;t>Math.PI;)t-=bi.PI_TIMES_2;for(;t<=-Math.PI;)t+=bi.PI_TIMES_2;return t},bi.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],n=arguments[1],i=n.x-e.x,r=n.y-e.y;return Math.atan2(r,i)}},bi.isAcute=function(t,e,n){var i=t.x-e.x,r=t.y-e.y;return i*(n.x-e.x)+r*(n.y-e.y)>0},bi.isObtuse=function(t,e,n){var i=t.x-e.x,r=t.y-e.y;return i*(n.x-e.x)+r*(n.y-e.y)<0},bi.interiorAngle=function(t,e,n){var i=bi.angle(e,t),r=bi.angle(e,n);return Math.abs(r-i)},bi.normalizePositive=function(t){if(t<0){for(;t<0;)t+=bi.PI_TIMES_2;t>=bi.PI_TIMES_2&&(t=0)}else{for(;t>=bi.PI_TIMES_2;)t-=bi.PI_TIMES_2;t<0&&(t=0)}return t},bi.angleBetween=function(t,e,n){var i=bi.angle(e,t),r=bi.angle(e,n);return bi.diff(i,r)},bi.diff=function(t,e){var n=null;return n=t<e?e-t:t-e,n>Math.PI&&(n=2*Math.PI-n),n},bi.toRadians=function(t){return t*Math.PI/180},bi.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?bi.COUNTERCLOCKWISE:n<0?bi.CLOCKWISE:bi.NONE},bi.angleBetweenOriented=function(t,e,n){var i=bi.angle(e,t),r=bi.angle(e,n),o=r-i;return o<=-Math.PI?o+bi.PI_TIMES_2:o>Math.PI?o-bi.PI_TIMES_2:o},bi.PI_TIMES_2=2*Math.PI,bi.PI_OVER_2=Math.PI/2,bi.PI_OVER_4=Math.PI/4,bi.COUNTERCLOCKWISE=le.COUNTERCLOCKWISE,bi.CLOCKWISE=le.CLOCKWISE,bi.NONE=le.COLLINEAR,e(Ii.prototype,{area:function(){return Ii.area(this.p0,this.p1,this.p2)},signedArea:function(){return Ii.signedArea(this.p0,this.p1,this.p2)},interpolateZ:function(t){if(null===t)throw new i("Supplied point is null.");return Ii.interpolateZ(t,this.p0,this.p1,this.p2)},longestSideLength:function(){return Ii.longestSideLength(this.p0,this.p1,this.p2)},isAcute:function(){return Ii.isAcute(this.p0,this.p1,this.p2)},circumcentre:function(){return Ii.circumcentre(this.p0,this.p1,this.p2)},area3D:function(){return Ii.area3D(this.p0,this.p1,this.p2)},centroid:function(){return Ii.centroid(this.p0,this.p1,this.p2)},inCentre:function(){return Ii.inCentre(this.p0,this.p1,this.p2)},interfaces_:function(){return[]},getClass:function(){return Ii}}),Ii.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},Ii.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},Ii.det=function(t,e,n,i){return t*i-e*n},Ii.interpolateZ=function(t,e,n,i){var r=e.x,o=e.y,s=n.x-r,a=i.x-r,u=n.y-o,l=i.y-o,c=s*l-a*u,h=t.x-r,f=t.y-o,p=(l*h-a*f)/c,d=(-u*h+s*f)/c;return e.z+p*(n.z-e.z)+d*(i.z-e.z)},Ii.longestSideLength=function(t,e,n){var i=t.distance(e),r=e.distance(n),o=n.distance(t),s=i;return r>s&&(s=r),o>s&&(s=o),s},Ii.isAcute=function(t,e,n){return!!bi.isAcute(t,e,n)&&!!bi.isAcute(e,n,t)&&!!bi.isAcute(n,t,e)},Ii.circumcentre=function(t,e,n){var i=n.x,r=n.y,o=t.x-i,s=t.y-r,a=e.x-i,u=e.y-r,l=2*Ii.det(o,s,a,u);return new p(i-Ii.det(s,o*o+s*s,u,a*a+u*u)/l,r+Ii.det(o,o*o+s*s,a,a*a+u*u)/l)},Ii.perpendicularBisector=function(t,e){var n=e.x-t.x,i=e.y-t.y;return new F(new F(t.x+n/2,t.y+i/2,1),new F(t.x-i+n/2,t.y+n+i/2,1))},Ii.angleBisector=function(t,e,n){var i=e.distance(t),r=e.distance(n),o=i/(i+r),s=n.x-t.x,a=n.y-t.y;return new p(t.x+o*s,t.y+o*a)},Ii.area3D=function(t,e,n){var i=e.x-t.x,r=e.y-t.y,o=e.z-t.z,s=n.x-t.x,a=n.y-t.y,u=n.z-t.z,l=r*u-o*a,c=o*s-i*u,h=i*a-r*s,f=l*l+c*c+h*h;return Math.sqrt(f)/2},Ii.centroid=function(t,e,n){return new p((t.x+e.x+n.x)/3,(t.y+e.y+n.y)/3)},Ii.inCentre=function(t,e,n){var i=e.distance(n),r=t.distance(n),o=t.distance(e),s=i+r+o;return new p((i*t.x+r*e.x+o*n.x)/s,(i*t.y+r*e.y+o*n.y)/s)},e(Ni.prototype,{getRadius:function(){return this.compute(),this.radius},getDiameter:function(){switch(this.compute(),this.extremalPts.length){case 0:return this.input.getFactory().createLineString();case 1:return this.input.getFactory().createPoint(this.centre)}var t=this.extremalPts[0],e=this.extremalPts[1];return this.input.getFactory().createLineString([t,e])},getExtremalPoints:function(){return this.compute(),this.extremalPts},computeCirclePoints:function(){if(this.input.isEmpty())return this.extremalPts=new Array(0).fill(null),null;if(1===this.input.getNumPoints()){var t=this.input.getCoordinates();return this.extremalPts=[new p(t[0])],null}var e=this.input.convexHull(),n=e.getCoordinates(),t=n;if(n[0].equals2D(n[n.length-1])&&(t=new Array(n.length-1).fill(null),U.copyDeep(n,0,t,0,n.length-1)),t.length<=2)return this.extremalPts=U.copyDeep(t),null;for(var i=Ni.lowestPoint(t),r=Ni.pointWitMinAngleWithX(t,i),o=0;o<t.length;o++){var s=Ni.pointWithMinAngleWithSegment(t,i,r);if(bi.isObtuse(i,s,r))return this.extremalPts=[new p(i),new p(r)],null;if(bi.isObtuse(s,i,r))i=s;else{if(!bi.isObtuse(s,r,i))return this.extremalPts=[new p(i),new p(r),new p(s)],null;r=s}}f.shouldNeverReachHere("Logic failure in Minimum Bounding Circle algorithm!")},compute:function(){return null!==this.extremalPts?null:(this.computeCirclePoints(),this.computeCentre(),void(null!==this.centre&&(this.radius=this.centre.distance(this.extremalPts[0]))))},getFarthestPoints:function(){switch(this.compute(),this.extremalPts.length){case 0:return this.input.getFactory().createLineString();case 1:return this.input.getFactory().createPoint(this.centre)}var t=this.extremalPts[0],e=this.extremalPts[this.extremalPts.length-1];return this.input.getFactory().createLineString([t,e])},getCircle:function(){if(this.compute(),null===this.centre)return this.input.getFactory().createPolygon();var t=this.input.getFactory().createPoint(this.centre);return 0===this.radius?t:t.buffer(this.radius)},getCentre:function(){return this.compute(),this.centre},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 p((this.extremalPts[0].x+this.extremalPts[1].x)/2,(this.extremalPts[0].y+this.extremalPts[1].y)/2);break;case 3:this.centre=Ii.circumcentre(this.extremalPts[0],this.extremalPts[1],this.extremalPts[2])}},interfaces_:function(){return[]},getClass:function(){return Ni}}),Ni.pointWitMinAngleWithX=function(t,e){for(var n=r.MAX_VALUE,i=null,o=0;o<t.length;o++){var s=t[o];if(s!==e){var a=s.x-e.x,u=s.y-e.y;u<0&&(u=-u);var l=Math.sqrt(a*a+u*u),c=u/l;c<n&&(n=c,i=s)}}return i},Ni.lowestPoint=function(t){for(var e=t[0],n=1;n<t.length;n++)t[n].y<e.y&&(e=t[n]);return e},Ni.pointWithMinAngleWithSegment=function(t,e,n){for(var i=r.MAX_VALUE,o=null,s=0;s<t.length;s++){var a=t[s];if(a!==e&&a!==n){var u=bi.angleBetween(e,a,n);u<i&&(i=u,o=a)}}return o},e(Ci.prototype,{getWidthCoordinate:function(){return this.computeMinimumDiameter(),this.minWidthPt},getSupportingSegment:function(){return this.computeMinimumDiameter(),this.inputGeom.getFactory().createLineString([this.minBaseSeg.p0,this.minBaseSeg.p1])},getDiameter:function(){if(this.computeMinimumDiameter(),null===this.minWidthPt)return this.inputGeom.getFactory().createLineString(null);var t=this.minBaseSeg.project(this.minWidthPt);return this.inputGeom.getFactory().createLineString([t,this.minWidthPt])},computeWidthConvex:function(t){this.convexHullPts=t instanceof Lt?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)},computeConvexRingMinDiameter:function(t){this.minWidth=r.MAX_VALUE;for(var e=1,n=new ce,i=0;i<t.length-1;i++)n.p0=t[i],n.p1=t[i+1],e=this.findMaxPerpDistance(t,n,e)},computeMinimumDiameter:function(){if(null!==this.minWidthPt)return null;if(this.isConvex)this.computeWidthConvex(this.inputGeom);else{var t=new ve(this.inputGeom).getConvexHull();this.computeWidthConvex(t)}},getLength:function(){return this.computeMinimumDiameter(),this.minWidth},findMaxPerpDistance:function(t,e,n){for(var i=e.distancePerpendicular(t[n]),r=i,o=n,s=o;r>=i;)i=r,o=s,s=Ci.nextIndex(t,o),r=e.distancePerpendicular(t[s]);return i<this.minWidth&&(this.minPtIndex=o,this.minWidth=i,this.minWidthPt=t[this.minPtIndex],this.minBaseSeg=new ce(e)),o},getMinimumRectangle:function(){if(this.computeMinimumDiameter(),0===this.minWidth)return this.minBaseSeg.p0.equals2D(this.minBaseSeg.p1)?this.inputGeom.getFactory().createPoint(this.minBaseSeg.p0):this.minBaseSeg.toGeometry(this.inputGeom.getFactory());for(var t=this.minBaseSeg.p1.x-this.minBaseSeg.p0.x,e=this.minBaseSeg.p1.y-this.minBaseSeg.p0.y,n=r.MAX_VALUE,i=-r.MAX_VALUE,o=r.MAX_VALUE,s=-r.MAX_VALUE,a=0;a<this.convexHullPts.length;a++){var u=Ci.computeC(t,e,this.convexHullPts[a]);u>i&&(i=u),u<n&&(n=u);var l=Ci.computeC(-e,t,this.convexHullPts[a]);l>s&&(s=l),l<o&&(o=l)}var c=Ci.computeSegmentForLine(-t,-e,s),h=Ci.computeSegmentForLine(-t,-e,o),f=Ci.computeSegmentForLine(-e,t,i),p=Ci.computeSegmentForLine(-e,t,n),d=f.lineIntersection(c),g=p.lineIntersection(c),v=p.lineIntersection(h),y=f.lineIntersection(h),m=this.inputGeom.getFactory().createLinearRing([d,g,v,y,d]);return this.inputGeom.getFactory().createPolygon(m,null)},interfaces_:function(){return[]},getClass:function(){return Ci}}),Ci.nextIndex=function(t,e){return e++,e>=t.length&&(e=0),e},Ci.computeC=function(t,e,n){return t*n.y-e*n.x},Ci.getMinimumDiameter=function(t){return new Ci(t).getDiameter()},Ci.getMinimumRectangle=function(t){return new Ci(t).getMinimumRectangle()},Ci.computeSegmentForLine=function(t,e,n){var i=null,r=null;return Math.abs(e)>Math.abs(t)?(i=new p(0,n/e),r=new p(1,n/e-t/e)):(i=new p(n/t,0),r=new p(n/t-e/t,1)),new ce(i,r)};var cs=Object.freeze({Centroid:fe,CGAlgorithms:le,ConvexHull:ve,InteriorPointArea:oi,InteriorPointLine:ai,InteriorPointPoint:ui,RobustLineIntersector:se,MCPointInRing:Ei,MinimumBoundingCircle:Ni,MinimumDiameter:Ci});e(Si.prototype,{getResultGeometry:function(){return new Mi(this.distanceTolerance).transform(this.inputGeom)},setDistanceTolerance:function(t){if(t<=0)throw new i("Tolerance must be positive");this.distanceTolerance=t},interfaces_:function(){return[]},getClass:function(){return Si}}),Si.densifyPoints=function(t,e,n){for(var i=new ce,r=new b,o=0;o<t.length-1;o++){i.p0=t[o],i.p1=t[o+1],r.add(i.p0,!1);var s=i.getLength(),a=Math.trunc(s/e)+1;if(a>1)for(var u=s/a,l=1;l<a;l++){var c=l*u/s,h=i.pointAlong(c);n.makePrecise(h),r.add(h,!1)}}return r.add(t[t.length-1],!1),r.toCoordinateArray()},Si.densify=function(t,e){var n=new Si(t);return n.setDistanceTolerance(e),n.getResultGeometry()},c(Mi,me),e(Mi.prototype,{transformMultiPolygon:function(t,e){var n=me.prototype.transformMultiPolygon.call(this,t,e);return this.createValidArea(n)},transformPolygon:function(t,e){var n=me.prototype.transformPolygon.call(this,t,e);return e instanceof Tt?n:this.createValidArea(n)},transformCoordinates:function(t,e){var n=t.toCoordinateArray(),i=Si.densifyPoints(n,this.distanceTolerance,e.getPrecisionModel());return e instanceof Nt&&1===i.length&&(i=new Array(0).fill(null)),this.factory.getCoordinateSequenceFactory().create(i)},createValidArea:function(t){return t.buffer(0)},interfaces_:function(){return[]},getClass:function(){return Mi}}),Si.DensifyTransformer=Mi;var hs=Object.freeze({Densifier:Si});e(Li.prototype,{find:function(t){var e=this;do{if(null===e)return null;if(e.dest().equals2D(t))return e;e=e.oNext()}while(e!==this);return null},dest:function(){return this._sym._orig},oNext:function(){return this._sym._next},insert:function(t){if(this.oNext()===this)return this.insertAfter(t),null;var e=this.compareTo(t),n=this;do{var i=n.oNext();if(i.compareTo(t)!==e||i===this)return n.insertAfter(t),null;n=i}while(n!==this);f.shouldNeverReachHere()},insertAfter:function(t){f.equals(this._orig,t.orig());var e=this.oNext();this._sym.setNext(t),t.sym().setNext(e)},degree:function(){var t=0,e=this;do{t++,e=e.oNext()}while(e!==this);return t},equals:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this._orig.equals2D(t)&&this._sym._orig.equals(e)}},deltaY:function(){return this._sym._orig.y-this._orig.y},sym:function(){return this._sym},prev:function(){return this._sym.next()._sym},compareAngularDirection:function(t){
var e=this.deltaX(),n=this.deltaY(),i=t.deltaX(),r=t.deltaY();if(e===i&&n===r)return 0;var o=Ke.quadrant(e,n),s=Ke.quadrant(i,r);return o>s?1:o<s?-1:le.computeOrientation(t._orig,t.dest(),this.dest())},prevNode:function(){for(var t=this;2===t.degree();)if((t=t.prev())===this)return null;return t},compareTo:function(t){var e=t;return this.compareAngularDirection(e)},next:function(){return this._next},setSym:function(t){this._sym=t},orig:function(){return this._orig},toString:function(){return"HE("+this._orig.x+" "+this._orig.y+", "+this._sym._orig.x+" "+this._sym._orig.y+")"},setNext:function(t){this._next=t},init:function(t){this.setSym(t),t.setSym(this),this.setNext(t),t.setNext(this)},deltaX:function(){return this._sym._orig.x-this._orig.x},interfaces_:function(){return[]},getClass:function(){return Li}}),Li.init=function(t,e){if(null!==t._sym||null!==e._sym||null!==t._next||null!==e._next)throw new IllegalStateException("Edges are already initialized");return t.init(e),t},Li.create=function(t,e){var n=new Li(t),i=new Li(e);return n.init(i),n},c(Ri,Li),e(Ri.prototype,{mark:function(){this._isMarked=!0},setMark:function(t){this._isMarked=t},isMarked:function(){return this._isMarked},interfaces_:function(){return[]},getClass:function(){return Ri}}),Ri.setMarkBoth=function(t,e){t.setMark(e),t.sym().setMark(e)},Ri.isMarked=function(t){return t.isMarked()},Ri.setMark=function(t,e){t.setMark(e)},Ri.markBoth=function(t){t.mark(),t.sym().mark()},Ri.mark=function(t){t.mark()},e(Pi.prototype,{insert:function(t,e,n){var i=this.create(t,e);null!==n?n.insert(i):this.vertexMap.put(t,i);var r=this.vertexMap.get(e);return null!==r?r.insert(i.sym()):this.vertexMap.put(e,i.sym()),i},create:function(t,e){var n=this.createEdge(t),i=this.createEdge(e);return Li.init(n,i),n},createEdge:function(t){return new Li(t)},addEdge:function(t,e){if(!Pi.isValidEdge(t,e))return null;var n=this.vertexMap.get(t),i=null;return null!==n&&(i=n.find(e)),null!==i?i:this.insert(t,e,n)},getVertexEdges:function(){return this.vertexMap.values()},findEdge:function(t,e){var n=this.vertexMap.get(t);return null===n?null:n.find(e)},interfaces_:function(){return[]},getClass:function(){return Pi}}),Pi.isValidEdge=function(t,e){return 0!==e.compareTo(t)},c(Ti,Ri),e(Ti.prototype,{setStart:function(){this._isStart=!0},isStart:function(){return this._isStart},interfaces_:function(){return[]},getClass:function(){return Ti}}),c(Oi,Pi),e(Oi.prototype,{createEdge:function(t){return new Ti(t)},interfaces_:function(){return[]},getClass:function(){return Oi}}),e(_i.prototype,{addLine:function(t){this.lines.add(this.factory.createLineString(t.toCoordinateArray()))},updateRingStartEdge:function(t){return t.isStart()||(t=t.sym(),t.isStart())?null===this.ringStartEdge?(this.ringStartEdge=t,null):void(t.orig().compareTo(this.ringStartEdge.orig())<0&&(this.ringStartEdge=t)):null},getResult:function(){return null===this.result&&this.computeResult(),this.result},process:function(t){var e=t.prevNode();null===e&&(e=t),this.stackEdges(e),this.buildLines()},buildRing:function(t){var e=new b,n=t;for(e.add(n.orig().copy(),!1);2===n.sym().degree();){var i=n.next();if(i===t)break;e.add(i.orig().copy(),!1),n=i}e.add(n.dest().copy(),!1),this.addLine(e)},buildLine:function(t){var e=new b,n=t;for(this.ringStartEdge=null,Ri.markBoth(n),e.add(n.orig().copy(),!1);2===n.sym().degree();){this.updateRingStartEdge(n);var i=n.next();if(i===t)return this.buildRing(this.ringStartEdge),null;e.add(i.orig().copy(),!1),n=i,Ri.markBoth(n)}e.add(n.dest().copy(),!1),this.stackEdges(n.sym()),this.addLine(e)},stackEdges:function(t){var e=t;do{Ri.isMarked(e)||this.nodeEdgeStack.add(e),e=e.oNext()}while(e!==t)},computeResult:function(){for(var t=this.graph.getVertexEdges(),e=t.iterator();e.hasNext();){var n=e.next();Ri.isMarked(n)||this.process(n)}this.result=this.factory.buildGeometry(this.lines)},buildLines:function(){for(;!this.nodeEdgeStack.empty();){var t=this.nodeEdgeStack.pop();Ri.isMarked(t)||this.buildLine(t)}},add:function(){if(arguments[0]instanceof G){arguments[0].apply({interfaces_:function(){return[k]},filter:function(t){t instanceof Nt&&this.add(t)}})}else if(M(arguments[0],v))for(var t=arguments[0],e=t.iterator();e.hasNext();){var n=e.next();this.add(n)}else if(arguments[0]instanceof Nt){var i=arguments[0];null===this.factory&&(this.factory=i.getFactory());for(var r=i.getCoordinateSequence(),o=!1,e=1;e<r.size();e++){var s=this.graph.addEdge(r.getCoordinate(e-1),r.getCoordinate(e));null!==s&&(o||(s.setStart(),o=!0))}}},interfaces_:function(){return[]},getClass:function(){return _i}}),_i.dissolve=function(t){var e=new _i;return e.add(t),e.getResult()};var fs=Object.freeze({LineDissolver:_i}),ps=Object.freeze({GeometryGraph:Qn});e(Ai.prototype,{hasChildren:function(){for(var t=0;t<4;t++)if(null!==this.subnode[t])return!0;return!1},isPrunable:function(){return!(this.hasChildren()||this.hasItems())},addAllItems:function(t){t.addAll(this.items);for(var e=0;e<4;e++)null!==this.subnode[e]&&this.subnode[e].addAllItems(t);return t},getNodeCount:function(){for(var t=0,e=0;e<4;e++)null!==this.subnode[e]&&(t+=this.subnode[e].size());return t+1},size:function(){for(var t=0,e=0;e<4;e++)null!==this.subnode[e]&&(t+=this.subnode[e].size());return t+this.items.size()},addAllItemsFromOverlapping:function(t,e){if(!this.isSearchMatch(t))return null;e.addAll(this.items);for(var n=0;n<4;n++)null!==this.subnode[n]&&this.subnode[n].addAllItemsFromOverlapping(t,e)},visitItems:function(t,e){for(var n=this.items.iterator();n.hasNext();)e.visitItem(n.next())},hasItems:function(){return!this.items.isEmpty()},remove:function(t,e){if(!this.isSearchMatch(t))return!1;for(var n=!1,i=0;i<4;i++)if(null!==this.subnode[i]&&(n=this.subnode[i].remove(t,e))){this.subnode[i].isPrunable()&&(this.subnode[i]=null);break}return n||(n=this.items.remove(e))},visit:function(t,e){if(!this.isSearchMatch(t))return null;this.visitItems(t,e);for(var n=0;n<4;n++)null!==this.subnode[n]&&this.subnode[n].visit(t,e)},getItems:function(){return this.items},depth:function(){for(var t=0,e=0;e<4;e++)if(null!==this.subnode[e]){var n=this.subnode[e].depth();n>t&&(t=n)}return t+1},isEmpty:function(){var t=!0;this.items.isEmpty()||(t=!1);for(var e=0;e<4;e++)null!==this.subnode[e]&&(this.subnode[e].isEmpty()||(t=!1));return t},add:function(t){this.items.add(t)},interfaces_:function(){return[u]},getClass:function(){return Ai}}),Ai.getSubnodeIndex=function(t,e,n){var i=-1;return t.getMinX()>=e&&(t.getMinY()>=n&&(i=3),t.getMaxY()<=n&&(i=1)),t.getMaxX()<=e&&(t.getMinY()>=n&&(i=2),t.getMaxY()<=n&&(i=0)),i},e(Di.prototype,{getLevel:function(){return this.level},computeKey:function(){if(1===arguments.length){var t=arguments[0];for(this.level=Di.computeQuadLevel(t),this.env=new I,this.computeKey(this.level,t);!this.env.contains(t);)this.level+=1,this.computeKey(this.level,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],i=fi.powerOf2(e);this.pt.x=Math.floor(n.getMinX()/i)*i,this.pt.y=Math.floor(n.getMinY()/i)*i,this.env.init(this.pt.x,this.pt.x+i,this.pt.y,this.pt.y+i)}},getEnvelope:function(){return this.env},getCentre:function(){return new p((this.env.getMinX()+this.env.getMaxX())/2,(this.env.getMinY()+this.env.getMaxY())/2)},getPoint:function(){return this.pt},interfaces_:function(){return[]},getClass:function(){return Di}}),Di.computeQuadLevel=function(t){var e=t.getWidth(),n=t.getHeight(),i=e>n?e:n;return fi.exponent(i)+1},c(Fi,Ai),e(Fi.prototype,{find:function(t){var e=Ai.getSubnodeIndex(t,this.centrex,this.centrey);if(-1===e)return this;if(null!==this.subnode[e]){return this.subnode[e].find(t)}return this},isSearchMatch:function(t){return this.env.intersects(t)},getSubnode:function(t){return null===this.subnode[t]&&(this.subnode[t]=this.createSubnode(t)),this.subnode[t]},getEnvelope:function(){return this.env},getNode:function(t){var e=Ai.getSubnodeIndex(t,this.centrex,this.centrey);if(-1!==e){return this.getSubnode(e).getNode(t)}return this},createSubnode:function(t){var e=0,n=0,i=0,r=0;switch(t){case 0:e=this.env.getMinX(),n=this.centrex,i=this.env.getMinY(),r=this.centrey;break;case 1:e=this.centrex,n=this.env.getMaxX(),i=this.env.getMinY(),r=this.centrey;break;case 2:e=this.env.getMinX(),n=this.centrex,i=this.centrey,r=this.env.getMaxY();break;case 3:e=this.centrex,n=this.env.getMaxX(),i=this.centrey,r=this.env.getMaxY()}return new Fi(new I(e,n,i,r),this.level-1)},insertNode:function(t){f.isTrue(null===this.env||this.env.contains(t.env));var e=Ai.getSubnodeIndex(t.env,this.centrex,this.centrey);if(t.level===this.level-1)this.subnode[e]=t;else{var n=this.createSubnode(e);n.insertNode(t),this.subnode[e]=n}},interfaces_:function(){return[]},getClass:function(){return Fi}}),Fi.createNode=function(t){var e=new Di(t);return new Fi(e.getEnvelope(),e.getLevel())},Fi.createExpanded=function(t,e){var n=new I(e);null!==t&&n.expandToInclude(t.env);var i=Fi.createNode(n);return null!==t&&i.insertNode(t),i},c(qi,Ai),e(qi.prototype,{insert:function(t,e){var n=Ai.getSubnodeIndex(t,qi.origin.x,qi.origin.y);if(-1===n)return this.add(e),null;var i=this.subnode[n];if(null===i||!i.getEnvelope().contains(t)){var r=Fi.createExpanded(i,t);this.subnode[n]=r}this.insertContained(this.subnode[n],t,e)},isSearchMatch:function(t){return!0},insertContained:function(t,e,n){f.isTrue(t.getEnvelope().contains(e));var i=vi.isZeroWidth(e.getMinX(),e.getMaxX()),r=vi.isZeroWidth(e.getMinY(),e.getMaxY()),o=null;o=i||r?t.find(e):t.getNode(e),o.add(n)},interfaces_:function(){return[]},getClass:function(){return qi}}),qi.origin=new p(0,0),e(ki.prototype,{size:function(){return null!==this.root?this.root.size():0},insert:function(t,e){this.collectStats(t);var n=ki.ensureExtent(t,this.minExtent);this.root.insert(n,e)},query:function(){if(1===arguments.length){var t=arguments[0],e=new zn;return this.query(t,e),e.getItems()}if(2===arguments.length){var n=arguments[0],i=arguments[1];this.root.visit(n,i)}},queryAll:function(){var t=new w;return this.root.addAllItems(t),t},remove:function(t,e){var n=ki.ensureExtent(t,this.minExtent);return this.root.remove(n,e)},collectStats:function(t){var e=t.getWidth();e<this.minExtent&&e>0&&(this.minExtent=e);var n=t.getHeight();n<this.minExtent&&n>0&&(this.minExtent=n)},depth:function(){return null!==this.root?this.root.depth():0},isEmpty:function(){return null===this.root},interfaces_:function(){return[De,u]},getClass:function(){return ki}}),ki.ensureExtent=function(t,e){var n=t.getMinX(),i=t.getMaxX(),r=t.getMinY(),o=t.getMaxY();return n!==i&&r!==o?t:(n===i&&(n-=e/2,i=n+e/2),r===o&&(r-=e/2,o=r+e/2),new I(n,i,r,o))},ki.serialVersionUID=-0x678b60c967a25400;var ds=Object.freeze({Quadtree:ki}),gs=Object.freeze({STRtree:Be}),vs=Object.freeze({quadtree:ds,strtree:gs}),ys=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"];e(Gi.prototype,{read:function(t){var e=void 0;e="string"==typeof t?JSON.parse(t):t;var n=e.type;if(!ms[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==ys.indexOf(n)?ms[n].apply(this,[e.coordinates]):"GeometryCollection"===n?ms[n].apply(this,[e.geometries]):ms[n].apply(this,[e])},write:function(t){var e=t.getGeometryType();if(!xs[e])throw new Error("Geometry is not supported");return xs[e].apply(this,[t])}});var ms={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var i=t.geometry.type;if(!ms[i])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=ms.bbox.apply(this,[t.bbox])),e},FeatureCollection:function(t){var e={};if(t.features){e.features=[];for(var n=0;n<t.features.length;++n)e.features.push(this.read(t.features[n]))}return t.bbox&&(e.bbox=this.parse.bbox.apply(this,[t.bbox])),e},coordinates:function(t){for(var e=[],n=0;n<t.length;++n){var i=t[n];e.push(new p(i[0],i[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new p(t[0],t[1]),new p(t[2],t[1]),new p(t[2],t[3]),new p(t[0],t[3]),new p(t[0],t[1])])},Point:function(t){var e=new p(t[0],t[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],n=0;n<t.length;++n)e.push(ms.Point.apply(this,[t[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=ms.coordinates.apply(this,[t]);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],n=0;n<t.length;++n)e.push(ms.LineString.apply(this,[t[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=ms.coordinates.apply(this,[t[0]]),n=this.geometryFactory.createLinearRing(e),i=[],r=1;r<t.length;++r){var o=t[r],s=ms.coordinates.apply(this,[o]),a=this.geometryFactory.createLinearRing(s);i.push(a)}return this.geometryFactory.createPolygon(n,i)},MultiPolygon:function(t){for(var e=[],n=0;n<t.length;++n){var i=t[n];e.push(ms.Polygon.apply(this,[i]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(t){for(var e=[],n=0;n<t.length;++n){var i=t[n];e.push(this.read(i))}return this.geometryFactory.createGeometryCollection(e)}},xs={coordinate:function(t){return[t.x,t.y]},Point:function(t){return{type:"Point",coordinates:xs.coordinate.apply(this,[t.getCoordinate()])}},MultiPoint:function(t){for(var e=[],n=0;n<t.geometries.length;++n){var i=t.geometries[n],r=xs.Point.apply(this,[i]);e.push(r.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(t){for(var e=[],n=t.getCoordinates(),i=0;i<n.length;++i){var r=n[i];e.push(xs.coordinate.apply(this,[r]))}return{type:"LineString",coordinates:e}},MultiLineString:function(t){for(var e=[],n=0;n<t.geometries.length;++n){var i=t.geometries[n],r=xs.LineString.apply(this,[i]);e.push(r.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=xs.LineString.apply(this,[t.shell]);e.push(n.coordinates);for(var i=0;i<t.holes.length;++i){var r=t.holes[i],o=xs.LineString.apply(this,[r]);e.push(o.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(t){for(var e=[],n=0;n<t.geometries.length;++n){var i=t.geometries[n],r=xs.Polygon.apply(this,[i]);e.push(r.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(t){for(var e=[],n=0;n<t.geometries.length;++n){var i=t.geometries[n],r=i.getGeometryType();e.push(xs[r].apply(this,[i]))}return{type:"GeometryCollection",geometries:e}}};e(ji.prototype,{read:function(t){var e=this.parser.read(t);return this.precisionModel.getType()===te.FIXED&&this.reducePrecision(e),e},reducePrecision:function(t){var e,n;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(e=0,n=t.points.length;e<n;e++)this.precisionModel.makePrecise(t.points[e]);else if(t.geometries)for(e=0,n=t.geometries.length;e<n;e++)this.reducePrecision(t.geometries[e])}}),e(Bi.prototype,{write:function(t){return this.parser.write(t)}}),e(zi.prototype,{read:function(t){var e=this.parser.read(t);return this.precisionModel.getType()===te.FIXED&&this.reducePrecision(e),e},reducePrecision:function(t){if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(var e=0,n=t.points.coordinates.length;e<n;e++)this.precisionModel.makePrecise(t.points.coordinates[e]);else if(t.geometries)for(var i=0,r=t.geometries.length;i<r;i++)this.reducePrecision(t.geometries[i])}}),e(Xi.prototype,{read:function(t){var e=this.ol;return t instanceof e.geom.Point?this.convertFromPoint(t):t instanceof e.geom.LineString?this.convertFromLineString(t):t instanceof e.geom.LinearRing?this.convertFromLinearRing(t):t instanceof e.geom.Polygon?this.convertFromPolygon(t):t instanceof e.geom.MultiPoint?this.convertFromMultiPoint(t):t instanceof e.geom.MultiLineString?this.convertFromMultiLineString(t):t instanceof e.geom.MultiPolygon?this.convertFromMultiPolygon(t):t instanceof e.geom.GeometryCollection?this.convertFromCollection(t):void 0},convertFromPoint:function(t){var e=t.getCoordinates();return this.geometryFactory.createPoint(new p(e[0],e[1]))},convertFromLineString:function(t){return this.geometryFactory.createLineString(t.getCoordinates().map(function(t){return new p(t[0],t[1])}))},convertFromLinearRing:function(t){return this.geometryFactory.createLinearRing(t.getCoordinates().map(function(t){return new p(t[0],t[1])}))},convertFromPolygon:function(t){for(var e=t.getLinearRings(),n=null,i=[],r=0;r<e.length;r++){var o=this.convertFromLinearRing(e[r]);0===r?n=o:i.push(o)}return this.geometryFactory.createPolygon(n,i)},convertFromMultiPoint:function(t){var e=t.getPoints().map(function(t){return this.convertFromPoint(t)},this);return this.geometryFactory.createMultiPoint(e)},convertFromMultiLineString:function(t){var e=t.getLineStrings().map(function(t){return this.convertFromLineString(t)},this);return this.geometryFactory.createMultiLineString(e)},convertFromMultiPolygon:function(t){var e=t.getPolygons().map(function(t){return this.convertFromPolygon(t)},this);return this.geometryFactory.createMultiPolygon(e)},convertFromCollection:function(t){var e=t.getGeometries().map(function(t){return this.read(t)},this);return this.geometryFactory.createGeometryCollection(e)},write:function(t){return"Point"===t.getGeometryType()?this.convertToPoint(t.getCoordinate()):"LineString"===t.getGeometryType()?this.convertToLineString(t):"LinearRing"===t.getGeometryType()?this.convertToLinearRing(t):"Polygon"===t.getGeometryType()?this.convertToPolygon(t):"MultiPoint"===t.getGeometryType()?this.convertToMultiPoint(t):"MultiLineString"===t.getGeometryType()?this.convertToMultiLineString(t):"MultiPolygon"===t.getGeometryType()?this.convertToMultiPolygon(t):"GeometryCollection"===t.getGeometryType()?this.convertToCollection(t):void 0},convertToPoint:function(t){return new this.ol.geom.Point([t.x,t.y])},convertToLineString:function(t){var e=t.points.coordinates.map(Vi);return new this.ol.geom.LineString(e)},convertToLinearRing:function(t){var e=t.points.coordinates.map(Vi);return new this.ol.geom.LinearRing(e)},convertToPolygon:function(t){for(var e=[t.shell.points.coordinates.map(Vi)],n=0;n<t.holes.length;n++)e.push(t.holes[n].points.coordinates.map(Vi));return new this.ol.geom.Polygon(e)},convertToMultiPoint:function(t){return new this.ol.geom.MultiPoint(t.getCoordinates().map(Vi))},convertToMultiLineString:function(t){for(var e=[],n=0;n<t.geometries.length;n++)e.push(this.convertToLineString(t.geometries[n]).getCoordinates());return new this.ol.geom.MultiLineString(e)},convertToMultiPolygon:function(t){for(var e=[],n=0;n<t.geometries.length;n++)e.push(this.convertToPolygon(t.geometries[n]).getCoordinates());return new this.ol.geom.MultiPolygon(e)},convertToCollection:function(t){for(var e=[],n=0;n<t.geometries.length;n++){var i=t.geometries[n];e.push(this.write(i))}return new this.ol.geom.GeometryCollection(e)}});var Es=Object.freeze({GeoJSONReader:ji,GeoJSONWriter:Bi,OL3Parser:Xi,WKTReader:zi,WKTWriter:re});e(Yi.prototype,{rescale:function(){if(M(arguments[0],v))for(var t=arguments[0],e=t.iterator();e.hasNext();){var n=e.next();this.rescale(n.getCoordinates())}else if(arguments[0]instanceof Array){var i=arguments[0];2===i.length&&(new p(i[0]),new p(i[1]));for(var e=0;e<i.length;e++)i[e].x=i[e].x/this.scaleFactor+this.offsetX,i[e].y=i[e].y/this.scaleFactor+this.offsetY;2===i.length&&i[0].equals2D(i[1])&&D.out.println(i)}},scale:function(){if(M(arguments[0],v)){for(var t=arguments[0],e=new w,n=t.iterator();n.hasNext();){var i=n.next();e.add(new He(this.scale(i.getCoordinates()),i.getData()))}return e}if(arguments[0]instanceof Array){for(var r=arguments[0],o=new Array(r.length).fill(null),n=0;n<r.length;n++)o[n]=new p(Math.round((r[n].x-this.offsetX)*this.scaleFactor),Math.round((r[n].y-this.offsetY)*this.scaleFactor),r[n].z);return U.removeRepeatedPoints(o)}},isIntegerPrecision:function(){return 1===this.scaleFactor},getNodedSubstrings:function(){var t=this.noder.getNodedSubstrings();return this.isScaled&&this.rescale(t),t},computeNodes:function(t){var e=t;this.isScaled&&(e=this.scale(t)),this.noder.computeNodes(e)},interfaces_:function(){return[$e]},getClass:function(){return Yi}});var ws=Object.freeze({MCIndexNoder:en,ScaledNoder:Yi,SegmentString:Re});e(Ui.prototype,{isSimpleMultiPoint:function(t){if(t.isEmpty())return!0;for(var e=new at,n=0;n<t.getNumGeometries();n++){var i=t.getGeometryN(n),r=i.getCoordinate();if(e.contains(r))return this.nonSimpleLocation=r,!1;e.add(r)}return!0},isSimplePolygonal:function(t){for(var e=Bn.getLines(t),n=e.iterator();n.hasNext();){var i=n.next();if(!this.isSimpleLinearGeometry(i))return!1}return!0},hasClosedEndpointIntersection:function(t){for(var e=new rt,n=t.getEdgeIterator();n.hasNext();){var i=n.next(),r=(i.getMaximumSegmentIndex(),i.isClosed()),o=i.getCoordinate(0);this.addEndpoint(e,o,r);var s=i.getCoordinate(i.getNumPoints()-1);this.addEndpoint(e,s,r)}for(var n=e.values().iterator();n.hasNext();){var a=n.next();if(a.isClosed&&2!==a.degree)return this.nonSimpleLocation=a.getCoordinate(),!0}return!1},getNonSimpleLocation:function(){return this.nonSimpleLocation},isSimpleLinearGeometry:function(t){if(t.isEmpty())return!0;var e=new Qn(0,t),n=new se,i=e.computeSelfNodes(n,!0);return!(i.hasIntersection()&&(i.hasProperIntersection()?(this.nonSimpleLocation=i.getProperIntersectionPoint(),1):this.hasNonEndpointIntersection(e)||this.isClosedEndpointsInInterior&&this.hasClosedEndpointIntersection(e)))},hasNonEndpointIntersection:function(t){for(var e=t.getEdgeIterator();e.hasNext();)for(var n=e.next(),i=n.getMaximumSegmentIndex(),r=n.getEdgeIntersectionList().iterator();r.hasNext();){var o=r.next();if(!o.isEndPoint(i))return this.nonSimpleLocation=o.getCoordinate(),!0}return!1},addEndpoint:function(t,e,n){var i=t.get(e);null===i&&(i=new Wi(e),t.put(e,i)),i.addEndpoint(n)},computeSimple:function(t){return this.nonSimpleLocation=null,!!t.isEmpty()||(t instanceof Nt?this.isSimpleLinearGeometry(t):t instanceof pt?this.isSimpleLinearGeometry(t):t instanceof Rt?this.isSimpleMultiPoint(t):M(t,Mt)?this.isSimplePolygonal(t):!(t instanceof ft)||this.isSimpleGeometryCollection(t))},isSimple:function(){return this.nonSimpleLocation=null,this.computeSimple(this.inputGeom)},isSimpleGeometryCollection:function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);if(!this.computeSimple(n))return!1}return!0},interfaces_:function(){return[]},getClass:function(){return Ui}}),e(Wi.prototype,{addEndpoint:function(t){this.degree++,this.isClosed|=t},getCoordinate:function(){return this.pt},interfaces_:function(){return[]},getClass:function(){return Wi}}),Ui.EndpointInfo=Wi,e(Hi.prototype,{getEndCapStyle:function(){return this.endCapStyle},isSingleSided:function(){return this._isSingleSided},setQuadrantSegments:function(t){this.quadrantSegments=t,0===this.quadrantSegments&&(this.joinStyle=Hi.JOIN_BEVEL),this.quadrantSegments<0&&(this.joinStyle=Hi.JOIN_MITRE,this.mitreLimit=Math.abs(this.quadrantSegments)),t<=0&&(this.quadrantSegments=1),this.joinStyle!==Hi.JOIN_ROUND&&(this.quadrantSegments=Hi.DEFAULT_QUADRANT_SEGMENTS)},getJoinStyle:function(){return this.joinStyle},setJoinStyle:function(t){this.joinStyle=t},setSimplifyFactor:function(t){this.simplifyFactor=t<0?0:t},getSimplifyFactor:function(){return this.simplifyFactor},getQuadrantSegments:function(){return this.quadrantSegments},setEndCapStyle:function(t){this.endCapStyle=t},getMitreLimit:function(){return this.mitreLimit},setMitreLimit:function(t){this.mitreLimit=t},setSingleSided:function(t){this._isSingleSided=t},interfaces_:function(){return[]},getClass:function(){return Hi}}),Hi.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Hi.CAP_ROUND=1,Hi.CAP_FLAT=2,Hi.CAP_SQUARE=3,Hi.JOIN_ROUND=1,Hi.JOIN_MITRE=2,Hi.JOIN_BEVEL=3,Hi.DEFAULT_QUADRANT_SEGMENTS=8,Hi.DEFAULT_MITRE_LIMIT=5,Hi.DEFAULT_SIMPLIFY_FACTOR=.01,e(Ji.prototype,{getCoordinate:function(){return this.minCoord},getRightmostSide:function(t,e){var n=this.getRightmostSideOfSegment(t,e);return n<0&&(n=this.getRightmostSideOfSegment(t,e-1)),n<0&&(this.minCoord=null,this.checkForRightmostCoordinate(t)),n},findRightmostEdgeAtVertex:function(){var t=this.minDe.getEdge().getCoordinates();f.isTrue(this.minIndex>0&&this.minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this.minIndex-1],n=t[this.minIndex+1],i=le.computeOrientation(this.minCoord,n,e),r=!1;e.y<this.minCoord.y&&n.y<this.minCoord.y&&i===le.COUNTERCLOCKWISE?r=!0:e.y>this.minCoord.y&&n.y>this.minCoord.y&&i===le.CLOCKWISE&&(r=!0),r&&(this.minIndex=this.minIndex-1)},getRightmostSideOfSegment:function(t,e){var n=t.getEdge(),i=n.getCoordinates();if(e<0||e+1>=i.length)return-1;if(i[e].y===i[e+1].y)return-1;var r=cn.LEFT;return i[e].y<i[e+1].y&&(r=cn.RIGHT),r},getEdge:function(){return this.orientedDe},checkForRightmostCoordinate:function(t){for(var e=t.getEdge().getCoordinates(),n=0;n<e.length-1;n++)(null===this.minCoord||e[n].x>this.minCoord.x)&&(this.minDe=t,this.minIndex=n,this.minCoord=e[n])},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)},findEdge:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}f.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,this.getRightmostSide(this.minDe,this.minIndex)===cn.LEFT&&(this.orientedDe=this.minDe.getSym())},interfaces_:function(){return[]},getClass:function(){return Ji}}),Zi.prototype.addLast=function(t){this.array_.push(t)},Zi.prototype.removeFirst=function(){return this.array_.shift()},Zi.prototype.isEmpty=function(){return 0===this.array_.length},e(Ki.prototype,{clearVisitedEdges:function(){for(var t=this.dirEdgeList.iterator();t.hasNext();){t.next().setVisited(!1)}},getRightmostCoordinate:function(){return this.rightMostCoord},computeNodeDepth:function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var i=n.next();if(i.isVisited()||i.getSym().isVisited()){e=i;break}}if(null===e)throw new rn("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var n=t.getEdges().iterator();n.hasNext();){var i=n.next();i.setVisited(!0),this.copySymDepths(i)}},computeDepth:function(t){this.clearVisitedEdges();var e=this.finder.getEdge();e.getNode(),e.getLabel(),e.setEdgeDepths(cn.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},create:function(t){this.addReachable(t),this.finder.findEdge(this.dirEdgeList),this.rightMostCoord=this.finder.getCoordinate()},findResultEdges:function(){for(var t=this.dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(cn.RIGHT)>=1&&e.getDepth(cn.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},computeDepths:function(t){var e=new Q,n=new Zi,i=t.getNode();for(n.addLast(i),e.add(i),t.setVisited(!0);!n.isEmpty();){var r=n.removeFirst();e.add(r),this.computeNodeDepth(r);for(var o=r.getEdges().iterator();o.hasNext();){var s=o.next(),a=s.getSym();if(!a.isVisited()){var u=a.getNode();e.contains(u)||(n.addLast(u),e.add(u))}}}},compareTo:function(t){var e=t;return this.rightMostCoord.x<e.rightMostCoord.x?-1:this.rightMostCoord.x>e.rightMostCoord.x?1:0},getEnvelope:function(){if(null===this.env){for(var t=new I,e=this.dirEdgeList.iterator();e.hasNext();)for(var n=e.next(),i=n.getEdge().getCoordinates(),r=0;r<i.length-1;r++)t.expandToInclude(i[r]);this.env=t}return this.env},addReachable:function(t){var e=new de;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},copySymDepths:function(t){var e=t.getSym();e.setDepth(cn.LEFT,t.getDepth(cn.RIGHT)),e.setDepth(cn.RIGHT,t.getDepth(cn.LEFT))},add:function(t,e){t.setVisited(!0),this.nodes.add(t);for(var n=t.getEdges().iterator();n.hasNext();){var i=n.next();this.dirEdgeList.add(i);var r=i.getSym(),o=r.getNode();o.isVisited()||e.push(o)}},getNodes:function(){return this.nodes},getDirectedEdges:function(){return this.dirEdgeList},interfaces_:function(){return[o]},getClass:function(){return Ki}}),e(Qi.prototype,{isDeletable:function(t,e,n,i){var r=this.inputLine[t],o=this.inputLine[e],s=this.inputLine[n];return!!this.isConcave(r,o,s)&&!!this.isShallow(r,o,s,i)&&this.isShallowSampled(r,o,t,n,i)},deleteShallowConcavities:function(){for(var t=1,e=(this.inputLine.length,this.findNextNonDeletedIndex(t)),n=this.findNextNonDeletedIndex(e),i=!1;n<this.inputLine.length;){var r=!1;this.isDeletable(t,e,n,this.distanceTol)&&(this.isDeleted[e]=Qi.DELETE,r=!0,i=!0),t=r?n:e,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e)}return i},isShallowConcavity:function(t,e,n,i){return le.computeOrientation(t,e,n)===this.angleOrientation&&le.distancePointLine(e,t,n)<i},isShallowSampled:function(t,e,n,i,r){var o=Math.trunc((i-n)/Qi.NUM_PTS_TO_CHECK);o<=0&&(o=1);for(var s=n;s<i;s+=o)if(!this.isShallow(t,e,this.inputLine[s],r))return!1;return!0},isConcave:function(t,e,n){return le.computeOrientation(t,e,n)===this.angleOrientation},simplify:function(t){this.distanceTol=Math.abs(t),t<0&&(this.angleOrientation=le.CLOCKWISE),this.isDeleted=new Array(this.inputLine.length).fill(null);var e=!1;do{e=this.deleteShallowConcavities()}while(e);return this.collapseLine()},findNextNonDeletedIndex:function(t){for(var e=t+1;e<this.inputLine.length&&this.isDeleted[e]===Qi.DELETE;)e++;return e},isShallow:function(t,e,n,i){return le.distancePointLine(e,t,n)<i},collapseLine:function(){for(var t=new b,e=0;e<this.inputLine.length;e++)this.isDeleted[e]!==Qi.DELETE&&t.add(this.inputLine[e]);return t.toCoordinateArray()},interfaces_:function(){return[]},getClass:function(){return Qi}}),Qi.simplify=function(t,e){return new Qi(t).simplify(e)},Qi.INIT=0,Qi.DELETE=1,Qi.KEEP=1,Qi.NUM_PTS_TO_CHECK=10,e($i.prototype,{getCoordinates:function(){return this.ptList.toArray($i.COORDINATE_ARRAY_TYPE)},setPrecisionModel:function(t){this.precisionModel=t},addPt:function(t){var e=new p(t);return this.precisionModel.makePrecise(e),this.isRedundant(e)?null:void this.ptList.add(e)},reverse:function(){},addPts:function(t,e){if(e)for(var n=0;n<t.length;n++)this.addPt(t[n]);else for(var n=t.length-1;n>=0;n--)this.addPt(t[n])},isRedundant:function(t){if(this.ptList.size()<1)return!1;var e=this.ptList.get(this.ptList.size()-1);return t.distance(e)<this.minimimVertexDistance},toString:function(){return(new ne).createLineString(this.getCoordinates()).toString()},closeRing:function(){if(this.ptList.size()<1)return null;var t=new p(this.ptList.get(0)),e=this.ptList.get(this.ptList.size()-1);return this.ptList.size()>=2&&this.ptList.get(this.ptList.size()-2),t.equals(e)?null:void this.ptList.add(t)},setMinimumVertexDistance:function(t){this.minimimVertexDistance=t},interfaces_:function(){return[]},getClass:function(){return $i}}),$i.COORDINATE_ARRAY_TYPE=new Array(0).fill(null),e(tr.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))return null;var n=le.computeOrientation(this.s0,this.s1,this.s2),i=n===le.CLOCKWISE&&this.side===cn.LEFT||n===le.COUNTERCLOCKWISE&&this.side===cn.RIGHT;0===n?this.addCollinear(e):i?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},addLineEndCap:function(t,e){var n=new ce(t,e),i=new ce;this.computeOffsetSegment(n,cn.LEFT,this.distance,i);var r=new ce;this.computeOffsetSegment(n,cn.RIGHT,this.distance,r);var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o);switch(this.bufParams.getEndCapStyle()){case Hi.CAP_ROUND:this.segList.addPt(i.p1),this.addFilletArc(e,a+Math.PI/2,a-Math.PI/2,le.CLOCKWISE,this.distance),this.segList.addPt(r.p1);break;case Hi.CAP_FLAT:this.segList.addPt(i.p1),this.segList.addPt(r.p1);break;case Hi.CAP_SQUARE:var u=new p
;u.x=Math.abs(this.distance)*Math.cos(a),u.y=Math.abs(this.distance)*Math.sin(a);var l=new p(i.p1.x+u.x,i.p1.y+u.y),c=new p(r.p1.x+u.x,r.p1.y+u.y);this.segList.addPt(l),this.segList.addPt(c)}},getCoordinates:function(){return this.segList.getCoordinates()},addMitreJoin:function(t,e,n,i){var r=!0,o=null;try{o=F.intersection(e.p0,e.p1,n.p0,n.p1);(i<=0?1:o.distance(t)/Math.abs(i))>this.bufParams.getMitreLimit()&&(r=!1)}catch(t){if(!(t instanceof C))throw t;o=new p(0,0),r=!1}r?this.segList.addPt(o):this.addLimitedMitreJoin(e,n,i,this.bufParams.getMitreLimit())},addFilletCorner:function(t,e,n,i,r){var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o),u=n.x-t.x,l=n.y-t.y,c=Math.atan2(l,u);i===le.CLOCKWISE?a<=c&&(a+=2*Math.PI):a>=c&&(a-=2*Math.PI),this.segList.addPt(e),this.addFilletArc(t,a,c,i,r),this.segList.addPt(n)},addOutsideTurn:function(t,e){return this.offset0.p1.distance(this.offset1.p0)<this.distance*tr.OFFSET_SEGMENT_SEPARATION_FACTOR?(this.segList.addPt(this.offset0.p1),null):void(this.bufParams.getJoinStyle()===Hi.JOIN_MITRE?this.addMitreJoin(this.s1,this.offset0,this.offset1,this.distance):this.bufParams.getJoinStyle()===Hi.JOIN_BEVEL?this.addBevelJoin(this.offset0,this.offset1):(e&&this.segList.addPt(this.offset0.p1),this.addFilletCorner(this.s1,this.offset0.p1,this.offset1.p0,t,this.distance),this.segList.addPt(this.offset1.p0)))},createSquare:function(t){this.segList.addPt(new p(t.x+this.distance,t.y+this.distance)),this.segList.addPt(new p(t.x+this.distance,t.y-this.distance)),this.segList.addPt(new p(t.x-this.distance,t.y-this.distance)),this.segList.addPt(new p(t.x-this.distance,t.y+this.distance)),this.segList.closeRing()},addSegments:function(t,e){this.segList.addPts(t,e)},addFirstSegment:function(){this.segList.addPt(this.offset1.p0)},addLastSegment:function(){this.segList.addPt(this.offset1.p1)},initSideSegments:function(t,e,n){this.s1=t,this.s2=e,this.side=n,this.seg1.setCoordinates(t,e),this.computeOffsetSegment(this.seg1,n,this.distance,this.offset1)},addLimitedMitreJoin:function(t,e,n,i){var r=this.seg0.p1,o=bi.angle(r,this.seg0.p0),s=(bi.angle(r,this.seg1.p1),bi.angleBetweenOriented(this.seg0.p0,r,this.seg1.p1)),a=s/2,u=bi.normalize(o+a),l=bi.normalize(u+Math.PI),c=i*n,h=c*Math.abs(Math.sin(a)),f=n-h,d=r.x+c*Math.cos(l),g=r.y+c*Math.sin(l),v=new p(d,g),y=new ce(r,v),m=y.pointAlongOffset(1,f),x=y.pointAlongOffset(1,-f);this.side===cn.LEFT?(this.segList.addPt(m),this.segList.addPt(x)):(this.segList.addPt(x),this.segList.addPt(m))},computeOffsetSegment:function(t,e,n,i){var r=e===cn.LEFT?1:-1,o=t.p1.x-t.p0.x,s=t.p1.y-t.p0.y,a=Math.sqrt(o*o+s*s),u=r*n*o/a,l=r*n*s/a;i.p0.x=t.p0.x-l,i.p0.y=t.p0.y+u,i.p1.x=t.p1.x-l,i.p1.y=t.p1.y+u},addFilletArc:function(t,e,n,i,r){var o=i===le.CLOCKWISE?-1:1,s=Math.abs(e-n),a=Math.trunc(s/this.filletAngleQuantum+.5);if(a<1)return null;var u=null,l=null;u=0,l=s/a;for(var c=u,h=new p;c<s;){var f=e+o*c;h.x=t.x+r*Math.cos(f),h.y=t.y+r*Math.sin(f),this.segList.addPt(h),c+=l}},addInsideTurn:function(t,e){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*tr.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this.segList.addPt(this.offset0.p1);else{if(this.segList.addPt(this.offset0.p1),this.closingSegLengthFactor>0){var n=new p((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(n);var i=new p((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(i)}else this.segList.addPt(this.s1);this.segList.addPt(this.offset1.p0)}},createCircle:function(t){var e=new p(t.x+this.distance,t.y);this.segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this.distance),this.segList.closeRing()},addBevelJoin:function(t,e){this.segList.addPt(t.p1),this.segList.addPt(e.p0)},init:function(t){this.distance=t,this.maxCurveSegmentError=t*(1-Math.cos(this.filletAngleQuantum/2)),this.segList=new $i,this.segList.setPrecisionModel(this.precisionModel),this.segList.setMinimumVertexDistance(t*tr.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},addCollinear:function(t){this.li.computeIntersection(this.s0,this.s1,this.s1,this.s2),this.li.getIntersectionNum()>=2&&(this.bufParams.getJoinStyle()===Hi.JOIN_BEVEL||this.bufParams.getJoinStyle()===Hi.JOIN_MITRE?(t&&this.segList.addPt(this.offset0.p1),this.segList.addPt(this.offset1.p0)):this.addFilletCorner(this.s1,this.offset0.p1,this.offset1.p0,le.CLOCKWISE,this.distance))},closeRing:function(){this.segList.closeRing()},hasNarrowConcaveAngle:function(){return this._hasNarrowConcaveAngle},interfaces_:function(){return[]},getClass:function(){return tr}}),tr.OFFSET_SEGMENT_SEPARATION_FACTOR=.001,tr.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR=.001,tr.CURVE_VERTEX_SNAP_DISTANCE_FACTOR=1e-6,tr.MAX_CLOSING_SEG_LEN_FACTOR=80,e(er.prototype,{getOffsetCurve:function(t,e){if(this.distance=e,0===e)return null;var n=e<0,i=Math.abs(e),r=this.getSegGen(i);t.length<=1?this.computePointCurve(t[0],r):this.computeOffsetCurve(t,n,r);var o=r.getCoordinates();return n&&U.reverse(o),o},computeSingleSidedBufferCurve:function(t,e,n){var i=this.simplifyTolerance(this.distance);if(e){n.addSegments(t,!0);var r=Qi.simplify(t,-i),o=r.length-1;n.initSideSegments(r[o],r[o-1],cn.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(r[s],!0)}else{n.addSegments(t,!1);var a=Qi.simplify(t,i),u=a.length-1;n.initSideSegments(a[0],a[1],cn.LEFT),n.addFirstSegment();for(var s=2;s<=u;s++)n.addNextSegment(a[s],!0)}n.addLastSegment(),n.closeRing()},computeRingBufferCurve:function(t,e,n){var i=this.simplifyTolerance(this.distance);e===cn.RIGHT&&(i=-i);var r=Qi.simplify(t,i),o=r.length-1;n.initSideSegments(r[o-1],r[0],e);for(var s=1;s<=o;s++){var a=1!==s;n.addNextSegment(r[s],a)}n.closeRing()},computeLineBufferCurve:function(t,e){var n=this.simplifyTolerance(this.distance),i=Qi.simplify(t,n),r=i.length-1;e.initSideSegments(i[0],i[1],cn.LEFT);for(var o=2;o<=r;o++)e.addNextSegment(i[o],!0);e.addLastSegment(),e.addLineEndCap(i[r-1],i[r]);var s=Qi.simplify(t,-n),a=s.length-1;e.initSideSegments(s[a],s[a-1],cn.LEFT);for(var o=a-2;o>=0;o--)e.addNextSegment(s[o],!0);e.addLastSegment(),e.addLineEndCap(s[1],s[0]),e.closeRing()},computePointCurve:function(t,e){switch(this.bufParams.getEndCapStyle()){case Hi.CAP_ROUND:e.createCircle(t);break;case Hi.CAP_SQUARE:e.createSquare(t)}},getLineCurve:function(t,e){if(this.distance=e,e<0&&!this.bufParams.isSingleSided())return null;if(0===e)return null;var n=Math.abs(e),i=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],i);else if(this.bufParams.isSingleSided()){var r=e<0;this.computeSingleSidedBufferCurve(t,r,i)}else this.computeLineBufferCurve(t,i);return i.getCoordinates()},getBufferParameters:function(){return this.bufParams},simplifyTolerance:function(t){return t*this.bufParams.getSimplifyFactor()},getRingCurve:function(t,e,n){if(this.distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return er.copyCoordinates(t);var i=this.getSegGen(n);return this.computeRingBufferCurve(t,e,i),i.getCoordinates()},computeOffsetCurve:function(t,e,n){var i=this.simplifyTolerance(this.distance);if(e){var r=Qi.simplify(t,-i),o=r.length-1;n.initSideSegments(r[o],r[o-1],cn.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(r[s],!0)}else{var a=Qi.simplify(t,i),u=a.length-1;n.initSideSegments(a[0],a[1],cn.LEFT),n.addFirstSegment();for(var s=2;s<=u;s++)n.addNextSegment(a[s],!0)}n.addLastSegment()},getSegGen:function(t){return new tr(this.precisionModel,this.bufParams,t)},interfaces_:function(){return[]},getClass:function(){return er}}),er.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new p(t[n]);return e},e(nr.prototype,{findStabbedSegments:function(){if(1===arguments.length){for(var t=arguments[0],e=new w,n=this.subgraphs.iterator();n.hasNext();){var i=n.next(),r=i.getEnvelope();t.y<r.getMinY()||t.y>r.getMaxY()||this.findStabbedSegments(t,i.getDirectedEdges(),e)}return e}if(3===arguments.length)if(M(arguments[2],m)&&arguments[0]instanceof p&&arguments[1]instanceof En)for(var o=arguments[0],s=arguments[1],a=arguments[2],u=s.getEdge().getCoordinates(),n=0;n<u.length-1;n++){this.seg.p0=u[n],this.seg.p1=u[n+1],this.seg.p0.y>this.seg.p1.y&&this.seg.reverse();var l=Math.max(this.seg.p0.x,this.seg.p1.x);if(!(l<o.x||this.seg.isHorizontal()||o.y<this.seg.p0.y||o.y>this.seg.p1.y||le.computeOrientation(this.seg.p0,this.seg.p1,o)===le.RIGHT)){var c=s.getDepth(cn.LEFT);this.seg.p0.equals(u[n])||(c=s.getDepth(cn.RIGHT));var h=new ir(this.seg,c);a.add(h)}}else if(M(arguments[2],m)&&arguments[0]instanceof p&&M(arguments[1],m))for(var f=arguments[0],d=arguments[1],g=arguments[2],n=d.iterator();n.hasNext();){var v=n.next();v.isForward()&&this.findStabbedSegments(f,v,g)}},getDepth:function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:ls.min(e).leftDepth},interfaces_:function(){return[]},getClass:function(){return nr}}),e(ir.prototype,{compareTo:function(t){var e=t;if(this.upwardSeg.minX()>=e.upwardSeg.maxX())return 1;if(this.upwardSeg.maxX()<=e.upwardSeg.minX())return-1;var n=this.upwardSeg.orientationIndex(e.upwardSeg);return 0!==n?n:(n=-1*e.upwardSeg.orientationIndex(this.upwardSeg),0!==n?n:this.upwardSeg.compareTo(e.upwardSeg))},compareX:function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},toString:function(){return this.upwardSeg.toString()},interfaces_:function(){return[o]},getClass:function(){return ir}}),nr.DepthSegment=ir,e(rr.prototype,{addPoint:function(t){if(this.distance<=0)return null;var e=t.getCoordinates(),n=this.curveBuilder.getLineCurve(e,this.distance);this.addCurve(n,S.EXTERIOR,S.INTERIOR)},addPolygon:function(t){var e=this.distance,n=cn.LEFT;this.distance<0&&(e=-this.distance,n=cn.RIGHT);var i=t.getExteriorRing(),r=U.removeRepeatedPoints(i.getCoordinates());if(this.distance<0&&this.isErodedCompletely(i,this.distance))return null;if(this.distance<=0&&r.length<3)return null;this.addPolygonRing(r,e,n,S.EXTERIOR,S.INTERIOR);for(var o=0;o<t.getNumInteriorRing();o++){var s=t.getInteriorRingN(o),a=U.removeRepeatedPoints(s.getCoordinates());this.distance>0&&this.isErodedCompletely(s,-this.distance)||this.addPolygonRing(a,e,cn.opposite(n),S.INTERIOR,S.EXTERIOR)}},isTriangleErodedCompletely:function(t,e){var n=new Ii(t[0],t[1],t[2]),i=n.inCentre();return le.distancePointLine(i,n.p0,n.p1)<Math.abs(e)},addLineString:function(t){if(this.distance<=0&&!this.curveBuilder.getBufferParameters().isSingleSided())return null;var e=U.removeRepeatedPoints(t.getCoordinates()),n=this.curveBuilder.getLineCurve(e,this.distance);this.addCurve(n,S.EXTERIOR,S.INTERIOR)},addCurve:function(t,e,n){if(null===t||t.length<2)return null;var i=new He(t,new fn(0,S.BOUNDARY,e,n));this.curveList.add(i)},getCurves:function(){return this.add(this.inputGeom),this.curveList},addPolygonRing:function(t,e,n,i,r){if(0===e&&t.length<Pt.MINIMUM_VALID_SIZE)return null;var o=i,s=r;t.length>=Pt.MINIMUM_VALID_SIZE&&le.isCCW(t)&&(o=r,s=i,n=cn.opposite(n));var a=this.curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)},add:function(t){if(t.isEmpty())return null;if(t instanceof Lt)this.addPolygon(t);else if(t instanceof Nt)this.addLineString(t);else if(t instanceof St)this.addPoint(t);else if(t instanceof Rt)this.addCollection(t);else if(t instanceof pt)this.addCollection(t);else if(t instanceof Tt)this.addCollection(t);else{if(!(t instanceof ft))throw new UnsupportedOperationException(t.getClass().getName());this.addCollection(t)}},isErodedCompletely:function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(4===n.length)return this.isTriangleErodedCompletely(n,e);var i=t.getEnvelopeInternal(),r=Math.min(i.getHeight(),i.getWidth());return e<0&&2*Math.abs(e)>r},addCollection:function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},interfaces_:function(){return[]},getClass:function(){return rr}}),e(or.prototype,{isTrivialIntersection:function(t,e,n,i){if(t===n&&1===this.li.getIntersectionNum()){if(or.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var r=t.size()-1;if(0===e&&i===r||0===i&&e===r)return!0}}return!1},getProperIntersectionPoint:function(){return this.properIntersectionPoint},hasProperInteriorIntersection:function(){return this.hasProperInterior},getLineIntersector:function(){return this.li},hasProperIntersection:function(){return this.hasProper},processIntersections:function(t,e,n,i){if(t===n&&e===i)return null;this.numTests++;var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[i],a=n.getCoordinates()[i+1];this.li.computeIntersection(r,o,s,a),this.li.hasIntersection()&&(this.numIntersections++,this.li.isInteriorIntersection()&&(this.numInteriorIntersections++,this.hasInterior=!0),this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,t.addIntersections(this.li,e,0),n.addIntersections(this.li,i,1),this.li.isProper()&&(this.numProperIntersections++,this.hasProper=!0,this.hasProperInterior=!0)))},hasIntersection:function(){return this._hasIntersection},isDone:function(){return!1},hasInteriorIntersection:function(){return this.hasInterior},interfaces_:function(){return[on]},getClass:function(){return or}}),or.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)},e(sr.prototype,{setWorkingPrecisionModel:function(t){this.workingPrecisionModel=t},insertUniqueEdge:function(t){var e=this.edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new fn(t.getLabel()),i.flip()),n.merge(i);var r=sr.depthDelta(i),o=e.getDepthDelta(),s=o+r;e.setDepthDelta(s)}else this.edgeList.add(t),t.setDepthDelta(sr.depthDelta(t.getLabel()))},buildSubgraphs:function(t,e){for(var n=new w,i=t.iterator();i.hasNext();){var r=i.next(),o=r.getRightmostCoordinate(),s=new nr(n),a=s.getDepth(o);r.computeDepth(a),r.findResultEdges(),n.add(r),e.add(r.getDirectedEdges(),r.getNodes())}},createSubgraphs:function(t){for(var e=new w,n=t.getNodes().iterator();n.hasNext();){var i=n.next();if(!i.isVisited()){var r=new Ki;r.create(i),e.add(r)}}return ls.sort(e,ls.reverseOrder()),e},createEmptyResultGeometry:function(){return this.geomFact.createPolygon()},getNoder:function(t){if(null!==this.workingNoder)return this.workingNoder;var e=new en,n=new se;return n.setPrecisionModel(t),e.setSegmentIntersector(new or(n)),e},buffer:function(t,e){var n=this.workingPrecisionModel;null===n&&(n=t.getPrecisionModel()),this.geomFact=t.getFactory();var i=new er(n,this.bufParams),r=new rr(t,e,i),o=r.getCurves();if(o.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(o,n),this.graph=new bn(new Pn),this.graph.addEdges(this.edgeList.getEdges());var s=this.createSubgraphs(this.graph),a=new In(this.geomFact);this.buildSubgraphs(s,a);var u=a.getPolygons();return u.size()<=0?this.createEmptyResultGeometry():this.geomFact.buildGeometry(u)},computeNodedEdges:function(t,e){var n=this.getNoder(e);n.computeNodes(t);for(var i=n.getNodedSubstrings(),r=i.iterator();r.hasNext();){var o=r.next(),s=o.getCoordinates();if(2!==s.length||!s[0].equals2D(s[1])){var a=o.getData(),u=new Kn(o.getCoordinates(),new fn(a));this.insertUniqueEdge(u)}}},setNoder:function(t){this.workingNoder=t},interfaces_:function(){return[]},getClass:function(){return sr}}),sr.depthDelta=function(t){var e=t.getLocation(0,cn.LEFT),n=t.getLocation(0,cn.RIGHT);return e===S.INTERIOR&&n===S.EXTERIOR?1:e===S.EXTERIOR&&n===S.INTERIOR?-1:0},sr.convertSegStrings=function(t){for(var e=new ne,n=new w;t.hasNext();){var i=t.next(),r=e.createLineString(i.getCoordinates());n.add(r)}return e.buildGeometry(n)},e(ar.prototype,{checkEndPtVertexIntersections:function(){if(0===arguments.length)for(var t=this.segStrings.iterator();t.hasNext();){var e=t.next(),n=e.getCoordinates();this.checkEndPtVertexIntersections(n[0],this.segStrings),this.checkEndPtVertexIntersections(n[n.length-1],this.segStrings)}else if(2===arguments.length)for(var i=arguments[0],r=arguments[1],t=r.iterator();t.hasNext();)for(var e=t.next(),n=e.getCoordinates(),o=1;o<n.length-1;o++)if(n[o].equals(i))throw new l("found endpt/interior pt intersection at index "+o+" :pt "+i)},checkInteriorIntersections:function(){if(0===arguments.length)for(var t=this.segStrings.iterator();t.hasNext();)for(var e=t.next(),n=this.segStrings.iterator();n.hasNext();){var i=n.next();this.checkInteriorIntersections(e,i)}else if(2===arguments.length)for(var r=arguments[0],o=arguments[1],s=r.getCoordinates(),a=o.getCoordinates(),u=0;u<s.length-1;u++)for(var c=0;c<a.length-1;c++)this.checkInteriorIntersections(r,u,o,c);else if(4===arguments.length){var h=arguments[0],f=arguments[1],p=arguments[2],d=arguments[3];if(h===p&&f===d)return null;var g=h.getCoordinates()[f],v=h.getCoordinates()[f+1],y=p.getCoordinates()[d],m=p.getCoordinates()[d+1];if(this.li.computeIntersection(g,v,y,m),this.li.hasIntersection()&&(this.li.isProper()||this.hasInteriorIntersection(this.li,g,v)||this.hasInteriorIntersection(this.li,y,m)))throw new l("found non-noded intersection at "+g+"-"+v+" and "+y+"-"+m)}},checkValid:function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},checkCollapses:function(){if(0===arguments.length)for(var t=this.segStrings.iterator();t.hasNext();){var e=t.next();this.checkCollapses(e)}else if(1===arguments.length)for(var n=arguments[0],i=n.getCoordinates(),t=0;t<i.length-2;t++)this.checkCollapse(i[t],i[t+1],i[t+2])},hasInteriorIntersection:function(t,e,n){for(var i=0;i<t.getIntersectionNum();i++){var r=t.getIntersection(i);if(!r.equals(e)&&!r.equals(n))return!0}return!1},checkCollapse:function(t,e,n){if(t.equals(n))throw new l("found non-noded collapse at "+ar.fact.createLineString([t,e,n]))},interfaces_:function(){return[]},getClass:function(){return ar}}),ar.fact=new ne,e(ur.prototype,{intersectsScaled:function(t,e){var n=Math.min(t.x,e.x),i=Math.max(t.x,e.x),r=Math.min(t.y,e.y),o=Math.max(t.y,e.y),s=this.maxx<n||this.minx>i||this.maxy<r||this.miny>o;if(s)return!1;var a=this.intersectsToleranceSquare(t,e);return f.isTrue(!(s&&a),"Found bad envelope test"),a},initCorners:function(t){this.minx=t.x-.5,this.maxx=t.x+.5,this.miny=t.y-.5,this.maxy=t.y+.5,this.corner[0]=new p(this.maxx,this.maxy),this.corner[1]=new p(this.minx,this.maxy),this.corner[2]=new p(this.minx,this.miny),this.corner[3]=new p(this.maxx,this.miny)},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))},scale:function(t){return Math.round(t*this.scaleFactor)},getCoordinate:function(){return this.originalPt},copyScaled:function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},getSafeEnvelope:function(){if(null===this.safeEnv){var t=ur.SAFE_ENV_EXPANSION_FACTOR/this.scaleFactor;this.safeEnv=new I(this.originalPt.x-t,this.originalPt.x+t,this.originalPt.y-t,this.originalPt.y+t)}return this.safeEnv},intersectsPixelClosure:function(t,e){return this.li.computeIntersection(t,e,this.corner[0],this.corner[1]),!!(this.li.hasIntersection()||(this.li.computeIntersection(t,e,this.corner[1],this.corner[2]),this.li.hasIntersection()||(this.li.computeIntersection(t,e,this.corner[2],this.corner[3]),this.li.hasIntersection()||(this.li.computeIntersection(t,e,this.corner[3],this.corner[0]),this.li.hasIntersection()))))},intersectsToleranceSquare:function(t,e){var n=!1,i=!1;return this.li.computeIntersection(t,e,this.corner[0],this.corner[1]),!!(this.li.isProper()||(this.li.computeIntersection(t,e,this.corner[1],this.corner[2]),this.li.isProper()||(this.li.hasIntersection()&&(n=!0),this.li.computeIntersection(t,e,this.corner[2],this.corner[3]),this.li.isProper()||(this.li.hasIntersection()&&(i=!0),this.li.computeIntersection(t,e,this.corner[3],this.corner[0]),this.li.isProper()||n&&i||t.equals(this.pt)||e.equals(this.pt)))))},addSnappedNode:function(t,e){var n=t.getCoordinate(e),i=t.getCoordinate(e+1);return!!this.intersects(n,i)&&(t.addIntersection(this.getCoordinate(),e),!0)},interfaces_:function(){return[]},getClass:function(){return ur}}),ur.SAFE_ENV_EXPANSION_FACTOR=.75,e(lr.prototype,{snap:function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],n=arguments[1],i=arguments[2],r=e.getSafeEnvelope(),o=new cr(e,n,i);return this.index.query(r,{interfaces_:function(){return[Ae]},visitItem:function(t){t.select(r,o)}}),o.isNodeAdded()}},interfaces_:function(){return[]},getClass:function(){return lr}}),c(cr,li),e(cr.prototype,{isNodeAdded:function(){return this._isNodeAdded},select:function(){if(2!==arguments.length)return li.prototype.select.apply(this,arguments);var t=arguments[0],e=arguments[1],n=t.getContext();return null!==this.parentEdge&&n===this.parentEdge&&e===this.hotPixelVertexIndex?null:void(this._isNodeAdded=this.hotPixel.addSnappedNode(n,e))},interfaces_:function(){return[]},getClass:function(){return cr}}),lr.HotPixelSnapAction=cr,e(hr.prototype,{processIntersections:function(t,e,n,i){if(t===n&&e===i)return null;var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[i],a=n.getCoordinates()[i+1];if(this.li.computeIntersection(r,o,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),n.addIntersections(this.li,i,1)}},isDone:function(){return!1},getInteriorIntersections:function(){return this.interiorIntersections},interfaces_:function(){return[on]},getClass:function(){return hr}}),e(fr.prototype,{checkCorrectness:function(t){var e=He.getNodedSubstrings(t),n=new ar(e);try{n.checkValid()}catch(t){if(!(t instanceof N))throw t;t.printStackTrace()}},getNodedSubstrings:function(){return He.getNodedSubstrings(this.nodedSegStrings)},snapRound:function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},findInteriorIntersections:function(t,e){var n=new hr(e);return this.noder.setSegmentIntersector(n),this.noder.computeNodes(t),n.getInteriorIntersections()},computeVertexSnaps:function(){if(M(arguments[0],v))for(var t=arguments[0],e=t.iterator();e.hasNext();){var n=e.next();this.computeVertexSnaps(n)}else if(arguments[0]instanceof He)for(var i=arguments[0],r=i.getCoordinates(),o=0;o<r.length;o++){var s=new ur(r[o],this.scaleFactor,this.li),a=this.pointSnapper.snap(s,i,o);a&&i.addIntersection(r[o],o)}},computeNodes:function(t){this.nodedSegStrings=t,this.noder=new en,this.pointSnapper=new lr(this.noder.getIndex()),this.snapRound(t,this.li)},computeIntersectionSnaps:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),i=new ur(n,this.scaleFactor,this.li);this.pointSnapper.snap(i)}},interfaces_:function(){return[$e]},getClass:function(){return fr}}),e(pr.prototype,{bufferFixedPrecision:function(t){var e=new Yi(new fr(new te(1)),t.getScale()),n=new sr(this.bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this.resultGeometry=n.buffer(this.argGeom,this.distance)},bufferReducedPrecision:function(){if(0===arguments.length){for(var t=pr.MAX_PRECISION_DIGITS;t>=0;t--){try{this.bufferReducedPrecision(t)}catch(t){if(!(t instanceof rn))throw t;this.saveException=t}if(null!==this.resultGeometry)return null}throw this.saveException}if(1===arguments.length){var e=arguments[0],n=pr.precisionScaleFactor(this.argGeom,this.distance,e),i=new te(n);this.bufferFixedPrecision(i)}},computeGeometry:function(){if(this.bufferOriginalPrecision(),null!==this.resultGeometry)return null;var t=this.argGeom.getFactory().getPrecisionModel();t.getType()===te.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},setQuadrantSegments:function(t){this.bufParams.setQuadrantSegments(t)},bufferOriginalPrecision:function(){try{var t=new sr(this.bufParams);this.resultGeometry=t.buffer(this.argGeom,this.distance)}catch(t){if(!(t instanceof l))throw t;this.saveException=t}},getResultGeometry:function(t){return this.distance=t,this.computeGeometry(),this.resultGeometry},setEndCapStyle:function(t){this.bufParams.setEndCapStyle(t)},interfaces_:function(){return[]},getClass:function(){return pr}}),pr.bufferOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new pr(t),i=n.getResultGeometry(e);return i}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof G&&"number"==typeof arguments[1]){var r=arguments[0],o=arguments[1],s=arguments[2],a=new pr(r);a.setQuadrantSegments(s);var i=a.getResultGeometry(o);return i}if(arguments[2]instanceof Hi&&arguments[0]instanceof G&&"number"==typeof arguments[1]){var u=arguments[0],l=arguments[1],c=arguments[2],a=new pr(u,c),i=a.getResultGeometry(l);return i}}else if(4===arguments.length){var h=arguments[0],f=arguments[1],p=arguments[2],d=arguments[3],a=new pr(h);a.setQuadrantSegments(p),a.setEndCapStyle(d);var i=a.getResultGeometry(f);return i}},pr.precisionScaleFactor=function(t,e,n){var i=t.getEnvelopeInternal(),r=L.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY())),o=e>0?e:0,s=r+2*o,a=Math.trunc(Math.log(s)/Math.log(10)+1),u=n-a;return Math.pow(10,u)},pr.CAP_ROUND=Hi.CAP_ROUND,pr.CAP_BUTT=Hi.CAP_FLAT,pr.CAP_FLAT=Hi.CAP_FLAT,pr.CAP_SQUARE=Hi.CAP_SQUARE,pr.MAX_PRECISION_DIGITS=12;var bs=Object.freeze({BufferOp:pr,BufferParameters:Hi});e(dr.prototype,{filter:function(t){t instanceof Lt&&this.comps.add(t)},interfaces_:function(){return[ct]},getClass:function(){return dr}}),dr.getPolygons=function(){if(1===arguments.length){var t=arguments[0];return dr.getPolygons(t,new w)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Lt?n.add(e):e instanceof ft&&e.apply(new dr(n)),n}},e(gr.prototype,{isInsideArea:function(){return this.segIndex===gr.INSIDE_AREA},getCoordinate:function(){return this.pt},getGeometryComponent:function(){return this.component},getSegmentIndex:function(){return this.segIndex},interfaces_:function(){return[]},getClass:function(){return gr}}),gr.INSIDE_AREA=-1,e(vr.prototype,{filter:function(t){t instanceof St&&this.pts.add(t)},interfaces_:function(){return[ct]},getClass:function(){return vr}}),vr.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof St?ls.singletonList(t):vr.getPoints(t,new w)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof St?n.add(e):e instanceof ft&&e.apply(new vr(n)),n}},e(yr.prototype,{filter:function(t){(t instanceof St||t instanceof Nt||t instanceof Lt)&&this.locations.add(new gr(t,0,t.getCoordinate()))},interfaces_:function(){return[ct]},getClass:function(){return yr}}),yr.getLocations=function(t){var e=new w;return t.apply(new yr(e)),e},e(mr.prototype,{computeContainmentDistance:function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this.minDistance<=this.terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],i=1-e,r=dr.getPolygons(this.geom[e]);if(r.size()>0){var o=yr.getLocations(this.geom[i]);if(this.computeContainmentDistance(o,r,n),this.minDistance<=this.terminateDistance)return this.minDistanceLocation[i]=n[0],this.minDistanceLocation[e]=n[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&M(arguments[0],m)&&M(arguments[1],m)){for(var s=arguments[0],a=arguments[1],u=arguments[2],l=0;l<s.size();l++)for(var c=s.get(l),h=0;h<a.size();h++)if(this.computeContainmentDistance(c,a.get(h),u),this.minDistance<=this.terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof gr&&arguments[1]instanceof Lt){var f=arguments[0],p=arguments[1],d=arguments[2],g=f.getCoordinate();if(S.EXTERIOR!==this.ptLocator.locate(g,p))return this.minDistance=0,d[0]=f,d[1]=new gr(p,g),null}},computeMinDistanceLinesPoints:function(t,e,n){for(var i=0;i<t.size();i++)for(var r=t.get(i),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(r,s,n),this.minDistance<=this.terminateDistance)return null}},computeFacetDistance:function(){var t=new Array(2).fill(null),e=Bn.getLines(this.geom[0]),n=Bn.getLines(this.geom[1]),i=vr.getPoints(this.geom[0]),r=vr.getPoints(this.geom[1]);return this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this.minDistance<=this.terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,r,t),this.updateMinDistance(t,!1),this.minDistance<=this.terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,i,t),this.updateMinDistance(t,!0),this.minDistance<=this.terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistancePoints(i,r,t),void this.updateMinDistance(t,!1))))},nearestLocations:function(){return this.computeMinDistance(),this.minDistanceLocation},updateMinDistance:function(t,e){return null===t[0]?null:void(e?(this.minDistanceLocation[0]=t[1],this.minDistanceLocation[1]=t[0]):(this.minDistanceLocation[0]=t[0],this.minDistanceLocation[1]=t[1]))},nearestPoints:function(){return this.computeMinDistance(),[this.minDistanceLocation[0].getCoordinate(),this.minDistanceLocation[1].getCoordinate()]},computeMinDistance:function(){if(0===arguments.length){if(null!==this.minDistanceLocation)return null;if(this.minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this.minDistance<=this.terminateDistance)return null;this.computeFacetDistance()}else if(3===arguments.length)if(arguments[2]instanceof Array&&arguments[0]instanceof Nt&&arguments[1]instanceof St){var t=arguments[0],e=arguments[1],n=arguments[2];if(t.getEnvelopeInternal().distance(e.getEnvelopeInternal())>this.minDistance)return null;for(var i=t.getCoordinates(),r=e.getCoordinate(),o=0;o<i.length-1;o++){var s=le.distancePointLine(r,i[o],i[o+1]);if(s<this.minDistance){this.minDistance=s;var a=new ce(i[o],i[o+1]),u=a.closestPoint(r);n[0]=new gr(t,o,u),n[1]=new gr(e,0,r)}if(this.minDistance<=this.terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Nt&&arguments[1]instanceof Nt){var l=arguments[0],c=arguments[1],h=arguments[2];if(l.getEnvelopeInternal().distance(c.getEnvelopeInternal())>this.minDistance)return null;for(var i=l.getCoordinates(),f=c.getCoordinates(),o=0;o<i.length-1;o++)for(var p=0;p<f.length-1;p++){var s=le.distanceLineLine(i[o],i[o+1],f[p],f[p+1]);if(s<this.minDistance){this.minDistance=s;var d=new ce(i[o],i[o+1]),g=new ce(f[p],f[p+1]),v=d.closestPoints(g);h[0]=new gr(l,o,v[0]),h[1]=new gr(c,p,v[1])}if(this.minDistance<=this.terminateDistance)return null}}},computeMinDistancePoints:function(t,e,n){for(var i=0;i<t.size();i++)for(var r=t.get(i),o=0;o<e.size();o++){var s=e.get(o),a=r.getCoordinate().distance(s.getCoordinate());if(a<this.minDistance&&(this.minDistance=a,n[0]=new gr(r,0,r.getCoordinate()),n[1]=new gr(s,0,s.getCoordinate())),this.minDistance<=this.terminateDistance)return null}},distance:function(){if(null===this.geom[0]||null===this.geom[1])throw new i("null geometries are not supported");return this.geom[0].isEmpty()||this.geom[1].isEmpty()?0:(this.computeMinDistance(),this.minDistance)},computeMinDistanceLines:function(t,e,n){for(var i=0;i<t.size();i++)for(var r=t.get(i),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(r,s,n),this.minDistance<=this.terminateDistance)return null}},interfaces_:function(){return[]},getClass:function(){return mr}}),mr.distance=function(t,e){return new mr(t,e).distance()},mr.isWithinDistance=function(t,e,n){return new mr(t,e,n).distance()<=n},mr.nearestPoints=function(t,e){return new mr(t,e).nearestPoints()};var Is=Object.freeze({DistanceOp:mr});e(xr.prototype,{getCoordinates:function(){
if(null===this.coordinates){for(var t=0,e=0,n=new b,i=this.directedEdges.iterator();i.hasNext();){var r=i.next();r.getEdgeDirection()?t++:e++,n.add(r.getEdge().getLine().getCoordinates(),!1,r.getEdgeDirection())}this.coordinates=n.toCoordinateArray(),e>t&&U.reverse(this.coordinates)}return this.coordinates},toLineString:function(){return this.factory.createLineString(this.getCoordinates())},add:function(t){this.directedEdges.add(t)},interfaces_:function(){return[]},getClass:function(){return xr}}),e(Er.prototype,{setVisited:function(t){this._isVisited=t},isMarked:function(){return this._isMarked},setData:function(t){this.data=t},getData:function(){return this.data},setMarked:function(t){this._isMarked=t},getContext:function(){return this.data},isVisited:function(){return this._isVisited},setContext:function(t){this.data=t},interfaces_:function(){return[]},getClass:function(){return Er}}),Er.getComponentWithVisitedState=function(t,e){for(;t.hasNext();){var n=t.next();if(n.isVisited()===e)return n}return null},Er.setVisited=function(t,e){for(;t.hasNext();){t.next().setVisited(e)}},Er.setMarked=function(t,e){for(;t.hasNext();){t.next().setMarked(e)}},c(wr,Er),e(wr.prototype,{isRemoved:function(){return null===this.parentEdge},compareDirection:function(t){return this.quadrant>t.quadrant?1:this.quadrant<t.quadrant?-1:le.computeOrientation(t.p0,t.p1,this.p1)},getCoordinate:function(){return this.from.getCoordinate()},print:function(t){var e=this.getClass().getName(),n=e.lastIndexOf("."),i=e.substring(n+1);t.print(" "+i+": "+this.p0+" - "+this.p1+" "+this.quadrant+":"+this.angle)},getDirectionPt:function(){return this.p1},getAngle:function(){return this.angle},compareTo:function(t){var e=t;return this.compareDirection(e)},getFromNode:function(){return this.from},getSym:function(){return this.sym},setEdge:function(t){this.parentEdge=t},remove:function(){this.sym=null,this.parentEdge=null},getEdge:function(){return this.parentEdge},getQuadrant:function(){return this.quadrant},setSym:function(t){this.sym=t},getToNode:function(){return this.to},getEdgeDirection:function(){return this.edgeDirection},interfaces_:function(){return[o]},getClass:function(){return wr}}),wr.toEdges=function(t){for(var e=new w,n=t.iterator();n.hasNext();)e.add(n.next().parentEdge);return e},c(br,wr),e(br.prototype,{getNext:function(){return 2!==this.getToNode().getDegree()?null:this.getToNode().getOutEdges().getEdges().get(0)===this.getSym()?this.getToNode().getOutEdges().getEdges().get(1):(f.isTrue(this.getToNode().getOutEdges().getEdges().get(1)===this.getSym()),this.getToNode().getOutEdges().getEdges().get(0))},interfaces_:function(){return[]},getClass:function(){return br}}),c(Ir,Er),e(Ir.prototype,{isRemoved:function(){return null===this.dirEdge},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)},getDirEdge:function(){if(Number.isInteger(arguments[0])){var t=arguments[0];return this.dirEdge[t]}if(arguments[0]instanceof Cr){var e=arguments[0];return this.dirEdge[0].getFromNode()===e?this.dirEdge[0]:this.dirEdge[1].getFromNode()===e?this.dirEdge[1]:null}},remove:function(){this.dirEdge=null},getOppositeNode:function(t){return this.dirEdge[0].getFromNode()===t?this.dirEdge[0].getToNode():this.dirEdge[1].getFromNode()===t?this.dirEdge[1].getToNode():null},interfaces_:function(){return[]},getClass:function(){return Ir}}),e(Nr.prototype,{getNextEdge:function(t){var e=this.getIndex(t);return this.outEdges.get(this.getIndex(e+1))},getCoordinate:function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},iterator:function(){return this.sortEdges(),this.outEdges.iterator()},sortEdges:function(){this.sorted||(ls.sort(this.outEdges),this.sorted=!0)},remove:function(t){this.outEdges.remove(t)},getEdges:function(){return this.sortEdges(),this.outEdges},getNextCWEdge:function(t){var e=this.getIndex(t);return this.outEdges.get(this.getIndex(e-1))},getIndex:function(){if(arguments[0]instanceof Ir){var t=arguments[0];this.sortEdges();for(var e=0;e<this.outEdges.size();e++){var n=this.outEdges.get(e);if(n.getEdge()===t)return e}return-1}if(arguments[0]instanceof wr){var i=arguments[0];this.sortEdges();for(var e=0;e<this.outEdges.size();e++){var n=this.outEdges.get(e);if(n===i)return e}return-1}if(Number.isInteger(arguments[0])){var r=arguments[0],o=r%this.outEdges.size();return o<0&&(o+=this.outEdges.size()),o}},add:function(t){this.outEdges.add(t),this.sorted=!1},getDegree:function(){return this.outEdges.size()},interfaces_:function(){return[]},getClass:function(){return Nr}}),c(Cr,Er),e(Cr.prototype,{isRemoved:function(){return null===this.pt},addOutEdge:function(t){this.deStar.add(t)},getCoordinate:function(){return this.pt},getOutEdges:function(){return this.deStar},remove:function(){if(0===arguments.length)this.pt=null;else if(1===arguments.length){var t=arguments[0];this.deStar.remove(t)}},getIndex:function(t){return this.deStar.getIndex(t)},getDegree:function(){return this.deStar.getDegree()},interfaces_:function(){return[]},getClass:function(){return Cr}}),Cr.getEdgesBetween=function(t,e){var n=wr.toEdges(t.getOutEdges().getEdges()),i=new Q(n),r=wr.toEdges(e.getOutEdges().getEdges());return i.retainAll(r),i},c(Sr,Ir),e(Sr.prototype,{getLine:function(){return this.line},interfaces_:function(){return[]},getClass:function(){return Sr}}),e(Mr.prototype,{find:function(t){return this.nodeMap.get(t)},iterator:function(){return this.nodeMap.values().iterator()},remove:function(t){return this.nodeMap.remove(t)},values:function(){return this.nodeMap.values()},add:function(t){return this.nodeMap.put(t.getCoordinate(),t),t},interfaces_:function(){return[]},getClass:function(){return Mr}}),e(Lr.prototype,{findNodesOfDegree:function(t){for(var e=new w,n=this.nodeIterator();n.hasNext();){var i=n.next();i.getDegree()===t&&e.add(i)}return e},dirEdgeIterator:function(){return this.dirEdges.iterator()},edgeIterator:function(){return this.edges.iterator()},remove:function(){if(arguments[0]instanceof Ir){var t=arguments[0];this.remove(t.getDirEdge(0)),this.remove(t.getDirEdge(1)),this.edges.remove(t),t.remove()}else if(arguments[0]instanceof wr){var e=arguments[0],n=e.getSym();null!==n&&n.setSym(null),e.getFromNode().remove(e),e.remove(),this.dirEdges.remove(e)}else if(arguments[0]instanceof Cr){for(var i=arguments[0],r=i.getOutEdges().getEdges(),o=r.iterator();o.hasNext();){var s=o.next(),n=s.getSym();null!==n&&this.remove(n),this.dirEdges.remove(s);var a=s.getEdge();null!==a&&this.edges.remove(a)}this.nodeMap.remove(i.getCoordinate()),i.remove()}},findNode:function(t){return this.nodeMap.find(t)},getEdges:function(){return this.edges},nodeIterator:function(){return this.nodeMap.iterator()},contains:function(){if(arguments[0]instanceof Ir){var t=arguments[0];return this.edges.contains(t)}if(arguments[0]instanceof wr){var e=arguments[0];return this.dirEdges.contains(e)}},add:function(){if(arguments[0]instanceof Cr){var t=arguments[0];this.nodeMap.add(t)}else if(arguments[0]instanceof Ir){var e=arguments[0];this.edges.add(e),this.add(e.getDirEdge(0)),this.add(e.getDirEdge(1))}else if(arguments[0]instanceof wr){var n=arguments[0];this.dirEdges.add(n)}},getNodes:function(){return this.nodeMap.values()},interfaces_:function(){return[]},getClass:function(){return Lr}}),c(Rr,Lr),e(Rr.prototype,{addEdge:function(t){if(t.isEmpty())return null;var e=U.removeRepeatedPoints(t.getCoordinates());if(e.length<=1)return null;var n=e[0],i=e[e.length-1],r=this.getNode(n),o=this.getNode(i),s=new br(r,o,e[1],!0),a=new br(o,r,e[e.length-2],!1),u=new Sr(t);u.setDirectedEdges(s,a),this.add(u)},getNode:function(t){var e=this.findNode(t);return null===e&&(e=new Cr(t),this.add(e)),e},interfaces_:function(){return[]},getClass:function(){return Rr}}),e(Pr.prototype,{buildEdgeStringsForUnprocessedNodes:function(){for(var t=this.graph.getNodes().iterator();t.hasNext();){var e=t.next();e.isMarked()||(f.isTrue(2===e.getDegree()),this.buildEdgeStringsStartingAt(e),e.setMarked(!0))}},buildEdgeStringsForNonDegree2Nodes:function(){for(var t=this.graph.getNodes().iterator();t.hasNext();){var e=t.next();2!==e.getDegree()&&(this.buildEdgeStringsStartingAt(e),e.setMarked(!0))}},buildEdgeStringsForObviousStartNodes:function(){this.buildEdgeStringsForNonDegree2Nodes()},getMergedLineStrings:function(){return this.merge(),this.mergedLineStrings},buildEdgeStringsStartingAt:function(t){for(var e=t.getOutEdges().iterator();e.hasNext();){var n=e.next();n.getEdge().isMarked()||this.edgeStrings.add(this.buildEdgeStringStartingWith(n))}},merge:function(){if(null!==this.mergedLineStrings)return null;Er.setMarked(this.graph.nodeIterator(),!1),Er.setMarked(this.graph.edgeIterator(),!1),this.edgeStrings=new w,this.buildEdgeStringsForObviousStartNodes(),this.buildEdgeStringsForIsolatedLoops(),this.mergedLineStrings=new w;for(var t=this.edgeStrings.iterator();t.hasNext();){var e=t.next();this.mergedLineStrings.add(e.toLineString())}},buildEdgeStringStartingWith:function(t){var e=new xr(this.factory),n=t;do{e.add(n),n.getEdge().setMarked(!0),n=n.getNext()}while(null!==n&&n!==t);return e},add:function(){if(arguments[0]instanceof G){arguments[0].apply({interfaces_:function(){return[k]},filter:function(t){t instanceof Nt&&this.add(t)}})}else if(M(arguments[0],v)){var t=arguments[0];this.mergedLineStrings=null;for(var e=t.iterator();e.hasNext();){var n=e.next();this.add(n)}}else if(arguments[0]instanceof Nt){var i=arguments[0];null===this.factory&&(this.factory=i.getFactory()),this.graph.addEdge(i)}},buildEdgeStringsForIsolatedLoops:function(){this.buildEdgeStringsForUnprocessedNodes()},interfaces_:function(){return[]},getClass:function(){return Pr}});var Ns=Object.freeze({LineMerger:Pr}),Cs=Object.freeze({OverlayOp:ni});c(Tr,wr),e(Tr.prototype,{getNext:function(){return this.next},isInRing:function(){return null!==this.edgeRing},setRing:function(t){this.edgeRing=t},setLabel:function(t){this.label=t},getLabel:function(){return this.label},setNext:function(t){this.next=t},getRing:function(){return this.edgeRing},interfaces_:function(){return[]},getClass:function(){return Tr}}),c(Or,Ir),e(Or.prototype,{getLine:function(){return this.line},interfaces_:function(){return[]},getClass:function(){return Or}}),e(_r.prototype,{visitInteriorRing:function(t,e){var n=t.getCoordinates(),i=n[0],r=_r.findDifferentPoint(n,i),o=e.findEdgeInSameDirection(i,r),s=e.findEdgeEnd(o),a=null;s.getLabel().getLocation(0,cn.RIGHT)===S.INTERIOR?a=s:s.getSym().getLabel().getLocation(0,cn.RIGHT)===S.INTERIOR&&(a=s.getSym()),f.isTrue(null!==a,"unable to find dirEdge with Interior on RHS"),this.visitLinkedDirectedEdges(a)},visitShellInteriors:function(t,e){if(t instanceof Lt){var n=t;this.visitInteriorRing(n.getExteriorRing(),e)}if(t instanceof Tt)for(var i=t,r=0;r<i.getNumGeometries();r++){var n=i.getGeometryN(r);this.visitInteriorRing(n.getExteriorRing(),e)}},getCoordinate:function(){return this.disconnectedRingcoord},setInteriorEdgesInResult:function(t){for(var e=t.getEdgeEnds().iterator();e.hasNext();){var n=e.next();n.getLabel().getLocation(0,cn.RIGHT)===S.INTERIOR&&n.setInResult(!0)}},visitLinkedDirectedEdges:function(t){var e=t,n=t;do{f.isTrue(null!==n,"found null Directed Edge"),n.setVisited(!0),n=n.getNext()}while(n!==e)},buildEdgeRings:function(t){for(var e=new w,n=t.iterator();n.hasNext();){var i=n.next();if(i.isInResult()&&null===i.getEdgeRing()){var r=new gn(i,this.geometryFactory);r.linkDirectedEdgesForMinimalEdgeRings();var o=r.buildMinimalRings();e.addAll(o)}}return e},hasUnvisitedShellEdge:function(t){for(var e=0;e<t.size();e++){var n=t.get(e);if(!n.isHole()){var i=n.getEdges(),r=i.get(0);if(r.getLabel().getLocation(0,cn.RIGHT)===S.INTERIOR)for(var o=0;o<i.size();o++)if(r=i.get(o),!r.isVisited())return this.disconnectedRingcoord=r.getCoordinate(),!0}}return!1},isInteriorsConnected:function(){var t=new w;this.geomGraph.computeSplitEdges(t);var e=new bn(new Pn);e.addEdges(t),this.setInteriorEdgesInResult(e),e.linkResultDirectedEdges();var n=this.buildEdgeRings(e.getEdgeEnds());return this.visitShellInteriors(this.geomGraph.getGeometry(),e),!this.hasUnvisitedShellEdge(n)},interfaces_:function(){return[]},getClass:function(){return _r}}),_r.findDifferentPoint=function(t,e){for(var n=0;n<t.length;n++)if(!t[n].equals(e))return t[n];return null},e(Ar.prototype,{createEdgeEndForNext:function(t,e,n,i){var r=n.segmentIndex+1;if(r>=t.getNumPoints()&&null===i)return null;var o=t.getCoordinate(r);null!==i&&i.segmentIndex===n.segmentIndex&&(o=i.coord);var s=new xn(t,n.coord,o,new fn(t.getLabel()));e.add(s)},createEdgeEndForPrev:function(t,e,n,i){var r=n.segmentIndex;if(0===n.dist){if(0===r)return null;r--}var o=t.getCoordinate(r);null!==i&&i.segmentIndex>=r&&(o=i.coord);var s=new fn(t.getLabel());s.flip();var a=new xn(t,n.coord,o,s);e.add(a)},computeEdgeEnds:function(){if(1===arguments.length){for(var t=arguments[0],e=new w,n=t;n.hasNext();){var i=n.next();this.computeEdgeEnds(i,e)}return e}if(2===arguments.length){var r=arguments[0],o=arguments[1],s=r.getEdgeIntersectionList();s.addEndpoints();var a=s.iterator(),u=null,l=null;if(!a.hasNext())return null;var c=a.next();do{u=l,l=c,c=null,a.hasNext()&&(c=a.next()),null!==l&&(this.createEdgeEndForPrev(r,o,l,u),this.createEdgeEndForNext(r,o,l,c))}while(null!==l)}},interfaces_:function(){return[]},getClass:function(){return Ar}}),c(Dr,xn),e(Dr.prototype,{insert:function(t){this.edgeEnds.add(t)},print:function(t){t.println("EdgeEndBundle--\x3e Label: "+this.label);for(var e=this.iterator();e.hasNext();){e.next().print(t),t.println()}},iterator:function(){return this.edgeEnds.iterator()},getEdgeEnds:function(){return this.edgeEnds},computeLabelOn:function(t,e){for(var n=0,i=!1,r=this.iterator();r.hasNext();){var o=r.next(),s=o.getLabel().getLocation(t);s===S.BOUNDARY&&n++,s===S.INTERIOR&&(i=!0)}var s=S.NONE;i&&(s=S.INTERIOR),n>0&&(s=Qn.determineBoundary(e,n)),this.label.setLocation(t,s)},computeLabelSide:function(t,e){for(var n=this.iterator();n.hasNext();){var i=n.next();if(i.getLabel().isArea()){var r=i.getLabel().getLocation(t,e);if(r===S.INTERIOR)return this.label.setLocation(t,e,S.INTERIOR),null;r===S.EXTERIOR&&this.label.setLocation(t,e,S.EXTERIOR)}}},getLabel:function(){return this.label},computeLabelSides:function(t){this.computeLabelSide(t,cn.LEFT),this.computeLabelSide(t,cn.RIGHT)},updateIM:function(t){Kn.updateIM(this.label,t)},computeLabel:function(t){for(var e=!1,n=this.iterator();n.hasNext();){n.next().getLabel().isArea()&&(e=!0)}this.label=e?new fn(S.NONE,S.NONE,S.NONE):new fn(S.NONE);for(var i=0;i<2;i++)this.computeLabelOn(i,t),e&&this.computeLabelSides(i)},interfaces_:function(){return[]},getClass:function(){return Dr}}),c(Fr,Ln),e(Fr.prototype,{updateIM:function(t){for(var e=this.iterator();e.hasNext();){e.next().updateIM(t)}},insert:function(t){var e=this.edgeMap.get(t);null===e?(e=new Dr(t),this.insertEdgeEnd(t,e)):e.insert(t)},interfaces_:function(){return[]},getClass:function(){return Fr}}),c(qr,yn),e(qr.prototype,{updateIMFromEdges:function(t){this.edges.updateIM(t)},computeIM:function(t){t.setAtLeastIfValid(this.label.getLocation(0),this.label.getLocation(1),0)},interfaces_:function(){return[]},getClass:function(){return qr}}),c(kr,wn),e(kr.prototype,{createNode:function(t){return new qr(t,new Fr)},interfaces_:function(){return[]},getClass:function(){return kr}}),e(Gr.prototype,{insertEdgeEnds:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.nodes.add(n)}},getNodeIterator:function(){return this.nodes.iterator()},copyNodesAndLabels:function(t,e){for(var n=t.getNodeIterator();n.hasNext();){var i=n.next();this.nodes.addNode(i.getCoordinate()).setLabel(e,i.getLabel().getLocation(e))}},build:function(t){this.computeIntersectionNodes(t,0),this.copyNodesAndLabels(t,0);var e=new Ar,n=e.computeEdgeEnds(t.getEdgeIterator());this.insertEdgeEnds(n)},computeIntersectionNodes:function(t,e){for(var n=t.getEdgeIterator();n.hasNext();)for(var i=n.next(),r=i.getLabel().getLocation(e),o=i.getEdgeIntersectionList().iterator();o.hasNext();){var s=o.next(),a=this.nodes.addNode(s.coord);r===S.BOUNDARY?a.setLabelBoundary(e):a.getLabel().isNull(e)&&a.setLabel(e,S.INTERIOR)}},interfaces_:function(){return[]},getClass:function(){return Gr}}),e(jr.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().copy(),!1}return!0},getInvalidPoint:function(){return this.invalidPoint},hasDuplicateRings:function(){for(var t=this.nodeGraph.getNodeIterator();t.hasNext();)for(var e=t.next(),n=e.getEdges().iterator();n.hasNext();){var i=n.next();if(i.getEdgeEnds().size()>1)return this.invalidPoint=i.getEdge().getCoordinate(0),!0}return!1},isNodeConsistentArea:function(){var t=this.geomGraph.computeSelfNodes(this.li,!0,!0);return t.hasProperIntersection()?(this.invalidPoint=t.getProperIntersectionPoint(),!1):(this.nodeGraph.build(this.geomGraph),this.isNodeEdgeAreaLabelsConsistent())},interfaces_:function(){return[]},getClass:function(){return jr}}),e(Br.prototype,{buildIndex:function(){this.index=new Be;for(var t=0;t<this.rings.size();t++){var e=this.rings.get(t),n=e.getEnvelopeInternal();this.index.insert(n,e)}},getNestedPoint:function(){return this.nestedPt},isNonNested:function(){this.buildIndex();for(var t=0;t<this.rings.size();t++)for(var e=this.rings.get(t),n=e.getCoordinates(),i=this.index.query(e.getEnvelopeInternal()),r=0;r<i.size();r++){var o=i.get(r),s=o.getCoordinates();if(e!==o&&e.getEnvelopeInternal().intersects(o.getEnvelopeInternal())){var a=Vr.findPtNotNode(n,o,this.graph);if(null!==a){var u=le.isPointInRing(a,s);if(u)return this.nestedPt=a,!1}}}return!0},add:function(t){this.rings.add(t),this.totalEnv.expandToInclude(t.getEnvelopeInternal())},interfaces_:function(){return[]},getClass:function(){return Br}}),e(zr.prototype,{getErrorType:function(){return this.errorType},getMessage:function(){return zr.errMsg[this.errorType]},getCoordinate:function(){return this.pt},toString:function(){var t="";return null!==this.pt&&(t=" at or near point "+this.pt),this.getMessage()+t},interfaces_:function(){return[]},getClass:function(){return zr}}),zr.ERROR=0,zr.REPEATED_POINT=1,zr.HOLE_OUTSIDE_SHELL=2,zr.NESTED_HOLES=3,zr.DISCONNECTED_INTERIOR=4,zr.SELF_INTERSECTION=5,zr.RING_SELF_INTERSECTION=6,zr.NESTED_SHELLS=7,zr.DUPLICATE_RINGS=8,zr.TOO_FEW_POINTS=9,zr.INVALID_COORDINATE=10,zr.RING_NOT_CLOSED=11,zr.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"],e(Vr.prototype,{checkInvalidCoordinates:function(){if(arguments[0]instanceof Array){for(var t=arguments[0],e=0;e<t.length;e++)if(!Vr.isValid(t[e]))return this.validErr=new zr(zr.INVALID_COORDINATE,t[e]),null}else if(arguments[0]instanceof Lt){var n=arguments[0];if(this.checkInvalidCoordinates(n.getExteriorRing().getCoordinates()),null!==this.validErr)return null;for(var e=0;e<n.getNumInteriorRing();e++)if(this.checkInvalidCoordinates(n.getInteriorRingN(e).getCoordinates()),null!==this.validErr)return null}},checkHolesNotNested:function(t,e){for(var n=new Br(e),i=0;i<t.getNumInteriorRing();i++){var r=t.getInteriorRingN(i);n.add(r)}n.isNonNested()||(this.validErr=new zr(zr.NESTED_HOLES,n.getNestedPoint()))},checkConsistentArea:function(t){var e=new jr(t);return e.isNodeConsistentArea()?void(e.hasDuplicateRings()&&(this.validErr=new zr(zr.DUPLICATE_RINGS,e.getInvalidPoint()))):(this.validErr=new zr(zr.SELF_INTERSECTION,e.getInvalidPoint()),null)},isValid:function(){return this.checkValid(this.parentGeometry),null===this.validErr},checkShellInsideHole:function(t,e,n){var i=t.getCoordinates(),r=e.getCoordinates(),o=Vr.findPtNotNode(i,e,n);if(null!==o){if(!le.isPointInRing(o,r))return o}var s=Vr.findPtNotNode(r,t,n);if(null!==s){return le.isPointInRing(s,i)?s:null}return f.shouldNeverReachHere("points in shell and hole appear to be equal"),null},checkNoSelfIntersectingRings:function(t){for(var e=t.getEdgeIterator();e.hasNext();){var n=e.next();if(this.checkNoSelfIntersectingRing(n.getEdgeIntersectionList()),null!==this.validErr)return null}},checkConnectedInteriors:function(t){var e=new _r(t);e.isInteriorsConnected()||(this.validErr=new zr(zr.DISCONNECTED_INTERIOR,e.getCoordinate()))},checkNoSelfIntersectingRing:function(t){for(var e=new at,n=!0,i=t.iterator();i.hasNext();){var r=i.next();if(n)n=!1;else{if(e.contains(r.coord))return this.validErr=new zr(zr.RING_SELF_INTERSECTION,r.coord),null;e.add(r.coord)}}},checkHolesInShell:function(t,e){for(var n=t.getExteriorRing(),i=new Ei(n),r=0;r<t.getNumInteriorRing();r++){var o=t.getInteriorRingN(r),s=Vr.findPtNotNode(o.getCoordinates(),n,e);if(null===s)return null;if(!i.isInside(s))return this.validErr=new zr(zr.HOLE_OUTSIDE_SHELL,s),null}},checkTooFewPoints:function(t){if(t.hasTooFewPoints())return this.validErr=new zr(zr.TOO_FEW_POINTS,t.getInvalidPoint()),null},getValidationError:function(){return this.checkValid(this.parentGeometry),this.validErr},checkValid:function(){if(arguments[0]instanceof St){var t=arguments[0];this.checkInvalidCoordinates(t.getCoordinates())}else if(arguments[0]instanceof Rt){var e=arguments[0];this.checkInvalidCoordinates(e.getCoordinates())}else if(arguments[0]instanceof Pt){var n=arguments[0];if(this.checkInvalidCoordinates(n.getCoordinates()),null!==this.validErr)return null;if(this.checkClosedRing(n),null!==this.validErr)return null;var i=new Qn(0,n);if(this.checkTooFewPoints(i),null!==this.validErr)return null;var r=new se;i.computeSelfNodes(r,!0,!0),this.checkNoSelfIntersectingRings(i)}else if(arguments[0]instanceof Nt){var o=arguments[0];if(this.checkInvalidCoordinates(o.getCoordinates()),null!==this.validErr)return null;var i=new Qn(0,o);this.checkTooFewPoints(i)}else if(arguments[0]instanceof Lt){var s=arguments[0];if(this.checkInvalidCoordinates(s),null!==this.validErr)return null;if(this.checkClosedRings(s),null!==this.validErr)return null;var i=new Qn(0,s);if(this.checkTooFewPoints(i),null!==this.validErr)return null;if(this.checkConsistentArea(i),null!==this.validErr)return null;if(!this.isSelfTouchingRingFormingHoleValid&&(this.checkNoSelfIntersectingRings(i),null!==this.validErr))return null;if(this.checkHolesInShell(s,i),null!==this.validErr)return null;if(this.checkHolesNotNested(s,i),null!==this.validErr)return null;this.checkConnectedInteriors(i)}else if(arguments[0]instanceof Tt){for(var a=arguments[0],u=0;u<a.getNumGeometries();u++){var l=a.getGeometryN(u);if(this.checkInvalidCoordinates(l),null!==this.validErr)return null;if(this.checkClosedRings(l),null!==this.validErr)return null}var i=new Qn(0,a);if(this.checkTooFewPoints(i),null!==this.validErr)return null;if(this.checkConsistentArea(i),null!==this.validErr)return null;if(!this.isSelfTouchingRingFormingHoleValid&&(this.checkNoSelfIntersectingRings(i),null!==this.validErr))return null;for(var u=0;u<a.getNumGeometries();u++){var l=a.getGeometryN(u);if(this.checkHolesInShell(l,i),null!==this.validErr)return null}for(var u=0;u<a.getNumGeometries();u++){var l=a.getGeometryN(u);if(this.checkHolesNotNested(l,i),null!==this.validErr)return null}if(this.checkShellsNotNested(a,i),null!==this.validErr)return null;this.checkConnectedInteriors(i)}else if(arguments[0]instanceof ft)for(var c=arguments[0],u=0;u<c.getNumGeometries();u++){var h=c.getGeometryN(u);if(this.checkValid(h),null!==this.validErr)return null}else if(arguments[0]instanceof G){var f=arguments[0];if(this.validErr=null,f.isEmpty())return null;if(f instanceof St)this.checkValid(f);else if(f instanceof Rt)this.checkValid(f);else if(f instanceof Pt)this.checkValid(f);else if(f instanceof Nt)this.checkValid(f);else if(f instanceof Lt)this.checkValid(f);else if(f instanceof Tt)this.checkValid(f);else{if(!(f instanceof ft))throw new UnsupportedOperationException(f.getClass().getName());this.checkValid(f)}}},setSelfTouchingRingFormingHoleValid:function(t){this.isSelfTouchingRingFormingHoleValid=t},checkShellNotNested:function(t,e,n){var i=t.getCoordinates(),r=e.getExteriorRing(),o=r.getCoordinates(),s=Vr.findPtNotNode(i,r,n);if(null===s)return null;if(!le.isPointInRing(s,o))return null;if(e.getNumInteriorRing()<=0)return this.validErr=new zr(zr.NESTED_SHELLS,s),null;for(var a=null,u=0;u<e.getNumInteriorRing();u++){var l=e.getInteriorRingN(u);if(null===(a=this.checkShellInsideHole(t,l,n)))return null}this.validErr=new zr(zr.NESTED_SHELLS,a)},checkClosedRings:function(t){if(this.checkClosedRing(t.getExteriorRing()),null!==this.validErr)return null;for(var e=0;e<t.getNumInteriorRing();e++)if(this.checkClosedRing(t.getInteriorRingN(e)),null!==this.validErr)return null},checkClosedRing:function(t){if(!t.isClosed()){var e=null;t.getNumPoints()>=1&&(e=t.getCoordinateN(0)),this.validErr=new zr(zr.RING_NOT_CLOSED,e)}},checkShellsNotNested:function(t,e){for(var n=0;n<t.getNumGeometries();n++)for(var i=t.getGeometryN(n),r=i.getExteriorRing(),o=0;o<t.getNumGeometries();o++)if(n!==o){var s=t.getGeometryN(o);if(this.checkShellNotNested(r,s,e),null!==this.validErr)return null}},interfaces_:function(){return[]},getClass:function(){return Vr}}),Vr.findPtNotNode=function(t,e,n){for(var i=n.findEdge(e),r=i.getEdgeIntersectionList(),o=0;o<t.length;o++){var s=t[o];if(!r.isIntersection(s))return s}return null},Vr.isValid=function(){if(arguments[0]instanceof G){return new Vr(arguments[0]).isValid()}if(arguments[0]instanceof p){var t=arguments[0];return!(r.isNaN(t.x)||r.isInfinite(t.x)||r.isNaN(t.y)||r.isInfinite(t.y))}},e(Xr.prototype,{isIncluded:function(){return this._isIncluded},getCoordinates:function(){if(null===this.ringPts){for(var t=new b,e=this.deList.iterator();e.hasNext();){var n=e.next(),i=n.getEdge();Xr.addEdge(i.getLine().getCoordinates(),n.getEdgeDirection(),t)}this.ringPts=t.toCoordinateArray()}return this.ringPts},isIncludedSet:function(){return this._isIncludedSet},isValid:function(){return this.getCoordinates(),!(this.ringPts.length<=3)&&(this.getRing(),Vr.isValid(this.ring))},build:function(t){var e=t;do{this.add(e),e.setRing(this),e=e.getNext(),f.isTrue(null!==e,"found null DE in ring"),f.isTrue(e===t||!e.isInRing(),"found DE already in ring")}while(e!==t)},isOuterHole:function(){return!!this._isHole&&!this.hasShell()},getPolygon:function(){var t=null;if(null!==this.holes){t=new Array(this.holes.size()).fill(null);for(var e=0;e<this.holes.size();e++)t[e]=this.holes.get(e)}return this.factory.createPolygon(this.ring,t)},isHole:function(){return this._isHole},isProcessed:function(){return this._isProcessed},addHole:function(){if(arguments[0]instanceof Pt){var t=arguments[0];null===this.holes&&(this.holes=new w),this.holes.add(t)}else if(arguments[0]instanceof Xr){var e=arguments[0];e.setShell(this);var n=e.getRing();null===this.holes&&(this.holes=new w),this.holes.add(n)}},setIncluded:function(t){this._isIncluded=t,this._isIncludedSet=!0},getOuterHole:function(){if(this.isHole())return null;for(var t=0;t<this.deList.size();t++){var e=this.deList.get(t),n=e.getSym().getRing();if(n.isOuterHole())return n}return null},computeHole:function(){var t=this.getRing();this._isHole=le.isCCW(t.getCoordinates())},hasShell:function(){return null!==this.shell},isOuterShell:function(){return null!==this.getOuterHole()},getLineString:function(){return this.getCoordinates(),this.factory.createLineString(this.ringPts)},toString:function(){return re.toLineString(new qt(this.getCoordinates()))},getShell:function(){return this.isHole()?this.shell:this},add:function(t){this.deList.add(t)},getRing:function(){if(null!==this.ring)return this.ring;this.getCoordinates(),this.ringPts.length<3&&D.out.println(this.ringPts);try{this.ring=this.factory.createLinearRing(this.ringPts)}catch(t){if(!(t instanceof N))throw t;D.out.println(this.ringPts)}return this.ring},updateIncluded:function(){if(this.isHole())return null;for(var t=0;t<this.deList.size();t++){var e=this.deList.get(t),n=e.getSym().getRing().getShell();if(null!==n&&n.isIncludedSet())return this.setIncluded(!n.isIncluded()),null}},setShell:function(t){this.shell=t},setProcessed:function(t){this._isProcessed=t},interfaces_:function(){return[]},getClass:function(){return Xr}}),Xr.findDirEdgesInRing=function(t){var e=t,n=new w;do{n.add(e),e=e.getNext(),f.isTrue(null!==e,"found null DE in ring"),f.isTrue(e===t||!e.isInRing(),"found DE already in ring")}while(e!==t);return n},Xr.addEdge=function(t,e,n){if(e)for(var i=0;i<t.length;i++)n.add(t[i],!1);else for(var i=t.length-1;i>=0;i--)n.add(t[i],!1)},Xr.findEdgeRingContaining=function(t,e){for(var n=t.getRing(),i=n.getEnvelopeInternal(),r=n.getCoordinateN(0),o=null,s=null,a=e.iterator();a.hasNext();){var u=a.next(),l=u.getRing(),c=l.getEnvelopeInternal();if(!c.equals(i)&&c.contains(i)){r=U.ptNotInList(n.getCoordinates(),l.getCoordinates());var h=!1;le.isPointInRing(r,l.getCoordinates())&&(h=!0),h&&(null===o||s.contains(c))&&(o=u,s=o.getRing().getEnvelopeInternal())}}return o},e(Yr.prototype,{compare:function(t,e){var n=t,i=e;return n.getRing().getEnvelope().compareTo(i.getRing().getEnvelope())},interfaces_:function(){return[a]},getClass:function(){return Yr}}),Xr.EnvelopeComparator=Yr,c(Ur,Lr),e(Ur.prototype,{findEdgeRing:function(t){var e=new Xr(this.factory);return e.build(t),e},computeDepthParity:function(){if(0===arguments.length)for(;;){return null}else 1===arguments.length&&arguments[0]},computeNextCWEdges:function(){for(var t=this.nodeIterator();t.hasNext();){var e=t.next();Ur.computeNextCWEdges(e)}},addEdge:function(t){if(t.isEmpty())return null;var e=U.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return null;var n=e[0],i=e[e.length-1],r=this.getNode(n),o=this.getNode(i),s=new Tr(r,o,e[1],!0),a=new Tr(o,r,e[e.length-2],!1),u=new Or(t);u.setDirectedEdges(s,a),this.add(u)},deleteCutEdges:function(){this.computeNextCWEdges(),Ur.findLabeledEdgeRings(this.dirEdges);for(var t=new w,e=this.dirEdges.iterator();e.hasNext();){var n=e.next();if(!n.isMarked()){var i=n.getSym();if(n.getLabel()===i.getLabel()){n.setMarked(!0),i.setMarked(!0);var r=n.getEdge();t.add(r.getLine())}}}return t},getEdgeRings:function(){this.computeNextCWEdges(),Ur.label(this.dirEdges,-1);var t=Ur.findLabeledEdgeRings(this.dirEdges);this.convertMaximalToMinimalEdgeRings(t);for(var e=new w,n=this.dirEdges.iterator();n.hasNext();){var i=n.next();if(!i.isMarked()&&!i.isInRing()){var r=this.findEdgeRing(i);e.add(r)}}return e},getNode:function(t){var e=this.findNode(t);return null===e&&(e=new Cr(t),this.add(e)),e},convertMaximalToMinimalEdgeRings:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),i=n.getLabel(),r=Ur.findIntersectionNodes(n,i);if(null!==r)for(var o=r.iterator();o.hasNext();){var s=o.next();Ur.computeNextCCWEdges(s,i)}}},deleteDangles:function(){for(var t=this.findNodesOfDegree(1),e=new Q,n=new de,i=t.iterator();i.hasNext();)n.push(i.next());for(;!n.isEmpty();){var r=n.pop();Ur.deleteAllEdges(r);for(var o=r.getOutEdges().getEdges(),i=o.iterator();i.hasNext();){var s=i.next();s.setMarked(!0);var a=s.getSym();null!==a&&a.setMarked(!0);var u=s.getEdge();e.add(u.getLine());var l=s.getToNode();1===Ur.getDegreeNonDeleted(l)&&n.push(l)}}return e},interfaces_:function(){return[]},getClass:function(){return Ur}}),Ur.findLabeledEdgeRings=function(t){for(var e=new w,n=1,i=t.iterator();i.hasNext();){var r=i.next();if(!(r.isMarked()||r.getLabel()>=0)){e.add(r);var o=Xr.findDirEdgesInRing(r);Ur.label(o,n),n++}}return e},Ur.getDegreeNonDeleted=function(t){for(var e=t.getOutEdges().getEdges(),n=0,i=e.iterator();i.hasNext();){i.next().isMarked()||n++}return n},Ur.deleteAllEdges=function(t){for(var e=t.getOutEdges().getEdges(),n=e.iterator();n.hasNext();){var i=n.next();i.setMarked(!0);var r=i.getSym();null!==r&&r.setMarked(!0)}},Ur.label=function(t,e){
for(var n=t.iterator();n.hasNext();){n.next().setLabel(e)}},Ur.computeNextCWEdges=function(t){for(var e=t.getOutEdges(),n=null,i=null,r=e.getEdges().iterator();r.hasNext();){var o=r.next();if(!o.isMarked()){if(null===n&&(n=o),null!==i){var s=i.getSym();s.setNext(o)}i=o}}if(null!==i){var s=i.getSym();s.setNext(n)}},Ur.computeNextCCWEdges=function(t,e){for(var n=t.getOutEdges(),i=null,r=null,o=n.getEdges(),s=o.size()-1;s>=0;s--){var a=o.get(s),u=a.getSym(),l=null;a.getLabel()===e&&(l=a);var c=null;u.getLabel()===e&&(c=u),null===l&&null===c||(null!==c&&(r=c),null!==l&&(null!==r&&(r.setNext(l),r=null),null===i&&(i=l)))}null!==r&&(f.isTrue(null!==i),r.setNext(i))},Ur.getDegree=function(t,e){for(var n=t.getOutEdges().getEdges(),i=0,r=n.iterator();r.hasNext();){r.next().getLabel()===e&&i++}return i},Ur.findIntersectionNodes=function(t,e){var n=t,i=null;do{var r=n.getFromNode();Ur.getDegree(r,e)>1&&(null===i&&(i=new w),i.add(r)),n=n.getNext(),f.isTrue(null!==n,"found null DE in ring"),f.isTrue(n===t||!n.isInRing(),"found DE already in ring")}while(n!==t);return i},e(Wr.prototype,{getGeometry:function(){return null===this.geomFactory&&(this.geomFactory=new ne),this.polygonize(),this.extractOnlyPolygonal?this.geomFactory.buildGeometry(this.polyList):this.geomFactory.createGeometryCollection(ne.toGeometryArray(this.polyList))},getInvalidRingLines:function(){return this.polygonize(),this.invalidRingLines},findValidRings:function(t,e,n){for(var i=t.iterator();i.hasNext();){var r=i.next();r.isValid()?e.add(r):n.add(r.getLineString())}},polygonize:function(){if(null!==this.polyList)return null;if(this.polyList=new w,null===this.graph)return null;this.dangles=this.graph.deleteDangles(),this.cutEdges=this.graph.deleteCutEdges();var t=this.graph.getEdgeRings(),e=new w;this.invalidRingLines=new w,this.isCheckingRingsValid?this.findValidRings(t,e,this.invalidRingLines):e=t,this.findShellsAndHoles(e),Wr.assignHolesToShells(this.holeList,this.shellList),ls.sort(this.shellList,new Xr.EnvelopeComparator);var n=!0;this.extractOnlyPolygonal&&(Wr.findDisjointShells(this.shellList),n=!1),this.polyList=Wr.extractPolygons(this.shellList,n)},getDangles:function(){return this.polygonize(),this.dangles},getCutEdges:function(){return this.polygonize(),this.cutEdges},getPolygons:function(){return this.polygonize(),this.polyList},add:function(){if(M(arguments[0],v))for(var t=arguments[0],e=t.iterator();e.hasNext();){var n=e.next();this.add(n)}else if(arguments[0]instanceof Nt){var i=arguments[0];this.geomFactory=i.getFactory(),null===this.graph&&(this.graph=new Ur(this.geomFactory)),this.graph.addEdge(i)}else if(arguments[0]instanceof G){var r=arguments[0];r.apply(this.lineStringAdder)}},setCheckRingsValid:function(t){this.isCheckingRingsValid=t},findShellsAndHoles:function(t){this.holeList=new w,this.shellList=new w;for(var e=t.iterator();e.hasNext();){var n=e.next();n.computeHole(),n.isHole()?this.holeList.add(n):this.shellList.add(n)}},interfaces_:function(){return[]},getClass:function(){return Wr}}),Wr.findOuterShells=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),i=n.getOuterHole();null===i||i.isProcessed()||(n.setIncluded(!0),i.setProcessed(!0))}},Wr.extractPolygons=function(t,e){for(var n=new w,i=t.iterator();i.hasNext();){var r=i.next();(e||r.isIncluded())&&n.add(r.getPolygon())}return n},Wr.assignHolesToShells=function(t,e){for(var n=t.iterator();n.hasNext();){var i=n.next();Wr.assignHoleToShell(i,e)}},Wr.assignHoleToShell=function(t,e){var n=Xr.findEdgeRingContaining(t,e);null!==n&&n.addHole(t)},Wr.findDisjointShells=function(t){Wr.findOuterShells(t);var e=null;do{e=!1;for(var n=t.iterator();n.hasNext();){var i=n.next();i.isIncludedSet()||(i.updateIncluded(),i.isIncludedSet()||(e=!0))}}while(e)},e(Hr.prototype,{filter:function(t){t instanceof Nt&&this.p.add(t)},interfaces_:function(){return[k]},getClass:function(){return Hr}}),Wr.LineStringAdder=Hr;var Ss=Object.freeze({Polygonizer:Wr});e(Jr.prototype,{insertEdgeEnds:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.nodes.add(n)}},computeProperIntersectionIM:function(t,e){var n=this.arg[0].getGeometry().getDimension(),i=this.arg[1].getGeometry().getDimension(),r=t.hasProperIntersection(),o=t.hasProperInteriorIntersection();2===n&&2===i?r&&e.setAtLeast("212101212"):2===n&&1===i?(r&&e.setAtLeast("FFF0FFFF2"),o&&e.setAtLeast("1FFFFF1FF")):1===n&&2===i?(r&&e.setAtLeast("F0FFFFFF2"),o&&e.setAtLeast("1F1FFFFFF")):1===n&&1===i&&o&&e.setAtLeast("0FFFFFFFF")},labelIsolatedEdges:function(t,e){for(var n=this.arg[t].getEdgeIterator();n.hasNext();){var i=n.next();i.isIsolated()&&(this.labelIsolatedEdge(i,e,this.arg[e].getGeometry()),this.isolatedEdges.add(i))}},labelIsolatedEdge:function(t,e,n){if(n.getDimension()>0){var i=this.ptLocator.locate(t.getCoordinate(),n);t.getLabel().setAllLocations(e,i)}else t.getLabel().setAllLocations(e,S.EXTERIOR)},computeIM:function(){var t=new he;if(t.set(S.EXTERIOR,S.EXTERIOR,2),!this.arg[0].getGeometry().getEnvelopeInternal().intersects(this.arg[1].getGeometry().getEnvelopeInternal()))return this.computeDisjointIM(t),t;this.arg[0].computeSelfNodes(this.li,!1),this.arg[1].computeSelfNodes(this.li,!1);var e=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(e,t);var n=new Ar,i=n.computeEdgeEnds(this.arg[0].getEdgeIterator());this.insertEdgeEnds(i);var r=n.computeEdgeEnds(this.arg[1].getEdgeIterator());return this.insertEdgeEnds(r),this.labelNodeEdges(),this.labelIsolatedEdges(0,1),this.labelIsolatedEdges(1,0),this.updateIM(t),t},labelNodeEdges:function(){for(var t=this.nodes.iterator();t.hasNext();){t.next().getEdges().computeLabelling(this.arg)}},copyNodesAndLabels:function(t){for(var e=this.arg[t].getNodeIterator();e.hasNext();){var n=e.next();this.nodes.addNode(n.getCoordinate()).setLabel(t,n.getLabel().getLocation(t))}},labelIntersectionNodes:function(t){for(var e=this.arg[t].getEdgeIterator();e.hasNext();)for(var n=e.next(),i=n.getLabel().getLocation(t),r=n.getEdgeIntersectionList().iterator();r.hasNext();){var o=r.next(),s=this.nodes.find(o.coord);s.getLabel().isNull(t)&&(i===S.BOUNDARY?s.setLabelBoundary(t):s.setLabel(t,S.INTERIOR))}},labelIsolatedNode:function(t,e){var n=this.ptLocator.locate(t.getCoordinate(),this.arg[e].getGeometry());t.getLabel().setAllLocations(e,n)},computeIntersectionNodes:function(t){for(var e=this.arg[t].getEdgeIterator();e.hasNext();)for(var n=e.next(),i=n.getLabel().getLocation(t),r=n.getEdgeIntersectionList().iterator();r.hasNext();){var o=r.next(),s=this.nodes.addNode(o.coord);i===S.BOUNDARY?s.setLabelBoundary(t):s.getLabel().isNull(t)&&s.setLabel(t,S.INTERIOR)}},labelIsolatedNodes:function(){for(var t=this.nodes.iterator();t.hasNext();){var e=t.next(),n=e.getLabel();f.isTrue(n.getGeometryCount()>0,"node with empty label found"),e.isIsolated()&&(n.isNull(0)?this.labelIsolatedNode(e,0):this.labelIsolatedNode(e,1))}},updateIM:function(t){for(var e=this.isolatedEdges.iterator();e.hasNext();){e.next().updateIM(t)}for(var n=this.nodes.iterator();n.hasNext();){var i=n.next();i.updateIM(t),i.updateIMFromEdges(t)}},computeDisjointIM:function(t){var e=this.arg[0].getGeometry();e.isEmpty()||(t.set(S.INTERIOR,S.EXTERIOR,e.getDimension()),t.set(S.BOUNDARY,S.EXTERIOR,e.getBoundaryDimension()));var n=this.arg[1].getGeometry();n.isEmpty()||(t.set(S.EXTERIOR,S.INTERIOR,n.getDimension()),t.set(S.EXTERIOR,S.BOUNDARY,n.getBoundaryDimension()))},interfaces_:function(){return[]},getClass:function(){return Jr}}),e(Zr.prototype,{isContainedInBoundary:function(t){if(t instanceof Lt)return!1;if(t instanceof St)return this.isPointContainedInBoundary(t);if(t instanceof Nt)return this.isLineStringContainedInBoundary(t);for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);if(!this.isContainedInBoundary(n))return!1}return!0},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},isLineStringContainedInBoundary:function(t){for(var e=t.getCoordinateSequence(),n=new p,i=new p,r=0;r<e.size()-1;r++)if(e.getCoordinate(r,n),e.getCoordinate(r+1,i),!this.isLineSegmentContainedInBoundary(n,i))return!1;return!0},isPointContainedInBoundary:function(){if(arguments[0]instanceof St){var t=arguments[0];return this.isPointContainedInBoundary(t.getCoordinate())}if(arguments[0]instanceof p){var e=arguments[0];return e.x===this.rectEnv.getMinX()||e.x===this.rectEnv.getMaxX()||e.y===this.rectEnv.getMinY()||e.y===this.rectEnv.getMaxY()}},contains:function(t){return!!this.rectEnv.contains(t.getEnvelopeInternal())&&!this.isContainedInBoundary(t)},interfaces_:function(){return[]},getClass:function(){return Zr}}),Zr.contains=function(t,e){return new Zr(t).contains(e)},e(Kr.prototype,{intersects:function(t,e){var n=new I(t,e);if(!this.rectEnv.intersects(n))return!1;if(this.rectEnv.intersects(t))return!0;if(this.rectEnv.intersects(e))return!0;if(t.compareTo(e)>0){var i=t;t=e,e=i}var r=!1;return e.y>t.y&&(r=!0),r?this.li.computeIntersection(t,e,this.diagDown0,this.diagDown1):this.li.computeIntersection(t,e,this.diagUp0,this.diagUp1),!!this.li.hasIntersection()},interfaces_:function(){return[]},getClass:function(){return Kr}}),e(Qr.prototype,{applyTo:function(t){for(var e=0;e<t.getNumGeometries()&&!this._isDone;e++){var n=t.getGeometryN(e);if(n instanceof ft)this.applyTo(n);else if(this.visit(n),this.isDone())return this._isDone=!0,null}},interfaces_:function(){return[]},getClass:function(){return Qr}}),e($r.prototype,{intersects:function(t){if(!this.rectEnv.intersects(t.getEnvelopeInternal()))return!1;var e=new to(this.rectEnv);if(e.applyTo(t),e.intersects())return!0;var n=new eo(this.rectangle);if(n.applyTo(t),n.containsPoint())return!0;var i=new no(this.rectangle);return i.applyTo(t),!!i.intersects()},interfaces_:function(){return[]},getClass:function(){return $r}}),$r.intersects=function(t,e){return new $r(t).intersects(e)},c(to,Qr),e(to.prototype,{isDone:function(){return!0===this._intersects},visit:function(t){var e=t.getEnvelopeInternal();return this.rectEnv.intersects(e)?this.rectEnv.contains(e)?(this._intersects=!0,null):e.getMinX()>=this.rectEnv.getMinX()&&e.getMaxX()<=this.rectEnv.getMaxX()?(this._intersects=!0,null):e.getMinY()>=this.rectEnv.getMinY()&&e.getMaxY()<=this.rectEnv.getMaxY()?(this._intersects=!0,null):void 0:null},intersects:function(){return this._intersects},interfaces_:function(){return[]},getClass:function(){return to}}),c(eo,Qr),e(eo.prototype,{isDone:function(){return!0===this._containsPoint},visit:function(t){if(!(t instanceof Lt))return null;var e=t.getEnvelopeInternal();if(!this.rectEnv.intersects(e))return null;for(var n=new p,i=0;i<4;i++)if(this.rectSeq.getCoordinate(i,n),e.contains(n)&&Mn.containsPointInPolygon(n,t))return this._containsPoint=!0,null},containsPoint:function(){return this._containsPoint},interfaces_:function(){return[]},getClass:function(){return eo}}),c(no,Qr),e(no.prototype,{intersects:function(){return this.hasIntersection},isDone:function(){return!0===this.hasIntersection},visit:function(t){var e=t.getEnvelopeInternal();if(!this.rectEnv.intersects(e))return null;var n=Bn.getLines(t);this.checkIntersectionWithLineStrings(n)},checkIntersectionWithLineStrings:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();if(this.checkIntersectionWithSegments(n),this.hasIntersection)return null}},checkIntersectionWithSegments:function(t){for(var e=t.getCoordinateSequence(),n=1;n<e.size();n++)if(e.getCoordinate(n-1,this.p0),e.getCoordinate(n,this.p1),this.rectIntersector.intersects(this.p0,this.p1))return this.hasIntersection=!0,null},interfaces_:function(){return[]},getClass:function(){return no}}),c(io,$n),e(io.prototype,{getIntersectionMatrix:function(){return this._relate.computeIM()},interfaces_:function(){return[]},getClass:function(){return io}}),io.covers=function(t,e){return!!t.getEnvelopeInternal().covers(e.getEnvelopeInternal())&&(!!t.isRectangle()||io.relate(t,e).isCovers())},io.intersects=function(t,e){return!!t.getEnvelopeInternal().intersects(e.getEnvelopeInternal())&&(t.isRectangle()?$r.intersects(t,e):e.isRectangle()?$r.intersects(e,t):io.relate(t,e).isIntersects())},io.touches=function(t,e){return!!t.getEnvelopeInternal().intersects(e.getEnvelopeInternal())&&io.relate(t,e).isTouches(t.getDimension(),e.getDimension())},io.within=function(t,e){return e.contains(t)},io.coveredBy=function(t,e){return io.covers(e,t)},io.relate=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new io(t,e),i=n.getIntersectionMatrix();return i}if(3===arguments.length){if("string"==typeof arguments[2]&&arguments[0]instanceof G&&arguments[1]instanceof G){var r=arguments[0],o=arguments[1],s=arguments[2];return io.relateWithCheck(r,o).matches(s)}if(M(arguments[2],B)&&arguments[0]instanceof G&&arguments[1]instanceof G){var a=arguments[0],u=arguments[1],l=arguments[2],n=new io(a,u,l),i=n.getIntersectionMatrix();return i}}},io.overlaps=function(t,e){return!!t.getEnvelopeInternal().intersects(e.getEnvelopeInternal())&&io.relate(t,e).isOverlaps(t.getDimension(),e.getDimension())},io.disjoint=function(t,e){return!t.intersects(e)},io.relateWithCheck=function(t,e){return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),io.relate(t,e)},io.crosses=function(t,e){return!!t.getEnvelopeInternal().intersects(e.getEnvelopeInternal())&&io.relate(t,e).isCrosses(t.getDimension(),e.getDimension())},io.contains=function(t,e){return!!t.getEnvelopeInternal().contains(e.getEnvelopeInternal())&&(t.isRectangle()?Zr.contains(t,e):io.relate(t,e).isContains())};var Ms=Object.freeze({RelateOp:io});e(ro.prototype,{extractElements:function(t,e){if(null===t)return null;for(var n=0;n<t.getNumGeometries();n++){var i=t.getGeometryN(n);this.skipEmpty&&i.isEmpty()||e.add(i)}},combine:function(){for(var t=new w,e=this.inputGeoms.iterator();e.hasNext();){var n=e.next();this.extractElements(n,t)}return 0===t.size()?null!==this.geomFactory?this.geomFactory.createGeometryCollection(null):null:this.geomFactory.buildGeometry(t)},interfaces_:function(){return[]},getClass:function(){return ro}}),ro.combine=function(){if(1===arguments.length){var t=arguments[0],e=new ro(t);return e.combine()}if(2===arguments.length){var n=arguments[0],i=arguments[1],e=new ro(ro.createList(n,i));return e.combine()}if(3===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],e=new ro(ro.createList(r,o,s));return e.combine()}},ro.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},ro.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new w;return n.add(t),n.add(e),n}if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2],n=new w;return n.add(i),n.add(r),n.add(o),n}},e(oo.prototype,{union:function(){for(var t=new Me,e=new at,n=0;n<this.pointGeom.getNumGeometries();n++){var i=this.pointGeom.getGeometryN(n),r=i.getCoordinate();t.locate(r,this.otherGeom)===S.EXTERIOR&&e.add(r)}if(0===e.size())return this.otherGeom;var o=null,s=U.toCoordinateArray(e);return o=1===s.length?this.geomFact.createPoint(s[0]):this.geomFact.createMultiPointFromCoords(s),ro.combine(o,this.otherGeom)},interfaces_:function(){return[]},getClass:function(){return oo}}),oo.union=function(t,e){return new oo(t,e).union()},e(so.prototype,{filter:function(t){-1!==this.sortIndex&&t.getSortIndex()!==this.sortIndex||this.comps.add(t)},interfaces_:function(){return[ct]},getClass:function(){return so}}),so.extract=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return so.extract(t,e,new w)}if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];return n.getSortIndex()===i?r.add(n):n instanceof ft&&n.apply(new so(i,r)),r}},e(ao.prototype,{reduceToGeometries:function(t){for(var e=new w,n=t.iterator();n.hasNext();){var i=n.next(),r=null;M(i,m)?r=this.unionTree(i):i instanceof G&&(r=i),e.add(r)}return e},extractByEnvelope:function(t,e,n){for(var i=new w,r=0;r<e.getNumGeometries();r++){var o=e.getGeometryN(r);o.getEnvelopeInternal().intersects(t)?i.add(o):n.add(o)}return this.geomFactory.buildGeometry(i)},unionOptimized:function(t,e){var n=t.getEnvelopeInternal(),i=e.getEnvelopeInternal();if(!n.intersects(i)){return ro.combine(t,e)}if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var r=n.intersection(i);return this.unionUsingEnvelopeIntersection(t,e,r)},union:function(){if(null===this.inputPolys)throw new IllegalStateException("union() method cannot be called twice");if(this.inputPolys.isEmpty())return null;this.geomFactory=this.inputPolys.iterator().next().getFactory();for(var t=new Be(ao.STRTREE_NODE_CAPACITY),e=this.inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this.inputPolys=null;var i=t.itemsTree();return this.unionTree(i)},binaryUnion:function(){if(1===arguments.length){var t=arguments[0];return this.binaryUnion(t,0,t.size())}if(3===arguments.length){var e=arguments[0],n=arguments[1],i=arguments[2];if(i-n<=1){var r=ao.getGeometry(e,n);return this.unionSafe(r,null)}if(i-n==2)return this.unionSafe(ao.getGeometry(e,n),ao.getGeometry(e,n+1));var o=Math.trunc((i+n)/2),r=this.binaryUnion(e,n,o),s=this.binaryUnion(e,o,i);return this.unionSafe(r,s)}},repeatedUnion:function(t){for(var e=null,n=t.iterator();n.hasNext();){var i=n.next();e=null===e?i.copy():e.union(i)}return e},unionSafe:function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},unionActual:function(t,e){return ao.restrictToPolygons(t.union(e))},unionTree:function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},unionUsingEnvelopeIntersection:function(t,e,n){var i=new w,r=this.extractByEnvelope(n,t,i),o=this.extractByEnvelope(n,e,i),s=this.unionActual(r,o);return i.add(s),ro.combine(i)},bufferUnion:function(){if(1===arguments.length){var t=arguments[0],e=t.get(0).getFactory(),n=e.buildGeometry(t),i=n.buffer(0);return i}if(2===arguments.length){var r=arguments[0],o=arguments[1],e=r.getFactory(),n=e.createGeometryCollection([r,o]),i=n.buffer(0);return i}},interfaces_:function(){return[]},getClass:function(){return ao}}),ao.restrictToPolygons=function(t){if(M(t,Mt))return t;var e=dr.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(ne.toPolygonArray(e))},ao.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},ao.union=function(t){return new ao(t).union()},ao.STRTREE_NODE_CAPACITY=4,e(uo.prototype,{unionNoOpt:function(t){var e=this.geomFact.createPoint();return ri.overlayOp(t,e,ni.UNION)},unionWithNull:function(t,e){return null===t&&null===e?null:null===e?t:null===t?e:t.union(e)},extract:function(){if(M(arguments[0],v))for(var t=arguments[0],e=t.iterator();e.hasNext();){var n=e.next();this.extract(n)}else if(arguments[0]instanceof G){var i=arguments[0];null===this.geomFact&&(this.geomFact=i.getFactory()),so.extract(i,G.SORTINDEX_POLYGON,this.polygons),so.extract(i,G.SORTINDEX_LINESTRING,this.lines),so.extract(i,G.SORTINDEX_POINT,this.points)}},union:function(){if(null===this.geomFact)return null;var t=null;if(this.points.size()>0){var e=this.geomFact.buildGeometry(this.points);t=this.unionNoOpt(e)}var n=null;if(this.lines.size()>0){var i=this.geomFact.buildGeometry(this.lines);n=this.unionNoOpt(i)}var r=null;this.polygons.size()>0&&(r=ao.union(this.polygons));var o=this.unionWithNull(n,r),s=null;return s=null===t?o:null===o?t:oo.union(t,o),null===s?this.geomFact.createGeometryCollection():s},interfaces_:function(){return[]},getClass:function(){return uo}}),uo.union=function(){if(1===arguments.length){if(M(arguments[0],v)){var t=arguments[0],e=new uo(t);return e.union()}if(arguments[0]instanceof G){var n=arguments[0],e=new uo(n);return e.union()}}else if(2===arguments.length){var i=arguments[0],r=arguments[1],e=new uo(i,r);return e.union()}};var Ls=Object.freeze({UnaryUnionOp:uo}),Rs=Object.freeze({IsValidOp:Vr,ConsistentAreaTester:jr}),Ps=Object.freeze({BoundaryOp:dt,IsSimpleOp:Ui,buffer:bs,distance:Is,linemerge:Ns,overlay:Cs,polygonize:Ss,relate:Ms,union:Ls,valid:Rs});c(lo,Ot.CoordinateOperation),e(lo.prototype,{editCoordinates:function(t,e){if(0===t.length)return null;for(var n=new Array(t.length).fill(null),i=0;i<t.length;i++){var r=new p(t[i]);this.targetPM.makePrecise(r),n[i]=r}var o=new b(n,!1),s=o.toCoordinateArray(),a=0;e instanceof Nt&&(a=2),e instanceof Pt&&(a=4);var u=n;return this.removeCollapsed&&(u=null),s.length<a?u:s},interfaces_:function(){return[]},getClass:function(){return lo}}),e(co.prototype,{fixPolygonalTopology:function(t){var e=t;this.changePrecisionModel||(e=this.changePM(t,this.targetPM));var n=e.buffer(0),i=n;return this.changePrecisionModel||(i=this.changePM(n,t.getPrecisionModel())),i},reducePointwise:function(t){var e=null;if(this.changePrecisionModel){e=new Ot(this.createFactory(t.getFactory(),this.targetPM))}else e=new Ot;var n=this.removeCollapsed;return t.getDimension()>=2&&(n=!0),e.edit(t,new lo(this.targetPM,n))},changePM:function(t,e){return this.createEditor(t.getFactory(),e).edit(t,new Ot.NoOpGeometryOperation)},setRemoveCollapsedComponents:function(t){this.removeCollapsed=t},createFactory:function(t,e){return new ne(e,t.getSRID(),t.getCoordinateSequenceFactory())},setChangePrecisionModel:function(t){this.changePrecisionModel=t},reduce:function(t){var e=this.reducePointwise(t);return this.isPointwise?e:M(e,Mt)?e.isValid()?e:this.fixPolygonalTopology(e):e},setPointwise:function(t){this.isPointwise=t},createEditor:function(t,e){return t.getPrecisionModel()===e?new Ot:new Ot(this.createFactory(t,e))},interfaces_:function(){return[]},getClass:function(){return co}}),co.reduce=function(t,e){return new co(e).reduce(t)},co.reducePointwise=function(t,e){var n=new co(e);return n.setPointwise(!0),n.reduce(t)};var Ts=Object.freeze({GeometryPrecisionReducer:co});e(ho.prototype,{simplifySection:function(t,e){if(t+1===e)return null;this.seg.p0=this.pts[t],this.seg.p1=this.pts[e];for(var n=-1,i=t,r=t+1;r<e;r++){var o=this.seg.distance(this.pts[r]);o>n&&(n=o,i=r)}if(n<=this.distanceTolerance)for(var r=t+1;r<e;r++)this.usePt[r]=!1;else this.simplifySection(t,i),this.simplifySection(i,e)},setDistanceTolerance:function(t){this.distanceTolerance=t},simplify:function(){this.usePt=new Array(this.pts.length).fill(null);for(var t=0;t<this.pts.length;t++)this.usePt[t]=!0;this.simplifySection(0,this.pts.length-1);for(var e=new b,t=0;t<this.pts.length;t++)this.usePt[t]&&e.add(new p(this.pts[t]));return e.toCoordinateArray()},interfaces_:function(){return[]},getClass:function(){return ho}}),ho.simplify=function(t,e){var n=new ho(t);return n.setDistanceTolerance(e),n.simplify()},e(fo.prototype,{setEnsureValid:function(t){this.isEnsureValidTopology=t},getResultGeometry:function(){return this.inputGeom.isEmpty()?this.inputGeom.copy():new po(this.isEnsureValidTopology,this.distanceTolerance).transform(this.inputGeom)},setDistanceTolerance:function(t){if(t<0)throw new i("Tolerance must be non-negative");this.distanceTolerance=t},interfaces_:function(){return[]},getClass:function(){return fo}}),fo.simplify=function(t,e){var n=new fo(t);return n.setDistanceTolerance(e),n.getResultGeometry()},c(po,me),e(po.prototype,{transformPolygon:function(t,e){if(t.isEmpty())return null;var n=me.prototype.transformPolygon.call(this,t,e);return e instanceof Tt?n:this.createValidArea(n)},createValidArea:function(t){return this.isEnsureValidTopology?t.buffer(0):t},transformCoordinates:function(t,e){var n=t.toCoordinateArray(),i=null;return i=0===n.length?new Array(0).fill(null):ho.simplify(n,this.distanceTolerance),this.factory.getCoordinateSequenceFactory().create(i)},transformMultiPolygon:function(t,e){var n=me.prototype.transformMultiPolygon.call(this,t,e);return this.createValidArea(n)},transformLinearRing:function(t,e){var n=e instanceof Lt,i=me.prototype.transformLinearRing.call(this,t,e);return!n||i instanceof Pt?i:null},interfaces_:function(){return[]},getClass:function(){return po}}),fo.DPTransformer=po,c(go,ce),e(go.prototype,{getIndex:function(){return this.index},getParent:function(){return this.parent},interfaces_:function(){return[]},getClass:function(){return go}}),e(vo.prototype,{addToResult:function(t){this.resultSegs.add(t)},asLineString:function(){return this.parentLine.getFactory().createLineString(vo.extractCoordinates(this.resultSegs))},getResultSize:function(){var t=this.resultSegs.size();return 0===t?0:t+1},getParent:function(){return this.parentLine},getSegment:function(t){return this.segs[t]},getParentCoordinates:function(){return this.parentLine.getCoordinates()},getMinimumSize:function(){return this.minimumSize},asLinearRing:function(){return this.parentLine.getFactory().createLinearRing(vo.extractCoordinates(this.resultSegs))},getSegments:function(){return this.segs},init:function(){var t=this.parentLine.getCoordinates();this.segs=new Array(t.length-1).fill(null);for(var e=0;e<t.length-1;e++){var n=new go(t[e],t[e+1],this.parentLine,e);this.segs[e]=n}},getResultCoordinates:function(){return vo.extractCoordinates(this.resultSegs)},interfaces_:function(){return[]},getClass:function(){return vo}}),vo.extractCoordinates=function(t){for(var e=new Array(t.size()+1).fill(null),n=null,i=0;i<t.size();i++)n=t.get(i),e[i]=n.p0;return e[e.length-1]=n.p1,e},e(yo.prototype,{remove:function(t){this.index.remove(new I(t.p0,t.p1),t)},add:function(){if(arguments[0]instanceof vo)for(var t=arguments[0],e=t.getSegments(),n=0;n<e.length;n++){var i=e[n];this.add(i)}else if(arguments[0]instanceof ce){var r=arguments[0];this.index.insert(new I(r.p0,r.p1),r)}},query:function(t){var e=new I(t.p0,t.p1),n=new mo(t);return this.index.query(e,n),n.getItems()},interfaces_:function(){return[]},getClass:function(){return yo}}),e(mo.prototype,{visitItem:function(t){var e=t;I.intersects(e.p0,e.p1,this.querySeg.p0,this.querySeg.p1)&&this.items.add(t)},getItems:function(){return this.items},interfaces_:function(){return[Ae]},getClass:function(){return mo}}),e(xo.prototype,{flatten:function(t,e){var n=this.linePts[t],i=this.linePts[e],r=new ce(n,i);return this.remove(this.line,t,e),this.outputIndex.add(r),r},hasBadIntersection:function(t,e,n){return!!this.hasBadOutputIntersection(n)||!!this.hasBadInputIntersection(t,e,n)},setDistanceTolerance:function(t){this.distanceTolerance=t},simplifySection:function(t,e,n){n+=1;var i=new Array(2).fill(null);if(t+1===e){var r=this.line.getSegment(t);return this.line.addToResult(r),null}var o=!0;if(this.line.getResultSize()<this.line.getMinimumSize()){n+1<this.line.getMinimumSize()&&(o=!1)}var s=new Array(1).fill(null),a=this.findFurthestPoint(this.linePts,t,e,s);s[0]>this.distanceTolerance&&(o=!1);var u=new ce;if(u.p0=this.linePts[t],u.p1=this.linePts[e],i[0]=t,i[1]=e,this.hasBadIntersection(this.line,i,u)&&(o=!1),o){var r=this.flatten(t,e);return this.line.addToResult(r),null}this.simplifySection(t,a,n),this.simplifySection(a,e,n)},hasBadOutputIntersection:function(t){for(var e=this.outputIndex.query(t),n=e.iterator();n.hasNext();){var i=n.next();if(this.hasInteriorIntersection(i,t))return!0}return!1},findFurthestPoint:function(t,e,n,i){var r=new ce;r.p0=t[e],r.p1=t[n];for(var o=-1,s=e,a=e+1;a<n;a++){var u=t[a],l=r.distance(u);l>o&&(o=l,s=a)}return i[0]=o,s},simplify:function(t){this.line=t,this.linePts=t.getParentCoordinates(),this.simplifySection(0,this.linePts.length-1,0)},remove:function(t,e,n){for(var i=e;i<n;i++){var r=t.getSegment(i);this.inputIndex.remove(r)}},hasInteriorIntersection:function(t,e){return this.li.computeIntersection(t.p0,t.p1,e.p0,e.p1),this.li.isInteriorIntersection()},hasBadInputIntersection:function(t,e,n){for(var i=this.inputIndex.query(n),r=i.iterator();r.hasNext();){var o=r.next();if(this.hasInteriorIntersection(o,n)){if(xo.isInLineSection(t,e,o))continue;return!0}}return!1},interfaces_:function(){return[]},getClass:function(){return xo}}),xo.isInLineSection=function(t,e,n){if(n.getParent()!==t.getParent())return!1;var i=n.getIndex();return i>=e[0]&&i<e[1]},e(Eo.prototype,{setDistanceTolerance:function(t){this.distanceTolerance=t},simplify:function(t){for(var e=t.iterator();e.hasNext();)this.inputIndex.add(e.next());for(var e=t.iterator();e.hasNext();){var n=new xo(this.inputIndex,this.outputIndex);n.setDistanceTolerance(this.distanceTolerance),n.simplify(e.next())}},interfaces_:function(){return[]},getClass:function(){return Eo}}),e(wo.prototype,{getResultGeometry:function(){return this.inputGeom.isEmpty()?this.inputGeom.copy():(this.linestringMap=new $t,this.inputGeom.apply(new Io(this)),this.lineSimplifier.simplify(this.linestringMap.values()),new bo(this.linestringMap).transform(this.inputGeom))},setDistanceTolerance:function(t){if(t<0)throw new i("Tolerance must be non-negative");this.lineSimplifier.setDistanceTolerance(t)},interfaces_:function(){return[]},getClass:function(){return wo}}),wo.simplify=function(t,e){var n=new wo(t);return n.setDistanceTolerance(e),n.getResultGeometry()},c(bo,me),e(bo.prototype,{transformCoordinates:function(t,e){if(0===t.size())return null;if(e instanceof Nt){var n=this.linestringMap.get(e);return this.createCoordinateSequence(n.getResultCoordinates())}return me.prototype.transformCoordinates.call(this,t,e)},interfaces_:function(){return[]},getClass:function(){return bo}}),e(Io.prototype,{filter:function(t){if(t instanceof Nt){var e=t;if(e.isEmpty())return null;var n=e.isClosed()?4:2,i=new vo(e,n);this.tps.linestringMap.put(e,i)}},interfaces_:function(){return[k]},getClass:function(){return Io}}),wo.LineStringTransformer=bo,wo.LineStringMapBuilderFilter=Io;var Os=Object.freeze({DouglasPeuckerSimplifier:fo,TopologyPreservingSimplifier:wo});e(No.prototype,{splitAt:function(){if(1===arguments.length){var t=arguments[0],e=this.minimumLen/this.segLen;if(t.distance(this.seg.p0)<this.minimumLen)return this.splitPt=this.seg.pointAlong(e),null;if(t.distance(this.seg.p1)<this.minimumLen)return this.splitPt=No.pointAlongReverse(this.seg,e),null;this.splitPt=t}else if(2===arguments.length){var n=arguments[0],i=arguments[1],r=this.getConstrainedLength(n),o=r/this.segLen;i.equals2D(this.seg.p0)?this.splitPt=this.seg.pointAlong(o):this.splitPt=No.pointAlongReverse(this.seg,o)}},setMinimumLength:function(t){this.minimumLen=t},getConstrainedLength:function(t){return t<this.minimumLen?this.minimumLen:t},getSplitPoint:function(){return this.splitPt},interfaces_:function(){return[]},getClass:function(){return No}}),No.pointAlongReverse=function(t,e){var n=new p;return n.x=t.p1.x-e*(t.p1.x-t.p0.x),n.y=t.p1.y-e*(t.p1.y-t.p0.y),n},e(Co.prototype,{findSplitPoint:function(t,e){},interfaces_:function(){return[]},getClass:function(){return Co}}),e(So.prototype,{findSplitPoint:function(t,e){var n=t.getLineSegment(),i=n.getLength(),r=i/2,o=new No(n),s=So.projectedSplitPoint(t,e),a=2*s.distance(e)*.8,u=a;return u>r&&(u=r),o.setMinimumLength(u),o.splitAt(s),o.getSplitPoint()},interfaces_:function(){return[Co]},getClass:function(){return So}}),So.projectedSplitPoint=function(t,e){return t.getLineSegment().project(e)},e(Mo.prototype,{interfaces_:function(){return[]},getClass:function(){return Mo}}),Mo.triArea=function(t,e,n){return(e.x-t.x)*(n.y-t.y)-(e.y-t.y)*(n.x-t.x)},Mo.isInCircleDDNormalized=function(t,e,n,i){var r=O.valueOf(t.x).selfSubtract(i.x),o=O.valueOf(t.y).selfSubtract(i.y),s=O.valueOf(e.x).selfSubtract(i.x),a=O.valueOf(e.y).selfSubtract(i.y),u=O.valueOf(n.x).selfSubtract(i.x),l=O.valueOf(n.y).selfSubtract(i.y),c=r.multiply(a).selfSubtract(s.multiply(o)),h=s.multiply(l).selfSubtract(u.multiply(a)),f=u.multiply(o).selfSubtract(r.multiply(l)),p=r.multiply(r).selfAdd(o.multiply(o)),d=s.multiply(s).selfAdd(a.multiply(a)),g=u.multiply(u).selfAdd(l.multiply(l))
;return p.selfMultiply(h).selfAdd(d.selfMultiply(f)).selfAdd(g.selfMultiply(c)).doubleValue()>0},Mo.checkRobustInCircle=function(t,e,n,i){var r=Mo.isInCircleNonRobust(t,e,n,i),o=Mo.isInCircleDDSlow(t,e,n,i),s=Mo.isInCircleCC(t,e,n,i),a=Ii.circumcentre(t,e,n);D.out.println("p radius diff a = "+Math.abs(i.distance(a)-t.distance(a))/t.distance(a)),r===o&&r===s||(D.out.println("inCircle robustness failure (double result = "+r+", DD result = "+o+", CC result = "+s+")"),D.out.println(re.toLineString(new qt([t,e,n,i]))),D.out.println("Circumcentre = "+re.toPoint(a)+" radius = "+t.distance(a)),D.out.println("p radius diff a = "+Math.abs(i.distance(a)/t.distance(a)-1)),D.out.println("p radius diff b = "+Math.abs(i.distance(a)/e.distance(a)-1)),D.out.println("p radius diff c = "+Math.abs(i.distance(a)/n.distance(a)-1)),D.out.println())},Mo.isInCircleDDFast=function(t,e,n,i){var r=O.sqr(t.x).selfAdd(O.sqr(t.y)).selfMultiply(Mo.triAreaDDFast(e,n,i)),o=O.sqr(e.x).selfAdd(O.sqr(e.y)).selfMultiply(Mo.triAreaDDFast(t,n,i)),s=O.sqr(n.x).selfAdd(O.sqr(n.y)).selfMultiply(Mo.triAreaDDFast(t,e,i)),a=O.sqr(i.x).selfAdd(O.sqr(i.y)).selfMultiply(Mo.triAreaDDFast(t,e,n));return r.selfSubtract(o).selfAdd(s).selfSubtract(a).doubleValue()>0},Mo.isInCircleCC=function(t,e,n,i){var r=Ii.circumcentre(t,e,n),o=t.distance(r);return i.distance(r)-o<=0},Mo.isInCircleNormalized=function(t,e,n,i){var r=t.x-i.x,o=t.y-i.y,s=e.x-i.x,a=e.y-i.y,u=n.x-i.x,l=n.y-i.y;return(r*r+o*o)*(s*l-u*a)+(s*s+a*a)*(u*o-r*l)+(u*u+l*l)*(r*a-s*o)>0},Mo.isInCircleDDSlow=function(t,e,n,i){var r=O.valueOf(i.x),o=O.valueOf(i.y),s=O.valueOf(t.x),a=O.valueOf(t.y),u=O.valueOf(e.x),l=O.valueOf(e.y),c=O.valueOf(n.x),h=O.valueOf(n.y),f=s.multiply(s).add(a.multiply(a)).multiply(Mo.triAreaDDSlow(u,l,c,h,r,o)),p=u.multiply(u).add(l.multiply(l)).multiply(Mo.triAreaDDSlow(s,a,c,h,r,o)),d=c.multiply(c).add(h.multiply(h)).multiply(Mo.triAreaDDSlow(s,a,u,l,r,o)),g=r.multiply(r).add(o.multiply(o)).multiply(Mo.triAreaDDSlow(s,a,u,l,c,h));return f.subtract(p).add(d).subtract(g).doubleValue()>0},Mo.isInCircleNonRobust=function(t,e,n,i){return(t.x*t.x+t.y*t.y)*Mo.triArea(e,n,i)-(e.x*e.x+e.y*e.y)*Mo.triArea(t,n,i)+(n.x*n.x+n.y*n.y)*Mo.triArea(t,e,i)-(i.x*i.x+i.y*i.y)*Mo.triArea(t,e,n)>0},Mo.isInCircleRobust=function(t,e,n,i){return Mo.isInCircleNormalized(t,e,n,i)},Mo.triAreaDDSlow=function(t,e,n,i,r,o){return n.subtract(t).multiply(o.subtract(e)).subtract(i.subtract(e).multiply(r.subtract(t)))},Mo.triAreaDDFast=function(t,e,n){var i=O.valueOf(e.x).selfSubtract(t.x).selfMultiply(O.valueOf(n.y).selfSubtract(t.y)),r=O.valueOf(e.y).selfSubtract(t.y).selfMultiply(O.valueOf(n.x).selfSubtract(t.x));return i.selfSubtract(r)},e(Lo.prototype,{circleCenter:function(t,e){var n=new Lo(this.getX(),this.getY()),i=this.bisector(n,t),r=this.bisector(t,e),o=new F(i,r),s=null;try{s=new Lo(o.getX(),o.getY())}catch(i){if(!(i instanceof C))throw i;D.err.println("a: "+n+" b: "+t+" c: "+e),D.err.println(i)}return s},dot:function(t){return this.p.x*t.getX()+this.p.y*t.getY()},magn:function(){return Math.sqrt(this.p.x*this.p.x+this.p.y*this.p.y)},getZ:function(){return this.p.z},bisector:function(t,e){var n=e.getX()-t.getX(),i=e.getY()-t.getY();return new F(new F(t.getX()+n/2,t.getY()+i/2,1),new F(t.getX()-i+n/2,t.getY()+n+i/2,1))},equals:function(){if(1===arguments.length){var t=arguments[0];return this.p.x===t.getX()&&this.p.y===t.getY()}if(2===arguments.length){var e=arguments[0],n=arguments[1];return this.p.distance(e.getCoordinate())<n}},getCoordinate:function(){return this.p},isInCircle:function(t,e,n){return Mo.isInCircleRobust(t.p,e.p,n.p,this.p)},interpolateZValue:function(t,e,n){var i=t.getX(),r=t.getY(),o=e.getX()-i,s=n.getX()-i,a=e.getY()-r,u=n.getY()-r,l=o*u-s*a,c=this.getX()-i,h=this.getY()-r,f=(u*c-s*h)/l,p=(-a*c+o*h)/l;return t.getZ()+f*(e.getZ()-t.getZ())+p*(n.getZ()-t.getZ())},midPoint:function(t){return new Lo((this.p.x+t.getX())/2,(this.p.y+t.getY())/2,(this.p.z+t.getZ())/2)},rightOf:function(t){return this.isCCW(t.dest(),t.orig())},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},getX:function(){return this.p.x},crossProduct:function(t){return this.p.x*t.getY()-this.p.y*t.getX()},setZ:function(t){this.p.z=t},times:function(t){return new Lo(t*this.p.x,t*this.p.y)},cross:function(){return new Lo(this.p.y,-this.p.x)},leftOf:function(t){return this.isCCW(t.orig(),t.dest())},toString:function(){return"POINT ("+this.p.x+" "+this.p.y+")"},sub:function(t){return new Lo(this.p.x-t.getX(),this.p.y-t.getY())},getY:function(){return this.p.y},classify:function(t,e){var n=this,i=e.sub(t),r=n.sub(t),o=i.crossProduct(r);return o>0?Lo.LEFT:o<0?Lo.RIGHT:i.getX()*r.getX()<0||i.getY()*r.getY()<0?Lo.BEHIND:i.magn()<r.magn()?Lo.BEYOND:t.equals(n)?Lo.ORIGIN:e.equals(n)?Lo.DESTINATION:Lo.BETWEEN},sum:function(t){return new Lo(this.p.x+t.getX(),this.p.y+t.getY())},distance:function(t,e){return Math.sqrt(Math.pow(e.getX()-t.getX(),2)+Math.pow(e.getY()-t.getY(),2))},circumRadiusRatio:function(t,e){var n=this.circleCenter(t,e),i=this.distance(n,t),r=this.distance(this,t),o=this.distance(t,e);return o<r&&(r=o),o=this.distance(e,this),o<r&&(r=o),i/r},interfaces_:function(){return[]},getClass:function(){return Lo}}),Lo.interpolateZ=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],i=e.distance(n),r=t.distance(e),o=n.z-e.z;return e.z+o*(r/i)}if(4===arguments.length){var s=arguments[0],a=arguments[1],u=arguments[2],l=arguments[3],c=a.x,h=a.y,f=u.x-c,p=l.x-c,d=u.y-h,g=l.y-h,v=f*g-p*d,y=s.x-c,m=s.y-h,x=(g*y-p*m)/v,E=(-d*y+f*m)/v;return a.z+x*(u.z-a.z)+E*(l.z-a.z)}},Lo.LEFT=0,Lo.RIGHT=1,Lo.BEYOND=2,Lo.BEHIND=3,Lo.BETWEEN=4,Lo.ORIGIN=5,Lo.DESTINATION=6,c(Ro,Lo),e(Ro.prototype,{getConstraint:function(){return this.constraint},setOnConstraint:function(t){this._isOnConstraint=t},merge:function(t){t._isOnConstraint&&(this._isOnConstraint=!0,this.constraint=t.constraint)},isOnConstraint:function(){return this._isOnConstraint},setConstraint:function(t){this._isOnConstraint=!0,this.constraint=t},interfaces_:function(){return[]},getClass:function(){return Ro}}),e(Po.prototype,{equalsNonOriented:function(t){return!!this.equalsOriented(t)||!!this.equalsOriented(t.sym())},toLineSegment:function(){return new ce(this.vertex.getCoordinate(),this.dest().getCoordinate())},dest:function(){return this.sym().orig()},oNext:function(){return this.next},equalsOriented:function(t){return!(!this.orig().getCoordinate().equals2D(t.orig().getCoordinate())||!this.dest().getCoordinate().equals2D(t.dest().getCoordinate()))},dNext:function(){return this.sym().oNext().sym()},lPrev:function(){return this.next.sym()},rPrev:function(){return this.sym().oNext()},rot:function(){return this._rot},oPrev:function(){return this._rot.next._rot},sym:function(){return this._rot._rot},setOrig:function(t){this.vertex=t},lNext:function(){return this.invRot().oNext().rot()},getLength:function(){return this.orig().getCoordinate().distance(this.dest().getCoordinate())},invRot:function(){return this._rot.sym()},setDest:function(t){this.sym().setOrig(t)},setData:function(t){this.data=t},getData:function(){return this.data},delete:function(){this._rot=null},orig:function(){return this.vertex},rNext:function(){return this._rot.next.invRot()},toString:function(){var t=this.vertex.getCoordinate(),e=this.dest().getCoordinate();return re.toLineString(t,e)},isLive:function(){return null!==this._rot},getPrimary:function(){return this.orig().getCoordinate().compareTo(this.dest().getCoordinate())<=0?this:this.sym()},dPrev:function(){return this.invRot().oNext().invRot()},setNext:function(t){this.next=t},interfaces_:function(){return[]},getClass:function(){return Po}}),Po.makeEdge=function(t,e){var n=new Po,i=new Po,r=new Po,o=new Po;n._rot=i,i._rot=r,r._rot=o,o._rot=n,n.setNext(n),i.setNext(o),r.setNext(r),o.setNext(i);var s=n;return s.setOrig(t),s.setDest(e),s},Po.swap=function(t){var e=t.oPrev(),n=t.sym().oPrev();Po.splice(t,e),Po.splice(t.sym(),n),Po.splice(t,e.lNext()),Po.splice(t.sym(),n.lNext()),t.setOrig(e.dest()),t.setDest(n.dest())},Po.splice=function(t,e){var n=t.oNext().rot(),i=e.oNext().rot(),r=e.oNext(),o=t.oNext(),s=i.oNext(),a=n.oNext();t.setNext(r),e.setNext(o),n.setNext(s),i.setNext(a)},Po.connect=function(t,e){var n=Po.makeEdge(t.dest(),e.orig());return Po.splice(n,t.lNext()),Po.splice(n.sym(),e),n},e(To.prototype,{insertSite:function(t){var e=this.subdiv.locate(t);if(this.subdiv.isVertexOfEdge(e,t))return e;this.subdiv.isOnEdge(e,t.getCoordinate())&&(e=e.oPrev(),this.subdiv.delete(e.oNext()));var n=this.subdiv.makeEdge(e.orig(),t);Po.splice(n,e);var i=n;do{n=this.subdiv.connect(e,n.sym()),e=n.oPrev()}while(e.lNext()!==i);for(;;){var r=e.oPrev();if(r.dest().rightOf(e)&&t.isInCircle(e.orig(),r.dest(),e.dest()))Po.swap(e),e=e.oPrev();else{if(e.oNext()===i)return n;e=e.oNext().lPrev()}}},insertSites:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.insertSite(n)}},interfaces_:function(){return[]},getClass:function(){return To}}),e(Oo.prototype,{locate:function(t){},interfaces_:function(){return[]},getClass:function(){return Oo}}),e(_o.prototype,{init:function(){this.lastEdge=this.findEdge()},locate:function(t){this.lastEdge.isLive()||this.init();var e=this.subdiv.locateFromEdge(t,this.lastEdge);return this.lastEdge=e,e},findEdge:function(){return this.subdiv.getEdges().iterator().next()},interfaces_:function(){return[Oo]},getClass:function(){return _o}}),c(Ao,l),e(Ao.prototype,{getSegment:function(){return this.seg},interfaces_:function(){return[]},getClass:function(){return Ao}}),Ao.msgWithSpatial=function(t,e){return null!==e?t+" [ "+e+" ]":t},e(Do.prototype,{visit:function(t){},interfaces_:function(){return[]},getClass:function(){return Do}}),e(Fo.prototype,{getTriangleVertices:function(t){var e=new Go;return this.visitTriangles(e,t),e.getTriangleVertices()},isFrameVertex:function(t){return!!t.equals(this.frameVertex[0])||!!t.equals(this.frameVertex[1])||!!t.equals(this.frameVertex[2])},isVertexOfEdge:function(t,e){return!(!e.equals(t.orig(),this.tolerance)&&!e.equals(t.dest(),this.tolerance))},connect:function(t,e){var n=Po.connect(t,e);return this.quadEdges.add(n),n},getVoronoiCellPolygon:function(t,e){var n=new w,i=t;do{var r=t.rot().orig().getCoordinate();n.add(r),t=t.oPrev()}while(t!==i);var o=new b;o.addAll(n,!1),o.closeRing(),o.size()<4&&(D.out.println(o),o.add(o.get(o.size()-1),!0));var s=o.toCoordinateArray(),a=e.createPolygon(e.createLinearRing(s),null),u=i.orig();return a.setUserData(u.getCoordinate()),a},setLocator:function(t){this.locator=t},initSubdiv:function(){var t=this.makeEdge(this.frameVertex[0],this.frameVertex[1]),e=this.makeEdge(this.frameVertex[1],this.frameVertex[2]);Po.splice(t.sym(),e);var n=this.makeEdge(this.frameVertex[2],this.frameVertex[0]);return Po.splice(e.sym(),n),Po.splice(n.sym(),t),t},isFrameBorderEdge:function(t){var e=new Array(3).fill(null);Fo.getTriangleEdges(t,e);var n=new Array(3).fill(null);Fo.getTriangleEdges(t.sym(),n);var i=t.lNext().dest();if(this.isFrameVertex(i))return!0;var r=t.sym().lNext().dest();return!!this.isFrameVertex(r)},makeEdge:function(t,e){var n=Po.makeEdge(t,e);return this.quadEdges.add(n),n},visitTriangles:function(t,e){this.visitedKey++;var n=new de;n.push(this.startingEdge);for(var i=new Q;!n.empty();){var r=n.pop();if(!i.contains(r)){var o=this.fetchTriangleToVisit(r,n,e,i);null!==o&&t.visit(o)}}},isFrameEdge:function(t){return!(!this.isFrameVertex(t.orig())&&!this.isFrameVertex(t.dest()))},isOnEdge:function(t,e){return this.seg.setCoordinates(t.orig().getCoordinate(),t.dest().getCoordinate()),this.seg.distance(e)<this.edgeCoincidenceTolerance},getEnvelope:function(){return new I(this.frameEnv)},createFrame:function(t){var e=t.getWidth(),n=t.getHeight(),i=0;i=e>n?10*e:10*n,this.frameVertex[0]=new Lo((t.getMaxX()+t.getMinX())/2,t.getMaxY()+i),this.frameVertex[1]=new Lo(t.getMinX()-i,t.getMinY()-i),this.frameVertex[2]=new Lo(t.getMaxX()+i,t.getMinY()-i),this.frameEnv=new I(this.frameVertex[0].getCoordinate(),this.frameVertex[1].getCoordinate()),this.frameEnv.expandToInclude(this.frameVertex[2].getCoordinate())},getTriangleCoordinates:function(t){var e=new jo;return this.visitTriangles(e,t),e.getTriangles()},getVertices:function(t){for(var e=new Q,n=this.quadEdges.iterator();n.hasNext();){var i=n.next(),r=i.orig();!t&&this.isFrameVertex(r)||e.add(r);var o=i.dest();!t&&this.isFrameVertex(o)||e.add(o)}return e},fetchTriangleToVisit:function(t,e,n,i){var r=t,o=0,s=!1;do{this.triEdges[o]=r,this.isFrameEdge(r)&&(s=!0);var a=r.sym();i.contains(a)||e.push(a),i.add(r),o++,r=r.lNext()}while(r!==t);return s&&!n?null:this.triEdges},getEdges:function(){if(0===arguments.length)return this.quadEdges;if(1===arguments.length){for(var t=arguments[0],e=this.getPrimaryEdges(!1),n=new Array(e.size()).fill(null),i=0,r=e.iterator();r.hasNext();){var o=r.next();n[i++]=t.createLineString([o.orig().getCoordinate(),o.dest().getCoordinate()])}return t.createMultiLineString(n)}},getVertexUniqueEdges:function(t){for(var e=new w,n=new Q,i=this.quadEdges.iterator();i.hasNext();){var r=i.next(),o=r.orig();n.contains(o)||(n.add(o),!t&&this.isFrameVertex(o)||e.add(r));var s=r.sym(),a=s.orig();n.contains(a)||(n.add(a),!t&&this.isFrameVertex(a)||e.add(s))}return e},getTriangleEdges:function(t){var e=new ko;return this.visitTriangles(e,t),e.getTriangleEdges()},getPrimaryEdges:function(t){this.visitedKey++;var e=new w,n=new de;n.push(this.startingEdge);for(var i=new Q;!n.empty();){var r=n.pop();if(!i.contains(r)){var o=r.getPrimary();!t&&this.isFrameEdge(o)||e.add(o),n.push(r.oNext()),n.push(r.sym().oNext()),i.add(r),i.add(r.sym())}}return e},delete:function(t){Po.splice(t,t.oPrev()),Po.splice(t.sym(),t.sym().oPrev());var e=t.sym(),n=t.rot(),i=t.rot().sym();this.quadEdges.remove(t),this.quadEdges.remove(e),this.quadEdges.remove(n),this.quadEdges.remove(i),t.delete(),e.delete(),n.delete(),i.delete()},locateFromEdge:function(t,e){for(var n=0,i=this.quadEdges.size(),r=e;;){if(++n>i)throw new Ao(r.toLineSegment());if(t.equals(r.orig())||t.equals(r.dest()))break;if(t.rightOf(r))r=r.sym();else if(t.rightOf(r.oNext())){if(t.rightOf(r.dPrev()))break;r=r.dPrev()}else r=r.oNext()}return r},getTolerance:function(){return this.tolerance},getVoronoiCellPolygons:function(t){this.visitTriangles(new qo,!0);for(var e=new w,n=this.getVertexUniqueEdges(!1),i=n.iterator();i.hasNext();){var r=i.next();e.add(this.getVoronoiCellPolygon(r,t))}return e},getVoronoiDiagram:function(t){var e=this.getVoronoiCellPolygons(t);return t.createGeometryCollection(ne.toGeometryArray(e))},getTriangles:function(t){for(var e=this.getTriangleCoordinates(!1),n=new Array(e.size()).fill(null),i=0,r=e.iterator();r.hasNext();){var o=r.next();n[i++]=t.createPolygon(t.createLinearRing(o),null)}return t.createGeometryCollection(n)},insertSite:function(t){var e=this.locate(t);if(t.equals(e.orig(),this.tolerance)||t.equals(e.dest(),this.tolerance))return e;var n=this.makeEdge(e.orig(),t);Po.splice(n,e);var i=n;do{n=this.connect(e,n.sym()),e=n.oPrev()}while(e.lNext()!==i);return i},locate:function(){if(1===arguments.length){if(arguments[0]instanceof Lo){var t=arguments[0];return this.locator.locate(t)}if(arguments[0]instanceof p){var e=arguments[0];return this.locator.locate(new Lo(e))}}else if(2===arguments.length){var n=arguments[0],i=arguments[1],r=this.locator.locate(new Lo(n));if(null===r)return null;var o=r;r.dest().getCoordinate().equals2D(n)&&(o=r.sym());var s=o;do{if(s.dest().getCoordinate().equals2D(i))return s;s=s.oNext()}while(s!==o);return null}},interfaces_:function(){return[]},getClass:function(){return Fo}}),Fo.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 i("Edges do not form a triangle")},e(qo.prototype,{visit:function(t){for(var e=t[0].orig().getCoordinate(),n=t[1].orig().getCoordinate(),i=t[2].orig().getCoordinate(),r=Ii.circumcentre(e,n,i),o=new Lo(r),s=0;s<3;s++)t[s].rot().setOrig(o)},interfaces_:function(){return[Do]},getClass:function(){return qo}}),e(ko.prototype,{getTriangleEdges:function(){return this.triList},visit:function(t){this.triList.add(t.clone())},interfaces_:function(){return[Do]},getClass:function(){return ko}}),e(Go.prototype,{visit:function(t){this.triList.add([t[0].orig(),t[1].orig(),t[2].orig()])},getTriangleVertices:function(){return this.triList},interfaces_:function(){return[Do]},getClass:function(){return Go}}),e(jo.prototype,{checkTriangleSize:function(t){t.length>=2?re.toLineString(t[0],t[1]):t.length>=1&&re.toPoint(t[0])},visit:function(t){this.coordList.clear();for(var e=0;e<3;e++){var n=t[e].orig();this.coordList.add(n.getCoordinate())}if(this.coordList.size()>0){this.coordList.closeRing();var i=this.coordList.toCoordinateArray();if(4!==i.length)return null;this.triCoords.add(i)}},getTriangles:function(){return this.triCoords},interfaces_:function(){return[Do]},getClass:function(){return jo}}),Fo.TriangleCircumcentreVisitor=qo,Fo.TriangleEdgesListVisitor=ko,Fo.TriangleVertexListVisitor=Go,Fo.TriangleCoordinatesVisitor=jo,Fo.EDGE_COINCIDENCE_TOL_FACTOR=1e3,e(Bo.prototype,{getLineSegment:function(){return this.ls},getEndZ:function(){return this.ls.getCoordinate(1).z},getStartZ:function(){return this.ls.getCoordinate(0).z},intersection:function(t){return this.ls.intersection(t.getLineSegment())},getStart:function(){return this.ls.getCoordinate(0)},getEnd:function(){return this.ls.getCoordinate(1)},getEndY:function(){return this.ls.getCoordinate(1).y},getStartX:function(){return this.ls.getCoordinate(0).x},equalsTopo:function(t){return this.ls.equalsTopo(t.getLineSegment())},getStartY:function(){return this.ls.getCoordinate(0).y},setData:function(t){this.data=t},getData:function(){return this.data},getEndX:function(){return this.ls.getCoordinate(1).x},toString:function(){return this.ls.toString()},interfaces_:function(){return[]},getClass:function(){return Bo}}),e(zo.prototype,{visit:function(t){},interfaces_:function(){return[]},getClass:function(){return zo}}),e(Vo.prototype,{isRepeated:function(){return this.count>1},getRight:function(){return this.right},getCoordinate:function(){return this.p},setLeft:function(t){this.left=t},getX:function(){return this.p.x},getData:function(){return this.data},getCount:function(){return this.count},getLeft:function(){return this.left},getY:function(){return this.p.y},increment:function(){this.count=this.count+1},setRight:function(t){this.right=t},interfaces_:function(){return[]},getClass:function(){return Vo}}),e(Xo.prototype,{insert:function(){if(1===arguments.length){var t=arguments[0];return this.insert(t,null)}if(2===arguments.length){var e=arguments[0],n=arguments[1];if(null===this.root)return this.root=new Vo(e,n),this.root;if(this.tolerance>0){var i=this.findBestMatchNode(e);if(null!==i)return i.increment(),i}return this.insertExact(e,n)}},query:function(){var t=arguments,e=this;if(1===arguments.length){var n=arguments[0],i=new w;return this.query(n,i),i}if(2===arguments.length)if(arguments[0]instanceof I&&M(arguments[1],m))!function(){var n=t[0],i=t[1];e.queryNode(e.root,n,!0,{interfaces_:function(){return[zo]},visit:function(t){i.add(t)}})}();else if(arguments[0]instanceof I&&M(arguments[1],zo)){var r=arguments[0],o=arguments[1];this.queryNode(this.root,r,!0,o)}},queryNode:function(t,e,n,i){if(null===t)return null;var r=null,o=null,s=null;n?(r=e.getMinX(),o=e.getMaxX(),s=t.getX()):(r=e.getMinY(),o=e.getMaxY(),s=t.getY());var a=r<s,u=s<=o;a&&this.queryNode(t.getLeft(),e,!n,i),e.contains(t.getCoordinate())&&i.visit(t),u&&this.queryNode(t.getRight(),e,!n,i)},findBestMatchNode:function(t){var e=new Yo(t,this.tolerance);return this.query(e.queryEnvelope(),e),e.getNode()},isEmpty:function(){return null===this.root},insertExact:function(t,e){for(var n=this.root,i=this.root,r=!0,o=!0;null!==n;){if(null!==n){if(t.distance(n.getCoordinate())<=this.tolerance)return n.increment(),n}o=r?t.x<n.getX():t.y<n.getY(),i=n,n=o?n.getLeft():n.getRight(),r=!r}this.numberOfNodes=this.numberOfNodes+1;var s=new Vo(t,e);return o?i.setLeft(s):i.setRight(s),s},interfaces_:function(){return[]},getClass:function(){return Xo}}),Xo.toCoordinates=function(){if(1===arguments.length){var t=arguments[0];return Xo.toCoordinates(t,!1)}if(2===arguments.length){for(var e=arguments[0],n=arguments[1],i=new b,r=e.iterator();r.hasNext();)for(var o=r.next(),s=n?o.getCount():1,a=0;a<s;a++)i.add(o.getCoordinate(),!0);return i.toCoordinateArray()}},e(Yo.prototype,{visit:function(t){var e=this.p.distance(t.getCoordinate());if(!(e<=this.tolerance))return null;var n=!1;(null===this.matchNode||e<this.matchDist||null!==this.matchNode&&e===this.matchDist&&t.getCoordinate().compareTo(this.matchNode.getCoordinate())<1)&&(n=!0),n&&(this.matchNode=t,this.matchDist=e)},queryEnvelope:function(){var t=new I(this.p);return t.expandBy(this.tolerance),t},getNode:function(){return this.matchNode},interfaces_:function(){return[zo]},getClass:function(){return Yo}}),Xo.BestMatchVisitor=Yo,e(Uo.prototype,{getInitialVertices:function(){return this.initialVertices},getKDT:function(){return this.kdt},enforceConstraints:function(){this.addConstraintVertices();var t=0,e=0;do{e=this.enforceGabriel(this.segments),t++}while(e>0&&t<Uo.MAX_SPLIT_ITER)},insertSites:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.insertSite(n)}},getVertexFactory:function(){return this.vertexFactory},getPointArray:function(){for(var t=new Array(this.initialVertices.size()+this.segVertices.size()).fill(null),e=0,n=this.initialVertices.iterator();n.hasNext();){var i=n.next();t[e++]=i.getCoordinate()}for(var r=this.segVertices.iterator();r.hasNext();){var i=r.next();t[e++]=i.getCoordinate()}return t},setConstraints:function(t,e){this.segments=t,this.segVertices=e},computeConvexHull:function(){var t=new ne,e=this.getPointArray(),n=new ve(e,t);this.convexHull=n.getConvexHull()},addConstraintVertices:function(){this.computeConvexHull(),this.insertSites(this.segVertices)},findNonGabrielPoint:function(t){var e=t.getStart(),n=t.getEnd(),i=new p((e.x+n.x)/2,(e.y+n.y)/2),o=e.distance(i),s=new I(i);s.expandBy(o);for(var a=this.kdt.query(s),u=null,l=r.MAX_VALUE,c=a.iterator();c.hasNext();){var h=c.next(),f=h.getCoordinate();if(!f.equals2D(e)&&!f.equals2D(n)){var d=i.distance(f);if(d<o){var g=d;(null===u||g<l)&&(u=f,l=g)}}}return u},getConstraintSegments:function(){return this.segments},setSplitPointFinder:function(t){this.splitFinder=t},getConvexHull:function(){return this.convexHull},getTolerance:function(){return this.tolerance},enforceGabriel:function(t){for(var e=new w,n=0,i=new w,r=t.iterator();r.hasNext();){var o=r.next(),s=this.findNonGabrielPoint(o);if(null!==s){this.splitPt=this.splitFinder.findSplitPoint(o,s);var a=this.createVertex(this.splitPt,o),u=(this.insertSite(a),new Bo(o.getStartX(),o.getStartY(),o.getStartZ(),a.getX(),a.getY(),a.getZ(),o.getData())),l=new Bo(a.getX(),a.getY(),a.getZ(),o.getEndX(),o.getEndY(),o.getEndZ(),o.getData());e.add(u),e.add(l),i.add(o),n+=1}}return t.removeAll(i),t.addAll(e),n},createVertex:function(){if(1===arguments.length){var t=arguments[0],e=null;return e=null!==this.vertexFactory?this.vertexFactory.createVertex(t,null):new Ro(t)}if(2===arguments.length){var n=arguments[0],i=arguments[1],e=null;return e=null!==this.vertexFactory?this.vertexFactory.createVertex(n,i):new Ro(n),e.setOnConstraint(!0),e}},getSubdivision:function(){return this.subdiv},computeBoundingBox:function(){var t=Uo.computeVertexEnvelope(this.initialVertices),e=Uo.computeVertexEnvelope(this.segVertices),n=new I(t);n.expandToInclude(e);var i=.2*n.getWidth(),r=.2*n.getHeight(),o=Math.max(i,r);this.computeAreaEnv=new I(n),this.computeAreaEnv.expandBy(o)},setVertexFactory:function(t){this.vertexFactory=t},formInitialDelaunay:function(){this.computeBoundingBox(),this.subdiv=new Fo(this.computeAreaEnv,this.tolerance),this.subdiv.setLocator(new _o(this.subdiv)),this.incDel=new To(this.subdiv),this.insertSites(this.initialVertices)},insertSite:function(){if(arguments[0]instanceof Ro){var t=arguments[0],e=this.kdt.insert(t.getCoordinate(),t);if(e.isRepeated()){var n=e.getData();return n.merge(t),n}return this.incDel.insertSite(t),t}if(arguments[0]instanceof p){var i=arguments[0];this.insertSite(this.createVertex(i))}},interfaces_:function(){return[]},getClass:function(){return Uo}}),Uo.computeVertexEnvelope=function(t){for(var e=new I,n=t.iterator();n.hasNext();){var i=n.next();e.expandToInclude(i.getCoordinate())}return e},Uo.MAX_SPLIT_ITER=99,e(Wo.prototype,{create:function(){if(null!==this.subdiv)return null;var t=Wo.envelope(this.siteCoords),e=Wo.toVertices(this.siteCoords);this.subdiv=new Fo(t,this.tolerance),new To(this.subdiv).insertSites(e)},setTolerance:function(t){this.tolerance=t},setSites:function(){if(arguments[0]instanceof G){var t=arguments[0];this.siteCoords=Wo.extractUniqueCoordinates(t)}else if(M(arguments[0],v)){var e=arguments[0];this.siteCoords=Wo.unique(U.toCoordinateArray(e))}},getEdges:function(t){return this.create(),this.subdiv.getEdges(t)},getSubdivision:function(){return this.create(),this.subdiv},getTriangles:function(t){return this.create(),this.subdiv.getTriangles(t)},interfaces_:function(){return[]},getClass:function(){return Wo}}),Wo.extractUniqueCoordinates=function(t){if(null===t)return new b;var e=t.getCoordinates();return Wo.unique(e)},Wo.envelope=function(t){for(var e=new I,n=t.iterator();n.hasNext();){var i=n.next();e.expandToInclude(i)}return e},Wo.unique=function(t){var e=U.copyDeep(t);return ut.sort(e),new b(e,!1)},Wo.toVertices=function(t){for(var e=new w,n=t.iterator();n.hasNext();){var i=n.next();e.add(new Lo(i))}return e},e(Ho.prototype,{createSiteVertices:function(t){for(var e=new w,n=t.iterator();n.hasNext();){var i=n.next();this.constraintVertexMap.containsKey(i)||e.add(new Ro(i))}return e},create:function(){if(null!==this.subdiv)return null;var t=Wo.envelope(this.siteCoords),e=new w;null!==this.constraintLines&&(t.expandToInclude(this.constraintLines.getEnvelopeInternal()),this.createVertices(this.constraintLines),e=Ho.createConstraintSegments(this.constraintLines));var n=this.createSiteVertices(this.siteCoords),i=new Uo(n,this.tolerance);i.setConstraints(e,new w(this.constraintVertexMap.values())),i.formInitialDelaunay(),i.enforceConstraints(),this.subdiv=i.getSubdivision()},setTolerance:function(t){this.tolerance=t},setConstraints:function(t){this.constraintLines=t},setSites:function(t){this.siteCoords=Wo.extractUniqueCoordinates(t)},getEdges:function(t){return this.create(),this.subdiv.getEdges(t)},getSubdivision:function(){return this.create(),this.subdiv},getTriangles:function(t){return this.create(),this.subdiv.getTriangles(t)},createVertices:function(t){for(var e=t.getCoordinates(),n=0;n<e.length;n++){var i=new Ro(e[n]);this.constraintVertexMap.put(e[n],i)}},interfaces_:function(){return[]},getClass:function(){return Ho}}),Ho.createConstraintSegments=function(){if(1===arguments.length){for(var t=arguments[0],e=Bn.getLines(t),n=new w,i=e.iterator();i.hasNext();){var r=i.next();Ho.createConstraintSegments(r,n)}return n}if(2===arguments.length)for(var o=arguments[0],s=arguments[1],a=o.getCoordinates(),i=1;i<a.length;i++)s.add(new Bo(a[i-1],a[i]))},e(Jo.prototype,{create:function(){if(null!==this.subdiv)return null;var t=Wo.envelope(this.siteCoords);this.diagramEnv=t;var e=Math.max(this.diagramEnv.getWidth(),this.diagramEnv.getHeight());this.diagramEnv.expandBy(e),null!==this.clipEnv&&this.diagramEnv.expandToInclude(this.clipEnv);var n=Wo.toVertices(this.siteCoords);this.subdiv=new Fo(t,this.tolerance),new To(this.subdiv).insertSites(n)},getDiagram:function(t){this.create();var e=this.subdiv.getVoronoiDiagram(t);return Jo.clipGeometryCollection(e,this.diagramEnv)},setTolerance:function(t){this.tolerance=t},setSites:function(){if(arguments[0]instanceof G){var t=arguments[0];this.siteCoords=Wo.extractUniqueCoordinates(t)}else if(M(arguments[0],v)){var e=arguments[0];this.siteCoords=Wo.unique(U.toCoordinateArray(e))}},setClipEnvelope:function(t){this.clipEnv=t},getSubdivision:function(){return this.create(),this.subdiv},interfaces_:function(){return[]},getClass:function(){return Jo}}),Jo.clipGeometryCollection=function(t,e){for(var n=t.getFactory().toGeometry(e),i=new w,r=0;r<t.getNumGeometries();r++){var o=t.getGeometryN(r),s=null;e.contains(o.getEnvelopeInternal())?s=o:e.intersects(o.getEnvelopeInternal())&&(s=n.intersection(o),s.setUserData(o.getUserData())),null===s||s.isEmpty()||i.add(s)}return t.getFactory().createGeometryCollection(ne.toGeometryArray(i))};var _s=Object.freeze({Vertex:Lo}),As=Object.freeze({ConformingDelaunayTriangulationBuilder:Ho,DelaunayTriangulationBuilder:Wo,VoronoiDiagramBuilder:Jo,quadedge:_s});e(Zo.prototype,{interfaces_:function(){return[]},getClass:function(){return Zo}}),Zo.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return ni.createEmptyResult(ni.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),ri.overlayOp(t,e,ni.UNION)},e(G.prototype,{equalsTopo:function(t){return!!this.getEnvelopeInternal().equals(t.getEnvelopeInternal())&&io.relate(this,t).isEquals(this.getDimension(),t.getDimension())},union:function(){if(0===arguments.length)return uo.union(this);if(1===arguments.length){var t=arguments[0];return Zo.union(this,t)}},isValid:function(){return Vr.isValid(this)},intersection:function(t){if(this.isEmpty()||t.isEmpty())return ni.createEmptyResult(ni.INTERSECTION,this,t,this.factory);if(this.isGeometryCollection()){var e=t;return ln.map(this,{interfaces_:function(){return[MapOp]},map:function(t){return t.intersection(e)}})}return this.checkNotGeometryCollection(this),this.checkNotGeometryCollection(t),ri.overlayOp(this,t,ni.INTERSECTION)},covers:function(t){return io.covers(this,t)},coveredBy:function(t){return io.coveredBy(this,t)},touches:function(t){return io.touches(this,t)},intersects:function(t){return io.intersects(this,t)},within:function(t){return io.within(this,t)},overlaps:function(t){return io.overlaps(this,t)},disjoint:function(t){return io.disjoint(this,t)},crosses:function(t){return io.crosses(this,t)},buffer:function(){if(1===arguments.length){var t=arguments[0];return pr.bufferOp(this,t)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return pr.bufferOp(this,e,n)}if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];return pr.bufferOp(this,i,r,o)}},convexHull:function(){return new ve(this).getConvexHull()},relate:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return io.relate.apply(io,[this].concat(e))},getCentroid:function(){if(this.isEmpty())return this.factory.createPoint();var t=fe.getCentroid(this);return this.createPointFromInternalCoord(t,this)},getInteriorPoint:function(){if(this.isEmpty())return this.factory.createPoint();var t=null,e=this.getDimension();if(0===e){var n=new ui(this);t=n.getInteriorPoint()}else if(1===e){var n=new ai(this);t=n.getInteriorPoint()}else{var n=new oi(this);t=n.getInteriorPoint()}return this.createPointFromInternalCoord(t,this)},symDifference:function(t){if(this.isEmpty()||t.isEmpty()){if(this.isEmpty()&&t.isEmpty())return ni.createEmptyResult(ni.SYMDIFFERENCE,this,t,this.factory);if(this.isEmpty())return t.copy();if(t.isEmpty())return this.copy()}return this.checkNotGeometryCollection(this),this.checkNotGeometryCollection(t),ri.overlayOp(this,t,ni.SYMDIFFERENCE)},createPointFromInternalCoord:function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},toText:function(){return(new re).write(this)},toString:function(){this.toText()},contains:function(t){return io.contains(this,t)},difference:function(t){return this.isEmpty()?ni.createEmptyResult(ni.DIFFERENCE,this,t,this.factory):t.isEmpty()?this.copy():(this.checkNotGeometryCollection(this),this.checkNotGeometryCollection(t),ri.overlayOp(this,t,ni.DIFFERENCE))},
isSimple:function(){return new Ui(this).isSimple()},isWithinDistance:function(t,e){return!(this.getEnvelopeInternal().distance(t.getEnvelopeInternal())>e)&&mr.isWithinDistance(this,t,e)},distance:function(t){return mr.distance(this,t)},isEquivalentClass:function(t){return this.getClass()===t.getClass()}});t.version="1.3.0 (6e65adb)",t.algorithm=cs,t.densify=hs,t.dissolve=fs,t.geom=us,t.geomgraph=ps,t.index=vs,t.io=Es,t.noding=ws,t.operation=Ps,t.precision=Ts,t.simplify=Os,t.triangulate=As,Object.defineProperty(t,"__esModule",{value:!0})})},{}],131:[function(t,e,n){function i(t,e){switch(t.geometry?t.geometry.type:t.type){case"Point":return r(u(t),e);case"Polygon":var n=[];l(t,function(t){n.push(t)});var c,h,f,p,d,g,v,y,m=a(t,e),x=m.geometry.coordinates,E=0,w=0,b=0,I=n.map(function(t){return[t[0]-x[0],t[1]-x[1]]});for(c=0;c<n.length-1;c++)h=I[c],p=h[0],g=h[1],f=I[c+1],d=f[0],v=f[1],y=p*v-d*g,b+=y,E+=(p+d)*y,w+=(g+v)*y;if(0===b)return m;var N=.5*b,C=1/(6*N);return r([x[0]+C*E,x[1]+C*w],e);default:var S=o(s(t));return S?i(S,e):a(t,e)}}var r=t("@turf/helpers").point,o=t("@turf/convex"),s=t("@turf/explode"),a=t("@turf/centroid"),u=t("@turf/invariant").getCoord,l=t("@turf/meta").coordEach;e.exports=i},{"@turf/centroid":132,"@turf/convex":135,"@turf/explode":154,"@turf/helpers":157,"@turf/invariant":158,"@turf/meta":159}],132:[function(t,e,n){var i=t("@turf/meta").coordEach,r=t("@turf/helpers").point;e.exports=function(t,e){var n=0,o=0,s=0;return i(t,function(t){n+=t[0],o+=t[1],s++},!0),r([n/s,o/s],e)}},{"@turf/helpers":133,"@turf/meta":134}],133:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],134:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],135:[function(t,e,n){var i=t("@turf/meta").coordEach,r=t("convex-hull"),o=t("@turf/helpers").polygon;e.exports=function(t){var e=[];i(t,function(t){e.push([t[0],t[1]])});var n=r(e);if(n.length>=3){for(var s=[],a=0;a<n.length;a++)s.push(e[n[a][0]]);return s.push(e[n[n.length-1][1]]),o([s])}}},{"@turf/helpers":136,"@turf/meta":137,"convex-hull":140}],136:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],137:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],138:[function(t,e,n){"use strict";function i(t,e){for(var n=new Array(e+1),i=0;i<t.length;++i)n[i]=t[i];for(var i=0;i<=t.length;++i){for(var r=t.length;r<=e;++r){for(var s=new Array(e),a=0;a<e;++a)s[a]=Math.pow(r+1-i,a);n[r]=s}if(o.apply(void 0,n))return!0}return!1}function r(t){var e=t.length;if(0===e)return[];if(1===e)return[0];for(var n=t[0].length,r=[t[0]],o=[0],s=1;s<e;++s)if(r.push(t[s]),i(r,n)){if(o.push(s),o.length===n+1)return o}else r.pop();return o}e.exports=r;var o=t("robust-orientation")},{"robust-orientation":146}],139:[function(t,e,n){"use strict";"use restrict";function i(t){var e=32;return t&=-t,t&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}n.INT_BITS=32,n.INT_MAX=2147483647,n.INT_MIN=-1<<31,n.sign=function(t){return(t>0)-(t<0)},n.abs=function(t){var e=t>>31;return(t^e)-e},n.min=function(t,e){return e^(t^e)&-(t<e)},n.max=function(t,e){return t^(t^e)&-(t<e)},n.isPow2=function(t){return!(t&t-1||!t)},n.log2=function(t){var e,n;return e=(t>65535)<<4,t>>>=e,n=(t>255)<<3,t>>>=n,e|=n,n=(t>15)<<2,t>>>=n,e|=n,n=(t>3)<<1,t>>>=n,(e|=n)|t>>1},n.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},n.popCount=function(t){return t-=t>>>1&1431655765,16843009*((t=(858993459&t)+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},n.countTrailingZeros=i,n.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},n.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},n.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var r=new Array(256);!function(t){for(var e=0;e<256;++e){var n=e,i=e,r=7;for(n>>>=1;n;n>>>=1)i<<=1,i|=1&n,--r;t[e]=i<<r&255}}(r),n.reverse=function(t){return r[255&t]<<24|r[t>>>8&255]<<16|r[t>>>16&255]<<8|r[t>>>24&255]},n.interleave2=function(t,e){return t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1},n.deinterleave2=function(t,e){return t=t>>>e&1431655765,t=858993459&(t|t>>>1),t=252645135&(t|t>>>2),t=16711935&(t|t>>>4),(t=65535&(t|t>>>16))<<16>>16},n.interleave3=function(t,e,n){return t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t|=e<<1,n&=1023,n=4278190335&(n|n<<16),n=251719695&(n|n<<8),n=3272356035&(n|n<<4),n=1227133513&(n|n<<2),t|n<<2},n.deinterleave3=function(t,e){return t=t>>>e&1227133513,t=3272356035&(t|t>>>2),t=251719695&(t|t>>>4),t=4278190335&(t|t>>>8),(t=1023&(t|t>>>16))<<22>>22},n.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>i(t)+1}},{}],140:[function(t,e,n){"use strict";function i(t){var e=t.length;if(0===e)return[];if(1===e)return[[0]];var n=t[0].length;return 0===n?[]:1===n?r(t):2===n?o(t):s(t,n)}var r=t("./lib/ch1d"),o=t("./lib/ch2d"),s=t("./lib/chnd");e.exports=i},{"./lib/ch1d":141,"./lib/ch2d":142,"./lib/chnd":143}],141:[function(t,e,n){"use strict";function i(t){for(var e=0,n=0,i=1;i<t.length;++i)t[i][0]<t[e][0]&&(e=i),t[i][0]>t[n][0]&&(n=i);return e<n?[[e],[n]]:e>n?[[n],[e]]:[[e]]}e.exports=i},{}],142:[function(t,e,n){"use strict";function i(t){var e=r(t),n=e.length;if(n<=2)return[];for(var i=new Array(n),o=e[n-1],s=0;s<n;++s){var a=e[s];i[s]=[o,a],o=a}return i}e.exports=i;var r=t("monotone-convex-hull-2d")},{"monotone-convex-hull-2d":145}],143:[function(t,e,n){"use strict";function i(t,e){for(var n=t.length,i=new Array(n),r=0;r<e.length;++r)i[r]=t[e[r]];for(var o=e.length,r=0;r<n;++r)e.indexOf(r)<0&&(i[o++]=t[r]);return i}function r(t,e){for(var n=t.length,i=e.length,r=0;r<n;++r)for(var o=t[r],s=0;s<o.length;++s){var a=o[s];if(a<i)o[s]=e[a];else{a-=i;for(var u=0;u<i;++u)a>=e[u]&&(a+=1);o[s]=a}}return t}function o(t,e){try{return s(t,!0)}catch(l){var n=a(t);if(n.length<=e)return[];var o=i(t,n),u=s(o,!0);return r(u,n)}}e.exports=o;var s=t("incremental-convex-hull"),a=t("affine-hull")},{"affine-hull":138,"incremental-convex-hull":144}],144:[function(t,e,n){"use strict";function i(t,e,n){this.vertices=t,this.adjacent=e,this.boundary=n,this.lastVisited=-1}function r(t,e,n){this.vertices=t,this.cell=e,this.index=n}function o(t,e){return c(t.vertices,e.vertices)}function s(t){for(var e=["function orient(){var tuple=this.tuple;return test("],n=0;n<=t;++n)n>0&&e.push(","),e.push("tuple[",n,"]");e.push(")}return orient");var i=new Function("test",e.join("")),r=l[t+1];return r||(r=l),i(r)}function a(t,e,n){this.dimension=t,this.vertices=e,this.simplices=n,this.interior=n.filter(function(t){return!t.boundary}),this.tuple=new Array(t+1);for(var i=0;i<=t;++i)this.tuple[i]=this.vertices[i];var r=h[t];r||(r=h[t]=s(t)),this.orient=r}function u(t,e){var n=t.length;if(0===n)throw new Error("Must have at least d+1 points");var r=t[0].length;if(n<=r)throw new Error("Must input at least d+1 points");var o=t.slice(0,r+1),s=l.apply(void 0,o);if(0===s)throw new Error("Input not in general position");for(var u=new Array(r+1),c=0;c<=r;++c)u[c]=c;s<0&&(u[0]=1,u[1]=0);for(var h=new i(u,new Array(r+1),!1),f=h.adjacent,p=new Array(r+2),c=0;c<=r;++c){for(var d=u.slice(),g=0;g<=r;++g)g===c&&(d[g]=-1);var v=d[0];d[0]=d[1],d[1]=v;var y=new i(d,new Array(r+1),!0);f[c]=y,p[c]=y}p[r+1]=h;for(var c=0;c<=r;++c)for(var d=f[c].vertices,m=f[c].adjacent,g=0;g<=r;++g){var x=d[g];if(x<0)m[g]=h;else for(var E=0;E<=r;++E)f[E].vertices.indexOf(x)<0&&(m[g]=f[E])}for(var w=new a(r,o,p),b=!!e,c=r+1;c<n;++c)w.insert(t[c],b);return w.boundary()}e.exports=u;var l=t("robust-orientation"),c=t("simplicial-complex").compareCells;i.prototype.flip=function(){var t=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=t;var e=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=e};var h=[],f=a.prototype;f.handleBoundaryDegeneracy=function(t,e){var n=this.dimension,i=this.vertices.length-1,r=this.tuple,o=this.vertices,s=[t];for(t.lastVisited=-i;s.length>0;){t=s.pop();for(var a=(t.vertices,t.adjacent),u=0;u<=n;++u){var l=a[u];if(l.boundary&&!(l.lastVisited<=-i)){for(var c=l.vertices,h=0;h<=n;++h){var f=c[h];r[h]=f<0?e:o[f]}var p=this.orient();if(p>0)return l;l.lastVisited=-i,0===p&&s.push(l)}}}return null},f.walk=function(t,e){var n=this.vertices.length-1,i=this.dimension,r=this.vertices,o=this.tuple,s=e?this.interior.length*Math.random()|0:this.interior.length-1,a=this.interior[s];t:for(;!a.boundary;){for(var u=a.vertices,l=a.adjacent,c=0;c<=i;++c)o[c]=r[u[c]];a.lastVisited=n;for(var c=0;c<=i;++c){var h=l[c];if(!(h.lastVisited>=n)){var f=o[c];o[c]=t;var p=this.orient();if(o[c]=f,p<0){a=h;continue t}h.boundary?h.lastVisited=-n:h.lastVisited=n}}return}return a},f.addPeaks=function(t,e){var n=this.vertices.length-1,s=this.dimension,a=this.vertices,u=this.tuple,l=this.interior,c=this.simplices,h=[e];e.lastVisited=n,e.vertices[e.vertices.indexOf(-1)]=n,e.boundary=!1,l.push(e);for(var f=[];h.length>0;){var e=h.pop(),p=e.vertices,d=e.adjacent,g=p.indexOf(n);if(!(g<0))for(var v=0;v<=s;++v)if(v!==g){var y=d[v];if(y.boundary&&!(y.lastVisited>=n)){var m=y.vertices;if(y.lastVisited!==-n){for(var x=0,E=0;E<=s;++E)m[E]<0?(x=E,u[E]=t):u[E]=a[m[E]];var w=this.orient();if(w>0){m[x]=n,y.boundary=!1,l.push(y),h.push(y),y.lastVisited=n;continue}y.lastVisited=-n}var b=y.adjacent,I=p.slice(),N=d.slice(),C=new i(I,N,!0);c.push(C);var S=b.indexOf(e);if(!(S<0)){b[S]=C,N[g]=y,I[v]=-1,N[v]=e,d[v]=C,C.flip();for(var E=0;E<=s;++E){var M=I[E];if(!(M<0||M===n)){for(var L=new Array(s-1),R=0,P=0;P<=s;++P){var T=I[P];T<0||P===E||(L[R++]=T)}f.push(new r(L,C,E))}}}}}}f.sort(o);for(var v=0;v+1<f.length;v+=2){var O=f[v],_=f[v+1],A=O.index,D=_.index;A<0||D<0||(O.cell.adjacent[O.index]=_.cell,_.cell.adjacent[_.index]=O.cell)}},f.insert=function(t,e){var n=this.vertices;n.push(t);var i=this.walk(t,e);if(i){for(var r=this.dimension,o=this.tuple,s=0;s<=r;++s){var a=i.vertices[s];o[s]=a<0?t:n[a]}var u=this.orient(o);u<0||(0!==u||(i=this.handleBoundaryDegeneracy(i,t)))&&this.addPeaks(t,i)}},f.boundary=function(){for(var t=this.dimension,e=[],n=this.simplices,i=n.length,r=0;r<i;++r){var o=n[r];if(o.boundary){for(var s=new Array(t),a=o.vertices,u=0,l=0,c=0;c<=t;++c)a[c]>=0?s[u++]=a[c]:l=1&c;if(l===(1&t)){var h=s[0];s[0]=s[1],s[1]=h}e.push(s)}}return e}},{"robust-orientation":146,"simplicial-complex":150}],145:[function(t,e,n){"use strict";function i(t){var e=t.length;if(e<3){for(var n=new Array(e),i=0;i<e;++i)n[i]=i;return 2===e&&t[0][0]===t[1][0]&&t[0][1]===t[1][1]?[0]:n}for(var o=new Array(e),i=0;i<e;++i)o[i]=i;o.sort(function(e,n){var i=t[e][0]-t[n][0];return i||t[e][1]-t[n][1]});for(var s=[o[0],o[1]],a=[o[0],o[1]],i=2;i<e;++i){for(var u=o[i],l=t[u],c=s.length;c>1&&r(t[s[c-2]],t[s[c-1]],l)<=0;)c-=1,s.pop();for(s.push(u),c=a.length;c>1&&r(t[a[c-2]],t[a[c-1]],l)>=0;)c-=1,a.pop();a.push(u)}for(var n=new Array(a.length+s.length-2),h=0,i=0,f=s.length;i<f;++i)n[h++]=s[i];for(var p=a.length-2;p>0;--p)n[h++]=a[p];return n}e.exports=i;var r=t("robust-orientation")[3]},{"robust-orientation":146}],146:[function(t,e,n){"use strict";function i(t,e){for(var n=new Array(t.length-1),i=1;i<t.length;++i)for(var r=n[i-1]=new Array(t.length-1),o=0,s=0;o<t.length;++o)o!==e&&(r[s++]=t[i][o]);return n}function r(t){for(var e=new Array(t),n=0;n<t;++n){e[n]=new Array(t);for(var i=0;i<t;++i)e[n][i]=["m",i,"[",t-n-1,"]"].join("")}return e}function o(t){return 1&t?"-":""}function s(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",s(t.slice(0,e)),",",s(t.slice(e)),")"].join("")}function a(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],n=0;n<t.length;++n)e.push(["scale(",s(a(i(t,n))),",",o(n),t[0][n],")"].join(""));return e}function u(t){for(var e=[],n=[],o=r(t),u=[],l=0;l<t;++l)0==(1&l)?e.push.apply(e,a(i(o,l))):n.push.apply(n,a(i(o,l))),u.push("m"+l);var d=s(e),g=s(n),v="orientation"+t+"Exact",y=["function ",v,"(",u.join(),"){var p=",d,",n=",g,",d=sub(p,n);return d[d.length-1];};return ",v].join("");return new Function("sum","prod","scale","sub",y)(h,c,f,p)}function l(t){var e=y[t.length];return e||(e=y[t.length]=u(t.length)),e.apply(void 0,t)}var c=t("two-product"),h=t("robust-sum"),f=t("robust-scale"),p=t("robust-subtract"),d=5,g=u(3),v=u(4),y=[function(){return 0},function(){return 0},function(t,e){return e[0]-t[0]},function(t,e,n){var i,r=(t[1]-n[1])*(e[0]-n[0]),o=(t[0]-n[0])*(e[1]-n[1]),s=r-o;if(r>0){if(o<=0)return s;i=r+o}else{if(!(r<0))return s;if(o>=0)return s;i=-(r+o)}var a=3.3306690738754716e-16*i;return s>=a||s<=-a?s:g(t,e,n)},function(t,e,n,i){var r=t[0]-i[0],o=e[0]-i[0],s=n[0]-i[0],a=t[1]-i[1],u=e[1]-i[1],l=n[1]-i[1],c=t[2]-i[2],h=e[2]-i[2],f=n[2]-i[2],p=o*l,d=s*u,g=s*a,y=r*l,m=r*u,x=o*a,E=c*(p-d)+h*(g-y)+f*(m-x),w=(Math.abs(p)+Math.abs(d))*Math.abs(c)+(Math.abs(g)+Math.abs(y))*Math.abs(h)+(Math.abs(m)+Math.abs(x))*Math.abs(f),b=7.771561172376103e-16*w;return E>b||-E>b?E:v(t,e,n,i)}];!function(){for(;y.length<=d;)y.push(u(y.length));for(var t=[],n=["slow"],i=0;i<=d;++i)t.push("a"+i),n.push("o"+i);for(var r=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"],i=2;i<=d;++i)r.push("case ",i,":return o",i,"(",t.slice(0,i).join(),");");r.push("}var s=new Array(arguments.length);for(var i=0;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return getOrientation"),n.push(r.join(""));var o=Function.apply(void 0,n);e.exports=o.apply(void 0,[l].concat(y));for(var i=0;i<=d;++i)e.exports[i]=y[i]}()},{"robust-scale":147,"robust-subtract":148,"robust-sum":149,"two-product":151}],147:[function(t,e,n){"use strict";function i(t,e){var n=t.length;if(1===n){var i=r(t[0],e);return i[0]?i:[i[1]]}var s=new Array(2*n),a=[.1,.1],u=[.1,.1],l=0;r(t[0],e,a),a[0]&&(s[l++]=a[0]);for(var c=1;c<n;++c){r(t[c],e,u);var h=a[1];o(h,u[0],a),a[0]&&(s[l++]=a[0]);var f=u[1],p=a[1],d=f+p,g=d-f,v=p-g;a[1]=d,v&&(s[l++]=v)}return a[1]&&(s[l++]=a[1]),0===l&&(s[l++]=0),s.length=l,s}var r=t("two-product"),o=t("two-sum");e.exports=i},{"two-product":151,"two-sum":152}],148:[function(t,e,n){"use strict";function i(t,e){var n=t+e,i=n-t,r=n-i,o=e-i,s=t-r,a=s+o;return a?[a,n]:[n]}function r(t,e){var n=0|t.length,r=0|e.length;if(1===n&&1===r)return i(t[0],-e[0]);var o,s,a=n+r,u=new Array(a),l=0,c=0,h=0,f=Math.abs,p=t[c],d=f(p),g=-e[h],v=f(g);d<v?(s=p,(c+=1)<n&&(p=t[c],d=f(p))):(s=g,(h+=1)<r&&(g=-e[h],v=f(g))),c<n&&d<v||h>=r?(o=p,(c+=1)<n&&(p=t[c],d=f(p))):(o=g,(h+=1)<r&&(g=-e[h],v=f(g)));for(var y,m,x,E,w,b=o+s,I=b-o,N=s-I,C=N,S=b;c<n&&h<r;)d<v?(o=p,(c+=1)<n&&(p=t[c],d=f(p))):(o=g,(h+=1)<r&&(g=-e[h],v=f(g))),s=C,b=o+s,I=b-o,N=s-I,N&&(u[l++]=N),y=S+b,m=y-S,x=y-m,E=b-m,w=S-x,C=w+E,S=y;for(;c<n;)o=p,s=C,b=o+s,I=b-o,N=s-I,N&&(u[l++]=N),y=S+b,m=y-S,x=y-m,E=b-m,w=S-x,C=w+E,S=y,(c+=1)<n&&(p=t[c]);for(;h<r;)o=g,s=C,b=o+s,I=b-o,N=s-I,N&&(u[l++]=N),y=S+b,m=y-S,x=y-m,E=b-m,w=S-x,C=w+E,S=y,(h+=1)<r&&(g=-e[h]);return C&&(u[l++]=C),S&&(u[l++]=S),l||(u[l++]=0),u.length=l,u}e.exports=r},{}],149:[function(t,e,n){"use strict";function i(t,e){var n=t+e,i=n-t,r=n-i,o=e-i,s=t-r,a=s+o;return a?[a,n]:[n]}function r(t,e){var n=0|t.length,r=0|e.length;if(1===n&&1===r)return i(t[0],e[0]);var o,s,a=n+r,u=new Array(a),l=0,c=0,h=0,f=Math.abs,p=t[c],d=f(p),g=e[h],v=f(g);d<v?(s=p,(c+=1)<n&&(p=t[c],d=f(p))):(s=g,(h+=1)<r&&(g=e[h],v=f(g))),c<n&&d<v||h>=r?(o=p,(c+=1)<n&&(p=t[c],d=f(p))):(o=g,(h+=1)<r&&(g=e[h],v=f(g)));for(var y,m,x,E,w,b=o+s,I=b-o,N=s-I,C=N,S=b;c<n&&h<r;)d<v?(o=p,(c+=1)<n&&(p=t[c],d=f(p))):(o=g,(h+=1)<r&&(g=e[h],v=f(g))),s=C,b=o+s,I=b-o,N=s-I,N&&(u[l++]=N),y=S+b,m=y-S,x=y-m,E=b-m,w=S-x,C=w+E,S=y;for(;c<n;)o=p,s=C,b=o+s,I=b-o,N=s-I,N&&(u[l++]=N),y=S+b,m=y-S,x=y-m,E=b-m,w=S-x,C=w+E,S=y,(c+=1)<n&&(p=t[c]);for(;h<r;)o=g,s=C,b=o+s,I=b-o,N=s-I,N&&(u[l++]=N),y=S+b,m=y-S,x=y-m,E=b-m,w=S-x,C=w+E,S=y,(h+=1)<r&&(g=e[h]);return C&&(u[l++]=C),S&&(u[l++]=S),l||(u[l++]=0),u.length=l,u}e.exports=r},{}],150:[function(t,e,n){"use strict";"use restrict";function i(t){for(var e=0,n=Math.max,i=0,r=t.length;i<r;++i)e=n(e,t[i].length);return e-1}function r(t){for(var e=-1,n=Math.max,i=0,r=t.length;i<r;++i)for(var o=t[i],s=0,a=o.length;s<a;++s)e=n(e,o[s]);return e+1}function o(t){for(var e=new Array(t.length),n=0,i=t.length;n<i;++n)e[n]=t[n].slice(0);return e}function s(t,e){var n=t.length,i=t.length-e.length,r=Math.min;if(i)return i;switch(n){case 0:return 0;case 1:return t[0]-e[0];case 2:var o=t[0]+t[1]-e[0]-e[1];return o||r(t[0],t[1])-r(e[0],e[1]);case 3:var s=t[0]+t[1],a=e[0]+e[1];if(o=s+t[2]-(a+e[2]))return o;var u=r(t[0],t[1]),l=r(e[0],e[1]),o=r(u,t[2])-r(l,e[2]);return o||r(u+t[2],s)-r(l+e[2],a);default:var c=t.slice(0);c.sort();var h=e.slice(0);h.sort();for(var f=0;f<n;++f)if(i=c[f]-h[f])return i;return 0}}function a(t,e){return s(t[0],e[0])}function u(t,e){if(e){for(var n=t.length,i=new Array(n),r=0;r<n;++r)i[r]=[t[r],e[r]];i.sort(a);for(var r=0;r<n;++r)t[r]=i[r][0],e[r]=i[r][1];return t}return t.sort(s),t}function l(t){if(0===t.length)return[];for(var e=1,n=t.length,i=1;i<n;++i){var r=t[i];if(s(r,t[i-1])){if(i===e){e++;continue}t[e++]=r}}return t.length=e,t}function c(t,e){for(var n=0,i=t.length-1,r=-1;n<=i;){var o=n+i>>1,a=s(t[o],e);a<=0?(0===a&&(r=o),n=o+1):a>0&&(i=o-1)}return r}function h(t,e){for(var n=new Array(t.length),i=0,r=n.length;i<r;++i)n[i]=[];for(var o=[],i=0,a=e.length;i<a;++i)for(var u=e[i],l=u.length,h=1,f=1<<l;h<f;++h){o.length=x.popCount(h);for(var p=0,d=0;d<l;++d)h&1<<d&&(o[p++]=u[d]);var g=c(t,o);if(!(g<0))for(;;)if(n[g++].push(i),g>=t.length||0!==s(t[g],o))break}return n}function f(t,e){if(!e)return h(l(d(t,0)),t,0);for(var n=new Array(e),i=0;i<e;++i)n[i]=[];for(var i=0,r=t.length;i<r;++i)for(var o=t[i],s=0,a=o.length;s<a;++s)n[o[s]].push(i);return n}function p(t){for(var e=[],n=0,i=t.length;n<i;++n)for(var r=t[n],o=0|r.length,s=1,a=1<<o;s<a;++s){for(var l=[],c=0;c<o;++c)s>>>c&1&&l.push(r[c]);e.push(l)}return u(e)}function d(t,e){if(e<0)return[];for(var n=[],i=(1<<e+1)-1,r=0;r<t.length;++r)for(var o=t[r],s=i;s<1<<o.length;s=x.nextCombination(s)){for(var a=new Array(e+1),l=0,c=0;c<o.length;++c)s&1<<c&&(a[l++]=o[c]);n.push(a)}return u(n)}function g(t){for(var e=[],n=0,i=t.length;n<i;++n)for(var r=t[n],o=0,s=r.length;o<s;++o){for(var a=new Array(r.length-1),l=0,c=0;l<s;++l)l!==o&&(a[c++]=r[l]);e.push(a)}return u(e)}function v(t,e){for(var n=new E(e),i=0;i<t.length;++i)for(var r=t[i],o=0;o<r.length;++o)for(var s=o+1;s<r.length;++s)n.link(r[o],r[s]);for(var a=[],u=n.ranks,i=0;i<u.length;++i)u[i]=-1;for(var i=0;i<t.length;++i){var l=n.find(t[i][0]);u[l]<0?(u[l]=a.length,a.push([t[i].slice(0)])):a[u[l]].push(t[i].slice(0))}return a}function y(t){for(var e=l(u(d(t,0))),n=new E(e.length),i=0;i<t.length;++i)for(var r=t[i],o=0;o<r.length;++o)for(var s=c(e,[r[o]]),a=o+1;a<r.length;++a)n.link(s,c(e,[r[a]]));for(var h=[],f=n.ranks,i=0;i<f.length;++i)f[i]=-1;for(var i=0;i<t.length;++i){var p=n.find(c(e,[t[i][0]]));f[p]<0?(f[p]=h.length,h.push([t[i].slice(0)])):h[f[p]].push(t[i].slice(0))}return h}function m(t,e){return e?v(t,e):y(t)}var x=t("bit-twiddle"),E=t("union-find");n.dimension=i,n.countVertices=r,n.cloneCells=o,n.compareCells=s,n.normalize=u,n.unique=l,n.findCell=c,n.incidence=h,n.dual=f,n.explode=p,n.skeleton=d,n.boundary=g,n.connectedComponents=m},{"bit-twiddle":139,"union-find":153}],151:[function(t,e,n){"use strict";function i(t,e,n){var i=t*e,o=r*t,s=o-t,a=o-s,u=t-a,l=r*e,c=l-e,h=l-c,f=e-h,p=i-a*h,d=p-u*h,g=d-a*f,v=u*f-g;return n?(n[0]=v,n[1]=i,n):[v,i]}e.exports=i;var r=+(Math.pow(2,27)+1)},{}],152:[function(t,e,n){"use strict";function i(t,e,n){var i=t+e,r=i-t,o=i-r,s=e-r,a=t-o;return n?(n[0]=a+s,n[1]=i,n):[a+s,i]}e.exports=i},{}],153:[function(t,e,n){"use strict";"use restrict";function i(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e<t;++e)this.roots[e]=e,this.ranks[e]=0}e.exports=i;var r=i.prototype;Object.defineProperty(r,"length",{get:function(){return this.roots.length}}),r.makeSet=function(){var t=this.roots.length;return this.roots.push(t),this.ranks.push(0),t},r.find=function(t){for(var e=t,n=this.roots;n[t]!==t;)t=n[t];for(;n[e]!==t;){var i=n[e];n[e]=t,e=i}return t},r.link=function(t,e){var n=this.find(t),i=this.find(e);if(n!==i){var r=this.ranks,o=this.roots,s=r[n],a=r[i];s<a?o[n]=i:a<s?o[i]=n:(o[i]=n,++r[n])}}},{}],154:[function(t,e,n){var i=t("@turf/meta"),r=t("@turf/helpers"),o=r.point,s=i.coordEach,a=i.featureEach,u=r.featureCollection;e.exports=function(t){var e=[];return"FeatureCollection"===t.type?a(t,function(t){s(t,function(n){e.push(o(n,t.properties))})}):s(t,function(n){e.push(o(n,t.properties))}),u(e)}},{"@turf/helpers":155,"@turf/meta":156}],155:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],156:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],157:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],158:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],159:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],160:[function(t,e,n){arguments[4][122][0].apply(n,arguments)},{"@turf/bbox":161,"@turf/helpers":163,dup:122}],161:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"@turf/meta":162,dup:22}],162:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],163:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],164:[function(t,e,n){arguments[4][132][0].apply(n,arguments)},{"@turf/helpers":165,"@turf/meta":166,dup:132}],165:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],166:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],167:[function(t,e,n){var i=t("@turf/destination"),r=t("@turf/helpers").polygon;e.exports=function(t,e,n,o,s){if(!t)throw new Error("center is required");if(!e)throw new Error("radius is required");n=n||64,s=s||t.properties||{};for(var a=[],u=0;u<n;u++)a.push(i(t,e,360*u/n,o).geometry.coordinates);return a.push(a[0]),r([a],s)}},{"@turf/destination":168,"@turf/helpers":171}],168:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{"@turf/helpers":169,"@turf/invariant":170,dup:5}],169:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],170:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],171:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],172:[function(t,e,n){arguments[4][77][0].apply(n,arguments)},{"@turf/helpers":173,"@turf/invariant":174,dup:77}],173:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],174:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],175:[function(t,e,n){function i(t){return t.coordinates?s(t):"Feature"===t.type?r(t):"FeatureCollection"===t.type?o(t):"GeometryCollection"===t.type?s(t):void 0}function r(t){var e={type:"Feature",properties:t.properties||{},geometry:s(t.geometry)};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e}function o(t){return{type:"FeatureCollection",features:t.features.map(function(t){return r(t)})}}function s(t){return"GeometryCollection"===t.type?{type:"GeometryCollection",geometries:t.geometries.map(function(t){return s(t)})}:{type:t.type,coordinates:a(t.coordinates)}}function a(t){return"object"!=typeof t[0]?t.slice():t.map(function(t){return a(t)})}e.exports=function(t,e){if(!t)throw new Error("geojson is required");if(e&&"boolean"!=typeof e)throw new Error("cloneAll must be a Boolean");return e?JSON.parse(JSON.stringify(t)):i(t)}},{}],176:[function(t,e,n){var i=t("@turf/meta"),r=t("@turf/clone"),o=t("@turf/helpers"),s=t("@turf/invariant"),a=t("density-clustering"),u=t("@turf/distance"),l=i.coordAll,c=s.collectionOf,h=o.convertDistance;e.exports=function(t,e,n,i){if(c(t,"Point","Input must contain Points"),null===e||void 0===e)throw new Error("maxDistance is required");if(!(Math.sign(e)>0))throw new Error("Invalid maxDistance");if(!(void 0===i||null===i||Math.sign(i)>0))throw new Error("Invalid minPoints");t=r(t,!0),i=i||3;var o=new a.DBSCAN,s=o.run(l(t),h(e,n),i,u),f=-1;return s.forEach(function(e){f++,e.forEach(function(e){var n=t.features[e];n.properties||(n.properties={}),n.properties.cluster=f,n.properties.dbscan="core"})}),o.noise.forEach(function(e){var n=t.features[e];n.properties||(n.properties={}),n.properties.cluster?n.properties.dbscan="edge":n.properties.dbscan="noise"}),t}},{"@turf/clone":177,"@turf/distance":178,"@turf/helpers":181,"@turf/invariant":182,"@turf/meta":183,"density-clustering":188}],177:[function(t,e,n){arguments[4][175][0].apply(n,arguments)},{dup:175}],178:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":179,"@turf/invariant":180,dup:8}],179:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],180:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],181:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],182:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],183:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],184:[function(t,e,n){function i(t,e,n,i){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(t,e,n,i)}i.prototype.run=function(t,e,n,i){this._init(t,e,n,i);for(var r=0;r<this._datasetLength;r++)if(1!==this._visited[r]){this._visited[r]=1;var o=this._regionQuery(r);if(o.length<this.minPts)this.noise.push(r);else{var s=this.clusters.length;this.clusters.push([]),this._addToCluster(r,s),this._expandCluster(s,o)}}return this.clusters},i.prototype._init=function(t,e,n,i){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+typeof t+" given");this.dataset=t,this.clusters=[],this.noise=[],this._datasetLength=t.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}e&&(this.epsilon=e),n&&(this.minPts=n),i&&(this.distance=i)},i.prototype._expandCluster=function(t,e){for(var n=0;n<e.length;n++){var i=e[n];if(1!==this._visited[i]){this._visited[i]=1;var r=this._regionQuery(i);r.length>=this.minPts&&(e=this._mergeArrays(e,r))}1!==this._assigned[i]&&this._addToCluster(i,t)}},i.prototype._addToCluster=function(t,e){this.clusters[e].push(t),this._assigned[t]=1},i.prototype._regionQuery=function(t){for(var e=[],n=0;n<this._datasetLength;n++){this.distance(this.dataset[t],this.dataset[n])<this.epsilon&&e.push(n)}return e},i.prototype._mergeArrays=function(t,e){for(var n=e.length,i=0;i<n;i++){var r=e[i];t.indexOf(r)<0&&t.push(r)}return t},i.prototype._euclideanDistance=function(t,e){for(var n=0,i=Math.min(t.length,e.length);i--;)n+=(t[i]-e[i])*(t[i]-e[i]);return Math.sqrt(n)},void 0!==e&&e.exports&&(e.exports=i)},{}],185:[function(t,e,n){function i(t,e,n){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(t,e,n)}i.prototype.init=function(t,e,n){this.assignments=[],this.centroids=[],void 0!==t&&(this.dataset=t),void 0!==e&&(this.k=e),void 0!==n&&(this.distance=n)},i.prototype.run=function(t,e){this.init(t,e);for(var n=this.dataset.length,i=0;i<this.k;i++)this.centroids[i]=this.randomCentroid();for(var r=!0;r;){r=this.assign();for(var o=0;o<this.k;o++){for(var s=new Array(c),a=0,u=0;u<c;u++)s[u]=0;for(var l=0;l<n;l++){var c=this.dataset[l].length;if(o===this.assignments[l]){for(var u=0;u<c;u++)s[u]+=this.dataset[l][u];a++}}if(a>0){for(var u=0;u<c;u++)s[u]/=a;this.centroids[o]=s}else this.centroids[o]=this.randomCentroid(),r=!0}}return this.getClusters()},i.prototype.randomCentroid=function(){var t,e,n=this.dataset.length-1;do{e=Math.round(Math.random()*n),t=this.dataset[e]}while(this.centroids.indexOf(t)>=0);return t},i.prototype.assign=function(){for(var t,e=!1,n=this.dataset.length,i=0;i<n;i++)(t=this.argmin(this.dataset[i],this.centroids,this.distance))!=this.assignments[i]&&(this.assignments[i]=t,e=!0);return e},i.prototype.getClusters=function(){for(var t,e=new Array(this.k),n=0;n<this.assignments.length;n++)t=this.assignments[n],void 0===e[t]&&(e[t]=[]),e[t].push(n);return e},i.prototype.argmin=function(t,e,n){for(var i,r=Number.MAX_VALUE,o=0,s=e.length,a=0;a<s;a++)(i=n(t,e[a]))<r&&(r=i,o=a);return o},i.prototype.distance=function(t,e){for(var n=0,i=Math.min(t.length,e.length);i--;){var r=t[i]-e[i];n+=r*r}return Math.sqrt(n)},void 0!==e&&e.exports&&(e.exports=i)},{}],186:[function(t,e,n){function i(t,e,n,i){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(t,e,n,i)}if(void 0!==e&&e.exports)var r=t("./PriorityQueue.js");i.prototype.run=function(t,e,n,i){this._init(t,e,n,i);for(var o=0,s=this.dataset.length;o<s;o++)if(1!==this._processed[o]){this._processed[o]=1,this.clusters.push([o]);var a=this.clusters.length-1;this._orderedList.push(o);var u=new r(null,null,"asc"),l=this._regionQuery(o);void 0!==this._distanceToCore(o)&&(this._updateQueue(o,l,u),this._expandCluster(a,u))}return this.clusters},i.prototype.getReachabilityPlot=function(){for(var t=[],e=0,n=this._orderedList.length;e<n;e++){var i=this._orderedList[e],r=this._reachability[i];t.push([i,r])}return t},i.prototype._init=function(t,e,n,i){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+typeof t+" given");this.dataset=t,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}e&&(this.epsilon=e),n&&(this.minPts=n),i&&(this.distance=i)},i.prototype._updateQueue=function(t,e,n){var i=this;this._coreDistance=this._distanceToCore(t),e.forEach(function(e){if(void 0===i._processed[e]){var r=i.distance(i.dataset[t],i.dataset[e]),o=Math.max(i._coreDistance,r);void 0===i._reachability[e]?(i._reachability[e]=o,n.insert(e,o)):o<i._reachability[e]&&(i._reachability[e]=o,n.remove(e),n.insert(e,o))}})},i.prototype._expandCluster=function(t,e){for(var n=e.getElements(),i=0,r=n.length;i<r;i++){var o=n[i];if(void 0===this._processed[o]){var s=this._regionQuery(o);this._processed[o]=1,this.clusters[t].push(o),this._orderedList.push(o),void 0!==this._distanceToCore(o)&&(this._updateQueue(o,s,e),this._expandCluster(t,e))}}},i.prototype._distanceToCore=function(t){for(var e=this.epsilon,n=0;n<e;n++){if(this._regionQuery(t,n).length>=this.minPts)return n}},i.prototype._regionQuery=function(t,e){e=e||this.epsilon;for(var n=[],i=0,r=this.dataset.length;i<r;i++)this.distance(this.dataset[t],this.dataset[i])<e&&n.push(i);return n},i.prototype._euclideanDistance=function(t,e){for(var n=0,i=Math.min(t.length,e.length);i--;)n+=(t[i]-e[i])*(t[i]-e[i]);return Math.sqrt(n)},void 0!==e&&e.exports&&(e.exports=i)},{"./PriorityQueue.js":187}],187:[function(t,e,n){function i(t,e,n){this._queue=[],this._priorities=[],this._sorting="desc",this._init(t,e,n)}i.prototype.insert=function(t,e){for(var n=this._queue.length,i=n;i--;){var r=this._priorities[i];"desc"===this._sorting?e>r&&(n=i):e<r&&(n=i)}this._insertAt(t,e,n)},i.prototype.remove=function(t){for(var e=this._queue.length;e--;){if(t===this._queue[e]){this._queue.splice(e,1),this._priorities.splice(e,1);break}}},i.prototype.forEach=function(t){this._queue.forEach(t)},i.prototype.getElements=function(){return this._queue},i.prototype.getElementPriority=function(t){return this._priorities[t]},i.prototype.getPriorities=function(){return this._priorities},i.prototype.getElementsWithPriorities=function(){for(var t=[],e=0,n=this._queue.length;e<n;e++)t.push([this._queue[e],this._priorities[e]]);return t},i.prototype._init=function(t,e,n){if(t&&e){if(this._queue=[],this._priorities=[],t.length!==e.length)throw new Error("Arrays must have the same length");for(var i=0;i<t.length;i++)this.insert(t[i],e[i])}n&&(this._sorting=n)},i.prototype._insertAt=function(t,e,n){this._queue.length===n?(this._queue.push(t),
this._priorities.push(e)):(this._queue.splice(n,0,t),this._priorities.splice(n,0,e))},void 0!==e&&e.exports&&(e.exports=i)},{}],188:[function(t,e,n){void 0!==e&&e.exports&&(e.exports={DBSCAN:t("./DBSCAN.js"),KMEANS:t("./KMEANS.js"),OPTICS:t("./OPTICS.js"),PriorityQueue:t("./PriorityQueue.js")})},{"./DBSCAN.js":184,"./KMEANS.js":185,"./OPTICS.js":186,"./PriorityQueue.js":187}],189:[function(t,e,n){var i=t("@turf/meta"),r=t("@turf/clone"),o=t("./skmeans"),s=t("@turf/invariant"),a=i.coordAll,u=i.featureEach,l=s.collectionOf;e.exports=function(t,e,n){l(t,"Point","Input must contain Points");var i=t.features.length;e=e||Math.round(Math.sqrt(i/2)),e>i&&(e=i),!1!==n&&void 0!==n||(t=r(t,!0));var s=a(t),c=s.slice(0,e),h=o(s,e,c),f={};return h.centroids.forEach(function(t,e){f[e]=t}),u(t,function(t,e){var n=h.idxs[e];t.properties.cluster=n,t.properties.centroid=f[n]}),t}},{"./skmeans":193,"@turf/clone":190,"@turf/invariant":191,"@turf/meta":192}],190:[function(t,e,n){arguments[4][175][0].apply(n,arguments)},{dup:175}],191:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],192:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],193:[function(t,e,n){function i(t,e,n){for(var i=t.length,r=0,o=0;o<i;o++){var s=(t[o]||0)-(e[o]||0);r+=s*s}return n?Math.sqrt(r):r}function r(t,e,n){var i=Math.abs(t-e);return n?i:i*i}function o(t,e){for(var n={},i=[],r=e<<2,o=t.length,s=t[0].length>0;i.length<e&&r-- >0;){var a=t[Math.floor(Math.random()*o)],u=s?a.join("_"):""+a;n[u]||(n[u]=!0,i.push(a))}if(i.length<e)throw new Error("Error initializating clusters");return i}function s(t,e){var n=t[0].length?i:r,o=[],s=t.length,a=t[0].length>0,u={},l=t[Math.floor(Math.random()*s)],c=a?l.join("_"):""+l;for(o.push(l),u[c]=!0;o.length<e;){for(var h=[],f=o.length,p=0,d=[],g=0;g<s;g++){for(var v=1/0,y=0;y<f;y++){var m=n(t[g],o[y]);m<=v&&(v=m)}h[g]=v}for(var x=0;x<s;x++)p+=h[x];for(var E=0;E<s;E++)d[E]={i:E,v:t[E],pr:h[E]/p,cs:0};d.sort(function(t,e){return t.pr-e.pr}),d[0].cs=d[0].pr;for(var w=1;w<s;w++)d[w].cs=d[w-1].cs+d[w].pr;for(var b=Math.random(),I=0;I<s-1&&d[I++].cs<b;);o.push(d[I-1].v)}return o}function a(t,e,n){n=n||[];for(var i=0;i<t;i++)n[i]=e;return n}function u(t,e,n,r){var u=[],c=[],h=[],f=[],p=!1,d=r||l,g=t.length,v=t[0].length,y=v>0;if(n)u="kmrand"==n?o(t,e):"kmpp"==n?s(t,e):n;else for(var m={};u.length<e;){var x=Math.floor(Math.random()*g);m[x]||(m[x]=!0,u.push(t[x]))}do{for(var E=0;E<g;E++){for(var w=1/0,b=0,I=0;I<e;I++){var f=y?i(t[E],u[I]):Math.abs(t[E]-u[I]);f<=w&&(w=f,b=I)}h[E]=b}for(var N=[],C=[],c=[],S=0;S<e;S++)N[S]=0,C[S]=y?a(v,0,C[S]):0,c[S]=u[S];if(y){for(var M=0;M<e;M++)u[M]=[];for(var L=0;L<g;L++){for(var R=h[L],P=C[R],T=t[L],O=0;O<v;O++)P[O]+=T[O];N[R]++}p=!0;for(var _=0;_<e;_++){for(var A=u[_],D=C[_],F=c[_],q=N[_],k=0;k<v;k++)A[k]=D[k]/q||0;if(p)for(var G=0;G<v;G++)if(F[G]!=A[G]){p=!1;break}}}else{for(var j=0;j<g;j++){var B=h[j];C[B]+=t[j],N[B]++}for(var z=0;z<e;z++)u[z]=C[z]/N[z]||0;p=!0;for(var V=0;V<e;V++)if(c[V]!=u[V]){p=!1;break}}p=p||--d<=0}while(!p);return{it:l-d,k:e,idxs:h,centroids:u}}var l=1e4;e.exports=u},{}],194:[function(t,e,n){function i(t,e){if(!t)throw new Error("geojson is required");if("FeatureCollection"!==t.type)throw new Error("geojson must be a FeatureCollection");if(void 0===e||null===e)throw new Error("filter is required");var n=[];return c(t,function(t){a(t.properties,e)&&n.push(t)}),h(n)}function r(t,e,n){if(!t)throw new Error("geojson is required");if("FeatureCollection"!==t.type)throw new Error("geojson must be a FeatureCollection");if(void 0===e||null===e)throw new Error("property is required");for(var i=s(t,e),r=Object.keys(i),o=0;o<r.length;o++){for(var a=r[o],u=i[a],l=[],c=0;c<u.length;c++)l.push(t.features[u[c]]);n(h(l),a,o)}}function o(t,e,n,i){var o=i;return r(t,e,function(t,e,r){o=0===r&&void 0===i?t:n(o,t,e,r)}),o}function s(t,e){var n={};return c(t,function(t,i){var r=t.properties||{};if(r.hasOwnProperty(e)){var o=r[e];n.hasOwnProperty(o)?n[o].push(i):n[o]=[i]}}),n}function a(t,e){if(void 0===t)return!1;var n=typeof e;if("number"===n||"string"===n)return t.hasOwnProperty(e);if(Array.isArray(e)){for(var i=0;i<e.length;i++)if(!a(t,e[i]))return!1;return!0}return u(t,e)}function u(t,e){for(var n=Object.keys(e),i=0;i<n.length;i++){var r=n[i];if(t[r]!==e[r])return!1}return!0}function l(t,e){if(!e)return{};if(!e.length)return{};for(var n={},i=0;i<e.length;i++){var r=e[i];t.hasOwnProperty(r)&&(n[r]=t[r])}return n}var c=t("@turf/meta").featureEach,h=t("@turf/helpers").featureCollection;e.exports={getCluster:i,clusterEach:r,clusterReduce:o,createBins:s,applyFilter:a,propertiesContainsFilter:u,filterProperties:l}},{"@turf/helpers":195,"@turf/meta":196}],195:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],196:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],197:[function(t,e,n){var i=t("@turf/bbox"),r=t("@turf/inside"),o=t("rbush");e.exports=function(t,e,n,s){var a=o(6),u=e.features.map(function(t){return{minX:t.geometry.coordinates[0],minY:t.geometry.coordinates[1],maxX:t.geometry.coordinates[0],maxY:t.geometry.coordinates[1],property:t.properties[n]}});return a.load(u),t.features.forEach(function(t){t.properties||(t.properties={});var e=i(t),n=a.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}),o=[];n.forEach(function(e){r({type:"Point",coordinates:[e.minX,e.minY]},t)&&o.push(e.property)}),t.properties[s]=o}),t}},{"@turf/bbox":198,"@turf/inside":200,rbush:203}],198:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"@turf/meta":199,dup:22}],199:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],200:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{"@turf/invariant":201,dup:34}],201:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],202:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],203:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53,quickselect:202}],204:[function(t,e,n){var i=t("@turf/meta");e.exports=function(t){function e(t,e,i){i?n[e].coordinates=n[e].coordinates.concat(t.geometry.coordinates):n[e].coordinates.push(t.geometry.coordinates),n[e].properties.push(t.properties)}var n={MultiPoint:{coordinates:[],properties:[]},MultiLineString:{coordinates:[],properties:[]},MultiPolygon:{coordinates:[],properties:[]}},r=Object.keys(n).reduce(function(t,e){return t[e.replace("Multi","")]=e,t},{});return i.featureEach(t,function(t){t.geometry&&(n[t.geometry.type]?e(t,t.geometry.type,!0):r[t.geometry.type]&&e(t,r[t.geometry.type],!1))}),{type:"FeatureCollection",features:Object.keys(n).filter(function(t){return n[t].coordinates.length}).sort().map(function(t){return{type:"Feature",properties:{collectedProperties:n[t].properties},geometry:{type:t,coordinates:n[t].coordinates}}})}}},{"@turf/meta":205}],205:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],206:[function(t,e,n){function i(t,e,n){function i(t){var i=t.geometry.coordinates[0][0],r=t.geometry.coordinates[0][1],o=t.geometry.coordinates[0][2],s=a(i,r,n),u=a(r,o,n),l=a(i,o,n);return s<=e&&u<=e&&l<=e}if("number"!=typeof e)throw new Error("maxEdge parameter is required");var s=o(t),u=s.features.filter(i);if(s.features=u,s.features.length<1)throw new Error("too few polygons found to compute concave hull");return r(s)}function r(t){for(var e=JSON.parse(JSON.stringify(t.features[0])),n=t.features,i=0,r=n.length;i<r;i++){var o=n[i];o.geometry&&(e=s(e,o))}return e}var o=t("@turf/tin"),s=t("@turf/union"),a=t("@turf/distance");e.exports=i},{"@turf/distance":207,"@turf/tin":210,"@turf/union":212}],207:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":208,"@turf/invariant":209,dup:8}],208:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],209:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],210:[function(t,e,n){function i(t,e,n){this.a=t,this.b=e,this.c=n;var i,r,o=e.x-t.x,s=e.y-t.y,a=n.x-t.x,u=n.y-t.y,l=o*(t.x+e.x)+s*(t.y+e.y),c=a*(t.x+n.x)+u*(t.y+n.y),h=2*(o*(n.y-e.y)-s*(n.x-e.x));this.x=(u*l-s*c)/h,this.y=(o*c-a*l)/h,i=this.x-t.x,r=this.y-t.y,this.r=i*i+r*r}function r(t,e){return e.x-t.x}function o(t){var e,n,i,r,o,s=t.length;t:for(;s;)for(n=t[--s],e=t[--s],i=s;i;)if(o=t[--i],r=t[--i],e===r&&n===o||e===o&&n===r){t.splice(s,2),t.splice(i,2),s-=2;continue t}}function s(t){if(t.length<3)return[];t.sort(r);for(var e,n,s,a,u,l,c=t.length-1,h=t[c].x,f=t[0].x,p=t[c].y,d=p;c--;)t[c].y<p&&(p=t[c].y),t[c].y>d&&(d=t[c].y);var g,v=f-h,y=d-p,m=v>y?v:y,x=.5*(f+h),E=.5*(d+p),w=[new i({x:x-20*m,y:E-m,__sentinel:!0},{x:x,y:E+20*m,__sentinel:!0},{x:x+20*m,y:E-m,__sentinel:!0})],b=[],I=[];for(c=t.length;c--;){for(I.length=0,g=w.length;g--;)v=t[c].x-w[g].x,v>0&&v*v>w[g].r?(b.push(w[g]),w.splice(g,1)):(y=t[c].y-w[g].y,v*v+y*y>w[g].r||(I.push(w[g].a,w[g].b,w[g].b,w[g].c,w[g].c,w[g].a),w.splice(g,1)));for(o(I),g=I.length;g;)n=I[--g],e=I[--g],s=t[c],a=n.x-e.x,u=n.y-e.y,l=2*(a*(s.y-n.y)-u*(s.x-n.x)),Math.abs(l)>1e-12&&w.push(new i(e,n,s))}for(Array.prototype.push.apply(b,w),c=b.length;c--;)(b[c].a.__sentinel||b[c].b.__sentinel||b[c].c.__sentinel)&&b.splice(c,1);return b}var a=t("@turf/helpers"),u=a.polygon,l=a.featureCollection;e.exports=function(t,e){if("FeatureCollection"!==t.type)throw new Error("points must be a FeatureCollection");var n=!1;return l(s(t.features.map(function(t){var i={x:t.geometry.coordinates[0],y:t.geometry.coordinates[1]};return e?i.z=t.properties[e]:3===t.geometry.coordinates.length&&(n=!0,i.z=t.geometry.coordinates[2]),i})).map(function(t){var e=[t.a.x,t.a.y],i=[t.b.x,t.b.y],r=[t.c.x,t.c.y],o={};return n?(e.push(t.a.z),i.push(t.b.z),r.push(t.c.z)):o={a:t.a.z,b:t.b.z,c:t.c.z},u([[e,i,r,e]],o)}))}},{"@turf/helpers":211}],211:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],212:[function(t,e,n){var i=t("jsts");e.exports=function(){for(var t=new i.io.GeoJSONReader,e=t.read(JSON.stringify(arguments[0].geometry)),n=1;n<arguments.length;n++)e=e.union(t.read(JSON.stringify(arguments[n].geometry)));return e=(new i.io.GeoJSONWriter).write(e),{type:"Feature",geometry:e,properties:arguments[0].properties}}},{jsts:213}],213:[function(t,e,n){arguments[4][130][0].apply(n,arguments)},{dup:130}],214:[function(t,e,n){arguments[4][135][0].apply(n,arguments)},{"@turf/helpers":215,"@turf/meta":216,"convex-hull":219,dup:135}],215:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],216:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],217:[function(t,e,n){arguments[4][138][0].apply(n,arguments)},{dup:138,"robust-orientation":225}],218:[function(t,e,n){arguments[4][139][0].apply(n,arguments)},{dup:139}],219:[function(t,e,n){arguments[4][140][0].apply(n,arguments)},{"./lib/ch1d":220,"./lib/ch2d":221,"./lib/chnd":222,dup:140}],220:[function(t,e,n){arguments[4][141][0].apply(n,arguments)},{dup:141}],221:[function(t,e,n){arguments[4][142][0].apply(n,arguments)},{dup:142,"monotone-convex-hull-2d":224}],222:[function(t,e,n){arguments[4][143][0].apply(n,arguments)},{"affine-hull":217,dup:143,"incremental-convex-hull":223}],223:[function(t,e,n){arguments[4][144][0].apply(n,arguments)},{dup:144,"robust-orientation":225,"simplicial-complex":229}],224:[function(t,e,n){arguments[4][145][0].apply(n,arguments)},{dup:145,"robust-orientation":225}],225:[function(t,e,n){arguments[4][146][0].apply(n,arguments)},{dup:146,"robust-scale":226,"robust-subtract":227,"robust-sum":228,"two-product":230}],226:[function(t,e,n){arguments[4][147][0].apply(n,arguments)},{dup:147,"two-product":230,"two-sum":231}],227:[function(t,e,n){arguments[4][148][0].apply(n,arguments)},{dup:148}],228:[function(t,e,n){arguments[4][149][0].apply(n,arguments)},{dup:149}],229:[function(t,e,n){arguments[4][150][0].apply(n,arguments)},{"bit-twiddle":218,dup:150,"union-find":232}],230:[function(t,e,n){arguments[4][151][0].apply(n,arguments)},{dup:151}],231:[function(t,e,n){arguments[4][152][0].apply(n,arguments)},{dup:152}],232:[function(t,e,n){arguments[4][153][0].apply(n,arguments)},{dup:153}],233:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{"@turf/helpers":234,"@turf/invariant":235,dup:5}],234:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],235:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],236:[function(t,e,n){function i(t){switch(t.type){case"Polygon":if(o(t)>1)return t;return;case"MultiPolygon":var e=[];if(u(t,function(t){o(t)>1&&e.push(t.geometry.coordinates)}),e.length)return{type:"MultiPolygon",coordinates:e}}}var r=t("jsts"),o=t("@turf/area"),s=t("@turf/helpers").feature,a=t("@turf/invariant").getGeom,u=t("@turf/meta").flattenEach;e.exports=function(t,e){var n=a(t),o=a(e),u=t.properties||{};if(n=i(n),o=i(o),n){if(!o)return s(n,u);var l=new r.io.GeoJSONReader,c=l.read(n),h=l.read(o),f=c.difference(h);if(!f.isEmpty()){var p=new r.io.GeoJSONWriter,d=p.write(f);return s(d,u)}}}},{"@turf/area":237,"@turf/helpers":241,"@turf/invariant":242,"@turf/meta":243,jsts:244}],237:[function(t,e,n){arguments[4][12][0].apply(n,arguments)},{"@mapbox/geojson-area":238,"@turf/meta":239,dup:12}],238:[function(t,e,n){arguments[4][13][0].apply(n,arguments)},{dup:13,wgs84:240}],239:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],240:[function(t,e,n){arguments[4][15][0].apply(n,arguments)},{dup:15}],241:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],242:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],243:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],244:[function(t,e,n){arguments[4][130][0].apply(n,arguments)},{dup:130}],245:[function(t,e,n){function i(t){if(null===t||void 0===t)throw new Error("No polygon was passed");t.geometry.type="LineString";var e=[].concat.apply([],t.geometry.coordinates);return t.geometry.coordinates=e,t}var r=t("@turf/union"),o=t("turf-overlaps"),s=t("@turf/bbox"),a=t("rbush"),u=t("geojson-utils"),l=t("get-closest");e.exports=function(t,e){for(var n=[],c=[],h=new a,f=0;f<t.features.length;f++){var p=s(t.features[f]),d={minX:p[0],minY:p[1],maxX:p[2],maxY:p[3],origIndexPosition:f};c.push(d)}h.load(c);for(var g=0;g<t.features.length;g++){for(var v=t.features[g],y=s(v),m={minX:y[0],minY:y[1],maxX:y[2],maxY:y[3]},x=h.search(m),E=!1,w=0;w<x.length;w++){v=t.features[g];var b=x[w].origIndexPosition;if(n.length>0&&0!==b)if(b>n[n.length-1])b-=n.length;else{var I=l.greaterNumber(b,n);0!==I&&(b-=I)}if(b!==g){var N=t.features[b];if(void 0===typeof e||N.properties[e]===v.properties[e]){var C=o(v,N);if(!C){var S=JSON.stringify(v),M=JSON.stringify(N),L=i(JSON.parse(S)),R=i(JSON.parse(M));C=u.lineStringsIntersect(L.geometry,R.geometry)}C&&(t.features[g]=r(v,N),n.push(x[w].origIndexPosition),n.sort(function(t,e){return t-e}),h.remove(x[w]),t.features.splice(b,1),m.origIndexPosition=g,h.remove(m,function(t,e){return t.origIndexPosition===e.origIndexPosition}),E=!0)}}}if(E){var P=s(v);h.insert({minX:P[0],minY:P[1],maxX:P[2],maxY:P[3],origIndexPosition:g}),g--}}return t}},{"@turf/bbox":246,"@turf/union":248,"geojson-utils":250,"get-closest":251,rbush:253,"turf-overlaps":255}],246:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"@turf/meta":247,dup:22}],247:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],248:[function(t,e,n){arguments[4][212][0].apply(n,arguments)},{dup:212,jsts:249}],249:[function(t,e,n){arguments[4][130][0].apply(n,arguments)},{dup:130}],250:[function(t,e,n){!function(){function t(t){for(var e=[],n=[],i=0;i<t[0].length;i++)e.push(t[0][i][1]),n.push(t[0][i][0]);return e=e.sort(function(t,e){return t-e}),n=n.sort(function(t,e){return t-e}),[[e[0],n[0]],[e[e.length-1],n[n.length-1]]]}function n(t,e,n){for(var i=[[0,0]],r=0;r<n.length;r++){for(var o=0;o<n[r].length;o++)i.push(n[r][o]);i.push(n[r][0]),i.push([0,0])}for(var s=!1,r=0,o=i.length-1;r<i.length;o=r++)i[r][0]>e!=i[o][0]>e&&t<(i[o][1]-i[r][1])*(e-i[r][0])/(i[o][0]-i[r][0])+i[r][1]&&(s=!s);return s}var i=this.gju={};void 0!==e&&e.exports&&(e.exports=i),i.lineStringsIntersect=function(t,e){for(var n=[],i=0;i<=t.coordinates.length-2;++i)for(var r=0;r<=e.coordinates.length-2;++r){var o={x:t.coordinates[i][1],y:t.coordinates[i][0]},s={x:t.coordinates[i+1][1],y:t.coordinates[i+1][0]},a={x:e.coordinates[r][1],y:e.coordinates[r][0]},u={x:e.coordinates[r+1][1],y:e.coordinates[r+1][0]},l=(u.x-a.x)*(o.y-a.y)-(u.y-a.y)*(o.x-a.x),c=(s.x-o.x)*(o.y-a.y)-(s.y-o.y)*(o.x-a.x),h=(u.y-a.y)*(s.x-o.x)-(u.x-a.x)*(s.y-o.y);if(0!=h){var f=l/h,p=c/h;0<=f&&f<=1&&0<=p&&p<=1&&n.push({type:"Point",coordinates:[o.x+f*(s.x-o.x),o.y+f*(s.y-o.y)]})}}return 0==n.length&&(n=!1),n},i.pointInBoundingBox=function(t,e){return!(t.coordinates[1]<e[0][0]||t.coordinates[1]>e[1][0]||t.coordinates[0]<e[0][1]||t.coordinates[0]>e[1][1])},i.pointInPolygon=function(e,r){for(var o="Polygon"==r.type?[r.coordinates]:r.coordinates,s=!1,a=0;a<o.length;a++)i.pointInBoundingBox(e,t(o[a]))&&(s=!0);if(!s)return!1;for(var u=!1,a=0;a<o.length;a++)n(e.coordinates[1],e.coordinates[0],o[a])&&(u=!0);return u},i.pointInMultiPolygon=function(e,r){for(var o="MultiPolygon"==r.type?[r.coordinates]:r.coordinates,s=!1,a=!1,u=0;u<o.length;u++){for(var l=o[u],c=0;c<l.length;c++)s||i.pointInBoundingBox(e,t(l[c]))&&(s=!0);if(!s)return!1;for(var c=0;c<l.length;c++)a||n(e.coordinates[1],e.coordinates[0],l[c])&&(a=!0)}return a},i.numberToRadius=function(t){return t*Math.PI/180},i.numberToDegree=function(t){return 180*t/Math.PI},i.drawCircle=function(t,e,n){for(var r=[e.coordinates[1],e.coordinates[0]],o=t/1e3/6371,s=[i.numberToRadius(r[0]),i.numberToRadius(r[1])],n=n||15,a=[[r[0],r[1]]],u=0;u<n;u++){var l=2*Math.PI*u/n,c=Math.asin(Math.sin(s[0])*Math.cos(o)+Math.cos(s[0])*Math.sin(o)*Math.cos(l)),h=s[1]+Math.atan2(Math.sin(l)*Math.sin(o)*Math.cos(s[0]),Math.cos(o)-Math.sin(s[0])*Math.sin(c));a[u]=[],a[u][1]=i.numberToDegree(c),a[u][0]=i.numberToDegree(h)}return{type:"Polygon",coordinates:[a]}},i.rectangleCentroid=function(t){var e=t.coordinates[0],n=e[0][0],i=e[0][1];return{type:"Point",coordinates:[n+(e[2][0]-n)/2,i+(e[2][1]-i)/2]}},i.pointDistance=function(t,e){var n=t.coordinates[0],r=t.coordinates[1],o=e.coordinates[0],s=e.coordinates[1],a=i.numberToRadius(s-r),u=i.numberToRadius(o-n),l=Math.pow(Math.sin(a/2),2)+Math.cos(i.numberToRadius(r))*Math.cos(i.numberToRadius(s))*Math.pow(Math.sin(u/2),2);return 2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))*6371*1e3},i.geometryWithinRadius=function(t,e,n){if("Point"==t.type)return i.pointDistance(t,e)<=n;if("LineString"==t.type||"Polygon"==t.type){var r,o={};r="Polygon"==t.type?t.coordinates[0]:t.coordinates;for(var s in r)if(o.coordinates=r[s],i.pointDistance(o,e)>n)return!1}return!0},i.area=function(t){for(var e,n,i=0,r=t.coordinates[0],o=r.length-1,s=0;s<r.length;o=s++){var e={x:r[s][1],y:r[s][0]},n={x:r[o][1],y:r[o][0]};i+=e.x*n.y,i-=e.y*n.x}return i/=2},i.centroid=function(t){for(var e,n,r,o=0,s=0,a=t.coordinates[0],u=a.length-1,l=0;l<a.length;u=l++){var n={x:a[l][1],y:a[l][0]},r={x:a[u][1],y:a[u][0]};e=n.x*r.y-r.x*n.y,o+=(n.x+r.x)*e,s+=(n.y+r.y)*e}return e=6*i.area(t),{type:"Point",coordinates:[s/e,o/e]}},i.simplify=function(t,e){e=e||20,t=t.map(function(t){return{lng:t.coordinates[0],lat:t.coordinates[1]}});var n,i,r,o,s,a,u,l,c,h,f,p,d,g,v,y,m,x,E,w=Math.PI/180*.5,b=new Array,I=new Array,N=new Array;if(t.length<3)return t;for(n=t.length,h=360*e/(2*Math.PI*6378137),h*=h,r=0,I[0]=0,N[0]=n-1,i=1;i>0;)if(o=I[i-1],s=N[i-1],i--,s-o>1){for(f=t[s].lng()-t[o].lng(),p=t[s].lat()-t[o].lat(),Math.abs(f)>180&&(f=360-Math.abs(f)),f*=Math.cos(w*(t[s].lat()+t[o].lat())),d=f*f+p*p,a=o+1,u=o,c=-1;a<s;a++)g=t[a].lng()-t[o].lng(),v=t[a].lat()-t[o].lat(),Math.abs(g)>180&&(g=360-Math.abs(g)),g*=Math.cos(w*(t[a].lat()+t[o].lat())),y=g*g+v*v,m=t[a].lng()-t[s].lng(),x=t[a].lat()-t[s].lat(),Math.abs(m)>180&&(m=360-Math.abs(m)),m*=Math.cos(w*(t[a].lat()+t[s].lat())),E=m*m+x*x,(l=y>=d+E?E:E>=d+y?y:(g*p-v*f)*(g*p-v*f)/d)>c&&(u=a,c=l);c<h?(b[r]=o,r++):(i++,I[i-1]=u,N[i-1]=s,i++,I[i-1]=o,N[i-1]=u)}else b[r]=o,r++;b[r]=n-1,r++;for(var C=new Array,a=0;a<r;a++)C.push(t[b[a]]);return C.map(function(t){return{type:"Point",coordinates:[t.lng,t.lat]}})},i.destinationPoint=function(t,e,n){n/=6371,e=i.numberToRadius(e);var r=i.numberToRadius(t.coordinates[0]),o=i.numberToRadius(t.coordinates[1]),s=Math.asin(Math.sin(o)*Math.cos(n)+Math.cos(o)*Math.sin(n)*Math.cos(e)),a=r+Math.atan2(Math.sin(e)*Math.sin(n)*Math.cos(o),Math.cos(n)-Math.sin(o)*Math.sin(s));return a=(a+3*Math.PI)%(2*Math.PI)-Math.PI,{type:"Point",coordinates:[i.numberToDegree(a),i.numberToDegree(s)]}}}()},{}],251:[function(t,e,n){"use strict";function i(t,e,n){var i,r;if(!Array.isArray(e))throw new Error("Get closest expects an array as second argument");return e.forEach(function(e,o){var s=n(e,t);s>=0&&(void 0===r||s<r)&&(r=s,i=o)}),i}e.exports={number:function(t,e){return i(t,e,function(t,e){return Math.abs(t-e)})},greaterNumber:function(t,e){return i(t,e,function(t,e){return t-e})},lowerNumber:function(t,e){return i(t,e,function(t,e){return e-t})},custom:function(t,e,n){return i(t,e,n)}}},{}],252:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],253:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53,quickselect:252}],254:[function(t,e,n){e.exports=function(t){for(var e,n,i=0,r=1,o=t.length;r<o;)e=n||t[0],n=t[r],i+=(n[0]-e[0])*(n[1]+e[1]),r++;return i>0}},{}],255:[function(t,e,n){function i(t,e){var n=t[0],i=t[1],r=e[0],o=e[1];return s([n,r,o,n])!=s([i,r,o,i])&&s([n,i,r,n])!=s([n,i,o,n])}function r(t,e){for(var n=0;n<t.length-1;n++)for(var r=[t[n],t[n+1]],o=0;o<e.length-1;o++){var s=[e[o],e[o+1]];if(i(r,s))return!0}return!1}function o(t){var e=[[[]]];switch(t.geometry.type){case"LineString":e=[[t.geometry.coordinates]];break;case"Polygon":e=[t.geometry.coordinates];break;case"MultiPolygon":e=t.geometry.coordinates}return e}var s=t("turf-is-clockwise");e.exports=function(t,e){var n=o(t),i=o(e);return n.some(function(t){return i.some(function(e){return t.some(function(t){return e.some(function(e){return r(t,e)})})})})}},{"turf-is-clockwise":254}],256:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":257,"@turf/invariant":258,dup:8}],257:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],258:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],259:[function(t,e,n){var i=t("@turf/bbox"),r=t("@turf/bbox-polygon");e.exports=function(t){return r(i(t))}},{"@turf/bbox":262,"@turf/bbox-polygon":260}],260:[function(t,e,n){arguments[4][20][0].apply(n,arguments)},{"@turf/helpers":261,dup:20}],261:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],262:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"@turf/meta":263,dup:22}],263:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],264:[function(t,e,n){arguments[4][154][0].apply(n,arguments)},{"@turf/helpers":265,"@turf/meta":266,dup:154}],265:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],266:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],267:[function(t,e,n){var i=t("@turf/meta").flattenEach,r=t("@turf/helpers").featureCollection;e.exports=function(t){if(!t)throw new Error("geojson is required");var e=[];return i(t,function(t){e.push(t)}),r(e)}},{"@turf/helpers":268,"@turf/meta":269}],268:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],269:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],270:[function(t,e,n){var i=t("@turf/meta").coordEach;e.exports=function(t,e){if(!t)throw new Error("geojson is required");return!1!==e&&void 0!==e||(t=JSON.parse(JSON.stringify(t))),i(t,function(t){var e=t[0],n=t[1];t[0]=n,t[1]=e}),t}},{"@turf/meta":271}],271:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],272:[function(t,e,n){"use strict";var i=Math.PI/180,r=180/Math.PI,o=function(t,e){this.lon=t,this.lat=e,this.x=i*t,this.y=i*e};o.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)},o.prototype.antipode=function(){var t=-1*this.lat,e=this.lon<0?180+this.lon:-1*(180-this.lon);return new o(e,t)};var s=function(){this.coords=[],this.length=0};s.prototype.move_to=function(t){this.length++,this.coords.push(t)};var a=function(t){this.properties=t||{},this.geometries=[]};a.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(1===this.geometries.length)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var t=[],e=0;e<this.geometries.length;e++)t.push(this.geometries[e].coords);return{geometry:{type:"MultiLineString",coordinates:t},type:"Feature",properties:this.properties}},a.prototype.wkt=function(){for(var t="",e="LINESTRING(",n=function(t){e+=t[0]+" "+t[1]+","},i=0;i<this.geometries.length;i++){if(0===this.geometries[i].coords.length)return"LINESTRING(empty)";this.geometries[i].coords.forEach(n),t+=e.substring(0,e.length-1)+")"}return t};var u=function(t,e,n){if(!t||void 0===t.x||void 0===t.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!e||void 0===e.x||void 0===e.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new o(t.x,t.y),this.end=new o(e.x,e.y),this.properties=n||{};var i=this.start.x-this.end.x,r=this.start.y-this.end.y,s=Math.pow(Math.sin(r/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(i/2),2);if(this.g=2*Math.asin(Math.sqrt(s)),this.g===Math.PI)throw new Error("it appears "+t.view()+" and "+e.view()+" are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+t+" and "+e)};u.prototype.interpolate=function(t){var e=Math.sin((1-t)*this.g)/Math.sin(this.g),n=Math.sin(t*this.g)/Math.sin(this.g),i=e*Math.cos(this.start.y)*Math.cos(this.start.x)+n*Math.cos(this.end.y)*Math.cos(this.end.x),o=e*Math.cos(this.start.y)*Math.sin(this.start.x)+n*Math.cos(this.end.y)*Math.sin(this.end.x),s=e*Math.sin(this.start.y)+n*Math.sin(this.end.y),a=r*Math.atan2(s,Math.sqrt(Math.pow(i,2)+Math.pow(o,2)));return[r*Math.atan2(o,i),a]},u.prototype.Arc=function(t,e){var n=[];if(!t||t<=2)n.push([this.start.lon,this.start.lat]),n.push([this.end.lon,this.end.lat]);else for(var i=1/(t-1),r=0;r<t;++r){var o=i*r,u=this.interpolate(o);n.push(u)}for(var l=!1,c=0,h=e&&e.offset?e.offset:10,f=180-h,p=-180+h,d=360-h,g=1;g<n.length;++g){var v=n[g-1][0],y=n[g][0],m=Math.abs(y-v);m>d&&(y>f&&v<p||v>f&&y<p)?l=!0:m>c&&(c=m)}var x=[];if(l&&c<h){var E=[];x.push(E);for(var w=0;w<n.length;++w){var b=parseFloat(n[w][0]);if(w>0&&Math.abs(b-n[w-1][0])>d){var I=parseFloat(n[w-1][0]),N=parseFloat(n[w-1][1]),C=parseFloat(n[w][0]),S=parseFloat(n[w][1]);if(I>-180&&I<p&&180===C&&w+1<n.length&&n[w-1][0]>-180&&n[w-1][0]<p){E.push([-180,n[w][1]]),w++,E.push([n[w][0],n[w][1]]);continue}if(I>f&&I<180&&-180===C&&w+1<n.length&&n[w-1][0]>f&&n[w-1][0]<180){E.push([180,n[w][1]]),w++,E.push([n[w][0],n[w][1]]);continue}if(I<p&&C>f){var M=I;I=C,C=M;var L=N;N=S,S=L}if(I>f&&C<p&&(C+=360),I<=180&&C>=180&&I<C){var R=(180-I)/(C-I),P=R*S+(1-R)*N;E.push([n[w-1][0]>f?180:-180,P]),E=[],E.push([n[w-1][0]>f?-180:180,P]),x.push(E)}else E=[],x.push(E);E.push([b,n[w][1]])}else E.push([n[w][0],n[w][1]])}}else{var T=[];x.push(T);for(var O=0;O<n.length;++O)T.push([n[O][0],n[O][1]])}for(var _=new a(this.properties),A=0;A<x.length;++A){var D=new s;_.geometries.push(D);for(var F=x[A],q=0;q<F.length;++q)D.move_to(F[q])}return _},e.exports={Coord:o,Arc:a,GreatCircle:u}},{}],273:[function(t,e,n){var i=t("./arc"),r=t("@turf/invariant").getCoord;e.exports=function(t,e,n,o,s){return t=r(t),e=r(e),n=n||{},o=o||100,s=s||10,new i.GreatCircle({x:t[0],y:t[1]},{x:e[0],y:e[1]},n).Arc(o,{offset:s}).json()}},{"./arc":272,"@turf/invariant":274}],274:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],275:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],276:[function(t,e,n){function i(t,e,n){for(var i=[],r=0;r<6;r++){var o=t[0]+e*c[r],s=t[1]+n*h[r];i.push([o,s])}return i.push(i[0]),u([i])}function r(t,e,n){for(var i=[],r=0;r<6;r++){var o=[];o.push(t),o.push([t[0]+e*c[r],t[1]+n*h[r]]),o.push([t[0]+e*c[(r+1)%6],t[1]+n*h[(r+1)%6]]),o.push(t),i.push(u([o]))}return i}for(var o=t("@turf/distance"),s=t("@turf/helpers"),a=s.point,u=s.polygon,l=s.featureCollection,c=[],h=[],f=0;f<6;f++){var p=2*Math.PI/6*f;c.push(Math.cos(p)),h.push(Math.sin(p))}e.exports=function(t,e,n,s){var u=t[0],c=t[1],h=t[2],f=t[3],p=(c+f)/2,d=(u+h)/2,g=e/o(a([u,p]),a([h,p]),n),v=g*(h-u),y=e/o(a([d,c]),a([d,f]),n),m=y*(f-c),x=v/2,E=2*x,w=Math.sqrt(3)/2*m,b=h-u,I=f-c,N=.75*E,C=w,S=b/(E-x/2),M=Math.ceil(S);Math.round(S)===M&&M++;var L=(M*N-x/2-b)/2-x/2,R=Math.ceil(I/w),P=(I-R*w)/2,T=R*w-I>w/2;T&&(P-=w/4);for(var O=l([]),_=0;_<M;_++)for(var A=0;A<=R;A++){var D=_%2==1;if((0!==A||!D)&&(0!==A||!T)){var F=_*N+u-L,q=A*C+c+P;D&&(q-=w/2),s?O.features.push.apply(O.features,r([F,q],v/2,m/2)):O.features.push(i([F,q],v/2,m/2))}}return O}},{"@turf/distance":277,"@turf/helpers":280}],277:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":278,"@turf/invariant":279,dup:8}],278:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],279:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],280:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],281:[function(t,e,n){var i=t("@turf/bbox"),r=t("@turf/distance"),o=t("@turf/centroid"),s=t("@turf/square-grid");e.exports=function(t,e,n,a,u){if(!e)throw new Error("valueField is required");if(void 0===n||null===n)throw new Error("weight is required");if(void 0===a||null===a)throw new Error("cellWidth is required");if(0===t.features.filter(function(t){return t.properties&&t.properties.hasOwnProperty(e)}).length)throw new Error("Specified Data Field is Missing");for(var l=s(i(t),a,u),c=l.features.length,h=0;h<c;h++){for(var f=0,p=0,d=0;d<t.features.length;d++){var g=r(o(l.features[h]),t.features[d],u);0===g&&(f=t.features[d].properties[e]);var v=1/Math.pow(g,n);p+=v,f+=v*t.features[d].properties[e]}l.features[h].properties[e]=f/p}return l}},{"@turf/bbox":282,"@turf/centroid":284,"@turf/distance":287,"@turf/square-grid":290}],282:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"@turf/meta":283,dup:22}],283:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],284:[function(t,e,n){arguments[4][132][0].apply(n,arguments)},{"@turf/helpers":285,"@turf/meta":286,dup:132}],285:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],286:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],287:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":288,"@turf/invariant":289,dup:8}],288:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],289:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],290:[function(t,e,n){var i=t("@turf/distance"),r=t("@turf/bbox"),o=t("@turf/helpers"),s=o.point,a=o.polygon,u=o.featureCollection;e.exports=function(t,e,n,o){var l=[];if(!t)throw new Error("bbox is required");if(Array.isArray(t)||(t=r(t)),4!==t.length)throw new Error("bbox must contain 4 numbers");var c=t[0],h=t[1],f=t[2],p=t[3],d=i(s([c,h]),s([f,h]),n),g=i(s([c,h]),s([c,p]),n),v=Math.ceil(d/e),y=Math.ceil(g/e),m=e/d,x=m*(f-c);!0===o&&(x*=d/e/v);var E=e/g,w=E*(p-h);!0===o&&(w*=g/e/y);for(var b=c,I=0;I<v;I++){for(var N=h,C=0;C<y;C++){var S=a([[[b,N],[b,N+w],[b+x,N+w],[b+x,N],[b,N]]]);l.push(S),N+=w}b+=x}return u(l)}},{"@turf/bbox":291,"@turf/distance":293,"@turf/helpers":296}],291:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"@turf/meta":292,dup:22}],292:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],293:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":294,"@turf/invariant":295,dup:8}],294:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],295:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],
296:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],297:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{"@turf/invariant":298,dup:34}],298:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],299:[function(t,e,n){var i=t("@turf/meta"),r=t("@turf/bbox"),o=t("@turf/hex-grid"),s=t("@turf/point-grid"),a=t("@turf/distance"),u=t("@turf/centroid"),l=t("@turf/invariant"),c=t("@turf/square-grid"),h=t("@turf/triangle-grid"),f=i.featureEach,p=l.collectionOf;e.exports=function(t,e,n,i,l,d){if(!t)throw new Error("points is required");if(p(t,"Point","input must contain Points"),!e)throw new Error("cellSize is required");if(void 0!==d&&"number"!=typeof d)throw new Error("weight must be a number");i=i||"elevation",n=n||"square",d=d||1;var g,v=r(t);switch(n){case"point":case"points":g=s(v,e,l,!0);break;case"square":case"squares":g=c(v,e,l);break;case"hex":case"hexes":g=o(v,e,l);break;case"triangle":case"triangles":g=h(v,e,l);break;default:throw new Error("invalid gridType")}return f(g,function(e){var r=0,o=0;f(t,function(t){var s,c="point"===n?e:u(e),h=a(c,t,l);if(void 0!==i&&(s=t.properties[i]),void 0===s&&(s=t.geometry.coordinates[2]),void 0===s)throw new Error("zValue is missing");0===h&&(r=s);var f=1/Math.pow(h,d);o+=f,r+=f*s}),e.properties[i]=r/o}),g}},{"@turf/bbox":300,"@turf/centroid":302,"@turf/distance":305,"@turf/hex-grid":308,"@turf/invariant":313,"@turf/meta":314,"@turf/point-grid":315,"@turf/square-grid":325,"@turf/triangle-grid":332}],300:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"@turf/meta":301,dup:22}],301:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],302:[function(t,e,n){arguments[4][132][0].apply(n,arguments)},{"@turf/helpers":303,"@turf/meta":304,dup:132}],303:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],304:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],305:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":306,"@turf/invariant":307,dup:8}],306:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],307:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],308:[function(t,e,n){arguments[4][276][0].apply(n,arguments)},{"@turf/distance":309,"@turf/helpers":312,dup:276}],309:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":310,"@turf/invariant":311,dup:8}],310:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],311:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],312:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],313:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],314:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],315:[function(t,e,n){var i=t("@turf/distance"),r=t("@turf/bbox"),o=t("@turf/helpers"),s=t("@turf/inside"),a=t("@turf/invariant"),u=a.getGeomType,l=o.point,c=o.featureCollection;e.exports=function(t,e,n,o,a){var h=[],f=t;if(!t)throw new Error("bbox is required");if(Array.isArray(t)||(t=r(t)),4!==t.length)throw new Error("bbox must contain 4 numbers");var p=t[0],d=t[1],g=t[2],v=t[3],y=e/i(l([p,d]),l([g,d]),n),m=y*(g-p),x=e/i(l([p,d]),l([p,v]),n),E=x*(v-d);if(!1!==o)var w=g-p,b=v-d,I=Math.floor(w/m),N=Math.floor(b/E),C=(w-I*m)/2,S=(b-N*E)/2;var M=!Array.isArray(f)&&("Polygon"===u(f)||"MultiPolygon"===u(f)),L=p;for(!1!==o&&(L+=C);L<=g;){var R=d;for(!1!==o&&(R+=S);R<=v;){var P=l([L,R]);!0===a&&M?s(P,f)&&h.push(P):h.push(P),R+=E}L+=m}return c(h)}},{"@turf/bbox":316,"@turf/distance":318,"@turf/helpers":321,"@turf/inside":322,"@turf/invariant":324}],316:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"@turf/meta":317,dup:22}],317:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],318:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":319,"@turf/invariant":320,dup:8}],319:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],320:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],321:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],322:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{"@turf/invariant":323,dup:34}],323:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],324:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],325:[function(t,e,n){arguments[4][290][0].apply(n,arguments)},{"@turf/bbox":326,"@turf/distance":328,"@turf/helpers":331,dup:290}],326:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"@turf/meta":327,dup:22}],327:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],328:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":329,"@turf/invariant":330,dup:8}],329:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],330:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],331:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],332:[function(t,e,n){var i=t("@turf/distance"),r=t("@turf/helpers"),o=r.polygon,s=r.featureCollection;e.exports=function(t,e,n){for(var r=s([]),a=e/i([t[0],t[1]],[t[2],t[1]],n),u=a*(t[2]-t[0]),l=e/i([t[0],t[1]],[t[0],t[3]],n),c=l*(t[3]-t[1]),h=0,f=t[0];f<=t[2];){for(var p=0,d=t[1];d<=t[3];)h%2==0&&p%2==0?r.features.push(o([[[f,d],[f,d+c],[f+u,d],[f,d]]]),o([[[f,d+c],[f+u,d+c],[f+u,d],[f,d+c]]])):h%2==0&&p%2==1?r.features.push(o([[[f,d],[f+u,d+c],[f+u,d],[f,d]]]),o([[[f,d],[f,d+c],[f+u,d+c],[f,d]]])):p%2==0&&h%2==1?r.features.push(o([[[f,d],[f,d+c],[f+u,d+c],[f,d]]]),o([[[f,d],[f+u,d+c],[f+u,d],[f,d]]])):p%2==1&&h%2==1&&r.features.push(o([[[f,d],[f,d+c],[f+u,d],[f,d]]]),o([[[f,d+c],[f+u,d+c],[f+u,d],[f,d+c]]])),d+=c,p++;h++,f+=u}return r}},{"@turf/distance":333,"@turf/helpers":336}],333:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":334,"@turf/invariant":335,dup:8}],334:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],335:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],336:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],337:[function(t,e,n){var i=t("jsts");e.exports=function(t,e){var n,r;n="Feature"===t.type?t.geometry:t,r="Feature"===e.type?e.geometry:e;var o=new i.io.GeoJSONReader,s=o.read(JSON.stringify(n)),a=o.read(JSON.stringify(r)),u=s.intersection(a);if(!u.isEmpty()){return{type:"Feature",properties:{},geometry:(new i.io.GeoJSONWriter).write(u)}}}},{jsts:338}],338:[function(t,e,n){arguments[4][130][0].apply(n,arguments)},{dup:130}],339:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],340:[function(t,e,n){function i(t,e,n){for(var i=[],r=1;r<e.length;r++){var a=+e[r-1],u=+e[r],l=v.isoBands(t,a,u-a),c=o(l),h=s(c),f={};f.groupedRings=h,f[n]=a+"-"+u,i.push(f)}return i}function r(t,e,n){var i=l(n),r=i[2]-i[0],o=i[3]-i[1],s=i[0],a=i[1],u=e[0].length-1,c=e.length-1,h=r/u,f=o/c,p=function(t){t[0]=t[0]*h+s,t[1]=t[1]*f+a};return t.forEach(function(t){t.groupedRings.forEach(function(t){t.forEach(function(t){t.forEach(p)})})}),t}function o(t){var e=[],n=[];t.forEach(function(t){var i=c(y([t]));n.push(i),e.push({ring:t,area:i})}),n.sort(function(t,e){return e-t});var i=[];return n.forEach(function(t){for(var n=0;n<e.length;n++)if(e[n].area===t){i.push(e[n].ring),e.splice(n,1);break}}),i}function s(t){for(var e=t.map(function(t){return{lrCoordinates:t,grouped:!1}}),n=[];!u(e);)for(var i=0;i<e.length;i++)if(!e[i].grouped){var r=[];r.push(e[i].lrCoordinates),e[i].grouped=!0;for(var o=y([e[i].lrCoordinates]),s=i+1;s<e.length;s++)if(!e[s].grouped){var l=y([e[s].lrCoordinates]);a(l,o)&&(r.push(e[s].lrCoordinates),e[s].grouped=!0)}n.push(r)}return n}function a(t,e){for(var n=p(t),i=0;i<n.features.length;i++)if(!h(n.features[i],e))return!1;return!0}function u(t){for(var e=0;e<t.length;e++)if(!1===t[e].grouped)return!1;return!0}var l=t("@turf/bbox"),c=t("@turf/area"),h=t("@turf/inside"),f=t("@turf/helpers"),p=t("@turf/explode"),d=t("@turf/invariant"),g=t("grid-to-matrix"),v=t("marchingsquares"),y=f.polygon,m=f.multiPolygon,x=d.collectionOf,E=f.featureCollection;e.exports=function(t,e,n,o){var s=function(t){return!!t&&t.constructor===Object};if(x(t,"Point","Input must contain Points"),!e||!Array.isArray(e))throw new Error("breaks is required");if(o=o||{},o.commonProperties&&!s(o.commonProperties))throw new Error("commonProperties is not an Object");if(o.isobandProperties&&!Array.isArray(o.isobandProperties))throw new Error("isobandProperties is not an Array");if(n&&"string"!=typeof n)throw new Error("zProperty is not a string");n=n||"elevation";var a=o.commonProperties||{},u=o.isobandProperties||[],l=g(t,n,!0),c=i(l,e,n);c=r(c,l,t);var h=c.map(function(t,e){if(u[e]&&!s(u[e]))throw new Error("Each mappedProperty is required to be an Object");var i=Object.assign({},a,u[e]);return i[n]=t[n],m(t.groupedRings,i)});return E(h)}},{"@turf/area":342,"@turf/bbox":343,"@turf/explode":344,"@turf/helpers":345,"@turf/inside":346,"@turf/invariant":347,"grid-to-matrix":349,marchingsquares:354}],341:[function(t,e,n){arguments[4][13][0].apply(n,arguments)},{dup:13,wgs84:355}],342:[function(t,e,n){var i=t("@mapbox/geojson-area").geometry,r=t("@turf/meta").geomReduce;e.exports=function(t){return r(t,function(t,e){return t+i(e)},0)}},{"@mapbox/geojson-area":341,"@turf/meta":348}],343:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{"@turf/meta":348,dup:43}],344:[function(t,e,n){var i=t("@turf/helpers").featureCollection,r=t("@turf/meta").featureEach,o=t("@turf/meta").coordEach,s=t("@turf/helpers").point;e.exports=function(t){var e=[];return"FeatureCollection"===t.type?r(t,function(t){o(t,function(n){e.push(s(n,t.properties))})}):o(t,function(n){e.push(s(n,t.properties))}),i(e)}},{"@turf/helpers":345,"@turf/meta":348}],345:[function(t,e,n){function i(t,e){if(!t)throw new Error("No geometry passed");return{type:"Feature",properties:e||{},geometry:t}}e.exports.feature=i,e.exports.point=function(t,e){if(!t)throw new Error("No coordinates passed");if(void 0===t.length)throw new Error("Coordinates must be an array");if(t.length<2)throw new Error("Coordinates must be at least 2 numbers long");if("number"!=typeof t[0]||"number"!=typeof t[1])throw new Error("Coordinates must numbers");return i({type:"Point",coordinates:t},e)},e.exports.polygon=function(t,e){if(!t)throw new Error("No coordinates passed");for(var n=0;n<t.length;n++){var r=t[n];if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var o=0;o<r[r.length-1].length;o++)if(r[r.length-1][o]!==r[0][o])throw new Error("First and last Position are not equivalent.")}return i({type:"Polygon",coordinates:t},e)},e.exports.lineString=function(t,e){if(!t)throw new Error("No coordinates passed");return i({type:"LineString",coordinates:t},e)},e.exports.featureCollection=function(t){if(!t)throw new Error("No features passed");return{type:"FeatureCollection",features:t}},e.exports.multiLineString=function(t,e){if(!t)throw new Error("No coordinates passed");return i({type:"MultiLineString",coordinates:t},e)},e.exports.multiPoint=function(t,e){if(!t)throw new Error("No coordinates passed");return i({type:"MultiPoint",coordinates:t},e)},e.exports.multiPolygon=function(t,e){if(!t)throw new Error("No coordinates passed");return i({type:"MultiPolygon",coordinates:t},e)},e.exports.geometryCollection=function(t,e){if(!t)throw new Error("No geometries passed");return i({type:"GeometryCollection",geometries:t},e)};var r={miles:3960,nauticalmiles:3441.145,degrees:57.2957795,radians:1,inches:250905600,yards:6969600,meters:6373e3,metres:6373e3,kilometers:6373,kilometres:6373,feet:20908792.65};e.exports.radiansToDistance=function(t,e){var n=r[e||"kilometers"];if(void 0===n)throw new Error("Invalid unit");return t*n},e.exports.distanceToRadians=function(t,e){var n=r[e||"kilometers"];if(void 0===n)throw new Error("Invalid unit");return t/n},e.exports.distanceToDegrees=function(t,e){var n=r[e||"kilometers"];if(void 0===n)throw new Error("Invalid unit");return t/n*57.2958}},{}],346:[function(t,e,n){function i(t,e,n){var i=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var r=0,o=e.length-1;r<e.length;o=r++){var s=e[r][0],a=e[r][1],u=e[o][0],l=e[o][1];if(t[1]*(s-u)+a*(u-t[0])+l*(t[0]-s)==0&&(s-t[0])*(u-t[0])<=0&&(a-t[1])*(l-t[1])<=0)return!n;a>t[1]!=l>t[1]&&t[0]<(u-s)*(t[1]-a)/(l-a)+s&&(i=!i)}return i}var r=t("@turf/invariant");e.exports=function(t,e){var n=r.getCoord(t),o=e.geometry.coordinates;"Polygon"===e.geometry.type&&(o=[o]);for(var s=0,a=!1;s<o.length&&!a;s++)if(i(n,o[s][0])){for(var u=!1,l=1;l<o[s].length&&!u;)i(n,o[s][l],!0)&&(u=!0),l++;u||(a=!0)}return a}},{"@turf/invariant":347}],347:[function(t,e,n){function i(t){if(!t)throw new Error("No obj passed");var e=r(t);if(e.length>1&&"number"==typeof e[0]&&"number"==typeof e[1])return e;throw new Error("Coordinate is not a valid Point")}function r(t){if(!t)throw new Error("No obj passed");var e;if(t.length?e=t:t.coordinates?e=t.coordinates:t.geometry&&t.geometry.coordinates&&(e=t.geometry.coordinates),e)return o(e),e;throw new Error("No valid coordinates")}function o(t){if(t.length>1&&"number"==typeof t[0]&&"number"==typeof t[1])return!0;if(t[0].length)return o(t[0]);throw new Error("coordinates must only contain numbers")}function s(t,e,n){if(!e||!n)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.type)}function a(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)}function u(t,e,n){if(!t)throw new Error("No featureCollection passed");if(!n)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+n+", FeatureCollection required");for(var i=0;i<t.features.length;i++){var r=t.features[i];if(!r||"Feature"!==r.type||!r.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!r.geometry||r.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+r.geometry.type)}}e.exports.geojsonType=s,e.exports.collectionOf=u,e.exports.featureOf=a,e.exports.getCoord=i,e.exports.getCoords=r},{}],348:[function(t,e,n){function i(t,e,n){var r,o,s,a,u,l,c,h,f,p,d=0,g=0,v="FeatureCollection"===t.type,y="Feature"===t.type,m=v?t.features.length:1;for(r=0;r<m;r++)for(f=v?t.features[r].geometry:y?t.geometry:t,p="GeometryCollection"===f.type,c=p?f.geometries.length:1,a=0;a<c;a++)if(l=p?f.geometries[a]:f,h=l.coordinates,d=!n||"Polygon"!==l.type&&"MultiPolygon"!==l.type?0:1,"Point"===l.type)e(h,g),g++;else if("LineString"===l.type||"MultiPoint"===l.type)for(o=0;o<h.length;o++)e(h[o],g),g++;else if("Polygon"===l.type||"MultiLineString"===l.type)for(o=0;o<h.length;o++)for(s=0;s<h[o].length-d;s++)e(h[o][s],g),g++;else if("MultiPolygon"===l.type)for(o=0;o<h.length;o++)for(s=0;s<h[o].length;s++)for(u=0;u<h[o][s].length-d;u++)e(h[o][s][u],g),g++;else{if("GeometryCollection"!==l.type)throw new Error("Unknown Geometry Type");for(o=0;o<l.geometries.length;o++)i(l.geometries[o],e,n)}}function r(t,e,n,r){var o=n;return i(t,function(t,i){o=0===i&&void 0===n?t:e(o,t,i)},r),o}function o(t,e){var n;switch(t.type){case"FeatureCollection":for(n=0;n<t.features.length;n++)e(t.features[n].properties,n);break;case"Feature":e(t.properties,0)}}function s(t,e,n){var i=n;return o(t,function(t,r){i=0===r&&void 0===n?t:e(i,t,r)}),i}function a(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)e(t.features[n],n)}function u(t,e,n){var i=n;return a(t,function(t,r){i=0===r&&void 0===n?t:e(i,t,r)}),i}function l(t){var e=[];return i(t,function(t){e.push(t)}),e}function c(t,e){var n,i,r,o,s,a,u,l=0,c="FeatureCollection"===t.type,h="Feature"===t.type,f=c?t.features.length:1;for(n=0;n<f;n++)for(a=c?t.features[n].geometry:h?t.geometry:t,u="GeometryCollection"===a.type,s=u?a.geometries.length:1,r=0;r<s;r++)if(o=u?a.geometries[r]:a,"Point"===o.type||"LineString"===o.type||"MultiPoint"===o.type||"Polygon"===o.type||"MultiLineString"===o.type||"MultiPolygon"===o.type)e(o,l),l++;else{if("GeometryCollection"!==o.type)throw new Error("Unknown Geometry Type");for(i=0;i<o.geometries.length;i++)e(o.geometries[i],l),l++}}function h(t,e,n){var i=n;return c(t,function(t,r){i=0===r&&void 0===n?t:e(i,t,r)}),i}e.exports.coordEach=i,e.exports.coordReduce=r,e.exports.propEach=o,e.exports.propReduce=s,e.exports.featureEach=a,e.exports.featureReduce=u,e.exports.coordAll=l,e.exports.geomEach=c,e.exports.geomReduce=h},{}],349:[function(t,e,n){function i(t,e){var n={};return s(t,function(t){var e=o(t)[1];n[e]||(n[e]=[]),n[e].push(t)}),Object.keys(n).map(function(t){return n[t].sort(function(t,e){return o(t)[0]-o(e)[0]})}).sort(function(t,n){return e?o(t[0])[1]-o(n[0])[1]:o(n[0])[1]-o(t[0])[1]})}var r=t("@turf/invariant"),o=r.getCoords,s=t("@turf/meta").featureEach;e.exports=function(t,e,n){r.collectionOf(t,"Point","input must contain Points"),e=e||"elevation";for(var o=i(t,n),s=[],a=0;a<o.length;a++){for(var u=o[a],l=[],c=0;c<u.length;c++){var h=u[c];h.properties[e]?l.push(h.properties[e]):l.push(0)}s.push(l)}return s}},{"@turf/invariant":350,"@turf/meta":351}],350:[function(t,e,n){function i(t){if(!t)throw new Error("No obj passed");var e=r(t);if(e.length>1&&"number"==typeof e[0]&&"number"==typeof e[1])return e;throw new Error("Coordinate is not a valid Point")}function r(t){if(!t)throw new Error("No obj passed");var e;if(t.length?e=t:t.coordinates?e=t.coordinates:t.geometry&&t.geometry.coordinates&&(e=t.geometry.coordinates),e)return o(e),e;throw new Error("No valid coordinates")}function o(t){if(t.length>1&&"number"==typeof t[0]&&"number"==typeof t[1])return!0;if(Array.isArray(t[0])&&t[0].length)return o(t[0]);throw new Error("coordinates must only contain numbers")}function s(t,e,n){if(!e||!n)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.type)}function a(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)}function u(t,e,n){if(!t)throw new Error("No featureCollection passed");if(!n)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+n+", FeatureCollection required");for(var i=0;i<t.features.length;i++){var r=t.features[i];if(!r||"Feature"!==r.type||!r.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!r.geometry||r.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+r.geometry.type)}}function l(t){if(!t)throw new Error("<geojson> is required");if(t.geometry)return t.geometry;if(t.coordinates||t.geometries)return t;throw new Error("<geojson> must be a Feature or Geometry Object")}function c(t){return l(t).type}e.exports={geojsonType:s,collectionOf:u,featureOf:a,getCoord:i,getCoords:r,containsNumber:o,getGeom:l,getGeomType:c}},{}],351:[function(t,e,n){function i(t,e,n){var r,o,s,a,u,l,c,h,f,p,d=0,g=0,v="FeatureCollection"===t.type,y="Feature"===t.type,m=v?t.features.length:1;for(r=0;r<m;r++)for(f=v?t.features[r].geometry:y?t.geometry:t,p="GeometryCollection"===f.type,c=p?f.geometries.length:1,a=0;a<c;a++)if(l=p?f.geometries[a]:f,h=l.coordinates,d=!n||"Polygon"!==l.type&&"MultiPolygon"!==l.type?0:1,"Point"===l.type)e(h,g),g++;else if("LineString"===l.type||"MultiPoint"===l.type)for(o=0;o<h.length;o++)e(h[o],g),g++;else if("Polygon"===l.type||"MultiLineString"===l.type)for(o=0;o<h.length;o++)for(s=0;s<h[o].length-d;s++)e(h[o][s],g),g++;else if("MultiPolygon"===l.type)for(o=0;o<h.length;o++)for(s=0;s<h[o].length;s++)for(u=0;u<h[o][s].length-d;u++)e(h[o][s][u],g),g++;else{if("GeometryCollection"!==l.type)throw new Error("Unknown Geometry Type");for(o=0;o<l.geometries.length;o++)i(l.geometries[o],e,n)}}function r(t,e,n,r){var o=n;return i(t,function(t,i){o=0===i&&void 0===n?t:e(o,t,i)},r),o}function o(t,e){var n;switch(t.type){case"FeatureCollection":for(n=0;n<t.features.length;n++)e(t.features[n].properties,n);break;case"Feature":e(t.properties,0)}}function s(t,e,n){var i=n;return o(t,function(t,r){i=0===r&&void 0===n?t:e(i,t,r)}),i}function a(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)e(t.features[n],n)}function u(t,e,n){var i=n;return a(t,function(t,r){i=0===r&&void 0===n?t:e(i,t,r)}),i}function l(t){var e=[];return i(t,function(t){e.push(t)}),e}function c(t,e){var n,i,r,o,s,a,u,l,c=0,h="FeatureCollection"===t.type,f="Feature"===t.type,p=h?t.features.length:1;for(n=0;n<p;n++)for(a=h?t.features[n].geometry:f?t.geometry:t,l=h?t.features[n].properties:f?t.properties:{},u="GeometryCollection"===a.type,s=u?a.geometries.length:1,r=0;r<s;r++)if(o=u?a.geometries[r]:a,"Point"===o.type||"LineString"===o.type||"MultiPoint"===o.type||"Polygon"===o.type||"MultiLineString"===o.type||"MultiPolygon"===o.type)e(o,c,l),c++;else{if("GeometryCollection"!==o.type)throw new Error("Unknown Geometry Type");for(i=0;i<o.geometries.length;i++)e(o.geometries[i],c,l),c++}}function h(t,e,n){var i=n;return c(t,function(t,r,o){i=0===r&&void 0===n?t:e(i,t,r,o)}),i}function f(t,e){c(t,function(t,n,i){switch(t.type){case"Point":case"LineString":case"Polygon":return void e(d(t,i),n,0)}var r;switch(t.type){case"MultiPoint":r="Point";break;case"MultiLineString":r="LineString";break;case"MultiPolygon":r="Polygon"}t.coordinates.forEach(function(t,o){e(d({type:r,coordinates:t},i),n,o)})})}function p(t,e,n){var i=n;return f(t,function(t,r,o){i=0===r&&0===o&&void 0===n?t:e(i,t,r,o)}),i}function d(t,e){if(!t)throw new Error("No geometry passed");return{type:"Feature",properties:e||{},geometry:t}}e.exports={coordEach:i,coordReduce:r,propEach:o,propReduce:s,featureEach:a,featureReduce:u,coordAll:l,geomEach:c,geomReduce:h,flattenEach:f,flattenReduce:p}},{}],352:[function(e,n,i){!function(e,i){"function"==typeof t&&t.amd?t([],function(){return{isoBands:i()}}):"object"==typeof n&&n.exports?n.exports={isoBands:i()}:e.MarchingSquaresJS={isoBands:i(),isoContours:e.MarchingSquaresJS?e.MarchingSquaresJS.isoContours:null}}(this,function(){function t(t,e,n,o){o=o||{};for(var s=Object.keys(c),a=0;a<s.length;a++){var u=s[a],f=o[u];f=void 0!==f&&null!==f?f:c[u],h[u]=f}h.verbose&&console.log("MarchingSquaresJS-isoBands: computing isobands for ["+e+":"+(e+n)+"]");var p,d=i(t,e,n);return h.polygons?(h.verbose&&console.log("MarchingSquaresJS-isoBands: returning single polygons for each grid cell"),p=l(d)):(h.verbose&&console.log("MarchingSquaresJS-isoBands: returning polygon paths for entire data grid"),p=r(d)),"function"==typeof h.successCallback&&h.successCallback(p),p}function e(t,e,n){return(t-e)/(n-e)}function n(t){return t.constructor.toString().indexOf("Array")>-1}function i(t,n,i){for(var r=t.length-1,o=t[0].length-1,s={rows:r,cols:o,cells:[]},a=n+Math.abs(i),u=0;u<r;++u){s.cells[u]=[];for(var l=0;l<o;++l){var c=0,h=t[u+1][l],f=t[u+1][l+1],p=t[u][l+1],d=t[u][l];if(!(isNaN(h)||isNaN(f)||isNaN(p)||isNaN(d))){c|=h<n?0:h>a?128:64,c|=f<n?0:f>a?32:16,c|=p<n?0:p>a?8:4,c|=d<n?0:d>a?2:1;var g=+c,v=0;if(17===c||18===c||33===c||34===c||38===c||68===c||72===c||98===c||102===c||132===c||136===c||137===c||152===c||153===c){var y=(h+f+p+d)/4;v=y>a?2:y<n?0:1,34===c?1===v?c=35:0===v&&(c=136):136===c?1===v?(c=35,v=4):0===v&&(c=34):17===c?1===v?(c=155,v=4):0===v&&(c=153):68===c?1===v?(c=103,v=4):0===v&&(c=102):153===c?1===v&&(c=155):102===c?1===v&&(c=103):152===c?v<2&&(c=156,v=1):137===c?v<2&&(c=139,v=1):98===c?v<2&&(c=99,v=1):38===c?v<2&&(c=39,v=1):18===c?v>0?(c=156,v=4):c=152:33===c?v>0?(c=139,v=4):c=137:72===c?v>0?(c=99,v=4):c=98:132===c&&(v>0?(c=39,v=4):c=38)}if(0!=c&&170!=c){var m,x,E,w,b,I,N,C;m=x=E=w=b=I=N=C=.5;var S=[];1===c?(E=1-e(n,p,d),C=1-e(n,h,d),S.push(Rt[c])):169===c?(E=e(a,d,p),C=e(a,d,h),S.push(Rt[c])):4===c?(I=1-e(n,f,p),w=e(n,d,p),S.push(Mt[c])):166===c?(I=e(a,p,f),w=1-e(a,p,d),S.push(Mt[c])):16===c?(b=e(n,p,f),x=e(n,h,f),S.push(St[c])):154===c?(b=1-e(a,f,p),x=1-e(a,f,h),S.push(St[c])):64===c?(N=e(n,d,h),m=1-e(n,f,h),S.push(Tt[c])):106===c?(N=1-e(a,h,d),m=e(a,h,f),S.push(Tt[c])):168===c?(w=e(a,d,p),E=e(n,d,p),C=e(n,d,h),N=e(a,d,h),S.push(Lt[c]),S.push(Rt[c])):2===c?(w=1-e(n,p,d),E=1-e(a,p,d),C=1-e(a,h,d),N=1-e(n,h,d),S.push(Lt[c]),S.push(Rt[c])):162===c?(b=e(a,p,f),I=e(n,p,f),w=1-e(n,p,d),E=1-e(a,p,d),S.push(Lt[c]),S.push(Rt[c])):8===c?(b=1-e(n,f,p),I=1-e(a,f,p),w=e(a,d,p),E=e(n,d,p),S.push(St[c]),S.push(Mt[c])):138===c?(b=1-e(n,f,p),I=1-e(a,f,p),m=1-e(a,f,h),x=1-e(n,f,h),S.push(St[c]),S.push(Mt[c])):32===c?(b=e(a,p,f),I=e(n,p,f),m=e(n,h,f),x=e(a,h,f),S.push(St[c]),S.push(Mt[c])):42===c?(C=1-e(a,h,d),N=1-e(n,h,d),m=e(n,h,f),x=e(a,h,f),S.push(Pt[c]),S.push(Tt[c])):128===c&&(C=e(n,d,h),N=e(a,d,h),m=1-e(a,f,h),x=1-e(n,f,h),S.push(Pt[c]),S.push(Tt[c])),5===c?(I=1-e(n,f,p),C=1-e(n,h,d),S.push(Mt[c])):165===c?(I=e(a,p,f),C=e(a,d,h),S.push(Mt[c])):20===c?(w=e(n,d,p),x=e(n,h,f),S.push(Lt[c])):150===c?(w=1-e(a,p,d),x=1-e(a,f,h),S.push(Lt[c])):80===c?(b=e(n,p,f),N=e(n,d,h),S.push(St[c])):90===c?(b=1-e(a,f,p),N=1-e(a,h,d),S.push(St[c])):65===c?(E=1-e(n,p,d),m=1-e(n,f,h),S.push(Rt[c])):105===c?(E=e(a,d,p),m=e(a,h,f),S.push(Rt[c])):160===c?(b=e(a,p,f),I=e(n,p,f),C=e(n,d,h),N=e(a,d,h),S.push(St[c]),S.push(Mt[c])):10===c?(b=1-e(n,f,p),I=1-e(a,f,p),C=1-e(a,h,d),N=1-e(n,h,d),S.push(St[c]),S.push(Mt[c])):130===c?(w=1-e(n,p,d),E=1-e(a,p,d),m=1-e(a,f,h),x=1-e(n,f,h),S.push(Lt[c]),S.push(Rt[c])):40===c?(w=e(a,d,p),E=e(n,d,p),m=e(n,h,f),x=e(a,h,f),S.push(Lt[c]),S.push(Rt[c])):101===c?(I=e(a,p,f),m=e(a,h,f),S.push(Mt[c])):69===c?(I=1-e(n,f,p),m=1-e(n,f,h),S.push(Mt[c])):149===c?(C=e(a,d,h),x=1-e(a,f,h),S.push(Pt[c])):21===c?(C=1-e(n,h,d),x=e(n,h,f),S.push(Pt[c])):86===c?(w=1-e(a,p,d),N=1-e(a,h,d),S.push(Lt[c])):84===c?(w=e(n,d,p),N=e(n,d,h),S.push(Lt[c])):89===c?(b=1-e(a,f,p),E=e(a,d,p),S.push(Rt[c])):81===c?(b=e(n,p,f),E=1-e(n,p,d),S.push(Rt[c])):96===c?(b=e(a,p,f),I=e(n,p,f),N=e(n,d,h),m=e(a,h,f),S.push(St[c]),S.push(Mt[c])):74===c?(b=1-e(n,f,p),I=1-e(a,f,p),N=1-e(a,h,d),m=1-e(n,f,h),S.push(St[c]),S.push(Mt[c])):24===c?(b=1-e(a,f,p),w=e(a,d,p),E=e(n,d,p),x=e(n,h,f),S.push(St[c]),S.push(Rt[c])):146===c?(b=e(n,p,f),w=1-e(n,p,d),E=1-e(a,p,d),x=1-e(a,f,h),S.push(St[c]),S.push(Rt[c])):6===c?(I=1-e(n,f,p),w=1-e(a,p,d),C=1-e(a,h,d),N=1-e(n,h,d),S.push(Mt[c]),S.push(Lt[c])):164===c?(I=e(a,p,f),w=e(n,d,p),C=e(n,d,h),N=e(a,d,h),S.push(Mt[c]),S.push(Lt[c])):129===c?(E=1-e(n,p,d),C=e(a,d,h),m=1-e(a,f,h),x=1-e(n,f,h),S.push(Rt[c]),S.push(Pt[c])):41===c?(E=e(a,d,p),C=1-e(n,h,d),m=e(n,h,f),x=e(a,h,f),S.push(Rt[c]),S.push(Pt[c])):66===c?(w=1-e(n,p,d),E=1-e(a,p,d),N=1-e(a,h,d),m=1-e(n,f,h),S.push(Lt[c]),S.push(Rt[c])):104===c?(w=e(a,d,p),E=e(n,d,p),N=e(n,d,h),m=e(a,h,f),S.push(Rt[c]),S.push(Ot[c])):144===c?(b=e(n,p,f),C=e(n,d,h),N=e(a,d,h),x=1-e(a,f,h),S.push(St[c]),S.push(Tt[c])):26===c?(b=1-e(a,f,p),C=1-e(a,h,d),N=1-e(n,h,d),x=e(n,h,f),S.push(St[c]),S.push(Tt[c])):36===c?(I=e(a,p,f),w=e(n,d,p),m=e(n,h,f),x=e(a,h,f),S.push(Mt[c]),S.push(Lt[c])):134===c?(I=1-e(n,f,p),w=1-e(a,p,d),m=1-e(a,f,h),x=1-e(n,f,h),S.push(Mt[c]),S.push(Lt[c])):9===c?(b=1-e(n,f,p),I=1-e(a,f,p),E=e(a,d,p),C=1-e(n,h,d),S.push(St[c]),S.push(Mt[c])):161===c?(b=e(a,p,f),I=e(n,p,f),E=1-e(n,p,d),C=e(a,d,h),S.push(St[c]),S.push(Mt[c])):37===c?(I=e(a,p,f),C=1-e(n,h,d),m=e(n,h,f),x=e(a,h,f),S.push(Mt[c]),S.push(Pt[c])):133===c?(I=1-e(n,f,p),C=e(a,d,h),m=1-e(a,f,h),x=1-e(n,f,h),S.push(Mt[c]),S.push(Pt[c])):148===c?(w=e(n,d,p),C=e(n,d,h),N=e(a,d,h),x=1-e(a,f,h),S.push(Lt[c]),S.push(Tt[c])):22===c?(w=1-e(a,p,d),C=1-e(a,h,d),N=1-e(n,h,d),x=e(n,h,f),S.push(Lt[c]),S.push(Tt[c])):82===c?(b=e(n,p,f),w=1-e(n,p,d),E=1-e(a,p,d),N=1-e(a,h,d),S.push(St[c]),S.push(Rt[c])):88===c?(b=1-e(a,f,p),w=e(a,d,p),E=e(n,d,p),N=e(n,d,h),S.push(St[c]),S.push(Rt[c])):73===c?(b=1-e(n,f,p),I=1-e(a,f,p),E=e(a,d,p),m=1-e(n,f,h),S.push(St[c]),S.push(Mt[c])):97===c?(b=e(a,p,f),I=e(n,p,f),E=1-e(n,p,d),m=e(a,h,f),S.push(St[c]),S.push(Mt[c])):145===c?(b=e(n,p,f),E=1-e(n,p,d),C=e(a,d,h),x=1-e(a,f,h),S.push(St[c]),S.push(Pt[c])):25===c?(b=1-e(a,f,p),E=e(a,d,p),C=1-e(n,h,d),x=e(n,h,f),S.push(St[c]),S.push(Pt[c])):70===c?(I=1-e(n,f,p),w=1-e(a,p,d),N=1-e(a,h,d),m=1-e(n,f,h),S.push(Mt[c]),S.push(Lt[c])):100===c?(I=e(a,p,f),w=e(n,d,p),N=e(n,d,h),m=e(a,h,f),S.push(Mt[c]),S.push(Lt[c])):34===c?(0===v?(b=1-e(n,f,p),I=1-e(a,f,p),w=e(a,d,p),E=e(n,d,p),C=e(n,d,h),N=e(a,d,h),m=1-e(a,f,h),x=1-e(n,f,h)):(b=e(a,p,f),I=e(n,p,f),w=1-e(n,p,d),E=1-e(a,p,d),C=1-e(a,h,d),N=1-e(n,h,d),m=e(n,h,f),x=e(a,h,f)),S.push(St[c]),S.push(Mt[c]),S.push(Pt[c]),S.push(Tt[c])):35===c?(4===v?(b=1-e(n,f,p),I=1-e(a,f,p),w=e(a,d,p),E=e(n,d,p),C=e(n,d,h),N=e(a,d,h),m=1-e(a,f,h),x=1-e(n,f,h)):(b=e(a,p,f),I=e(n,p,f),w=1-e(n,p,d),E=1-e(a,p,d),C=1-e(a,h,d),N=1-e(n,h,d),m=e(n,h,f),x=e(a,h,f)),S.push(St[c]),S.push(Mt[c]),S.push(Rt[c]),S.push(Tt[c])):136===c?(0===v?(b=e(a,p,f),I=e(n,p,f),w=1-e(n,p,d),E=1-e(a,p,d),C=1-e(a,h,d),N=1-e(n,h,d),m=e(n,h,f),x=e(a,h,f)):(b=1-e(n,f,p),I=1-e(a,f,p),w=e(a,d,p),E=e(n,d,p),C=e(n,d,h),N=e(a,d,h),m=1-e(a,f,h),x=1-e(n,f,h)),S.push(St[c]),S.push(Mt[c]),S.push(Pt[c]),S.push(Tt[c])):153===c?(0===v?(b=e(n,p,f),E=1-e(n,p,d),C=1-e(n,h,d),x=e(n,h,f)):(b=1-e(a,f,p),E=e(a,d,p),C=e(a,d,h),x=1-e(a,f,h)),S.push(St[c]),S.push(Rt[c])):102===c?(0===v?(I=1-e(n,f,p),w=e(n,d,p),N=e(n,d,h),m=1-e(n,f,h)):(I=e(a,p,f),w=1-e(a,p,d),N=1-e(a,h,d),m=e(a,h,f)),S.push(Mt[c]),S.push(Tt[c])):155===c?(4===v?(b=e(n,p,f),E=1-e(n,p,d),C=1-e(n,h,d),x=e(n,h,f)):(b=1-e(a,f,p),E=e(a,d,p),C=e(a,d,h),x=1-e(a,f,h)),S.push(St[c]),S.push(Pt[c])):103===c?(4===v?(I=1-e(n,f,p),w=e(n,d,p),N=e(n,d,h),m=1-e(n,f,h)):(I=e(a,p,f),w=1-e(a,p,d),N=1-e(a,h,d),m=e(a,h,f)),S.push(Mt[c]),S.push(Lt[c])):152===c?(0===v?(b=e(n,p,f),w=1-e(n,p,d),E=1-e(a,p,d),C=1-e(a,h,d),N=1-e(n,h,d),x=e(n,h,f)):(b=1-e(a,f,p),w=e(a,d,p),E=e(n,d,p),C=e(n,d,h),N=e(a,d,h),x=1-e(a,f,h)),S.push(St[c]),S.push(Lt[c]),S.push(Rt[c])):156===c?(4===v?(b=e(n,p,f),w=1-e(n,p,d),E=1-e(a,p,d),C=1-e(a,h,d),N=1-e(n,h,d),x=e(n,h,f)):(b=1-e(a,f,p),w=e(a,d,p),E=e(n,d,p),C=e(n,d,h),N=e(a,d,h),x=1-e(a,f,h)),S.push(St[c]),S.push(Rt[c]),S.push(Tt[c])):137===c?(0===v?(b=e(a,p,f),I=e(n,p,f),E=1-e(n,p,d),C=1-e(n,h,d),m=e(n,h,f),x=e(a,h,f)):(b=1-e(n,f,p),I=1-e(a,f,p),E=e(a,d,p),C=e(a,d,h),m=1-e(a,f,h),x=1-e(n,f,h)),S.push(St[c]),S.push(Mt[c]),S.push(Rt[c])):139===c?(4===v?(b=e(a,p,f),I=e(n,p,f),E=1-e(n,p,d),C=1-e(n,h,d),m=e(n,h,f),x=e(a,h,f)):(b=1-e(n,f,p),I=1-e(a,f,p),E=e(a,d,p),C=e(a,d,h),m=1-e(a,f,h),x=1-e(n,f,h)),S.push(St[c]),S.push(Mt[c]),S.push(Pt[c])):98===c?(0===v?(b=1-e(n,f,p),I=1-e(a,f,p),w=e(a,d,p),E=e(n,d,p),N=e(n,d,h),m=1-e(n,f,h)):(b=e(a,p,f),I=e(n,p,f),w=1-e(n,p,d),E=1-e(a,p,d),N=1-e(a,h,d),m=e(a,h,f)),S.push(St[c]),S.push(Mt[c]),S.push(Tt[c])):99===c?(4===v?(b=1-e(n,f,p),I=1-e(a,f,p),w=e(a,d,p),E=e(n,d,p),N=e(n,d,h),m=1-e(n,f,h)):(b=e(a,p,f),I=e(n,p,f),w=1-e(n,p,d),E=1-e(a,p,d),N=1-e(a,h,d),m=e(a,h,f)),S.push(St[c]),S.push(Mt[c]),S.push(Rt[c])):38===c?(0===v?(I=1-e(n,f,p),w=e(n,d,p),C=e(n,d,h),N=e(a,d,h),m=1-e(a,f,h),x=1-e(n,f,h)):(I=e(a,p,f),w=1-e(a,p,d),C=1-e(a,h,d),N=1-e(n,h,d),m=e(n,h,f),x=e(a,h,f)),S.push(Mt[c]),S.push(Pt[c]),S.push(Tt[c])):39===c?(4===v?(I=1-e(n,f,p),w=e(n,d,p),C=e(n,d,h),N=e(a,d,h),m=1-e(a,f,h),x=1-e(n,f,h)):(I=e(a,p,f),w=1-e(a,p,d),C=1-e(a,h,d),N=1-e(n,h,d),m=e(n,h,f),x=e(a,h,f)),S.push(Mt[c]),S.push(Lt[c]),S.push(Tt[c])):85===c&&(b=1,I=0,w=1,E=0,C=0,N=1,m=0,x=1),(m<0||m>1||x<0||x>1||b<0||b>1||w<0||w>1||C<0||C>1||N<0||N>1)&&console.log("MarchingSquaresJS-isoBands: "+c+" "+g+" "+h+","+f+","+p+","+d+" "+v+" "+m+" "+x+" "+b+" "+I+" "+w+" "+E+" "+C+" "+N),s.cells[u][l]={cval:c,cval_real:g,flipped:v,topleft:m,
topright:x,righttop:b,rightbottom:I,bottomright:w,bottomleft:E,leftbottom:C,lefttop:N,edges:S}}}}}return s}function r(t){for(var e=[],n=t.rows,i=t.cols,r=[],s=0;s<n;s++)for(var l=0;l<i;l++)if(void 0!==t.cells[s][l]&&t.cells[s][l].edges.length>0){var c=t.cells[s][l],h=a(c),f=null,p=l,d=s;null!==h&&r.push([h.p[0]+p,h.p[1]+d]);do{if(null===(f=u(t.cells[d][p],h.x,h.y,h.o)))break;if(r.push([f.p[0]+p,f.p[1]+d]),p+=f.x,d+=f.y,h=f,d<0||d>=n||p<0||p>=i||void 0===t.cells[d][p]){p-=f.x,d-=f.y;var g=o(t,p,d,f.x,f.y,f.o);if(null===g)break;g.path.forEach(function(t){r.push(t)}),p=g.i,d=g.j,h=g}}while(void 0!==t.cells[d][p]&&t.cells[d][p].edges.length>0);e.push(r),r=[],t.cells[s][l].edges.length>0&&l--}return e}function o(t,e,n,i,r,o){for(var s=t.cells[n][e],a=s.cval_real,u=e+i,l=n+r,c=[],h=!1;!h;){if(void 0===t.cells[l]||void 0===t.cells[l][u])if(l-=r,u-=i,s=t.cells[l][u],a=s.cval_real,-1===r)if(0===o)if(a&g)c.push([u,l]),i=-1,r=0,o=0;else{if(!(a&d)){c.push([u+s.bottomright,l]),i=0,r=1,o=1,h=!0;break}c.push([u+1,l]),i=1,r=0,o=0}else{if(!(a&g)){if(a&d){c.push([u+s.bottomright,l]),i=0,r=1,o=1,h=!0;break}c.push([u+s.bottomleft,l]),i=0,r=1,o=0,h=!0;break}c.push([u,l]),i=-1,r=0,o=0}else if(1===r)if(0===o){if(!(a&p)){if(a&f){c.push([u+s.topleft,l+1]),i=0,r=-1,o=0,h=!0;break}c.push([u+s.topright,l+1]),i=0,r=-1,o=1,h=!0;break}c.push([u+1,l+1]),i=1,r=0,o=1}else c.push([u+1,l+1]),i=1,r=0,o=1;else if(-1===i)if(0===o){if(!(a&f)){if(a&g){c.push([u,l+s.leftbottom]),i=1,r=0,o=0,h=!0;break}c.push([u,l+s.lefttop]),i=1,r=0,o=1,h=!0;break}c.push([u,l+1]),i=0,r=1,o=0}else{if(!(a&f)){console.log("MarchingSquaresJS-isoBands: wtf");break}c.push([u,l+1]),i=0,r=1,o=0}else{if(1!==i){console.log("MarchingSquaresJS-isoBands: we came from nowhere!");break}if(0===o){if(!(a&d)){c.push([u+1,l+s.rightbottom]),i=-1,r=0,o=0,h=!0;break}c.push([u+1,l]),i=0,r=-1,o=1}else{if(!(a&d)){if(a&p){c.push([u+1,l+s.righttop]),i=-1,r=0,o=1;break}c.push([u+1,l+s.rightbottom]),i=-1,r=0,o=0,h=!0;break}c.push([u+1,l]),i=0,r=-1,o=1}}else if(s=t.cells[l][u],a=s.cval_real,-1===i)if(0===o)if(void 0!==t.cells[l-1]&&void 0!==t.cells[l-1][u])i=0,r=-1,o=1;else{if(!(a&g)){c.push([u+s.bottomright,l]),i=0,r=1,o=1,h=!0;break}c.push([u,l])}else{if(!(a&f)){console.log("MarchingSquaresJS-isoBands: found entry from top at "+u+","+l);break}console.log("MarchingSquaresJS-isoBands: proceeding in x-direction!")}else if(1===i){if(0===o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l+1]&&void 0!==t.cells[l+1][u])i=0,r=1,o=0;else{if(!(a&p)){c.push([u+s.topleft,l+1]),i=0,r=-1,o=0,h=!0;break}c.push([u+1,l+1]),i=1,r=0,o=1}}else if(-1===r){if(1!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l][u+1])i=1,r=0,o=1;else{if(!(a&d)){c.push([u+1,l+s.righttop]),i=-1,r=0,o=1,h=!0;break}c.push([u+1,l]),i=0,r=-1,o=1}}else{if(1!==r){console.log("MarchingSquaresJS-isoBands: where did we came from???");break}if(0!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l][u-1])i=-1,r=0,o=0;else{if(!(a&f)){c.push([u,l+s.leftbottom]),i=1,r=0,o=0,h=!0;break}c.push([u,l+1]),i=0,r=1,o=0}}if(u+=i,l+=r,u===e&&l===n)break}return{path:c,i:u,j:l,x:i,y:r,o:o}}function s(t,e){delete t.edges[e];for(var n=e+1;n<t.edges.length;n++)t.edges[n-1]=t.edges[n];t.edges.pop()}function a(t){if(t.edges.length>0){var e=t.edges[t.edges.length-1],n=t.cval_real;switch(e){case 0:return n&p?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 1:return n&d?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 2:return n&d?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 3:return n&g?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 4:return n&p?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 5:return n&d?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 6:return n&d?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 7:return n&g?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 8:return n&d?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.righttop],x:-1,y:0,o:1};case 9:return n&g?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 10:return n&g?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.righttop],x:-1,y:0,o:1};case 11:return n&f?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 12:return n&d?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 13:return n&g?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 14:return n&g?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 15:return n&f?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 16:return n&d?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 17:return n&f?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 18:return n&g?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 19:return n&f?{p:[t.bottomleft,0],x:0,y:1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 20:return n&f?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 21:return n&p?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.topright,1],x:0,y:-1,o:1};case 22:return n&f?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 23:return n&p?{p:[0,t.lefttop],x:1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};default:console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(t)}}return null}function u(t,e,n,i){var r,o,a,u,l,c=t.cval;switch(e){case-1:switch(i){case 0:r=Mt[c],a=C[c],u=S[c],l=M[c];break;default:r=St[c],a=b[c],u=I[c],l=N[c]}break;case 1:switch(i){case 0:r=Pt[c],a=q[c],u=k[c],l=G[c];break;default:r=Tt[c],a=A[c],u=D[c],l=F[c]}break;default:switch(n){case-1:switch(i){case 0:r=Ot[c],a=v[c],u=y[c],l=m[c];break;default:r=_t[c],a=x[c],u=E[c],l=w[c]}break;case 1:switch(i){case 0:r=Rt[c],a=L[c],u=R[c],l=P[c];break;default:r=Lt[c],a=T[c],u=O[c],l=_[c]}}}if(o=t.edges.indexOf(r),void 0===t.edges[o])return null;switch(s(t,o),c=t.cval_real,r){case 0:c&p?(e=t.topleft,n=1):(e=1,n=t.righttop);break;case 1:c&d?(e=1,n=t.rightbottom):(e=t.topleft,n=1);break;case 2:c&d?(e=t.topleft,n=1):(e=t.bottomright,n=0);break;case 3:c&g?(e=t.bottomleft,n=0):(e=t.topleft,n=1);break;case 4:c&p?(e=t.topright,n=1):(e=1,n=t.righttop);break;case 5:c&d?(e=1,n=t.rightbottom):(e=t.topright,n=1);break;case 6:c&d?(e=t.topright,n=1):(e=t.bottomright,n=0);break;case 7:c&g?(e=t.bottomleft,n=0):(e=t.topright,n=1);break;case 8:c&d?(e=1,n=t.righttop):(e=t.bottomright,n=0);break;case 9:c&g?(e=t.bottomleft,n=0):(e=1,n=t.righttop);break;case 10:c&g?(e=1,n=t.righttop):(e=0,n=t.leftbottom);break;case 11:c&f?(e=0,n=t.lefttop):(e=1,n=t.righttop);break;case 12:c&d?(e=1,n=t.rightbottom):(e=t.bottomright,n=0);break;case 13:c&g?(e=t.bottomleft,n=0):(e=1,n=t.rightbottom);break;case 14:c&g?(e=1,n=t.rightbottom):(e=0,n=t.leftbottom);break;case 15:c&f?(e=0,n=t.lefttop):(e=1,n=t.rightbottom);break;case 16:c&d?(e=0,n=t.leftbottom):(e=t.bottomright,n=0);break;case 17:c&f?(e=0,n=t.lefttop):(e=t.bottomright,n=0);break;case 18:c&g?(e=t.bottomleft,n=0):(e=0,n=t.leftbottom);break;case 19:c&f?(e=0,n=t.lefttop):(e=t.bottomleft,n=0);break;case 20:c&f?(e=0,n=t.leftbottom):(e=t.topleft,n=1);break;case 21:c&p?(e=t.topright,n=1):(e=0,n=t.leftbottom);break;case 22:c&f?(e=0,n=t.lefttop):(e=t.topleft,n=1);break;case 23:c&p?(e=t.topright,n=1):(e=0,n=t.lefttop);break;default:return console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(t),null}return void 0!==e&&void 0!==n&&void 0!==a&&void 0!==u&&void 0!==l||(console.log("MarchingSquaresJS-isoBands: undefined value!"),console.log(t),console.log(e+" "+n+" "+a+" "+u+" "+l)),{p:[e,n],x:a,y:u,o:l}}function l(t){var e=[],i=0;return t.cells.forEach(function(t,r){t.forEach(function(t,o){if(void 0!==t){var s=At[t.cval](t);"object"==typeof s&&n(s)?"object"==typeof s[0]&&n(s[0])?"object"==typeof s[0][0]&&n(s[0][0])?s.forEach(function(t){t.forEach(function(t){t[0]+=o,t[1]+=r}),e[i++]=t}):(s.forEach(function(t){t[0]+=o,t[1]+=r}),e[i++]=s):console.log("MarchingSquaresJS-isoBands: bandcell polygon with malformed coordinates"):console.log("MarchingSquaresJS-isoBands: bandcell polygon with null coordinates")}})}),e}var c={successCallback:null,verbose:!1,polygons:!1},h={},f=64,p=16,d=4,g=1,v=[],y=[],m=[],x=[],E=[],w=[],b=[],I=[],N=[],C=[],S=[],M=[],L=[],R=[],P=[],T=[],O=[],_=[],A=[],D=[],F=[],q=[],k=[],G=[];b[85]=C[85]=-1,I[85]=S[85]=0,N[85]=M[85]=1,A[85]=q[85]=1,D[85]=k[85]=0,F[85]=G[85]=1,v[85]=x[85]=0,y[85]=E[85]=-1,m[85]=P[85]=0,T[85]=L[85]=0,O[85]=R[85]=1,w[85]=_[85]=1,q[1]=q[169]=0,k[1]=k[169]=-1,G[1]=G[169]=0,L[1]=L[169]=-1,R[1]=R[169]=0,P[1]=P[169]=0,C[4]=C[166]=0,S[4]=S[166]=-1,M[4]=M[166]=1,T[4]=T[166]=1,O[4]=O[166]=0,_[4]=_[166]=0,b[16]=b[154]=0,I[16]=I[154]=1,N[16]=N[154]=1,x[16]=x[154]=1,E[16]=E[154]=0,w[16]=w[154]=1,A[64]=A[106]=0,D[64]=D[106]=1,F[64]=F[106]=0,v[64]=v[106]=-1,y[64]=y[106]=0,m[64]=m[106]=1,A[2]=A[168]=0,D[2]=D[168]=-1,F[2]=F[168]=1,q[2]=q[168]=0,k[2]=k[168]=-1,G[2]=G[168]=0,L[2]=L[168]=-1,R[2]=R[168]=0,P[2]=P[168]=0,T[2]=T[168]=-1,O[2]=O[168]=0,_[2]=_[168]=1,b[8]=b[162]=0,I[8]=I[162]=-1,N[8]=N[162]=0,C[8]=C[162]=0,S[8]=S[162]=-1,M[8]=M[162]=1,L[8]=L[162]=1,R[8]=R[162]=0,P[8]=P[162]=1,T[8]=T[162]=1,O[8]=O[162]=0,_[8]=_[162]=0,b[32]=b[138]=0,I[32]=I[138]=1,N[32]=N[138]=1,C[32]=C[138]=0,S[32]=S[138]=1,M[32]=M[138]=0,v[32]=v[138]=1,y[32]=y[138]=0,m[32]=m[138]=0,x[32]=x[138]=1,E[32]=E[138]=0,w[32]=w[138]=1,q[128]=q[42]=0,k[128]=k[42]=1,G[128]=G[42]=1,A[128]=A[42]=0,D[128]=D[42]=1,F[128]=F[42]=0,v[128]=v[42]=-1,y[128]=y[42]=0,m[128]=m[42]=1,x[128]=x[42]=-1,E[128]=E[42]=0,w[128]=w[42]=0,C[5]=C[165]=-1,S[5]=S[165]=0,M[5]=M[165]=0,q[5]=q[165]=1,k[5]=k[165]=0,G[5]=G[165]=0,T[20]=T[150]=0,O[20]=O[150]=1,_[20]=_[150]=1,x[20]=x[150]=0,E[20]=E[150]=-1,w[20]=w[150]=1,b[80]=b[90]=-1,I[80]=I[90]=0,N[80]=N[90]=1,A[80]=A[90]=1,D[80]=D[90]=0,F[80]=F[90]=1,L[65]=L[105]=0,R[65]=R[105]=1,P[65]=P[105]=0,v[65]=v[105]=0,y[65]=y[105]=-1,m[65]=m[105]=0,b[160]=b[10]=-1,I[160]=I[10]=0,N[160]=N[10]=1,C[160]=C[10]=-1,S[160]=S[10]=0,M[160]=M[10]=0,q[160]=q[10]=1,k[160]=k[10]=0,G[160]=G[10]=0,A[160]=A[10]=1,D[160]=D[10]=0,F[160]=F[10]=1,T[130]=T[40]=0,O[130]=O[40]=1,_[130]=_[40]=1,L[130]=L[40]=0,R[130]=R[40]=1,P[130]=P[40]=0,v[130]=v[40]=0,y[130]=y[40]=-1,m[130]=m[40]=0,x[130]=x[40]=0,E[130]=E[40]=-1,w[130]=w[40]=1,C[37]=C[133]=0,S[37]=S[133]=1,M[37]=M[133]=1,q[37]=q[133]=0,k[37]=k[133]=1,G[37]=G[133]=0,v[37]=v[133]=-1,y[37]=y[133]=0,m[37]=m[133]=0,x[37]=x[133]=1,E[37]=E[133]=0,w[37]=w[133]=0,T[148]=T[22]=-1,O[148]=O[22]=0,_[148]=_[22]=0,q[148]=q[22]=0,k[148]=k[22]=-1,G[148]=G[22]=1,A[148]=A[22]=0,D[148]=D[22]=1,F[148]=F[22]=1,x[148]=x[22]=-1,E[148]=E[22]=0,w[148]=w[22]=1,b[82]=b[88]=0,I[82]=I[88]=-1,N[82]=N[88]=1,T[82]=T[88]=1,O[82]=O[88]=0,_[82]=_[88]=1,L[82]=L[88]=-1,R[82]=R[88]=0,P[82]=P[88]=1,A[82]=A[88]=0,D[82]=D[88]=-1,F[82]=F[88]=0,b[73]=b[97]=0,I[73]=I[97]=1,N[73]=N[97]=0,C[73]=C[97]=0,S[73]=S[97]=-1,M[73]=M[97]=0,L[73]=L[97]=1,R[73]=R[97]=0,P[73]=P[97]=0,v[73]=v[97]=1,y[73]=y[97]=0,m[73]=m[97]=1,b[145]=b[25]=0,I[145]=I[25]=-1,N[145]=N[25]=0,L[145]=L[25]=1,R[145]=R[25]=0,P[145]=P[25]=1,q[145]=q[25]=0,k[145]=k[25]=1,G[145]=G[25]=1,x[145]=x[25]=-1,E[145]=E[25]=0,w[145]=w[25]=0,C[70]=C[100]=0,S[70]=S[100]=1,M[70]=M[100]=0,T[70]=T[100]=-1,O[70]=O[100]=0,_[70]=_[100]=1,A[70]=A[100]=0,D[70]=D[100]=-1;F[70]=F[100]=1,v[70]=v[100]=1,y[70]=y[100]=0,m[70]=m[100]=0,C[101]=C[69]=0,S[101]=S[69]=1,M[101]=M[69]=0,v[101]=v[69]=1,y[101]=y[69]=0,m[101]=m[69]=0,q[149]=q[21]=0,k[149]=k[21]=1,G[149]=G[21]=1,x[149]=x[21]=-1,E[149]=E[21]=0,w[149]=w[21]=0,T[86]=T[84]=-1,O[86]=O[84]=0,_[86]=_[84]=1,A[86]=A[84]=0,D[86]=D[84]=-1,F[86]=F[84]=1,b[89]=b[81]=0,I[89]=I[81]=-1,N[89]=N[81]=0,L[89]=L[81]=1,R[89]=R[81]=0,P[89]=P[81]=1,b[96]=b[74]=0,I[96]=I[74]=1,N[96]=N[74]=0,C[96]=C[74]=-1,S[96]=S[74]=0,M[96]=M[74]=1,A[96]=A[74]=1,D[96]=D[74]=0,F[96]=F[74]=0,v[96]=v[74]=1,y[96]=y[74]=0,m[96]=m[74]=1,b[24]=b[146]=0,I[24]=I[146]=-1,N[24]=N[146]=1,T[24]=T[146]=1,O[24]=O[146]=0,_[24]=_[146]=1,L[24]=L[146]=0,R[24]=R[146]=1,P[24]=P[146]=1,x[24]=x[146]=0,E[24]=E[146]=-1,w[24]=w[146]=0,C[6]=C[164]=-1,S[6]=S[164]=0,M[6]=M[164]=1,T[6]=T[164]=-1,O[6]=O[164]=0,_[6]=_[164]=0,q[6]=q[164]=0,k[6]=k[164]=-1,G[6]=G[164]=1,A[6]=A[164]=1,D[6]=D[164]=0,F[6]=F[164]=0,L[129]=L[41]=0,R[129]=R[41]=1,P[129]=P[41]=1,q[129]=q[41]=0,k[129]=k[41]=1,G[129]=G[41]=0,v[129]=v[41]=-1,y[129]=y[41]=0,m[129]=m[41]=0,x[129]=x[41]=0,E[129]=E[41]=-1,w[129]=w[41]=0,T[66]=T[104]=0,O[66]=O[104]=1,_[66]=_[104]=0,L[66]=L[104]=-1,R[66]=R[104]=0,P[66]=P[104]=1,A[66]=A[104]=0,D[66]=D[104]=-1,F[66]=F[104]=0,v[66]=v[104]=0,y[66]=y[104]=-1,m[66]=m[104]=1,b[144]=b[26]=-1,I[144]=I[26]=0,N[144]=N[26]=0,q[144]=q[26]=1,k[144]=k[26]=0,G[144]=G[26]=1,A[144]=A[26]=0,D[144]=D[26]=1,F[144]=F[26]=1,x[144]=x[26]=-1,E[144]=E[26]=0,w[144]=w[26]=1,C[36]=C[134]=0,S[36]=S[134]=1,M[36]=M[134]=1,T[36]=T[134]=0,O[36]=O[134]=1,_[36]=_[134]=0,v[36]=v[134]=0,y[36]=y[134]=-1,m[36]=m[134]=1,x[36]=x[134]=1,E[36]=E[134]=0,w[36]=w[134]=0,b[9]=b[161]=-1,I[9]=I[161]=0,N[9]=N[161]=0,C[9]=C[161]=0,S[9]=S[161]=-1,M[9]=M[161]=0,L[9]=L[161]=1,R[9]=R[161]=0,P[9]=P[161]=0,q[9]=q[161]=1,k[9]=k[161]=0,G[9]=G[161]=1,b[136]=0,I[136]=1,N[136]=1,C[136]=0,S[136]=1,M[136]=0,T[136]=-1,O[136]=0,_[136]=1,L[136]=-1,R[136]=0,P[136]=0,q[136]=0,k[136]=-1,G[136]=0,A[136]=0,D[136]=-1,F[136]=1,v[136]=1,y[136]=0,m[136]=0,x[136]=1,E[136]=0,w[136]=1,b[34]=0,I[34]=-1,N[34]=0,C[34]=0,S[34]=-1,M[34]=1,T[34]=1,O[34]=0,_[34]=0,L[34]=1,R[34]=0,P[34]=1,q[34]=0,k[34]=1,G[34]=1,A[34]=0,D[34]=1,F[34]=0,v[34]=-1,y[34]=0,m[34]=1,x[34]=-1,E[34]=0,w[34]=0,b[35]=0,I[35]=1,N[35]=1,C[35]=0,S[35]=-1,M[35]=1,T[35]=1,O[35]=0,_[35]=0,L[35]=-1,R[35]=0,P[35]=0,q[35]=0,k[35]=-1,G[35]=0,A[35]=0,D[35]=1,F[35]=0,v[35]=-1,y[35]=0,m[35]=1,x[35]=1,E[35]=0,w[35]=1,b[153]=0,I[153]=1,N[153]=1,L[153]=-1;R[153]=0,P[153]=0,q[153]=0,k[153]=-1,G[153]=0,x[153]=1,E[153]=0,w[153]=1,C[102]=0,S[102]=-1,M[102]=1,T[102]=1,O[102]=0,_[102]=0,A[102]=0,D[102]=1,F[102]=0,v[102]=-1,y[102]=0,m[102]=1,b[155]=0,I[155]=-1,N[155]=0,L[155]=1,R[155]=0,P[155]=1,q[155]=0,k[155]=1,G[155]=1,x[155]=-1,E[155]=0,w[155]=0,C[103]=0,S[103]=1,M[103]=0,T[103]=-1,O[103]=0,_[103]=1,A[103]=0,D[103]=-1,F[103]=1,v[103]=1,y[103]=0,m[103]=0,b[152]=0,I[152]=1,N[152]=1,T[152]=-1,O[152]=0,_[152]=1,L[152]=-1,R[152]=0,P[152]=0,q[152]=0,k[152]=-1,G[152]=0,A[152]=0,D[152]=-1,F[152]=1,x[152]=1,E[152]=0,w[152]=1,b[156]=0,I[156]=-1,N[156]=1,T[156]=1,O[156]=0,_[156]=1,L[156]=-1,R[156]=0,P[156]=0,q[156]=0,k[156]=-1,G[156]=0,A[156]=0,D[156]=1,F[156]=1,x[156]=-1,E[156]=0,w[156]=1,b[137]=0,I[137]=1,N[137]=1,C[137]=0,S[137]=1,M[137]=0,L[137]=-1,R[137]=0,P[137]=0,q[137]=0,k[137]=-1,G[137]=0,v[137]=1,y[137]=0,m[137]=0,x[137]=1,E[137]=0,w[137]=1,b[139]=0,I[139]=1,N[139]=1,C[139]=0,S[139]=-1,M[139]=0,L[139]=1,R[139]=0,P[139]=0,q[139]=0,k[139]=1,G[139]=0,v[139]=-1,y[139]=0,m[139]=0,x[139]=1,E[139]=0,w[139]=1,b[98]=0,I[98]=-1,N[98]=0,C[98]=0,S[98]=-1,M[98]=1,T[98]=1,O[98]=0,_[98]=0,L[98]=1,R[98]=0,P[98]=1,A[98]=0,D[98]=1,F[98]=0,v[98]=-1,y[98]=0,m[98]=1,b[99]=0,I[99]=1,N[99]=0,C[99]=0,S[99]=-1,M[99]=1,T[99]=1,O[99]=0,_[99]=0,L[99]=-1,R[99]=0,P[99]=1,A[99]=0,D[99]=-1,F[99]=0,v[99]=1,y[99]=0,m[99]=1,C[38]=0,S[38]=-1,M[38]=1,T[38]=1,O[38]=0,_[38]=0,q[38]=0,k[38]=1,G[38]=1,A[38]=0,D[38]=1,F[38]=0,v[38]=-1,y[38]=0,m[38]=1,x[38]=-1,E[38]=0,w[38]=0,C[39]=0,S[39]=1,M[39]=1,T[39]=-1,O[39]=0,_[39]=0,q[39]=0,k[39]=-1,G[39]=1,A[39]=0,D[39]=1,F[39]=0,v[39]=-1,y[39]=0,m[39]=1,x[39]=1,E[39]=0,w[39]=0;var j=function(t){return[[t.bottomleft,0],[0,0],[0,t.leftbottom]]},B=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0]]},z=function(t){return[[t.topright,1],[1,1],[1,t.righttop]]},V=function(t){return[[0,t.lefttop],[0,1],[t.topleft,1]]},X=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop]]},Y=function(t){return[[t.bottomright,0],[t.bottomleft,0],[1,t.righttop],[1,t.rightbottom]]},U=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.topleft,1],[t.topright,1]]},W=function(t){return[[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},H=function(t){return[[0,0],[0,t.leftbottom],[1,t.rightbottom],[1,0]]},J=function(t){return[[1,0],[t.bottomright,0],[t.topright,1],[1,1]]},Z=function(t){return[[1,1],[1,t.righttop],[0,t.lefttop],[0,1]]},K=function(t){return[[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},Q=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.leftbottom],[0,t.lefttop]]},$=function(t){return[[t.topleft,1],[t.topright,1],[t.bottomright,0],[t.bottomleft,0]]},tt=function(){return[[0,0],[0,1],[1,1],[1,0]]},et=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,1],[t.topleft,1]]},nt=function(t){return[[t.topright,1],[1,1],[1,0],[0,0],[0,t.leftbottom]]},it=function(t){return[[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[1,1]]},rt=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,1]]},ot=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.lefttop],[0,1],[t.topleft,1]]},st=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[t.topright,1]]},at=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop]]},ut=function(t){return[[t.topright,1],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1]]},lt=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},ct=function(t){return[[1,1],[1,t.righttop],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},ht=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[t.topleft,1],[t.topright,1]]},ft=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom]]},pt=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},dt=function(t){return[[1,1],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},gt=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1]]},vt=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},yt=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},mt=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},xt=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},Et=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},wt=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},bt=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},It=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},Nt=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},Ct=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},St=[],Mt=[],Lt=[],Rt=[],Pt=[],Tt=[],Ot=[],_t=[];Rt[1]=Pt[1]=18,Rt[169]=Pt[169]=18,Lt[4]=Mt[4]=12,Lt[166]=Mt[166]=12,St[16]=_t[16]=4,St[154]=_t[154]=4,Tt[64]=Ot[64]=22,Tt[106]=Ot[106]=22,Lt[2]=Tt[2]=17,Rt[2]=Pt[2]=18,Lt[168]=Tt[168]=17,Rt[168]=Pt[168]=18,St[8]=Rt[8]=9,Mt[8]=Lt[8]=12,St[162]=Rt[162]=9,Mt[162]=Lt[162]=12,St[32]=_t[32]=4,Mt[32]=Ot[32]=1,St[138]=_t[138]=4,Mt[138]=Ot[138]=1,Pt[128]=_t[128]=21,Tt[128]=Ot[128]=22,Pt[42]=_t[42]=21,Tt[42]=Ot[42]=22,Mt[5]=Pt[5]=14,Mt[165]=Pt[165]=14,Lt[20]=_t[20]=6,Lt[150]=_t[150]=6,St[80]=Tt[80]=11,St[90]=Tt[90]=11,Rt[65]=Ot[65]=3,Rt[105]=Ot[105]=3,St[160]=Tt[160]=11,Mt[160]=Pt[160]=14,St[10]=Tt[10]=11,Mt[10]=Pt[10]=14,Lt[130]=_t[130]=6,Rt[130]=Ot[130]=3,Lt[40]=_t[40]=6,Rt[40]=Ot[40]=3,Mt[101]=Ot[101]=1,Mt[69]=Ot[69]=1,Pt[149]=_t[149]=21,Pt[21]=_t[21]=21,Lt[86]=Tt[86]=17,Lt[84]=Tt[84]=17,St[89]=Rt[89]=9,St[81]=Rt[81]=9,St[96]=Ot[96]=0,Mt[96]=Tt[96]=15,St[74]=Ot[74]=0,Mt[74]=Tt[74]=15,St[24]=Lt[24]=8,Rt[24]=_t[24]=7,St[146]=Lt[146]=8,Rt[146]=_t[146]=7,Mt[6]=Tt[6]=15,Lt[6]=Pt[6]=16,Mt[164]=Tt[164]=15,Lt[164]=Pt[164]=16,Rt[129]=_t[129]=7,Pt[129]=Ot[129]=20,Rt[41]=_t[41]=7,Pt[41]=Ot[41]=20,Lt[66]=Ot[66]=2,Rt[66]=Tt[66]=19,Lt[104]=Ot[104]=2,Rt[104]=Tt[104]=19,St[144]=Pt[144]=10,Tt[144]=_t[144]=23,St[26]=Pt[26]=10,Tt[26]=_t[26]=23,Mt[36]=_t[36]=5,Lt[36]=Ot[36]=2,Mt[134]=_t[134]=5,Lt[134]=Ot[134]=2,St[9]=Pt[9]=10,Mt[9]=Rt[9]=13,St[161]=Pt[161]=10,Mt[161]=Rt[161]=13,Mt[37]=_t[37]=5,Pt[37]=Ot[37]=20,Mt[133]=_t[133]=5,Pt[133]=Ot[133]=20,Lt[148]=Pt[148]=16,Tt[148]=_t[148]=23,Lt[22]=Pt[22]=16,Tt[22]=_t[22]=23,St[82]=Lt[82]=8,Rt[82]=Tt[82]=19,St[88]=Lt[88]=8,Rt[88]=Tt[88]=19,St[73]=Ot[73]=0,Mt[73]=Rt[73]=13,St[97]=Ot[97]=0,Mt[97]=Rt[97]=13,St[145]=Rt[145]=9,Pt[145]=_t[145]=21,St[25]=Rt[25]=9,Pt[25]=_t[25]=21,Mt[70]=Ot[70]=1,Lt[70]=Tt[70]=17,Mt[100]=Ot[100]=1,Lt[100]=Tt[100]=17,St[34]=Rt[34]=9,Mt[34]=Lt[34]=12,Pt[34]=_t[34]=21,Tt[34]=Ot[34]=22,St[136]=_t[136]=4,Mt[136]=Ot[136]=1,Lt[136]=Tt[136]=17,Rt[136]=Pt[136]=18,St[35]=_t[35]=4,Mt[35]=Lt[35]=12,Rt[35]=Pt[35]=18,Tt[35]=Ot[35]=22,St[153]=_t[153]=4,Rt[153]=Pt[153]=18,Mt[102]=Lt[102]=12,Tt[102]=Ot[102]=22,St[155]=Rt[155]=9,Pt[155]=_t[155]=23,Mt[103]=Ot[103]=1,Lt[103]=Tt[103]=17,St[152]=_t[152]=4,Lt[152]=Tt[152]=17,Rt[152]=Pt[152]=18,St[156]=Lt[156]=8,Rt[156]=Pt[156]=18,Tt[156]=_t[156]=23,St[137]=_t[137]=4,Mt[137]=Ot[137]=1,Rt[137]=Pt[137]=18,St[139]=_t[139]=4,Mt[139]=Rt[139]=13,Pt[139]=Ot[139]=20,St[98]=Rt[98]=9,Mt[98]=Lt[98]=12,Tt[98]=Ot[98]=22,St[99]=Ot[99]=0,Mt[99]=Lt[99]=12,Rt[99]=Tt[99]=19,Mt[38]=Lt[38]=12,Pt[38]=_t[38]=21,Tt[38]=Ot[38]=22,Mt[39]=_t[39]=5,Lt[39]=Pt[39]=16,Tt[39]=Ot[39]=22;var At=[];return At[1]=At[169]=j,At[4]=At[166]=B,At[16]=At[154]=z,At[64]=At[106]=V,At[168]=At[2]=X,At[162]=At[8]=Y,At[138]=At[32]=U,At[42]=At[128]=W,At[5]=At[165]=H,At[20]=At[150]=J,At[80]=At[90]=Z,At[65]=At[105]=K,At[160]=At[10]=Q,At[130]=At[40]=$,At[85]=tt,At[101]=At[69]=et,At[149]=At[21]=nt,At[86]=At[84]=it,At[89]=At[81]=rt,At[96]=At[74]=ot,At[24]=At[146]=st,At[6]=At[164]=at,At[129]=At[41]=ut,At[66]=At[104]=lt,At[144]=At[26]=ct,At[36]=At[134]=ht,At[9]=At[161]=ft,At[37]=At[133]=pt,At[148]=At[22]=dt,At[82]=At[88]=gt,At[73]=At[97]=vt,At[145]=At[25]=yt,At[70]=At[100]=mt,At[34]=function(t){return[W(t),Y(t)]},At[35]=xt,At[136]=function(t){return[U(t),X(t)]},At[153]=function(t){return[z(t),j(t)]},At[102]=function(t){return[B(t),V(t)]},At[155]=Et,At[103]=wt,At[152]=function(t){return[z(t),X(t)]},At[156]=bt,At[137]=function(t){return[U(t),j(t)]},At[139]=It,At[98]=function(t){return[Y(t),V(t)]},At[99]=Nt,At[38]=function(t){return[B(t),W(t)]},At[39]=Ct,t})},{}],353:[function(e,n,i){!function(e,i){"function"==typeof t&&t.amd?t([],function(){return{isoContours:i()}}):"object"==typeof n&&n.exports?n.exports={isoContours:i()}:e.MarchingSquaresJS={isoContours:i(),isoBands:e.MarchingSquaresJS?e.MarchingSquaresJS.isoBands:null}}(this,function(){function t(t,e,i){i=i||{};for(var r=Object.keys(l),o=0;o<r.length;o++){var s=r[o],u=i[s];u=void 0!==u&&null!==u?u:l[s],c[s]=u}c.verbose&&console.log("MarchingSquaresJS-isoContours: computing isocontour for "+e);var h=a(n(t,e));return"function"==typeof c.successCallback&&c.successCallback(h),h}function e(t,e,n){return(t-e)/(n-e)}function n(t,n){for(var i=t.length-1,r=t[0].length-1,o={rows:i,cols:r,cells:[]},s=0;s<i;++s){o.cells[s]=[];for(var a=0;a<r;++a){var u=0,l=t[s+1][a],c=t[s+1][a+1],h=t[s][a+1],f=t[s][a];if(!(isNaN(l)||isNaN(c)||isNaN(h)||isNaN(f))){u|=l>=n?8:0,u|=c>=n?4:0,u|=h>=n?2:0,u|=f>=n?1:0;var p=!1;if(5===u||10===u){var d=(l+c+h+f)/4;5===u&&d<n?(u=10,p=!0):10===u&&d<n&&(u=5,p=!0)}if(0!=u&&15!=u){var g,v,y,m;g=v=y=m=.5,1===u?(y=1-e(n,l,f),v=1-e(n,h,f)):2===u?(v=e(n,f,h),m=1-e(n,c,h)):3===u?(y=1-e(n,l,f),m=1-e(n,c,h)):4===u?(g=e(n,l,c),m=e(n,h,c)):5===u?(g=e(n,l,c),m=e(n,h,c),v=1-e(n,h,f),y=1-e(n,l,f)):6===u?(v=e(n,f,h),g=e(n,l,c)):7===u?(y=1-e(n,l,f),g=e(n,l,c)):8===u?(y=e(n,f,l),g=1-e(n,c,l)):9===u?(v=1-e(n,h,f),g=1-e(n,c,l)):10===u?(g=1-e(n,c,l),m=1-e(n,c,h),v=e(n,f,h),y=e(n,f,l)):11===u?(g=1-e(n,c,l),m=1-e(n,c,h)):12===u?(y=e(n,f,l),m=e(n,h,c)):13===u?(v=1-e(n,h,f),m=e(n,h,c)):14===u?(y=e(n,f,l),v=e(n,f,h)):console.log("MarchingSquaresJS-isoContours: Illegal cval detected: "+u),o.cells[s][a]={cval:u,flipped:p,top:g,right:m,bottom:v,left:y}}}}}return o}function i(t){return 5===t.cval||10===t.cval}function r(t){return 0===t.cval||15===t.cval}function o(t){r(t)||5===t.cval||10===t.cval||(t.cval=15)}function s(t,e){return"top"===e?[t.top,1]:"bottom"===e?[t.bottom,0]:"right"===e?[1,t.right]:"left"===e?[0,t.left]:void 0}function a(t){var e=[],n=0;t.rows,t.cols;return t.cells.forEach(function(o,s){o.forEach(function(o,a){if(void 0!==o&&!i(o)&&!r(o)){var l=u(t.cells,s,a),c=!1;if("mergeable"===l.info)for(var h=l.path[l.path.length-1][0],f=l.path[l.path.length-1][1],p=n-1;p>=0;p--)if(Math.abs(e[p][0][0]-h)<=1e-7&&Math.abs(e[p][0][1]-f)<=1e-7){for(var d=l.path.length-2;d>=0;--d)e[p].unshift(l.path[d]);c=!0;break}c||(e[n++]=l.path)}})}),e}function u(t,e,n){var i,r,a,u=t.length,l=[],c=[0,0,1,1,0,0,0,0,-1,0,1,1,-1,0,-1,0],h=[0,-1,0,0,1,1,1,1,0,-1,0,0,0,-1,0,0],f=["none","left","bottom","left","right","none","bottom","left","top","top","none","top","right","right","bottom","none"],p=["none","bottom","right","right","top","top","top","top","left","bottom","right","right","left","bottom","left","none"],d=(t[e][n],t[e][n]),g=d.cval,a=f[g],v=s(d,a);l.push([n+v[0],e+v[1]]),a=p[g],v=s(d,a),l.push([n+v[0],e+v[1]]),o(d);for(var y=n+c[g],m=e+h[g],x=g;y>=0&&m>=0&&m<u&&(y!=n||m!=e)&&void 0!==(d=t[m][y]);){if(0===(g=d.cval)||15===g)return{path:l,info:"mergeable"};a=p[g],i=c[g],r=h[g],5!==g&&10!==g||(5===g?d.flipped?-1===h[x]?(a="left",i=-1,r=0):(a="right",i=1,r=0):-1===c[x]&&(a="bottom",i=0,r=-1):10===g&&(d.flipped?-1===c[x]?(a="top",i=0,r=1):(a="bottom",i=0,r=-1):1===h[x]&&(a="left",i=-1,r=0))),v=s(d,a),l.push([y+v[0],m+v[1]]),o(d),y+=i,m+=r,x=g}return{path:l,info:"closed"}}var l={successCallback:null,verbose:!1},c={};return t})},{}],354:[function(e,n,i){!function(i,r){"function"==typeof t&&t.amd?t(["./marchingsquares-isobands","./marchingsquares-isocontours"],r):"object"==typeof n&&n.exports?n.exports=r(e("./marchingsquares-isobands"),e("./marchingsquares-isocontours")):i.MarchingSquaresJS=r(i.MarchingSquaresJS?i.MarchingSquaresJS.isoBands:null,i.MarchingSquaresJS?i.MarchingSquaresJS.isoContours:null)}(this,function(t,e){return{isoBands:"function"==typeof t?t:"object"==typeof t&&"function"==typeof t.isoBands?t.isoBands:null,isoContours:"function"==typeof e?e:"object"==typeof e&&"function"==typeof e.isoContours?e.isoContours:null}})},{"./marchingsquares-isobands":352,"./marchingsquares-isocontours":353}],355:[function(t,e,n){arguments[4][15][0].apply(n,arguments)},{dup:15}],356:[function(t,e,n){function i(t,e,n,i,r){for(var o=[],s=1;s<e.length;s++){var a=+e[s],u=Object.assign({},i,r[s]);u[n]=a;var l=f(h.isoContours(t,a),u);o.push(l)}return o}function r(t,e,n){var i=s(n),r=i[2]-i[0],o=i[3]-i[1],a=i[0],u=i[1],l=e[0].length-1,c=e.length-1,h=r/l,f=o/c,d=function(t){t[0]=t[0]*h+a,t[1]=t[1]*f+u};return t.forEach(function(t){p(t,d)}),t}function o(t){return!!t&&t.constructor===Object}var s=t("@turf/bbox"),a=t("@turf/meta"),u=t("@turf/helpers"),l=t("@turf/invariant"),c=t("grid-to-matrix"),h=t("marchingsquares"),f=u.multiLineString,p=a.coordEach,d=l.collectionOf,g=u.featureCollection;e.exports=function(t,e,n,s,a){if(n=n||"elevation",s=s||{},a=a||[],d(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks must be an Array");if(!o(s))throw new Error("propertiesToAllIsolines must be an Object");if(!Array.isArray(a))throw new Error("propertiesPerIsoline must be an Array");if("string"!=typeof n)throw new Error("zProperty must be a string");var u=c(t,n,!0),l=i(u,e,n,s,a),h=r(l,u,t);return g(h)}},{"@turf/bbox":357,"@turf/helpers":359,"@turf/invariant":360,"@turf/meta":361,"grid-to-matrix":362,marchingsquares:365}],357:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"@turf/meta":358,dup:22}],358:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],359:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],360:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],361:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],362:[function(t,e,n){arguments[4][349][0].apply(n,arguments)},{"@turf/invariant":360,"@turf/meta":361,dup:349}],363:[function(t,e,n){arguments[4][352][0].apply(n,arguments)},{dup:352}],364:[function(t,e,n){arguments[4][353][0].apply(n,arguments)},{dup:353}],365:[function(t,e,n){arguments[4][354][0].apply(n,arguments)},{"./marchingsquares-isobands":363,"./marchingsquares-isocontours":364,dup:354}],366:[function(t,e,n){function i(t,e,n,i,r,o,s,a){var u,l,c,h,f,p={x:null,y:null,onLine1:!1,onLine2:!1};return 0===(u=(a-o)*(n-t)-(s-r)*(i-e))?null!==p.x&&null!==p.y&&p:(l=e-o,c=t-r,h=(s-r)*l-(a-o)*c,f=(n-t)*l-(i-e)*c,l=h/u,c=f/u,p.x=t+l*(n-t),p.y=e+l*(i-e),l>=0&&l<=1&&(p.onLine1=!0),c>=0&&c<=1&&(p.onLine2=!0),!(!p.onLine1||!p.onLine2)&&[p.x,p.y])}var r=t("@turf/helpers").point;e.exports=function(t){var e,n,o={type:"FeatureCollection",features:[]};if(n="Feature"===t.type?t.geometry:t,"LineString"===n.type)e=[n.coordinates];else if("MultiLineString"===n.type)e=n.coordinates;else if("MultiPolygon"===n.type)e=[].concat.apply([],n.coordinates);else{if("Polygon"!==n.type)throw new Error("Input must be a LineString, MultiLineString, Polygon, or MultiPolygon Feature or Geometry");e=n.coordinates}return e.forEach(function(t){e.forEach(function(e){for(var n=0;n<t.length-1;n++)for(var s=0;s<e.length-1;s++)if(t!==e||1!==Math.abs(n-s)&&Math.abs(n-s)!==t.length-2){var a=i(t[n][0],t[n][1],t[n+1][0],t[n+1][1],e[s][0],e[s][1],e[s+1][0],e[s+1][1]);a&&o.features.push(r([a[0],a[1]]))}})}),o}},{"@turf/helpers":367}],367:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],368:[function(t,e,n){function i(t){var e=t%360;return e<0&&(e+=360),e}var r=t("@turf/destination"),o=t("@turf/circle"),s=t("@turf/helpers").lineString;e.exports=function(t,e,n,a,u,l){if(!t)throw new Error("center is required");if(void 0===n||null===n)throw new Error("bearing1 is required");if(void 0===a||null===a)throw new Error("bearing2 is required");if(!e)throw new Error("radius is required");u=u||64;var c=i(n),h=i(a),f=t.properties;if(c===h)return s(o(t,e,u,l).geometry.coordinates[0],f);for(var p=c,d=c<h?h:h+360,g=p,v=[],y=0;g<d;)v.push(r(t,e,g,l).geometry.coordinates),y++,g=p+360*y/u;return g>d&&v.push(r(t,e,d,l).geometry.coordinates),s(v,f)}},{"@turf/circle":369,"@turf/destination":374,"@turf/helpers":377}],369:[function(t,e,n){arguments[4][167][0].apply(n,arguments)},{"@turf/destination":370,"@turf/helpers":373,dup:167}],370:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{"@turf/helpers":371,"@turf/invariant":372,dup:5}],371:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],372:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],373:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],374:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{"@turf/helpers":375,"@turf/invariant":376,dup:5}],375:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],376:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],377:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],378:[function(t,e,n){function i(t,e,n,i){var s=o(t,n);if(s<=e)return i(t);for(var a=Math.floor(s/e)+1,u=0;u<a;u++){i(r(t,e*u,e*(u+1),n),u)}}var r=t("@turf/line-slice-along"),o=t("@turf/line-distance"),s=t("@turf/helpers").featureCollection,a=t("@turf/meta").flattenEach;e.exports=function(t,e,n,r){if(!t)throw new Error("geojson is required");if(e<=0)throw new Error("segmentLength must be greater than 0");var o=[];return a(t,function(t){r&&(t.geometry.coordinates=t.geometry.coordinates.reverse()),i(t,e,n,function(t){o.push(t)})}),s(o)}
},{"@turf/helpers":379,"@turf/line-distance":380,"@turf/line-slice-along":385,"@turf/meta":395}],379:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],380:[function(t,e,n){var i=t("@turf/distance"),r=t("@turf/meta").segmentReduce;e.exports=function(t,e){if(!t)throw new Error("geojson is required");return r(t,function(t,n){var r=n.geometry.coordinates;return t+i(r[0],r[1],e)},0)}},{"@turf/distance":381,"@turf/meta":384}],381:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":382,"@turf/invariant":383,dup:8}],382:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],383:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],384:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],385:[function(t,e,n){var i=t("@turf/bearing"),r=t("@turf/distance"),o=t("@turf/destination"),s=t("@turf/helpers").lineString;e.exports=function(t,e,n,a){var u,l=[];if("Feature"===t.type)u=t.geometry.coordinates;else{if("LineString"!==t.type)throw new Error("input must be a LineString Feature or Geometry");u=t.coordinates}for(var c,h,f,p=0,d=0;d<u.length&&!(e>=p&&d===u.length-1);d++){if(p>e&&0===l.length){if(!(c=e-p))return l.push(u[d]),s(l);h=i(u[d],u[d-1])-180,f=o(u[d],c,h,a),l.push(f.geometry.coordinates)}if(p>=n)return(c=n-p)?(h=i(u[d],u[d-1])-180,f=o(u[d],c,h,a),l.push(f.geometry.coordinates),s(l)):(l.push(u[d]),s(l));if(p>=e&&l.push(u[d]),d===u.length-1)return s(l);p+=r(u[d],u[d+1],a)}return s(u[u.length-1])}},{"@turf/bearing":386,"@turf/destination":388,"@turf/distance":391,"@turf/helpers":394}],386:[function(t,e,n){arguments[4][3][0].apply(n,arguments)},{"@turf/invariant":387,dup:3}],387:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],388:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{"@turf/helpers":389,"@turf/invariant":390,dup:5}],389:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],390:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],391:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":392,"@turf/invariant":393,dup:8}],392:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],393:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],394:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],395:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],396:[function(t,e,n){arguments[4][380][0].apply(n,arguments)},{"@turf/distance":397,"@turf/meta":400,dup:380}],397:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":398,"@turf/invariant":399,dup:8}],398:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],399:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],400:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],401:[function(t,e,n){arguments[4][42][0].apply(n,arguments)},{"@turf/helpers":403,"@turf/invariant":404,"@turf/line-segment":405,"@turf/meta":409,dup:42,"geojson-rbush":410}],402:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{"@turf/meta":409,dup:43}],403:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],404:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],405:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{"@turf/helpers":406,"@turf/invariant":407,"@turf/meta":408,dup:46}],406:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],407:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],408:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],409:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],410:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{"@turf/bbox":402,"@turf/helpers":403,"@turf/meta":409,dup:51,rbush:412}],411:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],412:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53,quickselect:411}],413:[function(t,e,n){function i(t,e,n){var i=[],o=f(e,n),s=a(t),l=[];return s.forEach(function(t,e){if(e!==s.length-1){var n=r(t,s[e+1],o);if(i.push(n),e>0){var a=i[e-1],c=u(n,a);!1!==c&&(a[1]=c,n[0]=c),l.push(a[0]),e===s.length-2&&(l.push(n[0]),l.push(n[1]))}2===s.length&&(l.push(n[0]),l.push(n[1]))}}),c(l,t.properties)}function r(t,e,n){var i=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),r=t[0]+n*(e[1]-t[1])/i,o=e[0]+n*(e[1]-t[1])/i;return[[r,t[1]+n*(t[0]-e[0])/i],[o,e[1]+n*(t[0]-e[0])/i]]}var o=t("@turf/meta"),s=t("@turf/helpers"),a=t("@turf/invariant").getCoords,u=t("./intersection"),l=o.flattenEach,c=s.lineString,h=s.multiLineString,f=s.distanceToDegrees;e.exports=function(t,e,n){if(!t)throw new Error("geojson is required");if(void 0===e||null===e||isNaN(e))throw new Error("distance is required");var r="Feature"===t.type?t.geometry.type:t.type,o=t.properties;switch(r){case"LineString":return i(t,e,n);case"MultiLineString":var s=[];return l(t,function(t){s.push(i(t,e,n).geometry.coordinates)}),h(s,o);default:throw new Error("geometry "+r+" is not supported")}}},{"./intersection":414,"@turf/helpers":415,"@turf/invariant":416,"@turf/meta":417}],414:[function(t,e,n){function i(t){var e=t[0],n=t[1];return[n[0]-e[0],n[1]-e[1]]}function r(t,e){return t[0]*e[1]-e[0]*t[1]}function o(t,e){return[t[0]+e[0],t[1]+e[1]]}function s(t,e){return[t[0]-e[0],t[1]-e[1]]}function a(t,e){return[t*e[0],t*e[1]]}function u(t,e){var n=t[0],u=i(t),l=e[0],c=i(e),h=r(u,c);return o(n,a(r(s(l,n),c)/h,u))}function l(t,e){return 0===r(i(t),i(e))}function c(t,e){return!l(t,e)&&u(t,e)}e.exports=c},{}],415:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],416:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],417:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],418:[function(t,e,n){arguments[4][99][0].apply(n,arguments)},{"@turf/helpers":420,"@turf/invariant":421,"@turf/line-segment":422,"@turf/meta":426,"deep-equal":427,dup:99,"geojson-rbush":430}],419:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{"@turf/meta":426,dup:43}],420:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],421:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],422:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{"@turf/helpers":423,"@turf/invariant":424,"@turf/meta":425,dup:46}],423:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],424:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],425:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],426:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],427:[function(t,e,n){arguments[4][81][0].apply(n,arguments)},{"./lib/is_arguments.js":428,"./lib/keys.js":429,dup:81}],428:[function(t,e,n){arguments[4][82][0].apply(n,arguments)},{dup:82}],429:[function(t,e,n){arguments[4][83][0].apply(n,arguments)},{dup:83}],430:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{"@turf/bbox":419,"@turf/helpers":420,"@turf/meta":426,dup:51,rbush:432}],431:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],432:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53,quickselect:431}],433:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{"@turf/helpers":434,"@turf/invariant":435,"@turf/meta":436,dup:46}],434:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],435:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],436:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],437:[function(t,e,n){arguments[4][385][0].apply(n,arguments)},{"@turf/bearing":438,"@turf/destination":440,"@turf/distance":443,"@turf/helpers":446,dup:385}],438:[function(t,e,n){arguments[4][3][0].apply(n,arguments)},{"@turf/invariant":439,dup:3}],439:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],440:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{"@turf/helpers":441,"@turf/invariant":442,dup:5}],441:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],442:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],443:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":444,"@turf/invariant":445,dup:8}],444:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],445:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],446:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],447:[function(t,e,n){var i=t("@turf/helpers").lineString,r=t("@turf/point-on-line");e.exports=function(t,e,n){var o;if("Feature"===n.type)o=n.geometry.coordinates;else{if("LineString"!==n.type)throw new Error("input must be a LineString Feature or Geometry");o=n.coordinates}var s,a=r(n,t),u=r(n,e);s=a.properties.index<=u.properties.index?[a,u]:[u,a];for(var l=[s[0].geometry.coordinates],c=s[0].properties.index+1;c<s[1].properties.index+1;c++)l.push(o[c]);return l.push(s[1].geometry.coordinates),i(l,n.properties)}},{"@turf/helpers":448,"@turf/point-on-line":449}],448:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],449:[function(t,e,n){var i=t("@turf/meta"),r=t("@turf/helpers"),o=t("@turf/bearing"),s=t("@turf/distance"),a=t("@turf/invariant"),u=t("@turf/destination"),l=t("@turf/line-intersect"),c=r.point,h=a.getCoords,f=r.lineString,p=i.flattenEach;e.exports=function(t,e,n){var i=t.geometry?t.geometry.type:t.type;if("LineString"!==i&&"MultiLineString"!==i)throw new Error("lines must be LineString or MultiLineString");var r=c([1/0,1/0],{dist:1/0}),a=0;return p(t,function(t){for(var i=h(t),p=0;p<i.length-1;p++){var d=c(i[p]);d.properties.dist=s(e,d,n);var g=c(i[p+1]);g.properties.dist=s(e,g,n);var v=s(d,g,n),y=Math.max(d.properties.dist,g.properties.dist),m=o(d,g),x=u(e,y,m+90,n),E=u(e,y,m-90,n),w=l(f([x.geometry.coordinates,E.geometry.coordinates]),f([d.geometry.coordinates,g.geometry.coordinates])),b=null;w.features.length>0&&(b=w.features[0],b.properties.dist=s(e,b,n),b.properties.location=a+s(d,b,n)),d.properties.dist<r.properties.dist&&(r=d,r.properties.index=p,r.properties.location=a),g.properties.dist<r.properties.dist&&(r=g,r.properties.index=p+1,r.properties.location=a+v),b&&b.properties.dist<r.properties.dist&&(r=b,r.properties.index=p),a+=v}}),r}},{"@turf/bearing":450,"@turf/destination":452,"@turf/distance":455,"@turf/helpers":458,"@turf/invariant":459,"@turf/line-intersect":460,"@turf/meta":472}],450:[function(t,e,n){arguments[4][3][0].apply(n,arguments)},{"@turf/invariant":451,dup:3}],451:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],452:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{"@turf/helpers":453,"@turf/invariant":454,dup:5}],453:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],454:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],455:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":456,"@turf/invariant":457,dup:8}],456:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],457:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],458:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],459:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],460:[function(t,e,n){arguments[4][42][0].apply(n,arguments)},{"@turf/helpers":462,"@turf/invariant":463,"@turf/line-segment":464,"@turf/meta":468,dup:42,"geojson-rbush":469}],461:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{"@turf/meta":468,dup:43}],462:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],463:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],464:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{"@turf/helpers":465,"@turf/invariant":466,"@turf/meta":467,dup:46}],465:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],466:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],467:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],468:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],469:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{"@turf/bbox":461,"@turf/helpers":462,"@turf/meta":468,dup:51,rbush:471}],470:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],471:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53,quickselect:470}],472:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],473:[function(t,e,n){function i(t,e){var n=[],i=a();return m(e,function(e){if(n.forEach(function(t,e){t.id=e}),n.length){var s=i.search(e),a=o(e,s);n=n.filter(function(t){return t.id!==a.id}),i.remove(a),m(r(a,e),function(t){n.push(t),i.insert(t)})}else n=r(t,e).features,i.load(E(n))}),E(n)}function r(t,e){var n=[],i=a(),r=p(t);i.load(r);var s=i.search(e);if(!s.features.length)return E([t]);var u=o(e,s),l=[g(r.features[0])[0]],c=x(r,function(t,i,r){var o=g(i)[1],s=g(e);return r===u.id?(t.push(s),n.push(v(t)),s[0]===o[0]&&s[1]===o[1]?[s]:[s,o]):(t.push(o),t)},l);return c.length>1&&n.push(v(c)),E(n)}function o(t,e){var n,i;if(!e.features)throw new Error("<lines> must contain features");return 1===e.features.length?e.features[0]:(m(e,function(e){var r=f(e,t),o=r.properties.dist;void 0===n?(i=e,n=o):o<n&&(i=e,n=o)}),i)}var s=t("@turf/meta"),a=t("geojson-rbush"),u=t("@turf/helpers"),l=t("@turf/flatten"),c=t("@turf/truncate"),h=t("@turf/invariant"),f=t("@turf/point-on-line"),p=t("@turf/line-segment"),d=t("@turf/line-intersect"),g=h.getCoords,v=u.lineString,y=h.getGeomType,m=s.featureEach,x=s.featureReduce,E=u.featureCollection;e.exports=function(t,e){if("LineString"!==y(t))throw new Error("<line> must be LineString");var n=y(e);if("FeatureCollection"===n)throw new Error("<splitter> cannot be a FeatureCollection");switch(c(e,6,3,!0),n){case"Point":return r(t,e);case"MultiPoint":return i(t,l(e));case"LineString":case"MultiLineString":case"Polygon":case"MultiPolygon":return i(t,d(t,e));default:throw new Error("<splitter> geometry type is not supported")}}},{"@turf/flatten":475,"@turf/helpers":478,"@turf/invariant":479,"@turf/line-intersect":480,"@turf/line-segment":492,"@turf/meta":496,"@turf/point-on-line":497,"@turf/truncate":521,"geojson-rbush":523}],474:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{"@turf/meta":496,dup:43}],475:[function(t,e,n){arguments[4][267][0].apply(n,arguments)},{"@turf/helpers":476,"@turf/meta":477,dup:267}],476:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],477:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],478:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],479:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],480:[function(t,e,n){arguments[4][42][0].apply(n,arguments)},{"@turf/helpers":482,"@turf/invariant":483,"@turf/line-segment":484,"@turf/meta":488,dup:42,"geojson-rbush":489}],481:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{"@turf/meta":488,dup:43}],482:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],483:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],484:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{"@turf/helpers":485,"@turf/invariant":486,"@turf/meta":487,dup:46}],485:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],486:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],487:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],488:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],489:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{"@turf/bbox":481,"@turf/helpers":482,"@turf/meta":488,dup:51,rbush:491}],490:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],491:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53,quickselect:490}],492:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{"@turf/helpers":493,"@turf/invariant":494,"@turf/meta":495,dup:46}],493:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],494:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],495:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],496:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],497:[function(t,e,n){arguments[4][449][0].apply(n,arguments)},{"@turf/bearing":498,"@turf/destination":500,"@turf/distance":503,"@turf/helpers":506,"@turf/invariant":507,"@turf/line-intersect":508,"@turf/meta":520,dup:449}],498:[function(t,e,n){arguments[4][3][0].apply(n,arguments)},{"@turf/invariant":499,dup:3}],499:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],500:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{"@turf/helpers":501,"@turf/invariant":502,dup:5}],501:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],502:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],503:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":504,"@turf/invariant":505,dup:8}],504:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],505:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],506:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],507:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],508:[function(t,e,n){arguments[4][42][0].apply(n,arguments)},{"@turf/helpers":510,"@turf/invariant":511,"@turf/line-segment":512,"@turf/meta":516,dup:42,"geojson-rbush":517}],509:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{"@turf/meta":516,dup:43}],510:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],511:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],512:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{"@turf/helpers":513,"@turf/invariant":514,"@turf/meta":515,dup:46}],513:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],514:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],515:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],516:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],517:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{"@turf/bbox":509,"@turf/helpers":510,"@turf/meta":516,dup:51,rbush:519}],518:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],519:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53,quickselect:518}],520:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],521:[function(t,e,n){function i(t,e,n){t.length>n&&t.splice(n,t.length);for(var i=0;i<t.length;i++)t[i]=Math.round(t[i]*e)/e;return t}var r=t("@turf/meta").coordEach;e.exports=function(t,e,n,o){if(e=void 0===e||null===e||isNaN(e)?6:e,n=void 0===n||null===n||isNaN(n)?3:n,!t)throw new Error("<geojson> is required");if("number"!=typeof e)throw new Error("<precision> must be a number");if("number"!=typeof n)throw new Error("<coordinates> must be a number");!1!==o&&void 0!==o||(t=JSON.parse(JSON.stringify(t)));var s=Math.pow(10,e);return r(t,function(t){i(t,s,n)}),t}},{"@turf/meta":522}],522:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],523:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{"@turf/bbox":474,"@turf/helpers":478,"@turf/meta":496,dup:51,rbush:525}],524:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],525:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53,quickselect:524}],526:[function(t,e,n){function i(t,e,n,i){e=e||t.properties||{};var l=u(t),h=r(t);if(!l.length)throw new Error("line must contain coordinates");switch(h){case"LineString":return n&&(l=o(l)),c([l],e);case"MultiLineString":var p=[],d=0;return l.forEach(function(t){if(n&&(t=o(t)),i){var e=s(a(f(t)));e>d?(p.unshift(t),d=e):p.push(t)}else p.push(t)}),c(p,e);default:throw new Error("geometry type "+h+" is not supported")}}function r(t){return t.geometry?t.geometry.type:t.type}function o(t){var e=t[0],n=e[0],i=e[1],r=t[t.length-1],o=r[0],s=r[1];return n===o&&i===s||t.push(e),t}function s(t){var e=t[0],n=t[1],i=t[2],r=t[3];return Math.abs(e-i)*Math.abs(n-r)}var a=t("@turf/bbox"),u=t("@turf/invariant").getCoords,l=t("@turf/helpers"),c=l.polygon,h=l.multiPolygon,f=l.lineString;e.exports=function(t,e,n,o){if(!t)throw new Error("lines is required");switch(n=void 0===n||n,o=void 0===o||o,r(t)){case"FeatureCollection":case"GeometryCollection":var s=[];return(t.features?t.features:t.geometries).forEach(function(t){s.push(u(i(t,{},n,o)))}),h(s,e)}return i(t,e,n,o)}},{"@turf/bbox":527,"@turf/helpers":529,"@turf/invariant":530}],527:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"@turf/meta":528,dup:22}],528:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],529:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],530:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],531:[function(t,e,n){function i(t,e,n){var i=[];return i.push(t.geometry.coordinates[0]),p(e,function(t){i.push(t.geometry.coordinates[0])}),p(n,function(t){i.push(t.geometry.coordinates[0])}),h.polygon(i)}function r(t){var e=[],n=[];return p(t,function(t){var i=t.geometry.coordinates,r=i[0],o=i.slice(1);e.push(h.polygon([r])),o.forEach(function(t){n.push(h.polygon([t]))})}),[h.featureCollection(e),h.featureCollection(n)]}function o(t){var e=[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]],n=t&&t.geometry.coordinates||e;return h.polygon(n)}function s(t){if(t.features.length<=1)return t;var e=u(t),n=[],i={};return p(t,function(t,r){if(i[r])return!0;for(e.remove({index:r},a),i[r]=!0;;){var o=f(t),s=e.search({minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]});if(s.length>0){var u=s.map(function(t){return i[t.index]=!0,e.remove({index:t.index},a),t.geojson});u.push(t),t=c.apply(this,u)}if(0===s.length)break}n.push(t)}),h.featureCollection(n)}function a(t,e){return t.index===e.index}function u(t){var e=l(),n=[];return p(t,function(t,e){var i=f(t);n.push({minX:i[0],minY:i[1],maxX:i[2],maxY:i[3],geojson:t,index:e})}),e.load(n),e}var l=t("rbush"),c=t("@turf/union"),h=t("@turf/helpers"),f=t("@turf/bbox"),p=t("@turf/meta").flattenEach;e.exports=function(t,e){var n=o(e),a=r(t),u=a[0],l=a[1];return u=s(u),l=s(l),i(n,u,l)}},{"@turf/bbox":532,"@turf/helpers":534,"@turf/meta":535,"@turf/union":536,rbush:539}],532:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"@turf/meta":533,dup:22}],533:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],534:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],535:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],536:[function(t,e,n){arguments[4][212][0].apply(n,arguments)},{dup:212,jsts:537}],537:[function(t,e,n){arguments[4][130][0].apply(n,arguments)},{dup:130}],538:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],539:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53,quickselect:538}],540:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],541:[function(t,e,n){var i=t("@turf/bearing"),r=t("@turf/destination"),o=t("@turf/distance");e.exports=function(t,e){var n=o(t,e,"miles"),s=i(t,e);return r(t,n/2,s,"miles")}},{"@turf/bearing":542,"@turf/destination":544,"@turf/distance":547}],542:[function(t,e,n){arguments[4][3][0].apply(n,arguments)},{"@turf/invariant":543,dup:3}],543:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],544:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{"@turf/helpers":545,"@turf/invariant":546,dup:5}],545:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],546:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],547:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":548,"@turf/invariant":549,dup:8}],548:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],549:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],550:[function(t,e,n){var i=t("@turf/distance");e.exports=function(t,e){for(var n,r=1/0,o=0;o<e.features.length;o++){var s=i(t,e.features[o],"miles");s<r&&(n=e.features[o],r=s)}return n}},{"@turf/distance":551}],551:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":552,"@turf/invariant":553,dup:8}],552:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],553:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],554:[function(t,e,n){var i=t("@turf/invariant"),r=i.getCoord,o=i.getGeom;e.exports=function(t,e){var n=r(t),i=o(e),s=i.coordinates,a=s[0];if(a.length<4)throw new Error("OuterRing of a Polygon must have 4 or more Positions.");var u=e.properties||{},l=u.a,c=u.b,h=u.c,f=n[0],p=n[1],d=a[0][0],g=a[0][1],v=void 0!==l?l:a[0][2],y=a[1][0],m=a[1][1],x=void 0!==c?c:a[1][2],E=a[2][0],w=a[2][1],b=void 0!==h?h:a[2][2];return(b*(f-d)*(p-m)+v*(f-y)*(p-w)+x*(f-E)*(p-g)-x*(f-d)*(p-w)-b*(f-y)*(p-g)-v*(f-E)*(p-m))/((f-d)*(p-m)+(f-y)*(p-w)+(f-E)*(p-g)-(f-d)*(p-w)-(f-y)*(p-g)-(f-E)*(p-m))}},{"@turf/invariant":555}],555:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],556:[function(t,e,n){arguments[4][315][0].apply(n,arguments)},{"@turf/bbox":557,"@turf/distance":559,"@turf/helpers":562,"@turf/inside":563,"@turf/invariant":565,dup:315}],557:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"@turf/meta":558,dup:22}],558:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],559:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":560,"@turf/invariant":561,dup:8}],560:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],561:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],562:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],563:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{"@turf/invariant":564,dup:34}],564:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],565:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],566:[function(t,e,n){arguments[4][449][0].apply(n,arguments)},{"@turf/bearing":567,"@turf/destination":569,"@turf/distance":572,"@turf/helpers":575,"@turf/invariant":576,"@turf/line-intersect":577,"@turf/meta":589,dup:449}],567:[function(t,e,n){arguments[4][3][0].apply(n,arguments)},{"@turf/invariant":568,dup:3}],568:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],569:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{"@turf/helpers":570,"@turf/invariant":571,dup:5}],570:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],571:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],572:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":573,"@turf/invariant":574,dup:8}],573:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],574:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],575:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],576:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],577:[function(t,e,n){arguments[4][42][0].apply(n,arguments)},{"@turf/helpers":579,"@turf/invariant":580,"@turf/line-segment":581,"@turf/meta":585,dup:42,"geojson-rbush":586}],578:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{"@turf/meta":585,dup:43}],579:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],580:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],581:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{"@turf/helpers":582,"@turf/invariant":583,"@turf/meta":584,dup:46}],582:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],583:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],584:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],585:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],586:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{"@turf/bbox":578,"@turf/helpers":579,"@turf/meta":585,dup:51,rbush:588}],587:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],588:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53,quickselect:587}],589:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],590:[function(t,e,n){function i(t){"FeatureCollection"!==t.type&&("Feature"!==t.type&&(t={type:"Feature",geometry:t,properties:{}}),t=o([t]));for(var e=s(t),n=!1,i=0;!n&&i<t.features.length;){var c,h,f,p,d,g,v,y=t.features[i].geometry,m=!1;if("Point"===y.type)e.geometry.coordinates[0]===y.coordinates[0]&&e.geometry.coordinates[1]===y.coordinates[1]&&(n=!0);else if("MultiPoint"===y.type){var x=!1;for(v=0;!x&&v<y.coordinates.length;)e.geometry.coordinates[0]===y.coordinates[v][0]&&e.geometry.coordinates[1]===y.coordinates[v][1]&&(n=!0,x=!0),v++}else if("LineString"===y.type)for(v=0;!m&&v<y.coordinates.length-1;)c=e.geometry.coordinates[0],h=e.geometry.coordinates[1],f=y.coordinates[v][0],p=y.coordinates[v][1],d=y.coordinates[v+1][0],g=y.coordinates[v+1][1],r(c,h,f,p,d,g)&&(m=!0,n=!0),v++;else if("MultiLineString"===y.type)for(var E=0;E<y.coordinates.length;){m=!1,v=0;for(var w=y.coordinates[E];!m&&v<w.length-1;)c=e.geometry.coordinates[0],h=e.geometry.coordinates[1],f=w[v][0],p=w[v][1],d=w[v+1][0],g=w[v+1][1],r(c,h,f,p,d,g)&&(m=!0,n=!0),v++;E++}else if("Polygon"===y.type||"MultiPolygon"===y.type){var b={type:"Feature",geometry:y,properties:{}};u(e,b)&&(n=!0)}i++}if(n)return e;var I=o([]);for(i=0;i<t.features.length;i++)I.features=I.features.concat(l(t.features[i]).features);var N,C=1/0;for(i=0;i<I.features.length;i++){var S=a(e,I.features[i],"miles");S<C&&(C=S,N=I.features[i])}return N}function r(t,e,n,i,r,o){if(Math.sqrt((r-n)*(r-n)+(o-i)*(o-i))===Math.sqrt((t-n)*(t-n)+(e-i)*(e-i))+Math.sqrt((r-t)*(r-t)+(o-e)*(o-e)))return!0}var o=t("@turf/helpers").featureCollection,s=t("@turf/center"),a=t("@turf/distance"),u=t("@turf/inside"),l=t("@turf/explode");e.exports=i},{"@turf/center":591,"@turf/distance":595,"@turf/explode":598,"@turf/helpers":601,"@turf/inside":602}],591:[function(t,e,n){arguments[4][122][0].apply(n,arguments)},{"@turf/bbox":592,"@turf/helpers":594,dup:122}],592:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"@turf/meta":593,dup:22}],593:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],594:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],595:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":596,"@turf/invariant":597,dup:8}],596:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],597:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],598:[function(t,e,n){arguments[4][154][0].apply(n,arguments)},{"@turf/helpers":599,"@turf/meta":600,dup:154}],599:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],600:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],601:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],602:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{"@turf/invariant":603,dup:34}],603:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],604:[function(t,e,n){function i(t,e,n,i,a,u){for(var l=0;l<t.length;l++){var c=t[l],h=t[l+1];l===t.length-1&&(h=t[0]),i=s(c,h,e),n<=0&&i>0&&(o(e,c,a)||(a=c)),n>0&&i<=0&&(r(e,c,u)||(u=c)),n=i}return[a,u]}function r(t,e,n){return s(t,e,n)>=0}function o(t,e,n){return s(t,e,n)<=0}function s(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(n[0]-t[0])*(e[1]-t[1])}function a(t){return t.geometry?t.geometry.type:t.type}var u=t("@turf/invariant").getCoords,l=t("@turf/helpers"),c=l.featureCollection;e.exports=function(t,e){var n,r,o,h=u(t),f=u(e);switch(a(e)){case"Polygon":r=0,o=0,n=s(f[0][0],f[0][1],h);var p=i(f[0],h,n,void 0,r,o);r=p[0],o=p[1];break;case"MultiPolygon":r=0,o=0,n=s(f[0][0][0],f[0][0][1],h),f.forEach(function(t){var e=i(t[0],h,n,void 0,r,o);r=e[0],o=e[1]})}return c([l.point(r),l.point(o)])}},{"@turf/helpers":605,"@turf/invariant":606}],605:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],606:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],607:[function(t,e,n){arguments[4][54][0].apply(n,arguments)},{"@turf/helpers":608,"@turf/invariant":609,dup:54}],608:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],609:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],610:[function(t,e,n){var i=t("polygonize");e.exports=function(t){return i(t)}},{polygonize:622}],
611:[function(t,e,n){var i=t("@turf/helpers").polygon;e.exports=function(t){var e=[t[0],t[1]],n=[t[0],t[3]],r=[t[2],t[3]],o=[t[2],t[1]];return i([[e,o,r,n,e]])}},{"@turf/helpers":614}],612:[function(t,e,n){var i=t("@turf/meta").coordEach;e.exports=function(t){var e=[1/0,1/0,-1/0,-1/0];return i(t,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}},{"@turf/meta":617}],613:[function(t,e,n){var i=t("@turf/bbox"),r=t("@turf/bbox-polygon");e.exports=function(t){return r(i(t))}},{"@turf/bbox":612,"@turf/bbox-polygon":611}],614:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],615:[function(t,e,n){function i(t,e,n){var i=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var r=0,o=e.length-1;r<e.length;o=r++){var s=e[r][0],a=e[r][1],u=e[o][0],l=e[o][1];if(t[1]*(s-u)+a*(u-t[0])+l*(t[0]-s)==0&&(s-t[0])*(u-t[0])<=0&&(a-t[1])*(l-t[1])<=0)return!n;a>t[1]!=l>t[1]&&t[0]<(u-s)*(t[1]-a)/(l-a)+s&&(i=!i)}return i}function r(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}var o=t("@turf/invariant"),s=o.getCoord,a=o.getCoords;e.exports=function(t,e,n){if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var o=s(t),u=a(e),l=e.geometry?e.geometry.type:e.type,c=e.bbox;if(c&&!1===r(o,c))return!1;"Polygon"===l&&(u=[u]);for(var h=0,f=!1;h<u.length&&!f;h++)if(i(o,u[h][0],n)){for(var p=!1,d=1;d<u[h].length&&!p;)i(o,u[h][d],!n)&&(p=!0),d++;p||(f=!0)}return f}},{"@turf/invariant":616}],616:[function(t,e,n){arguments[4][350][0].apply(n,arguments)},{dup:350}],617:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],618:[function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=t("@turf/helpers"),s=o.lineString,a=t("./util"),u=a.orientationIndex,l=function(){function t(e,n){i(this,t),this.from=e,this.to=n,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return r(t,[{key:"getSymetric",value:function(){return this.symetric||(this.symetric=new t(this.to,this.from),this.symetric.symetric=this),this.symetric}}]),r(t,[{key:"deleteEdge",value:function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)}},{key:"isEqual",value:function(t){return this.from.id===t.from.id&&this.to.id===t.to.id}},{key:"toString",value:function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"}},{key:"toLineString",value:function(){return s([this.from.coordinates,this.to.coordinates])}},{key:"compareTo",value:function(t){return u(t.from.coordinates,t.to.coordinates,this.to.coordinates)}}]),t}();e.exports=l},{"./util":623,"@turf/helpers":614}],619:[function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=t("./util"),s=o.orientationIndex,a=o.envelopeIsEqual,u=o.envelopeContains,l=o.coordinatesEqual,c=t("@turf/helpers"),h=c.multiPoint,f=c.polygon,p=c.point,d=t("@turf/envelope"),g=t("@turf/inside"),v=function(){function t(){i(this,t),this.edges=[],this.polygon=void 0,this.envelope=void 0}return r(t,[{key:"push",value:function(t){this[this.edges.length]=t,this.edges.push(t),this.polygon=this.envelope=void 0}},{key:"get",value:function(t){return this.edges[t]}},{key:"forEach",value:function(t){this.edges.forEach(t)}},{key:"map",value:function(t){return this.edges.map(t)}},{key:"some",value:function(t){return this.edges.some(t)}},{key:"isValid",value:function(){return!0}},{key:"isHole",value:function(){var t=this,e=this.edges.reduce(function(e,n,i){return n.from.coordinates[1]>t.edges[e].from.coordinates[1]&&(e=i),e},0),n=(0===e?this.length:e)-1,i=(e+1)%this.length,r=s(this.edges[n].from.coordinates,this.edges[e].from.coordinates,this.edges[i].from.coordinates);return 0===r?this.edges[n].from.coordinates[0]>this.edges[i].from.coordinates[0]:r>0}},{key:"toMultiPoint",value:function(){return h(this.edges.map(function(t){return t.from.coordinates}))}},{key:"toPolygon",value:function(){if(this.polygon)return this.polygon;var t=this.edges.map(function(t){return t.from.coordinates});return t.push(this.edges[0].from.coordinates),this.polygon=f([t])}},{key:"getEnvelope",value:function(){return this.envelope?this.envelope:this.envelope=d(this.toPolygon())}},{key:"inside",value:function(t){return g(t,this.toPolygon())}},{key:"length",get:function(){return this.edges.length}}],[{key:"findEdgeRingContaining",value:function(t,e){var n=t.getEnvelope(),i=void 0,r=void 0;return e.forEach(function(e){var o=e.getEnvelope();if(r&&(i=r.getEnvelope()),!a(o,n)&&u(o,n)){var s=t.map(function(t){return t.from.coordinates}).find(function(t){return!e.some(function(e){return l(t,e.from.coordinates)})});s&&e.inside(p(s))&&(r&&!u(i,o)||(r=e))}}),r}}]),t}();e.exports=v},{"./util":623,"@turf/envelope":613,"@turf/helpers":614,"@turf/inside":615}],620:[function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t){if(!t)throw new Error("No geojson passed");if("FeatureCollection"!==t.type&&"GeometryCollection"!==t.type&&"MultiLineString"!==t.type&&"LineString"!==t.type&&"Feature"!==t.type)throw new Error("Invalid input type '"+t.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=t("./Node"),a=t("./Edge"),u=t("./EdgeRing"),l=t("@turf/meta"),c=l.flattenEach,h=l.coordReduce,f=t("@turf/invariant"),p=f.featureOf,d=function(){function t(){i(this,t),this.edges=[],this.nodes={}}return o(t,[{key:"getNode",value:function(t){var e=s.buildId(t),n=this.nodes[e];return n||(n=this.nodes[e]=new s(t)),n}},{key:"addEdge",value:function(t,e){var n=new a(t,e),i=n.getSymetric();this.edges.push(n),this.edges.push(i)}}],[{key:"fromGeoJson",value:function(e){r(e);var n=new t;return c(e,function(t){p(t,"LineString","Graph::fromGeoJson"),h(t,function(t,e){if(t){var i=n.getNode(t),r=n.getNode(e);n.addEdge(i,r)}return e})}),n}}]),o(t,[{key:"deleteDangles",value:function(){var t=this;Object.keys(this.nodes).map(function(e){return t.nodes[e]}).forEach(function(e){return t._removeIfDangle(e)})}},{key:"_removeIfDangle",value:function(t){var e=this;if(t.innerEdges.length<=1){var n=t.getOuterEdges().map(function(t){return t.to});this.removeNode(t),n.forEach(function(t){return e._removeIfDangle(t)})}}},{key:"deleteCutEdges",value:function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))})}},{key:"_computeNextCWEdges",value:function(t){var e=this;void 0===t?Object.keys(this.nodes).forEach(function(t){return e._computeNextCWEdges(e.nodes[t])}):t.getOuterEdges().forEach(function(e,n){t.getOuterEdge((0===n?t.getOuterEdges().length:n)-1).symetric.next=e})}},{key:"_computeNextCCWEdges",value:function(t,e){for(var n=t.getOuterEdges(),i=void 0,r=void 0,o=n.length-1;o>=0;--o){var s=n[o],a=s.symetric,u=void 0,l=void 0;s.label===e&&(u=s),a.label===e&&(l=a),u&&l&&(l&&(r=l),u&&(r&&(r.next=u,r=void 0),i||(i=u)))}r&&(r.next=i)}},{key:"_findLabeledEdgeRings",value:function(){var t=[],e=0;return this.edges.forEach(function(n){if(!(n.label>=0)){t.push(n);var i=n;do{i.label=e,i=i.next}while(!n.isEqual(i));e++}}),t}},{key:"getEdgeRings",value:function(){var t=this;this._computeNextCWEdges(),this.edges.forEach(function(t){t.label=void 0}),this._findLabeledEdgeRings().forEach(function(e){t._findIntersectionNodes(e).forEach(function(n){t._computeNextCCWEdges(n,e.label)})});var e=[];return this.edges.forEach(function(n){n.ring||e.push(t._findEdgeRing(n))}),e}},{key:"_findIntersectionNodes",value:function(t){var e=[],n=t;do{!function(){var i=0;n.from.getOuterEdges().forEach(function(e){e.label===t.label&&++i}),i>1&&e.push(n.from),n=n.next}()}while(!t.isEqual(n));return e}},{key:"_findEdgeRing",value:function(t){var e=t,n=new u;do{n.push(e),e.ring=n,e=e.next}while(!t.isEqual(e));return n}},{key:"removeNode",value:function(t){var e=this;t.getOuterEdges().forEach(function(t){return e.removeEdge(t)}),t.innerEdges.forEach(function(t){return e.removeEdge(t)}),delete this.nodes[t.id]}},{key:"removeEdge",value:function(t){this.edges=this.edges.filter(function(e){return!e.isEqual(t)}),t.deleteEdge()}}]),t}();e.exports=d},{"./Edge":618,"./EdgeRing":619,"./Node":621,"@turf/invariant":616,"@turf/meta":617}],621:[function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=t("./util"),s=o.orientationIndex,a=function(){function t(e){i(this,t),this.id=t.buildId(e),this.coordinates=e,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return r(t,null,[{key:"buildId",value:function(t){return t.join(",")}}]),r(t,[{key:"removeInnerEdge",value:function(t){this.innerEdges=this.innerEdges.filter(function(e){return e.from.id!==t.from.id})}},{key:"removeOuterEdge",value:function(t){this.outerEdges=this.outerEdges.filter(function(e){return e.to.id!==t.to.id})}},{key:"addOuterEdge",value:function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1}},{key:"sortOuterEdges",value:function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort(function(e,n){var i=e.to,r=n.to;if(i.coordinates[0]-t.coordinates[0]>=0&&r.coordinates[0]-t.coordinates[0]<0)return 1;if(i.coordinates[0]-t.coordinates[0]<0&&r.coordinates[0]-t.coordinates[0]>=0)return-1;if(i.coordinates[0]-t.coordinates[0]==0&&r.coordinates[0]-t.coordinates[0]==0)return i.coordinates[1]-t.coordinates[1]>=0||r.coordinates[1]-t.coordinates[1]>=0?i.coordinates[1]-r.coordinates[1]:r.coordinates[1]-i.coordinates[1];var o=s(t.coordinates,i.coordinates,r.coordinates);return o<0?1:o>0?-1:Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2)-(Math.pow(r.coordinates[0]-t.coordinates[0],2)+Math.pow(r.coordinates[1]-t.coordinates[1],2))}),this.outerEdgesSorted=!0)}},{key:"getOuterEdges",value:function(){return this.sortOuterEdges(),this.outerEdges}},{key:"getOuterEdge",value:function(t){return this.sortOuterEdges(),this.outerEdges[t]}},{key:"addInnerEdge",value:function(t){this.innerEdges.push(t)}}]),t}();e.exports=a},{"./util":623}],622:[function(t,e,n){"use strict";var i=t("./Graph"),r=t("./EdgeRing"),o=t("@turf/helpers"),s=o.featureCollection;e.exports=function(t){var e=i.fromGeoJson(t);e.deleteDangles(),e.deleteCutEdges();var n=[],o=[];return e.getEdgeRings().filter(function(t){return t.isValid()}).forEach(function(t){t.isHole()?n.push(t):o.push(t)}),n.forEach(function(t){r.findEdgeRingContaining(t,o)&&o.push(t)}),s(o.map(function(t){return t.toPolygon()}))}},{"./EdgeRing":619,"./Graph":620,"@turf/helpers":614}],623:[function(t,e,n){"use strict";function i(t,e,n){var i=e[0]-t[0],r=e[1]-t[1],o=n[0]-e[0],s=n[1]-e[1];return Math.sign(i*s-o*r)}function r(t,e){var n=t.geometry.coordinates.map(function(t){return t[0]}),i=t.geometry.coordinates.map(function(t){return t[1]}),r=e.geometry.coordinates.map(function(t){return t[0]}),o=e.geometry.coordinates.map(function(t){return t[1]});return Math.max(null,n)===Math.max(null,r)&&Math.max(null,i)===Math.max(null,o)&&Math.min(null,n)===Math.min(null,r)&&Math.min(null,i)===Math.min(null,o)}function o(t,e){return e.geometry.coordinates[0].every(function(e){return a(l(e),t)})}function s(t,e){return t[0]===e[0]&&t[1]===e[1]}var a=t("@turf/inside"),u=t("@turf/helpers"),l=u.point;e.exports={orientationIndex:i,envelopeIsEqual:r,envelopeContains:o,coordinatesEqual:s}},{"@turf/helpers":614,"@turf/inside":615}],624:[function(t,e,n){var i=t("geojson-random");e.exports=function(t,e,n){switch(n=n||{},e=e||1,t){case"point":case"points":case void 0:return i.point(e,n.bbox);case"polygon":case"polygons":return i.polygon(e,n.num_vertices,n.max_radial_length,n.bbox);default:throw new Error("Unknown type given: valid options are points and polygons")}}},{"geojson-random":625}],625:[function(t,e,n){function r(t){return t?c(t):[a(),u()]}function o(t){return function(e,n){return[e[0]+t[0],e[1]+t[1]]}}function s(){return Math.random()-.5}function a(){return 360*s()}function u(){return 180*s()}function l(t){return{type:"Point",coordinates:t||[a(),u()]}}function c(t){return[Math.random()*(t[2]-t[0])+t[0],Math.random()*(t[3]-t[1])+t[1]]}function h(t){return{type:"Polygon",coordinates:t}}function f(t){return{type:"Feature",geometry:t,properties:{}}}function p(t){return{type:"FeatureCollection",features:t}}e.exports=function(){throw new Error("call .point() or .polygon() instead")},e.exports.position=r,e.exports.point=function(t,e){var n=[];for(i=0;i<t;i++)n.push(f(e?l(r(e)):l()));return p(n)},e.exports.polygon=function(t,e,n,s){function a(t,e,n){n[e]=e>0?t+n[e-1]:t}function u(t,e){t=2*t*Math.PI/d[d.length-1];var i=Math.random();c.push([i*n*Math.sin(t),i*n*Math.cos(t)])}"number"!=typeof e&&(e=10),"number"!=typeof n&&(n=10);var l=[];for(i=0;i<t;i++){var c=[],d=Array.apply(null,new Array(e+1)).map(Math.random);d.forEach(a),d.forEach(u),c[c.length-1]=c[0],c=c.map(o(r(s))),l.push(f(h([c])))}return p(l)}},{}],626:[function(t,e,n){function i(t,e){switch("Feature"===t.type?t.geometry.type:t.type){case"GeometryCollection":return c(t,function(t){i(t,e)}),t;case"LineString":return r(a(t),e),t;case"Polygon":return o(a(t),e),t;case"MultiLineString":return a(t).forEach(function(t){r(t,e)}),t;case"MultiPolygon":return a(t).forEach(function(t){o(t,e)}),t;case"Point":case"MultiPoint":return t}}function r(t,e){u(t)===e&&t.reverse()}function o(t,e){u(t[0])!==e&&t[0].reverse();for(var n=1;n<t.length;n++)u(t[n])===e&&t[n].reverse()}var s=t("@turf/meta"),a=t("@turf/invariant").getCoords,u=t("turf-is-clockwise"),l=t("@turf/helpers").featureCollection,c=s.geomEach,h=s.featureEach;e.exports=function(t,e,n){if(e=void 0!==e&&e,n=void 0!==n&&n,!t)throw new Error("<geojson> is required");if("boolean"!=typeof e)throw new Error("<reverse> must be a boolean");if("boolean"!=typeof n)throw new Error("<mutate> must be a boolean");!1!==n&&void 0!==n||(t=JSON.parse(JSON.stringify(t)));var r=[];switch(t.type){case"GeometryCollection":return c(t,function(t){i(t,e)}),t;case"FeatureCollection":return h(t,function(t){h(i(t,e),function(t){r.push(t)})}),l(r)}return i(t,e)}},{"@turf/helpers":627,"@turf/invariant":628,"@turf/meta":629,"turf-is-clockwise":630}],627:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],628:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],629:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],630:[function(t,e,n){arguments[4][254][0].apply(n,arguments)},{dup:254}],631:[function(t,e,n){var i=t("@turf/invariant").getCoord,r=t("geodesy").LatLonSpherical;e.exports=function(t,e,n){if(!t)throw new Error("start point is required");if(!e)throw new Error("end point is required");var o,s=i(t),a=i(e),u=new r(s[1],s[0]),l=new r(a[1],a[0]);return o=n?l.rhumbBearingTo(u):u.rhumbBearingTo(l),o>180?-(360-o):o}},{"@turf/invariant":632,geodesy:639}],632:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],633:[function(t,e,n){"use strict";var i={};i.parseDMS=function(t){if("number"==typeof t&&isFinite(t))return Number(t);var e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;var n;switch(e.length){case 3:n=e[0]/1+e[1]/60+e[2]/3600;break;case 2:n=e[0]/1+e[1]/60;break;case 1:n=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(n=-n),Number(n)},i.separator="",i.toDMS=function(t,e,n){if(isNaN(t))return null;if(void 0===e&&(e="dms"),void 0===n)switch(e){case"d":case"deg":n=4;break;case"dm":case"deg+min":n=2;break;case"dms":case"deg+min+sec":n=0;break;default:e="dms",n=0}t=Math.abs(t);var r,o,s,a;switch(e){default:case"d":case"deg":o=t.toFixed(n),o<100&&(o="0"+o),o<10&&(o="0"+o),r=o+"°";break;case"dm":case"deg+min":var u=(60*t).toFixed(n);o=Math.floor(u/60),s=(u%60).toFixed(n),o<100&&(o="0"+o),o<10&&(o="0"+o),s<10&&(s="0"+s),r=o+"°"+i.separator+s+"";break;case"dms":case"deg+min+sec":var l=(3600*t).toFixed(n);o=Math.floor(l/3600),s=Math.floor(l/60)%60,a=(l%60).toFixed(n),o<100&&(o="0"+o),o<10&&(o="0"+o),s<10&&(s="0"+s),a<10&&(a="0"+a),r=o+"°"+i.separator+s+""+i.separator+a+"″"}return r},i.toLat=function(t,e,n){var r=i.toDMS(t,e,n);return null===r?"":r.slice(1)+i.separator+(t<0?"S":"N")},i.toLon=function(t,e,n){var r=i.toDMS(t,e,n);return null===r?"":r+i.separator+(t<0?"W":"E")},i.toBrng=function(t,e,n){t=(Number(t)+360)%360;var r=i.toDMS(t,e,n);return null===r?"":r.replace("360","0")},i.compassPoint=function(t,e){void 0===e&&(e=3),t=(t%360+360)%360;var n;switch(e){case 1:switch(Math.round(4*t/360)%4){case 0:n="N";break;case 1:n="E";break;case 2:n="S";break;case 3:n="W"}break;case 2:switch(Math.round(8*t/360)%8){case 0:n="N";break;case 1:n="NE";break;case 2:n="E";break;case 3:n="SE";break;case 4:n="S";break;case 5:n="SW";break;case 6:n="W";break;case 7:n="NW"}break;case 3:switch(Math.round(16*t/360)%16){case 0:n="N";break;case 1:n="NNE";break;case 2:n="NE";break;case 3:n="ENE";break;case 4:n="E";break;case 5:n="ESE";break;case 6:n="SE";break;case 7:n="SSE";break;case 8:n="S";break;case 9:n="SSW";break;case 10:n="SW";break;case 11:n="WSW";break;case 12:n="W";break;case 13:n="WNW";break;case 14:n="NW";break;case 15:n="NNW"}break;default:throw new RangeError("Precision must be between 1 and 3")}return n},void 0===String.prototype.trim&&(String.prototype.trim=function(){return String(this).replace(/^\s\s*/,"").replace(/\s\s*$/,"")}),void 0!==e&&e.exports&&(e.exports=i)},{}],634:[function(t,e,n){"use strict";function i(t,e,n){if(!(this instanceof i))return new i(t,e,n);void 0===n&&(n=i.datum.WGS84),this.lat=Number(t),this.lon=Number(e),this.datum=n}if(void 0!==e&&e.exports)var r=t("./vector3d.js");if(void 0!==e&&e.exports)var o=t("./dms.js");i.ellipsoid={WGS84:{a:6378137,b:6356752.31425,f:1/298.257223563},GRS80:{a:6378137,b:6356752.31414,f:1/298.257222101},Airy1830:{a:6377563.396,b:6356256.909,f:1/299.3249646},AiryModified:{a:6377340.189,b:6356034.448,f:1/299.3249646},Intl1924:{a:6378388,b:6356911.946,f:1/297},Bessel1841:{a:6377397.155,b:6356078.963,f:1/299.152815351}},i.datum={WGS84:{ellipsoid:i.ellipsoid.WGS84,transform:{tx:0,ty:0,tz:0,rx:0,ry:0,rz:0,s:0}},ITRF90:{ellipsoid:i.ellipsoid.GRS80,transform:{tx:-.06,ty:.517,tz:.223,rx:-.0183,ry:3e-4,rz:-.007,s:.011}},NAD83:{ellipsoid:i.ellipsoid.GRS80,transform:{tx:1.004,ty:-1.91,tz:-.515,rx:.0267,ry:34e-5,rz:.011,s:-.0015}},OSGB36:{ellipsoid:i.ellipsoid.Airy1830,transform:{tx:-446.448,ty:125.157,tz:-542.06,rx:-.1502,ry:-.247,rz:-.8421,s:20.4894}},ED50:{ellipsoid:i.ellipsoid.Intl1924,transform:{tx:89.5,ty:93.8,tz:123.1,rx:0,ry:0,rz:.156,s:-1.2}},Irl1975:{ellipsoid:i.ellipsoid.AiryModified,transform:{tx:-482.53,ty:130.596,tz:-564.557,rx:-1.042,ry:-.214,rz:-.631,s:-8.15}},TokyoJapan:{ellipsoid:i.ellipsoid.Bessel1841,transform:{tx:148,ty:-507,tz:-685,rx:0,ry:0,rz:0,s:0}}},i.prototype.convertDatum=function(t){var e,n=this;if(n.datum==i.datum.WGS84&&(e=t.transform),t==i.datum.WGS84){e={};for(var r in n.datum.transform)n.datum.transform.hasOwnProperty(r)&&(e[r]=-n.datum.transform[r])}return void 0===e&&(n=this.convertDatum(i.datum.WGS84),e=t.transform),n.toCartesian().applyTransform(e).toLatLonE(t)},i.prototype.toCartesian=function(){var t=this.lat.toRadians(),e=this.lon.toRadians(),n=this.datum.ellipsoid.a,i=this.datum.ellipsoid.f,o=Math.sin(t),s=Math.cos(t),a=Math.sin(e),u=Math.cos(e),l=2*i-i*i,c=n/Math.sqrt(1-l*o*o);return new r((c+0)*s*u,(c+0)*s*a,(c*(1-l)+0)*o)},r.prototype.toLatLonE=function(t){var e=this.x,n=this.y,r=this.z,o=t.ellipsoid.a,s=t.ellipsoid.b,a=t.ellipsoid.f,u=2*a-a*a,l=u/(1-u),c=Math.sqrt(e*e+n*n),h=Math.sqrt(c*c+r*r),f=s*r/(o*c)*(1+l*s/h),p=f/Math.sqrt(1+f*f),d=p/f,g=isNaN(d)?0:Math.atan2(r+l*s*p*p*p,c-u*o*d*d*d),v=Math.atan2(n,e),y=Math.sin(g);Math.cos(g),Math.sqrt(1-u*y*y);return new i(g.toDegrees(),v.toDegrees(),t)},r.prototype.applyTransform=function(t){var e=this.x,n=this.y,i=this.z,o=t.tx,s=t.ty,a=t.tz,u=(t.rx/3600).toRadians(),l=(t.ry/3600).toRadians(),c=(t.rz/3600).toRadians(),h=t.s/1e6+1;return new r(o+e*h-n*c+i*l,s+e*c+n*h-i*u,a-e*l+n*u+i*h)},i.prototype.toString=function(t,e){return o.toLat(this.lat,t,e)+", "+o.toLon(this.lon,t,e)},void 0===Number.prototype.toRadians&&(Number.prototype.toRadians=function(){return this*Math.PI/180}),void 0===Number.prototype.toDegrees&&(Number.prototype.toDegrees=function(){return 180*this/Math.PI}),void 0!==e&&e.exports&&(e.exports=i,e.exports.Vector3d=r)},{"./dms.js":633,"./vector3d.js":642}],635:[function(t,e,n){"use strict";function i(t,e){if(!(this instanceof i))return new i(t,e);this.lat=Number(t),this.lon=Number(e)}if(void 0!==e&&e.exports)var r=t("./dms");i.prototype.distanceTo=function(t,e){if(!(t instanceof i))throw new TypeError("point is not LatLon object");e=void 0===e?6371e3:Number(e);var n=e,r=this.lat.toRadians(),o=this.lon.toRadians(),s=t.lat.toRadians(),a=t.lon.toRadians(),u=s-r,l=a-o,c=Math.sin(u/2)*Math.sin(u/2)+Math.cos(r)*Math.cos(s)*Math.sin(l/2)*Math.sin(l/2);return n*(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)))},i.prototype.bearingTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");var e=this.lat.toRadians(),n=t.lat.toRadians(),r=(t.lon-this.lon).toRadians(),o=Math.sin(r)*Math.cos(n),s=Math.cos(e)*Math.sin(n)-Math.sin(e)*Math.cos(n)*Math.cos(r);return(Math.atan2(o,s).toDegrees()+360)%360},i.prototype.finalBearingTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");return(t.bearingTo(this)+180)%360},i.prototype.midpointTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");var e=this.lat.toRadians(),n=this.lon.toRadians(),r=t.lat.toRadians(),o=(t.lon-this.lon).toRadians(),s=Math.cos(r)*Math.cos(o),a=Math.cos(r)*Math.sin(o),u=Math.sqrt((Math.cos(e)+s)*(Math.cos(e)+s)+a*a),l=Math.sin(e)+Math.sin(r),c=Math.atan2(l,u),h=n+Math.atan2(a,Math.cos(e)+s);return new i(c.toDegrees(),(h.toDegrees()+540)%360-180)},i.prototype.intermediatePointTo=function(t,e){if(!(t instanceof i))throw new TypeError("point is not LatLon object");var n=this.lat.toRadians(),r=this.lon.toRadians(),o=t.lat.toRadians(),s=t.lon.toRadians(),a=Math.sin(n),u=Math.cos(n),l=Math.sin(r),c=Math.cos(r),h=Math.sin(o),f=Math.cos(o),p=Math.sin(s),d=Math.cos(s),g=o-n,v=s-r,y=Math.sin(g/2)*Math.sin(g/2)+Math.cos(n)*Math.cos(o)*Math.sin(v/2)*Math.sin(v/2),m=2*Math.atan2(Math.sqrt(y),Math.sqrt(1-y)),x=Math.sin((1-e)*m)/Math.sin(m),E=Math.sin(e*m)/Math.sin(m),w=x*u*c+E*f*d,b=x*u*l+E*f*p,I=x*a+E*h,N=Math.atan2(I,Math.sqrt(w*w+b*b)),C=Math.atan2(b,w);return new i(N.toDegrees(),(C.toDegrees()+540)%360-180)},i.prototype.destinationPoint=function(t,e,n){n=void 0===n?6371e3:Number(n);var r=Number(t)/n,o=Number(e).toRadians(),s=this.lat.toRadians(),a=this.lon.toRadians(),u=Math.sin(s),l=Math.cos(s),c=Math.sin(r),h=Math.cos(r),f=Math.sin(o),p=Math.cos(o),d=u*h+l*c*p,g=Math.asin(d),v=f*c*l,y=h-u*d,m=a+Math.atan2(v,y);return new i(g.toDegrees(),(m.toDegrees()+540)%360-180)},i.intersection=function(t,e,n,r){if(!(t instanceof i))throw new TypeError("p1 is not LatLon object");if(!(n instanceof i))throw new TypeError("p2 is not LatLon object");var o=t.lat.toRadians(),s=t.lon.toRadians(),a=n.lat.toRadians(),u=n.lon.toRadians(),l=Number(e).toRadians(),c=Number(r).toRadians(),h=a-o,f=u-s,p=2*Math.asin(Math.sqrt(Math.sin(h/2)*Math.sin(h/2)+Math.cos(o)*Math.cos(a)*Math.sin(f/2)*Math.sin(f/2)));if(0==p)return null;var d=Math.acos((Math.sin(a)-Math.sin(o)*Math.cos(p))/(Math.sin(p)*Math.cos(o)));isNaN(d)&&(d=0);var g=Math.acos((Math.sin(o)-Math.sin(a)*Math.cos(p))/(Math.sin(p)*Math.cos(a))),v=Math.sin(u-s)>0?d:2*Math.PI-d,y=Math.sin(u-s)>0?2*Math.PI-g:g,m=(l-v+Math.PI)%(2*Math.PI)-Math.PI,x=(y-c+Math.PI)%(2*Math.PI)-Math.PI;if(0==Math.sin(m)&&0==Math.sin(x))return null;if(Math.sin(m)*Math.sin(x)<0)return null;var E=Math.acos(-Math.cos(m)*Math.cos(x)+Math.sin(m)*Math.sin(x)*Math.cos(p)),w=Math.atan2(Math.sin(p)*Math.sin(m)*Math.sin(x),Math.cos(x)+Math.cos(m)*Math.cos(E)),b=Math.asin(Math.sin(o)*Math.cos(w)+Math.cos(o)*Math.sin(w)*Math.cos(l)),I=Math.atan2(Math.sin(l)*Math.sin(w)*Math.cos(o),Math.cos(w)-Math.sin(o)*Math.sin(b)),N=s+I;return new i(b.toDegrees(),(N.toDegrees()+540)%360-180)},i.prototype.crossTrackDistanceTo=function(t,e,n){if(!(t instanceof i))throw new TypeError("pathStart is not LatLon object");if(!(e instanceof i))throw new TypeError("pathEnd is not LatLon object");n=void 0===n?6371e3:Number(n);var r=t.distanceTo(this,n)/n,o=t.bearingTo(this).toRadians(),s=t.bearingTo(e).toRadians();return Math.asin(Math.sin(r)*Math.sin(o-s))*n},i.prototype.maxLatitude=function(t){var e=Number(t).toRadians(),n=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(e)*Math.cos(n))).toDegrees()},i.crossingParallels=function(t,e,n){var i=Number(n).toRadians(),r=t.lat.toRadians(),o=t.lon.toRadians(),s=e.lat.toRadians(),a=e.lon.toRadians(),u=a-o,l=Math.sin(r)*Math.cos(s)*Math.cos(i)*Math.sin(u),c=Math.sin(r)*Math.cos(s)*Math.cos(i)*Math.cos(u)-Math.cos(r)*Math.sin(s)*Math.cos(i),h=Math.cos(r)*Math.cos(s)*Math.sin(i)*Math.sin(u);if(h*h>l*l+c*c)return null;var f=Math.atan2(-c,l),p=Math.acos(h/Math.sqrt(l*l+c*c)),d=o+f-p,g=o+f+p;return{lon1:(d.toDegrees()+540)%360-180,lon2:(g.toDegrees()+540)%360-180}},i.prototype.rhumbDistanceTo=function(t,e){if(!(t instanceof i))throw new TypeError("point is not LatLon object");e=void 0===e?6371e3:Number(e);var n=e,r=this.lat.toRadians(),o=t.lat.toRadians(),s=o-r,a=Math.abs(t.lon-this.lon).toRadians();Math.abs(a)>Math.PI&&(a=a>0?-(2*Math.PI-a):2*Math.PI+a);var u=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(r/2+Math.PI/4)),l=Math.abs(u)>1e-11?s/u:Math.cos(r);return Math.sqrt(s*s+l*l*a*a)*n},i.prototype.rhumbBearingTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");var e=this.lat.toRadians(),n=t.lat.toRadians(),r=(t.lon-this.lon).toRadians();Math.abs(r)>Math.PI&&(r=r>0?-(2*Math.PI-r):2*Math.PI+r);var o=Math.log(Math.tan(n/2+Math.PI/4)/Math.tan(e/2+Math.PI/4));return(Math.atan2(r,o).toDegrees()+360)%360},i.prototype.rhumbDestinationPoint=function(t,e,n){n=void 0===n?6371e3:Number(n);var r=Number(t)/n,o=this.lat.toRadians(),s=this.lon.toRadians(),a=Number(e).toRadians(),u=r*Math.cos(a),l=o+u;Math.abs(l)>Math.PI/2&&(l=l>0?Math.PI-l:-Math.PI-l);var c=Math.log(Math.tan(l/2+Math.PI/4)/Math.tan(o/2+Math.PI/4)),h=Math.abs(c)>1e-11?u/c:Math.cos(o),f=r*Math.sin(a)/h,p=s+f;return new i(l.toDegrees(),(p.toDegrees()+540)%360-180)},i.prototype.rhumbMidpointTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");var e=this.lat.toRadians(),n=this.lon.toRadians(),r=t.lat.toRadians(),o=t.lon.toRadians();Math.abs(o-n)>Math.PI&&(n+=2*Math.PI);var s=(e+r)/2,a=Math.tan(Math.PI/4+e/2),u=Math.tan(Math.PI/4+r/2),l=Math.tan(Math.PI/4+s/2),c=((o-n)*Math.log(l)+n*Math.log(u)-o*Math.log(a))/Math.log(u/a);return isFinite(c)||(c=(n+o)/2),i(s.toDegrees(),(c.toDegrees()+540)%360-180)},i.areaOf=function(t,e){var n=void 0===e?6371e3:Number(e),i=t[0].equals(t[t.length-1]);i||t.push(t[0]);for(var r=t.length-1,o=0,s=0;s<r;s++){var a=t[s].lat.toRadians(),u=t[s+1].lat.toRadians(),l=(t[s+1].lon-t[s].lon).toRadians();o+=2*Math.atan2(Math.tan(l/2)*(Math.tan(a/2)+Math.tan(u/2)),1+Math.tan(a/2)*Math.tan(u/2))}(function(t){for(var e=0,n=t[0].bearingTo(t[1]),i=0;i<t.length-1;i++){var r=t[i].bearingTo(t[i+1]),o=t[i].finalBearingTo(t[i+1]);e+=(r-n+540)%360-180,e+=(o-r+540)%360-180,n=o}var r=t[0].bearingTo(t[1]);return e+=(r-n+540)%360-180,Math.abs(e)<90})(t)&&(o=Math.abs(o)-2*Math.PI);var c=Math.abs(o*n*n);return i||t.pop(),c},i.prototype.equals=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");return this.lat==t.lat&&this.lon==t.lon},i.prototype.toString=function(t,e){return r.toLat(this.lat,t,e)+", "+r.toLon(this.lon,t,e)},void 0===Number.prototype.toRadians&&(Number.prototype.toRadians=function(){return this*Math.PI/180}),void 0===Number.prototype.toDegrees&&(Number.prototype.toDegrees=function(){return 180*this/Math.PI}),void 0!==e&&e.exports&&(e.exports=i)},{"./dms":633}],636:[function(t,e,n){"use strict";function i(t,e){if(!(this instanceof i))return new i(t,e);this.lat=Number(t),this.lon=Number(e)}if(void 0!==e&&e.exports)var r=t("./vector3d.js");if(void 0!==e&&e.exports)var o=t("./dms.js");i.prototype.toVector=function(){var t=this.lat.toRadians(),e=this.lon.toRadians(),n=Math.cos(t)*Math.cos(e),i=Math.cos(t)*Math.sin(e),o=Math.sin(t);return new r(n,i,o)},r.prototype.toLatLonS=function(){var t=Math.atan2(this.z,Math.sqrt(this.x*this.x+this.y*this.y)),e=Math.atan2(this.y,this.x);return new i(t.toDegrees(),e.toDegrees())},i.prototype.greatCircle=function(t){var e=this.lat.toRadians(),n=this.lon.toRadians(),i=Number(t).toRadians(),o=Math.sin(n)*Math.cos(i)-Math.sin(e)*Math.cos(n)*Math.sin(i),s=-Math.cos(n)*Math.cos(i)-Math.sin(e)*Math.sin(n)*Math.sin(i),a=Math.cos(e)*Math.sin(i);return new r(o,s,a)},r.prototype.greatCircle=function(t){var e=Number(t).toRadians(),n=new r(0,0,1),i=n.cross(this),o=this.cross(i),s=i.times(Math.cos(e)/i.length());return o.times(Math.sin(e)/o.length()).minus(s)},i.prototype.distanceTo=function(t,e){if(!(t instanceof i))throw new TypeError("point is not LatLon object");e=void 0===e?6371e3:Number(e);var n=this.toVector(),r=t.toVector();return n.angleTo(r)*e},i.prototype.bearingTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");var e=this.toVector(),n=t.toVector(),o=new r(0,0,1),s=e.cross(n),a=e.cross(o);return(s.angleTo(a,e).toDegrees()+360)%360},i.prototype.midpointTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");var e=this.toVector(),n=t.toVector();return e.plus(n).unit().toLatLonS()},i.prototype.destinationPoint=function(t,e,n){n=void 0===n?6371e3:Number(n);var i=this.toVector(),o=Number(t)/n,s=Number(e).toRadians(),a=new r(0,0,1),u=a.cross(i).unit(),l=i.cross(u),c=u.times(Math.sin(s)),h=l.times(Math.cos(s)),f=h.plus(c),p=i.times(Math.cos(o)),d=f.times(Math.sin(o));return p.plus(d).toLatLonS()},i.intersection=function(t,e,n,r){if(!(t instanceof i))throw new TypeError("path1start is not LatLon object");if(!(n instanceof i))throw new TypeError("path2start is not LatLon object");if(!(e instanceof i)&&isNaN(e))throw new TypeError("path1brngEnd is not LatLon object or bearing");if(!(r instanceof i)&&isNaN(r))throw new TypeError("path2brngEnd is not LatLon object or bearing");var o,s,a,u,l=t.toVector(),c=n.toVector();e instanceof i?(o=l.cross(e.toVector()),a="endpoint"):(o=t.greatCircle(Number(e)),a="bearing"),r instanceof i?(s=c.cross(r.toVector()),u="endpoint"):(s=n.greatCircle(Number(r)),u="bearing");var h=o.cross(s),f=s.cross(o),p=null,d=null,g=null;switch(a+"+"+u){case"bearing+bearing":switch(d=Math.sign(o.cross(l).dot(h)),g=Math.sign(s.cross(c).dot(h)),d+g){case 2:p=h;break;case-2:p=f;break;case 0:p=l.plus(c).dot(h)>0?f:h}break;case"bearing+endpoint":d=Math.sign(o.cross(l).dot(h)),p=d>0?h:f;break;case"endpoint+bearing":
g=Math.sign(s.cross(c).dot(h)),p=g>0?h:f;break;case"endpoint+endpoint":p=l.plus(c).plus(e.toVector()).plus(r.toVector()).dot(h)>0?h:f}return p.toLatLonS()},i.prototype.crossTrackDistanceTo=function(t,e,n){if(!(t instanceof i))throw new TypeError("pathStart is not LatLon object");var r=void 0===n?6371e3:Number(n),o=this.toVector();return((e instanceof i?t.toVector().cross(e.toVector()):t.greatCircle(Number(e))).angleTo(o)-Math.PI/2)*r},i.prototype.nearestPointOnSegment=function(t,e){var n=null;if(this.isBetween(t,e)){var i=this.toVector(),r=t.toVector(),o=e.toVector(),s=r.cross(o),a=i.cross(s);n=s.cross(a).toLatLonS()}else{n=this.distanceTo(t)<this.distanceTo(e)?t:e}return n},i.prototype.isBetween=function(t,e){var n=this.toVector(),i=t.toVector(),r=e.toVector(),o=n.minus(i),s=r.minus(i),a=n.minus(r),u=i.minus(r),l=o.dot(s),c=a.dot(u);return l>=0&&c>=0},i.prototype.enclosedBy=function(t){var e=t[0].equals(t[t.length-1]);e||t.push(t[0]);for(var n=t.length-1,i=this.toVector(),r=[],o=0;o<n;o++)r[o]=i.minus(t[o].toVector());r.push(r[0]);for(var s=0,o=0;o<n;o++)s+=r[o].angleTo(r[o+1],i);var a=Math.abs(s)>Math.PI;return e||t.pop(),a},i.areaOf=function(t,e){var n=void 0===e?6371e3:Number(e);t[0].equals(t[t.length-1])||t.push(t[0]);var i=t.length-1;console.log("n",i);for(var r=[],o=0;o<i;o++){var s=t[o].toVector(),a=t[o+1].toVector();r[o]=s.cross(a)}console.log("c",r.length,r),r.push(r[0]);for(var u=0,o=0;o<i;o++)console.log(o,(Math.PI-r[o].angleTo(r[o+1])).toDegrees()),u+=Math.PI-r[o].angleTo(r[o+1]);return console.log("Σθ",u.toDegrees(),((i-2)*Math.PI).toDegrees()),(u-(i-2)*Math.PI)*n*n},i.meanOf=function(t){for(var e=new r(0,0,0),n=0;n<t.length;n++)e=e.plus(t[n].toVector());return e.unit().toLatLonS()},i.prototype.equals=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");return this.lat==t.lat&&this.lon==t.lon},i.prototype.toString=function(t,e){return o.toLat(this.lat,t,e)+", "+o.toLon(this.lon,t,e)},void 0===Number.prototype.toRadians&&(Number.prototype.toRadians=function(){return this*Math.PI/180}),void 0===Number.prototype.toDegrees&&(Number.prototype.toDegrees=function(){return 180*this/Math.PI}),void 0===Math.sign&&(Math.sign=function(t){return t=+t,0===t||isNaN(t)?t:t>0?1:-1}),void 0!==e&&e.exports&&(e.exports=i,e.exports.Vector3d=r)},{"./dms.js":633,"./vector3d.js":642}],637:[function(t,e,n){"use strict";if(void 0!==e&&e.exports)var i=t("./latlon-ellipsoidal.js");i.prototype.distanceTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");try{return this.inverse(t).distance}catch(t){return NaN}},i.prototype.initialBearingTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");try{return this.inverse(t).initialBearing}catch(t){return NaN}},i.prototype.finalBearingTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");try{return this.inverse(t).finalBearing}catch(t){return NaN}},i.prototype.destinationPoint=function(t,e){return this.direct(Number(t),Number(e)).point},i.prototype.finalBearingOn=function(t,e){return this.direct(Number(t),Number(e)).finalBearing},i.prototype.direct=function(t,e){var n,r,o,s,a,u=this.lat.toRadians(),l=this.lon.toRadians(),c=e.toRadians(),h=t,f=this.datum.ellipsoid.a,p=this.datum.ellipsoid.b,d=this.datum.ellipsoid.f,g=Math.sin(c),v=Math.cos(c),y=(1-d)*Math.tan(u),m=1/Math.sqrt(1+y*y),x=y*m,E=Math.atan2(y,v),w=m*g,b=1-w*w,I=b*(f*f-p*p)/(p*p),N=1+I/16384*(4096+I*(I*(320-175*I)-768)),C=I/1024*(256+I*(I*(74-47*I)-128)),S=h/(p*N),M=0;do{n=Math.cos(2*E+S),r=Math.sin(S),o=Math.cos(S),s=C*r*(n+C/4*(o*(2*n*n-1)-C/6*n*(4*r*r-3)*(4*n*n-3))),a=S,S=h/(p*N)+s}while(Math.abs(S-a)>1e-12&&++M<200);if(M>=200)throw new Error("Formula failed to converge");var L=x*r-m*o*v,R=Math.atan2(x*o+m*r*v,(1-d)*Math.sqrt(w*w+L*L)),P=Math.atan2(r*g,m*o-x*r*v),T=d/16*b*(4+d*(4-3*b)),O=P-(1-T)*d*w*(S+T*r*(n+T*o*(2*n*n-1))),_=(l+O+3*Math.PI)%(2*Math.PI)-Math.PI,A=Math.atan2(w,-L);return A=(A+2*Math.PI)%(2*Math.PI),{point:new i(R.toDegrees(),_.toDegrees(),this.datum),finalBearing:A.toDegrees()}},i.prototype.inverse=function(t){var e,n,i,r,o,s,a,u,l,c,h,f=this,p=t,d=f.lat.toRadians(),g=f.lon.toRadians(),v=p.lat.toRadians(),y=p.lon.toRadians(),m=this.datum.ellipsoid.a,x=this.datum.ellipsoid.b,E=this.datum.ellipsoid.f,w=y-g,b=(1-E)*Math.tan(d),I=1/Math.sqrt(1+b*b),N=b*I,C=(1-E)*Math.tan(v),S=1/Math.sqrt(1+C*C),M=C*S,L=w,R=0;do{if(e=Math.sin(L),n=Math.cos(L),i=S*e*(S*e)+(I*M-N*S*n)*(I*M-N*S*n),0==(r=Math.sqrt(i)))return 0;o=N*M+I*S*n,s=Math.atan2(r,o),a=I*S*e/r,u=1-a*a,l=o-2*N*M/u,isNaN(l)&&(l=0),c=E/16*u*(4+E*(4-3*u)),h=L,L=w+(1-c)*E*a*(s+c*r*(l+c*o*(2*l*l-1)))}while(Math.abs(L-h)>1e-12&&++R<200);if(R>=200)throw new Error("Formula failed to converge");var P=u*(m*m-x*x)/(x*x),T=1+P/16384*(4096+P*(P*(320-175*P)-768)),O=P/1024*(256+P*(P*(74-47*P)-128)),_=O*r*(l+O/4*(o*(2*l*l-1)-O/6*l*(4*r*r-3)*(4*l*l-3))),A=x*T*(s-_),D=Math.atan2(S*e,I*M-N*S*n),F=Math.atan2(I*e,-N*S+I*M*n);return D=(D+2*Math.PI)%(2*Math.PI),F=(F+2*Math.PI)%(2*Math.PI),A=Number(A.toFixed(3)),{distance:A,initialBearing:D.toDegrees(),finalBearing:F.toDegrees()}},void 0===Number.prototype.toRadians&&(Number.prototype.toRadians=function(){return this*Math.PI/180}),void 0===Number.prototype.toDegrees&&(Number.prototype.toDegrees=function(){return 180*this/Math.PI}),void 0!==e&&e.exports&&(e.exports=i)},{"./latlon-ellipsoidal.js":634}],638:[function(t,e,n){"use strict";function i(t,e,n,r,s,a,u){if(!(this instanceof i))return new i(t,e,n,r,s,a,u);if(void 0===u&&(u=o.datum.WGS84),!(1<=t&&t<=60))throw new Error("Invalid MGRS grid reference (zone "+t+")");if(1!=e.length)throw new Error("Invalid MGRS grid reference (band "+e+")");if(-1==i.latBands.indexOf(e))throw new Error("Invalid MGRS grid reference (band "+e+")");if(1!=n.length)throw new Error("Invalid MGRS grid reference (e100k "+n+")");if(1!=r.length)throw new Error("Invalid MGRS grid reference (n100k "+r+")");this.zone=Number(t),this.band=e,this.e100k=n,this.n100k=r,this.easting=Number(s),this.northing=Number(a),this.datum=u}if(void 0!==e&&e.exports)var r=t("./utm.js");if(void 0!==e&&e.exports)var o=t("./latlon-ellipsoidal.js");i.latBands="CDEFGHJKLMNPQRSTUVWXX",i.e100kLetters=["ABCDEFGH","JKLMNPQR","STUVWXYZ"],i.n100kLetters=["ABCDEFGHJKLMNPQRSTUV","FGHJKLMNPQRSTUVABCDE"],r.prototype.toMgrs=function(){if(isNaN(this.zone+this.easting+this.northing))throw new Error("Invalid UTM coordinate "+this.toString()+"");var t=this.zone,e=this.toLatLonE(),n=i.latBands.charAt(Math.floor(e.lat/8+10)),r=Math.floor(this.easting/1e5),o=i.e100kLetters[(t-1)%3].charAt(r-1),s=Math.floor(this.northing/1e5)%20,a=i.n100kLetters[(t-1)%2].charAt(s),u=this.easting%1e5,l=this.northing%1e5;return u=Number(u.toFixed(6)),l=Number(l.toFixed(6)),new i(t,n,o,a,u,l)},i.prototype.toUtm=function(){for(var t=this.zone,e=this.band,n=this.e100k,s=this.n100k,a=this.easting,u=this.northing,l=e>="N"?"N":"S",c=i.e100kLetters[(t-1)%3].indexOf(n)+1,h=1e5*c,f=i.n100kLetters[(t-1)%2].indexOf(s),p=1e5*f,d=8*(i.latBands.indexOf(e)-10),g=1e5*Math.floor(new o(d,0).toUtm().northing/1e5),v=0;v+p+u<g;)v+=2e6;return new r(t,l,h+a,v+p+u,this.datum)},i.parse=function(t){if(t=t.trim(),!t.match(/\s/)){var e=t.slice(5);e=e.slice(0,e.length/2)+" "+e.slice(-e.length/2),t=t.slice(0,3)+" "+t.slice(3,5)+" "+e}if(null==(t=t.match(/\S+/g))||4!=t.length)throw new Error("Invalid MGRS grid reference "+t+"");var n=t[0],r=n.slice(0,2),o=n.slice(2,3),s=t[1],a=s.slice(0,1),u=s.slice(1,2),l=t[2],c=t[3];return l=l.length>=5?l:(l+"00000").slice(0,5),c=c.length>=5?c:(c+"00000").slice(0,5),new i(r,o,a,u,l,c)},i.prototype.toString=function(t){if(t=void 0===t?10:Number(t),-1==[2,4,6,8,10].indexOf(t))throw new Error("Invalid precision "+t+"");var e=this.zone.pad(2),n=this.band,i=this.e100k,r=this.n100k,o=Math.floor(this.easting/Math.pow(10,5-t/2)),s=Math.floor(this.northing/Math.pow(10,5-t/2));return o=o.pad(t/2),s=s.pad(t/2),e+n+" "+i+r+" "+o+" "+s},void 0===Number.prototype.pad&&(Number.prototype.pad=function(t){for(var e=this.toString();e.length<t;)e="0"+e;return e}),void 0!==e&&e.exports&&(e.exports=i)},{"./latlon-ellipsoidal.js":634,"./utm.js":641}],639:[function(t,e,n){"use strict";n.LatLonSpherical=t("./latlon-spherical.js"),n.LatLonEllipsoidal=t("./latlon-ellipsoidal.js");var i=t("./latlon-vincenty.js");for(var r in i)n.LatLonEllipsoidal[r]=i[r];n.LatLonVectors=t("./latlon-vectors.js"),n.Vector3d=t("./vector3d.js"),n.Utm=t("./utm.js"),n.Mgrs=t("./mgrs.js"),n.OsGridRef=t("./osgridref.js"),n.Dms=t("./dms.js")},{"./dms.js":633,"./latlon-ellipsoidal.js":634,"./latlon-spherical.js":635,"./latlon-vectors.js":636,"./latlon-vincenty.js":637,"./mgrs.js":638,"./osgridref.js":640,"./utm.js":641,"./vector3d.js":642}],640:[function(t,e,n){"use strict";function i(t,e){if(!(this instanceof i))return new i(t,e);this.easting=Number(t),this.northing=Number(e)}if(void 0!==e&&e.exports)var r=t("./latlon-ellipsoidal.js");i.latLonToOsGrid=function(t){if(!(t instanceof r))throw new TypeError("point is not LatLon object");t.datum!=r.datum.OSGB36&&(t=t.convertDatum(r.datum.OSGB36));var e=t.lat.toRadians(),n=t.lon.toRadians(),o=6377563.396,s=6356256.909,a=.9996012717,u=49..toRadians(),l=(-2).toRadians(),c=1-s*s/(o*o),h=(o-s)/(o+s),f=h*h,p=h*h*h,d=Math.cos(e),g=Math.sin(e),v=o*a/Math.sqrt(1-c*g*g),y=o*a*(1-c)/Math.pow(1-c*g*g,1.5),m=v/y-1,x=(1+h+5/4*f+5/4*p)*(e-u),E=(3*h+3*h*h+21/8*p)*Math.sin(e-u)*Math.cos(e+u),w=(15/8*f+15/8*p)*Math.sin(2*(e-u))*Math.cos(2*(e+u)),b=35/24*p*Math.sin(3*(e-u))*Math.cos(3*(e+u)),I=s*a*(x-E+w-b),N=d*d*d,C=N*d*d,S=Math.tan(e)*Math.tan(e),M=S*S,L=I+-1e5,R=v/2*g*d,P=v/24*g*N*(5-S+9*m),T=v/720*g*C*(61-58*S+M),O=v*d,_=v/6*N*(v/y-S),A=v/120*C*(5-18*S+M+14*m-58*S*m),D=n-l,F=D*D,q=F*D,k=q*D,G=k*D,j=G*D,B=L+R*F+P*k+T*j,z=4e5+O*D+_*q+A*G;return B=Number(B.toFixed(3)),z=Number(z.toFixed(3)),new i(z,B)},i.osGridToLatLon=function(t,e){if(!(t instanceof i))throw new TypeError("gridref is not OsGridRef object");void 0===e&&(e=r.datum.WGS84);var n=t.easting,o=t.northing,s=6377563.396,a=6356256.909,u=.9996012717,l=49..toRadians(),c=(-2).toRadians(),h=1-a*a/(s*s),f=(s-a)/(s+a),p=f*f,d=f*f*f,g=l,v=0;do{g=(o- -1e5-v)/(s*u)+g;v=a*u*((1+f+5/4*p+5/4*d)*(g-l)-(3*f+3*f*f+21/8*d)*Math.sin(g-l)*Math.cos(g+l)+(15/8*p+15/8*d)*Math.sin(2*(g-l))*Math.cos(2*(g+l))-35/24*d*Math.sin(3*(g-l))*Math.cos(3*(g+l)))}while(o- -1e5-v>=1e-5);var y=Math.cos(g),m=Math.sin(g),x=s*u/Math.sqrt(1-h*m*m),E=s*u*(1-h)/Math.pow(1-h*m*m,1.5),w=x/E-1,b=Math.tan(g),I=b*b,N=I*I,C=N*I,S=1/y,M=x*x*x,L=M*x*x,R=L*x*x,P=b/(2*E*x),T=b/(24*E*M)*(5+3*I+w-9*I*w),O=b/(720*E*L)*(61+90*I+45*N),_=S/x,A=S/(6*M)*(x/E+2*I),D=S/(120*L)*(5+28*I+24*N),F=S/(5040*R)*(61+662*I+1320*N+720*C),q=n-4e5,k=q*q,G=k*q,j=k*k,B=G*k,z=j*k,V=B*k;g=g-P*k+T*j-O*z;var X=c+_*q-A*G+D*B-F*V,Y=new r(g.toDegrees(),X.toDegrees(),r.datum.OSGB36);return e!=r.datum.OSGB36&&(Y=Y.convertDatum(e)),Y},i.parse=function(t){t=String(t).trim();var e=t.match(/^(\d+),\s*(\d+)$/);if(e)return new i(e[1],e[2]);if(!(e=t.match(/^[A-Z]{2}\s*[0-9]+\s*[0-9]+$/i)))throw new Error("Invalid grid reference");var n=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0),r=t.toUpperCase().charCodeAt(1)-"A".charCodeAt(0);n>7&&n--,r>7&&r--;var o=(n-2)%5*5+r%5,s=19-5*Math.floor(n/5)-Math.floor(r/5),a=t.slice(2).trim().split(/\s+/);if(1==a.length&&(a=[a[0].slice(0,a[0].length/2),a[0].slice(a[0].length/2)]),o<0||o>6||s<0||s>12)throw new Error("Invalid grid reference");if(2!=a.length)throw new Error("Invalid grid reference");if(a[0].length!=a[1].length)throw new Error("Invalid grid reference");return a[0]=(a[0]+"00000").slice(0,5),a[1]=(a[1]+"00000").slice(0,5),new i(o+a[0],s+a[1])},i.prototype.toString=function(t){if(t=void 0===t?10:Number(t),isNaN(t))throw new Error("Invalid precision");var e=this.easting,n=this.northing;if(isNaN(e)||isNaN(n))throw new Error("Invalid grid reference");if(0==t)return e.pad(6)+","+n.pad(6);var i=Math.floor(e/1e5),r=Math.floor(n/1e5);if(i<0||i>6||r<0||r>12)return"";var o=19-r-(19-r)%5+Math.floor((i+10)/5),s=5*(19-r)%25+i%5;o>7&&o++,s>7&&s++;var a=String.fromCharCode(o+"A".charCodeAt(0),s+"A".charCodeAt(0));return e=Math.floor(e%1e5/Math.pow(10,5-t/2)),n=Math.floor(n%1e5/Math.pow(10,5-t/2)),a+" "+e.pad(t/2)+" "+n.pad(t/2)},void 0===String.prototype.trim&&(String.prototype.trim=function(){return String(this).replace(/^\s\s*/,"").replace(/\s\s*$/,"")}),void 0===Number.prototype.pad&&(Number.prototype.pad=function(t){for(var e=this.toString();e.length<t;)e="0"+e;return e}),void 0!==e&&e.exports&&(e.exports=i)},{"./latlon-ellipsoidal.js":634}],641:[function(t,e,n){"use strict";function i(t,e,n,o,s,a,u){if(!(this instanceof i))return new i(t,e,n,o,s,a,u);if(void 0===s&&(s=r.datum.WGS84),void 0===a&&(a=null),void 0===u&&(u=null),!(1<=t&&t<=60))throw new Error("Invalid UTM zone "+t);if(!e.match(/[NS]/i))throw new Error("Invalid UTM hemisphere "+e);this.zone=Number(t),this.hemisphere=e.toUpperCase(),this.easting=Number(n),this.northing=Number(o),this.datum=s,this.convergence=null===a?null:Number(a),this.scale=null===u?null:Number(u)}if(void 0!==e&&e.exports)var r=t("./latlon-ellipsoidal.js");r.prototype.toUtm=function(){if(isNaN(this.lat)||isNaN(this.lon))throw new Error("Invalid point");if(!(-80<this.lat&&this.lat<84))throw new Error("Outside UTM limits ("+this.lat+","+this.lon+")");var t=Math.floor((this.lon+180)/6)+1,e=(6*(t-1)-180+3).toRadians(),n="CDEFGHJKLMNPQRSTUVWXX",r=n.charAt(Math.floor(this.lat/8+10));31==t&&"V"==r&&this.lon>=3&&(t++,e+=6..toRadians()),32==t&&"X"==r&&this.lon<9&&(t--,e-=6..toRadians()),32==t&&"X"==r&&this.lon>=9&&(t++,e+=6..toRadians()),34==t&&"X"==r&&this.lon<21&&(t--,e-=6..toRadians()),34==t&&"X"==r&&this.lon>=21&&(t++,e+=6..toRadians()),36==t&&"X"==r&&this.lon<33&&(t--,e-=6..toRadians()),36==t&&"X"==r&&this.lon>=33&&(t++,e+=6..toRadians());for(var o=this.lat.toRadians(),s=this.lon.toRadians()-e,a=this.datum.ellipsoid.a,u=this.datum.ellipsoid.f,l=Math.sqrt(u*(2-u)),c=u/(2-u),h=c*c,f=c*h,p=c*f,d=c*p,g=c*d,v=Math.cos(s),y=Math.sin(s),m=Math.tan(s),x=Math.tan(o),E=Math.sinh(l*Math.atanh(l*x/Math.sqrt(1+x*x))),w=x*Math.sqrt(1+E*E)-E*Math.sqrt(1+x*x),b=Math.atan2(w,v),I=Math.asinh(y/Math.sqrt(w*w+v*v)),N=a/(1+c)*(1+.25*h+1/64*p+1/256*g),C=[null,.5*c-2/3*h+5/16*f+41/180*p-127/288*d+7891/37800*g,13/48*h-.6*f+557/1440*p+281/630*d-1983433/1935360*g,61/240*f-103/140*p+15061/26880*d+167603/181440*g,49561/161280*p-179/168*d+6601661/7257600*g,34729/80640*d-3418889/1995840*g,.6650675310896665*g],S=b,M=1;M<=6;M++)S+=C[M]*Math.sin(2*M*b)*Math.cosh(2*M*I);for(var L=I,M=1;M<=6;M++)L+=C[M]*Math.cos(2*M*b)*Math.sinh(2*M*I);for(var R=.9996*N*L,P=.9996*N*S,T=1,M=1;M<=6;M++)T+=2*M*C[M]*Math.cos(2*M*b)*Math.cosh(2*M*I);for(var O=0,M=1;M<=6;M++)O+=2*M*C[M]*Math.sin(2*M*b)*Math.sinh(2*M*I);var _=Math.atan(w/Math.sqrt(1+w*w)*m),A=Math.atan2(O,T),D=_+A,F=Math.sin(o),q=Math.sqrt(1-l*l*F*F)*Math.sqrt(1+x*x)/Math.sqrt(w*w+v*v),k=N/a*Math.sqrt(T*T+O*O),G=.9996*q*k;R+=5e5,P<0&&(P+=1e7),R=Number(R.toFixed(6)),P=Number(P.toFixed(6));var j=Number(D.toDegrees().toFixed(9)),B=Number(G.toFixed(12));return new i(t,this.lat>=0?"N":"S",R,P,this.datum,j,B)},i.prototype.toLatLonE=function(){var t=this.zone,e=this.hemisphere,n=this.easting,i=this.northing;if(isNaN(t)||isNaN(n)||isNaN(i))throw new Error("Invalid coordinate");var o=this.datum.ellipsoid.a,s=this.datum.ellipsoid.f;n-=5e5,i="S"==e?i-1e7:i;for(var a=Math.sqrt(s*(2-s)),u=s/(2-s),l=u*u,c=u*l,h=u*c,f=u*h,p=u*f,d=o/(1+u)*(1+.25*l+1/64*h+1/256*p),g=n/(.9996*d),v=i/(.9996*d),y=[null,.5*u-2/3*l+37/96*c-1/360*h-81/512*f+96199/604800*p,1/48*l+1/15*c-437/1440*h+46/105*f-1118711/3870720*p,17/480*c-37/840*h-209/4480*f+5569/90720*p,4397/161280*h-11/504*f-830251/7257600*p,4583/161280*f-108847/3991680*p,.03233083094085698*p],m=v,x=1;x<=6;x++)m-=y[x]*Math.sin(2*x*v)*Math.cosh(2*x*g);for(var E=g,x=1;x<=6;x++)E-=y[x]*Math.cos(2*x*v)*Math.sinh(2*x*g);var w=Math.sinh(E),b=Math.sin(m),I=Math.cos(m),N=b/Math.sqrt(w*w+I*I),C=N;do{var S=Math.sinh(a*Math.atanh(a*C/Math.sqrt(1+C*C))),M=C*Math.sqrt(1+S*S)-S*Math.sqrt(1+C*C),L=(N-M)/Math.sqrt(1+M*M)*(1+(1-a*a)*C*C)/((1-a*a)*Math.sqrt(1+C*C));C+=L}while(Math.abs(L)>1e-12);for(var R=C,P=Math.atan(R),T=Math.atan2(w,I),O=1,x=1;x<=6;x++)O-=2*x*y[x]*Math.cos(2*x*v)*Math.cosh(2*x*g);for(var _=0,x=1;x<=6;x++)_+=2*x*y[x]*Math.sin(2*x*v)*Math.sinh(2*x*g);var A=Math.atan(Math.tan(m)*Math.tanh(E)),D=Math.atan2(_,O),F=A+D,q=Math.sin(P),k=Math.sqrt(1-a*a*q*q)*Math.sqrt(1+R*R)*Math.sqrt(w*w+I*I),G=d/o/Math.sqrt(O*O+_*_),j=.9996*k*G;T+=(6*(t-1)-180+3).toRadians();var B=Number(P.toDegrees().toFixed(11)),z=Number(T.toDegrees().toFixed(11)),V=Number(F.toDegrees().toFixed(9)),X=Number(j.toFixed(12)),Y=new r(B,z,this.datum);return Y.convergence=V,Y.scale=X,Y},i.parse=function(t,e){if(void 0===e&&(e=r.datum.WGS84),null==(t=t.trim().match(/\S+/g))||4!=t.length)throw new Error("Invalid UTM coordinate "+t+"");return new i(t[0],t[1],t[2],t[3],e)},i.prototype.toString=function(t){t=Number(t||0);var e=this.zone<10?"0"+this.zone:this.zone,n=this.hemisphere,i=this.easting,r=this.northing;return isNaN(e)||!n.match(/[NS]/)||isNaN(i)||isNaN(r)?"":e+" "+n+" "+i.toFixed(t)+" "+r.toFixed(t)},void 0===Math.sinh&&(Math.sinh=function(t){return(Math.exp(t)-Math.exp(-t))/2}),void 0===Math.cosh&&(Math.cosh=function(t){return(Math.exp(t)+Math.exp(-t))/2}),void 0===Math.tanh&&(Math.tanh=function(t){return(Math.exp(t)-Math.exp(-t))/(Math.exp(t)+Math.exp(-t))}),void 0===Math.asinh&&(Math.asinh=function(t){return Math.log(t+Math.sqrt(1+t*t))}),void 0===Math.atanh&&(Math.atanh=function(t){return Math.log((1+t)/(1-t))/2}),void 0===String.prototype.trim&&(String.prototype.trim=function(){return String(this).replace(/^\s\s*/,"").replace(/\s\s*$/,"")}),void 0!==e&&e.exports&&(e.exports=i)},{"./latlon-ellipsoidal.js":634}],642:[function(t,e,n){"use strict";function i(t,e,n){if(!(this instanceof i))return new i(t,e,n);this.x=Number(t),this.y=Number(e),this.z=Number(n)}i.prototype.plus=function(t){if(!(t instanceof i))throw new TypeError("v is not Vector3d object");return new i(this.x+t.x,this.y+t.y,this.z+t.z)},i.prototype.minus=function(t){if(!(t instanceof i))throw new TypeError("v is not Vector3d object");return new i(this.x-t.x,this.y-t.y,this.z-t.z)},i.prototype.times=function(t){return t=Number(t),new i(this.x*t,this.y*t,this.z*t)},i.prototype.dividedBy=function(t){return t=Number(t),new i(this.x/t,this.y/t,this.z/t)},i.prototype.dot=function(t){if(!(t instanceof i))throw new TypeError("v is not Vector3d object");return this.x*t.x+this.y*t.y+this.z*t.z},i.prototype.cross=function(t){if(!(t instanceof i))throw new TypeError("v is not Vector3d object");return new i(this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x)},i.prototype.negate=function(){return new i(-this.x,-this.y,-this.z)},i.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},i.prototype.unit=function(){var t=this.length();return 1==t?this:0==t?this:new i(this.x/t,this.y/t,this.z/t)},i.prototype.angleTo=function(t,e){if(!(t instanceof i))throw new TypeError("v is not Vector3d object");var n=this.cross(t).length(),r=this.dot(t);if(void 0!==e){if(!(e instanceof i))throw new TypeError("vSign is not Vector3d object");n=this.cross(t).dot(e)<0?-n:n}return Math.atan2(n,r)},i.prototype.rotateAround=function(t,e){if(!(t instanceof i))throw new TypeError("axis is not Vector3d object");for(var n=this.unit(),r=[n.x,n.y,n.z],o=t.unit(),s=Math.sin(e),a=Math.cos(e),u=[[o.x*o.x*(1-a)+a,o.x*o.y*(1-a)-o.z*s,o.x*o.z*(1-a)+o.y*s],[o.y*o.x*(1-a)+o.z*s,o.y*o.y*(1-a)+a,o.y*o.z*(1-a)-o.x*s],[o.z*o.x*(1-a)-o.y*s,o.z*o.y*(1-a)+o.x*s,o.z*o.z*(1-a)+a]],l=[0,0,0],c=0;c<3;c++)for(var h=0;h<3;h++)l[c]+=u[c][h]*r[h];return new i(l[0],l[1],l[2])},i.prototype.toString=function(t){var e=void 0===t?3:Number(t);return"["+this.x.toFixed(e)+","+this.y.toFixed(e)+","+this.z.toFixed(e)+"]"},void 0!==e&&e.exports&&(e.exports=i)},{}],643:[function(t,e,n){var i=t("@turf/helpers"),r=t("@turf/invariant").getCoord,o=t("geodesy").LatLonSpherical,s=i.point,a=i.radiansToDistance,u=i.distanceToRadians;e.exports=function(t,e,n,i){if(!t)throw new Error("origin is required");if(void 0===e||null===e)throw new Error("distance is required");if(void 0===n||null===n)throw new Error("bearing is required");if(!(e>=0))throw new Error("distance must be greater than 0");i=i||"kilometers";var l=a(u(e,i),"meters"),c=r(t),h=new o(c[1],c[0]),f=h.rhumbDestinationPoint(l,n);return f.lon+=f.lon-c[0]>180?-360:c[0]-f.lon>180?360:0,s([f.lon,f.lat])}},{"@turf/helpers":644,"@turf/invariant":645,geodesy:652}],644:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],645:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],646:[function(t,e,n){arguments[4][633][0].apply(n,arguments)},{dup:633}],647:[function(t,e,n){arguments[4][634][0].apply(n,arguments)},{"./dms.js":646,"./vector3d.js":655,dup:634}],648:[function(t,e,n){arguments[4][635][0].apply(n,arguments)},{"./dms":646,dup:635}],649:[function(t,e,n){arguments[4][636][0].apply(n,arguments)},{"./dms.js":646,"./vector3d.js":655,dup:636}],650:[function(t,e,n){arguments[4][637][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":647,dup:637}],651:[function(t,e,n){arguments[4][638][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":647,"./utm.js":654,dup:638}],652:[function(t,e,n){arguments[4][639][0].apply(n,arguments)},{"./dms.js":646,"./latlon-ellipsoidal.js":647,"./latlon-spherical.js":648,"./latlon-vectors.js":649,"./latlon-vincenty.js":650,"./mgrs.js":651,"./osgridref.js":653,"./utm.js":654,"./vector3d.js":655,dup:639}],653:[function(t,e,n){arguments[4][640][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":647,dup:640}],654:[function(t,e,n){arguments[4][641][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":647,dup:641}],655:[function(t,e,n){arguments[4][642][0].apply(n,arguments)},{dup:642}],656:[function(t,e,n){var i=t("@turf/helpers"),r=t("@turf/invariant").getCoord,o=t("geodesy").LatLonSpherical,s=i.radiansToDistance,a=i.distanceToRadians;e.exports=function(t,e,n){if(!t)throw new Error("from point is required");if(!e)throw new Error("to point is required");n=n||"kilometers";var i=r(t),u=r(e),l=new o(i[1],i[0]),c=new o(u[1],u[0]);c[0]+=c[0]-l[0]>180?-360:l[0]-c[0]>180?360:0;var h=l.rhumbDistanceTo(c);return s(a(h,"meters"),n)}},{"@turf/helpers":657,"@turf/invariant":658,geodesy:665}],657:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],658:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],659:[function(t,e,n){arguments[4][633][0].apply(n,arguments)},{dup:633}],660:[function(t,e,n){arguments[4][634][0].apply(n,arguments)},{"./dms.js":659,"./vector3d.js":668,dup:634}],661:[function(t,e,n){arguments[4][635][0].apply(n,arguments)},{"./dms":659,dup:635}],662:[function(t,e,n){arguments[4][636][0].apply(n,arguments)},{"./dms.js":659,"./vector3d.js":668,dup:636}],663:[function(t,e,n){arguments[4][637][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":660,dup:637}],664:[function(t,e,n){arguments[4][638][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":660,"./utm.js":667,dup:638}],665:[function(t,e,n){arguments[4][639][0].apply(n,arguments)},{"./dms.js":659,"./latlon-ellipsoidal.js":660,"./latlon-spherical.js":661,"./latlon-vectors.js":662,"./latlon-vincenty.js":663,"./mgrs.js":664,"./osgridref.js":666,"./utm.js":667,"./vector3d.js":668,dup:639}],666:[function(t,e,n){arguments[4][640][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":660,dup:640}],667:[function(t,e,n){arguments[4][641][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":660,dup:641}],668:[function(t,e,n){arguments[4][642][0].apply(n,arguments)},{dup:642}],669:[function(t,e,n){function i(t,e){for(var n,i,r=t.slice(0),o=t.length,s=o-e;o-- >s;)i=Math.floor((o+1)*Math.random()),n=r[i],r[i]=r[o],r[o]=n;return r.slice(s)}var r=t("@turf/helpers").featureCollection;e.exports=function(t,e){return r(i(t.features,e))}},{"@turf/helpers":670}],670:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],671:[function(t,e,n){function i(t){var e=t%360;return e<0&&(e+=360),e}var r=t("@turf/circle"),o=t("@turf/meta").coordEach,s=t("@turf/helpers"),a=t("@turf/invariant").getCoords,u=s.polygon,l=t("@turf/line-arc");e.exports=function(t,e,n,s,c,h){if(!t)throw new Error("center is required");if(void 0===n||null===n)throw new Error("bearing1 is required");if(void 0===s||null===s)throw new Error("bearing2 is required");if(!e)throw new Error("radius is required");if(c=c||64,i(n)===i(s))return r(t,e,c,h);var f=a(t),p=l(t,e,n,s,c,h),d=[[f]];return o(p,function(t){d[0].push(t)}),d[0].push(f),u(d)}},{"@turf/circle":672,"@turf/helpers":677,"@turf/invariant":678,"@turf/line-arc":679,"@turf/meta":689}],672:[function(t,e,n){arguments[4][167][0].apply(n,arguments)},{"@turf/destination":673,"@turf/helpers":676,dup:167}],673:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{"@turf/helpers":674,"@turf/invariant":675,dup:5}],674:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],675:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],676:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],677:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],678:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],679:[function(t,e,n){arguments[4][368][0].apply(n,arguments)},{"@turf/circle":680,"@turf/destination":685,"@turf/helpers":688,dup:368}],680:[function(t,e,n){arguments[4][167][0].apply(n,arguments)},{"@turf/destination":681,"@turf/helpers":684,dup:167}],681:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{"@turf/helpers":682,"@turf/invariant":683,dup:5}],682:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],683:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],684:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],685:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{"@turf/helpers":686,"@turf/invariant":687,dup:5}],686:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],687:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],688:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],689:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],690:[function(t,e,n){function i(t,e,n){return"LineString"===t.geometry.type?{type:"LineString",coordinates:s(t.geometry.coordinates,e,n)}:"MultiLineString"===t.geometry.type?{type:"MultiLineString",coordinates:t.geometry.coordinates.map(function(t){return s(t,e,n)})}:"Polygon"===t.geometry.type?{type:"Polygon",coordinates:a(t.geometry.coordinates,e,n)}:"MultiPolygon"===t.geometry.type?{type:"MultiPolygon",coordinates:t.geometry.coordinates.map(function(t){return a(t,e,n)})}:t}function r(t){return!(t.length<3)&&(3!==t.length||t[2][0]!==t[0][0]||t[2][1]!==t[0][1])}function o(t,e){return{type:"Feature",geometry:t,properties:e}}function s(t,e,n){return u(t.map(function(t){return{x:t[0],y:t[1],z:t[2]}}),e,n).map(function(t){return t.z?[t.x,t.y,t.z]:[t.x,t.y]})}function a(t,e,n){return t.map(function(t){var i=t.map(function(t){return{x:t[0],y:t[1]}});if(i.length<4)throw new Error("Invalid polygon");for(var o=u(i,e,n).map(function(t){return[t.x,t.y]});!r(o);)e-=.01*e,o=u(i,e,n).map(function(t){return[t.x,t.y]});return o[o.length-1][0]===o[0][0]&&o[o.length-1][1]===o[0][1]||o.push(o[0]),o})}var u=t("simplify-js"),l=["LineString","MultiLineString","Polygon","MultiPolygon"];e.exports=function(t,e,n){return"Feature"===t.type?o(i(t,e,n),t.properties):"FeatureCollection"===t.type?{type:"FeatureCollection",features:t.features.map(function(t){var r=i(t,e,n);return l.indexOf(r.type)>-1?o(r,t.properties):r})}:"GeometryCollection"===t.type?{type:"GeometryCollection",geometries:t.geometries.map(function(t){return l.indexOf(t.type)>-1?i({type:"Feature",geometry:t},e,n):t})}:t}},{"simplify-js":691}],691:[function(e,n,i){!function(){"use strict";function e(t,e){var n=t.x-e.x,i=t.y-e.y;return n*n+i*i}function i(t,e,n){var i=e.x,r=e.y,o=n.x-i,s=n.y-r;if(0!==o||0!==s){var a=((t.x-i)*o+(t.y-r)*s)/(o*o+s*s);a>1?(i=n.x,r=n.y):a>0&&(i+=o*a,r+=s*a)}return o=t.x-i,s=t.y-r,o*o+s*s}function r(t,n){for(var i,r=t[0],o=[r],s=1,a=t.length;s<a;s++)i=t[s],e(i,r)>n&&(o.push(i),r=i);return r!==i&&o.push(i),o}function o(t,e){var n,r,o,s,a=t.length,u="undefined"!=typeof Uint8Array?Uint8Array:Array,l=new u(a),c=0,h=a-1,f=[],p=[];for(l[c]=l[h]=1;h;){for(r=0,n=c+1;n<h;n++)(o=i(t[n],t[c],t[h]))>r&&(s=n,r=o);r>e&&(l[s]=1,f.push(c,s,s,h)),h=f.pop(),c=f.pop()}for(n=0;n<a;n++)l[n]&&p.push(t[n]);return p}function s(t,e,n){var i=void 0!==e?e*e:1;return t=n?t:r(t,i),t=o(t,i)}"function"==typeof t&&t.amd?t(function(){return s}):void 0!==n?n.exports=s:"undefined"!=typeof self?self.simplify=s:window.simplify=s}()},{}],692:[function(t,e,n){arguments[4][290][0].apply(n,arguments)},{"@turf/bbox":693,"@turf/distance":695,"@turf/helpers":698,dup:290}],693:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"@turf/meta":694,dup:22}],694:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],695:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":696,"@turf/invariant":697,dup:8}],696:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],697:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],698:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],699:[function(t,e,n){var i=t("@turf/distance");e.exports=function(t){var e=t[0],n=t[1],r=t[2],o=t[3];if(i(t.slice(0,2),[r,n])>=i(t.slice(0,2),[e,o])){var s=(n+o)/2;return[e,s-(r-e)/2,r,s+(r-e)/2]}var a=(e+r)/2;return[a-(o-n)/2,n,a+(o-n)/2,o]}},{"@turf/distance":700}],700:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":701,"@turf/invariant":702,dup:8}],701:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],702:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],703:[function(t,e,n){var i=t("@turf/inside");e.exports=function(t,e,n,r){return t=JSON.parse(JSON.stringify(t)),e=JSON.parse(JSON.stringify(e)),t.features.forEach(function(t){t.properties||(t.properties={}),e.features.forEach(function(e){if(void 0===t.properties[r]){i(t,e)&&(t.properties[r]=e.properties[n])}})}),t}},{"@turf/inside":704}],704:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{"@turf/invariant":705,dup:34}],705:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],706:[function(t,e,n){function i(t){var e=r(t),n=s(e.vertices,e.holes,2),i=[],a=[];n.forEach(function(t,i){var r=n[i];a.push([e.vertices[2*r],e.vertices[2*r+1]])});for(var u=0;u<a.length;u+=3){var l=a.slice(u,u+3);l.push(a[u]),i.push(o([l]))}return i}function r(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},i=0,r=0;r<t.length;r++){for(var o=0;o<t[r].length;o++)for(var s=0;s<e;s++)n.vertices.push(t[r][o][s]);r>0&&(i+=t[r-1].length,n.holes.push(i))}return n}var o=t("@turf/helpers").polygon,s=t("earcut");e.exports=function(t){if(!t.geometry||"Polygon"!==t.geometry.type&&"MultiPolygon"!==t.geometry.type)throw new Error("input must be a Polygon or MultiPolygon");var e={type:"FeatureCollection",features:[]};return"Polygon"===t.geometry.type?e.features=i(t.geometry.coordinates):t.geometry.coordinates.forEach(function(t){e.features=e.features.concat(i(t))}),e}},{"@turf/helpers":707,earcut:708}],707:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],708:[function(t,e,n){"use strict";function i(t,e,n){n=n||2;var i=e&&e.length,o=i?e[0]*n:t.length,a=r(t,0,o,n,!0),u=[];if(!a)return u;var l,c,f,p,d,g,v;if(i&&(a=h(t,e,a,n)),t.length>80*n){l=f=t[0],c=p=t[1];for(var y=n;y<o;y+=n)d=t[y],g=t[y+1],d<l&&(l=d),g<c&&(c=g),d>f&&(f=d),g>p&&(p=g);v=Math.max(f-l,p-c)}return s(a,u,n,l,c,v),u}function r(t,e,n,i,r){var o,s;if(r===T(t,e,n,i)>0)for(o=e;o<n;o+=i)s=L(o,t[o],t[o+1],s);else for(o=n-i;o>=e;o-=i)s=L(o,t[o],t[o+1],s);return s&&b(s,s.next)&&(R(s),s=s.next),s}function o(t,e){if(!t)return t;e||(e=t);var n,i=t;do{if(n=!1,i.steiner||!b(i,i.next)&&0!==w(i.prev,i,i.next))i=i.next;else{if(R(i),(i=e=i.prev)===i.next)return null;n=!0}}while(n||i!==e);return e}
function s(t,e,n,i,r,h,f){if(t){!f&&h&&g(t,i,r,h);for(var p,d,v=t;t.prev!==t.next;)if(p=t.prev,d=t.next,h?u(t,i,r,h):a(t))e.push(p.i/n),e.push(t.i/n),e.push(d.i/n),R(t),t=d.next,v=d.next;else if((t=d)===v){f?1===f?(t=l(t,e,n),s(t,e,n,i,r,h,2)):2===f&&c(t,e,n,i,r,h):s(o(t),e,n,i,r,h,1);break}}}function a(t){var e=t.prev,n=t,i=t.next;if(w(e,n,i)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(x(e.x,e.y,n.x,n.y,i.x,i.y,r.x,r.y)&&w(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function u(t,e,n,i){var r=t.prev,o=t,s=t.next;if(w(r,o,s)>=0)return!1;for(var a=r.x<o.x?r.x<s.x?r.x:s.x:o.x<s.x?o.x:s.x,u=r.y<o.y?r.y<s.y?r.y:s.y:o.y<s.y?o.y:s.y,l=r.x>o.x?r.x>s.x?r.x:s.x:o.x>s.x?o.x:s.x,c=r.y>o.y?r.y>s.y?r.y:s.y:o.y>s.y?o.y:s.y,h=y(a,u,e,n,i),f=y(l,c,e,n,i),p=t.nextZ;p&&p.z<=f;){if(p!==t.prev&&p!==t.next&&x(r.x,r.y,o.x,o.y,s.x,s.y,p.x,p.y)&&w(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&x(r.x,r.y,o.x,o.y,s.x,s.y,p.x,p.y)&&w(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function l(t,e,n){var i=t;do{var r=i.prev,o=i.next.next;!b(r,o)&&I(r,i,i.next,o)&&C(r,o)&&C(o,r)&&(e.push(r.i/n),e.push(i.i/n),e.push(o.i/n),R(i),R(i.next),i=t=o),i=i.next}while(i!==t);return i}function c(t,e,n,i,r,a){var u=t;do{for(var l=u.next.next;l!==u.prev;){if(u.i!==l.i&&E(u,l)){var c=M(u,l);return u=o(u,u.next),c=o(c,c.next),s(u,e,n,i,r,a),void s(c,e,n,i,r,a)}l=l.next}u=u.next}while(u!==t)}function h(t,e,n,i){var s,a,u,l,c,h=[];for(s=0,a=e.length;s<a;s++)u=e[s]*i,l=s<a-1?e[s+1]*i:t.length,c=r(t,u,l,i,!1),c===c.next&&(c.steiner=!0),h.push(m(c));for(h.sort(f),s=0;s<h.length;s++)p(h[s],n),n=o(n,n.next);return n}function f(t,e){return t.x-e.x}function p(t,e){if(e=d(t,e)){var n=M(e,t);o(n,n.next)}}function d(t,e){var n,i=e,r=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=r&&a>s){if(s=a,a===r){if(o===i.y)return i;if(o===i.next.y)return i.next}n=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!n)return null;if(r===s)return n.prev;var u,l=n,c=n.x,h=n.y,f=1/0;for(i=n.next;i!==l;)r>=i.x&&i.x>=c&&x(o<h?r:s,o,c,h,o<h?s:r,o,i.x,i.y)&&((u=Math.abs(o-i.y)/(r-i.x))<f||u===f&&i.x>n.x)&&C(i,t)&&(n=i,f=u),i=i.next;return n}function g(t,e,n,i){var r=t;do{null===r.z&&(r.z=y(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,v(r)}function v(t){var e,n,i,r,o,s,a,u,l=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,i=n,a=0,e=0;e<l&&(a++,i=i.nextZ);e++);for(u=l;a>0||u>0&&i;)0===a?(r=i,i=i.nextZ,u--):0!==u&&i?n.z<=i.z?(r=n,n=n.nextZ,a--):(r=i,i=i.nextZ,u--):(r=n,n=n.nextZ,a--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;n=i}o.nextZ=null,l*=2}while(s>1);return t}function y(t,e,n,i,r){return t=32767*(t-n)/r,e=32767*(e-i)/r,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function m(t){var e=t,n=t;do{e.x<n.x&&(n=e),e=e.next}while(e!==t);return n}function x(t,e,n,i,r,o,s,a){return(r-s)*(e-a)-(t-s)*(o-a)>=0&&(t-s)*(i-a)-(n-s)*(e-a)>=0&&(n-s)*(o-a)-(r-s)*(i-a)>=0}function E(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!N(t,e)&&C(t,e)&&C(e,t)&&S(t,e)}function w(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function b(t,e){return t.x===e.x&&t.y===e.y}function I(t,e,n,i){return!!(b(t,e)&&b(n,i)||b(t,i)&&b(n,e))||w(t,e,n)>0!=w(t,e,i)>0&&w(n,i,t)>0!=w(n,i,e)>0}function N(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&I(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function C(t,e){return w(t.prev,t,t.next)<0?w(t,e,t.next)>=0&&w(t,t.prev,e)>=0:w(t,e,t.prev)<0||w(t,t.next,e)<0}function S(t,e){var n=t,i=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}function M(t,e){var n=new P(t.i,t.x,t.y),i=new P(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function L(t,e,n,i){var r=new P(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function R(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function P(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function T(t,e,n,i){for(var r=0,o=e,s=n-i;o<n;o+=i)r+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return r}e.exports=i,i.deviation=function(t,e,n,i){var r=e&&e.length,o=r?e[0]*n:t.length,s=Math.abs(T(t,0,o,n));if(r)for(var a=0,u=e.length;a<u;a++){var l=e[a]*n,c=a<u-1?e[a+1]*n:t.length;s-=Math.abs(T(t,l,c,n))}var h=0;for(a=0;a<i.length;a+=3){var f=i[a]*n,p=i[a+1]*n,d=i[a+2]*n;h+=Math.abs((t[f]-t[d])*(t[p+1]-t[f+1])-(t[f]-t[p])*(t[d+1]-t[f+1]))}return 0===s&&0===h?0:Math.abs((h-s)/s)},i.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},i=0,r=0;r<t.length;r++){for(var o=0;o<t[r].length;o++)for(var s=0;s<e;s++)n.vertices.push(t[r][o][s]);r>0&&(i+=t[r-1].length,n.holes.push(i))}return n}},{}],709:[function(t,e,n){arguments[4][210][0].apply(n,arguments)},{"@turf/helpers":710,dup:210}],710:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],711:[function(t,e,n){var i=t("@turf/meta"),r=t("@turf/centroid"),o=t("@turf/invariant"),s=t("@turf/rhumb-bearing"),a=t("@turf/rhumb-distance"),u=t("@turf/rhumb-destination"),l=i.coordEach,c=o.getCoords;e.exports=function(t,e,n,i){if(!t)throw new Error("geojson is required");if(void 0===e||null===e||isNaN(e))throw new Error("angle is required");return 0===e?t:(n||(n=r(t)),!1!==i&&void 0!==i||(t=JSON.parse(JSON.stringify(t))),l(t,function(t){var i=s(n,t),r=i+e,o=a(n,t),l=c(u(n,o,r));t[0]=l[0],t[1]=l[1]}),t)}},{"@turf/centroid":712,"@turf/invariant":715,"@turf/meta":716,"@turf/rhumb-bearing":717,"@turf/rhumb-destination":729,"@turf/rhumb-distance":742}],712:[function(t,e,n){arguments[4][132][0].apply(n,arguments)},{"@turf/helpers":713,"@turf/meta":714,dup:132}],713:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],714:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],715:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],716:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],717:[function(t,e,n){arguments[4][631][0].apply(n,arguments)},{"@turf/invariant":718,dup:631,geodesy:725}],718:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],719:[function(t,e,n){arguments[4][633][0].apply(n,arguments)},{dup:633}],720:[function(t,e,n){arguments[4][634][0].apply(n,arguments)},{"./dms.js":719,"./vector3d.js":728,dup:634}],721:[function(t,e,n){arguments[4][635][0].apply(n,arguments)},{"./dms":719,dup:635}],722:[function(t,e,n){arguments[4][636][0].apply(n,arguments)},{"./dms.js":719,"./vector3d.js":728,dup:636}],723:[function(t,e,n){arguments[4][637][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":720,dup:637}],724:[function(t,e,n){arguments[4][638][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":720,"./utm.js":727,dup:638}],725:[function(t,e,n){arguments[4][639][0].apply(n,arguments)},{"./dms.js":719,"./latlon-ellipsoidal.js":720,"./latlon-spherical.js":721,"./latlon-vectors.js":722,"./latlon-vincenty.js":723,"./mgrs.js":724,"./osgridref.js":726,"./utm.js":727,"./vector3d.js":728,dup:639}],726:[function(t,e,n){arguments[4][640][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":720,dup:640}],727:[function(t,e,n){arguments[4][641][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":720,dup:641}],728:[function(t,e,n){arguments[4][642][0].apply(n,arguments)},{dup:642}],729:[function(t,e,n){arguments[4][643][0].apply(n,arguments)},{"@turf/helpers":730,"@turf/invariant":731,dup:643,geodesy:738}],730:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],731:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],732:[function(t,e,n){arguments[4][633][0].apply(n,arguments)},{dup:633}],733:[function(t,e,n){arguments[4][634][0].apply(n,arguments)},{"./dms.js":732,"./vector3d.js":741,dup:634}],734:[function(t,e,n){arguments[4][635][0].apply(n,arguments)},{"./dms":732,dup:635}],735:[function(t,e,n){arguments[4][636][0].apply(n,arguments)},{"./dms.js":732,"./vector3d.js":741,dup:636}],736:[function(t,e,n){arguments[4][637][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":733,dup:637}],737:[function(t,e,n){arguments[4][638][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":733,"./utm.js":740,dup:638}],738:[function(t,e,n){arguments[4][639][0].apply(n,arguments)},{"./dms.js":732,"./latlon-ellipsoidal.js":733,"./latlon-spherical.js":734,"./latlon-vectors.js":735,"./latlon-vincenty.js":736,"./mgrs.js":737,"./osgridref.js":739,"./utm.js":740,"./vector3d.js":741,dup:639}],739:[function(t,e,n){arguments[4][640][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":733,dup:640}],740:[function(t,e,n){arguments[4][641][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":733,dup:641}],741:[function(t,e,n){arguments[4][642][0].apply(n,arguments)},{dup:642}],742:[function(t,e,n){arguments[4][656][0].apply(n,arguments)},{"@turf/helpers":743,"@turf/invariant":744,dup:656,geodesy:751}],743:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],744:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],745:[function(t,e,n){arguments[4][633][0].apply(n,arguments)},{dup:633}],746:[function(t,e,n){arguments[4][634][0].apply(n,arguments)},{"./dms.js":745,"./vector3d.js":754,dup:634}],747:[function(t,e,n){arguments[4][635][0].apply(n,arguments)},{"./dms":745,dup:635}],748:[function(t,e,n){arguments[4][636][0].apply(n,arguments)},{"./dms.js":745,"./vector3d.js":754,dup:636}],749:[function(t,e,n){arguments[4][637][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":746,dup:637}],750:[function(t,e,n){arguments[4][638][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":746,"./utm.js":753,dup:638}],751:[function(t,e,n){arguments[4][639][0].apply(n,arguments)},{"./dms.js":745,"./latlon-ellipsoidal.js":746,"./latlon-spherical.js":747,"./latlon-vectors.js":748,"./latlon-vincenty.js":749,"./mgrs.js":750,"./osgridref.js":752,"./utm.js":753,"./vector3d.js":754,dup:639}],752:[function(t,e,n){arguments[4][640][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":746,dup:640}],753:[function(t,e,n){arguments[4][641][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":746,dup:641}],754:[function(t,e,n){arguments[4][642][0].apply(n,arguments)},{dup:642}],755:[function(t,e,n){function i(t,e,n){var i="Point"===t.type||t.geometry&&"Point"===t.geometry.type;return n=r(t,n),1===e||i?t:(g(t,function(t){var i=f(n,t),r=h(n,t),o=i*e,s=m(p(n,o,r));t[0]=s[0],t[1]=s[1],3===t.length&&(t[2]*=e)}),t)}function r(t,e){if(void 0!==e&&null!==e||(e="centroid"),Array.isArray(e)||"object"==typeof e)return y(e);var n=t.bbox?t.bbox:l(t),i=n[0],r=n[1],o=n[2],a=n[3];switch(e){case"sw":case"southwest":case"westsouth":case"bottomleft":return d([i,r]);case"se":case"southeast":case"eastsouth":case"bottomright":return d([o,r]);case"nw":case"northwest":case"westnorth":case"topleft":return d([i,a]);case"ne":case"northeast":case"eastnorth":case"topright":return d([o,a]);case"center":return s(t);case void 0:case null:case"centroid":return u(t);default:throw new Error("invalid origin")}}var o=t("@turf/meta"),s=t("@turf/center"),a=t("@turf/helpers"),u=t("@turf/centroid"),l=t("@turf/bbox"),c=t("@turf/invariant"),h=t("@turf/rhumb-bearing"),f=t("@turf/rhumb-distance"),p=t("@turf/rhumb-destination"),d=a.point,g=o.coordEach,v=o.featureEach,y=c.getCoord,m=c.getCoords;e.exports=function(t,e,n,r){if(!t)throw new Error("geojson required");if("number"!=typeof e||0===e)throw new Error("invalid factor");var o=Array.isArray(n)||"object"==typeof n;return!0!==r&&(t=JSON.parse(JSON.stringify(t))),"FeatureCollection"!==t.type||o?i(t,e,n):(v(t,function(r,o){t.features[o]=i(r,e,n)}),t)}},{"@turf/bbox":756,"@turf/center":758,"@turf/centroid":762,"@turf/helpers":765,"@turf/invariant":766,"@turf/meta":767,"@turf/rhumb-bearing":768,"@turf/rhumb-destination":780,"@turf/rhumb-distance":793}],756:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"@turf/meta":757,dup:22}],757:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],758:[function(t,e,n){arguments[4][122][0].apply(n,arguments)},{"@turf/bbox":759,"@turf/helpers":761,dup:122}],759:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"@turf/meta":760,dup:22}],760:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],761:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],762:[function(t,e,n){arguments[4][132][0].apply(n,arguments)},{"@turf/helpers":763,"@turf/meta":764,dup:132}],763:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],764:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],765:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],766:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],767:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],768:[function(t,e,n){arguments[4][631][0].apply(n,arguments)},{"@turf/invariant":769,dup:631,geodesy:776}],769:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],770:[function(t,e,n){arguments[4][633][0].apply(n,arguments)},{dup:633}],771:[function(t,e,n){arguments[4][634][0].apply(n,arguments)},{"./dms.js":770,"./vector3d.js":779,dup:634}],772:[function(t,e,n){arguments[4][635][0].apply(n,arguments)},{"./dms":770,dup:635}],773:[function(t,e,n){arguments[4][636][0].apply(n,arguments)},{"./dms.js":770,"./vector3d.js":779,dup:636}],774:[function(t,e,n){arguments[4][637][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":771,dup:637}],775:[function(t,e,n){arguments[4][638][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":771,"./utm.js":778,dup:638}],776:[function(t,e,n){arguments[4][639][0].apply(n,arguments)},{"./dms.js":770,"./latlon-ellipsoidal.js":771,"./latlon-spherical.js":772,"./latlon-vectors.js":773,"./latlon-vincenty.js":774,"./mgrs.js":775,"./osgridref.js":777,"./utm.js":778,"./vector3d.js":779,dup:639}],777:[function(t,e,n){arguments[4][640][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":771,dup:640}],778:[function(t,e,n){arguments[4][641][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":771,dup:641}],779:[function(t,e,n){arguments[4][642][0].apply(n,arguments)},{dup:642}],780:[function(t,e,n){arguments[4][643][0].apply(n,arguments)},{"@turf/helpers":781,"@turf/invariant":782,dup:643,geodesy:789}],781:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],782:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],783:[function(t,e,n){arguments[4][633][0].apply(n,arguments)},{dup:633}],784:[function(t,e,n){arguments[4][634][0].apply(n,arguments)},{"./dms.js":783,"./vector3d.js":792,dup:634}],785:[function(t,e,n){arguments[4][635][0].apply(n,arguments)},{"./dms":783,dup:635}],786:[function(t,e,n){arguments[4][636][0].apply(n,arguments)},{"./dms.js":783,"./vector3d.js":792,dup:636}],787:[function(t,e,n){arguments[4][637][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":784,dup:637}],788:[function(t,e,n){arguments[4][638][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":784,"./utm.js":791,dup:638}],789:[function(t,e,n){arguments[4][639][0].apply(n,arguments)},{"./dms.js":783,"./latlon-ellipsoidal.js":784,"./latlon-spherical.js":785,"./latlon-vectors.js":786,"./latlon-vincenty.js":787,"./mgrs.js":788,"./osgridref.js":790,"./utm.js":791,"./vector3d.js":792,dup:639}],790:[function(t,e,n){arguments[4][640][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":784,dup:640}],791:[function(t,e,n){arguments[4][641][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":784,dup:641}],792:[function(t,e,n){arguments[4][642][0].apply(n,arguments)},{dup:642}],793:[function(t,e,n){arguments[4][656][0].apply(n,arguments)},{"@turf/helpers":794,"@turf/invariant":795,dup:656,geodesy:802}],794:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],795:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],796:[function(t,e,n){arguments[4][633][0].apply(n,arguments)},{dup:633}],797:[function(t,e,n){arguments[4][634][0].apply(n,arguments)},{"./dms.js":796,"./vector3d.js":805,dup:634}],798:[function(t,e,n){arguments[4][635][0].apply(n,arguments)},{"./dms":796,dup:635}],799:[function(t,e,n){arguments[4][636][0].apply(n,arguments)},{"./dms.js":796,"./vector3d.js":805,dup:636}],800:[function(t,e,n){arguments[4][637][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":797,dup:637}],801:[function(t,e,n){arguments[4][638][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":797,"./utm.js":804,dup:638}],802:[function(t,e,n){arguments[4][639][0].apply(n,arguments)},{"./dms.js":796,"./latlon-ellipsoidal.js":797,"./latlon-spherical.js":798,"./latlon-vectors.js":799,"./latlon-vincenty.js":800,"./mgrs.js":801,"./osgridref.js":803,"./utm.js":804,"./vector3d.js":805,dup:639}],803:[function(t,e,n){arguments[4][640][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":797,dup:640}],804:[function(t,e,n){arguments[4][641][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":797,dup:641}],805:[function(t,e,n){arguments[4][642][0].apply(n,arguments)},{dup:642}],806:[function(t,e,n){var i=t("@turf/meta"),r=t("@turf/invariant"),o=t("@turf/rhumb-destination"),s=i.coordEach,a=r.getCoords;e.exports=function(t,e,n,i,r,u){if(!t)throw new Error("geojson is required");if(void 0===e||null===e||isNaN(e))throw new Error("distance is required");if(r&&"number"!=typeof r&&isNaN(r))throw new Error("zTranslation is not a number");if(r=void 0!==r?r:0,0===e&&0===r)return t;if(void 0===n||null===n||isNaN(n))throw new Error("direction is required");return e<0&&(e=-e,n=-n),!1!==u&&void 0!==u||(t=JSON.parse(JSON.stringify(t))),s(t,function(t){var s=a(o(t,e,n,i));t[0]=s[0],t[1]=s[1],r&&3===t.length&&(t[2]+=r)}),t}},{"@turf/invariant":807,"@turf/meta":808,"@turf/rhumb-destination":809}],807:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],808:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],809:[function(t,e,n){arguments[4][643][0].apply(n,arguments)},{"@turf/helpers":810,"@turf/invariant":811,dup:643,geodesy:818}],810:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],811:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],812:[function(t,e,n){arguments[4][633][0].apply(n,arguments)},{dup:633}],813:[function(t,e,n){arguments[4][634][0].apply(n,arguments)},{"./dms.js":812,"./vector3d.js":821,dup:634}],814:[function(t,e,n){arguments[4][635][0].apply(n,arguments)},{"./dms":812,dup:635}],815:[function(t,e,n){arguments[4][636][0].apply(n,arguments)},{"./dms.js":812,"./vector3d.js":821,dup:636}],816:[function(t,e,n){arguments[4][637][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":813,dup:637}],817:[function(t,e,n){arguments[4][638][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":813,"./utm.js":820,dup:638}],818:[function(t,e,n){arguments[4][639][0].apply(n,arguments)},{"./dms.js":812,"./latlon-ellipsoidal.js":813,"./latlon-spherical.js":814,"./latlon-vectors.js":815,"./latlon-vincenty.js":816,"./mgrs.js":817,"./osgridref.js":819,"./utm.js":820,"./vector3d.js":821,dup:639}],819:[function(t,e,n){arguments[4][640][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":813,dup:640}],820:[function(t,e,n){arguments[4][641][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":813,dup:641}],821:[function(t,e,n){arguments[4][642][0].apply(n,arguments)},{dup:642}],822:[function(t,e,n){arguments[4][332][0].apply(n,arguments)},{"@turf/distance":823,"@turf/helpers":826,dup:332}],823:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":824,"@turf/invariant":825,dup:8}],824:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],825:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],826:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],827:[function(t,e,n){arguments[4][521][0].apply(n,arguments)},{"@turf/meta":828,dup:521}],828:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],829:[function(t,e,n){arguments[4][212][0].apply(n,arguments)},{dup:212,jsts:830}],830:[function(t,e,n){arguments[4][130][0].apply(n,arguments)},{dup:130}],831:[function(t,e,n){var i=t("simplepolygon"),r=t("@turf/flatten"),o=t("@turf/meta").featureEach,s=t("@turf/helpers").featureCollection;e.exports=function(t){var e=s([]);return o(t,function(t){"MultiPolygon"===t.geometry.type&&(t=r(t)),o(t,function(t){var n=i(t);o(n,function(n){n.properties=t.properties?t.properties:{},e.features.push(n)})})}),e}},{"@turf/flatten":834,"@turf/helpers":837,"@turf/meta":840,simplepolygon:847}],832:[function(t,e,n){arguments[4][13][0].apply(n,arguments)},{dup:13,wgs84:848}],833:[function(t,e,n){arguments[4][342][0].apply(n,arguments)},{"@mapbox/geojson-area":832,"@turf/meta":840,dup:342}],834:[function(t,e,n){arguments[4][267][0].apply(n,arguments)},{"@turf/helpers":835,"@turf/meta":836,dup:267}],835:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],836:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],837:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],838:[function(t,e,n){arguments[4][615][0].apply(n,arguments)},{"@turf/invariant":839,dup:615}],839:[function(t,e,n){arguments[4][350][0].apply(n,arguments)},{dup:350}],840:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],841:[function(t,e,n){(function(i){function r(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function o(t){var e=this.useColors;if(t[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+t[0]+(e?"%c ":" ")+"+"+n.humanize(this.diff),e){var i="color: "+this.color;t.splice(1,0,i,"color: inherit");var r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,function(t){"%%"!==t&&(r++,"%c"===t&&(o=r))}),t.splice(o,0,i)}}function s(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(t){try{null==t?n.storage.removeItem("debug"):n.storage.debug=t}catch(t){}}function u(){var t;try{t=n.storage.debug}catch(t){}return!t&&void 0!==i&&"env"in i&&(t=i.env.DEBUG),t}n=e.exports=t("./debug"),n.log=s,n.formatArgs=o,n.save=a,n.load=u,n.useColors=r,n.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},n.enable(u())}).call(this,t("_process"))},{"./debug":842,_process:853}],842:[function(t,e,n){function i(t){var e,i=0;for(e in t)i=(i<<5)-i+t.charCodeAt(e),i|=0;return n.colors[Math.abs(i)%n.colors.length]}function r(t){function e(){if(e.enabled){var t=e,i=+new Date,r=i-(l||i);t.diff=r,t.prev=l,t.curr=i,l=i;for(var o=new Array(arguments.length),s=0;s<o.length;s++)o[s]=arguments[s];o[0]=n.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var a=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,function(e,i){if("%%"===e)return e;a++;var r=n.formatters[i];if("function"==typeof r){var s=o[a];e=r.call(t,s),o.splice(a,1),a--}return e}),n.formatArgs.call(t,o);(e.log||n.log||console.log.bind(console)).apply(t,o)}}return e.namespace=t,e.enabled=n.enabled(t),e.useColors=n.useColors(),e.color=i(t),"function"==typeof n.init&&n.init(e),e}function o(t){n.save(t),n.names=[],n.skips=[];for(var e=("string"==typeof t?t:"").split(/[\s,]+/),i=e.length,r=0;r<i;r++)e[r]&&(t=e[r].replace(/\*/g,".*?"),"-"===t[0]?n.skips.push(new RegExp("^"+t.substr(1)+"$")):n.names.push(new RegExp("^"+t+"$")))}function s(){n.enable("")}function a(t){var e,i;for(e=0,i=n.skips.length;e<i;e++)if(n.skips[e].test(t))return!1;for(e=0,i=n.names.length;e<i;e++)if(n.names[e].test(t))return!0;return!1}function u(t){return t instanceof Error?t.stack||t.message:t}n=e.exports=r.debug=r.default=r,n.coerce=u,n.disable=s,n.enable=o,n.enabled=a,n.humanize=t("ms"),n.names=[],n.skips=[],n.formatters={};var l},{ms:844}],843:[function(t,e,n){function i(t,e,n,i){if(r(t,n)||r(t,i)||r(e,n)||r(i,n))return null;var o=t[0],s=t[1],a=e[0],u=e[1],l=n[0],c=n[1],h=i[0],f=i[1],p=(o-a)*(c-f)-(s-u)*(l-h);return 0==p?null:[((o*u-s*a)*(l-h)-(o-a)*(l*f-c*h))/p,((o*u-s*a)*(c-f)-(s-u)*(l*f-c*h))/p]}function r(t,e){if(!t||!e)return!1;if(t.length!=e.length)return!1;for(var n=0,i=t.length;n<i;n++)if(t[n]instanceof Array&&e[n]instanceof Array){if(!r(t[n],e[n]))return!1}else if(t[n]!=e[n])return!1;return!0}var o=t("rbush");e.exports=function(t,e,n){function r(t,n,r,o){var s=a[t][n],c=a[t][n+1],h=a[r][o],f=a[r][o+1],p=i(s,c,h,f);if(null!=p){var d=(p[0]-s[0])/(c[0]-s[0]),g=(p[0]-h[0])/(f[0]-h[0]);if(!(d>=1||d<=0||g>=1||g<=0)){var v=p,y=!l[v];y&&(l[v]=!0),e?u.push(e(p,t,n,s,c,d,r,o,h,f,g,y)):u.push(p)}}}function s(t,e){var n=a[t][e],i=a[t][e+1];if(n[0]<i[0])var r=n[0],o=i[0];else var r=i[0],o=n[0];if(n[1]<i[1])var s=n[1],u=i[1];else var s=i[1],u=n[1];return{minX:r,minY:s,maxX:o,maxY:u,ring:t,edge:e}}if("Polygon"!=t.geometry.type)throw new Error("The input feature must be a Polygon");n||(n=1);var a=t.geometry.coordinates,u=[],l={};if(n){for(var c=[],h=0;h<a.length;h++)for(var f=0;f<a[h].length-1;f++)c.push(s(h,f));var p=o();p.load(c)}for(var h=0;h<a.length;h++)for(var f=0;f<a[h].length-1;f++)if(n){var d=p.search(s(h,f));d.forEach(function(t){var e=t.ring,n=t.edge;r(h,f,e,n)})}else for(var g=0;g<a.length;g++)for(var v=0;v<a[g].length-1;v++)r(h,f,g,v);return e||(u={type:"Feature",geometry:{type:"MultiPoint",coordinates:u}}),u}},{rbush:846}],844:[function(t,e,n){function i(t){if(t=String(t),!(t.length>100)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*h;case"days":case"day":case"d":return n*c;case"hours":case"hour":case"hrs":case"hr":case"h":return n*l;case"minutes":case"minute":case"mins":case"min":case"m":return n*u;case"seconds":case"second":case"secs":case"sec":case"s":return n*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function r(t){return t>=c?Math.round(t/c)+"d":t>=l?Math.round(t/l)+"h":t>=u?Math.round(t/u)+"m":t>=a?Math.round(t/a)+"s":t+"ms"}function o(t){return s(t,c,"day")||s(t,l,"hour")||s(t,u,"minute")||s(t,a,"second")||t+" ms"}function s(t,e,n){if(!(t<e))return t<1.5*e?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var a=1e3,u=60*a,l=60*u,c=24*l,h=365.25*c;e.exports=function(t,e){e=e||{};var n=typeof t;if("string"===n&&t.length>0)return i(t);if("number"===n&&!1===isNaN(t))return e.long?o(t):r(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},{}],845:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],846:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53,quickselect:845}],847:[function(t,e,n){function i(t,e){if(void 0===e&&(e=!0),3!=t.length)throw new Error("This function requires an array of three points [x,y]");return(t[1][0]-t[0][0])*(t[2][1]-t[0][1])-(t[1][1]-t[0][1])*(t[2][0]-t[0][0])>=0==e}function r(t){for(var e=0,n=0;n<t.length-1;n++)t[n][0]<t[e][0]&&(e=n);if(i([t[(e-1).modulo(t.length-1)],t[e],t[(e+1).modulo(t.length-1)]],!0))var r=1;else var r=-1;return r}function o(t,e){if(!t||!e)return!1;if(t.length!=e.length)return!1;for(var n=0,i=t.length;n<i;n++)if(t[n]instanceof Array&&e[n]instanceof Array){if(!o(t[n],e[n]))return!1}else if(t[n]!=e[n])return!1;return!0}function s(t){for(var e={},n=1,i=0,r=t.length;i<r;++i){if(e.hasOwnProperty(t[i])){n=0;break}e[t[i]]=1}return n}var a=t("geojson-polygon-self-intersections"),u=t("@turf/helpers"),l=t("@turf/inside"),c=t("@turf/area"),h=t("rbush"),f=t("debug")("simplepolygon"),p=t("debug")("simplepolygon:all");e.exports=function(t){function e(){for(var t=[],e=0;e<C.features.length;e++)p("Output ring "+e+" has parent "+C.features[e].properties.parent),-1==C.features[e].properties.parent&&t.push(e);if(p("The following output ring(s) have no parent: "+t),t.length>1)for(var e=0;e<t.length;e++){for(var n=-1,i=0;i<C.features.length;i++)t[e]!=i&&l(u.point(C.features[t[e]].geometry.coordinates[0][0]),C.features[i],!0)&&c(C.features[i])<1/0&&(n=i,p("Ring "+t[e]+" lies inside output ring "+i));C.features[t[e]].properties.parent=n,p("Ring "+t[e]+" is assigned parent "+n)}}function n(){for(var t=0;t<C.features.length;t++)if(-1==C.features[t].properties.parent){var e=C.features[t].properties.winding;C.features[t].properties.netWinding=e,v(t,e)}}function v(t,e){for(var n=0;n<C.features.length;n++)if(C.features[n].properties.parent==t){var i=e+C.features[n].properties.winding;C.features[n].properties.netWinding=i,v(n,i)}}if("Feature"!=t.type)throw new Error("The input must a geojson object of type Feature");if(void 0===t.geometry||null==t.geometry)throw new Error("The input must a geojson object with a non-empty geometry");if("Polygon"!=t.geometry.type)throw new Error("The input must be a geojson Polygon");for(var y=t.geometry.coordinates.length,m=[],x=0;x<y;x++){var E=t.geometry.coordinates[x];o(E[0],E[E.length-1])||E.push(E[0]),m.push.apply(m,E.slice(0,E.length-1))}if(!s(m))throw new Error("The input polygon may not have duplicate vertices (except for the first and last vertex of each ring)");var w=m.length;f("Processing input");var b=a(t,function(t,e,n,i,r,o,s,a,u,l,c,h){return[t,e,n,i,r,o,s,a,u,l,c,h]}),I=b.length;if(f("Computing self-intersections"),0==I){for(var N=[],x=0;x<y;x++)N.push(u.polygon([t.geometry.coordinates[x]],{parent:-1,winding:r(t.geometry.coordinates[x])}));var C=u.featureCollection(N);return e(),n(),p("No self-intersections found. Input rings are output rings. Computed winding numbers, net winding numbers and parents"),f("Finishing without self-intersections"),C}for(var S=[],M=[],x=0;x<y;x++){S.push([]);for(var L=0;L<t.geometry.coordinates[x].length-1;L++)S[x].push([new d(t.geometry.coordinates[x][(L+1).modulo(t.geometry.coordinates[x].length-1)],1,[x,L],[x,(L+1).modulo(t.geometry.coordinates[x].length-1)],void 0)]),M.push(new g(t.geometry.coordinates[x][L],[x,(L-1).modulo(t.geometry.coordinates[x].length-1)],[x,L],void 0,void 0,!1,!0))}for(var x=0;x<I;x++)S[b[x][1]][b[x][2]].push(new d(b[x][0],b[x][5],[b[x][1],b[x][2]],[b[x][6],b[x][7]],void 0)),b[x][11]&&M.push(new g(b[x][0],[b[x][1],b[x][2]],[b[x][6],b[x][7]],void 0,void 0,!0,!0));for(var R=M.length,x=0;x<S.length;x++)for(var L=0;L<S[x].length;L++)S[x][L].sort(function(t,e){return t.param<e.param?-1:1});f("Setting up pseudoVtxListByRingAndEdge and isectList"),allIsectsAsIsectRbushTreeItem=[];for(var x=0;x<R;x++)allIsectsAsIsectRbushTreeItem.push({minX:M[x].coord[0],minY:M[x].coord[1],maxX:M[x].coord[0],maxY:M[x].coord[1],index:x});var P=h();P.load(allIsectsAsIsectRbushTreeItem);for(var x=0;x<S.length;x++)for(var L=0;L<S[x].length;L++)for(var T=0;T<S[x][L].length;T++){var O;O=T==S[x][L].length-1?S[x][(L+1).modulo(t.geometry.coordinates[x].length-1)][0].coord:S[x][L][T+1].coord;var _=P.search({minX:O[0],minY:O[1],maxX:O[0],maxY:O[1]})[0];S[x][L][T].nxtIsectAlongEdgeIn=_.index}f("Computing nextIsect for pseudoVtxListByRingAndEdge");for(var x=0;x<S.length;x++)for(var L=0;L<S[x].length;L++)for(var T=0;T<S[x][L].length;T++){var O=S[x][L][T].coord,_=P.search({minX:O[0],minY:O[1],maxX:O[0],maxY:O[1]})[0],A=_.index
;A<w?M[A].nxtIsectAlongRingAndEdge2=S[x][L][T].nxtIsectAlongEdgeIn:o(M[A].ringAndEdge1,S[x][L][T].ringAndEdgeIn)?M[A].nxtIsectAlongRingAndEdge1=S[x][L][T].nxtIsectAlongEdgeIn:M[A].nxtIsectAlongRingAndEdge2=S[x][L][T].nxtIsectAlongEdgeIn}f("Porting nextIsect to isectList");for(var D=[],x=0,L=0;L<y;L++){for(var F=x,T=0;T<t.geometry.coordinates[L].length-1;T++)M[x].coord[0]<M[F].coord[0]&&(F=x),x++;for(var q=M[F].nxtIsectAlongRingAndEdge2,T=0;T<M.length;T++)if(M[T].nxtIsectAlongRingAndEdge1==F||M[T].nxtIsectAlongRingAndEdge2==F){var k=T;break}var G=i([M[k].coord,M[F].coord,M[q].coord],!0)?1:-1;D.push({isect:F,parent:-1,winding:G})}D.sort(function(t,e){return M[t.isect].coord>M[e.isect].coord?-1:1}),p("Initial state of the queue: "+JSON.stringify(D)),f("Setting up queue");for(var N=[];D.length>0;){var j=D.pop(),B=j.isect,z=j.parent,V=j.winding,X=N.length,Y=[M[B].coord];p("# Starting output ring number "+N.length+" with winding "+V+" from intersection "+B),B<w&&p("This is a ring-vertex-intersections, which means this output ring does not touch existing output rings");var U=B;if(M[B].ringAndEdge1Walkable)var W=M[B].ringAndEdge1,H=M[B].nxtIsectAlongRingAndEdge1;else var W=M[B].ringAndEdge2,H=M[B].nxtIsectAlongRingAndEdge2;for(;!o(M[B].coord,M[H].coord);){p("Walking from intersection "+U+" to "+H+" over ring "+W[0]+" and edge "+W[1]),Y.push(M[H].coord),p("Adding intersection "+H+" to current output ring");for(var J=void 0,x=0;x<D.length;x++)if(D[x].isect==H){J=x;break}if(void 0!=J&&(p("Removing intersection "+H+" from queue"),D.splice(J,1)),o(W,M[H].ringAndEdge1)){if(W=M[H].ringAndEdge2,M[H].ringAndEdge2Walkable=!1,M[H].ringAndEdge1Walkable){p("Adding intersection "+H+" to queue");var Z={isect:H};i([M[U].coord,M[H].coord,M[M[H].nxtIsectAlongRingAndEdge2].coord],1==V)?(Z.parent=z,Z.winding=-V):(Z.parent=X,Z.winding=V),D.push(Z)}U=H,H=M[H].nxtIsectAlongRingAndEdge2}else{if(W=M[H].ringAndEdge1,M[H].ringAndEdge1Walkable=!1,M[H].ringAndEdge2Walkable){p("Adding intersection "+H+" to queue");var Z={isect:H};i([M[U].coord,M[H].coord,M[M[H].nxtIsectAlongRingAndEdge1].coord],1==V)?(Z.parent=z,Z.winding=-V):(Z.parent=X,Z.winding=V),D.push(Z)}U=H,H=M[H].nxtIsectAlongRingAndEdge1}p("Current state of the queue: "+JSON.stringify(D))}p("Walking from intersection "+U+" to "+H+" over ring "+W[0]+" and edge "+W[1]+" and closing ring"),Y.push(M[H].coord),N.push(u.polygon([Y],{index:X,parent:z,winding:V,netWinding:void 0}))}var C=u.featureCollection(N);return f("Walking"),e(),f("Determining parents"),n(),f("Setting winding number"),p("# Total of "+C.features.length+" rings"),C};var d=function(t,e,n,i,r){this.coord=t,this.param=e,this.ringAndEdgeIn=n,this.ringAndEdgeOut=i,this.nxtIsectAlongEdgeIn=r},g=function(t,e,n,i,r,o,s){this.coord=t,this.ringAndEdge1=e,this.ringAndEdge2=n,this.nxtIsectAlongRingAndEdge1=i,this.nxtIsectAlongRingAndEdge2=r,this.ringAndEdge1Walkable=o,this.ringAndEdge2Walkable=s};Number.prototype.modulo=function(t){return(this%t+t)%t}},{"@turf/area":833,"@turf/helpers":837,"@turf/inside":838,debug:841,"geojson-polygon-self-intersections":843,rbush:846}],848:[function(t,e,n){arguments[4][15][0].apply(n,arguments)},{dup:15}],849:[function(t,e,n){var i=t("@turf/inside"),r=t("@turf/helpers").featureCollection;e.exports=function(t,e){for(var n=r([]),o=0;o<e.features.length;o++)for(var s=0;s<t.features.length;s++){var a=i(t.features[s],e.features[o]);a&&n.features.push(t.features[s])}return n}},{"@turf/helpers":850,"@turf/inside":851}],850:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],851:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{"@turf/invariant":852,dup:34}],852:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],853:[function(t,e,n){function i(){if(!a){a=!0;for(var t,e=s.length;e;){t=s,s=[];for(var n=-1;++n<e;)t[n]();e=s.length}a=!1}}function r(){}var o=e.exports={},s=[],a=!1;o.nextTick=function(t){s.push(t),a||setTimeout(i,0)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=r,o.addListener=r,o.once=r,o.off=r,o.removeListener=r,o.removeAllListeners=r,o.emit=r,o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}]},{},[1])(1)});