text: var Multiselect=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=77)}([function(t,e){t.exports=Origo},function(t,e){t=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),"number"==typeof __g&&(__g=t)},function(t,e,n){var r=n(62)("wks"),i=n(63),o=n(1).Symbol,s="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=s&&o[t]||(s?o:i)("Symbol."+t))}).store=r},function(t,e,n){var r=n(36)("wks"),i=n(35),o=n(7).Symbol,s="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=s&&o[t]||(s?o:i)("Symbol."+t))}).store=r},function(t,e){t=t.exports={version:"2.6.11"},"number"==typeof __e&&(__e=t)},function(t,e,n){t.exports=n(95)},function(t,e,n){var r=n(13);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),"number"==typeof __g&&(__g=t)},function(t,e,n){var r=n(1),i=n(4),o=n(20),s=n(9),a=n(23),u="prototype",c=function(t,e,n){var l,p,h,f=t&c.F,g=t&c.G,d=t&c.S,y=t&c.P,_=t&c.B,m=t&c.W,v=g?i:i[e]||(i[e]={}),x=v[u],E=g?r:d?r[e]:(r[e]||{})[u];for(l in g&&(n=e),n)(p=!f&&E&&void 0!==E[l])&&a(v,l)||(h=(p?E:n)[l],v[l]=g&&"function"!=typeof E[l]?n[l]:_&&p?o(h,r):m&&E[l]==h?function(t){function e(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)}return e[u]=t[u],e}(h):y&&"function"==typeof h?o(Function.call,h):h,y&&((v.virtual||(v.virtual={}))[l]=h,t&c.R&&x&&!x[l]&&s(x,l,h)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,e,n){var r=n(22),i=n(49);t.exports=n(14)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){t.exports=!n(34)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e,n){var r=n(25),i=n(53);t.exports=n(10)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){"use strict";function r(t,e,n){void 0===n&&(n={});var r={type:"Feature"};return 0!==n.id&&!n.id||(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function i(t,e,n){return void 0===n&&(n={}),r({type:"Point",coordinates:t},e,n)}function o(t,e,n){void 0===n&&(n={});for(var i=0,o=t;i<o.length;i++){var s=o[i];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 r({type:"Polygon",coordinates:t},e,n)}function s(t,e,n){if(void 0===n&&(n={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return r({type:"LineString",coordinates:t},e,n)}function a(t,e){void 0===e&&(e={});var n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}function u(t,e,n){return void 0===n&&(n={}),r({type:"MultiLineString",coordinates:t},e,n)}function c(t,e,n){return void 0===n&&(n={}),r({type:"MultiPoint",coordinates:t},e,n)}function l(t,e,n){return void 0===n&&(n={}),r({type:"MultiPolygon",coordinates:t},e,n)}function p(t,n){void 0===n&&(n="kilometers");var r=e.factors[n];if(!r)throw new Error(n+" units is invalid");return t*r}function h(t,n){void 0===n&&(n="kilometers");var r=e.factors[n];if(!r)throw new Error(n+" units is invalid");return t/r}function f(t){return t%(2*Math.PI)*180/Math.PI}function g(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)&&!/^\s*$/.test(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.earthRadius=6371008.8,e.factors={centimeters:100*e.earthRadius,centimetres:100*e.earthRadius,degrees:e.earthRadius/111325,feet:3.28084*e.earthRadius,inches:39.37*e.earthRadius,kilometers:e.earthRadius/1e3,kilometres:e.earthRadius/1e3,meters:e.earthRadius,metres:e.earthRadius,miles:e.earthRadius/1609.344,millimeters:1e3*e.earthRadius,millimetres:1e3*e.earthRadius,nauticalmiles:e.earthRadius/1852,radians:1,yards:e.earthRadius/1.0936},e.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/e.earthRadius,yards:1/1.0936},e.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},e.feature=r,e.geometry=function(t,e,n){switch(void 0===n&&(n={}),t){case"Point":return i(e).geometry;case"LineString":return s(e).geometry;case"Polygon":return o(e).geometry;case"MultiPoint":return c(e).geometry;case"MultiLineString":return u(e).geometry;case"MultiPolygon":return l(e).geometry;default:throw new Error(t+" is invalid")}},e.point=i,e.points=function(t,e,n){return void 0===n&&(n={}),a(t.map((function(t){return i(t,e)})),n)},e.polygon=o,e.polygons=function(t,e,n){return void 0===n&&(n={}),a(t.map((function(t){return o(t,e)})),n)},e.lineString=s,e.lineStrings=function(t,e,n){return void 0===n&&(n={}),a(t.map((function(t){return s(t,e)})),n)},e.featureCollection=a,e.multiLineString=u,e.multiPoint=c,e.multiPolygon=l,e.geometryCollection=function(t,e,n){return void 0===n&&(n={}),r({type:"GeometryCollection",geometries:t},e,n)},e.round=function(t,e){if(void 0===e&&(e=0),e&&!(0<=e))throw new Error("precision must be a positive number");return e=Math.pow(10,e||0),Math.round(t*e)/e},e.radiansToLength=p,e.lengthToRadians=h,e.lengthToDegrees=function(t,e){return f(h(t,e))},e.bearingToAzimuth=function(t){return(t%=360)<0&&(t+=360),t},e.radiansToDegrees=f,e.degreesToRadians=function(t){return t%360*Math.PI/180},e.convertLength=function(t,e,n){if(void 0===e&&(e="kilometers"),void 0===n&&(n="kilometers"),!(0<=t))throw new Error("length must be a positive number");return p(h(t,e),n)},e.convertArea=function(t,n,r){if(void 0===n&&(n="meters"),void 0===r&&(r="kilometers"),!(0<=t))throw new Error("area must be a positive number");if(!(n=e.areaFactors[n]))throw new Error("invalid original units");if(!(r=e.areaFactors[r]))throw new Error("invalid final units");return t/n*r},e.isNumber=g,e.isObject=function(t){return!!t&&t.constructor===Object},e.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!g(t))throw new Error("bbox must only contain numbers")}))},e.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")},e.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},e.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},e.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},e.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},e.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},e.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},e.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){t.exports=!n(32)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e,n){var r=n(16);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(7),i=n(11),o=n(26),s=n(35)("src"),a=n(88),u="toString",c=(""+a).split(u);n(37).inspectSource=function(t){return a.call(t)},(t.exports=function(t,e,n,a){var u="function"==typeof n;u&&(o(n,"name")||i(n,"name",e)),t[e]!==n&&(u&&(o(n,s)||i(n,s,t[e]?""+t[e]:c.join(String(e)))),t===r?t[e]=n:a?t[e]?t[e]=n:i(t,e,n):(delete t[e],i(t,e,n)))})(Function.prototype,u,(function(){return"function"==typeof this&&this[s]||a.call(this)}))},function(t,e){t.exports={}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(12);function i(t,e,n){if(null!==t)for(var r,o,s,a,u,c,l,p=0,h=t.type,f="FeatureCollection"===h,g="Feature"===h,d=f?t.features.length:1,y=0;y<d;y++){a=(l=!!(c=f?t.features[y].geometry:g?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var _=0;_<a;_++){var m,v=0,x=0;if(null!==(m=l?c.geometries[_]:c)){u=m.coordinates;var E=m.type,I=!n||"Polygon"!==E&&"MultiPolygon"!==E?0:1;switch(E){case null:break;case"Point":if(!1===e(u,p,y,v,x))return!1;p++,v++;break;case"LineString":case"MultiPoint":for(r=0;r<u.length;r++){if(!1===e(u[r],p,y,v,x))return!1;p++,"MultiPoint"===E&&v++}"LineString"===E&&v++;break;case"Polygon":case"MultiLineString":for(r=0;r<u.length;r++){for(o=0;o<u[r].length-I;o++){if(!1===e(u[r][o],p,y,v,x))return!1;p++}"MultiLineString"===E&&v++,"Polygon"===E&&x++}"Polygon"===E&&v++;break;case"MultiPolygon":for(r=0;r<u.length;r++){for(o=x=0;o<u[r].length;o++){for(s=0;s<u[r][o].length-I;s++){if(!1===e(u[r][o][s],p,y,v,x))return!1;p++}x++}v++}break;case"GeometryCollection":for(r=0;r<m.geometries.length;r++)if(!1===i(m.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function o(t,e){var n;switch(t.type){case"FeatureCollection":for(n=0;n<t.features.length&&!1!==e(t.features[n].properties,n);n++);break;case"Feature":e(t.properties,0)}}function s(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length&&!1!==e(t.features[n],n);n++);}function a(t,e){for(var n,r,i,o,s,a,u,c,l,p=0,h="FeatureCollection"===t.type,f="Feature"===t.type,g=h?t.features.length:1,d=0;d<g;d++){for(s=h?t.features[d].geometry:f?t.geometry:t,u=h?t.features[d].properties:f?t.properties:{},c=h?t.features[d].bbox:f?t.bbox:void 0,l=h?t.features[d].id:f?t.id:void 0,o=(a=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,r=0;r<o;r++)if(null!==(i=a?s.geometries[r]:s))switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(i,p,u,c,l))return!1;break;case"GeometryCollection":for(n=0;n<i.geometries.length;n++)if(!1===e(i.geometries[n],p,u,c,l))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,p,u,c,l))return!1;p++}}function u(t,e){a(t,(function(t,n,i,o,s){var a,u=null===t?null:t.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return!1!==e(r.feature(t,i,{bbox:o,id:s}),n,0)&&void 0}switch(u){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var c=0;c<t.coordinates.length;c++){var l={type:a,coordinates:t.coordinates[c]};if(!1===e(r.feature(l,i),n,c))return!1}}))}function c(t,e){u(t,(function(t,n,o){var s=0;if(t.geometry){var a=t.geometry.type;if("Point"!==a&&"MultiPoint"!==a){var u,c=0,l=0,p=0;return!1!==i(t,(function(i,a,h,f,g){return void 0===u||c<n||l<f||p<g?(u=i,c=n,l=f,p=g,void(s=0)):(f=r.lineString([u,i],t.properties),!1!==e(f,n,o,g,s)&&(s++,void(u=i)))}))&&void 0}}}))}function l(t,e){if(!t)throw new Error("geojson is required");u(t,(function(t,n,i){if(null!==t.geometry){var o=t.geometry.type,s=t.geometry.coordinates;switch(o){case"LineString":if(!1===e(t,n,i,0,0))return!1;break;case"Polygon":for(var a=0;a<s.length;a++)if(!1===e(r.lineString(s[a],t.properties),n,i,a))return!1}}}))}e.coordEach=i,e.coordReduce=function(t,e,n,r){var o=n;return i(t,(function(t,r,i,s,a){o=0===r&&void 0===n?t:e(o,t,r,i,s,a)}),r),o},e.propEach=o,e.propReduce=function(t,e,n){var r=n;return o(t,(function(t,i){r=0===i&&void 0===n?t:e(r,t,i)})),r},e.featureEach=s,e.featureReduce=function(t,e,n){var r=n;return s(t,(function(t,i){r=0===i&&void 0===n?t:e(r,t,i)})),r},e.coordAll=function(t){var e=[];return i(t,(function(t){e.push(t)})),e},e.geomEach=a,e.geomReduce=function(t,e,n){var r=n;return a(t,(function(t,i,o,s,a){r=0===i&&void 0===n?t:e(r,t,i,o,s,a)})),r},e.flattenEach=u,e.flattenReduce=function(t,e,n){var r=n;return u(t,(function(t,i,o){r=0===i&&0===o&&void 0===n?t:e(r,t,i,o)})),r},e.segmentEach=c,e.segmentReduce=function(t,e,n){var r=n,i=!1;return c(t,(function(t,o,s,a,u){r=!1===i&&void 0===n?t:e(r,t,o,s,a,u),i=!0})),r},e.lineEach=l,e.lineReduce=function(t,e,n){var r=n;return l(t,(function(t,i,o,s){r=0===i&&void 0===n?t:e(r,t,i,o,s)})),r},e.findSegment=function(t,e){if(e=e||{},!r.isObject(e))throw new Error("options is invalid");var n,i=e.featureIndex||0,o=e.multiFeatureIndex||0,s=e.geometryIndex||0,a=e.segmentIndex||0,u=e.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),u=u||t.features[i].properties,n=t.features[i].geometry;break;case"Feature":u=u||t.properties,n=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=t;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var c=n.coordinates;switch(n.type){case"Point":case"MultiPoint":return null;case"LineString":return a<0&&(a=c.length+a-1),r.lineString([c[a],c[a+1]],u,e);case"Polygon":return s<0&&(s=c.length+s),a<0&&(a=c[s].length+a-1),r.lineString([c[s][a],c[s][a+1]],u,e);case"MultiLineString":return o<0&&(o=c.length+o),a<0&&(a=c[o].length+a-1),r.lineString([c[o][a],c[o][a+1]],u,e);case"MultiPolygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s),a<0&&(a=c[o][s].length-a-1),r.lineString([c[o][s][a],c[o][s][a+1]],u,e)}throw new Error("geojson is invalid")},e.findPoint=function(t,e){if(e=e||{},!r.isObject(e))throw new Error("options is invalid");var n,i=e.featureIndex||0,o=e.multiFeatureIndex||0,s=e.geometryIndex||0,a=e.coordIndex||0,u=e.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),u=u||t.features[i].properties,n=t.features[i].geometry;break;case"Feature":u=u||t.properties,n=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=t;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var c=n.coordinates;switch(n.type){case"Point":return r.point(c,u,e);case"MultiPoint":return o<0&&(o=c.length+o),r.point(c[o],u,e);case"LineString":return a<0&&(a=c.length+a),r.point(c[a],u,e);case"Polygon":return s<0&&(s=c.length+s),a<0&&(a=c[s].length+a),r.point(c[s][a],u,e);case"MultiLineString":return o<0&&(o=c.length+o),a<0&&(a=c[o].length+a),r.point(c[o][a],u,e);case"MultiPolygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s),a<0&&(a=c[o][s].length-a),r.point(c[o][s][a],u,e)}throw new Error("geojson is invalid")}},function(t,e,n){var r=n(21);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var r=n(6),i=n(80),o=n(81),s=Object.defineProperty;e.f=n(14)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on  "+t);return t}},function(t,e,n){var r=n(15),i=n(86),o=n(87),s=Object.defineProperty;e.f=n(10)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(7),i=n(37),o=n(11),s=n(17),a=n(55),u="prototype",c=function(t,e,n){var l,p,h,f=t&c.F,g=t&c.G,d=t&c.S,y=t&c.P,_=t&c.B,m=g?r:d?r[e]||(r[e]={}):(r[e]||{})[u],v=g?i:i[e]||(i[e]={}),x=v[u]||(v[u]={});for(l in g&&(n=e),n)p=((h=!f&&m&&void 0!==m[l])?m:n)[l],h=_&&h?a(p,r):y&&"function"==typeof p?a(Function.call,p):p,m&&s(m,l,p,t&c.U),v[l]!=p&&o(v,l,h),y&&x[l]!=p&&(x[l]=p)};r.core=i,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(12);e.getCoord=function(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&2<=t.length&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")},e.getCoords=function(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")},e.containsNumber=function t(e){if(1<e.length&&r.isNumber(e[0])&&r.isNumber(e[1]))return!0;if(Array.isArray(e[0])&&e[0].length)return t(e[0]);throw new Error("coordinates must only contain numbers")},e.geojsonType=function(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)},e.featureOf=function(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)},e.collectionOf=function(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 r=0,i=t.features;r<i.length;r++){var o=i[r];if(!o||"Feature"!==o.type||!o.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!o.geometry||o.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+o.geometry.type)}},e.getGeom=function(t){return"Feature"===t.type?t.geometry:t},e.getType=function(t,e){return"FeatureCollection"===t.type?"FeatureCollection":"GeometryCollection"===t.type?"GeometryCollection":("Feature"===t.type&&null!==t.geometry?t.geometry:t).type}},function(t,e,n){!function(t){"use strict";function e(){}function n(t){this.message=t||""}function r(t){this.message=t||""}function i(t){this.message=t||""}function o(){}function s(t){return null===t?Dt:t.color}function a(t){return null===t?null:t.parent}function u(t,e){null!==t&&(t.color=e)}function c(t){return null===t?null:t.left}function l(t){return null===t?null:t.right}function p(){this.root_=null,this.size_=0}function h(){}function f(){this.array_=[],arguments[0]instanceof xt&&this.addAll(arguments[0])}function g(){}function d(t){this.message=t||""}function y(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(null==this)throw new TypeError(this+" is not an object");var e=Object(this),n=Math.max(Math.min(e.length,9007199254740991),0)||0,r=1 in arguments&&parseInt(Number(arguments[1]),10)||0;r=r<0?Math.max(n+r,0):Math.min(r,n);var i=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:n;for(i=i<0?Math.max(n+arguments[2],0):Math.min(i,n);r<i;)e[r]=t,++r;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)};var _=function(){};_.prototype.interfaces_=function(){return[]},_.prototype.getClass=function(){return _},_.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var m=function(t){function e(e){t.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),v=function(){},x={MAX_VALUE:{configurable:!0}};v.isNaN=function(t){return Number.isNaN(t)},v.doubleToLongBits=function(t){return t},v.longBitsToDouble=function(t){return t},v.isInfinite=function(t){return!Number.isFinite(t)},x.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(v,x);var E=function(){},I=function(){},N=function(){},b=function t(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)this.x=0,this.y=0,this.z=t.NULL_ORDINATE;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.z=e.z}else 2===arguments.length?(this.x=arguments[0],this.y=arguments[1],this.z=t.NULL_ORDINATE):3===arguments.length&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},C={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};b.prototype.setOrdinate=function(t,e){switch(t){case b.X:this.x=e;break;case b.Y:this.y=e;break;case b.Z:this.z=e;break;default:throw new m("Invalid ordinate index: "+t)}},b.prototype.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],n=arguments[1];return!!_.equalsWithTolerance(this.x,e.x,n)&&!!_.equalsWithTolerance(this.y,e.y,n)}},b.prototype.getOrdinate=function(t){switch(t){case b.X:return this.x;case b.Y:return this.y;case b.Z:return this.z}throw new m("Invalid ordinate index: "+t)},b.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||v.isNaN(this.z))&&v.isNaN(t.z)},b.prototype.equals=function(t){return t instanceof b&&this.equals2D(t)},b.prototype.equalInZ=function(t,e){return _.equalsWithTolerance(this.z,t.z,e)},b.prototype.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},b.prototype.clone=function(){},b.prototype.copy=function(){return new b(this)},b.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},b.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return Math.sqrt(e*e+n*n+r*r)},b.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},b.prototype.hashCode=function(){var t=17;return 37*(t=37*t+b.hashCode(this.x))+b.hashCode(this.y)},b.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},b.prototype.interfaces_=function(){return[E,I,e]},b.prototype.getClass=function(){return b},b.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=v.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},C.DimensionalComparator.get=function(){return w},C.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},C.NULL_ORDINATE.get=function(){return v.NaN},C.X.get=function(){return 0},C.Y.get=function(){return 1},C.Z.get=function(){return 2},Object.defineProperties(b,C);var w=function(t){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var e=arguments[0];if(2!==e&&3!==e)throw new m("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};w.prototype.compare=function(t,e){var n=t,r=e,i=w.compare(n.x,r.x);if(0!==i)return i;var o=w.compare(n.y,r.y);return 0!==o?o:this._dimensionsToTest<=2?0:w.compare(n.z,r.z)},w.prototype.interfaces_=function(){return[N]},w.prototype.getClass=function(){return w},w.compare=function(t,e){return t<e?-1:t>e?1:v.isNaN(t)?v.isNaN(e)?0:-1:v.isNaN(e)?1:0};var S=function(){};S.prototype.create=function(){},S.prototype.interfaces_=function(){return[]},S.prototype.getClass=function(){return S};var L=function(){},P={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};L.prototype.interfaces_=function(){return[]},L.prototype.getClass=function(){return L},L.toLocationSymbol=function(t){switch(t){case L.EXTERIOR:return"e";case L.BOUNDARY:return"b";case L.INTERIOR:return"i";case L.NONE:return"-"}throw new m("Unknown location value: "+t)},P.INTERIOR.get=function(){return 0},P.BOUNDARY.get=function(){return 1},P.EXTERIOR.get=function(){return 2},P.NONE.get=function(){return-1},Object.defineProperties(L,P);var O=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},T=function(){},R={LOG_10:{configurable:!0}};T.prototype.interfaces_=function(){return[]},T.prototype.getClass=function(){return T},T.log10=function(t){var e=Math.log(t);return v.isInfinite(e)||v.isNaN(e)?e:e/T.LOG_10},T.min=function(t,e,n,r){var i=t;return e<i&&(i=e),n<i&&(i=n),r<i&&(i=r),i},T.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 r=arguments[0],i=arguments[1],o=arguments[2];return r<i?i:r>o?o:r}},T.wrap=function(t,e){return t<0?e- -t%e:t%e},T.max=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=t;return e>r&&(r=e),n>r&&(r=n),r}if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=i;return o>u&&(u=o),s>u&&(u=s),a>u&&(u=a),u}},T.average=function(t,e){return(t+e)/2},R.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(T,R);var M=function(t){this.str=t};M.prototype.append=function(t){this.str+=t},M.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},M.prototype.toString=function(t){return this.str};var D=function(t){this.value=t};D.prototype.intValue=function(){return this.value},D.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},D.isNaN=function(t){return Number.isNaN(t)};var A=function(){};A.isWhitespace=function(t){return t<=32&&t>=0||127===t},A.toUpperCase=function(t){return t.toUpperCase()};var F=function t(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length){if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}else if("string"==typeof arguments[0]){var r=arguments[0];t.call(this,t.parse(r))}}else if(2===arguments.length){var i=arguments[0],o=arguments[1];this.init(i,o)}},G={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};F.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},F.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),r=F.magnitude(n._hi),i=F.TEN.pow(r);(n=n.divide(i)).gt(F.TEN)?(n=n.divide(F.TEN),r+=1):n.lt(F.ONE)&&(n=n.multiply(F.TEN),r-=1);for(var o=r+1,s=new M,a=F.MAX_PRINT_DIGITS-1,u=0;u<=a;u++){t&&u===o&&s.append(".");var c=Math.trunc(n._hi);if(c<0)break;var l=!1,p=0;c>9?(l=!0,p="9"):p="0"+c,s.append(p),n=n.subtract(F.valueOf(c)).multiply(F.TEN),l&&n.selfAdd(F.TEN);var h=!0,f=F.magnitude(n._hi);if(f<0&&Math.abs(f)>=a-u&&(h=!1),!h)break}return e[0]=r,s.toString()},F.prototype.sqr=function(){return this.multiply(this)},F.prototype.doubleValue=function(){return this._hi+this._lo},F.prototype.subtract=function(){if(arguments[0]instanceof F){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},F.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},F.prototype.isZero=function(){return 0===this._hi&&0===this._lo},F.prototype.selfSubtract=function(){if(arguments[0]instanceof F){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)}},F.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},F.prototype.min=function(t){return this.le(t)?this:t},F.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof F){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],r=arguments[1],i=null,o=null,s=null,a=null,u=null,c=null,l=null,p=null;return u=this._hi/n,p=(i=(c=F.SPLIT*u)-(i=c-u))*(s=(p=F.SPLIT*n)-(s=p-n))-(l=u*n)+i*(a=n-s)+(o=u-i)*s+o*a,p=u+(c=(this._hi-l-p+this._lo-u*r)/n),this._hi=p,this._lo=u-p+c,this}},F.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},F.prototype.divide=function(){if(arguments[0]instanceof F){var t=arguments[0],e=null,n=null,r=null,i=null,o=null,s=null,a=null,u=null;return n=(o=this._hi/t._hi)-(e=(s=F.SPLIT*o)-(e=s-o)),u=e*(r=(u=F.SPLIT*t._hi)-(r=u-t._hi))-(a=o*t._hi)+e*(i=t._hi-r)+n*r+n*i,s=(this._hi-a-u+this._lo-o*t._lo)/t._hi,new F(u=o+s,o-u+s)}if("number"==typeof arguments[0]){var c=arguments[0];return v.isNaN(c)?F.createNaN():F.copy(this).selfDivide(c,0)}},F.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},F.prototype.pow=function(t){if(0===t)return F.valueOf(1);var e=new F(this),n=F.valueOf(1),r=Math.abs(t);if(r>1)for(;r>0;)r%2==1&&n.selfMultiply(e),(r/=2)>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},F.prototype.ceil=function(){if(this.isNaN())return F.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new F(t,e)},F.prototype.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},F.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},F.prototype.setValue=function(){if(arguments[0]instanceof F){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},F.prototype.max=function(t){return this.ge(t)?this:t},F.prototype.sqrt=function(){if(this.isZero())return F.valueOf(0);if(this.isNegative())return F.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=F.valueOf(e),r=this.subtract(n.sqr())._hi*(.5*t);return n.add(r)},F.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof F){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0],n=null,r=null,i=null,o=null,s=null,a=null;return o=(i=this._hi+e)-(s=i-this._hi),r=(a=(o=e-s+(this._hi-o))+this._lo)+(i-(n=i+a)),this._hi=n+r,this._lo=r+(n-this._hi),this}}else if(2===arguments.length){var u=arguments[0],c=arguments[1],l=null,p=null,h=null,f=null,g=null,d=null,y=null;f=this._hi+u,p=this._lo+c,g=f-(d=f-this._hi),h=p-(y=p-this._lo);var _=(l=f+(d=(g=u-d+(this._hi-g))+p))+(d=(h=c-y+(this._lo-h))+(d+(f-l))),m=d+(l-_);return this._hi=_,this._lo=m,this}},F.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof F){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],r=arguments[1],i=null,o=null,s=null,a=null,u=null,c=null;i=(u=F.SPLIT*this._hi)-this._hi,c=F.SPLIT*n,i=u-i,o=this._hi-i,s=c-n;var l=(u=this._hi*n)+(c=i*(s=c-s)-u+i*(a=n-s)+o*s+o*a+(this._hi*r+this._lo*n)),p=c+(i=u-l);return this._hi=l,this._lo=p,this}},F.prototype.selfSqr=function(){return this.selfMultiply(this)},F.prototype.floor=function(){if(this.isNaN())return F.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new F(t,e)},F.prototype.negate=function(){return this.isNaN()?this:new F(-this._hi,-this._lo)},F.prototype.clone=function(){},F.prototype.multiply=function(){if(arguments[0]instanceof F){var t=arguments[0];return t.isNaN()?F.createNaN():F.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return v.isNaN(e)?F.createNaN():F.copy(this).selfMultiply(e,0)}},F.prototype.isNaN=function(){return v.isNaN(this._hi)},F.prototype.intValue=function(){return Math.trunc(this._hi)},F.prototype.toString=function(){var t=F.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},F.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),r=e[0]+1,i=n;if("."===n.charAt(0))i="0"+n;else if(r<0)i="0."+F.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var o=r-n.length;i=n+F.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},F.prototype.reciprocal=function(){var t,e,n,r,i=null,o=null,s=null,a=null;t=(n=1/this._hi)-(i=(s=F.SPLIT*n)-(i=s-n)),o=(a=F.SPLIT*this._hi)-this._hi;var u=n+(s=(1-(r=n*this._hi)-(a=i*(o=a-o)-r+i*(e=this._hi-o)+t*o+t*e)-n*this._lo)/this._hi);return new F(u,n-u+s)},F.prototype.toSciNotation=function(){if(this.isZero())return F.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),r=F.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new Error("Found leading zero: "+n);var i="";n.length>1&&(i=n.substring(1));var o=n.charAt(0)+"."+i;return this.isNegative()?"-"+o+r:o+r},F.prototype.abs=function(){return this.isNaN()?F.NaN:this.isNegative()?this.negate():new F(this)},F.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},F.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},F.prototype.add=function(){if(arguments[0]instanceof F){var t=arguments[0];return F.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){var e=arguments[0];return F.copy(this).selfAdd(e)}},F.prototype.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 F){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._hi=n,this._lo=r}},F.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},F.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},F.prototype.trunc=function(){return this.isNaN()?F.NaN:this.isPositive()?this.floor():this.ceil()},F.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},F.prototype.interfaces_=function(){return[e,E,I]},F.prototype.getClass=function(){return F},F.sqr=function(t){return F.valueOf(t).selfMultiply(t)},F.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return F.parse(t)}if("number"==typeof arguments[0]){var e=arguments[0];return new F(e)}},F.sqrt=function(t){return F.valueOf(t).sqrt()},F.parse=function(t){for(var e=0,n=t.length;A.isWhitespace(t.charAt(e));)e++;var r=!1;if(e<n){var i=t.charAt(e);"-"!==i&&"+"!==i||(e++,"-"===i&&(r=!0))}for(var o=new F,s=0,a=0,u=0;!(e>=n);){var c=t.charAt(e);if(e++,A.isDigit(c)){var l=c-"0";o.selfMultiply(F.TEN),o.selfAdd(l),s++}else{if("."!==c){if("e"===c||"E"===c){var p=t.substring(e);try{u=D.parseInt(p)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+p+" in string "+t):e}break}throw new Error("Unexpected character '"+c+"' at position "+e+" in string "+t)}a=s}}var h=o,f=s-a-u;if(0===f)h=o;else if(f>0){var g=F.TEN.pow(f);h=o.divide(g)}else if(f<0){var d=F.TEN.pow(-f);h=o.multiply(d)}return r?h.negate():h},F.createNaN=function(){return new F(v.NaN,v.NaN)},F.copy=function(t){return new F(t)},F.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),r=Math.trunc(Math.floor(n));return 10*Math.pow(10,r)<=e&&(r+=1),r},F.stringOfChar=function(t,e){for(var n=new M,r=0;r<e;r++)n.append(t);return n.toString()},G.PI.get=function(){return new F(3.141592653589793,12246467991473532e-32)},G.TWO_PI.get=function(){return new F(6.283185307179586,24492935982947064e-32)},G.PI_2.get=function(){return new F(1.5707963267948966,6123233995736766e-32)},G.E.get=function(){return new F(2.718281828459045,14456468917292502e-32)},G.NaN.get=function(){return new F(v.NaN,v.NaN)},G.EPS.get=function(){return 123259516440783e-46},G.SPLIT.get=function(){return 134217729},G.MAX_PRINT_DIGITS.get=function(){return 32},G.TEN.get=function(){return F.valueOf(10)},G.ONE.get=function(){return F.valueOf(1)},G.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},G.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(F,G);var B=function(){},q={DP_SAFE_EPSILON:{configurable:!0}};B.prototype.interfaces_=function(){return[]},B.prototype.getClass=function(){return B},B.orientationIndex=function(t,e,n){var r=B.orientationIndexFilter(t,e,n);if(r<=1)return r;var i=F.valueOf(e.x).selfAdd(-t.x),o=F.valueOf(e.y).selfAdd(-t.y),s=F.valueOf(n.x).selfAdd(-e.x),a=F.valueOf(n.y).selfAdd(-e.y);return i.selfMultiply(a).selfSubtract(o.selfMultiply(s)).signum()},B.signOfDet2x2=function(t,e,n,r){return t.multiply(r).selfSubtract(e.multiply(n)).signum()},B.intersection=function(t,e,n,r){var i=F.valueOf(r.y).selfSubtract(n.y).selfMultiply(F.valueOf(e.x).selfSubtract(t.x)),o=F.valueOf(r.x).selfSubtract(n.x).selfMultiply(F.valueOf(e.y).selfSubtract(t.y)),s=i.subtract(o),a=F.valueOf(r.x).selfSubtract(n.x).selfMultiply(F.valueOf(t.y).selfSubtract(n.y)),u=F.valueOf(r.y).selfSubtract(n.y).selfMultiply(F.valueOf(t.x).selfSubtract(n.x)),c=a.subtract(u).selfDivide(s).doubleValue(),l=F.valueOf(t.x).selfAdd(F.valueOf(e.x).selfSubtract(t.x).selfMultiply(c)).doubleValue(),p=F.valueOf(e.x).selfSubtract(t.x).selfMultiply(F.valueOf(t.y).selfSubtract(n.y)),h=F.valueOf(e.y).selfSubtract(t.y).selfMultiply(F.valueOf(t.x).selfSubtract(n.x)),f=p.subtract(h).selfDivide(s).doubleValue(),g=F.valueOf(n.y).selfAdd(F.valueOf(r.y).selfSubtract(n.y).selfMultiply(f)).doubleValue();return new b(l,g)},B.orientationIndexFilter=function(t,e,n){var r=null,i=(t.x-n.x)*(e.y-n.y),o=(t.y-n.y)*(e.x-n.x),s=i-o;if(i>0){if(o<=0)return B.signum(s);r=i+o}else{if(!(i<0))return B.signum(s);if(o>=0)return B.signum(s);r=-i-o}var a=B.DP_SAFE_EPSILON*r;return s>=a||-s>=a?B.signum(s):2},B.signum=function(t){return t>0?1:t<0?-1:0},q.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(B,q);var k=function(){},V={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};V.X.get=function(){return 0},V.Y.get=function(){return 1},V.Z.get=function(){return 2},V.M.get=function(){return 3},k.prototype.setOrdinate=function(t,e,n){},k.prototype.size=function(){},k.prototype.getOrdinate=function(t,e){},k.prototype.getCoordinate=function(){},k.prototype.getCoordinateCopy=function(t){},k.prototype.getDimension=function(){},k.prototype.getX=function(t){},k.prototype.clone=function(){},k.prototype.expandEnvelope=function(t){},k.prototype.copy=function(){},k.prototype.getY=function(t){},k.prototype.toCoordinateArray=function(){},k.prototype.interfaces_=function(){return[I]},k.prototype.getClass=function(){return k},Object.defineProperties(k,V);var U=function(){},j=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(U),z=function(){};z.arraycopy=function(t,e,n,r,i){for(var o=0,s=e;s<e+i;s++)n[r+o]=t[s],o++},z.getProperty=function(t){return{"line.separator":"\n"}[t]};var X=function t(){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 e=arguments[0];this.x=e.x,this.y=e.y,this.w=1}else if(2===arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this.x=n,this.y=r,this.w=1}else if(arguments[0]instanceof t&&arguments[1]instanceof t){var i=arguments[0],o=arguments[1];this.x=i.y*o.w-o.y*i.w,this.y=o.x*i.w-i.x*o.w,this.w=i.x*o.y-o.x*i.y}else if(arguments[0]instanceof b&&arguments[1]instanceof b){var s=arguments[0],a=arguments[1];this.x=s.y-a.y,this.y=a.x-s.x,this.w=s.x*a.y-a.x*s.y}}else if(3===arguments.length){var u=arguments[0],c=arguments[1],l=arguments[2];this.x=u,this.y=c,this.w=l}else if(4===arguments.length){var p=arguments[0],h=arguments[1],f=arguments[2],g=arguments[3],d=p.y-h.y,y=h.x-p.x,_=p.x*h.y-h.x*p.y,m=f.y-g.y,v=g.x-f.x,x=f.x*g.y-g.x*f.y;this.x=y*x-v*_,this.y=m*_-d*x,this.w=d*v-m*y}};X.prototype.getY=function(){var t=this.y/this.w;if(v.isNaN(t)||v.isInfinite(t))throw new j;return t},X.prototype.getX=function(){var t=this.x/this.w;if(v.isNaN(t)||v.isInfinite(t))throw new j;return t},X.prototype.getCoordinate=function(){var t=new b;return t.x=this.getX(),t.y=this.getY(),t},X.prototype.interfaces_=function(){return[]},X.prototype.getClass=function(){return X},X.intersection=function(t,e,n,r){var i=t.y-e.y,o=e.x-t.x,s=t.x*e.y-e.x*t.y,a=n.y-r.y,u=r.x-n.x,c=n.x*r.y-r.x*n.y,l=i*u-a*o,p=(o*c-u*s)/l,h=(a*s-i*c)/l;if(v.isNaN(p)||v.isInfinite(p)||v.isNaN(h)||v.isInfinite(h))throw new j;return new b(p,h)};var Y=function t(){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 b){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(4===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];this.init(o,s,a,u)}},H={serialVersionUID:{configurable:!0}};Y.prototype.getArea=function(){return this.getWidth()*this.getHeight()},Y.prototype.equals=function(t){if(!(t instanceof Y))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()},Y.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new Y;var e=this._minx>t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,r=this._maxx<t._maxx?this._maxx:t._maxx,i=this._maxy<t._maxy?this._maxy:t._maxy;return new Y(e,r,n,i)},Y.prototype.isNull=function(){return this._maxx<this._minx},Y.prototype.getMaxX=function(){return this._maxx},Y.prototype.covers=function(){if(1===arguments.length){if(arguments[0]instanceof b){var t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof Y){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],r=arguments[1];return!this.isNull()&&n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy}},Y.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof Y){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 b){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&!(n>this._maxx||n<this._minx||r>this._maxy||r<this._miny)}},Y.prototype.getMinY=function(){return this._miny},Y.prototype.getMinX=function(){return this._minx},Y.prototype.expandToInclude=function(){if(1===arguments.length){if(arguments[0]instanceof b){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof Y){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],r=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=r,this._maxy=r):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),r<this._miny&&(this._miny=r),r>this._maxy&&(this._maxy=r))}},Y.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},Y.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},Y.prototype.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},Y.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},Y.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Y.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Y.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Y.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},Y.prototype.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()}},Y.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof Y){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof b){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.covers(n,r)}},Y.prototype.centre=function(){return this.isNull()?null:new b((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Y.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof b){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof Y){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],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];i<o?(this._minx=i,this._maxx=o):(this._minx=o,this._maxx=i),s<a?(this._miny=s,this._maxy=a):(this._miny=a,this._maxy=s)}},Y.prototype.getMaxY=function(){return this._maxy},Y.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var 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)},Y.prototype.hashCode=function(){var t=17;return 37*(t=37*(t=37*(t=37*t+b.hashCode(this._minx))+b.hashCode(this._maxx))+b.hashCode(this._miny))+b.hashCode(this._maxy)},Y.prototype.interfaces_=function(){return[E,e]},Y.prototype.getClass=function(){return Y},Y.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 r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=Math.min(o.x,s.x),u=Math.max(o.x,s.x),c=Math.min(r.x,i.x),l=Math.max(r.x,i.x);return!(c>u||l<a||(a=Math.min(o.y,s.y),u=Math.max(o.y,s.y),c=Math.min(r.y,i.y),l=Math.max(r.y,i.y),c>u||l<a))}},H.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(Y,H);var W={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*$/},K=function(t){this.geometryFactory=t||new _e};K.prototype.read=function(t){var e,n,r;t=t.replace(/[\n\r]/g," ");var i=W.typeStr.exec(t);if(-1!==t.search("EMPTY")&&((i=W.emptyTypeStr.exec(t))[2]=void 0),i&&(n=i[1].toLowerCase(),r=i[2],Q[n]&&(e=Q[n].apply(this,[r]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},K.prototype.write=function(t){return this.extractGeometry(t)},K.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!J[e])return null;var n=e.toUpperCase();return t.isEmpty()?n+" EMPTY":n+"("+J[e].apply(this,[t])+")"};var J={coordinate:function(t){return t.x+" "+t.y},point:function(t){return J.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+J.point.apply(this,[t._geometries[n]])+")");return e.join(",")},linestring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push(J.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},linearring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push(J.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},multilinestring:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+J.linestring.apply(this,[t._geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+J.linestring.apply(this,[t._shell])+")");for(var n=0,r=t._holes.length;n<r;++n)e.push("("+J.linestring.apply(this,[t._holes[n]])+")");return e.join(",")},multipolygon:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+J.polygon.apply(this,[t._geometries[n]])+")");return e.join(",")},geometrycollection:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push(this.extractGeometry(t._geometries[n]));return e.join(",")}},Q={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(W.spaces);return this.geometryFactory.createPoint(new b(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(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(W.trimParens,"$1"),r.push(Q.point.apply(this,[e]));return this.geometryFactory.createMultiPoint(r)},linestring:function(t){if(void 0===t)return this.geometryFactory.createLineString();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].trim().split(W.spaces),r.push(new b(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLineString(r)},linearring:function(t){if(void 0===t)return this.geometryFactory.createLinearRing();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].trim().split(W.spaces),r.push(new b(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLinearRing(r)},multilinestring:function(t){if(void 0===t)return this.geometryFactory.createMultiLineString();for(var e,n=t.trim().split(W.parenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(W.trimParens,"$1"),r.push(Q.linestring.apply(this,[e]));return this.geometryFactory.createMultiLineString(r)},polygon:function(t){if(void 0===t)return this.geometryFactory.createPolygon();for(var e,n,r,i,o=t.trim().split(W.parenComma),s=[],a=0,u=o.length;a<u;++a)e=o[a].replace(W.trimParens,"$1"),n=Q.linestring.apply(this,[e]),r=this.geometryFactory.createLinearRing(n._points),0===a?i=r:s.push(r);return this.geometryFactory.createPolygon(i,s)},multipolygon:function(t){if(void 0===t)return this.geometryFactory.createMultiPolygon();for(var e,n=t.trim().split(W.doubleParenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(W.trimParens,"$1"),r.push(Q.polygon.apply(this,[e]));return this.geometryFactory.createMultiPolygon(r)},geometrycollection:function(t){if(void 0===t)return this.geometryFactory.createGeometryCollection();for(var e=(t=t.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),n=[],r=0,i=e.length;r<i;++r)n.push(this.read(e[r]));return this.geometryFactory.createGeometryCollection(n)}},Z=function(t){this.parser=new K(t)};Z.prototype.write=function(t){return this.parser.write(t)},Z.toLineString=function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var $=function(t){function e(e){t.call(this,e),this.name="RuntimeException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),tt=function(t){function e(){if(t.call(this),0===arguments.length)t.call(this);else if(1===arguments.length){var e=arguments[0];t.call(this,e)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}($),et=function(){};et.prototype.interfaces_=function(){return[]},et.prototype.getClass=function(){return et},et.shouldNeverReachHere=function(){if(0===arguments.length)et.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new tt("Should never reach here"+(null!==t?": "+t:""))}},et.isTrue=function(){var t;if(1===arguments.length)et.isTrue(arguments[0],null);else if(2===arguments.length&&(t=arguments[1],!arguments[0]))throw null===t?new tt:new tt(t)},et.equals=function(){var t,e,n;if(2===arguments.length)et.equals(t=arguments[0],e=arguments[1],null);else if(3===arguments.length&&(t=arguments[0],n=arguments[2],!(e=arguments[1]).equals(t)))throw new tt("Expected "+t+" but encountered "+e+(null!==n?": "+n:""))};var nt=function(){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 b,this._intPt[1]=new b,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},rt={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};nt.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},nt.prototype.getTopologySummary=function(){var t=new M;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},nt.prototype.computeIntersection=function(t,e,n,r){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=n,this._inputLines[1][1]=r,this._result=this.computeIntersect(t,e,n,r)},nt.prototype.getIntersectionNum=function(){return this._result},nt.prototype.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];this.getEdgeDistance(t,0)>this.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},nt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},nt.prototype.setPrecisionModel=function(t){this._precisionModel=t},nt.prototype.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}},nt.prototype.getIntersection=function(t){return this._intPt[t]},nt.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},nt.prototype.hasIntersection=function(){return this._result!==nt.NO_INTERSECTION},nt.prototype.getEdgeDistance=function(t,e){return nt.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1])},nt.prototype.isCollinear=function(){return this._result===nt.COLLINEAR_INTERSECTION},nt.prototype.toString=function(){return Z.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Z.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},nt.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},nt.prototype.isIntersection=function(t){for(var e=0;e<this._result;e++)if(this._intPt[e].equals2D(t))return!0;return!1},nt.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},nt.prototype.interfaces_=function(){return[]},nt.prototype.getClass=function(){return nt},nt.computeEdgeDistance=function(t,e,n){var r=Math.abs(n.x-e.x),i=Math.abs(n.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(n))o=r>i?r:i;else{var s=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y);0!==(o=r>i?s:a)||t.equals(e)||(o=Math.max(s,a))}return et.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},nt.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=Math.sqrt(r*r+i*i);return et.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},rt.DONT_INTERSECT.get=function(){return 0},rt.DO_INTERSECT.get=function(){return 1},rt.COLLINEAR.get=function(){return 2},rt.NO_INTERSECTION.get=function(){return 0},rt.POINT_INTERSECTION.get=function(){return 1},rt.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(nt,rt);var it=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(t){var e=new Y(this._inputLines[0][0],this._inputLines[0][1]),n=new Y(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&n.contains(t)},e.prototype.computeIntersection=function(){if(3!==arguments.length)return t.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],n=arguments[1],r=arguments[2];if(this._isProper=!1,Y.intersects(n,r,e)&&0===at.orientationIndex(n,r,e)&&0===at.orientationIndex(r,n,e))return this._isProper=!0,(e.equals(n)||e.equals(r))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(t,e,n,r,i){i.x=this.smallestInAbsValue(t.x,e.x,n.x,r.x),i.y=this.smallestInAbsValue(t.y,e.y,n.y,r.y),t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.safeHCoordinateIntersection=function(t,n,r,i){var o=null;try{o=X.intersection(t,n,r,i)}catch(s){if(!(s instanceof j))throw s;o=e.nearestEndpoint(t,n,r,i)}return o},e.prototype.intersection=function(t,n,r,i){var o=this.intersectionWithNormalization(t,n,r,i);return this.isInSegmentEnvelopes(o)||(o=new b(e.nearestEndpoint(t,n,r,i))),null!==this._precisionModel&&this._precisionModel.makePrecise(o),o},e.prototype.smallestInAbsValue=function(t,e,n,r){var i=t,o=Math.abs(i);return Math.abs(e)<o&&(i=e,o=Math.abs(e)),Math.abs(n)<o&&(i=n,o=Math.abs(n)),Math.abs(r)<o&&(i=r),i},e.prototype.checkDD=function(t,e,n,r,i){var o=B.intersection(t,e,n,r),s=this.isInSegmentEnvelopes(o);z.out.println("DD in env = "+s+"  --------------------- "+o),i.distance(o)>1e-4&&z.out.println("Distance = "+i.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,n,r){var i=new b(t),o=new b(e),s=new b(n),a=new b(r),u=new b;this.normalizeToEnvCentre(i,o,s,a,u);var c=this.safeHCoordinateIntersection(i,o,s,a);return c.x+=u.x,c.y+=u.y,c},e.prototype.computeCollinearIntersection=function(e,n,r,i){var o=Y.intersects(e,n,r),s=Y.intersects(e,n,i),a=Y.intersects(r,i,e),u=Y.intersects(r,i,n);return o&&s?(this._intPt[0]=r,this._intPt[1]=i,t.COLLINEAR_INTERSECTION):a&&u?(this._intPt[0]=e,this._intPt[1]=n,t.COLLINEAR_INTERSECTION):o&&a?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||s||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&u?(this._intPt[0]=r,this._intPt[1]=n,!r.equals(n)||s||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&a?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||o||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&u?(this._intPt[0]=i,this._intPt[1]=n,!i.equals(n)||o||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,n,r,i){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,c=n.x<r.x?n.x:r.x,l=n.y<r.y?n.y:r.y,p=n.x>r.x?n.x:r.x,h=n.y>r.y?n.y:r.y,f=((o>c?o:c)+(a<p?a:p))/2,g=((s>l?s:l)+(u<h?u:h))/2;i.x=f,i.y=g,t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.computeIntersect=function(e,n,r,i){if(this._isProper=!1,!Y.intersects(e,n,r,i))return t.NO_INTERSECTION;var o=at.orientationIndex(e,n,r),s=at.orientationIndex(e,n,i);if(o>0&&s>0||o<0&&s<0)return t.NO_INTERSECTION;var a=at.orientationIndex(r,i,e),u=at.orientationIndex(r,i,n);return a>0&&u>0||a<0&&u<0?t.NO_INTERSECTION:0===o&&0===s&&0===a&&0===u?this.computeCollinearIntersection(e,n,r,i):(0===o||0===s||0===a||0===u?(this._isProper=!1,e.equals2D(r)||e.equals2D(i)?this._intPt[0]=e:n.equals2D(r)||n.equals2D(i)?this._intPt[0]=n:0===o?this._intPt[0]=new b(r):0===s?this._intPt[0]=new b(i):0===a?this._intPt[0]=new b(e):0===u&&(this._intPt[0]=new b(n))):(this._isProper=!0,this._intPt[0]=this.intersection(e,n,r,i)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,n,r){var i=t,o=at.distancePointLine(t,n,r),s=at.distancePointLine(e,n,r);return s<o&&(o=s,i=e),(s=at.distancePointLine(n,t,e))<o&&(o=s,i=n),(s=at.distancePointLine(r,t,e))<o&&(o=s,i=r),i},e}(nt),ot=function(){};ot.prototype.interfaces_=function(){return[]},ot.prototype.getClass=function(){return ot},ot.orientationIndex=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=n.x-e.x,s=n.y-e.y;return ot.signOfDet2x2(r,i,o,s)},ot.signOfDet2x2=function(t,e,n,r){var i=null,o=null,s=null;if(i=1,0===t||0===r)return 0===e||0===n?0:e>0?n>0?-i:i:n>0?i:-i;if(0===e||0===n)return r>0?t>0?i:-i:t>0?-i:i;if(e>0?r>0?e<=r||(i=-i,o=t,t=n,n=o,o=e,e=r,r=o):e<=-r?(i=-i,n=-n,r=-r):(o=t,t=-n,n=o,o=e,e=-r,r=o):r>0?-e<=r?(i=-i,t=-t,e=-e):(o=-t,t=n,n=o,o=-e,e=r,r=o):e>=r?(t=-t,e=-e,n=-n,r=-r):(i=-i,o=-t,t=-n,n=o,o=-e,e=-r,r=o),t>0){if(!(n>0))return i;if(!(t<=n))return i}else{if(n>0)return-i;if(!(t>=n))return-i;i=-i,t=-t,n=-n}for(;;){if((r-=(s=Math.floor(n/t))*e)<0)return-i;if(r>e)return i;if(t>(n-=s*t)+n){if(e<r+r)return i}else{if(e>r+r)return-i;n=t-n,r=e-r,i=-i}if(0===r)return 0===n?0:-i;if(0===n)return i;if((e-=(s=Math.floor(t/n))*r)<0)return i;if(e>r)return-i;if(n>(t-=s*n)+t){if(r<e+e)return-i}else{if(r>e+e)return i;t=n-t,e=r-e,i=-i}if(0===e)return 0===t?0:i;if(0===t)return-i}};var st=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};st.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,r=e.x;return n>r&&(n=e.x,r=t.x),this._p.x>=n&&this._p.x<=r&&(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 i=t.x-this._p.x,o=t.y-this._p.y,s=e.x-this._p.x,a=e.y-this._p.y,u=ot.signOfDet2x2(i,o,s,a);if(0===u)return this._isPointOnSegment=!0,null;a<o&&(u=-u),u>0&&this._crossingCount++}},st.prototype.isPointInPolygon=function(){return this.getLocation()!==L.EXTERIOR},st.prototype.getLocation=function(){return this._isPointOnSegment?L.BOUNDARY:this._crossingCount%2==1?L.INTERIOR:L.EXTERIOR},st.prototype.isOnSegment=function(){return this._isPointOnSegment},st.prototype.interfaces_=function(){return[]},st.prototype.getClass=function(){return st},st.locatePointInRing=function(){if(arguments[0]instanceof b&&O(arguments[1],k)){for(var t=arguments[0],e=arguments[1],n=new st(t),r=new b,i=new b,o=1;o<e.size();o++)if(e.getCoordinate(o,r),e.getCoordinate(o-1,i),n.countSegment(r,i),n.isOnSegment())return n.getLocation();return n.getLocation()}if(arguments[0]instanceof b&&arguments[1]instanceof Array){for(var s=arguments[0],a=arguments[1],u=new st(s),c=1;c<a.length;c++){var l=a[c],p=a[c-1];if(u.countSegment(l,p),u.isOnSegment())return u.getLocation()}return u.getLocation()}};var at=function(){},ut={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};at.prototype.interfaces_=function(){return[]},at.prototype.getClass=function(){return at},at.orientationIndex=function(t,e,n){return B.orientationIndex(t,e,n)},at.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,r=1;r<t.length-1;r++){var i=t[r].x-n,o=t[r+1].y;e+=i*(t[r-1].y-o)}return e/2}if(O(arguments[0],k)){var s=arguments[0],a=s.size();if(a<3)return 0;var u=new b,c=new b,l=new b;s.getCoordinate(0,c),s.getCoordinate(1,l);var p=c.x;l.x-=p;for(var h=0,f=1;f<a-1;f++)u.y=c.y,c.x=l.x,c.y=l.y,s.getCoordinate(f+1,l),l.x-=p,h+=c.x*(u.y-l.y);return h/2}},at.distanceLineLine=function(t,e,n,r){if(t.equals(e))return at.distancePointLine(t,n,r);if(n.equals(r))return at.distancePointLine(r,t,e);var i=!1;if(Y.intersects(t,e,n,r)){var o=(e.x-t.x)*(r.y-n.y)-(e.y-t.y)*(r.x-n.x);if(0===o)i=!0;else{var s=(t.y-n.y)*(r.x-n.x)-(t.x-n.x)*(r.y-n.y),a=((t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y))/o,u=s/o;(u<0||u>1||a<0||a>1)&&(i=!0)}}else i=!0;return i?T.min(at.distancePointLine(t,n,r),at.distancePointLine(e,n,r),at.distancePointLine(n,t,e),at.distancePointLine(r,t,e)):0},at.isPointInRing=function(t,e){return at.locatePointInRing(t,e)!==L.EXTERIOR},at.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new b;t.getCoordinate(0,r);for(var i=r.x,o=r.y,s=1;s<e;s++){t.getCoordinate(s,r);var a=r.x,u=r.y,c=a-i,l=u-o;n+=Math.sqrt(c*c+l*l),i=a,o=u}return n},at.isCCW=function(t){var e=t.length-1;if(e<3)throw new m("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],r=0,i=1;i<=e;i++){var o=t[i];o.y>n.y&&(n=o,r=i)}var s=r;do{(s-=1)<0&&(s=e)}while(t[s].equals2D(n)&&s!==r);var a=r;do{a=(a+1)%e}while(t[a].equals2D(n)&&a!==r);var u=t[s],c=t[a];if(u.equals2D(n)||c.equals2D(n)||u.equals2D(c))return!1;var l=at.computeOrientation(u,n,c);return 0===l?u.x>c.x:l>0},at.locatePointInRing=function(t,e){return st.locatePointInRing(t,e)},at.distancePointLinePerpendicular=function(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),i=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(i)*Math.sqrt(r)},at.computeOrientation=function(t,e,n){return at.orientationIndex(t,e,n)},at.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new m("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r<e.length-1;r++){var i=at.distancePointLine(t,e[r],e[r+1]);i<n&&(n=i)}return n}if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];if(s.x===a.x&&s.y===a.y)return o.distance(s);var u=(a.x-s.x)*(a.x-s.x)+(a.y-s.y)*(a.y-s.y),c=((o.x-s.x)*(a.x-s.x)+(o.y-s.y)*(a.y-s.y))/u;if(c<=0)return o.distance(s);if(c>=1)return o.distance(a);var l=((s.y-o.y)*(a.x-s.x)-(s.x-o.x)*(a.y-s.y))/u;return Math.abs(l)*Math.sqrt(u)}},at.isOnLine=function(t,e){for(var n=new it,r=1;r<e.length;r++){var i=e[r-1],o=e[r];if(n.computeIntersection(t,i,o),n.hasIntersection())return!0}return!1},ut.CLOCKWISE.get=function(){return-1},ut.RIGHT.get=function(){return at.CLOCKWISE},ut.COUNTERCLOCKWISE.get=function(){return 1},ut.LEFT.get=function(){return at.COUNTERCLOCKWISE},ut.COLLINEAR.get=function(){return 0},ut.STRAIGHT.get=function(){return at.COLLINEAR},Object.defineProperties(at,ut);var ct=function(){};ct.prototype.filter=function(t){},ct.prototype.interfaces_=function(){return[]},ct.prototype.getClass=function(){return ct};var lt=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},pt={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};lt.prototype.isGeometryCollection=function(){return this.getSortIndex()===lt.SORTINDEX_GEOMETRYCOLLECTION},lt.prototype.getFactory=function(){return this._factory},lt.prototype.getGeometryN=function(t){return this},lt.prototype.getArea=function(){return 0},lt.prototype.isRectangle=function(){return!1},lt.prototype.equals=function(){if(arguments[0]instanceof lt){var t=arguments[0];return null!==t&&this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof lt))return!1;var n=e;return this.equalsExact(n)}},lt.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},lt.prototype.geometryChanged=function(){this.apply(lt.geometryChangedFilter)},lt.prototype.geometryChangedAction=function(){this._envelope=null},lt.prototype.equalsNorm=function(t){return null!==t&&this.norm().equalsExact(t.norm())},lt.prototype.getLength=function(){return 0},lt.prototype.getNumGeometries=function(){return 1},lt.prototype.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],r=arguments[1];return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,r)}},lt.prototype.getUserData=function(){return this._userData},lt.prototype.getSRID=function(){return this._SRID},lt.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},lt.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===lt.SORTINDEX_GEOMETRYCOLLECTION)throw new m("This method does not support GeometryCollection arguments")},lt.prototype.equal=function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n},lt.prototype.norm=function(){var t=this.copy();return t.normalize(),t},lt.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},lt.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new Y(this._envelope)},lt.prototype.setSRID=function(t){this._SRID=t},lt.prototype.setUserData=function(t){this._userData=t},lt.prototype.compare=function(t,e){for(var n=t.iterator(),r=e.iterator();n.hasNext()&&r.hasNext();){var i=n.next(),o=r.next(),s=i.compareTo(o);if(0!==s)return s}return n.hasNext()?1:r.hasNext()?-1:0},lt.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},lt.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===lt.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===lt.SORTINDEX_MULTIPOINT||this.getSortIndex()===lt.SORTINDEX_MULTILINESTRING||this.getSortIndex()===lt.SORTINDEX_MULTIPOLYGON},lt.prototype.interfaces_=function(){return[I,E,e]},lt.prototype.getClass=function(){return lt},lt.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},lt.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(null===t[e])return!0;return!1},pt.serialVersionUID.get=function(){return 0x799ea46522854c00},pt.SORTINDEX_POINT.get=function(){return 0},pt.SORTINDEX_MULTIPOINT.get=function(){return 1},pt.SORTINDEX_LINESTRING.get=function(){return 2},pt.SORTINDEX_LINEARRING.get=function(){return 3},pt.SORTINDEX_MULTILINESTRING.get=function(){return 4},pt.SORTINDEX_POLYGON.get=function(){return 5},pt.SORTINDEX_MULTIPOLYGON.get=function(){return 6},pt.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},pt.geometryChangedFilter.get=function(){return ht},Object.defineProperties(lt,pt);var ht=function(){};ht.interfaces_=function(){return[ct]},ht.filter=function(t){t.geometryChangedAction()};var ft=function(){};ft.prototype.filter=function(t){},ft.prototype.interfaces_=function(){return[]},ft.prototype.getClass=function(){return ft};var gt=function(){},dt={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};gt.prototype.isInBoundary=function(t){},gt.prototype.interfaces_=function(){return[]},gt.prototype.getClass=function(){return gt},dt.Mod2BoundaryNodeRule.get=function(){return yt},dt.EndPointBoundaryNodeRule.get=function(){return _t},dt.MultiValentEndPointBoundaryNodeRule.get=function(){return mt},dt.MonoValentEndPointBoundaryNodeRule.get=function(){return vt},dt.MOD2_BOUNDARY_RULE.get=function(){return new yt},dt.ENDPOINT_BOUNDARY_RULE.get=function(){return new _t},dt.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new mt},dt.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new vt},dt.OGC_SFS_BOUNDARY_RULE.get=function(){return gt.MOD2_BOUNDARY_RULE},Object.defineProperties(gt,dt);var yt=function(){};yt.prototype.isInBoundary=function(t){return t%2==1},yt.prototype.interfaces_=function(){return[gt]},yt.prototype.getClass=function(){return yt};var _t=function(){};_t.prototype.isInBoundary=function(t){return t>0},_t.prototype.interfaces_=function(){return[gt]},_t.prototype.getClass=function(){return _t};var mt=function(){};mt.prototype.isInBoundary=function(t){return t>1},mt.prototype.interfaces_=function(){return[gt]},mt.prototype.getClass=function(){return mt};var vt=function(){};vt.prototype.isInBoundary=function(t){return 1===t},vt.prototype.interfaces_=function(){return[gt]},vt.prototype.getClass=function(){return vt};var xt=function(){};xt.prototype.add=function(){},xt.prototype.addAll=function(){},xt.prototype.isEmpty=function(){},xt.prototype.iterator=function(){},xt.prototype.size=function(){},xt.prototype.toArray=function(){},xt.prototype.remove=function(){},(n.prototype=new Error).name="IndexOutOfBoundsException";var Et=function(){};Et.prototype.hasNext=function(){},Et.prototype.next=function(){},Et.prototype.remove=function(){};var It=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(xt);(r.prototype=new Error).name="NoSuchElementException";var Nt=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof xt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,xt]},e.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.set=function(t,e){var n=this.array_[t];return this.array_[t]=e,n},e.prototype.iterator=function(){return new bt(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new n;return this.array_[t]},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.remove=function(t){for(var e=!1,n=0,r=this.array_.length;n<r;n++)if(this.array_[n]===t){this.array_.splice(n,1),e=!0;break}return e},e}(It),bt=function(t){function e(e){t.call(this),this.arrayList_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new r;return this.arrayList_.get(this.position_++)},e.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},e.prototype.set=function(t){return this.arrayList_.set(this.position_-1,t)},e.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},e}(Et),Ct=function(t){function e(){if(t.call(this),0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.ensureCapacity(e.length),this.add(e,!0)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.ensureCapacity(n.length),this.add(n,r)}}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={coordArrayType:{configurable:!0}};return n.coordArrayType.get=function(){return new Array(0).fill(null)},e.prototype.getCoordinate=function(t){return this.get(t)},e.prototype.addAll=function(){if(2===arguments.length){for(var e=arguments[0],n=arguments[1],r=!1,i=e.iterator();i.hasNext();)this.add(i.next(),n),r=!0;return r}return t.prototype.addAll.apply(this,arguments)},e.prototype.clone=function(){for(var e=t.prototype.clone.call(this),n=0;n<this.size();n++)e.add(n,this.get(n).copy());return e},e.prototype.toCoordinateArray=function(){return this.toArray(e.coordArrayType)},e.prototype.add=function(){if(1===arguments.length){var e=arguments[0];t.prototype.add.call(this,e)}else if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var n=arguments[0],r=arguments[1];return this.add(n,r,!0),!0}if(arguments[0]instanceof b&&"boolean"==typeof arguments[1]){var i=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(i))return null;t.prototype.add.call(this,i)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var o=arguments[0],s=arguments[1];return this.add(o,s),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var a=arguments[0],u=arguments[1];if(arguments[2])for(var c=0;c<a.length;c++)this.add(a[c],u);else for(var l=a.length-1;l>=0;l--)this.add(a[l],u);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof b){var p=arguments[0],h=arguments[1];if(!arguments[2]){var f=this.size();if(f>0){if(p>0&&this.get(p-1).equals2D(h))return null;if(p<f&&this.get(p).equals2D(h))return null}}t.prototype.add.call(this,p,h)}}else if(4===arguments.length){var g=arguments[0],d=arguments[1],y=arguments[2],_=arguments[3],m=1;y>_&&(m=-1);for(var v=y;v!==_;v+=m)this.add(g[v],d);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new b(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(Nt),wt=function(){},St={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};St.ForwardComparator.get=function(){return Lt},St.BidirectionalComparator.get=function(){return Pt},St.coordArrayType.get=function(){return new Array(0).fill(null)},wt.prototype.interfaces_=function(){return[]},wt.prototype.getClass=function(){return wt},wt.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},wt.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(wt.indexOf(r,e)<0)return r}return null},wt.scroll=function(t,e){var n=wt.indexOf(e,t);if(n<0)return null;var r=new Array(t.length).fill(null);z.arraycopy(t,n,r,0,t.length-n),z.arraycopy(t,0,r,t.length-n,n),z.arraycopy(r,0,t,0,t.length)},wt.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 r=arguments[0],i=arguments[1],o=arguments[2];if(r===i)return!0;if(null===r||null===i)return!1;if(r.length!==i.length)return!1;for(var s=0;s<r.length;s++)if(0!==o.compare(r[s],i[s]))return!1;return!0}},wt.intersection=function(t,e){for(var n=new Ct,r=0;r<t.length;r++)e.intersects(t[r])&&n.add(t[r],!0);return n.toCoordinateArray()},wt.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},wt.removeRepeatedPoints=function(t){return wt.hasRepeatedPoints(t)?new Ct(t,!1).toCoordinateArray():t},wt.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),r=0;r<=n;r++){var i=t[r];t[r]=t[e-r],t[e-r]=i}},wt.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)null!==t[n]&&e++;var r=new Array(e).fill(null);if(0===e)return r;for(var i=0,o=0;o<t.length;o++)null!==t[o]&&(r[i++]=t[o]);return r},wt.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 b(t[n]);return e}if(5===arguments.length)for(var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4],u=0;u<a;u++)o[s+u]=new b(r[i+u])},wt.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=e[t.length-n-1];if(0!==r.compareTo(i))return!1}return!0},wt.envelope=function(t){for(var e=new Y,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},wt.toCoordinateArray=function(t){return t.toArray(wt.coordArrayType)},wt.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},wt.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},wt.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,r=t[e].compareTo(t[n]);if(0!==r)return r}return 1},wt.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var r=t[n].compareTo(e[n]);if(0!==r)return r;n++}return n<e.length?-1:n<t.length?1:0},wt.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},wt.extract=function(t,e,n){e=T.clamp(e,0,t.length);var r=(n=T.clamp(n,-1,t.length))-e+1;n<0&&(r=0),e>=t.length&&(r=0),n<e&&(r=0);var i=new Array(r).fill(null);if(0===r)return i;for(var o=0,s=e;s<=n;s++)i[o++]=t[s];return i},Object.defineProperties(wt,St);var Lt=function(){};Lt.prototype.compare=function(t,e){return wt.compare(t,e)},Lt.prototype.interfaces_=function(){return[N]},Lt.prototype.getClass=function(){return Lt};var Pt=function(){};Pt.prototype.compare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(0===n.length)return 0;var i=wt.compare(n,r);return wt.isEqualReversed(n,r)?0:i},Pt.prototype.OLDcompare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(0===n.length)return 0;for(var i=wt.increasingDirection(n),o=wt.increasingDirection(r),s=i>0?0:n.length-1,a=o>0?0:n.length-1,u=0;u<n.length;u++){var c=n[s].compareTo(r[a]);if(0!==c)return c;s+=i,a+=o}return 0},Pt.prototype.interfaces_=function(){return[N]},Pt.prototype.getClass=function(){return Pt};var Ot=function(){};Ot.prototype.get=function(){},Ot.prototype.put=function(){},Ot.prototype.size=function(){},Ot.prototype.values=function(){},Ot.prototype.entrySet=function(){};var Tt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Ot);(i.prototype=new Error).name="OperationNotSupported",(o.prototype=new xt).contains=function(){};var Rt=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof xt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(this.array_[e]===t)return!0;return!1},e.prototype.add=function(t){return!this.contains(t)&&(this.array_.push(t),!0)},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.remove=function(t){throw new Error},e.prototype.size=function(){return this.array_.length},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.iterator=function(){return new Mt(this)},e}(o),Mt=function(t){function e(e){t.call(this),this.hashSet_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new r;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new i},e}(Et),Dt=0;(p.prototype=new Tt).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},p.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:Dt,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,r,i=this.root_;do{if(n=i,(r=t.compareTo(i.key))<0)i=i.left;else{if(!(r>0)){var o=i.value;return i.value=e,o}i=i.right}}while(null!==i);var s={key:t,left:null,right:null,value:e,parent:n,color:Dt,getValue:function(){return this.value},getKey:function(){return this.key}};return r<0?n.left=s:n.right=s,this.fixAfterInsertion(s),this.size_++,null},p.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(a(t)===c(a(a(t)))){var e=l(a(a(t)));1===s(e)?(u(a(t),Dt),u(e,Dt),u(a(a(t)),1),t=a(a(t))):(t===l(a(t))&&(t=a(t),this.rotateLeft(t)),u(a(t),Dt),u(a(a(t)),1),this.rotateRight(a(a(t))))}else{var n=c(a(a(t)));1===s(n)?(u(a(t),Dt),u(n,Dt),u(a(a(t)),1),t=a(a(t))):(t===c(a(t))&&(t=a(t),this.rotateRight(t)),u(a(t),Dt),u(a(a(t)),1),this.rotateLeft(a(a(t))))}this.root_.color=Dt},p.prototype.values=function(){var t=new Nt,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=p.successor(e));)t.add(e.value);return t},p.prototype.entrySet=function(){var t=new Rt,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=p.successor(e));)t.add(e);return t},p.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}},p.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}},p.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},p.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 n=t.parent,r=t;null!==n&&r===n.right;)r=n,n=n.parent;return n},p.prototype.size=function(){return this.size_};var At=function(){};At.prototype.interfaces_=function(){return[]},At.prototype.getClass=function(){return At},h.prototype=new o,(f.prototype=new h).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},f.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},f.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},f.prototype.remove=function(t){throw new i},f.prototype.size=function(){return this.array_.length},f.prototype.isEmpty=function(){return 0===this.array_.length},f.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},f.prototype.iterator=function(){return new Ft(this)};var Ft=function(t){this.treeSet_=t,this.position_=0};Ft.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new r;return this.treeSet_.array_[this.position_++]},Ft.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Ft.prototype.remove=function(){throw new i};var Gt=function(){};Gt.sort=function(){var t,e,n,r,i=arguments[0];if(1===arguments.length)r=function(t,e){return t.compareTo(e)},i.sort(r);else if(2===arguments.length)n=arguments[1],r=function(t,e){return n.compare(t,e)},i.sort(r);else if(3===arguments.length){(e=i.slice(arguments[1],arguments[2])).sort();var o=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length));for(i.splice(0,i.length),t=0;t<o.length;t++)i.push(o[t])}else if(4===arguments.length)for(e=i.slice(arguments[1],arguments[2]),n=arguments[3],r=function(t,e){return n.compare(t,e)},e.sort(r),o=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length)),i.splice(0,i.length),t=0;t<o.length;t++)i.push(o[t])},Gt.asList=function(t){for(var e=new Nt,n=0,r=t.length;n<r;n++)e.add(t[n]);return e};var Bt=function(){},qt={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};qt.P.get=function(){return 0},qt.L.get=function(){return 1},qt.A.get=function(){return 2},qt.FALSE.get=function(){return-1},qt.TRUE.get=function(){return-2},qt.DONTCARE.get=function(){return-3},qt.SYM_FALSE.get=function(){return"F"},qt.SYM_TRUE.get=function(){return"T"},qt.SYM_DONTCARE.get=function(){return"*"},qt.SYM_P.get=function(){return"0"},qt.SYM_L.get=function(){return"1"},qt.SYM_A.get=function(){return"2"},Bt.prototype.interfaces_=function(){return[]},Bt.prototype.getClass=function(){return Bt},Bt.toDimensionSymbol=function(t){switch(t){case Bt.FALSE:return Bt.SYM_FALSE;case Bt.TRUE:return Bt.SYM_TRUE;case Bt.DONTCARE:return Bt.SYM_DONTCARE;case Bt.P:return Bt.SYM_P;case Bt.L:return Bt.SYM_L;case Bt.A:return Bt.SYM_A}throw new m("Unknown dimension value: "+t)},Bt.toDimensionValue=function(t){switch(A.toUpperCase(t)){case Bt.SYM_FALSE:return Bt.FALSE;case Bt.SYM_TRUE:return Bt.TRUE;case Bt.SYM_DONTCARE:return Bt.DONTCARE;case Bt.SYM_P:return Bt.P;case Bt.SYM_L:return Bt.L;case Bt.SYM_A:return Bt.A}throw new m("Unknown dimension symbol: "+t)},Object.defineProperties(Bt,qt);var kt=function(){};kt.prototype.filter=function(t){},kt.prototype.interfaces_=function(){return[]},kt.prototype.getClass=function(){return kt};var Vt=function(){};Vt.prototype.filter=function(t,e){},Vt.prototype.isDone=function(){},Vt.prototype.isGeometryChanged=function(){},Vt.prototype.interfaces_=function(){return[]},Vt.prototype.getClass=function(){return Vt};var Ut=function(t){function e(e,n){if(t.call(this,n),this._geometries=e||[],t.hasNullElements(this._geometries))throw new m("geometries must not contain null elements")}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){for(var t=new Y,e=0;e<this._geometries.length;e++)t.expandToInclude(this._geometries[e].getEnvelopeInternal());return t},e.prototype.getGeometryN=function(t){return this._geometries[t]},e.prototype.getSortIndex=function(){return t.SORTINDEX_GEOMETRYCOLLECTION},e.prototype.getCoordinates=function(){for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=0;n<this._geometries.length;n++)for(var r=this._geometries[n].getCoordinates(),i=0;i<r.length;i++)t[++e]=r[i];return t},e.prototype.getArea=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getArea();return t},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._geometries.length!==r._geometries.length)return!1;for(var i=0;i<this._geometries.length;i++)if(!this._geometries[i].equalsExact(r._geometries[i],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<this._geometries.length;t++)this._geometries[t].normalize();Gt.sort(this._geometries)},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},e.prototype.getBoundaryDimension=function(){for(var t=Bt.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getBoundaryDimension());return t},e.prototype.getDimension=function(){for(var t=Bt.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getDimension());return t},e.prototype.getLength=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getNumPoints();return t},e.prototype.getNumGeometries=function(){return this._geometries.length},e.prototype.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)},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=new f(Gt.asList(this._geometries)),n=new f(Gt.asList(t._geometries));return this.compare(e,n)}if(2===arguments.length){for(var r=arguments[0],i=arguments[1],o=r,s=this.getNumGeometries(),a=o.getNumGeometries(),u=0;u<s&&u<a;){var c=this.getGeometryN(u),l=o.getGeometryN(u),p=c.compareToSameClass(l,i);if(0!==p)return p;u++}return u<s?1:u<a?-1:0}},e.prototype.apply=function(){if(O(arguments[0],ft))for(var t=arguments[0],e=0;e<this._geometries.length;e++)this._geometries[e].apply(t);else if(O(arguments[0],Vt)){var n=arguments[0];if(0===this._geometries.length)return null;for(var r=0;r<this._geometries.length&&(this._geometries[r].apply(n),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else if(O(arguments[0],kt)){var i=arguments[0];i.filter(this);for(var o=0;o<this._geometries.length;o++)this._geometries[o].apply(i)}else if(O(arguments[0],ct)){var s=arguments[0];s.filter(this);for(var a=0;a<this._geometries.length;a++)this._geometries[a].apply(s)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),et.shouldNeverReachHere(),null},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._geometries=new Array(this._geometries.length).fill(null);for(var n=0;n<this._geometries.length;n++)e._geometries[n]=this._geometries[n].clone();return e},e.prototype.getGeometryType=function(){return"GeometryCollection"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.isEmpty=function(){for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isEmpty())return!1;return!0},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x4f07bcb1f857d800},Object.defineProperties(e,n),e}(lt),jt=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return lt.SORTINDEX_MULTILINESTRING},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Bt.FALSE:0},e.prototype.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},e.prototype.getDimension=function(){return 1},e.prototype.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)},e.prototype.getBoundary=function(){return new zt(this).getBoundary()},e.prototype.getGeometryType=function(){return"MultiLineString"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[At]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x7155d2ab4afa8000},Object.defineProperties(e,n),e}(Ut),zt=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1===arguments.length){var t=arguments[0],e=gt.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=r}};zt.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)},zt.prototype.getBoundary=function(){return this._geom instanceof Kt?this.boundaryLineString(this._geom):this._geom instanceof jt?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},zt.prototype.boundaryLineString=function(t){return this._geom.isEmpty()?this.getEmptyMultiPoint():t.isClosed()?this._bnRule.isInBoundary(2)?t.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},zt.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},zt.prototype.computeBoundaryCoordinates=function(t){var e=new Nt;this._endpointMap=new p;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);0!==r.getNumPoints()&&(this.addEndpoint(r.getCoordinateN(0)),this.addEndpoint(r.getCoordinateN(r.getNumPoints()-1)))}for(var i=this._endpointMap.entrySet().iterator();i.hasNext();){var o=i.next(),s=o.getValue().count;this._bnRule.isInBoundary(s)&&e.add(o.getKey())}return wt.toCoordinateArray(e)},zt.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);null===e&&(e=new Xt,this._endpointMap.put(t,e)),e.count++},zt.prototype.interfaces_=function(){return[]},zt.prototype.getClass=function(){return zt},zt.getBoundary=function(){if(1===arguments.length){var t=arguments[0];return new zt(t).getBoundary()}if(2===arguments.length){var e=arguments[0],n=arguments[1];return new zt(e,n).getBoundary()}};var Xt=function(){this.count=null};Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt};var Yt=function(){},Ht={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt},Yt.chars=function(t,e){for(var n=new Array(e).fill(null),r=0;r<e;r++)n[r]=t;return String(n)},Yt.getStackTrace=function(){if(1===arguments.length){var t=arguments[0],e=new function(){},n=new function(){}(e);return t.printStackTrace(n),e.toString()}if(2===arguments.length){for(var r=arguments[0],i=arguments[1],o="",s=new function(){}(new function(){}(Yt.getStackTrace(r))),a=0;a<i;a++)try{o+=s.readLine()+Yt.NEWLINE}catch(t){if(!(t instanceof g))throw t;et.shouldNeverReachHere()}return o}},Yt.split=function(t,e){for(var n=e.length,r=new Nt,i=""+t,o=i.indexOf(e);o>=0;){var s=i.substring(0,o);r.add(s),o=(i=i.substring(o+n)).indexOf(e)}i.length>0&&r.add(i);for(var a=new Array(r.size()).fill(null),u=0;u<a.length;u++)a[u]=r.get(u);return a},Yt.toString=function(){if(1===arguments.length){var t=arguments[0];return Yt.SIMPLE_ORDINATE_FORMAT.format(t)}},Yt.spaces=function(t){return Yt.chars(" ",t)},Ht.NEWLINE.get=function(){return z.getProperty("line.separator")},Ht.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(Yt,Ht);var Wt=function(){};Wt.prototype.interfaces_=function(){return[]},Wt.prototype.getClass=function(){return Wt},Wt.copyCoord=function(t,e,n,r){for(var i=Math.min(t.getDimension(),n.getDimension()),o=0;o<i;o++)n.setOrdinate(r,o,t.getOrdinate(e,o))},Wt.isRing=function(t){var e=t.size();return 0===e||!(e<=3)&&t.getOrdinate(0,k.X)===t.getOrdinate(e-1,k.X)&&t.getOrdinate(0,k.Y)===t.getOrdinate(e-1,k.Y)},Wt.isEqual=function(t,e){var n=t.size();if(n!==e.size())return!1;for(var r=Math.min(t.getDimension(),e.getDimension()),i=0;i<n;i++)for(var o=0;o<r;o++){var s=t.getOrdinate(i,o),a=e.getOrdinate(i,o);if(!(t.getOrdinate(i,o)===e.getOrdinate(i,o)||v.isNaN(s)&&v.isNaN(a)))return!1}return!0},Wt.extend=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();if(Wt.copy(e,0,r,0,i),i>0)for(var o=i;o<n;o++)Wt.copy(e,i-1,r,o,1);return r},Wt.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),r=0;r<=n;r++)Wt.swap(t,r,e-r)},Wt.swap=function(t,e,n){if(e===n)return null;for(var r=0;r<t.getDimension();r++){var i=t.getOrdinate(e,r);t.setOrdinate(e,r,t.getOrdinate(n,r)),t.setOrdinate(n,r,i)}},Wt.copy=function(t,e,n,r,i){for(var o=0;o<i;o++)Wt.copyCoord(t,e+o,n,r+o)},Wt.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),r=new M;r.append("(");for(var i=0;i<e;i++){i>0&&r.append(" ");for(var o=0;o<n;o++)o>0&&r.append(","),r.append(Yt.toString(t.getOrdinate(i,o)))}return r.append(")"),r.toString()}},Wt.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?Wt.createClosedRing(t,e,4):e.getOrdinate(0,k.X)===e.getOrdinate(n-1,k.X)&&e.getOrdinate(0,k.Y)===e.getOrdinate(n-1,k.Y)?e:Wt.createClosedRing(t,e,n+1)},Wt.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();Wt.copy(e,0,r,0,i);for(var o=i;o<n;o++)Wt.copy(e,0,r,o,1);return r};var Kt=function(t){function e(e,n){t.call(this,n),this._points=null,this.init(e)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new Y:this._points.expandEnvelope(new Y)},e.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},e.prototype.getSortIndex=function(){return t.SORTINDEX_LINESTRING},e.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._points.size()!==r._points.size())return!1;for(var i=0;i<this._points.size();i++)if(!this.equal(this._points.getCoordinate(i),r._points.getCoordinate(i),n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.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&&Wt.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Bt.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return at.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return Wt.reverse(t),this.getFactory().createLineString(t)},e.prototype.compareToSameClass=function(){if(1===arguments.length){for(var t=arguments[0],e=0,n=0;e<this._points.size()&&n<t._points.size();){var r=this._points.getCoordinate(e).compareTo(t._points.getCoordinate(n));if(0!==r)return r;e++,n++}return e<this._points.size()?1:n<t._points.size()?-1:0}if(2===arguments.length){var i=arguments[0];return arguments[1].compare(this._points,i._points)}},e.prototype.apply=function(){if(O(arguments[0],ft))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(O(arguments[0],Vt)){var n=arguments[0];if(0===this._points.size())return null;for(var r=0;r<this._points.size()&&(n.filter(this._points,r),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else(O(arguments[0],kt)||O(arguments[0],ct))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return new zt(this).getBoundary()},e.prototype.isEquivalentClass=function(t){return t instanceof e},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._points=this._points.clone(),e},e.prototype.getCoordinateN=function(t){return this._points.getCoordinate(t)},e.prototype.getGeometryType=function(){return"LineString"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._points},e.prototype.isEmpty=function(){return 0===this._points.size()},e.prototype.init=function(t){if(null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),1===t.size())throw new m("Invalid number of points in LineString (found "+t.size()+" - must be 0 or >= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e<this._points.size();e++)if(this._points.getCoordinate(e).equals(t))return!0;return!1},e.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},e.prototype.getPointN=function(t){return this.getFactory().createPoint(this._points.getCoordinate(t))},e.prototype.interfaces_=function(){return[At]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,n),e}(lt),Jt=function(){};Jt.prototype.interfaces_=function(){return[]},Jt.prototype.getClass=function(){return Jt};var Qt=function(t){function e(e,n){t.call(this,n),this._coordinates=e||null,this.init(this._coordinates)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new Y;var t=new Y;return t.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),t},e.prototype.getSortIndex=function(){return t.SORTINDEX_POINT},e.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&(!(!this.isEmpty()||!e.isEmpty())||this.isEmpty()===e.isEmpty()&&this.equal(e.getCoordinate(),this.getCoordinate(),n))}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){},e.prototype.getCoordinate=function(){return 0!==this._coordinates.size()?this._coordinates.getCoordinate(0):null},e.prototype.getBoundaryDimension=function(){return Bt.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getNumPoints=function(){return this.isEmpty()?0:1},e.prototype.reverse=function(){return this.copy()},e.prototype.getX=function(){if(null===this.getCoordinate())throw new Error("getX called on empty Point");return this.getCoordinate().x},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0];return this.getCoordinate().compareTo(t.getCoordinate())}if(2===arguments.length){var e=arguments[0];return arguments[1].compare(this._coordinates,e._coordinates)}},e.prototype.apply=function(){if(O(arguments[0],ft)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(O(arguments[0],Vt)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else(O(arguments[0],kt)||O(arguments[0],ct))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._coordinates=this._coordinates.clone(),e},e.prototype.getGeometryType=function(){return"Point"},e.prototype.copy=function(){return new e(this._coordinates.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._coordinates},e.prototype.getY=function(){if(null===this.getCoordinate())throw new Error("getY called on empty Point");return this.getCoordinate().y},e.prototype.isEmpty=function(){return 0===this._coordinates.size()},e.prototype.init=function(t){null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),et.isTrue(t.size()<=1),this._coordinates=t},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[Jt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x44077bad161cbc00},Object.defineProperties(e,n),e}(lt),Zt=function(){};Zt.prototype.interfaces_=function(){return[]},Zt.prototype.getClass=function(){return Zt};var $t=function(t){function e(e,n,r){if(t.call(this,r),this._shell=null,this._holes=null,null===e&&(e=this.getFactory().createLinearRing()),null===n&&(n=[]),t.hasNullElements(n))throw new m("holes must not contain null elements");if(e.isEmpty()&&t.hasNonEmptyElements(n))throw new m("shell is empty but holes are not");this._shell=e,this._holes=n}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},e.prototype.getSortIndex=function(){return t.SORTINDEX_POLYGON},e.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=this._shell.getCoordinates(),r=0;r<n.length;r++)t[++e]=n[r];for(var i=0;i<this._holes.length;i++)for(var o=this._holes[i].getCoordinates(),s=0;s<o.length;s++)t[++e]=o[s];return t},e.prototype.getArea=function(){var t=0;t+=Math.abs(at.signedArea(this._shell.getCoordinateSequence()));for(var e=0;e<this._holes.length;e++)t-=Math.abs(at.signedArea(this._holes[e].getCoordinateSequence()));return t},e.prototype.isRectangle=function(){if(0!==this.getNumInteriorRing())return!1;if(null===this._shell)return!1;if(5!==this._shell.getNumPoints())return!1;for(var t=this._shell.getCoordinateSequence(),e=this.getEnvelopeInternal(),n=0;n<5;n++){var r=t.getX(n);if(r!==e.getMinX()&&r!==e.getMaxX())return!1;var i=t.getY(n);if(i!==e.getMinY()&&i!==e.getMaxY())return!1}for(var o=t.getX(0),s=t.getY(0),a=1;a<=4;a++){var u=t.getX(a),c=t.getY(a);if(u!==o==(c!==s))return!1;o=u,s=c}return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e,i=this._shell,o=r._shell;if(!i.equalsExact(o,n))return!1;if(this._holes.length!==r._holes.length)return!1;for(var s=0;s<this._holes.length;s++)if(!this._holes[s].equalsExact(r._holes[s],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.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);Gt.sort(this._holes)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(e.isEmpty())return null;var r=new Array(e.getCoordinates().length-1).fill(null);z.arraycopy(e.getCoordinates(),0,r,0,r.length);var i=wt.minCoordinate(e.getCoordinates());wt.scroll(r,i),z.arraycopy(r,0,e.getCoordinates(),0,r.length),e.getCoordinates()[r.length]=r[0],at.isCCW(e.getCoordinates())===n&&wt.reverse(e.getCoordinates())}},e.prototype.getCoordinate=function(){return this._shell.getCoordinate()},e.prototype.getNumInteriorRing=function(){return this._holes.length},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.getLength=function(){var t=0;t+=this._shell.getLength();for(var e=0;e<this._holes.length;e++)t+=this._holes[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=this._shell.getNumPoints(),e=0;e<this._holes.length;e++)t+=this._holes[e].getNumPoints();return t},e.prototype.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},e.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},e.prototype.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 r=arguments[0],i=arguments[1],o=r,s=this._shell,a=o._shell,u=s.compareToSameClass(a,i);if(0!==u)return u;for(var c=this.getNumInteriorRing(),l=o.getNumInteriorRing(),p=0;p<c&&p<l;){var h=this.getInteriorRingN(p),f=o.getInteriorRingN(p),g=h.compareToSameClass(f,i);if(0!==g)return g;p++}return p<c?1:p<l?-1:0}},e.prototype.apply=function(t){if(O(t,ft)){this._shell.apply(t);for(var e=0;e<this._holes.length;e++)this._holes[e].apply(t)}else if(O(t,Vt)){if(this._shell.apply(t),!t.isDone())for(var n=0;n<this._holes.length&&(this._holes[n].apply(t),!t.isDone());n++);t.isGeometryChanged()&&this.geometryChanged()}else if(O(t,kt))t.filter(this);else if(O(t,ct)){t.filter(this),this._shell.apply(t);for(var r=0;r<this._holes.length;r++)this._holes[r].apply(t)}},e.prototype.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)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._shell=this._shell.clone(),e._holes=new Array(this._holes.length).fill(null);for(var n=0;n<this._holes.length;n++)e._holes[n]=this._holes[n].clone();return e},e.prototype.getGeometryType=function(){return"Polygon"},e.prototype.copy=function(){for(var t=this._shell.copy(),n=new Array(this._holes.length).fill(null),r=0;r<n.length;r++)n[r]=this._holes[r].copy();return new e(t,n,this._factory)},e.prototype.getExteriorRing=function(){return this._shell},e.prototype.isEmpty=function(){return this._shell.isEmpty()},e.prototype.getInteriorRingN=function(t){return this._holes[t]},e.prototype.interfaces_=function(){return[Zt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,n),e}(lt),te=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return lt.SORTINDEX_MULTIPOINT},e.prototype.isValid=function(){return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getCoordinate=function(){if(1===arguments.length){var e=arguments[0];return this._geometries[e].getCoordinate()}return t.prototype.getCoordinate.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return Bt.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.getGeometryType=function(){return"MultiPoint"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Jt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x6fb1ed4162e0fc00},Object.defineProperties(e,n),e}(Ut),ee=function(t){function e(e,n){e instanceof b&&n instanceof _e&&(e=n.getCoordinateSequenceFactory().create(e)),t.call(this,e,n),this.validateConstruction()}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return lt.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return Bt.FALSE},e.prototype.isClosed=function(){return!!this.isEmpty()||t.prototype.isClosed.call(this)},e.prototype.reverse=function(){var t=this._points.copy();return Wt.reverse(t),this.getFactory().createLinearRing(t)},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!t.prototype.isClosed.call(this))throw new m("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new m("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.MINIMUM_VALID_SIZE.get=function(){return 4},n.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,n),e}(Kt),ne=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return lt.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.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)},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var t=new Nt,e=0;e<this._geometries.length;e++)for(var n=this._geometries[e].getBoundary(),r=0;r<n.getNumGeometries();r++)t.add(n.getGeometryN(r));var i=new Array(t.size()).fill(null);return this.getFactory().createMultiLineString(t.toArray(i))},e.prototype.getGeometryType=function(){return"MultiPolygon"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Zt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,n),e}(Ut),re=function(t){this._factory=t||null,this._isUserDataCopied=!1},ie={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};re.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},re.prototype.edit=function(t,e){if(null===t)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},re.prototype.editInternal=function(t,e){return null===this._factory&&(this._factory=t.getFactory()),t instanceof Ut?this.editGeometryCollection(t,e):t instanceof $t?this.editPolygon(t,e):t instanceof Qt||t instanceof Kt?e.edit(t,this._factory):(et.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},re.prototype.editGeometryCollection=function(t,e){for(var n=e.edit(t,this._factory),r=new Nt,i=0;i<n.getNumGeometries();i++){var o=this.edit(n.getGeometryN(i),e);null===o||o.isEmpty()||r.add(o)}return n.getClass()===te?this._factory.createMultiPoint(r.toArray([])):n.getClass()===jt?this._factory.createMultiLineString(r.toArray([])):n.getClass()===ne?this._factory.createMultiPolygon(r.toArray([])):this._factory.createGeometryCollection(r.toArray([]))},re.prototype.editPolygon=function(t,e){var n=e.edit(t,this._factory);if(null===n&&(n=this._factory.createPolygon(null)),n.isEmpty())return n;var r=this.edit(n.getExteriorRing(),e);if(null===r||r.isEmpty())return this._factory.createPolygon();for(var i=new Nt,o=0;o<n.getNumInteriorRing();o++){var s=this.edit(n.getInteriorRingN(o),e);null===s||s.isEmpty()||i.add(s)}return this._factory.createPolygon(r,i.toArray([]))},re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re},re.GeometryEditorOperation=function(){},ie.NoOpGeometryOperation.get=function(){return oe},ie.CoordinateOperation.get=function(){return se},ie.CoordinateSequenceOperation.get=function(){return ae},Object.defineProperties(re,ie);var oe=function(){};oe.prototype.edit=function(t,e){return t},oe.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},oe.prototype.getClass=function(){return oe};var se=function(){};se.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return null===n?t:t instanceof ee?e.createLinearRing(n):t instanceof Kt?e.createLineString(n):t instanceof Qt?n.length>0?e.createPoint(n[0]):e.createPoint():t},se.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},se.prototype.getClass=function(){return se};var ae=function(){};ae.prototype.edit=function(t,e){return t instanceof ee?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Kt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Qt?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},ae.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},ae.prototype.getClass=function(){return ae};var ue=function(){if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var e=0;e<t;e++)this._coordinates[e]=new b}else if(O(arguments[0],k)){var n=arguments[0];if(null===n)return this._coordinates=new Array(0).fill(null),null;this._dimension=n.getDimension(),this._coordinates=new Array(n.size()).fill(null);for(var r=0;r<this._coordinates.length;r++)this._coordinates[r]=n.getCoordinateCopy(r)}}else if(2===arguments.length)if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var i=arguments[0],o=arguments[1];this._coordinates=i,this._dimension=o,null===i&&(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 u=0;u<s;u++)this._coordinates[u]=new b}},ce={serialVersionUID:{configurable:!0}};ue.prototype.setOrdinate=function(t,e,n){switch(e){case k.X:this._coordinates[t].x=n;break;case k.Y:this._coordinates[t].y=n;break;case k.Z:this._coordinates[t].z=n;break;default:throw new m("invalid ordinateIndex")}},ue.prototype.size=function(){return this._coordinates.length},ue.prototype.getOrdinate=function(t,e){switch(e){case k.X:return this._coordinates[t].x;case k.Y:return this._coordinates[t].y;case k.Z:return this._coordinates[t].z}return v.NaN},ue.prototype.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}},ue.prototype.getCoordinateCopy=function(t){return new b(this._coordinates[t])},ue.prototype.getDimension=function(){return this._dimension},ue.prototype.getX=function(t){return this._coordinates[t].x},ue.prototype.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 ue(t,this._dimension)},ue.prototype.expandEnvelope=function(t){for(var e=0;e<this._coordinates.length;e++)t.expandToInclude(this._coordinates[e]);return t},ue.prototype.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 ue(t,this._dimension)},ue.prototype.toString=function(){if(this._coordinates.length>0){var t=new M(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"()"},ue.prototype.getY=function(t){return this._coordinates[t].y},ue.prototype.toCoordinateArray=function(){return this._coordinates},ue.prototype.interfaces_=function(){return[k,e]},ue.prototype.getClass=function(){return ue},ce.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(ue,ce);var le=function(){},pe={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};le.prototype.readResolve=function(){return le.instance()},le.prototype.create=function(){if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return new ue(t)}if(O(arguments[0],k)){var e=arguments[0];return new ue(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return r>3&&(r=3),r<2?new ue(n):new ue(n,r)}},le.prototype.interfaces_=function(){return[S,e]},le.prototype.getClass=function(){return le},le.instance=function(){return le.instanceObject},pe.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},pe.instanceObject.get=function(){return new le},Object.defineProperties(le,pe);var he=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return this.map_.get(t)||null},e.prototype.put=function(t,e){return this.map_.set(t,e),e},e.prototype.values=function(){for(var t=new Nt,e=this.map_.values(),n=e.next();!n.done;)t.add(n.value),n=e.next();return t},e.prototype.entrySet=function(){var t=new Rt;return this.map_.entries().forEach((function(e){return t.add(e)})),t},e.prototype.size=function(){return this.map_.size()},e}(Ot),fe=function t(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=t.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof de){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var n=arguments[0];this._modelType=t.FIXED,this.setScale(n)}else if(arguments[0]instanceof t){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}},ge={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};fe.prototype.equals=function(t){if(!(t instanceof fe))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},fe.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new D(n).compareTo(new D(r))},fe.prototype.getScale=function(){return this._scale},fe.prototype.isFloating=function(){return this._modelType===fe.FLOATING||this._modelType===fe.FLOATING_SINGLE},fe.prototype.getType=function(){return this._modelType},fe.prototype.toString=function(){var t="UNKNOWN";return this._modelType===fe.FLOATING?t="Floating":this._modelType===fe.FLOATING_SINGLE?t="Floating-Single":this._modelType===fe.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},fe.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return v.isNaN(t)||this._modelType===fe.FLOATING_SINGLE?t:this._modelType===fe.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof b){var e=arguments[0];if(this._modelType===fe.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},fe.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===fe.FLOATING?t=16:this._modelType===fe.FLOATING_SINGLE?t=6:this._modelType===fe.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},fe.prototype.setScale=function(t){this._scale=Math.abs(t)},fe.prototype.interfaces_=function(){return[e,E]},fe.prototype.getClass=function(){return fe},fe.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},ge.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},ge.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(fe,ge);var de=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},ye={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};de.prototype.readResolve=function(){return de.nameToTypeMap.get(this._name)},de.prototype.toString=function(){return this._name},de.prototype.interfaces_=function(){return[e]},de.prototype.getClass=function(){return de},ye.serialVersionUID.get=function(){return-552860263173159e4},ye.nameToTypeMap.get=function(){return new he},Object.defineProperties(de,ye),fe.Type=de,fe.FIXED=new de("FIXED"),fe.FLOATING=new de("FLOATING"),fe.FLOATING_SINGLE=new de("FLOATING SINGLE");var _e=function t(){this._precisionModel=new fe,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?O(arguments[0],S)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof fe&&(this._precisionModel=arguments[0]):2===arguments.length?(this._precisionModel=arguments[0],this._SRID=arguments[1]):3===arguments.length&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},me={serialVersionUID:{configurable:!0}};_e.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new b(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new b(t.getMinX(),t.getMinY()),new b(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new b(t.getMinX(),t.getMinY()),new b(t.getMinX(),t.getMaxY()),new b(t.getMaxX(),t.getMaxY()),new b(t.getMaxX(),t.getMinY()),new b(t.getMinX(),t.getMinY())]),null)},_e.prototype.createLineString=function(t){return t?t instanceof Array?new Kt(this.getCoordinateSequenceFactory().create(t),this):O(t,k)?new Kt(t,this):void 0:new Kt(this.getCoordinateSequenceFactory().create([]),this)},_e.prototype.createMultiLineString=function(){if(0===arguments.length)return new jt(null,this);if(1===arguments.length){var t=arguments[0];return new jt(t,this)}},_e.prototype.buildGeometry=function(t){for(var e=null,n=!1,r=!1,i=t.iterator();i.hasNext();){var o=i.next(),s=o.getClass();null===e&&(e=s),s!==e&&(n=!0),o.isGeometryCollectionOrDerived()&&(r=!0)}if(null===e)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(_e.toGeometryArray(t));var a=t.iterator().next();if(t.size()>1){if(a instanceof $t)return this.createMultiPolygon(_e.toPolygonArray(t));if(a instanceof Kt)return this.createMultiLineString(_e.toLineStringArray(t));if(a instanceof Qt)return this.createMultiPoint(_e.toPointArray(t));et.shouldNeverReachHere("Unhandled class: "+a.getClass().getName())}return a},_e.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},_e.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof b){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(O(arguments[0],k)){var e=arguments[0];return new Qt(e,this)}}},_e.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},_e.prototype.createPolygon=function(){if(0===arguments.length)return new $t(null,null,this);if(1===arguments.length){if(O(arguments[0],k)){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 ee){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];return new $t(r,i,this)}},_e.prototype.getSRID=function(){return this._SRID},_e.prototype.createGeometryCollection=function(){if(0===arguments.length)return new Ut(null,this);if(1===arguments.length){var t=arguments[0];return new Ut(t,this)}},_e.prototype.createGeometry=function(t){return new re(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},_e.prototype.getPrecisionModel=function(){return this._precisionModel},_e.prototype.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(O(arguments[0],k)){var e=arguments[0];return new ee(e,this)}}},_e.prototype.createMultiPolygon=function(){if(0===arguments.length)return new ne(null,this);if(1===arguments.length){var t=arguments[0];return new ne(t,this)}},_e.prototype.createMultiPoint=function(){if(0===arguments.length)return new te(null,this);if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return new te(t,this)}if(arguments[0]instanceof Array){var e=arguments[0];return this.createMultiPoint(null!==e?this.getCoordinateSequenceFactory().create(e):null)}if(O(arguments[0],k)){var n=arguments[0];if(null===n)return this.createMultiPoint(new Array(0).fill(null));for(var r=new Array(n.size()).fill(null),i=0;i<n.size();i++){var o=this.getCoordinateSequenceFactory().create(1,n.getDimension());Wt.copy(n,i,o,0,1),r[i]=this.createPoint(o)}return this.createMultiPoint(r)}}},_e.prototype.interfaces_=function(){return[e]},_e.prototype.getClass=function(){return _e},_e.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_e.toGeometryArray=function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},_e.getDefaultCoordinateSequenceFactory=function(){return le.instance()},_e.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_e.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_e.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_e.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_e.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_e.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_e.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},me.serialVersionUID.get=function(){return-0x5ea75f2051eeb400},Object.defineProperties(_e,me);var ve=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],xe=function(t){this.geometryFactory=t||new _e};xe.prototype.read=function(t){var e,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!Ee[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==ve.indexOf(n)?Ee[n].apply(this,[e.coordinates]):"GeometryCollection"===n?Ee[n].apply(this,[e.geometries]):Ee[n].apply(this,[e])},xe.prototype.write=function(t){var e=t.getGeometryType();if(!Ie[e])throw new Error("Geometry is not supported");return Ie[e].apply(this,[t])};var Ee={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var r=t.geometry.type;if(!Ee[r])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=Ee.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 r=t[n];e.push(new b(r[0],r[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new b(t[0],t[1]),new b(t[2],t[1]),new b(t[2],t[3]),new b(t[0],t[3]),new b(t[0],t[1])])},Point:function(t){var e=new b(t[0],t[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],n=0;n<t.length;++n)e.push(Ee.Point.apply(this,[t[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=Ee.coordinates.apply(this,[t]);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],n=0;n<t.length;++n)e.push(Ee.LineString.apply(this,[t[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=Ee.coordinates.apply(this,[t[0]]),n=this.geometryFactory.createLinearRing(e),r=[],i=1;i<t.length;++i){var o=t[i],s=Ee.coordinates.apply(this,[o]),a=this.geometryFactory.createLinearRing(s);r.push(a)}return this.geometryFactory.createPolygon(n,r)},MultiPolygon:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(Ee.Polygon.apply(this,[r]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(this.read(r))}return this.geometryFactory.createGeometryCollection(e)}},Ie={coordinate:function(t){return[t.x,t.y]},Point:function(t){return{type:"Point",coordinates:Ie.coordinate.apply(this,[t.getCoordinate()])}},MultiPoint:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=Ie.Point.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(t){for(var e=[],n=t.getCoordinates(),r=0;r<n.length;++r){var i=n[r];e.push(Ie.coordinate.apply(this,[i]))}return{type:"LineString",coordinates:e}},MultiLineString:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=Ie.LineString.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=Ie.LineString.apply(this,[t._shell]);e.push(n.coordinates);for(var r=0;r<t._holes.length;++r){var i=t._holes[r],o=Ie.LineString.apply(this,[i]);e.push(o.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=Ie.Polygon.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=r.getGeometryType();e.push(Ie[i].apply(this,[r]))}return{type:"GeometryCollection",geometries:e}}},Ne=function(t){this.geometryFactory=t||new _e,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new xe(this.geometryFactory)};Ne.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===fe.FIXED&&this.reducePrecision(e),e},Ne.prototype.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])};var be=function(){this.parser=new xe(this.geometryFactory)};be.prototype.write=function(t){return this.parser.write(t)};var Ce=function(){},we={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};Ce.prototype.interfaces_=function(){return[]},Ce.prototype.getClass=function(){return Ce},Ce.opposite=function(t){return t===Ce.LEFT?Ce.RIGHT:t===Ce.RIGHT?Ce.LEFT:t},we.ON.get=function(){return 0},we.LEFT.get=function(){return 1},we.RIGHT.get=function(){return 2},Object.defineProperties(Ce,we),(d.prototype=new Error).name="EmptyStackException",(y.prototype=new It).add=function(t){return this.array_.push(t),!0},y.prototype.get=function(t){if(t<0||t>=this.size())throw new Error;return this.array_[t]},y.prototype.push=function(t){return this.array_.push(t),t},y.prototype.pop=function(t){if(0===this.array_.length)throw new d;return this.array_.pop()},y.prototype.peek=function(){if(0===this.array_.length)throw new d;return this.array_[this.array_.length-1]},y.prototype.empty=function(){return 0===this.array_.length},y.prototype.isEmpty=function(){return this.empty()},y.prototype.search=function(t){return this.array_.indexOf(t)},y.prototype.size=function(){return this.array_.length},y.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t};var Se=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};Se.prototype.getCoordinate=function(){return this._minCoord},Se.prototype.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},Se.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();et.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],r=at.computeOrientation(this._minCoord,n,e),i=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&r===at.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&r===at.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)},Se.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge().getCoordinates();if(e<0||e+1>=n.length)return-1;if(n[e].y===n[e+1].y)return-1;var r=Ce.LEFT;return n[e].y<n[e+1].y&&(r=Ce.RIGHT),r},Se.prototype.getEdge=function(){return this._orientedDe},Se.prototype.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])},Se.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Se.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}et.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)===Ce.LEFT&&(this._orientedDe=this._minDe.getSym())},Se.prototype.interfaces_=function(){return[]},Se.prototype.getClass=function(){return Se};var Le=function(t){function e(n,r){t.call(this,e.msgWithCoord(n,r)),this.pt=r?new b(r):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(t,e){return e?t:t+" [ "+e+" ]"},e}($),Pe=function(){this.array_=[]};Pe.prototype.addLast=function(t){this.array_.push(t)},Pe.prototype.removeFirst=function(){return this.array_.shift()},Pe.prototype.isEmpty=function(){return 0===this.array_.length};var Oe=function(){this._finder=null,this._dirEdgeList=new Nt,this._nodes=new Nt,this._rightMostCoord=null,this._env=null,this._finder=new Se};Oe.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Oe.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Oe.prototype.computeNodeDepth=function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var r=n.next();if(r.isVisited()||r.getSym().isVisited()){e=r;break}}if(null===e)throw new Le("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();o.setVisited(!0),this.copySymDepths(o)}},Oe.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Ce.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Oe.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Oe.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Ce.RIGHT)>=1&&e.getDepth(Ce.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Oe.prototype.computeDepths=function(t){var e=new Rt,n=new Pe,r=t.getNode();for(n.addLast(r),e.add(r),t.setVisited(!0);!n.isEmpty();){var i=n.removeFirst();e.add(i),this.computeNodeDepth(i);for(var o=i.getEdges().iterator();o.hasNext();){var s=o.next().getSym();if(!s.isVisited()){var a=s.getNode();e.contains(a)||(n.addLast(a),e.add(a))}}}},Oe.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Oe.prototype.getEnvelope=function(){if(null===this._env){for(var t=new Y,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),r=0;r<n.length-1;r++)t.expandToInclude(n[r]);this._env=t}return this._env},Oe.prototype.addReachable=function(t){var e=new y;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},Oe.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(Ce.LEFT,t.getDepth(Ce.RIGHT)),e.setDepth(Ce.RIGHT,t.getDepth(Ce.LEFT))},Oe.prototype.add=function(t,e){t.setVisited(!0),this._nodes.add(t);for(var n=t.getEdges().iterator();n.hasNext();){var r=n.next();this._dirEdgeList.add(r);var i=r.getSym().getNode();i.isVisited()||e.push(i)}},Oe.prototype.getNodes=function(){return this._nodes},Oe.prototype.getDirectedEdges=function(){return this._dirEdgeList},Oe.prototype.interfaces_=function(){return[E]},Oe.prototype.getClass=function(){return Oe};var Te=function t(){if(this.location=null,1===arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var n=arguments[0];this.init(1),this.location[Ce.ON]=n}else if(arguments[0]instanceof t){var r=arguments[0];if(this.init(r.location.length),null!==r)for(var i=0;i<this.location.length;i++)this.location[i]=r.location[i]}}else if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];this.init(3),this.location[Ce.ON]=o,this.location[Ce.LEFT]=s,this.location[Ce.RIGHT]=a}};Te.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},Te.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==L.NONE)return!1;return!0},Te.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===L.NONE&&(this.location[e]=t)},Te.prototype.isLine=function(){return 1===this.location.length},Te.prototype.merge=function(t){if(t.location.length>this.location.length){var e=new Array(3).fill(null);e[Ce.ON]=this.location[Ce.ON],e[Ce.LEFT]=L.NONE,e[Ce.RIGHT]=L.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===L.NONE&&n<t.location.length&&(this.location[n]=t.location[n])},Te.prototype.getLocations=function(){return this.location},Te.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[Ce.LEFT];this.location[Ce.LEFT]=this.location[Ce.RIGHT],this.location[Ce.RIGHT]=t},Te.prototype.toString=function(){var t=new M;return this.location.length>1&&t.append(L.toLocationSymbol(this.location[Ce.LEFT])),t.append(L.toLocationSymbol(this.location[Ce.ON])),this.location.length>1&&t.append(L.toLocationSymbol(this.location[Ce.RIGHT])),t.toString()},Te.prototype.setLocations=function(t,e,n){this.location[Ce.ON]=t,this.location[Ce.LEFT]=e,this.location[Ce.RIGHT]=n},Te.prototype.get=function(t){return t<this.location.length?this.location[t]:L.NONE},Te.prototype.isArea=function(){return this.location.length>1},Te.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===L.NONE)return!0;return!1},Te.prototype.setLocation=function(){if(1===arguments.length){var t=arguments[0];this.setLocation(Ce.ON,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.location[e]=n}},Te.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(L.NONE)},Te.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},Te.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},Te.prototype.interfaces_=function(){return[]},Te.prototype.getClass=function(){return Te};var Re=function t(){if(this.elt=new Array(2).fill(null),1===arguments.length){if(Number.isInteger(arguments[0])){var e=arguments[0];this.elt[0]=new Te(e),this.elt[1]=new Te(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.elt[0]=new Te(n.elt[0]),this.elt[1]=new Te(n.elt[1])}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.elt[0]=new Te(L.NONE),this.elt[1]=new Te(L.NONE),this.elt[r].setLocation(i)}else if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];this.elt[0]=new Te(o,s,a),this.elt[1]=new Te(o,s,a)}else if(4===arguments.length){var u=arguments[0],c=arguments[1],l=arguments[2],p=arguments[3];this.elt[0]=new Te(L.NONE,L.NONE,L.NONE),this.elt[1]=new Te(L.NONE,L.NONE,L.NONE),this.elt[u].setLocations(c,l,p)}};Re.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},Re.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},Re.prototype.isNull=function(t){return this.elt[t].isNull()},Re.prototype.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)}},Re.prototype.isLine=function(t){return this.elt[t].isLine()},Re.prototype.merge=function(t){for(var e=0;e<2;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new Te(t.elt[e]):this.elt[e].merge(t.elt[e])},Re.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Re.prototype.getLocation=function(){if(1===arguments.length){var t=arguments[0];return this.elt[t].get(Ce.ON)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},Re.prototype.toString=function(){var t=new M;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()},Re.prototype.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()}},Re.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},Re.prototype.setLocation=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(Ce.ON,e)}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this.elt[n].setLocation(r,i)}},Re.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},Re.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},Re.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new Te(this.elt[t].location[0]))},Re.prototype.interfaces_=function(){return[]},Re.prototype.getClass=function(){return Re},Re.toLineLabel=function(t){for(var e=new Re(L.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var Me=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new Nt,this._pts=new Nt,this._label=new Re(L.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new Nt,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};Me.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=at.isCCW(this._ring.getCoordinates())},Me.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},Me.prototype.computePoints=function(t){this._startDe=t;var e=t,n=!0;do{if(null===e)throw new Le("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new Le("Directed Edge visited twice during ring-building at "+e.getCoordinate());this._edges.add(e);var r=e.getLabel();et.isTrue(r.isArea()),this.mergeLabel(r),this.addPoints(e.getEdge(),e.isForward(),n),n=!1,this.setEdgeRing(e,this),e=this.getNext(e)}while(e!==this._startDe)},Me.prototype.getLinearRing=function(){return this._ring},Me.prototype.getCoordinate=function(t){return this._pts.get(t)},Me.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var t=this._startDe;do{var e=t.getNode().getEdges().getOutgoingDegree(this);e>this._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},Me.prototype.addPoints=function(t,e,n){var r=t.getCoordinates();if(e){var i=1;n&&(i=0);for(var o=i;o<r.length;o++)this._pts.add(r[o])}else{var s=r.length-2;n&&(s=r.length-1);for(var a=s;a>=0;a--)this._pts.add(r[a])}},Me.prototype.isHole=function(){return this._isHole},Me.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},Me.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!at.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1;return!0},Me.prototype.addHole=function(t){this._holes.add(t)},Me.prototype.isShell=function(){return null===this._shell},Me.prototype.getLabel=function(){return this._label},Me.prototype.getEdges=function(){return this._edges},Me.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Me.prototype.getShell=function(){return this._shell},Me.prototype.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],r=e.getLocation(n,Ce.RIGHT);if(r===L.NONE)return null;if(this._label.getLocation(n)===L.NONE)return this._label.setLocation(n,r),null}},Me.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},Me.prototype.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)},Me.prototype.interfaces_=function(){return[]},Me.prototype.getClass=function(){return Me};var De=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setEdgeRing=function(t,e){t.setMinEdgeRing(e)},e.prototype.getNext=function(t){return t.getNextMin()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Me),Ae=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildMinimalRings=function(){var t=new Nt,e=this._startDe;do{if(null===e.getMinEdgeRing()){var n=new De(e,this._geometryFactory);t.add(n)}e=e.getNext()}while(e!==this._startDe);return t},e.prototype.setEdgeRing=function(t,e){t.setEdgeRing(e)},e.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var t=this._startDe;do{t.getNode().getEdges().linkMinimalDirectedEdges(this),t=t.getNext()}while(t!==this._startDe)},e.prototype.getNext=function(t){return t.getNext()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Me),Fe=function(){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}};Fe.prototype.setVisited=function(t){this._isVisited=t},Fe.prototype.setInResult=function(t){this._isInResult=t},Fe.prototype.isCovered=function(){return this._isCovered},Fe.prototype.isCoveredSet=function(){return this._isCoveredSet},Fe.prototype.setLabel=function(t){this._label=t},Fe.prototype.getLabel=function(){return this._label},Fe.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},Fe.prototype.updateIM=function(t){et.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},Fe.prototype.isInResult=function(){return this._isInResult},Fe.prototype.isVisited=function(){return this._isVisited},Fe.prototype.interfaces_=function(){return[]},Fe.prototype.getClass=function(){return Fe};var Ge=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var e=arguments[0],n=arguments[1];this._coord=e,this._edges=n,this._label=new Re(0,L.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1},e.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(t){t.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(t){},e.prototype.computeMergedLocation=function(t,e){var n=L.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==L.BOUNDARY&&(n=r)}return n},e.prototype.setLabel=function(){if(2!==arguments.length)return t.prototype.setLabel.apply(this,arguments);var e=arguments[0],n=arguments[1];null===this._label?this._label=new Re(e,n):this._label.setLocation(e,n)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){if(arguments[0]instanceof e){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof Re)for(var n=arguments[0],r=0;r<2;r++){var i=this.computeMergedLocation(n,r);this._label.getLocation(r)===L.NONE&&this._label.setLocation(r,i)}},e.prototype.add=function(t){this._edges.insert(t),t.setNode(this)},e.prototype.setLabelBoundary=function(t){if(null===this._label)return null;var e=L.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case L.BOUNDARY:n=L.INTERIOR;break;case L.INTERIOR:default:n=L.BOUNDARY}this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Fe),Be=function(){this.nodeMap=new p,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Be.prototype.find=function(t){return this.nodeMap.get(t)},Be.prototype.addNode=function(){if(arguments[0]instanceof b){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 Ge){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}},Be.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},Be.prototype.iterator=function(){return this.nodeMap.values().iterator()},Be.prototype.values=function(){return this.nodeMap.values()},Be.prototype.getBoundaryNodes=function(t){for(var e=new Nt,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===L.BOUNDARY&&e.add(r)}return e},Be.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},Be.prototype.interfaces_=function(){return[]},Be.prototype.getClass=function(){return Be};var qe=function(){},ke={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};qe.prototype.interfaces_=function(){return[]},qe.prototype.getClass=function(){return qe},qe.isNorthern=function(t){return t===qe.NE||t===qe.NW},qe.isOpposite=function(t,e){return t!==e&&2==(t-e+4)%4},qe.commonHalfPlane=function(t,e){if(t===e)return t;if(2==(t-e+4)%4)return-1;var n=t<e?t:e;return 0===n&&3===(t>e?t:e)?3:n},qe.isInHalfPlane=function(t,e){return e===qe.SE?t===qe.SE||t===qe.SW:t===e||t===e+1},qe.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 m("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?qe.NE:qe.SE:e>=0?qe.NW:qe.SW}if(arguments[0]instanceof b&&arguments[1]instanceof b){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new m("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?qe.NE:qe.SE:r.y>=n.y?qe.NW:qe.SW}},ke.NE.get=function(){return 0},ke.NW.get=function(){return 1},ke.SW.get=function(){return 2},ke.SE.get=function(){return 3},Object.defineProperties(qe,ke);var Ve=function(){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],r=arguments[2];this._edge=e,this.init(n,r),this._label=null}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this._edge=i,this.init(o,s),this._label=a}};Ve.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:at.computeOrientation(t._p0,t._p1,this._p1)},Ve.prototype.getDy=function(){return this._dy},Ve.prototype.getCoordinate=function(){return this._p0},Ve.prototype.setNode=function(t){this._node=t},Ve.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),r=n.lastIndexOf("."),i=n.substring(r+1);t.print("  "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+"   "+this._label)},Ve.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},Ve.prototype.getDirectedCoordinate=function(){return this._p1},Ve.prototype.getDx=function(){return this._dx},Ve.prototype.getLabel=function(){return this._label},Ve.prototype.getEdge=function(){return this._edge},Ve.prototype.getQuadrant=function(){return this._quadrant},Ve.prototype.getNode=function(){return this._node},Ve.prototype.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},Ve.prototype.computeLabel=function(t){},Ve.prototype.init=function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=qe.quadrant(this._dx,this._dy),et.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")},Ve.prototype.interfaces_=function(){return[E]},Ve.prototype.getClass=function(){return Ve};var Ue=function(t){function e(){var e=arguments[0],n=arguments[1];if(t.call(this,e),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],this._isForward=n,n)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var r=e.getNumPoints()-1;this.init(e.getCoordinate(r),e.getCoordinate(r-1))}this.computeDirectedLabel()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getNextMin=function(){return this._nextMin},e.prototype.getDepth=function(t){return this._depth[t]},e.prototype.setVisited=function(t){this._isVisited=t},e.prototype.computeDirectedLabel=function(){this._label=new Re(this._edge.getLabel()),this._isForward||this._label.flip()},e.prototype.getNext=function(){return this._next},e.prototype.setDepth=function(t,e){if(-999!==this._depth[t]&&this._depth[t]!==e)throw new Le("assigned depths do not match",this.getCoordinate());this._depth[t]=e},e.prototype.isInteriorAreaEdge=function(){for(var t=!0,e=0;e<2;e++)this._label.isArea(e)&&this._label.getLocation(e,Ce.LEFT)===L.INTERIOR&&this._label.getLocation(e,Ce.RIGHT)===L.INTERIOR||(t=!1);return t},e.prototype.setNextMin=function(t){this._nextMin=t},e.prototype.print=function(e){t.prototype.print.call(this,e),e.print(" "+this._depth[Ce.LEFT]+"/"+this._depth[Ce.RIGHT]),e.print(" ("+this.getDepthDelta()+")"),this._isInResult&&e.print(" inResult")},e.prototype.setMinEdgeRing=function(t){this._minEdgeRing=t},e.prototype.isLineEdge=function(){var t=this._label.isLine(0)||this._label.isLine(1),e=!this._label.isArea(0)||this._label.allPositionsEqual(0,L.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,L.EXTERIOR);return t&&e&&n},e.prototype.setEdgeRing=function(t){this._edgeRing=t},e.prototype.getMinEdgeRing=function(){return this._minEdgeRing},e.prototype.getDepthDelta=function(){var t=this._edge.getDepthDelta();return this._isForward||(t=-t),t},e.prototype.setInResult=function(t){this._isInResult=t},e.prototype.getSym=function(){return this._sym},e.prototype.isForward=function(){return this._isForward},e.prototype.getEdge=function(){return this._edge},e.prototype.printEdge=function(t){this.print(t),t.print(" "),this._isForward?this._edge.print(t):this._edge.printReverse(t)},e.prototype.setSym=function(t){this._sym=t},e.prototype.setVisitedEdge=function(t){this.setVisited(t),this._sym.setVisited(t)},e.prototype.setEdgeDepths=function(t,e){var n=this.getEdge().getDepthDelta();this._isForward||(n=-n);var r=1;t===Ce.LEFT&&(r=-1);var i=Ce.opposite(t),o=e+n*r;this.setDepth(t,e),this.setDepth(i,o)},e.prototype.getEdgeRing=function(){return this._edgeRing},e.prototype.isInResult=function(){return this._isInResult},e.prototype.setNext=function(t){this._next=t},e.prototype.isVisited=function(){return this._isVisited},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.depthFactor=function(t,e){return t===L.EXTERIOR&&e===L.INTERIOR?1:t===L.INTERIOR&&e===L.EXTERIOR?-1:0},e}(Ve),je=function(){};je.prototype.createNode=function(t){return new Ge(t,null)},je.prototype.interfaces_=function(){return[]},je.prototype.getClass=function(){return je};var ze=function(){if(this._edges=new Nt,this._nodes=null,this._edgeEndList=new Nt,0===arguments.length)this._nodes=new Be(new je);else if(1===arguments.length){var t=arguments[0];this._nodes=new Be(t)}};ze.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)}},ze.prototype.find=function(t){return this._nodes.find(t)},ze.prototype.addNode=function(){if(arguments[0]instanceof Ge){var t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof b){var e=arguments[0];return this._nodes.addNode(e)}},ze.prototype.getNodeIterator=function(){return this._nodes.iterator()},ze.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()},ze.prototype.debugPrintln=function(t){z.out.println(t)},ze.prototype.isBoundaryNode=function(t,e){var n=this._nodes.find(e);if(null===n)return!1;var r=n.getLabel();return null!==r&&r.getLocation(t)===L.BOUNDARY},ze.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkAllDirectedEdges()},ze.prototype.matchInSameDirection=function(t,e,n,r){return!!t.equals(n)&&at.computeOrientation(t,e,r)===at.COLLINEAR&&qe.quadrant(t,e)===qe.quadrant(n,r)},ze.prototype.getEdgeEnds=function(){return this._edgeEndList},ze.prototype.debugPrint=function(t){z.out.print(t)},ze.prototype.getEdgeIterator=function(){return this._edges.iterator()},ze.prototype.findEdgeInSameDirection=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(this.matchInSameDirection(t,e,i[0],i[1]))return r;if(this.matchInSameDirection(t,e,i[i.length-1],i[i.length-2]))return r}return null},ze.prototype.insertEdge=function(t){this._edges.add(t)},ze.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},ze.prototype.addEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this._edges.add(n);var r=new Ue(n,!0),i=new Ue(n,!1);r.setSym(i),i.setSym(r),this.add(r),this.add(i)}},ze.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},ze.prototype.getNodes=function(){return this._nodes.values()},ze.prototype.findEdge=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(t.equals(i[0])&&e.equals(i[1]))return r}return null},ze.prototype.interfaces_=function(){return[]},ze.prototype.getClass=function(){return ze},ze.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()};var Xe=function(){this._geometryFactory=null,this._shellList=new Nt;var t=arguments[0];this._geometryFactory=t};Xe.prototype.sortShellsAndHoles=function(t,e,n){for(var r=t.iterator();r.hasNext();){var i=r.next();i.isHole()?n.add(i):e.add(i)}},Xe.prototype.computePolygons=function(t){for(var e=new Nt,n=t.iterator();n.hasNext();){var r=n.next().toPolygon(this._geometryFactory);e.add(r)}return e},Xe.prototype.placeFreeHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(null===r.getShell()){var i=this.findEdgeRingContaining(r,t);if(null===i)throw new Le("unable to assign hole to a shell",r.getCoordinate(0));r.setShell(i)}}},Xe.prototype.buildMinimalEdgeRings=function(t,e,n){for(var r=new Nt,i=t.iterator();i.hasNext();){var o=i.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 r.add(o)}return r},Xe.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},Xe.prototype.buildMaximalEdgeRings=function(t){for(var e=new Nt,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var i=new Ae(r,this._geometryFactory);e.add(i),i.setInResult()}}return e},Xe.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}},Xe.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Xe.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),i=n.getCoordinateN(0),o=null,s=null,a=e.iterator();a.hasNext();){var u=a.next(),c=u.getLinearRing(),l=c.getEnvelopeInternal();null!==o&&(s=o.getLinearRing().getEnvelopeInternal());var p=!1;l.contains(r)&&at.isPointInRing(i,c.getCoordinates())&&(p=!0),p&&(null===o||s.contains(l))&&(o=u)}return o},Xe.prototype.findShell=function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var i=r.next();i.isHole()||(n=i,e++)}return et.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},Xe.prototype.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];ze.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),i=new Nt,o=this.buildMinimalEdgeRings(r,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}},Xe.prototype.interfaces_=function(){return[]},Xe.prototype.getClass=function(){return Xe};var Ye=function(){};Ye.prototype.getBounds=function(){},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye};var He=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};He.prototype.getItem=function(){return this._item},He.prototype.getBounds=function(){return this._bounds},He.prototype.interfaces_=function(){return[Ye,e]},He.prototype.getClass=function(){return He};var We=function(){this._size=null,this._items=null,this._size=0,this._items=new Nt,this._items.add(null)};We.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},We.prototype.size=function(){return this._size},We.prototype.reorder=function(t){for(var e=null,n=this._items.get(t);2*t<=this._size&&((e=2*t)!==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)},We.prototype.clear=function(){this._size=0,this._items.clear()},We.prototype.isEmpty=function(){return 0===this._size},We.prototype.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)},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We};var Ke=function(){};Ke.prototype.visitItem=function(t){},Ke.prototype.interfaces_=function(){return[]},Ke.prototype.getClass=function(){return Ke};var Je=function(){};Je.prototype.insert=function(t,e){},Je.prototype.remove=function(t,e){},Je.prototype.query=function(){},Je.prototype.interfaces_=function(){return[]},Je.prototype.getClass=function(){return Je};var Qe=function(){if(this._childBoundables=new Nt,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},Ze={serialVersionUID:{configurable:!0}};Qe.prototype.getLevel=function(){return this._level},Qe.prototype.size=function(){return this._childBoundables.size()},Qe.prototype.getChildBoundables=function(){return this._childBoundables},Qe.prototype.addChildBoundable=function(t){et.isTrue(null===this._bounds),this._childBoundables.add(t)},Qe.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Qe.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Qe.prototype.interfaces_=function(){return[Ye,e]},Qe.prototype.getClass=function(){return Qe},Ze.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Qe,Ze);var $e=function(){};$e.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},$e.min=function(t){return $e.sort(t),t.get(0)},$e.sort=function(t,e){var n=t.toArray();e?Gt.sort(n,e):Gt.sort(n);for(var r=t.iterator(),i=0,o=n.length;i<o;i++)r.next(),r.set(n[i])},$e.singletonList=function(t){var e=new Nt;return e.add(t),e};var tn=function(){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()};tn.prototype.expandToQueue=function(t,e){var n=tn.isComposite(this._boundable1),r=tn.isComposite(this._boundable2);if(n&&r)return tn.area(this._boundable1)>tn.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 m("neither boundable is composite")},tn.prototype.isLeaves=function(){return!(tn.isComposite(this._boundable1)||tn.isComposite(this._boundable2))},tn.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},tn.prototype.expand=function(t,e,n,r){for(var i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next(),s=new tn(o,e,this._itemDistance);s.getDistance()<r&&n.add(s)}},tn.prototype.getBoundable=function(t){return 0===t?this._boundable1:this._boundable2},tn.prototype.getDistance=function(){return this._distance},tn.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},tn.prototype.interfaces_=function(){return[E]},tn.prototype.getClass=function(){return tn},tn.area=function(t){return t.getBounds().getArea()},tn.isComposite=function(t){return t instanceof Qe};var en=function t(){if(this._root=null,this._built=!1,this._itemBoundables=new Nt,this._nodeCapacity=null,0===arguments.length){var e=t.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(1===arguments.length){var n=arguments[0];et.isTrue(n>1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},nn={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};en.prototype.getNodeCapacity=function(){return this._nodeCapacity},en.prototype.lastNode=function(t){return t.get(t.size()-1)},en.prototype.size=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();n instanceof Qe?t+=this.size(n):n instanceof He&&(t+=1)}return t}},en.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof He&&i.getItem()===e&&(n=i)}return null!==n&&(t.getChildBoundables().remove(n),!0)},en.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new Nt:t}if(1===arguments.length){for(var e=arguments[0],n=new Nt,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();if(i instanceof Qe){var o=this.itemsTree(i);null!==o&&n.add(o)}else i instanceof He?n.add(i.getItem()):et.shouldNeverReachHere()}return n.size()<=0?null:n}},en.prototype.insert=function(t,e){et.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new He(t,e))},en.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new Nt;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];if(et.isTrue(n>-2),r.getLevel()===n)return i.add(r),null;for(var o=r.getChildBoundables().iterator();o.hasNext();){var s=o.next();s instanceof Qe?this.boundablesAtLevel(n,s,i):(et.isTrue(s instanceof He),-1===n&&i.add(s))}return null}},en.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new Nt;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,e),e}if(2===arguments.length){var n=arguments[0],r=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.query(n,this._root,r)}else if(3===arguments.length)if(O(arguments[2],Ke)&&arguments[0]instanceof Object&&arguments[1]instanceof Qe)for(var i=arguments[0],o=arguments[1],s=arguments[2],a=o.getChildBoundables(),u=0;u<a.size();u++){var c=a.get(u);this.getIntersectsOp().intersects(c.getBounds(),i)&&(c instanceof Qe?this.query(i,c,s):c instanceof He?s.visitItem(c.getItem()):et.shouldNeverReachHere())}else if(O(arguments[2],It)&&arguments[0]instanceof Object&&arguments[1]instanceof Qe)for(var l=arguments[0],p=arguments[1],h=arguments[2],f=p.getChildBoundables(),g=0;g<f.size();g++){var d=f.get(g);this.getIntersectsOp().intersects(d.getBounds(),l)&&(d instanceof Qe?this.query(l,d,h):d instanceof He?h.add(d.getItem()):et.shouldNeverReachHere())}},en.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},en.prototype.getRoot=function(){return this.build(),this._root},en.prototype.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],r=arguments[1],i=arguments[2],o=this.removeItem(r,i);if(o)return!0;for(var s=null,a=r.getChildBoundables().iterator();a.hasNext();){var u=a.next();if(this.getIntersectsOp().intersects(u.getBounds(),n)&&u instanceof Qe&&(o=this.remove(n,u,i))){s=u;break}}return null!==s&&s.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(s),o}},en.prototype.createHigherLevels=function(t,e){et.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)},en.prototype.depth=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();if(n instanceof Qe){var r=this.depth(n);r>t&&(t=r)}}return t+1}},en.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var n=new Nt;n.add(this.createNode(e));var r=new Nt(t);$e.sort(r,this.getComparator());for(var i=r.iterator();i.hasNext();){var o=i.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(e)),this.lastNode(n).addChildBoundable(o)}return n},en.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},en.prototype.interfaces_=function(){return[e]},en.prototype.getClass=function(){return en},en.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},nn.IntersectsOp.get=function(){return rn},nn.serialVersionUID.get=function(){return-0x35ef64c82d4c5400},nn.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(en,nn);var rn=function(){},on=function(){};on.prototype.distance=function(t,e){},on.prototype.interfaces_=function(){return[]},on.prototype.getClass=function(){return on};var sn=function(t){function n(e){e=e||n.DEFAULT_NODE_CAPACITY,t.call(this,e)}t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n;var r={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return n.prototype.createParentBoundablesFromVerticalSlices=function(t,e){et.isTrue(t.length>0);for(var n=new Nt,r=0;r<t.length;r++)n.addAll(this.createParentBoundablesFromVerticalSlice(t[r],e));return n},n.prototype.createNode=function(t){return new an(t)},n.prototype.size=function(){return 0===arguments.length?t.prototype.size.call(this):t.prototype.size.apply(this,arguments)},n.prototype.insert=function(){if(2!==arguments.length)return t.prototype.insert.apply(this,arguments);var e=arguments[0],n=arguments[1];if(e.isNull())return null;t.prototype.insert.call(this,e,n)},n.prototype.getIntersectsOp=function(){return n.intersectsOp},n.prototype.verticalSlices=function(t,e){for(var n=Math.trunc(Math.ceil(t.size()/e)),r=new Array(e).fill(null),i=t.iterator(),o=0;o<e;o++){r[o]=new Nt;for(var s=0;i.hasNext()&&s<n;){var a=i.next();r[o].add(a),s++}}return r},n.prototype.query=function(){if(1===arguments.length){var e=arguments[0];return t.prototype.query.call(this,e)}if(2===arguments.length){var n=arguments[0],r=arguments[1];t.prototype.query.call(this,n,r)}else if(3===arguments.length)if(O(arguments[2],Ke)&&arguments[0]instanceof Object&&arguments[1]instanceof Qe){var i=arguments[0],o=arguments[1],s=arguments[2];t.prototype.query.call(this,i,o,s)}else if(O(arguments[2],It)&&arguments[0]instanceof Object&&arguments[1]instanceof Qe){var a=arguments[0],u=arguments[1],c=arguments[2];t.prototype.query.call(this,a,u,c)}},n.prototype.getComparator=function(){return n.yComparator},n.prototype.createParentBoundablesFromVerticalSlice=function(e,n){return t.prototype.createParentBoundables.call(this,e,n)},n.prototype.remove=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return t.prototype.remove.call(this,e,n)}return t.prototype.remove.apply(this,arguments)},n.prototype.depth=function(){return 0===arguments.length?t.prototype.depth.call(this):t.prototype.depth.apply(this,arguments)},n.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var r=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),i=new Nt(t);$e.sort(i,n.xComparator);var o=this.verticalSlices(i,Math.trunc(Math.ceil(Math.sqrt(r))));return this.createParentBoundablesFromVerticalSlices(o,e)},n.prototype.nearestNeighbour=function(){if(1===arguments.length){if(O(arguments[0],on)){var t=arguments[0],e=new tn(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour(e)}if(arguments[0]instanceof tn){var r=arguments[0];return this.nearestNeighbour(r,v.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof n&&O(arguments[1],on)){var i=arguments[0],o=arguments[1],s=new tn(this.getRoot(),i.getRoot(),o);return this.nearestNeighbour(s)}if(arguments[0]instanceof tn&&"number"==typeof arguments[1]){var a=arguments[0],u=arguments[1],c=null,l=new We;for(l.add(a);!l.isEmpty()&&u>0;){var p=l.poll(),h=p.getDistance();if(h>=u)break;p.isLeaves()?(u=h,c=p):p.expandToQueue(l,u)}return[c.getBoundable(0).getItem(),c.getBoundable(1).getItem()]}}else if(3===arguments.length){var f=arguments[0],g=arguments[1],d=arguments[2],y=new He(f,g),_=new tn(this.getRoot(),y,d);return this.nearestNeighbour(_)[0]}},n.prototype.interfaces_=function(){return[Je,e]},n.prototype.getClass=function(){return n},n.centreX=function(t){return n.avg(t.getMinX(),t.getMaxX())},n.avg=function(t,e){return(t+e)/2},n.centreY=function(t){return n.avg(t.getMinY(),t.getMaxY())},r.STRtreeNode.get=function(){return an},r.serialVersionUID.get=function(){return 0x39920f7d5f261e0},r.xComparator.get=function(){return{interfaces_:function(){return[N]},compare:function(e,r){return t.compareDoubles(n.centreX(e.getBounds()),n.centreX(r.getBounds()))}}},r.yComparator.get=function(){return{interfaces_:function(){return[N]},compare:function(e,r){return t.compareDoubles(n.centreY(e.getBounds()),n.centreY(r.getBounds()))}}},r.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},r.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(n,r),n}(en),an=function(t){function e(){var e=arguments[0];t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new Y(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Qe),un=function(){};un.prototype.interfaces_=function(){return[]},un.prototype.getClass=function(){return un},un.relativeSign=function(t,e){return t<e?-1:t>e?1:0},un.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=un.relativeSign(e.x,n.x),i=un.relativeSign(e.y,n.y);switch(t){case 0:return un.compareValue(r,i);case 1:return un.compareValue(i,r);case 2:return un.compareValue(i,-r);case 3:return un.compareValue(-r,i);case 4:return un.compareValue(-r,-i);case 5:return un.compareValue(-i,-r);case 6:return un.compareValue(-i,r);case 7:return un.compareValue(r,-i)}return et.shouldNeverReachHere("invalid octant value"),0},un.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var cn=function(){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],r=arguments[3];this._segString=t,this.coord=new b(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))};cn.prototype.getCoordinate=function(){return this.coord},cn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},cn.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:un.compare(this._segmentOctant,this.coord,e.coord)},cn.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},cn.prototype.isInterior=function(){return this._isInterior},cn.prototype.interfaces_=function(){return[E]},cn.prototype.getClass=function(){return cn};var ln=function(){this._nodeMap=new p,this._edge=null;var t=arguments[0];this._edge=t};ln.prototype.getSplitCoordinates=function(){var t=new Ct;this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next();this.addEdgeCoordinates(n,r,t),n=r}return t.toCoordinateArray()},ln.prototype.addCollapsedNodes=function(){var t=new Nt;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)}},ln.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},ln.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e<this._edge.size()-2;e++){var n=this._edge.getCoordinate(e),r=this._edge.getCoordinate(e+2);n.equals2D(r)&&t.add(new D(e+1))}},ln.prototype.addEdgeCoordinates=function(t,e,n){var r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);n.add(new b(t.coord),!1);for(var o=t.segmentIndex+1;o<=e.segmentIndex;o++)n.add(this._edge.getCoordinate(o));i&&n.add(new b(e.coord))},ln.prototype.iterator=function(){return this._nodeMap.values().iterator()},ln.prototype.addSplitEdges=function(t){this.addEndpoints(),this.addCollapsedNodes();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},ln.prototype.findCollapseIndex=function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var r=e.segmentIndex-t.segmentIndex;return e.isInterior()||r--,1===r&&(n[0]=t.segmentIndex+1,!0)},ln.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=new Array(1).fill(null),n=this.iterator(),r=n.next();n.hasNext();){var i=n.next();this.findCollapseIndex(r,i,e)&&t.add(new D(e[0])),r=i}},ln.prototype.getEdge=function(){return this._edge},ln.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},ln.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),s=0;o[s++]=new b(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this._edge.getCoordinate(a);return i&&(o[s]=new b(e.coord)),new gn(o,this._edge.getData())},ln.prototype.add=function(t,e){var n=new cn(this._edge,t,e,this._edge.getSegmentOctant(e)),r=this._nodeMap.get(n);return null!==r?(et.isTrue(r.coord.equals2D(t),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(n,n),n)},ln.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0).getCoordinate(0);if(!n.equals2D(e[0]))throw new $("bad split edge start point at "+n);var r=t.get(t.size()-1).getCoordinates(),i=r[r.length-1];if(!i.equals2D(e[e.length-1]))throw new $("bad split edge end point at "+i)},ln.prototype.interfaces_=function(){return[]},ln.prototype.getClass=function(){return ln};var pn=function(){};pn.prototype.interfaces_=function(){return[]},pn.prototype.getClass=function(){return pn},pn.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 m("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 b&&arguments[1]instanceof b){var i=arguments[0],o=arguments[1],s=o.x-i.x,a=o.y-i.y;if(0===s&&0===a)throw new m("Cannot compute the octant for two identical points "+i);return pn.octant(s,a)}};var hn=function(){};hn.prototype.getCoordinates=function(){},hn.prototype.size=function(){},hn.prototype.getCoordinate=function(t){},hn.prototype.isClosed=function(){},hn.prototype.setData=function(t){},hn.prototype.getData=function(){},hn.prototype.interfaces_=function(){return[]},hn.prototype.getClass=function(){return hn};var fn=function(){};fn.prototype.addIntersection=function(t,e){},fn.prototype.interfaces_=function(){return[hn]},fn.prototype.getClass=function(){return fn};var gn=function(){this._nodeList=new ln(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};gn.prototype.getCoordinates=function(){return this._pts},gn.prototype.size=function(){return this._pts.length},gn.prototype.getCoordinate=function(t){return this._pts[t]},gn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},gn.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},gn.prototype.setData=function(t){this._data=t},gn.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:pn.octant(t,e)},gn.prototype.getData=function(){return this._data},gn.prototype.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],r=arguments[1],i=arguments[3],o=new b(n.getIntersection(i));this.addIntersection(o,r)}},gn.prototype.toString=function(){return Z.toLineString(new ue(this._pts))},gn.prototype.getNodeList=function(){return this._nodeList},gn.prototype.addIntersectionNode=function(t,e){var n=e,r=n+1;if(r<this._pts.length){var i=this._pts[r];t.equals2D(i)&&(n=r)}return this._nodeList.add(t,n)},gn.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},gn.prototype.interfaces_=function(){return[fn]},gn.prototype.getClass=function(){return gn},gn.getNodedSubstrings=function(){if(1===arguments.length){var t=arguments[0],e=new Nt;return gn.getNodedSubstrings(t,e),e}if(2===arguments.length)for(var n=arguments[0],r=arguments[1],i=n.iterator();i.hasNext();)i.next().getNodeList().addSplitEdges(r)};var dn=function(){if(this.p0=null,this.p1=null,0===arguments.length)this.p0=new b,this.p1=new b;else if(1===arguments.length){var t=arguments[0];this.p0=new b(t.p0),this.p1=new b(t.p1)}else if(2===arguments.length)this.p0=arguments[0],this.p1=arguments[1];else if(4===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3];this.p0=new b(e,n),this.p1=new b(r,i)}},yn={serialVersionUID:{configurable:!0}};dn.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},dn.prototype.orientationIndex=function(){if(arguments[0]instanceof dn){var t=arguments[0],e=at.orientationIndex(this.p0,this.p1,t.p0),n=at.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}if(arguments[0]instanceof b){var r=arguments[0];return at.orientationIndex(this.p0,this.p1,r)}},dn.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},dn.prototype.isVertical=function(){return this.p0.x===this.p1.x},dn.prototype.equals=function(t){if(!(t instanceof dn))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},dn.prototype.intersection=function(t){var e=new it;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},dn.prototype.project=function(){if(arguments[0]instanceof b){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new b(t);var e=this.projectionFactor(t),n=new b;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 dn){var r=arguments[0],i=this.projectionFactor(r.p0),o=this.projectionFactor(r.p1);if(i>=1&&o>=1)return null;if(i<=0&&o<=0)return null;var s=this.project(r.p0);i<0&&(s=this.p0),i>1&&(s=this.p1);var a=this.project(r.p1);return o<0&&(a=this.p0),o>1&&(a=this.p1),new dn(s,a)}},dn.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},dn.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},dn.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},dn.prototype.distancePerpendicular=function(t){return at.distancePointLinePerpendicular(t,this.p0,this.p1)},dn.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},dn.prototype.midPoint=function(){return dn.midPoint(this.p0,this.p1)},dn.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,r=e*e+n*n;return r<=0?v.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r},dn.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=v.MAX_VALUE,i=null,o=this.closestPoint(t.p0);r=o.distance(t.p0),n[0]=o,n[1]=t.p0;var s=this.closestPoint(t.p1);(i=s.distance(t.p1))<r&&(r=i,n[0]=s,n[1]=t.p1);var a=t.closestPoint(this.p0);(i=a.distance(this.p0))<r&&(r=i,n[0]=this.p0,n[1]=a);var u=t.closestPoint(this.p1);return(i=u.distance(this.p1))<r&&(r=i,n[0]=this.p1,n[1]=u),n},dn.prototype.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},dn.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},dn.prototype.getLength=function(){return this.p0.distance(this.p1)},dn.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return 0!==n?n:this.p1.compareTo(e.p1)},dn.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},dn.prototype.equalsTopo=function(t){return this.p0.equals(t.p0)&&(this.p1.equals(t.p1)||this.p0.equals(t.p1))&&this.p1.equals(t.p0)},dn.prototype.lineIntersection=function(t){try{return X.intersection(this.p0,this.p1,t.p0,t.p1)}catch(t){if(!(t instanceof j))throw t}return null},dn.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},dn.prototype.pointAlongOffset=function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),r=this.p0.y+t*(this.p1.y-this.p0.y),i=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,s=Math.sqrt(i*i+o*o),a=0,u=0;if(0!==e){if(s<=0)throw new Error("Cannot compute offset from zero-length line segment");a=e*i/s,u=e*o/s}return new b(n-u,r+a)},dn.prototype.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}},dn.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||v.isNaN(e))&&(e=1),e},dn.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},dn.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},dn.prototype.distance=function(){if(arguments[0]instanceof dn){var t=arguments[0];return at.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof b){var e=arguments[0];return at.distancePointLine(e,this.p0,this.p1)}},dn.prototype.pointAlong=function(t){var e=new b;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},dn.prototype.hashCode=function(){var t=v.doubleToLongBits(this.p0.x);t^=31*v.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=v.doubleToLongBits(this.p1.x);return n^=31*v.doubleToLongBits(this.p1.y),e^Math.trunc(n)^Math.trunc(n>>32)},dn.prototype.interfaces_=function(){return[E,e]},dn.prototype.getClass=function(){return dn},dn.midPoint=function(t,e){return new b((t.x+e.x)/2,(t.y+e.y)/2)},yn.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(dn,yn);var _n=function(){this.tempEnv1=new Y,this.tempEnv2=new Y,this._overlapSeg1=new dn,this._overlapSeg2=new dn};_n.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];t.getLineSegment(e,this._overlapSeg1),n.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},_n.prototype.interfaces_=function(){return[]},_n.prototype.getClass=function(){return _n};var mn=function(){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],r=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=r};mn.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},mn.prototype.computeSelect=function(t,e,n,r){var i=this._pts[e],o=this._pts[n];if(r.tempEnv1.init(i,o),n-e==1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var s=Math.trunc((e+n)/2);e<s&&this.computeSelect(t,e,s,r),s<n&&this.computeSelect(t,s,n,r)},mn.prototype.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},mn.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},mn.prototype.setId=function(t){this._id=t},mn.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},mn.prototype.getEnvelope=function(){if(null===this._env){var t=this._pts[this._start],e=this._pts[this._end];this._env=new Y(t,e)}return this._env},mn.prototype.getEndIndex=function(){return this._end},mn.prototype.getStartIndex=function(){return this._start},mn.prototype.getContext=function(){return this._context},mn.prototype.getId=function(){return this._id},mn.prototype.computeOverlapsInternal=function(t,e,n,r,i,o){var s=this._pts[t],a=this._pts[e],u=n._pts[r],c=n._pts[i];if(e-t==1&&i-r==1)return o.overlap(this,t,n,r),null;if(o.tempEnv1.init(s,a),o.tempEnv2.init(u,c),!o.tempEnv1.intersects(o.tempEnv2))return null;var l=Math.trunc((t+e)/2),p=Math.trunc((r+i)/2);t<l&&(r<p&&this.computeOverlapsInternal(t,l,n,r,p,o),p<i&&this.computeOverlapsInternal(t,l,n,p,i,o)),l<e&&(r<p&&this.computeOverlapsInternal(l,e,n,r,p,o),p<i&&this.computeOverlapsInternal(l,e,n,p,i,o))},mn.prototype.interfaces_=function(){return[]},mn.prototype.getClass=function(){return mn};var vn=function(){};vn.prototype.interfaces_=function(){return[]},vn.prototype.getClass=function(){return vn},vn.getChainStartIndices=function(t){var e=0,n=new Nt;n.add(new D(e));do{var r=vn.findChainEnd(t,e);n.add(new D(r)),e=r}while(e<t.length-1);return vn.toIntArray(n)},vn.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 r=qe.quadrant(t[n],t[n+1]),i=e+1;i<t.length&&(t[i-1].equals2D(t[i])||qe.quadrant(t[i-1],t[i])===r);)i++;return i-1},vn.getChains=function(){if(1===arguments.length){var t=arguments[0];return vn.getChains(t,null)}if(2===arguments.length){for(var e=arguments[0],n=arguments[1],r=new Nt,i=vn.getChainStartIndices(e),o=0;o<i.length-1;o++){var s=new mn(e,i[o],i[o+1],n);r.add(s)}return r}},vn.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};var xn=function(){};xn.prototype.computeNodes=function(t){},xn.prototype.getNodedSubstrings=function(){},xn.prototype.interfaces_=function(){return[]},xn.prototype.getClass=function(){return xn};var En=function(){if(this._segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}};En.prototype.setSegmentIntersector=function(t){this._segInt=t},En.prototype.interfaces_=function(){return[xn]},En.prototype.getClass=function(){return En};var In=function(t){function e(e){e?t.call(this,e):t.call(this),this._monoChains=new Nt,this._index=new sn,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={SegmentOverlapAction:{configurable:!0}};return e.prototype.getMonotoneChains=function(){return this._monoChains},e.prototype.getNodedSubstrings=function(){return gn.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(t){for(var e=vn.getChains(t.getCoordinates(),t).iterator();e.hasNext();){var n=e.next();n.setId(this._idCounter++),this._index.insert(n.getEnvelope(),n),this._monoChains.add(n)}},e.prototype.computeNodes=function(t){this._nodedSegStrings=t;for(var e=t.iterator();e.hasNext();)this.add(e.next());this.intersectChains()},e.prototype.intersectChains=function(){for(var t=new Nn(this._segInt),e=this._monoChains.iterator();e.hasNext();)for(var n=e.next(),r=this._index.query(n.getEnvelope()).iterator();r.hasNext();){var i=r.next();if(i.getId()>n.getId()&&(n.computeOverlaps(i,t),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return Nn},Object.defineProperties(e,n),e}(En),Nn=function(t){function e(){t.call(this),this._si=null;var e=arguments[0];this._si=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(4!==arguments.length)return t.prototype.overlap.apply(this,arguments);var e=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3],o=e.getContext(),s=r.getContext();this._si.processIntersections(o,n,s,i)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(_n),bn=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(r)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(s),this.setMitreLimit(a)}},Cn={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};bn.prototype.getEndCapStyle=function(){return this._endCapStyle},bn.prototype.isSingleSided=function(){return this._isSingleSided},bn.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=bn.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=bn.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==bn.JOIN_ROUND&&(this._quadrantSegments=bn.DEFAULT_QUADRANT_SEGMENTS)},bn.prototype.getJoinStyle=function(){return this._joinStyle},bn.prototype.setJoinStyle=function(t){this._joinStyle=t},bn.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},bn.prototype.getSimplifyFactor=function(){return this._simplifyFactor},bn.prototype.getQuadrantSegments=function(){return this._quadrantSegments},bn.prototype.setEndCapStyle=function(t){this._endCapStyle=t},bn.prototype.getMitreLimit=function(){return this._mitreLimit},bn.prototype.setMitreLimit=function(t){this._mitreLimit=t},bn.prototype.setSingleSided=function(t){this._isSingleSided=t},bn.prototype.interfaces_=function(){return[]},bn.prototype.getClass=function(){return bn},bn.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Cn.CAP_ROUND.get=function(){return 1},Cn.CAP_FLAT.get=function(){return 2},Cn.CAP_SQUARE.get=function(){return 3},Cn.JOIN_ROUND.get=function(){return 1},Cn.JOIN_MITRE.get=function(){return 2},Cn.JOIN_BEVEL.get=function(){return 3},Cn.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Cn.DEFAULT_MITRE_LIMIT.get=function(){return 5},Cn.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(bn,Cn);var wn=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=at.COUNTERCLOCKWISE,this._inputLine=t||null},Sn={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};wn.prototype.isDeletable=function(t,e,n,r){var i=this._inputLine[t],o=this._inputLine[e],s=this._inputLine[n];return!!this.isConcave(i,o,s)&&!!this.isShallow(i,o,s,r)&&this.isShallowSampled(i,o,t,n,r)},wn.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e),r=!1;n<this._inputLine.length;){var i=!1;this.isDeletable(t,e,n,this._distanceTol)&&(this._isDeleted[e]=wn.DELETE,i=!0,r=!0),t=i?n:e,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e)}return r},wn.prototype.isShallowConcavity=function(t,e,n,r){return at.computeOrientation(t,e,n)===this._angleOrientation&&at.distancePointLine(e,t,n)<r},wn.prototype.isShallowSampled=function(t,e,n,r,i){var o=Math.trunc((r-n)/wn.NUM_PTS_TO_CHECK);o<=0&&(o=1);for(var s=n;s<r;s+=o)if(!this.isShallow(t,e,this._inputLine[s],i))return!1;return!0},wn.prototype.isConcave=function(t,e,n){return at.computeOrientation(t,e,n)===this._angleOrientation},wn.prototype.simplify=function(t){this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=at.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var e=!1;do{e=this.deleteShallowConcavities()}while(e);return this.collapseLine()},wn.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===wn.DELETE;)e++;return e},wn.prototype.isShallow=function(t,e,n,r){return at.distancePointLine(e,t,n)<r},wn.prototype.collapseLine=function(){for(var t=new Ct,e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==wn.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()},wn.prototype.interfaces_=function(){return[]},wn.prototype.getClass=function(){return wn},wn.simplify=function(t,e){return new wn(t).simplify(e)},Sn.INIT.get=function(){return 0},Sn.DELETE.get=function(){return 1},Sn.KEEP.get=function(){return 1},Sn.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(wn,Sn);var Ln=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new Nt},Pn={COORDINATE_ARRAY_TYPE:{configurable:!0}};Ln.prototype.getCoordinates=function(){return this._ptList.toArray(Ln.COORDINATE_ARRAY_TYPE)},Ln.prototype.setPrecisionModel=function(t){this._precisionModel=t},Ln.prototype.addPt=function(t){var e=new b(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},Ln.prototype.revere=function(){},Ln.prototype.addPts=function(t,e){if(e)for(var n=0;n<t.length;n++)this.addPt(t[n]);else for(var r=t.length-1;r>=0;r--)this.addPt(t[r])},Ln.prototype.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},Ln.prototype.toString=function(){return(new _e).createLineString(this.getCoordinates()).toString()},Ln.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new b(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},Ln.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},Ln.prototype.interfaces_=function(){return[]},Ln.prototype.getClass=function(){return Ln},Pn.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Ln,Pn);var On=function(){},Tn={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};On.prototype.interfaces_=function(){return[]},On.prototype.getClass=function(){return On},On.toDegrees=function(t){return 180*t/Math.PI},On.normalize=function(t){for(;t>Math.PI;)t-=On.PI_TIMES_2;for(;t<=-Math.PI;)t+=On.PI_TIMES_2;return t},On.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],r=n.x-e.x,i=n.y-e.y;return Math.atan2(i,r)}},On.isAcute=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)>0},On.isObtuse=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)<0},On.interiorAngle=function(t,e,n){var r=On.angle(e,t),i=On.angle(e,n);return Math.abs(i-r)},On.normalizePositive=function(t){if(t<0){for(;t<0;)t+=On.PI_TIMES_2;t>=On.PI_TIMES_2&&(t=0)}else{for(;t>=On.PI_TIMES_2;)t-=On.PI_TIMES_2;t<0&&(t=0)}return t},On.angleBetween=function(t,e,n){var r=On.angle(e,t),i=On.angle(e,n);return On.diff(r,i)},On.diff=function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n},On.toRadians=function(t){return t*Math.PI/180},On.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?On.COUNTERCLOCKWISE:n<0?On.CLOCKWISE:On.NONE},On.angleBetweenOriented=function(t,e,n){var r=On.angle(e,t),i=On.angle(e,n)-r;return i<=-Math.PI?i+On.PI_TIMES_2:i>Math.PI?i-On.PI_TIMES_2:i},Tn.PI_TIMES_2.get=function(){return 2*Math.PI},Tn.PI_OVER_2.get=function(){return Math.PI/2},Tn.PI_OVER_4.get=function(){return Math.PI/4},Tn.COUNTERCLOCKWISE.get=function(){return at.COUNTERCLOCKWISE},Tn.CLOCKWISE.get=function(){return at.CLOCKWISE},Tn.NONE.get=function(){return at.COLLINEAR},Object.defineProperties(On,Tn);var Rn=function t(){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 dn,this._seg1=new dn,this._offset0=new dn,this._offset1=new dn,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=e,this._bufParams=n,this._li=new it,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===bn.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},Mn={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};Rn.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=at.computeOrientation(this._s0,this._s1,this._s2),r=n===at.CLOCKWISE&&this._side===Ce.LEFT||n===at.COUNTERCLOCKWISE&&this._side===Ce.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},Rn.prototype.addLineEndCap=function(t,e){var n=new dn(t,e),r=new dn;this.computeOffsetSegment(n,Ce.LEFT,this._distance,r);var i=new dn;this.computeOffsetSegment(n,Ce.RIGHT,this._distance,i);var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o);switch(this._bufParams.getEndCapStyle()){case bn.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,a+Math.PI/2,a-Math.PI/2,at.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case bn.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case bn.CAP_SQUARE:var u=new b;u.x=Math.abs(this._distance)*Math.cos(a),u.y=Math.abs(this._distance)*Math.sin(a);var c=new b(r.p1.x+u.x,r.p1.y+u.y),l=new b(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(c),this._segList.addPt(l)}},Rn.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Rn.prototype.addMitreJoin=function(t,e,n,r){var i=!0,o=null;try{o=X.intersection(e.p0,e.p1,n.p0,n.p1),(r<=0?1:o.distance(t)/Math.abs(r))>this._bufParams.getMitreLimit()&&(i=!1)}catch(t){if(!(t instanceof j))throw t;o=new b(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},Rn.prototype.addFilletCorner=function(t,e,n,r,i){var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o),u=n.x-t.x,c=n.y-t.y,l=Math.atan2(c,u);r===at.CLOCKWISE?a<=l&&(a+=2*Math.PI):a>=l&&(a-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,a,l,r,i),this._segList.addPt(n)},Rn.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*Rn.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===bn.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===bn.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))},Rn.prototype.createSquare=function(t){this._segList.addPt(new b(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new b(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new b(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new b(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},Rn.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},Rn.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},Rn.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},Rn.prototype.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)},Rn.prototype.addLimitedMitreJoin=function(t,e,n,r){var i=this._seg0.p1,o=On.angle(i,this._seg0.p0),s=On.angleBetweenOriented(this._seg0.p0,i,this._seg1.p1)/2,a=On.normalize(o+s),u=On.normalize(a+Math.PI),c=r*n,l=n-c*Math.abs(Math.sin(s)),p=i.x+c*Math.cos(u),h=i.y+c*Math.sin(u),f=new b(p,h),g=new dn(i,f),d=g.pointAlongOffset(1,l),y=g.pointAlongOffset(1,-l);this._side===Ce.LEFT?(this._segList.addPt(d),this._segList.addPt(y)):(this._segList.addPt(y),this._segList.addPt(d))},Rn.prototype.computeOffsetSegment=function(t,e,n,r){var i=e===Ce.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=i*n*o/a,c=i*n*s/a;r.p0.x=t.p0.x-c,r.p0.y=t.p0.y+u,r.p1.x=t.p1.x-c,r.p1.y=t.p1.y+u},Rn.prototype.addFilletArc=function(t,e,n,r,i){var o=r===at.CLOCKWISE?-1:1,s=Math.abs(e-n),a=Math.trunc(s/this._filletAngleQuantum+.5);if(a<1)return null;for(var u=s/a,c=0,l=new b;c<s;){var p=e+o*c;l.x=t.x+i*Math.cos(p),l.y=t.y+i*Math.sin(p),this._segList.addPt(l),c+=u}},Rn.prototype.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*Rn.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 b((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 r=new b((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(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},Rn.prototype.createCircle=function(t){var e=new b(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Rn.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Rn.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Ln,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Rn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Rn.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===bn.JOIN_BEVEL||this._bufParams.getJoinStyle()===bn.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,at.CLOCKWISE,this._distance))},Rn.prototype.closeRing=function(){this._segList.closeRing()},Rn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Rn.prototype.interfaces_=function(){return[]},Rn.prototype.getClass=function(){return Rn},Mn.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},Mn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},Mn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Mn.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Rn,Mn);var Dn=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};Dn.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var n=e<0,r=Math.abs(e),i=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],i):this.computeOffsetCurve(t,n,i);var o=i.getCoordinates();return n&&wt.reverse(o),o},Dn.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=wn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Ce.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{n.addSegments(t,!1);var a=wn.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],Ce.LEFT),n.addFirstSegment();for(var c=2;c<=u;c++)n.addNextSegment(a[c],!0)}n.addLastSegment(),n.closeRing()},Dn.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===Ce.RIGHT&&(r=-r);var i=wn.simplify(t,r),o=i.length-1;n.initSideSegments(i[o-1],i[0],e);for(var s=1;s<=o;s++){var a=1!==s;n.addNextSegment(i[s],a)}n.closeRing()},Dn.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=wn.simplify(t,n),i=r.length-1;e.initSideSegments(r[0],r[1],Ce.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[i-1],r[i]);var s=wn.simplify(t,-n),a=s.length-1;e.initSideSegments(s[a],s[a-1],Ce.LEFT);for(var u=a-2;u>=0;u--)e.addNextSegment(s[u],!0);e.addLastSegment(),e.addLineEndCap(s[1],s[0]),e.closeRing()},Dn.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case bn.CAP_ROUND:e.createCircle(t);break;case bn.CAP_SQUARE:e.createSquare(t)}},Dn.prototype.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),r=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],r);else if(this._bufParams.isSingleSided()){var i=e<0;this.computeSingleSidedBufferCurve(t,i,r)}else this.computeLineBufferCurve(t,r);return r.getCoordinates()},Dn.prototype.getBufferParameters=function(){return this._bufParams},Dn.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},Dn.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return Dn.copyCoordinates(t);var r=this.getSegGen(n);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()},Dn.prototype.computeOffsetCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var i=wn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Ce.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{var a=wn.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],Ce.LEFT),n.addFirstSegment();for(var c=2;c<=u;c++)n.addNextSegment(a[c],!0)}n.addLastSegment()},Dn.prototype.getSegGen=function(t){return new Rn(this._precisionModel,this._bufParams,t)},Dn.prototype.interfaces_=function(){return[]},Dn.prototype.getClass=function(){return Dn},Dn.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new b(t[n]);return e};var An=function(){this._subgraphs=null,this._seg=new dn,this._cga=new at;var t=arguments[0];this._subgraphs=t},Fn={DepthSegment:{configurable:!0}};An.prototype.findStabbedSegments=function(){if(1===arguments.length){for(var t=arguments[0],e=new Nt,n=this._subgraphs.iterator();n.hasNext();){var r=n.next(),i=r.getEnvelope();t.y<i.getMinY()||t.y>i.getMaxY()||this.findStabbedSegments(t,r.getDirectedEdges(),e)}return e}if(3===arguments.length)if(O(arguments[2],It)&&arguments[0]instanceof b&&arguments[1]instanceof Ue){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=s.getEdge().getCoordinates(),c=0;c<u.length-1;c++)if(this._seg.p0=u[c],this._seg.p1=u[c+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<o.x||this._seg.isHorizontal()||o.y<this._seg.p0.y||o.y>this._seg.p1.y||at.computeOrientation(this._seg.p0,this._seg.p1,o)===at.RIGHT)){var l=s.getDepth(Ce.LEFT);this._seg.p0.equals(u[c])||(l=s.getDepth(Ce.RIGHT));var p=new Gn(this._seg,l);a.add(p)}}else if(O(arguments[2],It)&&arguments[0]instanceof b&&O(arguments[1],It))for(var h=arguments[0],f=arguments[1],g=arguments[2],d=f.iterator();d.hasNext();){var y=d.next();y.isForward()&&this.findStabbedSegments(h,y,g)}},An.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:$e.min(e)._leftDepth},An.prototype.interfaces_=function(){return[]},An.prototype.getClass=function(){return An},Fn.DepthSegment.get=function(){return Gn},Object.defineProperties(An,Fn);var Gn=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new dn(t),this._leftDepth=e};Gn.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||0!=(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?n:this._upwardSeg.compareTo(e._upwardSeg)},Gn.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},Gn.prototype.toString=function(){return this._upwardSeg.toString()},Gn.prototype.interfaces_=function(){return[E]},Gn.prototype.getClass=function(){return Gn};var Bn=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};Bn.prototype.area=function(){return Bn.area(this.p0,this.p1,this.p2)},Bn.prototype.signedArea=function(){return Bn.signedArea(this.p0,this.p1,this.p2)},Bn.prototype.interpolateZ=function(t){if(null===t)throw new m("Supplied point is null.");return Bn.interpolateZ(t,this.p0,this.p1,this.p2)},Bn.prototype.longestSideLength=function(){return Bn.longestSideLength(this.p0,this.p1,this.p2)},Bn.prototype.isAcute=function(){return Bn.isAcute(this.p0,this.p1,this.p2)},Bn.prototype.circumcentre=function(){return Bn.circumcentre(this.p0,this.p1,this.p2)},Bn.prototype.area3D=function(){return Bn.area3D(this.p0,this.p1,this.p2)},Bn.prototype.centroid=function(){return Bn.centroid(this.p0,this.p1,this.p2)},Bn.prototype.inCentre=function(){return Bn.inCentre(this.p0,this.p1,this.p2)},Bn.prototype.interfaces_=function(){return[]},Bn.prototype.getClass=function(){return Bn},Bn.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)},Bn.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},Bn.det=function(t,e,n,r){return t*r-e*n},Bn.interpolateZ=function(t,e,n,r){var i=e.x,o=e.y,s=n.x-i,a=r.x-i,u=n.y-o,c=r.y-o,l=s*c-a*u,p=t.x-i,h=t.y-o,f=(c*p-a*h)/l,g=(-u*p+s*h)/l;return e.z+f*(n.z-e.z)+g*(r.z-e.z)},Bn.longestSideLength=function(t,e,n){var r=t.distance(e),i=e.distance(n),o=n.distance(t),s=r;return i>s&&(s=i),o>s&&(s=o),s},Bn.isAcute=function(t,e,n){return!!On.isAcute(t,e,n)&&!!On.isAcute(e,n,t)&&!!On.isAcute(n,t,e)},Bn.circumcentre=function(t,e,n){var r=n.x,i=n.y,o=t.x-r,s=t.y-i,a=e.x-r,u=e.y-i,c=2*Bn.det(o,s,a,u),l=Bn.det(s,o*o+s*s,u,a*a+u*u),p=Bn.det(o,o*o+s*s,a,a*a+u*u);return new b(r-l/c,i+p/c)},Bn.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,i=new X(t.x+n/2,t.y+r/2,1),o=new X(t.x-r+n/2,t.y+n+r/2,1);return new X(i,o)},Bn.angleBisector=function(t,e,n){var r=e.distance(t),i=r/(r+e.distance(n)),o=n.x-t.x,s=n.y-t.y;return new b(t.x+i*o,t.y+i*s)},Bn.area3D=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=e.z-t.z,s=n.x-t.x,a=n.y-t.y,u=n.z-t.z,c=i*u-o*a,l=o*s-r*u,p=r*a-i*s,h=c*c+l*l+p*p;return Math.sqrt(h)/2},Bn.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,i=(t.y+e.y+n.y)/3;return new b(r,i)},Bn.inCentre=function(t,e,n){var r=e.distance(n),i=t.distance(n),o=t.distance(e),s=r+i+o,a=(r*t.x+i*e.x+o*n.x)/s,u=(r*t.y+i*e.y+o*n.y)/s;return new b(a,u)};var qn=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new Nt;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};qn.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,L.EXTERIOR,L.INTERIOR)},qn.prototype.addPolygon=function(t){var e=this._distance,n=Ce.LEFT;this._distance<0&&(e=-this._distance,n=Ce.RIGHT);var r=t.getExteriorRing(),i=wt.removeRepeatedPoints(r.getCoordinates());if(this._distance<0&&this.isErodedCompletely(r,this._distance))return null;if(this._distance<=0&&i.length<3)return null;this.addPolygonRing(i,e,n,L.EXTERIOR,L.INTERIOR);for(var o=0;o<t.getNumInteriorRing();o++){var s=t.getInteriorRingN(o),a=wt.removeRepeatedPoints(s.getCoordinates());this._distance>0&&this.isErodedCompletely(s,-this._distance)||this.addPolygonRing(a,e,Ce.opposite(n),L.INTERIOR,L.EXTERIOR)}},qn.prototype.isTriangleErodedCompletely=function(t,e){var n=new Bn(t[0],t[1],t[2]),r=n.inCentre();return at.distancePointLine(r,n.p0,n.p1)<Math.abs(e)},qn.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=wt.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,L.EXTERIOR,L.INTERIOR)},qn.prototype.addCurve=function(t,e,n){if(null===t||t.length<2)return null;var r=new gn(t,new Re(0,L.BOUNDARY,e,n));this._curveList.add(r)},qn.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},qn.prototype.addPolygonRing=function(t,e,n,r,i){if(0===e&&t.length<ee.MINIMUM_VALID_SIZE)return null;var o=r,s=i;t.length>=ee.MINIMUM_VALID_SIZE&&at.isCCW(t)&&(o=i,s=r,n=Ce.opposite(n));var a=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)},qn.prototype.add=function(t){if(t.isEmpty())return null;t instanceof $t?this.addPolygon(t):t instanceof Kt?this.addLineString(t):t instanceof Qt?this.addPoint(t):(t instanceof te||t instanceof jt||t instanceof ne||t instanceof Ut)&&this.addCollection(t)},qn.prototype.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 r=t.getEnvelopeInternal(),i=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>i},qn.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},qn.prototype.interfaces_=function(){return[]},qn.prototype.getClass=function(){return qn};var kn=function(){};kn.prototype.locate=function(t){},kn.prototype.interfaces_=function(){return[]},kn.prototype.getClass=function(){return kn};var Vn=function(){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()};Vn.prototype.next=function(){if(this._atStart)return this._atStart=!1,Vn.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 r;var t=this._parent.getGeometryN(this._index++);return t instanceof Ut?(this._subcollectionIterator=new Vn(t),this._subcollectionIterator.next()):t},Vn.prototype.remove=function(){throw new Error(this.getClass().getName())},Vn.prototype.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)},Vn.prototype.interfaces_=function(){return[Et]},Vn.prototype.getClass=function(){return Vn},Vn.isAtomic=function(t){return!(t instanceof Ut)};var Un=function(){this._geom=null;var t=arguments[0];this._geom=t};Un.prototype.locate=function(t){return Un.locate(t,this._geom)},Un.prototype.interfaces_=function(){return[kn]},Un.prototype.getClass=function(){return Un},Un.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&at.isPointInRing(t,e.getCoordinates())},Un.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!Un.isPointInRing(t,n))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var i=e.getInteriorRingN(r);if(Un.isPointInRing(t,i))return!1}return!0},Un.containsPoint=function(t,e){if(e instanceof $t)return Un.containsPointInPolygon(t,e);if(e instanceof Ut)for(var n=new Vn(e);n.hasNext();){var r=n.next();if(r!==e&&Un.containsPoint(t,r))return!0}return!1},Un.locate=function(t,e){return e.isEmpty()?L.EXTERIOR:Un.containsPoint(t,e)?L.INTERIOR:L.EXTERIOR};var jn=function(){this._edgeMap=new p,this._edgeList=null,this._ptInAreaLocation=[L.NONE,L.NONE]};jn.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)},jn.prototype.propagateSideLabels=function(t){for(var e=L.NONE,n=this.iterator();n.hasNext();){var r=n.next().getLabel();r.isArea(t)&&r.getLocation(t,Ce.LEFT)!==L.NONE&&(e=r.getLocation(t,Ce.LEFT))}if(e===L.NONE)return null;for(var i=e,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getLabel();if(a.getLocation(t,Ce.ON)===L.NONE&&a.setLocation(t,Ce.ON,i),a.isArea(t)){var u=a.getLocation(t,Ce.LEFT),c=a.getLocation(t,Ce.RIGHT);if(c!==L.NONE){if(c!==i)throw new Le("side location conflict",s.getCoordinate());u===L.NONE&&et.shouldNeverReachHere("found single null side (at "+s.getCoordinate()+")"),i=u}else et.isTrue(a.getLocation(t,Ce.LEFT)===L.NONE,"found single null side"),a.setLocation(t,Ce.RIGHT,i),a.setLocation(t,Ce.LEFT,i)}}},jn.prototype.getCoordinate=function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},jn.prototype.print=function(t){z.out.println("EdgeEndStar:   "+this.getCoordinate());for(var e=this.iterator();e.hasNext();)e.next().print(t)},jn.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},jn.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,r=e.get(n).getLabel().getLocation(t,Ce.LEFT);et.isTrue(r!==L.NONE,"Found unlabelled area edge");for(var i=r,o=this.iterator();o.hasNext();){var s=o.next().getLabel();et.isTrue(s.isArea(t),"Found non-area edge");var a=s.getLocation(t,Ce.LEFT),u=s.getLocation(t,Ce.RIGHT);if(a===u)return!1;if(u!==i)return!1;i=a}return!0},jn.prototype.findIndex=function(t){this.iterator();for(var e=0;e<this._edgeList.size();e++)if(this._edgeList.get(e)===t)return e;return-1},jn.prototype.iterator=function(){return this.getEdges().iterator()},jn.prototype.getEdges=function(){return null===this._edgeList&&(this._edgeList=new Nt(this._edgeMap.values())),this._edgeList},jn.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===L.NONE&&(this._ptInAreaLocation[t]=Un.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},jn.prototype.toString=function(){var t=new M;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()},jn.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();)e.next().computeLabel(t)},jn.prototype.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 r=n.next().getLabel(),i=0;i<2;i++)r.isLine(i)&&r.getLocation(i)===L.BOUNDARY&&(e[i]=!0);for(var o=this.iterator();o.hasNext();)for(var s=o.next(),a=s.getLabel(),u=0;u<2;u++)if(a.isAnyNull(u)){var c=L.NONE;if(e[u])c=L.EXTERIOR;else{var l=s.getCoordinate();c=this.getLocation(u,l,t)}a.setAllLocationsIfNull(u,c)}},jn.prototype.getDegree=function(){return this._edgeMap.size()},jn.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn};var zn=function(t){function e(){t.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var t=null,e=null,n=this._SCANNING_FOR_INCOMING,r=0;r<this._resultAreaEdgeList.size();r++){var i=this._resultAreaEdgeList.get(r),o=i.getSym();if(i.getLabel().isArea())switch(null===t&&i.isInResult()&&(t=i),n){case this._SCANNING_FOR_INCOMING:if(!o.isInResult())continue;e=o,n=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!i.isInResult())continue;e.setNext(i),n=this._SCANNING_FOR_INCOMING}}if(n===this._LINKING_TO_OUTGOING){if(null===t)throw new Le("no outgoing dirEdge found",this.getCoordinate());et.isTrue(t.isInResult(),"unable to link last incoming dirEdge"),e.setNext(t)}},e.prototype.insert=function(t){var e=t;this.insertEdgeEnd(e,e)},e.prototype.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 r=t.get(e-1),i=n.getQuadrant(),o=r.getQuadrant();return qe.isNorthern(i)&&qe.isNorthern(o)?n:qe.isNorthern(i)||qe.isNorthern(o)?0!==n.getDy()?n:0!==r.getDy()?r:(et.shouldNeverReachHere("found two horizontal edges incident on node"),null):r},e.prototype.print=function(t){z.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()}},e.prototype.getResultAreaEdges=function(){if(null!==this._resultAreaEdgeList)return this._resultAreaEdgeList;this._resultAreaEdgeList=new Nt;for(var t=this.iterator();t.hasNext();){var e=t.next();(e.isInResult()||e.getSym().isInResult())&&this._resultAreaEdgeList.add(e)}return this._resultAreaEdgeList},e.prototype.updateLabelling=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next().getLabel();n.setAllLocationsIfNull(0,t.getLocation(0)),n.setAllLocationsIfNull(1,t.getLocation(1))}},e.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var t=null,e=null,n=this._edgeList.size()-1;n>=0;n--){var r=this._edgeList.get(n),i=r.getSym();null===e&&(e=i),null!==t&&i.setNext(t),t=r}e.setNext(t)},e.prototype.computeDepths=function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),n=t.getDepth(Ce.LEFT),r=t.getDepth(Ce.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,i)!==r)throw new Le("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=o;u<s;u++){var c=this._edgeList.get(u);c.setEdgeDepths(Ce.RIGHT,a),a=c.getDepth(Ce.LEFT)}return a}},e.prototype.mergeSymLabels=function(){for(var t=this.iterator();t.hasNext();){var e=t.next();e.getLabel().merge(e.getSym().getLabel())}},e.prototype.linkMinimalDirectedEdges=function(t){for(var e=null,n=null,r=this._SCANNING_FOR_INCOMING,i=this._resultAreaEdgeList.size()-1;i>=0;i--){var o=this._resultAreaEdgeList.get(i),s=o.getSym();switch(null===e&&o.getEdgeRing()===t&&(e=o),r){case this._SCANNING_FOR_INCOMING:if(s.getEdgeRing()!==t)continue;n=s,r=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;n.setNextMin(o),r=this._SCANNING_FOR_INCOMING}}r===this._LINKING_TO_OUTGOING&&(et.isTrue(null!==e,"found null for first outgoing dirEdge"),et.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))},e.prototype.getOutgoingDegree=function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();)e.next().isInResult()&&t++;return t}if(1===arguments.length){for(var n=arguments[0],r=0,i=this.iterator();i.hasNext();)i.next().getEdgeRing()===n&&r++;return r}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=L.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=L.INTERIOR;break}if(r.isInResult()){t=L.EXTERIOR;break}}}if(t===L.NONE)return null;for(var i=t,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getSym();s.isLineEdge()?s.getEdge().setCovered(i===L.INTERIOR):(s.isInResult()&&(i=L.EXTERIOR),a.isInResult()&&(i=L.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new Re(L.NONE);for(var n=this.iterator();n.hasNext();)for(var r=n.next().getEdge().getLabel(),i=0;i<2;i++){var o=r.getLocation(i);o!==L.INTERIOR&&o!==L.BOUNDARY||this._label.setLocation(i,L.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(jn),Xn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(t){return new Ge(t,new zn)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(je),Yn=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};Yn.prototype.compareTo=function(t){var e=t;return Yn.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},Yn.prototype.interfaces_=function(){return[E]},Yn.prototype.getClass=function(){return Yn},Yn.orientation=function(t){return 1===wt.increasingDirection(t)},Yn.compareOriented=function(t,e,n,r){for(var i=e?1:-1,o=r?1:-1,s=e?t.length:-1,a=r?n.length:-1,u=e?0:t.length-1,c=r?0:n.length-1;;){var l=t[u].compareTo(n[c]);if(0!==l)return l;var p=(u+=i)===s,h=(c+=o)===a;if(p&&!h)return-1;if(!p&&h)return 1;if(p&&h)return 0}};var Hn=function(){this._edges=new Nt,this._ocaMap=new p};Hn.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 r=n.getCoordinates(),i=0;i<r.length;i++)i>0&&t.print(","),t.print(r[i].x+" "+r[i].y);t.println(")")}t.print(")  ")},Hn.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Hn.prototype.findEdgeIndex=function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1},Hn.prototype.iterator=function(){return this._edges.iterator()},Hn.prototype.getEdges=function(){return this._edges},Hn.prototype.get=function(t){return this._edges.get(t)},Hn.prototype.findEqualEdge=function(t){var e=new Yn(t.getCoordinates());return this._ocaMap.get(e)},Hn.prototype.add=function(t){this._edges.add(t);var e=new Yn(t.getCoordinates());this._ocaMap.put(e,t)},Hn.prototype.interfaces_=function(){return[]},Hn.prototype.getClass=function(){return Hn};var Wn=function(){};Wn.prototype.processIntersections=function(t,e,n,r){},Wn.prototype.isDone=function(){},Wn.prototype.interfaces_=function(){return[]},Wn.prototype.getClass=function(){return Wn};var Kn=function(){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};Kn.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(Kn.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.size()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},Kn.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Kn.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Kn.prototype.getLineIntersector=function(){return this._li},Kn.prototype.hasProperIntersection=function(){return this._hasProper},Kn.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Kn.prototype.hasIntersection=function(){return this._hasIntersection},Kn.prototype.isDone=function(){return!1},Kn.prototype.hasInteriorIntersection=function(){return this._hasInterior},Kn.prototype.interfaces_=function(){return[Wn]},Kn.prototype.getClass=function(){return Kn},Kn.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var Jn=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new b(t),this.segmentIndex=e,this.dist=n};Jn.prototype.getSegmentIndex=function(){return this.segmentIndex},Jn.prototype.getCoordinate=function(){return this.coord},Jn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},Jn.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},Jn.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t},Jn.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Jn.prototype.getDistance=function(){return this.dist},Jn.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},Jn.prototype.interfaces_=function(){return[E]},Jn.prototype.getClass=function(){return Jn};var Qn=function(){this._nodeMap=new p,this.edge=null;var t=arguments[0];this.edge=t};Qn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},Qn.prototype.iterator=function(){return this._nodeMap.values().iterator()},Qn.prototype.addSplitEdges=function(t){this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},Qn.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},Qn.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this.edge.pts[e.segmentIndex],i=e.dist>0||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),s=0;o[s++]=new b(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this.edge.pts[a];return i&&(o[s]=e.coord),new nr(o,new Re(this.edge._label))},Qn.prototype.add=function(t,e,n){var r=new Jn(t,e,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)},Qn.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},Qn.prototype.interfaces_=function(){return[]},Qn.prototype.getClass=function(){return Qn};var Zn=function(){};Zn.prototype.getChainStartIndices=function(t){var e=0,n=new Nt;n.add(new D(e));do{var r=this.findChainEnd(t,e);n.add(new D(r)),e=r}while(e<t.length-1);return Zn.toIntArray(n)},Zn.prototype.findChainEnd=function(t,e){for(var n=qe.quadrant(t[e],t[e+1]),r=e+1;r<t.length&&qe.quadrant(t[r-1],t[r])===n;)r++;return r-1},Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn},Zn.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};var $n=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new Y,this.env2=new Y;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Zn;this.startIndex=e.getChainStartIndices(this.pts)};$n.prototype.getCoordinates=function(){return this.pts},$n.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n},$n.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e<n?e:n},$n.prototype.computeIntersectsForChain=function(){if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],r)}else if(6===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=arguments[4],c=arguments[5],l=this.pts[i],p=this.pts[o],h=s.pts[a],f=s.pts[u];if(o-i==1&&u-a==1)return c.addIntersections(this.e,i,s.e,a),null;if(this.env1.init(l,p),this.env2.init(h,f),!this.env1.intersects(this.env2))return null;var g=Math.trunc((i+o)/2),d=Math.trunc((a+u)/2);i<g&&(a<d&&this.computeIntersectsForChain(i,g,s,a,d,c),d<u&&this.computeIntersectsForChain(i,g,s,d,u,c)),g<o&&(a<d&&this.computeIntersectsForChain(g,o,s,a,d,c),d<u&&this.computeIntersectsForChain(g,o,s,d,u,c))}},$n.prototype.getStartIndexes=function(){return this.startIndex},$n.prototype.computeIntersects=function(t,e){for(var n=0;n<this.startIndex.length-1;n++)for(var r=0;r<t.startIndex.length-1;r++)this.computeIntersectsForChain(n,t,r,e)},$n.prototype.interfaces_=function(){return[]},$n.prototype.getClass=function(){return $n};var tr=function t(){this._depth=Array(2).fill().map((function(){return Array(3)}));for(var e=0;e<2;e++)for(var n=0;n<3;n++)this._depth[e][n]=t.NULL_VALUE},er={NULL_VALUE:{configurable:!0}};tr.prototype.getDepth=function(t,e){return this._depth[t][e]},tr.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},tr.prototype.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]!==tr.NULL_VALUE)return!1;return!0}if(1===arguments.length){var n=arguments[0];return this._depth[n][1]===tr.NULL_VALUE}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._depth[r][i]===tr.NULL_VALUE}},tr.prototype.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 r=0;this._depth[t][n]>e&&(r=1),this._depth[t][n]=r}}},tr.prototype.getDelta=function(t){return this._depth[t][Ce.RIGHT]-this._depth[t][Ce.LEFT]},tr.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?L.EXTERIOR:L.INTERIOR},tr.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},tr.prototype.add=function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var n=1;n<3;n++){var r=t.getLocation(e,n);r!==L.EXTERIOR&&r!==L.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=tr.depthAtLocation(r):this._depth[e][n]+=tr.depthAtLocation(r))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===L.INTERIOR&&this._depth[i][o]++}},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr},tr.depthAtLocation=function(t){return t===L.EXTERIOR?0:t===L.INTERIOR?1:tr.NULL_VALUE},er.NULL_VALUE.get=function(){return-1},Object.defineProperties(tr,er);var nr=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Qn(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new tr,this._depthDelta=0,1===arguments.length){var n=arguments[0];e.call(this,n,null)}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new e(t,Re.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(t){this._isIsolated=t},e.prototype.setName=function(t){this._name=t},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;if(this.pts.length!==n.pts.length)return!1;for(var r=!0,i=!0,o=this.pts.length,s=0;s<this.pts.length;s++)if(this.pts[s].equals2D(n.pts[s])||(r=!1),this.pts[s].equals2D(n.pts[--o])||(i=!1),!r&&!i)return!1;return!0},e.prototype.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]}},e.prototype.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)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.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("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new $n(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new Y;for(var t=0;t<this.pts.length;t++)this._env.expandToInclude(this.pts[t])}return this._env},e.prototype.addIntersection=function(t,e,n,r){var i=new b(t.getIntersection(r)),o=e,s=t.getEdgeDistance(n,r),a=o+1;if(a<this.pts.length){var u=this.pts[a];i.equals2D(u)&&(o=a,s=0)}this.eiList.add(i,o,s)},e.prototype.toString=function(){var t=new M;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()},e.prototype.isPointwiseEqual=function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;e<this.pts.length;e++)if(!this.pts[e].equals2D(t.pts[e]))return!1;return!0},e.prototype.setDepthDelta=function(t){this._depthDelta=t},e.prototype.getEdgeIntersectionList=function(){return this.eiList},e.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.updateIM=function(){if(2!==arguments.length)return t.prototype.updateIM.apply(this,arguments);var e=arguments[0],n=arguments[1];n.setAtLeastIfValid(e.getLocation(0,Ce.ON),e.getLocation(1,Ce.ON),1),e.isArea()&&(n.setAtLeastIfValid(e.getLocation(0,Ce.LEFT),e.getLocation(1,Ce.LEFT),2),n.setAtLeastIfValid(e.getLocation(0,Ce.RIGHT),e.getLocation(1,Ce.RIGHT),2))},e}(Fe),rr=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Hn,this._bufParams=t||null};rr.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},rr.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new Re(t.getLabel())).flip(),n.merge(r);var i=rr.depthDelta(r),o=e.getDepthDelta()+i;e.setDepthDelta(o)}else this._edgeList.add(t),t.setDepthDelta(rr.depthDelta(t.getLabel()))},rr.prototype.buildSubgraphs=function(t,e){for(var n=new Nt,r=t.iterator();r.hasNext();){var i=r.next(),o=i.getRightmostCoordinate(),s=new An(n).getDepth(o);i.computeDepth(s),i.findResultEdges(),n.add(i),e.add(i.getDirectedEdges(),i.getNodes())}},rr.prototype.createSubgraphs=function(t){for(var e=new Nt,n=t.getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isVisited()){var i=new Oe;i.create(r),e.add(i)}}return $e.sort(e,$e.reverseOrder()),e},rr.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},rr.prototype.getNoder=function(t){if(null!==this._workingNoder)return this._workingNoder;var e=new In,n=new it;return n.setPrecisionModel(t),e.setSegmentIntersector(new Kn(n)),e},rr.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;null===n&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var r=new Dn(n,this._bufParams),i=new qn(t,e,r).getCurves();if(i.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(i,n),this._graph=new ze(new Xn),this._graph.addEdges(this._edgeList.getEdges());var o=this.createSubgraphs(this._graph),s=new Xe(this._geomFact);this.buildSubgraphs(o,s);var a=s.getPolygons();return a.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(a)},rr.prototype.computeNodedEdges=function(t,e){var n=this.getNoder(e);n.computeNodes(t);for(var r=n.getNodedSubstrings().iterator();r.hasNext();){var i=r.next(),o=i.getCoordinates();if(2!==o.length||!o[0].equals2D(o[1])){var s=i.getData(),a=new nr(i.getCoordinates(),new Re(s));this.insertUniqueEdge(a)}}},rr.prototype.setNoder=function(t){this._workingNoder=t},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},rr.depthDelta=function(t){var e=t.getLocation(0,Ce.LEFT),n=t.getLocation(0,Ce.RIGHT);return e===L.INTERIOR&&n===L.EXTERIOR?1:e===L.EXTERIOR&&n===L.INTERIOR?-1:0},rr.convertSegStrings=function(t){for(var e=new _e,n=new Nt;t.hasNext();){var r=t.next(),i=e.createLineString(r.getCoordinates());n.add(i)}return e.buildGeometry(n)};var ir=function(){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];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(4===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=arguments[3];this._noder=n,this._scaleFactor=r,this._offsetX=i,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};ir.prototype.rescale=function(){if(O(arguments[0],xt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.rescale(e.getCoordinates())}else if(arguments[0]instanceof Array){for(var n=arguments[0],r=0;r<n.length;r++)n[r].x=n[r].x/this._scaleFactor+this._offsetX,n[r].y=n[r].y/this._scaleFactor+this._offsetY;2===n.length&&n[0].equals2D(n[1])&&z.out.println(n)}},ir.prototype.scale=function(){if(O(arguments[0],xt)){for(var t=arguments[0],e=new Nt,n=t.iterator();n.hasNext();){var r=n.next();e.add(new gn(this.scale(r.getCoordinates()),r.getData()))}return e}if(arguments[0]instanceof Array){for(var i=arguments[0],o=new Array(i.length).fill(null),s=0;s<i.length;s++)o[s]=new b(Math.round((i[s].x-this._offsetX)*this._scaleFactor),Math.round((i[s].y-this._offsetY)*this._scaleFactor),i[s].z);return wt.removeRepeatedPoints(o)}},ir.prototype.isIntegerPrecision=function(){return 1===this._scaleFactor},ir.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},ir.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},ir.prototype.interfaces_=function(){return[xn]},ir.prototype.getClass=function(){return ir};var or=function(){this._li=new it,this._segStrings=null;var t=arguments[0];this._segStrings=t},sr={fact:{configurable:!0}};or.prototype.checkEndPtVertexIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next().getCoordinates();this.checkEndPtVertexIntersections(e[0],this._segStrings),this.checkEndPtVertexIntersections(e[e.length-1],this._segStrings)}else if(2===arguments.length)for(var n=arguments[0],r=arguments[1].iterator();r.hasNext();)for(var i=r.next().getCoordinates(),o=1;o<i.length-1;o++)if(i[o].equals(n))throw new $("found endpt/interior pt intersection at index "+o+" :pt "+n)},or.prototype.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 r=n.next();this.checkInteriorIntersections(e,r)}else if(2===arguments.length)for(var i=arguments[0],o=arguments[1],s=i.getCoordinates(),a=o.getCoordinates(),u=0;u<s.length-1;u++)for(var c=0;c<a.length-1;c++)this.checkInteriorIntersections(i,u,o,c);else if(4===arguments.length){var l=arguments[0],p=arguments[1],h=arguments[2],f=arguments[3];if(l===h&&p===f)return null;var g=l.getCoordinates()[p],d=l.getCoordinates()[p+1],y=h.getCoordinates()[f],_=h.getCoordinates()[f+1];if(this._li.computeIntersection(g,d,y,_),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,g,d)||this.hasInteriorIntersection(this._li,y,_)))throw new $("found non-noded intersection at "+g+"-"+d+" and "+y+"-"+_)}},or.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},or.prototype.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].getCoordinates(),r=0;r<n.length-2;r++)this.checkCollapse(n[r],n[r+1],n[r+2])},or.prototype.hasInteriorIntersection=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++){var i=t.getIntersection(r);if(!i.equals(e)&&!i.equals(n))return!0}return!1},or.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new $("found non-noded collapse at "+or.fact.createLineString([t,e,n]))},or.prototype.interfaces_=function(){return[]},or.prototype.getClass=function(){return or},sr.fact.get=function(){return new _e},Object.defineProperties(or,sr);var ar=function(){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 m("Scale factor must be non-zero");1!==e&&(this._pt=new b(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new b,this._p1Scaled=new b),this.initCorners(this._pt)},ur={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};ar.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),o=Math.max(t.y,e.y),s=this._maxx<n||this._minx>r||this._maxy<i||this._miny>o;if(s)return!1;var a=this.intersectsToleranceSquare(t,e);return et.isTrue(!(s&&a),"Found bad envelope test"),a},ar.prototype.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 b(this._maxx,this._maxy),this._corner[1]=new b(this._minx,this._maxy),this._corner[2]=new b(this._minx,this._miny),this._corner[3]=new b(this._maxx,this._miny)},ar.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},ar.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},ar.prototype.getCoordinate=function(){return this._originalPt},ar.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},ar.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=ar.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Y(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},ar.prototype.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()))))},ar.prototype.intersectsToleranceSquare=function(t,e){var n=!1,r=!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()&&(r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper()||n&&r||t.equals(this._pt)||e.equals(this._pt)))))},ar.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return!!this.intersects(n,r)&&(t.addIntersection(this.getCoordinate(),e),!0)},ar.prototype.interfaces_=function(){return[]},ar.prototype.getClass=function(){return ar},ur.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(ar,ur);var cr=function(){this.tempEnv1=new Y,this.selectedSegment=new dn};cr.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr};var lr=function(){this._index=null;var t=arguments[0];this._index=t},pr={HotPixelSnapAction:{configurable:!0}};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],r=arguments[2],i=e.getSafeEnvelope(),o=new hr(e,n,r);return this._index.query(i,{interfaces_:function(){return[Ke]},visitItem:function(t){t.select(i,o)}}),o.isNodeAdded()}},lr.prototype.interfaces_=function(){return[]},lr.prototype.getClass=function(){return lr},pr.HotPixelSnapAction.get=function(){return hr},Object.defineProperties(lr,pr);var hr=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return t.prototype.select.apply(this,arguments);var e=arguments[0],n=arguments[1],r=e.getContext();if(null!==this._parentEdge&&r===this._parentEdge&&n===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(r,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(cr),fr=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new Nt};fr.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];if(this._li.computeIntersection(i,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,r,1)}},fr.prototype.isDone=function(){return!1},fr.prototype.getInteriorIntersections=function(){return this._interiorIntersections},fr.prototype.interfaces_=function(){return[Wn]},fr.prototype.getClass=function(){return fr};var gr=function(){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 it,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};gr.prototype.checkCorrectness=function(t){var e=gn.getNodedSubstrings(t),n=new or(e);try{n.checkValid()}catch(t){if(!(t instanceof U))throw t;t.printStackTrace()}},gr.prototype.getNodedSubstrings=function(){return gn.getNodedSubstrings(this._nodedSegStrings)},gr.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},gr.prototype.findInteriorIntersections=function(t,e){var n=new fr(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},gr.prototype.computeVertexSnaps=function(){if(O(arguments[0],xt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.computeVertexSnaps(e)}else if(arguments[0]instanceof gn)for(var n=arguments[0],r=n.getCoordinates(),i=0;i<r.length;i++){var o=new ar(r[i],this._scaleFactor,this._li);this._pointSnapper.snap(o,n,i)&&n.addIntersection(r[i],i)}},gr.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new In,this._pointSnapper=new lr(this._noder.getIndex()),this.snapRound(t,this._li)},gr.prototype.computeIntersectionSnaps=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=new ar(n,this._scaleFactor,this._li);this._pointSnapper.snap(r)}},gr.prototype.interfaces_=function(){return[xn]},gr.prototype.getClass=function(){return gr};var dr=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new bn,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}},yr={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};dr.prototype.bufferFixedPrecision=function(t){var e=new ir(new gr(new fe(1)),t.getScale()),n=new rr(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},dr.prototype.bufferReducedPrecision=function(){var t=this;if(0===arguments.length){for(var e=dr.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof Le))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=dr.precisionScaleFactor(this._argGeom,this._distance,n),i=new fe(r);this.bufferFixedPrecision(i)}},dr.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===fe.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},dr.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},dr.prototype.bufferOriginalPrecision=function(){try{var t=new rr(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof $))throw t;this._saveException=t}},dr.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},dr.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},dr.prototype.interfaces_=function(){return[]},dr.prototype.getClass=function(){return dr},dr.bufferOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return new dr(t).getResultGeometry(e)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof lt&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1],i=arguments[2],o=new dr(n);return o.setQuadrantSegments(i),o.getResultGeometry(r)}if(arguments[2]instanceof bn&&arguments[0]instanceof lt&&"number"==typeof arguments[1]){var s=arguments[0],a=arguments[1],u=arguments[2];return new dr(s,u).getResultGeometry(a)}}else if(4===arguments.length){var c=arguments[0],l=arguments[1],p=arguments[2],h=arguments[3],f=new dr(c);return f.setQuadrantSegments(p),f.setEndCapStyle(h),f.getResultGeometry(l)}},dr.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),i=T.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(e>0?e:0),o=n-Math.trunc(Math.log(i)/Math.log(10)+1);return Math.pow(10,o)},yr.CAP_ROUND.get=function(){return bn.CAP_ROUND},yr.CAP_BUTT.get=function(){return bn.CAP_FLAT},yr.CAP_FLAT.get=function(){return bn.CAP_FLAT},yr.CAP_SQUARE.get=function(){return bn.CAP_SQUARE},yr.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(dr,yr);var _r=function(){this._pt=[new b,new b],this._distance=v.NaN,this._isNull=!0};_r.prototype.getCoordinates=function(){return this._pt},_r.prototype.getCoordinate=function(t){return this._pt[t]},_r.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},_r.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},_r.prototype.getDistance=function(){return this._distance},_r.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r};var mr=function(){};mr.prototype.interfaces_=function(){return[]},mr.prototype.getClass=function(){return mr},mr.computeDistance=function(){if(arguments[2]instanceof _r&&arguments[0]instanceof Kt&&arguments[1]instanceof b)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=t.getCoordinates(),i=new dn,o=0;o<r.length-1;o++){i.setCoordinates(r[o],r[o+1]);var s=i.closestPoint(e);n.setMinimum(s,e)}else if(arguments[2]instanceof _r&&arguments[0]instanceof $t&&arguments[1]instanceof b){var a=arguments[0],u=arguments[1],c=arguments[2];mr.computeDistance(a.getExteriorRing(),u,c);for(var l=0;l<a.getNumInteriorRing();l++)mr.computeDistance(a.getInteriorRingN(l),u,c)}else if(arguments[2]instanceof _r&&arguments[0]instanceof lt&&arguments[1]instanceof b){var p=arguments[0],h=arguments[1],f=arguments[2];if(p instanceof Kt)mr.computeDistance(p,h,f);else if(p instanceof $t)mr.computeDistance(p,h,f);else if(p instanceof Ut)for(var g=p,d=0;d<g.getNumGeometries();d++){var y=g.getGeometryN(d);mr.computeDistance(y,h,f)}else f.setMinimum(p.getCoordinate(),h)}else if(arguments[2]instanceof _r&&arguments[0]instanceof dn&&arguments[1]instanceof b){var _=arguments[0],m=arguments[1],v=arguments[2],x=_.closestPoint(m);v.setMinimum(x,m)}};var vr=function(t){this._maxPtDist=new _r,this._inputGeom=t||null},xr={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};vr.prototype.computeMaxMidpointDistance=function(t){var e=new Ir(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},vr.prototype.computeMaxVertexDistance=function(t){var e=new Er(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},vr.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},vr.prototype.getDistancePoints=function(){return this._maxPtDist},vr.prototype.interfaces_=function(){return[]},vr.prototype.getClass=function(){return vr},xr.MaxPointDistanceFilter.get=function(){return Er},xr.MaxMidpointDistanceFilter.get=function(){return Ir},Object.defineProperties(vr,xr);var Er=function(t){this._maxPtDist=new _r,this._minPtDist=new _r,this._geom=t||null};Er.prototype.filter=function(t){this._minPtDist.initialize(),mr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Er.prototype.getMaxPointDistance=function(){return this._maxPtDist},Er.prototype.interfaces_=function(){return[ft]},Er.prototype.getClass=function(){return Er};var Ir=function(t){this._maxPtDist=new _r,this._minPtDist=new _r,this._geom=t||null};Ir.prototype.filter=function(t,e){if(0===e)return null;var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=new b((n.x+r.x)/2,(n.y+r.y)/2);this._minPtDist.initialize(),mr.computeDistance(this._geom,i,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ir.prototype.isDone=function(){return!1},Ir.prototype.isGeometryChanged=function(){return!1},Ir.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ir.prototype.interfaces_=function(){return[Vt]},Ir.prototype.getClass=function(){return Ir};var Nr=function(t){this._comps=t||null};Nr.prototype.filter=function(t){t instanceof $t&&this._comps.add(t)},Nr.prototype.interfaces_=function(){return[kt]},Nr.prototype.getClass=function(){return Nr},Nr.getPolygons=function(){if(1===arguments.length){var t=arguments[0];return Nr.getPolygons(t,new Nt)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof $t?n.add(e):e instanceof Ut&&e.apply(new Nr(n)),n}};var br=function(){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}};br.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof ee){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof Kt&&this._lines.add(t)},br.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},br.prototype.interfaces_=function(){return[ct]},br.prototype.getClass=function(){return br},br.getGeometry=function(){if(1===arguments.length){var t=arguments[0];return t.getFactory().buildGeometry(br.getLines(t))}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(br.getLines(e,n))}},br.getLines=function(){if(1===arguments.length){var t=arguments[0];return br.getLines(t,!1)}if(2===arguments.length){if(O(arguments[0],xt)&&O(arguments[1],xt)){for(var e=arguments[0],n=arguments[1],r=e.iterator();r.hasNext();){var i=r.next();br.getLines(i,n)}return n}if(arguments[0]instanceof lt&&"boolean"==typeof arguments[1]){var o=arguments[0],s=arguments[1],a=new Nt;return o.apply(new br(a,s)),a}if(arguments[0]instanceof lt&&O(arguments[1],xt)){var u=arguments[0],c=arguments[1];return u instanceof Kt?c.add(u):u.apply(new br(c)),c}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&O(arguments[0],xt)&&O(arguments[1],xt)){for(var l=arguments[0],p=arguments[1],h=arguments[2],f=l.iterator();f.hasNext();){var g=f.next();br.getLines(g,p,h)}return p}if("boolean"==typeof arguments[2]&&arguments[0]instanceof lt&&O(arguments[1],xt)){var d=arguments[0],y=arguments[1],_=arguments[2];return d.apply(new br(y,_)),y}}};var Cr=function(){if(this._boundaryRule=gt.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 m("Rule must be non-null");this._boundaryRule=t}};Cr.prototype.locateInternal=function(){if(arguments[0]instanceof b&&arguments[1]instanceof $t){var t=arguments[0],e=arguments[1];if(e.isEmpty())return L.EXTERIOR;var n=e.getExteriorRing(),r=this.locateInPolygonRing(t,n);if(r===L.EXTERIOR)return L.EXTERIOR;if(r===L.BOUNDARY)return L.BOUNDARY;for(var i=0;i<e.getNumInteriorRing();i++){var o=e.getInteriorRingN(i),s=this.locateInPolygonRing(t,o);if(s===L.INTERIOR)return L.EXTERIOR;if(s===L.BOUNDARY)return L.BOUNDARY}return L.INTERIOR}if(arguments[0]instanceof b&&arguments[1]instanceof Kt){var a=arguments[0],u=arguments[1];if(!u.getEnvelopeInternal().intersects(a))return L.EXTERIOR;var c=u.getCoordinates();return u.isClosed()||!a.equals(c[0])&&!a.equals(c[c.length-1])?at.isOnLine(a,c)?L.INTERIOR:L.EXTERIOR:L.BOUNDARY}if(arguments[0]instanceof b&&arguments[1]instanceof Qt){var l=arguments[0];return arguments[1].getCoordinate().equals2D(l)?L.INTERIOR:L.EXTERIOR}},Cr.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?at.locatePointInRing(t,e.getCoordinates()):L.EXTERIOR},Cr.prototype.intersects=function(t,e){return this.locate(t,e)!==L.EXTERIOR},Cr.prototype.updateLocationInfo=function(t){t===L.INTERIOR&&(this._isIn=!0),t===L.BOUNDARY&&this._numBoundaries++},Cr.prototype.computeLocation=function(t,e){if(e instanceof Qt&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Kt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof $t)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof jt)for(var n=e,r=0;r<n.getNumGeometries();r++){var i=n.getGeometryN(r);this.updateLocationInfo(this.locateInternal(t,i))}else if(e instanceof ne)for(var o=e,s=0;s<o.getNumGeometries();s++){var a=o.getGeometryN(s);this.updateLocationInfo(this.locateInternal(t,a))}else if(e instanceof Ut)for(var u=new Vn(e);u.hasNext();){var c=u.next();c!==e&&this.computeLocation(t,c)}},Cr.prototype.locate=function(t,e){return e.isEmpty()?L.EXTERIOR:e instanceof Kt||e instanceof $t?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?L.BOUNDARY:this._numBoundaries>0||this._isIn?L.INTERIOR:L.EXTERIOR)},Cr.prototype.interfaces_=function(){return[]},Cr.prototype.getClass=function(){return Cr};var wr=function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length){var e=arguments[0],n=arguments[1];t.call(this,e,t.INSIDE_AREA,n)}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._component=r,this._segIndex=i,this._pt=o}},Sr={INSIDE_AREA:{configurable:!0}};wr.prototype.isInsideArea=function(){return this._segIndex===wr.INSIDE_AREA},wr.prototype.getCoordinate=function(){return this._pt},wr.prototype.getGeometryComponent=function(){return this._component},wr.prototype.getSegmentIndex=function(){return this._segIndex},wr.prototype.interfaces_=function(){return[]},wr.prototype.getClass=function(){return wr},Sr.INSIDE_AREA.get=function(){return-1},Object.defineProperties(wr,Sr);var Lr=function(t){this._pts=t||null};Lr.prototype.filter=function(t){t instanceof Qt&&this._pts.add(t)},Lr.prototype.interfaces_=function(){return[kt]},Lr.prototype.getClass=function(){return Lr},Lr.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Qt?$e.singletonList(t):Lr.getPoints(t,new Nt)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Qt?n.add(e):e instanceof Ut&&e.apply(new Lr(n)),n}};var Pr=function(){this._locations=null;var t=arguments[0];this._locations=t};Pr.prototype.filter=function(t){(t instanceof Qt||t instanceof Kt||t instanceof $t)&&this._locations.add(new wr(t,0,t.getCoordinate()))},Pr.prototype.interfaces_=function(){return[kt]},Pr.prototype.getClass=function(){return Pr},Pr.getLocations=function(t){var e=new Nt;return t.apply(new Pr(e)),e};var Or=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Cr,this._minDistanceLocation=null,this._minDistance=v.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=i}};Or.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],r=1-e,i=Nr.getPolygons(this._geom[e]);if(i.size()>0){var o=Pr.getLocations(this._geom[r]);if(this.computeContainmentDistance(o,i,n),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[r]=n[0],this._minDistanceLocation[e]=n[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&O(arguments[0],It)&&O(arguments[1],It)){for(var s=arguments[0],a=arguments[1],u=arguments[2],c=0;c<s.size();c++)for(var l=s.get(c),p=0;p<a.size();p++)if(this.computeContainmentDistance(l,a.get(p),u),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof wr&&arguments[1]instanceof $t){var h=arguments[0],f=arguments[1],g=arguments[2],d=h.getCoordinate();if(L.EXTERIOR!==this._ptLocator.locate(d,f))return this._minDistance=0,g[0]=h,g[1]=new wr(f,d),null}},Or.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(i,s,n),this._minDistance<=this._terminateDistance)return null}},Or.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=br.getLines(this._geom[0]),n=br.getLines(this._geom[1]),r=Lr.getPoints(this._geom[0]),i=Lr.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,i,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,r,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistancePoints(r,i,t),void this.updateMinDistance(t,!1))))},Or.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Or.prototype.updateMinDistance=function(t,e){if(null===t[0])return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},Or.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},Or.prototype.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 Kt&&arguments[1]instanceof Qt){var t=arguments[0],e=arguments[1],n=arguments[2];if(t.getEnvelopeInternal().distance(e.getEnvelopeInternal())>this._minDistance)return null;for(var r=t.getCoordinates(),i=e.getCoordinate(),o=0;o<r.length-1;o++){var s=at.distancePointLine(i,r[o],r[o+1]);if(s<this._minDistance){this._minDistance=s;var a=new dn(r[o],r[o+1]).closestPoint(i);n[0]=new wr(t,o,a),n[1]=new wr(e,0,i)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Kt&&arguments[1]instanceof Kt){var u=arguments[0],c=arguments[1],l=arguments[2];if(u.getEnvelopeInternal().distance(c.getEnvelopeInternal())>this._minDistance)return null;for(var p=u.getCoordinates(),h=c.getCoordinates(),f=0;f<p.length-1;f++)for(var g=0;g<h.length-1;g++){var d=at.distanceLineLine(p[f],p[f+1],h[g],h[g+1]);if(d<this._minDistance){this._minDistance=d;var y=new dn(p[f],p[f+1]),_=new dn(h[g],h[g+1]),m=y.closestPoints(_);l[0]=new wr(u,f,m[0]),l[1]=new wr(c,g,m[1])}if(this._minDistance<=this._terminateDistance)return null}}},Or.prototype.computeMinDistancePoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o),a=i.getCoordinate().distance(s.getCoordinate());if(a<this._minDistance&&(this._minDistance=a,n[0]=new wr(i,0,i.getCoordinate()),n[1]=new wr(s,0,s.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},Or.prototype.distance=function(){if(null===this._geom[0]||null===this._geom[1])throw new m("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Or.prototype.computeMinDistanceLines=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(i,s,n),this._minDistance<=this._terminateDistance)return null}},Or.prototype.interfaces_=function(){return[]},Or.prototype.getClass=function(){return Or},Or.distance=function(t,e){return new Or(t,e).distance()},Or.isWithinDistance=function(t,e,n){return new Or(t,e,n).distance()<=n},Or.nearestPoints=function(t,e){return new Or(t,e).nearestPoints()};var Tr=function(){this._pt=[new b,new b],this._distance=v.NaN,this._isNull=!0};Tr.prototype.getCoordinates=function(){return this._pt},Tr.prototype.getCoordinate=function(t){return this._pt[t]},Tr.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},Tr.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},Tr.prototype.toString=function(){return Z.toLineString(this._pt[0],this._pt[1])},Tr.prototype.getDistance=function(){return this._distance},Tr.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr};var Rr=function(){};Rr.prototype.interfaces_=function(){return[]},Rr.prototype.getClass=function(){return Rr},Rr.computeDistance=function(){if(arguments[2]instanceof Tr&&arguments[0]instanceof Kt&&arguments[1]instanceof b)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new dn,i=t.getCoordinates(),o=0;o<i.length-1;o++){r.setCoordinates(i[o],i[o+1]);var s=r.closestPoint(e);n.setMinimum(s,e)}else if(arguments[2]instanceof Tr&&arguments[0]instanceof $t&&arguments[1]instanceof b){var a=arguments[0],u=arguments[1],c=arguments[2];Rr.computeDistance(a.getExteriorRing(),u,c);for(var l=0;l<a.getNumInteriorRing();l++)Rr.computeDistance(a.getInteriorRingN(l),u,c)}else if(arguments[2]instanceof Tr&&arguments[0]instanceof lt&&arguments[1]instanceof b){var p=arguments[0],h=arguments[1],f=arguments[2];if(p instanceof Kt)Rr.computeDistance(p,h,f);else if(p instanceof $t)Rr.computeDistance(p,h,f);else if(p instanceof Ut)for(var g=p,d=0;d<g.getNumGeometries();d++){var y=g.getGeometryN(d);Rr.computeDistance(y,h,f)}else f.setMinimum(p.getCoordinate(),h)}else if(arguments[2]instanceof Tr&&arguments[0]instanceof dn&&arguments[1]instanceof b){var _=arguments[0],m=arguments[1],v=arguments[2],x=_.closestPoint(m);v.setMinimum(x,m)}};var Mr=function(){this._g0=null,this._g1=null,this._ptDist=new Tr,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},Dr={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Mr.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Mr.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new m("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Mr.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Mr.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Mr.prototype.computeOrientedDistance=function(t,e,n){var r=new Ar(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var i=new Fr(e,this._densifyFrac);t.apply(i),n.setMaximum(i.getMaxPointDistance())}},Mr.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Mr.prototype.interfaces_=function(){return[]},Mr.prototype.getClass=function(){return Mr},Mr.distance=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return new Mr(t,e).distance()}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=new Mr(n,r);return o.setDensifyFraction(i),o.distance()}},Dr.MaxPointDistanceFilter.get=function(){return Ar},Dr.MaxDensifiedByFractionDistanceFilter.get=function(){return Fr},Object.defineProperties(Mr,Dr);var Ar=function(){this._maxPtDist=new Tr,this._minPtDist=new Tr,this._euclideanDist=new Rr,this._geom=null;var t=arguments[0];this._geom=t};Ar.prototype.filter=function(t){this._minPtDist.initialize(),Rr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ar.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ar.prototype.interfaces_=function(){return[ft]},Ar.prototype.getClass=function(){return Ar};var Fr=function(){this._maxPtDist=new Tr,this._minPtDist=new Tr,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};Fr.prototype.filter=function(t,e){if(0===e)return null;for(var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=(r.x-n.x)/this._numSubSegs,o=(r.y-n.y)/this._numSubSegs,s=0;s<this._numSubSegs;s++){var a=n.x+s*i,u=n.y+s*o,c=new b(a,u);this._minPtDist.initialize(),Rr.computeDistance(this._geom,c,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},Fr.prototype.isDone=function(){return!1},Fr.prototype.isGeometryChanged=function(){return!1},Fr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Fr.prototype.interfaces_=function(){return[Vt]},Fr.prototype.getClass=function(){return Fr};var Gr=function(t,e,n){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=n||null},Br={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Gr.prototype.checkMaximumDistance=function(t,e,n){var r=new Mr(e,t);if(r.setDensifyFraction(.25),this._maxDistanceFound=r.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var i=r.getCoordinates();this._errorLocation=i[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Z.toLineString(i[0],i[1])+")"}},Gr.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Gr.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Gr.VERBOSE&&z.out.println("Min Dist= "+this._minDistanceFound+"  err= "+(1-this._minDistanceFound/this._bufDistance)+"  Max Dist= "+this._maxDistanceFound+"  err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Gr.prototype.checkNegativeValid=function(){if(!(this._input instanceof $t||this._input instanceof ne||this._input instanceof Ut))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},Gr.prototype.getErrorIndicator=function(){return this._errorIndicator},Gr.prototype.checkMinimumDistance=function(t,e,n){var r=new Or(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound<n){this._isValid=!1;var i=r.nearestPoints();this._errorLocation=r.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+Z.toLineString(i[0],i[1])+" )"}},Gr.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)},Gr.prototype.getErrorLocation=function(){return this._errorLocation},Gr.prototype.getPolygonLines=function(t){for(var e=new Nt,n=new br(e),r=Nr.getPolygons(t).iterator();r.hasNext();)r.next().apply(n);return t.getFactory().buildGeometry(e)},Gr.prototype.getErrorMessage=function(){return this._errMsg},Gr.prototype.interfaces_=function(){return[]},Gr.prototype.getClass=function(){return Gr},Br.VERBOSE.get=function(){return!1},Br.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Gr,Br);var qr=function(t,e,n){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=n||null},kr={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};qr.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},qr.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*qr.MAX_ENV_DIFF_FRAC;0===t&&(t=.001);var e=new Y(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new Y(this._result.getEnvelopeInternal());n.expandBy(t),n.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(n)),this.report("Envelope")},qr.prototype.checkDistance=function(){var t=new Gr(this._input,this._distance,this._result);t.isValid()||(this._isValid=!1,this._errorMsg=t.getErrorMessage(),this._errorLocation=t.getErrorLocation(),this._errorIndicator=t.getErrorIndicator()),this.report("Distance")},qr.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},qr.prototype.checkPolygonal=function(){this._result instanceof $t||this._result instanceof ne||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},qr.prototype.getErrorIndicator=function(){return this._errorIndicator},qr.prototype.getErrorLocation=function(){return this._errorLocation},qr.prototype.checkExpectedEmpty=function(){return this._input.getDimension()>=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},qr.prototype.report=function(t){if(!qr.VERBOSE)return null;z.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},qr.prototype.getErrorMessage=function(){return this._errorMsg},qr.prototype.interfaces_=function(){return[]},qr.prototype.getClass=function(){return qr},qr.isValidMsg=function(t,e,n){var r=new qr(t,e,n);return r.isValid()?null:r.getErrorMessage()},qr.isValid=function(t,e,n){return!!new qr(t,e,n).isValid()},kr.VERBOSE.get=function(){return!1},kr.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(qr,kr);var Vr=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Vr.prototype.getCoordinates=function(){return this._pts},Vr.prototype.size=function(){return this._pts.length},Vr.prototype.getCoordinate=function(t){return this._pts[t]},Vr.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Vr.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:pn.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Vr.prototype.setData=function(t){this._data=t},Vr.prototype.getData=function(){return this._data},Vr.prototype.toString=function(){return Z.toLineString(new ue(this._pts))},Vr.prototype.interfaces_=function(){return[hn]},Vr.prototype.getClass=function(){return Vr};var Ur=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new Nt,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};Ur.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Ur.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},Ur.prototype.getIntersectionSegments=function(){return this._intSegments},Ur.prototype.count=function(){return this._intersectionCount},Ur.prototype.getIntersections=function(){return this._intersections},Ur.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Ur.prototype.setKeepIntersections=function(t){this._keepIntersections=t},Ur.prototype.processIntersections=function(t,e,n,r){if(!this._findAllIntersections&&this.hasIntersection())return null;if(t===n&&e===r)return null;if(this._isCheckEndSegmentsOnly&&!this.isEndSegment(t,e)&&!this.isEndSegment(n,r))return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=i,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++)},Ur.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},Ur.prototype.hasIntersection=function(){return null!==this._interiorIntersection},Ur.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},Ur.prototype.interfaces_=function(){return[Wn]},Ur.prototype.getClass=function(){return Ur},Ur.createAllIntersectionsFinder=function(t){var e=new Ur(t);return e.setFindAllIntersections(!0),e},Ur.createAnyIntersectionFinder=function(t){return new Ur(t)},Ur.createIntersectionCounter=function(t){var e=new Ur(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var jr=function(){this._li=new it,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};jr.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},jr.prototype.getIntersections=function(){return this._segInt.getIntersections()},jr.prototype.isValid=function(){return this.execute(),this._isValid},jr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},jr.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Ur(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new In;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},jr.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Le(this.getErrorMessage(),this._segInt.getInteriorIntersection())},jr.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Z.toLineString(t[0],t[1])+" and "+Z.toLineString(t[2],t[3])},jr.prototype.interfaces_=function(){return[]},jr.prototype.getClass=function(){return jr},jr.computeIntersections=function(t){var e=new jr(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var zr=function t(){this._nv=null;var e=arguments[0];this._nv=new jr(t.toSegmentStrings(e))};zr.prototype.checkValid=function(){this._nv.checkValid()},zr.prototype.interfaces_=function(){return[]},zr.prototype.getClass=function(){return zr},zr.toSegmentStrings=function(t){for(var e=new Nt,n=t.iterator();n.hasNext();){var r=n.next();e.add(new Vr(r.getCoordinates(),r))}return e},zr.checkValid=function(t){new zr(t).checkValid()};var Xr=function(t){this._mapOp=t};Xr.prototype.map=function(t){for(var e=new Nt,n=0;n<t.getNumGeometries();n++){var r=this._mapOp.map(t.getGeometryN(n));r.isEmpty()||e.add(r)}return t.getFactory().createGeometryCollection(_e.toGeometryArray(e))},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr},Xr.map=function(t,e){return new Xr(e).map(t)};var Yr=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new Nt,this._resultLineList=new Nt;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};Yr.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)}},Yr.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},Yr.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},Yr.prototype.collectLineEdge=function(t,e,n){var r=t.getLabel(),i=t.getEdge();t.isLineEdge()&&(t.isVisited()||!wi.isResultOfOp(r,e)||i.isCovered()||(n.add(i),t.setVisitedEdge(!0)))},Yr.prototype.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(),r=n.getEdge();if(n.isLineEdge()&&!r.isCoveredSet()){var i=this._op.isCoveredByA(n.getCoordinate());r.setCovered(i)}}},Yr.prototype.labelIsolatedLines=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=n.getLabel();n.isIsolated()&&(r.isNull(0)?this.labelIsolatedLine(n,0):this.labelIsolatedLine(n,1))}},Yr.prototype.buildLines=function(t){for(var e=this._lineEdgesList.iterator();e.hasNext();){var n=e.next(),r=this._geometryFactory.createLineString(n.getCoordinates());this._resultLineList.add(r),n.setInResult(!0)}},Yr.prototype.collectBoundaryTouchEdge=function(t,e,n){var r=t.getLabel();return t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult()?null:(et.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(wi.isResultOfOp(r,e)&&e===wi.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr};var Hr=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new Nt;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};Hr.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},Hr.prototype.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!==wi.INTERSECTION)){var r=n.getLabel();wi.isResultOfOp(r,t)&&this.filterCoveredNodeToPoint(n)}}},Hr.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr};var Wr=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Wr.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Wr.prototype.transformPolygon=function(t,e){var n=!0,r=this.transformLinearRing(t.getExteriorRing(),t);null!==r&&r instanceof ee&&!r.isEmpty()||(n=!1);for(var i=new Nt,o=0;o<t.getNumInteriorRing();o++){var s=this.transformLinearRing(t.getInteriorRingN(o),t);null===s||s.isEmpty()||(s instanceof ee||(n=!1),i.add(s))}if(n)return this._factory.createPolygon(r,i.toArray([]));var a=new Nt;return null!==r&&a.add(r),a.addAll(i),this._factory.buildGeometry(a)},Wr.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Wr.prototype.getInputGeometry=function(){return this._inputGeom},Wr.prototype.transformMultiLineString=function(t,e){for(var n=new Nt,r=0;r<t.getNumGeometries();r++){var i=this.transformLineString(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Wr.prototype.transformCoordinates=function(t,e){return this.copy(t)},Wr.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Wr.prototype.transformMultiPoint=function(t,e){for(var n=new Nt,r=0;r<t.getNumGeometries();r++){var i=this.transformPoint(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Wr.prototype.transformMultiPolygon=function(t,e){for(var n=new Nt,r=0;r<t.getNumGeometries();r++){var i=this.transformPolygon(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Wr.prototype.copy=function(t){return t.copy()},Wr.prototype.transformGeometryCollection=function(t,e){for(var n=new Nt,r=0;r<t.getNumGeometries();r++){var i=this.transform(t.getGeometryN(r));null!==i&&(this._pruneEmptyGeometry&&i.isEmpty()||n.add(i))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(_e.toGeometryArray(n)):this._factory.buildGeometry(n)},Wr.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof Qt)return this.transformPoint(t,null);if(t instanceof te)return this.transformMultiPoint(t,null);if(t instanceof ee)return this.transformLinearRing(t,null);if(t instanceof Kt)return this.transformLineString(t,null);if(t instanceof jt)return this.transformMultiLineString(t,null);if(t instanceof $t)return this.transformPolygon(t,null);if(t instanceof ne)return this.transformMultiPolygon(t,null);if(t instanceof Ut)return this.transformGeometryCollection(t,null);throw new m("Unknown Geometry subtype: "+t.getClass().getName())},Wr.prototype.transformLinearRing=function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(null===n)return this._factory.createLinearRing(null);var r=n.size();return r>0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr};var Kr=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new dn,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Kt&&"number"==typeof arguments[1]){var e=arguments[0],n=arguments[1];t.call(this,e.getCoordinates(),n)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=t.isClosed(r),this._snapTolerance=i}};Kr.prototype.snapVertices=function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),r=0;r<n;r++){var i=t.get(r),o=this.findSnapForVertex(i,e);null!==o&&(t.set(r,new b(o)),0===r&&this._isClosed&&t.set(t.size()-1,new b(o)))}},Kr.prototype.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},Kr.prototype.snapTo=function(t){var e=new Ct(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},Kr.prototype.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 r=0;r<n;r++){var i=e[r],o=this.findSegmentIndexToSnap(i,t);o>=0&&t.add(o+1,new b(i),!1)}},Kr.prototype.findSegmentIndexToSnap=function(t,e){for(var n=v.MAX_VALUE,r=-1,i=0;i<e.size()-1;i++){if(this._seg.p0=e.get(i),this._seg.p1=e.get(i+1),this._seg.p0.equals2D(t)||this._seg.p1.equals2D(t)){if(this._allowSnappingToSourceVertices)continue;return-1}var o=this._seg.distance(t);o<this._snapTolerance&&o<n&&(n=o,r=i)}return r},Kr.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Kr.prototype.interfaces_=function(){return[]},Kr.prototype.getClass=function(){return Kr},Kr.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])};var Jr=function(t){this._srcGeom=t||null},Qr={SNAP_PRECISION_FACTOR:{configurable:!0}};Jr.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t);return new Zr(e,n).transform(this._srcGeom)},Jr.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),r=new Zr(t,n,!0).transform(this._srcGeom),i=r;return e&&O(i,Zt)&&(i=r.buffer(0)),i},Jr.prototype.computeSnapTolerance=function(t){return this.computeMinimumSegmentLength(t)/10},Jr.prototype.extractTargetCoordinates=function(t){for(var e=new f,n=t.getCoordinates(),r=0;r<n.length;r++)e.add(n[r]);return e.toArray(new Array(0).fill(null))},Jr.prototype.computeMinimumSegmentLength=function(t){for(var e=v.MAX_VALUE,n=0;n<t.length-1;n++){var r=t[n].distance(t[n+1]);r<e&&(e=r)}return e},Jr.prototype.interfaces_=function(){return[]},Jr.prototype.getClass=function(){return Jr},Jr.snap=function(t,e,n){var r=new Array(2).fill(null),i=new Jr(t);r[0]=i.snapTo(e,n);var o=new Jr(e);return r[1]=o.snapTo(r[0],n),r},Jr.computeOverlaySnapTolerance=function(){if(1===arguments.length){var t=arguments[0],e=Jr.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===fe.FIXED){var r=1/n.getScale()*2/1.415;r>e&&(e=r)}return e}if(2===arguments.length){var i=arguments[0],o=arguments[1];return Math.min(Jr.computeOverlaySnapTolerance(i),Jr.computeOverlaySnapTolerance(o))}},Jr.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Jr.SNAP_PRECISION_FACTOR},Jr.snapToSelf=function(t,e,n){return new Jr(t).snapToSelf(e,n)},Qr.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Jr,Qr);var Zr=function(t){function e(e,n,r){t.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=void 0!==r&&r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var n=new Kr(t,this._snapTolerance);return n.setAllowSnappingToSourceVertices(this._isSelfSnap),n.snapTo(e)},e.prototype.transformCoordinates=function(t,e){var n=t.toCoordinateArray(),r=this.snapLine(n,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Wr),$r=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};$r.prototype.getCommon=function(){return v.longBitsToDouble(this._commonBits)},$r.prototype.add=function(t){var e=v.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=$r.signExpBits(this._commonBits),this._isFirst=!1,null):$r.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=$r.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=$r.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},$r.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=v.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+v.toBinaryString(t),r=n.substring(n.length-64);return r.substring(0,1)+"  "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+e+" ]"}},$r.prototype.interfaces_=function(){return[]},$r.prototype.getClass=function(){return $r},$r.getBit=function(t,e){return 0!=(t&1<<e)?1:0},$r.signExpBits=function(t){return t>>52},$r.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},$r.numCommonMostSigMantissaBits=function(t,e){for(var n=0,r=52;r>=0;r--){if($r.getBit(t,r)!==$r.getBit(e,r))return n;n++}return 52};var ti=function(){this._commonCoord=null,this._ccFilter=new ni},ei={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};ti.prototype.addCommonBits=function(t){var e=new ri(this._commonCoord);t.apply(e),t.geometryChanged()},ti.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new b(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new ri(e);return t.apply(n),t.geometryChanged(),t},ti.prototype.getCommonCoordinate=function(){return this._commonCoord},ti.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},ei.CommonCoordinateFilter.get=function(){return ni},ei.Translater.get=function(){return ri},Object.defineProperties(ti,ei);var ni=function(){this._commonBitsX=new $r,this._commonBitsY=new $r};ni.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},ni.prototype.getCommonCoordinate=function(){return new b(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},ni.prototype.interfaces_=function(){return[ft]},ni.prototype.getClass=function(){return ni};var ri=function(){this.trans=null;var t=arguments[0];this.trans=t};ri.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,r=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,r)},ri.prototype.isDone=function(){return!1},ri.prototype.isGeometryChanged=function(){return!0},ri.prototype.interfaces_=function(){return[Vt]},ri.prototype.getClass=function(){return ri};var ii=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};ii.prototype.selfSnap=function(t){return new Jr(t).snapTo(t,this._snapTolerance)},ii.prototype.removeCommonBits=function(t){this._cbr=new ti,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},ii.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},ii.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=wi.overlayOp(e[0],e[1],t);return this.prepareResult(n)},ii.prototype.checkValid=function(t){t.isValid()||z.out.println("Snapped geometry is invalid")},ii.prototype.computeSnapTolerance=function(){this._snapTolerance=Jr.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},ii.prototype.snap=function(t){var e=this.removeCommonBits(t);return Jr.snap(e[0],e[1],this._snapTolerance)},ii.prototype.interfaces_=function(){return[]},ii.prototype.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,wi.UNION)},ii.intersection=function(t,e){return ii.overlayOp(t,e,wi.INTERSECTION)},ii.symDifference=function(t,e){return ii.overlayOp(t,e,wi.SYMDIFFERENCE)},ii.difference=function(t,e){return ii.overlayOp(t,e,wi.DIFFERENCE)};var oi=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};oi.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=wi.overlayOp(this._geom[0],this._geom[1],t),n=!0}catch(t){if(!(t instanceof $))throw t;r=t}if(!n)try{e=ii.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof $?r:t}return e},oi.prototype.interfaces_=function(){return[]},oi.prototype.getClass=function(){return oi},oi.overlayOp=function(t,e,n){return new oi(t,e).getResultGeometry(n)},oi.union=function(t,e){return oi.overlayOp(t,e,wi.UNION)},oi.intersection=function(t,e){return oi.overlayOp(t,e,wi.INTERSECTION)},oi.symDifference=function(t,e){return oi.overlayOp(t,e,wi.SYMDIFFERENCE)},oi.difference=function(t,e){return oi.overlayOp(t,e,wi.DIFFERENCE)};var si=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};si.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},si.prototype.interfaces_=function(){return[]},si.prototype.getClass=function(){return si};var ai=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var e=arguments[0],n=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=n}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=r,this._xValue=i,this._obj=o}},ui={INSERT:{configurable:!0},DELETE:{configurable:!0}};ai.prototype.isDelete=function(){return this._eventType===ai.DELETE},ai.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},ai.prototype.getObject=function(){return this._obj},ai.prototype.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},ai.prototype.getInsertEvent=function(){return this._insertEvent},ai.prototype.isInsert=function(){return this._eventType===ai.INSERT},ai.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},ai.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},ai.prototype.interfaces_=function(){return[E]},ai.prototype.getClass=function(){return ai},ui.INSERT.get=function(){return 1},ui.DELETE.get=function(){return 2},Object.defineProperties(ai,ui);var ci=function(){};ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci};var li=function(){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};li.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(li.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},li.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},li.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},li.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},li.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next().getCoordinate();if(t.isIntersection(r))return!0}return!1},li.prototype.hasProperIntersection=function(){return this._hasProper},li.prototype.hasIntersection=function(){return this._hasIntersection},li.prototype.isDone=function(){return this._isDone},li.prototype.isBoundaryPoint=function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},li.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},li.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,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))))},li.prototype.interfaces_=function(){return[]},li.prototype.getClass=function(){return li},li.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var pi=function(t){function e(){t.call(this),this.events=new Nt,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){$e.sort(this.events);for(var t=0;t<this.events.size();t++){var e=this.events.get(t);e.isDelete()&&e.getInsertEvent().setDeleteEventIndex(t)}},e.prototype.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 li&&O(arguments[0],It)&&O(arguments[1],It)){var r=arguments[0],i=arguments[1],o=arguments[2];this.addEdges(r,r),this.addEdges(i,i),this.computeIntersections(o)}else if("boolean"==typeof arguments[2]&&O(arguments[0],It)&&arguments[1]instanceof li){var s=arguments[0],a=arguments[1];arguments[2]?this.addEdges(s,null):this.addEdges(s),this.computeIntersections(a)}},e.prototype.addEdge=function(t,e){for(var n=t.getMonotoneChainEdge(),r=n.getStartIndexes(),i=0;i<r.length-1;i++){var o=new si(n,i),s=new ai(e,n.getMinX(i),o);this.events.add(s),this.events.add(new ai(n.getMaxX(i),s))}},e.prototype.processOverlaps=function(t,e,n,r){for(var i=n.getObject(),o=t;o<e;o++){var s=this.events.get(o);if(s.isInsert()){var a=s.getObject();n.isSameLabel(s)||(i.computeIntersections(a,r),this.nOverlaps++)}}},e.prototype.addEdges=function(){if(1===arguments.length)for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.addEdge(e,e)}else if(2===arguments.length)for(var n=arguments[0],r=arguments[1],i=n.iterator();i.hasNext();){var o=i.next();this.addEdge(o,r)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ci),hi=function(){this._min=v.POSITIVE_INFINITY,this._max=v.NEGATIVE_INFINITY},fi={NodeComparator:{configurable:!0}};hi.prototype.getMin=function(){return this._min},hi.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},hi.prototype.getMax=function(){return this._max},hi.prototype.toString=function(){return Z.toLineString(new b(this._min,0),new b(this._max,0))},hi.prototype.interfaces_=function(){return[]},hi.prototype.getClass=function(){return hi},fi.NodeComparator.get=function(){return gi},Object.defineProperties(hi,fi);var gi=function(){};gi.prototype.compare=function(t,e){var n=t,r=e,i=(n._min+n._max)/2,o=(r._min+r._max)/2;return i<o?-1:i>o?1:0},gi.prototype.interfaces_=function(){return[N]},gi.prototype.getClass=function(){return gi};var di=function(t){function e(){t.call(this),this._item=null;var e=arguments[0],n=arguments[1],r=arguments[2];this._min=e,this._max=n,this._item=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;n.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(hi),yi=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var e=arguments[0],n=arguments[1];this._node1=e,this._node2=n,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,n),null!==this._node2&&this._node2.query(t,e,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(hi),_i=function(){this._leaves=new Nt,this._root=null,this._level=0};_i.prototype.buildTree=function(){$e.sort(this._leaves,new hi.NodeComparator);for(var t=this._leaves,e=null,n=new Nt;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},_i.prototype.insert=function(t,e,n){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new di(t,e,n))},_i.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},_i.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},_i.prototype.printNode=function(t){z.out.println(Z.toLineString(new b(t._min,this._level),new b(t._max,this._level)))},_i.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},_i.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var r=t.get(n);if(null===(n+1<t.size()?t.get(n):null))e.add(r);else{var i=new yi(t.get(n),t.get(n+1));e.add(i)}}},_i.prototype.interfaces_=function(){return[]},_i.prototype.getClass=function(){return _i};var mi=function(){this._items=new Nt};mi.prototype.visitItem=function(t){this._items.add(t)},mi.prototype.getItems=function(){return this._items},mi.prototype.interfaces_=function(){return[Ke]},mi.prototype.getClass=function(){return mi};var vi=function(){this._index=null;var t=arguments[0];if(!O(t,Zt))throw new m("Argument must be Polygonal");this._index=new Ii(t)},xi={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};vi.prototype.locate=function(t){var e=new st(t),n=new Ei(e);return this._index.query(t.y,t.y,n),e.getLocation()},vi.prototype.interfaces_=function(){return[kn]},vi.prototype.getClass=function(){return vi},xi.SegmentVisitor.get=function(){return Ei},xi.IntervalIndexedGeometry.get=function(){return Ii},Object.defineProperties(vi,xi);var Ei=function(){this._counter=null;var t=arguments[0];this._counter=t};Ei.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},Ei.prototype.interfaces_=function(){return[Ke]},Ei.prototype.getClass=function(){return Ei};var Ii=function(){this._index=new _i;var t=arguments[0];this.init(t)};Ii.prototype.init=function(t){for(var e=br.getLines(t).iterator();e.hasNext();){var n=e.next().getCoordinates();this.addLine(n)}},Ii.prototype.addLine=function(t){for(var e=1;e<t.length;e++){var n=new dn(t[e-1],t[e]),r=Math.min(n.p0.y,n.p1.y),i=Math.max(n.p0.y,n.p1.y);this._index.insert(r,i,n)}},Ii.prototype.query=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new mi;return this._index.query(t,e,n),n.getItems()}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._index.query(r,i,o)}},Ii.prototype.interfaces_=function(){return[]},Ii.prototype.getClass=function(){return Ii};var Ni=function(t){function e(){if(t.call(this),this._parentGeom=null,this._lineEdgeMap=new he,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Cr,2===arguments.length){var e=arguments[0],n=arguments[1],r=gt.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=r,null!==n&&this.add(n)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];this._argIndex=i,this._parentGeom=o,this._boundaryNodeRule=s,null!==o&&this.add(o)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertBoundaryPoint=function(t,n){var r=this._nodes.addNode(n).getLabel(),i=1;r.getLocation(t,Ce.ON)===L.BOUNDARY&&i++;var o=e.determineBoundary(this._boundaryNodeRule,i);r.setLocation(t,o)},e.prototype.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],r=arguments[1],i=arguments[2],o=new li(n,!0,!1);o.setIsDoneIfProperInt(i);var s=this.createEdgeSetIntersector(),a=this._parentGeom instanceof ee||this._parentGeom instanceof $t||this._parentGeom instanceof ne,u=r||!a;return s.computeIntersections(this._edges,o,u),this.addSelfIntersectionNodes(this._argIndex),o}},e.prototype.computeSplitEdges=function(t){for(var e=this._edges.iterator();e.hasNext();)e.next().eiList.addSplitEdges(t)},e.prototype.computeEdgeIntersections=function(t,e,n){var r=new li(e,n,!0);return r.setBoundaryNodes(this.getBoundaryNodes(),t.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,t._edges,r),r},e.prototype.getGeometry=function(){return this._parentGeom},e.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},e.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},e.prototype.addPoint=function(){if(arguments[0]instanceof Qt){var t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,L.INTERIOR)}else if(arguments[0]instanceof b){var e=arguments[0];this.insertPoint(this._argIndex,e,L.INTERIOR)}},e.prototype.addPolygon=function(t){this.addPolygonRing(t.getExteriorRing(),L.EXTERIOR,L.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var n=t.getInteriorRingN(e);this.addPolygonRing(n,L.INTERIOR,L.EXTERIOR)}},e.prototype.addEdge=function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this._argIndex,e[0],L.BOUNDARY),this.insertPoint(this._argIndex,e[e.length-1],L.BOUNDARY)},e.prototype.addLineString=function(t){var e=wt.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=e[0],null;var n=new nr(e,new Re(this._argIndex,L.INTERIOR));this._lineEdgeMap.put(t,n),this.insertEdge(n),et.isTrue(e.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),n=0,r=t.iterator();r.hasNext();){var i=r.next();e[n++]=i.getCoordinate().copy()}return e},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(t,e,n){if(this.isBoundaryNode(t,e))return null;n===L.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,n)},e.prototype.addPolygonRing=function(t,e,n){if(t.isEmpty())return null;var r=wt.removeRepeatedPoints(t.getCoordinates());if(r.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var i=e,o=n;at.isCCW(r)&&(i=n,o=e);var s=new nr(r,new Re(this._argIndex,L.BOUNDARY,i,o));this._lineEdgeMap.put(t,s),this.insertEdge(s),this.insertPoint(this._argIndex,r[0],L.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var r=this._nodes.addNode(e),i=r.getLabel();null===i?r._label=new Re(t,n):i.setLocation(t,n)},e.prototype.createEdgeSetIntersector=function(){return new pi},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var n=e.next(),r=n.getLabel().getLocation(t),i=n.eiList.iterator();i.hasNext();){var o=i.next();this.addSelfIntersectionNode(t,o.coord,r)}},e.prototype.add=function(){if(1!==arguments.length)return t.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof ne&&(this._useBoundaryDeterminationRule=!1),e instanceof $t)this.addPolygon(e);else if(e instanceof Kt)this.addLineString(e);else if(e instanceof Qt)this.addPoint(e);else if(e instanceof te)this.addCollection(e);else if(e instanceof jt)this.addCollection(e);else if(e instanceof ne)this.addCollection(e);else{if(!(e instanceof Ut))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},e.prototype.locate=function(t){return O(this._parentGeom,Zt)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new vi(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(t,e){return t.isInBoundary(e)?L.BOUNDARY:L.INTERIOR},e}(ze),bi=function(){if(this._li=new it,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 Ni(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=gt.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ni(0,e,r),this._arg[1]=new Ni(1,n,r)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];i.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ni(0,i,s),this._arg[1]=new Ni(1,o,s)}};bi.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},bi.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},bi.prototype.interfaces_=function(){return[]},bi.prototype.getClass=function(){return bi};var Ci=function(){};Ci.prototype.interfaces_=function(){return[]},Ci.prototype.getClass=function(){return Ci},Ci.map=function(){if(arguments[0]instanceof lt&&O(arguments[1],Ci.MapOp)){for(var t=arguments[0],e=arguments[1],n=new Nt,r=0;r<t.getNumGeometries();r++){var i=e.map(t.getGeometryN(r));null!==i&&n.add(i)}return t.getFactory().buildGeometry(n)}if(O(arguments[0],xt)&&O(arguments[1],Ci.MapOp)){for(var o=arguments[0],s=arguments[1],a=new Nt,u=o.iterator();u.hasNext();){var c=u.next(),l=s.map(c);null!==l&&a.add(l)}return a}},Ci.MapOp=function(){};var wi=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n),this._ptLocator=new Cr,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Hn,this._resultPolyList=new Nt,this._resultLineList=new Nt,this._resultPointList=new Nt,this._graph=new ze(new Xn),this._geomFact=e.getFactory()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new Re(t.getLabel())).flip();var i=e.getDepth();i.isNull()&&i.add(n),i.add(r),n.merge(r)}else this._edgeList.add(t)},e.prototype.getGraph=function(){return this._graph},e.prototype.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))}},e.prototype.isCoveredByLA=function(t){return!!this.isCovered(t,this._resultLineList)||!!this.isCovered(t,this._resultPolyList)},e.prototype.computeGeometry=function(t,n,r,i){var o=new Nt;return o.addAll(t),o.addAll(n),o.addAll(r),o.isEmpty()?e.createEmptyResult(i,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(o)},e.prototype.mergeSymLabels=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().mergeSymLabels()},e.prototype.isCovered=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(this._ptLocator.locate(t,r)!==L.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var t=new Nt,e=this._edgeList.iterator();e.hasNext();){var n=e.next();n.isCollapsed()&&(e.remove(),t.add(n.getCollapsedEdge()))}this._edgeList.addAll(t)},e.prototype.updateNodeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getEdges().getLabel();e.getLabel().merge(n)}},e.prototype.getResultGeometry=function(t){return this.computeOverlay(t),this._resultGeom},e.prototype.insertUniqueEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.insertUniqueEdge(n)}},e.prototype.computeOverlay=function(t){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var e=new Nt;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),zr.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new Xe(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var r=new Yr(this,this._geomFact,this._ptLocator);this._resultLineList=r.build(t);var i=new Hr(this,this._geomFact,this._ptLocator);this._resultPointList=i.build(t),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,t)},e.prototype.labelIncompleteNode=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._arg[e].getGeometry());t.getLabel().setLocation(e,n)},e.prototype.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))}},e.prototype.findResultAreaEdges=function(t){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var r=n.next(),i=r.getLabel();i.isArea()&&!r.isInteriorAreaEdge()&&e.isResultOfOp(i.getLocation(0,Ce.RIGHT),i.getLocation(1,Ce.RIGHT),t)&&r.setInResult(!0)}},e.prototype.computeLabelsFromDepths=function(){for(var t=this._edgeList.iterator();t.hasNext();){var e=t.next(),n=e.getLabel(),r=e.getDepth();if(!r.isNull()){r.normalize();for(var i=0;i<2;i++)n.isNull(i)||!n.isArea()||r.isNull(i)||(0===r.getDelta(i)?n.toLine(i):(et.isTrue(!r.isNull(i,Ce.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(i,Ce.LEFT,r.getLocation(i,Ce.LEFT)),et.isTrue(!r.isNull(i,Ce.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(i,Ce.RIGHT,r.getLocation(i,Ce.RIGHT))))}}},e.prototype.computeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},e.prototype.labelIncompleteNodes=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getLabel();e.isIsolated()&&(n.isNull(0)?this.labelIncompleteNode(e,0):this.labelIncompleteNode(e,1)),e.getEdges().updateLabelling(n)}},e.prototype.isCoveredByA=function(t){return!!this.isCovered(t,this._resultPolyList)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(bi);wi.overlayOp=function(t,e,n){return new wi(t,e).getResultGeometry(n)},wi.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return wi.createEmptyResult(wi.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var n=e;return Xr.map(t,{interfaces_:function(){return[Ci.MapOp]},map:function(t){return t.intersection(n)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,wi.INTERSECTION)},wi.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return wi.createEmptyResult(wi.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,wi.SYMDIFFERENCE)},wi.resultDimension=function(t,e,n){var r=e.getDimension(),i=n.getDimension(),o=-1;switch(t){case wi.INTERSECTION:o=Math.min(r,i);break;case wi.UNION:o=Math.max(r,i);break;case wi.DIFFERENCE:o=r;break;case wi.SYMDIFFERENCE:o=Math.max(r,i)}return o},wi.createEmptyResult=function(t,e,n,r){var i=null;switch(wi.resultDimension(t,e,n)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon()}return i},wi.difference=function(t,e){return t.isEmpty()?wi.createEmptyResult(wi.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,wi.DIFFERENCE))},wi.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),r=t.getLocation(1);return wi.isResultOfOp(n,r,e)}if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];switch(i===L.BOUNDARY&&(i=L.INTERIOR),o===L.BOUNDARY&&(o=L.INTERIOR),s){case wi.INTERSECTION:return i===L.INTERIOR&&o===L.INTERIOR;case wi.UNION:return i===L.INTERIOR||o===L.INTERIOR;case wi.DIFFERENCE:return i===L.INTERIOR&&o!==L.INTERIOR;case wi.SYMDIFFERENCE:return i===L.INTERIOR&&o!==L.INTERIOR||i!==L.INTERIOR&&o===L.INTERIOR}return!1}},wi.INTERSECTION=1,wi.UNION=2,wi.DIFFERENCE=3,wi.SYMDIFFERENCE=4;var Si=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Cr,this._seg=new dn;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};Si.prototype.isWithinToleranceOfBoundary=function(t){for(var e=0;e<this._linework.getNumGeometries();e++)for(var n=this._linework.getGeometryN(e).getCoordinateSequence(),r=0;r<n.size()-1;r++)if(n.getCoordinate(r,this._seg.p0),n.getCoordinate(r+1,this._seg.p1),this._seg.distance(t)<=this._boundaryDistanceTolerance)return!0;return!1},Si.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?L.BOUNDARY:this._ptLocator.locate(t,this._g)},Si.prototype.extractLinework=function(t){var e=new Li;t.apply(e);var n=e.getLinework(),r=_e.toLineStringArray(n);return t.getFactory().createMultiLineString(r)},Si.prototype.interfaces_=function(){return[]},Si.prototype.getClass=function(){return Si};var Li=function(){this._linework=null,this._linework=new Nt};Li.prototype.getLinework=function(){return this._linework},Li.prototype.filter=function(t){if(t instanceof $t){var e=t;this._linework.add(e.getExteriorRing());for(var n=0;n<e.getNumInteriorRing();n++)this._linework.add(e.getInteriorRingN(n))}},Li.prototype.interfaces_=function(){return[kt]},Li.prototype.getClass=function(){return Li};var Pi=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Pi.prototype.extractPoints=function(t,e,n){for(var r=t.getCoordinates(),i=0;i<r.length-1;i++)this.computeOffsetPoints(r[i],r[i+1],e,n)},Pi.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Pi.prototype.getPoints=function(t){for(var e=new Nt,n=br.getLines(this._g).iterator();n.hasNext();){var r=n.next();this.extractPoints(r,t,e)}return e},Pi.prototype.computeOffsetPoints=function(t,e,n,r){var i=e.x-t.x,o=e.y-t.y,s=Math.sqrt(i*i+o*o),a=n*i/s,u=n*o/s,c=(e.x+t.x)/2,l=(e.y+t.y)/2;if(this._doLeft){var p=new b(c-u,l+a);r.add(p)}if(this._doRight){var h=new b(c+u,l-a);r.add(h)}},Pi.prototype.interfaces_=function(){return[]},Pi.prototype.getClass=function(){return Pi};var Oi=function t(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=t.TOLERANCE,this._testCoords=new Nt;var e=arguments[0],n=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,n),this._geom=[e,n,r],this._locFinder=[new Si(this._geom[0],this._boundaryDistanceTolerance),new Si(this._geom[1],this._boundaryDistanceTolerance),new Si(this._geom[2],this._boundaryDistanceTolerance)]},Ti={TOLERANCE:{configurable:!0}};Oi.prototype.reportResult=function(t,e,n){z.out.println("Overlay result invalid - A:"+L.toLocationSymbol(e[0])+" B:"+L.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+L.toLocationSymbol(e[2]))},Oi.prototype.isValid=function(t){return this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]),this.checkValid(t)},Oi.prototype.checkValid=function(){if(1===arguments.length){for(var t=arguments[0],e=0;e<this._testCoords.size();e++){var n=this._testCoords.get(e);if(!this.checkValid(t,n))return this._invalidLocation=n,!1}return!0}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._location[0]=this._locFinder[0].getLocation(i),this._location[1]=this._locFinder[1].getLocation(i),this._location[2]=this._locFinder[2].getLocation(i),!!Oi.hasLocation(this._location,L.BOUNDARY)||this.isValidResult(r,this._location)}},Oi.prototype.addTestPts=function(t){var e=new Pi(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Oi.prototype.isValidResult=function(t,e){var n=wi.isResultOfOp(e[0],e[1],t),r=!(n^e[2]===L.INTERIOR);return r||this.reportResult(t,e,n),r},Oi.prototype.getInvalidLocation=function(){return this._invalidLocation},Oi.prototype.interfaces_=function(){return[]},Oi.prototype.getClass=function(){return Oi},Oi.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},Oi.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Jr.computeSizeBasedSnapTolerance(t),Jr.computeSizeBasedSnapTolerance(e))},Oi.isValid=function(t,e,n,r){return new Oi(t,e,r).isValid(n)},Ti.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Oi,Ti);var Ri=function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e};Ri.prototype.extractElements=function(t,e){if(null===t)return null;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);this._skipEmpty&&r.isEmpty()||e.add(r)}},Ri.prototype.combine=function(){for(var t=new Nt,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)},Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri},Ri.combine=function(){if(1===arguments.length){var t=arguments[0];return new Ri(t).combine()}if(2===arguments.length){var e=arguments[0],n=arguments[1];return new Ri(Ri.createList(e,n)).combine()}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];return new Ri(Ri.createList(r,i,o)).combine()}},Ri.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Ri.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new Nt;return n.add(t),n.add(e),n}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=new Nt;return s.add(r),s.add(i),s.add(o),s}};var Mi=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new Nt)},Di={STRTREE_NODE_CAPACITY:{configurable:!0}};Mi.prototype.reduceToGeometries=function(t){for(var e=new Nt,n=t.iterator();n.hasNext();){var r=n.next(),i=null;O(r,It)?i=this.unionTree(r):r instanceof lt&&(i=r),e.add(i)}return e},Mi.prototype.extractByEnvelope=function(t,e,n){for(var r=new Nt,i=0;i<e.getNumGeometries();i++){var o=e.getGeometryN(i);o.getEnvelopeInternal().intersects(t)?r.add(o):n.add(o)}return this._geomFactory.buildGeometry(r)},Mi.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!n.intersects(r))return Ri.combine(t,e);if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var i=n.intersection(r);return this.unionUsingEnvelopeIntersection(t,e,i)},Mi.prototype.union=function(){if(null===this._inputPolys)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new sn(Mi.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var r=t.itemsTree();return this.unionTree(r)},Mi.prototype.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],r=arguments[2];if(r-n<=1){var i=Mi.getGeometry(e,n);return this.unionSafe(i,null)}if(r-n==2)return this.unionSafe(Mi.getGeometry(e,n),Mi.getGeometry(e,n+1));var o=Math.trunc((r+n)/2),s=this.binaryUnion(e,n,o),a=this.binaryUnion(e,o,r);return this.unionSafe(s,a)}},Mi.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var r=n.next();e=null===e?r.copy():e.union(r)}return e},Mi.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},Mi.prototype.unionActual=function(t,e){return Mi.restrictToPolygons(t.union(e))},Mi.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},Mi.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var r=new Nt,i=this.extractByEnvelope(n,t,r),o=this.extractByEnvelope(n,e,r),s=this.unionActual(i,o);return r.add(s),Ri.combine(r)},Mi.prototype.bufferUnion=function(){if(1===arguments.length){var t=arguments[0];return t.get(0).getFactory().buildGeometry(t).buffer(0)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().createGeometryCollection([e,n]).buffer(0)}},Mi.prototype.interfaces_=function(){return[]},Mi.prototype.getClass=function(){return Mi},Mi.restrictToPolygons=function(t){if(O(t,Zt))return t;var e=Nr.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(_e.toPolygonArray(e))},Mi.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Mi.union=function(t){return new Mi(t).union()},Di.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Mi,Di);var Ai=function(){};Ai.prototype.interfaces_=function(){return[]},Ai.prototype.getClass=function(){return Ai},Ai.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return wi.createEmptyResult(wi.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,wi.UNION)},t.GeoJSONReader=Ne,t.GeoJSONWriter=be,t.OverlayOp=wi,t.UnionOp=Ai,t.BufferOp=dr,Object.defineProperty(t,"__esModule",{value:!0})}(e)},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var r=n(13),i=n(1).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){var r=n(37),i=n(7),o="__core-js_shared__",s=i[o]||(i[o]={});(t.exports=function(t,e){return s[t]||(s[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(54)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e){t=t.exports={version:"2.6.11"},"number"==typeof __e&&(__e=t)},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on  "+t);return t}},function(t,e,n){var r=n(3)("unscopables"),i=Array.prototype;null==i[r]&&n(11)(i,r,{}),t.exports=function(t){i[r][t]=!0}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(0<t?r:n)(t)}},function(t,e){t.exports=!0},function(t,e,n){var r=n(105),i=n(24);t.exports=function(t){return r(i(t))}},function(t,e,n){var r=n(62)("keys"),i=n(63);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e,n){var r=n(22).f,i=n(23),o=n(2)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){"use strict";var r=n(21);function i(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)}t.exports.f=function(t){return new i(t)}},function(t,e){t.exports={}},function(t,e,n){var r=n(56),i=n(38);t.exports=function(t){return r(i(t))}},function(t,e,n){var r=n(36)("keys"),i=n(35);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){t.exports="\t\n\v\f\r   ᠎             　\u2028\u2029\ufeff"},function(t,e,n){var r=n(16),i=n(7).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e,n){"use strict";var r=n(15);t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){t.exports=!1},function(t,e,n){var r=n(90);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){var r=n(28);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){var r=n(38);t.exports=function(t){return Object(r(t))}},function(t,e,n){var r=n(59),i=Math.min;t.exports=function(t){return 0<t?i(r(t),9007199254740991):0}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(0<t?r:n)(t)}},function(t,e,n){"use strict";function r(){return this}var i=n(41),o=n(8),s=n(99),a=n(9),u=n(18),c=n(100),l=n(44),p=n(108),h=n(2)("iterator"),f=!([].keys&&"next"in[].keys()),g="values";t.exports=function(t,e,n,d,y,_,m){function v(t){if(!f&&t in w)return w[t];switch(t){case"keys":case g:return function(){return new n(this,t)}}return function(){return new n(this,t)}}c(n,e,d);var x,E,I,N=e+" Iterator",b=y==g,C=!1,w=t.prototype,S=w[h]||w["@@iterator"]||y&&w[y],L=S||v(y),P=y?b?v("entries"):L:void 0;if((d="Array"==e&&w.entries||S)&&(I=p(d.call(new t)))!==Object.prototype&&I.next&&(l(I,N,!0),i||"function"==typeof I[h]||a(I,h,r)),b&&S&&S.name!==g&&(C=!0,L=function(){return S.call(this)}),i&&!m||!f&&!C&&w[h]||a(w,h,L),u[e]=L,u[N]=r,y)if(x={values:b?L:v(g),keys:_?L:v("keys"),entries:P},m)for(E in x)E in w||s(w,E,x[E]);else o(o.P+o.F*(f||C),e,x);return x}},function(t,e,n){var r=n(40),i=Math.min;t.exports=function(t){return 0<t?i(r(t),9007199254740991):0}},function(t,e,n){var r=n(4),i=n(1),o="__core-js_shared__",s=i[o]||(i[o]={});(t.exports=function(t,e){return s[t]||(s[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(41)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){n=n(1).document,t.exports=n&&n.documentElement},function(t,e,n){var r=n(29),i=n(2)("toStringTag"),o="Arguments"==r(function(){return arguments}());t.exports=function(t){var e;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(t=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),i))?t:o?r(e):"Object"==(t=r(e))&&"function"==typeof e.callee?"Arguments":t}},function(t,e,n){var r=n(6),i=n(21),o=n(2)("species");t.exports=function(t,e){var n;return void 0===(t=r(t).constructor)||null==(n=r(t)[o])?e:i(n)}},function(t,e,n){function r(){var t,e=+this;_.hasOwnProperty(e)&&(t=_[e],delete _[e],t())}function i(t){r.call(t.data)}var o,s=n(20),a=n(120),u=n(65),c=n(33),l=n(1),p=l.process,h=l.setImmediate,f=l.clearImmediate,g=l.MessageChannel,d=l.Dispatch,y=0,_={},m="onreadystatechange";h&&f||(h=function(t){for(var e=[],n=1;n<arguments.length;)e.push(arguments[n++]);return _[++y]=function(){a("function"==typeof t?t:Function(t),e)},o(y),y},f=function(t){delete _[t]},"process"==n(29)(p)?o=function(t){p.nextTick(s(r,t,1))}:d&&d.now?o=function(t){d.now(s(r,t,1))}:g?(g=(n=new g).port2,n.port1.onmessage=i,o=s(g.postMessage,g,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(o=function(t){l.postMessage(t+"","*")},l.addEventListener("message",i,!1)):o=m in c("script")?function(t){u.appendChild(c("script"))[m]=function(){u.removeChild(this),r.call(t)}}:function(t){setTimeout(s(r,t,1),0)}),t.exports={set:h,clear:f}},function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,e,n){var r=n(6),i=n(13),o=n(45);t.exports=function(t,e){return r(t),i(e)&&e.constructor===t?e:((0,(t=o.f(t)).resolve)(e),t.promise)}},function(t,e,n){var r=n(135),i=n(73);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e,n){var r=n(47),i=n(58),o=n(136);t.exports=function(t){return function(e,n,s){var a,u=r(e),c=i(u.length),l=o(s,c);if(t&&n!=n){for(;l<c;)if((a=u[l++])!=a)return!0}else for(;l<c;l++)if((t||l in u)&&u[l]===n)return t||l||0;return!t&&-1}}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(25).f,i=n(26),o=n(3)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){t.exports=n(78)},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(146)),o=r(n(147)),s=n(19),a=r(n(153));function u(t,e){for(var n=0;n<t.coordinates.length-1;n++)if(function(t,e,n){var r=n[0]-t[0],i=n[1]-t[1],o=e[0]-t[0],s=e[1]-t[1];return r*s-i*o==0&&(Math.abs(o)>=Math.abs(s)?0<o?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:0<s?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1])}(t.coordinates[n],t.coordinates[n+1],e.coordinates))return 1}function c(t,e){for(var n=0,r=e.coordinates;n<r.length;n++){var s=r[n];if(i.default(s,t))return 1}return 0<o.default(e,a.default(t)).features.length}e.default=function(t,e){var n=!0;return s.flattenEach(t,(function(t){s.flattenEach(e,(function(e){return!1!==n&&void(n=function(t,e){switch(t.type){case"Point":switch(e.type){case"Point":return!function(t,e){return t[0]===e[0]&&t[1]===e[1]}(t.coordinates,e.coordinates);case"LineString":return!u(e,t);case"Polygon":return!i.default(t,e)}break;case"LineString":switch(e.type){case"Point":return!u(t,e);case"LineString":return!function(t,e){return 0<o.default(t,e).features.length}(t,e);case"Polygon":return!c(e,t)}break;case"Polygon":switch(e.type){case"Point":return!i.default(e,t);case"LineString":return!c(t,e);case"Polygon":return!function(t,e){for(var n=0,r=t.coordinates[0];n<r.length;n++){var s=r[n];if(i.default(s,e))return!0}for(var u=0,c=e.coordinates[0];u<c.length;u++){var l=c[u];if(i.default(l,t))return!0}return 0<o.default(a.default(t),a.default(e)).features.length}(e,t)}}return!1}(t.geometry,e.geometry))}))})),n}},function(t,e,n){t.exports=n(154)},function(t,e,n){n(79),t.exports=n(4).parseFloat},function(t,e,n){var r=n(8);n=n(82);r(r.G+r.F*(parseFloat!=n),{parseFloat:n})},function(t,e,n){t.exports=!n(14)&&!n(32)((function(){return 7!=Object.defineProperty(n(33)("div"),"a",{get:function(){return 7}}).a}))},function(t,e,n){var r=n(13);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var r=n(1).parseFloat,i=n(83).trim;t.exports=1/r(n(50)+"-0")!=-1/0?function(t){var e=i(String(t),3);return 0===(t=r(e))&&"-"==e.charAt(0)?-0:t}:r},function(t,e,n){var r=n(8),i=n(24),o=n(32),s=n(50),a=(n="["+s+"]",RegExp("^"+n+n+"*")),u=RegExp(n+n+"*$"),c=(n=function(t,e,n){var i={},a=o((function(){return!!s[t]()||"​"!="​"[t]()}));e=i[t]=a?e(c):s[t];n&&(i[n]=e),r(r.P+r.F*a,"String",i)}).trim=function(t,e){return t=String(i(t)),1&e&&(t=t.replace(a,"")),2&e&&(t=t.replace(u,"")),t};t.exports=n},function(t,e,n){"use strict";function r(t){n(17)(RegExp.prototype,a,t,!0)}n(85);var i=n(15),o=n(52),s=n(10),a="toString",u=/./[a];n(34)((function(){return"/a/b"!=u.call({source:"a",flags:"b"})}))?r((function(){var t=i(this);return"/".concat(t.source,"/","flags"in t?t.flags:!s&&t instanceof RegExp?o.call(t):void 0)})):u.name!=a&&r((function(){return u.call(this)}))},function(t,e,n){n(10)&&"g"!=/./g.flags&&n(25).f(RegExp.prototype,"flags",{configurable:!0,get:n(52)})},function(t,e,n){t.exports=!n(10)&&!n(34)((function(){return 7!=Object.defineProperty(n(51)("div"),"a",{get:function(){return 7}}).a}))},function(t,e,n){var r=n(16);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){t.exports=n(36)("native-function-to-string",Function.toString)},function(t,e,n){"use strict";var r=n(27),i=n(91)(5),o=!0;"find"in[]&&Array(1).find((function(){o=!1})),r(r.P+r.F*o,"Array",{find:function(t,e){return i(this,t,1<arguments.length?e:void 0)}}),n(39)("find")},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var r=n(55),i=n(56),o=n(57),s=n(58),a=n(92);t.exports=function(t,e){var n=1==t,u=2==t,c=3==t,l=4==t,p=6==t,h=5==t||p,f=e||a;return function(e,a,g){for(var d,y,_=o(e),m=i(_),v=r(a,g,3),x=s(m.length),E=0,I=n?f(e,x):u?f(e,0):void 0;E<x;E++)if((h||E in m)&&(y=v(d=m[E],E,_),t))if(n)I[E]=y;else if(y)switch(t){case 3:return!0;case 5:return d;case 6:return E;case 2:I.push(d)}else if(l)return!1;return p?-1:c||l?l:I}}},function(t,e,n){var r=n(93);t.exports=function(t,e){return new(r(t))(e)}},function(t,e,n){var r=n(16),i=n(94),o=n(3)("species");t.exports=function(t){var e;return i(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!i(e.prototype)||(e=void 0),r(e)&&null===(e=e[o])&&(e=void 0)),void 0===e?Array:e}},function(t,e,n){var r=n(28);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){n(96),n(97),n(110),n(114),n(126),n(127),t.exports=n(4).Promise},function(t,e){},function(t,e,n){"use strict";var r=n(98)(!0);n(60)(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t=this._t,e=this._i;return e>=t.length?{value:void 0,done:!0}:(e=r(t,e),this._i+=e.length,{value:e,done:!1})}))},function(t,e,n){var r=n(40),i=n(24);t.exports=function(t){return function(e,n){var o,s=String(i(e)),a=r(n);e=s.length;return a<0||e<=a?t?"":void 0:(n=s.charCodeAt(a))<55296||56319<n||a+1===e||(o=s.charCodeAt(a+1))<56320||57343<o?t?s.charAt(a):n:t?s.slice(a,a+2):o-56320+(n-55296<<10)+65536}}},function(t,e,n){t.exports=n(9)},function(t,e,n){"use strict";var r=n(101),i=n(49),o=n(44),s={};n(9)(s,n(2)("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=r(s,{next:i(1,n)}),o(t,e+" Iterator")}},function(t,e,n){function r(){}var i=n(6),o=n(102),s=n(64),a=n(43)("IE_PROTO"),u="prototype",c=function(){var t=n(33)("iframe"),e=s.length;for(t.style.display="none",n(65).appendChild(t),t.src="javascript:",(t=t.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),c=t.F;e--;)delete c[u][s[e]];return c()};t.exports=Object.create||function(t,e){var n;return null!==t?(r[u]=i(t),n=new r,r[u]=null,n[a]=t):n=c(),void 0===e?n:o(n,e)}},function(t,e,n){var r=n(22),i=n(6),o=n(103);t.exports=n(14)?Object.defineProperties:function(t,e){i(t);for(var n,s=o(e),a=s.length,u=0;u<a;)r.f(t,n=s[u++],e[n]);return t}},function(t,e,n){var r=n(104),i=n(64);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e,n){var r=n(23),i=n(42),o=n(106)(!1),s=n(43)("IE_PROTO");t.exports=function(t,e){var n,a=i(t),u=0,c=[];for(n in a)n!=s&&r(a,n)&&c.push(n);for(;e.length>u;)r(a,n=e[u++])&&(~o(c,n)||c.push(n));return c}},function(t,e,n){var r=n(29);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){var r=n(42),i=n(61),o=n(107);t.exports=function(t){return function(e,n,s){var a,u=r(e),c=i(u.length),l=o(s,c);if(t&&n!=n){for(;l<c;)if((a=u[l++])!=a)return!0}else for(;l<c;l++)if((t||l in u)&&u[l]===n)return t||l||0;return!t&&-1}}},function(t,e,n){var r=n(40),i=Math.max,o=Math.min;t.exports=function(t,e){return(t=r(t))<0?i(t+e,0):o(t,e)}},function(t,e,n){var r=n(23),i=n(109),o=n(43)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,e,n){var r=n(24);t.exports=function(t){return Object(r(t))}},function(t,e,n){n(111);for(var r=n(1),i=n(9),o=n(18),s=n(2)("toStringTag"),a="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;u<a.length;u++){var c,l=a[u];(c=(c=r[l])&&c.prototype)&&!c[s]&&i(c,s,l),o[l]=o.Array}},function(t,e,n){"use strict";var r=n(112),i=n(113),o=n(18),s=n(42);t.exports=n(60)(Array,"Array",(function(t,e){this._t=s(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){"use strict";function r(){}function i(t){var e;return!(!y(t)||"function"!=typeof(e=t.then))&&e}function o(t,e){var n;t._n||(t._n=!0,n=t._c,I((function(){for(var r=t._v,o=1==t._s,s=0;n.length>s;)!function(e){var n,s,a,u=o?e.ok:e.fail,c=e.resolve,l=e.reject,p=e.domain;try{u?(o||(2==t._h&&G(t),t._h=1),!0===u?n=r:(p&&p.enter(),n=u(r),p&&(p.exit(),a=!0)),n===e.promise?l(L("Promise-chain cycle")):(s=i(n))?s.call(n,c,l):c(n)):l(r)}catch(e){p&&!a&&p.exit(),l(e)}}(n[s++]);t._c=[],t._n=!1,e&&!t._h&&A(t)})))}function s(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),o(e,!0))}var a,u,c,l,p=n(41),h=n(1),f=n(20),g=n(66),d=n(8),y=n(13),_=n(21),m=n(115),v=n(116),x=n(67),E=n(68).set,I=n(121)(),N=n(45),b=n(69),C=n(122),w=n(70),S="Promise",L=h.TypeError,P=h.process,O=P&&P.versions,T=O&&O.v8||"",R=h[S],M="process"==g(P),D=u=N.f,A=(g=!!function(){try{var t=R.resolve(1),e=(t.constructor={})[n(2)("species")]=function(t){t(r,r)};return(M||"function"==typeof PromiseRejectionEvent)&&t.then(r)instanceof e&&0!==T.indexOf("6.6")&&-1===C.indexOf("Chrome/66")}catch(t){}}(),function(t){E.call(h,(function(){var e,n,r=t._v,i=F(t);if(i&&(e=b((function(){M?P.emit("unhandledRejection",r,t):(n=h.onunhandledrejection)?n({promise:t,reason:r}):(n=h.console)&&n.error&&n.error("Unhandled promise rejection",r)})),t._h=M||F(t)?2:1),t._a=void 0,i&&e.e)throw e.v}))}),F=function(t){return 1!==t._h&&0===(t._a||t._c).length},G=function(t){E.call(h,(function(){var e;M?P.emit("rejectionHandled",t):(e=h.onrejectionhandled)&&e({promise:t,reason:t._v})}))},B=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw L("Promise can't be resolved itself");(e=i(t))?I((function(){var r={_w:n,_d:!1};try{e.call(t,f(B,r,1),f(s,r,1))}catch(t){s.call(r,t)}})):(n._v=t,n._s=1,o(n,!1))}catch(t){s.call({_w:n,_d:!1},t)}}};g||(R=function(t){m(this,R,S,"_h"),_(t),a.call(this);try{t(f(B,this,1),f(s,this,1))}catch(t){s.call(this,t)}},(a=function(){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(123)(R.prototype,{then:function(t,e){var n=D(x(this,R));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=M?P.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&o(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),c=function(){var t=new a;this.promise=t,this.resolve=f(B,t,1),this.reject=f(s,t,1)},N.f=D=function(t){return t===R||t===l?new c:u(t)}),d(d.G+d.W+d.F*!g,{Promise:R}),n(44)(R,S),n(124)(S),l=n(4)[S],d(d.S+d.F*!g,S,{reject:function(t){var e=D(this);return(0,e.reject)(t),e.promise}}),d(d.S+d.F*(p||!g),S,{resolve:function(t){return w(p&&this===l?R:this,t)}}),d(d.S+d.F*!(g&&n(125)((function(t){R.all(t).catch(r)}))),S,{all:function(t){var e=this,n=D(e),r=n.resolve,i=n.reject,o=b((function(){var n=[],o=0,s=1;v(t,!1,(function(t){var a=o++,u=!1;n.push(void 0),s++,e.resolve(t).then((function(t){u||(u=!0,n[a]=t,--s||r(n))}),i)})),--s||r(n)}));return o.e&&i(o.v),n.promise},race:function(t){var e=this,n=D(e),r=n.reject,i=b((function(){v(t,!1,(function(t){e.resolve(t).then(n.resolve,r)}))}));return i.e&&r(i.v),n.promise}})},function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){var r=n(20),i=n(117),o=n(118),s=n(6),a=n(61),u=n(119),c={},l={};(e=t.exports=function(t,e,n,p,h){h=h?function(){return t}:u(t);var f,g,d,y,_=r(n,p,e?2:1),m=0;if("function"!=typeof h)throw TypeError(t+" is not iterable!");if(o(h)){for(f=a(t.length);m<f;m++)if((y=e?_(s(g=t[m])[0],g[1]):_(t[m]))===c||y===l)return y}else for(d=h.call(t);!(g=d.next()).done;)if((y=i(d,_,g.value,e))===c||y===l)return y}).BREAK=c,e.RETURN=l},function(t,e,n){var r=n(6);t.exports=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&r(o.call(t)),e}}},function(t,e,n){var r=n(18),i=n(2)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},function(t,e,n){var r=n(66),i=n(2)("iterator"),o=n(18);t.exports=n(4).getIteratorMethod=function(t){if(null!=t)return t[i]||t["@@iterator"]||o[r(t)]}},function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(t,e,n){var r=n(1),i=n(68).set,o=r.MutationObserver||r.WebKitMutationObserver,s=r.process,a=r.Promise,u="process"==n(29)(s);t.exports=function(){function t(){var t,r;for(u&&(t=s.domain)&&t.exit();e;){r=e.fn,e=e.next;try{r()}catch(t){throw e?l():n=void 0,t}}n=void 0,t&&t.enter()}var e,n,c,l,p,h;return l=u?function(){s.nextTick(t)}:!o||r.navigator&&r.navigator.standalone?a&&a.resolve?(c=a.resolve(void 0),function(){c.then(t)}):function(){i.call(r,t)}:(p=!0,h=document.createTextNode(""),new o(t).observe(h,{characterData:!0}),function(){h.data=p=!p}),function(t){t={fn:t,next:void 0},n&&(n.next=t),e||(e=t,l()),n=t}}},function(t,e,n){n=n(1).navigator,t.exports=n&&n.userAgent||""},function(t,e,n){var r=n(9);t.exports=function(t,e,n){for(var i in e)n&&t[i]?t[i]=e[i]:r(t,i,e[i]);return t}},function(t,e,n){"use strict";var r=n(1),i=n(4),o=n(22),s=n(14),a=n(2)("species");t.exports=function(t){t=("function"==typeof i[t]?i:r)[t],s&&t&&!t[a]&&o.f(t,a,{configurable:!0,get:function(){return this}})}},function(t,e,n){var r=n(2)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o=[7],s=o[r]();s.next=function(){return{done:n=!0}},o[r]=function(){return s},t(o)}catch(t){}return n}},function(t,e,n){"use strict";var r=n(8),i=n(4),o=n(1),s=n(67),a=n(70);r(r.P+r.R,"Promise",{finally:function(t){var e=s(this,i.Promise||o.Promise),n="function"==typeof t;return this.then(n?function(n){return a(e,t()).then((function(){return n}))}:t,n?function(n){return a(e,t()).then((function(){throw n}))}:t)}})},function(t,e,n){"use strict";var r=n(8),i=n(45),o=n(69);r(r.S,"Promise",{try:function(t){var e=i.f(this);return((t=o(t)).e?e.reject:e.resolve)(t.v),e.promise}})},function(t,e,n){for(var r=n(129),i=n(71),o=n(17),s=n(7),a=n(11),u=n(46),c=(n=n(3))("iterator"),l=n("toStringTag"),p=u.Array,h={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},f=i(h),g=0;g<f.length;g++){var d,y=f[g],_=h[y],m=s[y],v=m&&m.prototype;if(v&&(v[c]||a(v,c,p),v[l]||a(v,l,y),u[y]=p,_))for(d in r)v[d]||o(v,d,r[d],!0)}},function(t,e,n){"use strict";var r=n(39),i=n(130),o=n(46),s=n(47);t.exports=n(131)(Array,"Array",(function(t,e){this._t=s(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){"use strict";function r(){return this}var i=n(54),o=n(27),s=n(17),a=n(11),u=n(46),c=n(132),l=n(74),p=n(138),h=n(3)("iterator"),f=!([].keys&&"next"in[].keys()),g="values";t.exports=function(t,e,n,d,y,_,m){function v(t){if(!f&&t in w)return w[t];switch(t){case"keys":case g:return function(){return new n(this,t)}}return function(){return new n(this,t)}}c(n,e,d);var x,E,I,N=e+" Iterator",b=y==g,C=!1,w=t.prototype,S=w[h]||w["@@iterator"]||y&&w[y],L=S||v(y),P=y?b?v("entries"):L:void 0;if((d="Array"==e&&w.entries||S)&&(I=p(d.call(new t)))!==Object.prototype&&I.next&&(l(I,N,!0),i||"function"==typeof I[h]||a(I,h,r)),b&&S&&S.name!==g&&(C=!0,L=function(){return S.call(this)}),i&&!m||!f&&!C&&w[h]||a(w,h,L),u[e]=L,u[N]=r,y)if(x={values:b?L:v(g),keys:_?L:v("keys"),entries:P},m)for(E in x)E in w||s(w,E,x[E]);else o(o.P+o.F*(f||C),e,x);return x}},function(t,e,n){"use strict";var r=n(133),i=n(53),o=n(74),s={};n(11)(s,n(3)("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=r(s,{next:i(1,n)}),o(t,e+" Iterator")}},function(t,e,n){function r(){}var i=n(15),o=n(134),s=n(73),a=n(48)("IE_PROTO"),u="prototype",c=function(){var t=n(51)("iframe"),e=s.length;for(t.style.display="none",n(137).appendChild(t),t.src="javascript:",(t=t.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),c=t.F;e--;)delete c[u][s[e]];return c()};t.exports=Object.create||function(t,e){var n;return null!==t?(r[u]=i(t),n=new r,r[u]=null,n[a]=t):n=c(),void 0===e?n:o(n,e)}},function(t,e,n){var r=n(25),i=n(15),o=n(71);t.exports=n(10)?Object.defineProperties:function(t,e){i(t);for(var n,s=o(e),a=s.length,u=0;u<a;)r.f(t,n=s[u++],e[n]);return t}},function(t,e,n){var r=n(26),i=n(47),o=n(72)(!1),s=n(48)("IE_PROTO");t.exports=function(t,e){var n,a=i(t),u=0,c=[];for(n in a)n!=s&&r(a,n)&&c.push(n);for(;e.length>u;)r(a,n=e[u++])&&(~o(c,n)||c.push(n));return c}},function(t,e,n){var r=n(59),i=Math.max,o=Math.min;t.exports=function(t,e){return(t=r(t))<0?i(t+e,0):o(t,e)}},function(t,e,n){n=n(7).document,t.exports=n&&n.documentElement},function(t,e,n){var r=n(26),i=n(57),o=n(48)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,e,n){"use strict";var r=n(140),i={};i[n(3)("toStringTag")]="z",i+""!="[object z]"&&n(17)(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},function(t,e,n){var r=n(28),i=n(3)("toStringTag"),o="Arguments"==r(function(){return arguments}());t.exports=function(t){var e;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(t=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),i))?t:o?r(e):"Object"==(t=r(e))&&"function"==typeof e.callee?"Arguments":t}},function(t,e,n){"use strict";var r=n(27),i=n(72)(!0);r(r.P,"Array",{includes:function(t,e){return i(this,t,1<arguments.length?e:void 0)}}),n(39)("includes")},function(t,e,n){"use strict";var r=n(27),i=n(143);r(r.P+r.F*n(145)("includes"),"String",{includes:function(t,e){return!!~i(this,t,"includes").indexOf(t,1<arguments.length?e:void 0)}})},function(t,e,n){var r=n(144),i=n(38);t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(t))}},function(t,e,n){var r=n(16),i=n(28),o=n(3)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},function(t,e,n){var r=n(3)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(t){}}return!0}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(30);function i(t,e,n){var r=!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 i=0,o=e.length-1;i<e.length;o=i++){var s=e[i][0],a=e[i][1],u=e[o][0],c=e[o][1];if(t[1]*(s-u)+a*(u-t[0])+c*(t[0]-s)==0&&(s-t[0])*(u-t[0])<=0&&(a-t[1])*(c-t[1])<=0)return!n;a>t[1]!=c>t[1]&&t[0]<(u-s)*(t[1]-a)/(c-a)+s&&(r=!r)}return r}e.default=function(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var o,s=r.getCoord(t),a=(t=(o=r.getGeom(e)).type,e=e.bbox,o.coordinates);if(e&&0==(o=s,(e=e)[0]<=o[0]&&e[1]<=o[1]&&e[2]>=o[0]&&e[3]>=o[1]))return!1;"Polygon"===t&&(a=[a]);for(var u=!1,c=0;c<a.length&&!u;c++)if(i(s,a[c][0],n.ignoreBoundary)){for(var l=!1,p=1;p<a[c].length&&!l;)i(s,a[c][p],!n.ignoreBoundary)&&(l=!0),p++;l||(u=!0)}return u}},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(12),o=n(30),s=r(n(148)),a=n(19),u=r(n(149));function c(t,e){var n=o.getCoords(t),r=o.getCoords(e);if(2!==n.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==r.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var s=n[0][0],a=n[0][1],u=n[1][0],c=n[1][1],l=r[0][0];t=r[0][1],e=r[1][0],r=((n=r[1][1])-t)*(u-s)-(e-l)*(c-a),n=(e-l)*(a-t)-(n-t)*(s-l);return 0==r?null:(n/=r,r=(l=(u-s)*(a-t)-(c-a)*(s-l))/r,0<=n&&n<=1&&0<=r&&r<=1?(s+=n*(u-s),a+=n*(c-a),i.point([s,a])):null)}e.default=function(t,e){var n={},r=[];if("LineString"===t.type&&(t=i.feature(t)),"LineString"===e.type&&(e=i.feature(e)),"Feature"===t.type&&"Feature"===e.type&&null!==t.geometry&&null!==e.geometry&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length){var l=c(t,e);return l&&r.push(l),i.featureCollection(r)}var p=u.default();return p.load(s.default(e)),a.featureEach(s.default(t),(function(t){a.featureEach(p.search(t),(function(e){var i=c(t,e);i&&(e=o.getCoords(i).join(","),n[e]||(n[e]=!0,r.push(i)))}))})),i.featureCollection(r)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),i=n(30),o=n(19);e.default=function(t){if(!t)throw new Error("geojson is required");var e=[];return o.flattenEach(t,(function(t){!function(t,e){var n=[],o=t.geometry;if(null!==o){switch(o.type){case"Polygon":n=i.getCoords(o);break;case"LineString":n=[i.getCoords(o)]}n.forEach((function(n){var i,o;(n=n,i=t.properties,o=[],n.reduce((function(t,e){var n,s,a,u=r.lineString([t,e],i);return u.bbox=(s=e,a=(n=t)[0],t=n[1],[a<(n=s[0])?a:n,t<(s=s[1])?t:s,n<a?a:n,s<t?t:s]),o.push(u),e})),o).forEach((function(t){t.id=e.length,e.push(t)}))}))}}(t,e)})),r.featureCollection(e)}},function(t,e,n){var r=n(150),i=n(12),o=n(19),s=n(152).default,a=o.featureEach,u=(o.coordEach,i.polygon,i.featureCollection);function c(t){return(t=r(t)).insert=function(t){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox||s(t),r.prototype.insert.call(this,t)},t.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox||s(t),e.push(t)})):a(t,(function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox||s(t),e.push(t)})),r.prototype.load.call(this,e)},t.remove=function(t,e){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox||s(t),r.prototype.remove.call(this,t,e)},t.clear=function(){return r.prototype.clear.call(this)},t.search=function(t){return t=r.prototype.search.call(this,this.toBBox(t)),u(t)},t.collides=function(t){return r.prototype.collides.call(this,this.toBBox(t))},t.all=function(){var t=r.prototype.all.call(this);return u(t)},t.toJSON=function(){return r.prototype.toJSON.call(this)},t.fromJSON=function(t){return r.prototype.fromJSON.call(this,t)},t.toBBox=function(t){var e;if(t.bbox)e=t.bbox;else if(Array.isArray(t)&&4===t.length)e=t;else if(Array.isArray(t)&&6===t.length)e=[t[0],t[1],t[3],t[4]];else if("Feature"===t.type)e=s(t);else{if("FeatureCollection"!==t.type)throw new Error("invalid geojson");e=s(t)}return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},t}t.exports=c,t.exports.default=c},function(t,e,n){"use strict";t.exports=i,t.exports.default=i;var r=n(151);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 o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){(i=i||g(null)).minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o,s=e;s<n;s++)o=t.children[s],a(i,t.leaf?r(o):o);return i}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 c(t,e){return t.minY-e.minY}function l(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function p(t){return t.maxX-t.minX+(t.maxY-t.minY)}function h(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function f(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function d(t,e,n,i,o){for(var s,a=[e,n];a.length;)(n=a.pop())-(e=a.pop())<=i||(s=e+Math.ceil((n-e)/i/2)*i,r(t,s,e,n,o),a.push(e,s,s,n))}i.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],r=this.toBBox;if(!f(t,e))return n;for(var i,o,s,a,u=[];e;){for(i=0,o=e.children.length;i<o;i++)s=e.children[i],f(t,a=e.leaf?r(s):s)&&(e.leaf?n.push(s):h(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(!f(t,e))return!1;for(var r,i,o,s,a=[];e;){for(r=0,i=e.children.length;r<i;r++)if(o=e.children[r],f(t,s=e.leaf?n(o):o)){if(e.leaf||h(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 r,i=this._build(t.slice(),0,t.length-1,0);return this.data.children.length?this.data.height===i.height?this._splitRoot(this.data,i):(this.data.height<i.height&&(r=this.data,this.data=i,i=r),this._insert(i,this.data.height-i.height-1,!0)):this.data=i,this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=g([]),this},remove:function(t,e){if(!t)return this;for(var n,r,i,o,s=this.data,a=this.toBBox(t),u=[],c=[];s||u.length;){if(s||(s=u.pop(),r=u[u.length-1],n=c.pop(),o=!0),s.leaf&&-1!==(i=function(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}(t,s.children,e)))return s.children.splice(i,1),u.push(s),this._condense(u),this;o||s.leaf||!h(s,a)?r?(n++,s=r.children[n],o=!1):s=null:(u.push(s),c.push(n),n=0,s=(r=s).children[0])}return this},toBBox:function(t){return t},compareMinX:u,compareMinY:c,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,r){var i,s=n-e+1,a=this._maxEntries;if(s<=a)return o(i=g(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,r-1))),(i=g([])).leaf=!1,i.height=r;var u,c,l,p,h=Math.ceil(s/a),f=h*Math.ceil(Math.sqrt(a));for(d(t,e,n,f,this.compareMinX),u=e;u<=n;u+=f)for(d(t,u,l=Math.min(u+f-1,n),h,this.compareMinY),c=u;c<=l;c+=h)p=Math.min(c+h-1,l),i.children.push(this._build(t,c,p,r-1));return o(i,this.toBBox),i},_chooseSubtree:function(t,e,n,r){for(var i,o,s,a,u,c,p,h,f;r.push(e),!e.leaf&&r.length-1!==n;){for(c=p=1/0,i=0,o=e.children.length;i<o;i++)u=l(s=e.children[i]),h=t,f=s,(h=(Math.max(f.maxX,h.maxX)-Math.min(f.minX,h.minX))*(Math.max(f.maxY,h.maxY)-Math.min(f.minY,h.minY))-u)<p?(p=h,c=u<c?u:c,a=s):h===p&&u<c&&(c=u,a=s);e=a||e.children[0]}return e},_insert:function(t,e,n){var r=this.toBBox,i=(n=n?t:r(t),[]);for((r=this._chooseSubtree(n,this.data,e,i)).children.push(t),a(r,n);0<=e&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(n,i,e)},_split:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r),r=this._chooseSplitIndex(n,i,r),(r=g(n.children.splice(r,n.children.length-r))).height=n.height,r.leaf=n.leaf,o(n,this.toBBox),o(r,this.toBBox),e?t[e-1].children.push(r):this._splitRoot(n,r)},_splitRoot:function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){for(var r,i,o,a,u,c,p,h,f,g=o=1/0,d=e;d<=n-e;d++)u=r=s(t,0,d,this.toBBox),c=i=s(t,d,n,this.toBBox),h=void 0,p=Math.max(u.minX,c.minX),h=Math.max(u.minY,c.minY),f=Math.min(u.maxX,c.maxX),c=Math.min(u.maxY,c.maxY),h=Math.max(0,f-p)*Math.max(0,c-h),i=l(r)+l(i),h<g?(g=h,a=d,o=i<o?i:o):h===g&&i<o&&(o=i,a=d);return a},_chooseSplitAxis:function(t,e,n){var r=t.leaf?this.compareMinX:u,i=t.leaf?this.compareMinY:c;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},_allDistMargin:function(t,e,n,r){t.children.sort(r);for(var i,o=this.toBBox,u=s(t,0,e,o),c=s(t,n-e,n,o),l=p(u)+p(c),h=e;h<n-e;h++)i=t.children[h],a(u,t.leaf?o(i):i),l+=p(u);for(h=n-e-1;e<=h;h--)i=t.children[h],a(c,t.leaf?o(i):i),l+=p(c);return l},_adjustParentBBoxes:function(t,e,n){for(var r=n;0<=r;r--)a(e[r],t)},_condense:function(t){for(var e,n=t.length-1;0<=n;n--)0===t[n].children.length?0<n?(e=t[n-1].children).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]+"};")}}},function(t,e,n){t.exports=function(){"use strict";function t(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function e(t,e){return t<e?-1:t>e?1:0}return function(n,r,i,o,s){!function e(n,r,i,o,s){for(;o>i;){if(o-i>600){var a=o-i+1,u=r-i+1,c=Math.log(a),l=.5*Math.exp(2*c/3),p=.5*Math.sqrt(c*l*(a-l)/a)*(u-a/2<0?-1:1),h=Math.max(i,Math.floor(r-u*l/a+p)),f=Math.min(o,Math.floor(r+(a-u)*l/a+p));e(n,r,h,f,s)}var g=n[r],d=i,y=o;for(t(n,i,r),s(n[o],g)>0&&t(n,i,o);d<y;){for(t(n,d,y),d++,y--;s(n[d],g)<0;)d++;for(;s(n[y],g)>0;)y--}0===s(n[i],g)?t(n,i,y):(y++,t(n,y,o)),y<=r&&(i=y+1),r<=y&&(o=y-1)}}(n,r,i||0,o||n.length-1,s||e)}}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(19);e.default=function(t){var e=[1/0,1/0,-1/0,-1/0];return r.coordEach(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}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),i=n(30);function o(t,e){void 0===e&&(e={});var n=i.getGeom(t);return n.type,a(n.coordinates,e.properties||("Feature"===t.type?t.properties:{}))}function s(t,e){void 0===e&&(e={});var n=((n=i.getGeom(t)).type,n.coordinates),o=e.properties||("Feature"===t.type?t.properties:{}),s=[];return n.forEach((function(t){s.push(a(t,o))})),r.featureCollection(s)}function a(t,e){return 1<t.length?r.multiLineString(t,e):r.lineString(t[0],e)}e.default=function(t,e){void 0===e&&(e={});var n=i.getGeom(t);switch(e.properties||"Feature"!==t.type||(e.properties=t.properties),n.type){case"Polygon":return o(n,e);case"MultiPolygon":return s(n,e);default:throw new Error("invalid poly")}},e.polygonToLine=o,e.multiPolygonToLine=s,e.coordsToLine=a},function(t,e,n){"use strict";n.r(e);var r=n(75),i=n.n(r),o=(n(84),n(89),n(5)),s=n.n(o),a=(r=(n(128),n(139),n(141),n(142),n(0)),n.n(r));function u(t,e,n){if(!l(n=n||{}))throw new Error("options is invalid");var r=n.bbox,i=n.id;if(void 0===t)throw new Error("geometry is required");if(e&&e.constructor!==Object)throw new Error("properties must be an Object");return r&&function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!c(t))throw new Error("bbox must only contain numbers")}))}(r),i&&function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}(i),n={type:"Feature"},i&&(n.id=i),r&&(n.bbox=r),n.properties=e||{},n.geometry=t,n}function c(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function l(t){return t&&t.constructor===Object}var p=function(t){var e=[1/0,1/0,-1/0,-1/0];return function t(e,n,r){if(null!==e)for(var i,o,s,a,u,c,l,p=0,h=e.type,f="FeatureCollection"===h,g="Feature"===h,d=f?e.features.length:1,y=0;y<d;y++){a=(l=!!(c=f?e.features[y].geometry:g?e.geometry:e)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var _=0;_<a;_++){var m,v=0,x=0;if(null!==(m=l?c.geometries[_]:c)){u=m.coordinates;var E=m.type,I=!r||"Polygon"!==E&&"MultiPolygon"!==E?0:1;switch(E){case null:break;case"Point":if(!1===n(u,p,y,v,x))return!1;p++,v++;break;case"LineString":case"MultiPoint":for(i=0;i<u.length;i++){if(!1===n(u[i],p,y,v,x))return!1;p++,"MultiPoint"===E&&v++}"LineString"===E&&v++;break;case"Polygon":case"MultiLineString":for(i=0;i<u.length;i++){for(o=0;o<u[i].length-I;o++){if(!1===n(u[i][o],p,y,v,x))return!1;p++}"MultiLineString"===E&&v++,"Polygon"===E&&x++}"Polygon"===E&&v++;break;case"MultiPolygon":for(i=0;i<u.length;i++){for("MultiPolygon"===E&&(x=0),o=0;o<u[i].length;o++){for(s=0;s<u[i][o].length-I;s++){if(!1===n(u[i][o][s],p,y,v,x))return!1;p++}x++}v++}break;case"GeometryCollection":for(i=0;i<m.geometries.length;i++)if(!1===t(m.geometries[i],n,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}(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},h=function(t,e){if(!l(e=e||{}))throw new Error("options is invalid");if(e=e.properties,!t)throw new Error("geojson is required");return function(t,e,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!c(t[0])||!c(t[1]))throw new Error("coordinates must contain numbers");return u({type:"Point",coordinates:t},e,n)}([((t=p(t))[0]+t[2])/2,(t[1]+t[3])/2],e)},f=6371008.8,g={meters:f,metres:f,millimeters:1e3*f,millimetres:1e3*f,centimeters:100*f,centimetres:100*f,kilometers:f/1e3,kilometres:f/1e3,miles:f/1609.344,nauticalmiles:f/1852,inches:39.37*f,yards:f/1.0936,feet:3.28084*f,radians:1,degrees:f/111325};function d(t,e){if(!y(e=e||{}))throw new Error("options is invalid");var n=e.bbox,r=e.id;if(!t)throw new Error("No features passed");if(!Array.isArray(t))throw new Error("features must be an Array");return n&&_(n),r&&m(r),e={type:"FeatureCollection"},r&&(e.id=r),n&&(e.bbox=n),e.features=t,e}function y(t){return t&&t.constructor===Object}function _(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!function(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}(t))throw new Error("bbox must only contain numbers")}))}function m(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}function v(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length&&!1!==e(t.features[n],n);n++);}function x(t,e){for(var n,r,i,o,s,a,u,c,l,p=0,h="FeatureCollection"===t.type,f="Feature"===t.type,g=h?t.features.length:1,d=0;d<g;d++){for(s=h?t.features[d].geometry:f?t.geometry:t,u=h?t.features[d].properties:f?t.properties:{},c=h?t.features[d].bbox:f?t.bbox:void 0,l=h?t.features[d].id:f?t.id:void 0,o=(a=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,r=0;r<o;r++)if(null!==(i=a?s.geometries[r]:s))switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(i,p,u,c,l))return;break;case"GeometryCollection":for(n=0;n<i.geometries.length;n++)if(!1===e(i.geometries[n],p,u,c,l))return;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,p,u,c,l))return;p++}}var E=function(t){var e=[1/0,1/0,-1/0,-1/0];return function t(e,n,r){if(null!==e)for(var i,o,s,a,u,c,l,p=0,h=e.type,f="FeatureCollection"===h,g="Feature"===h,d=f?e.features.length:1,y=0;y<d;y++){a=(l=!!(c=f?e.features[y].geometry:g?e.geometry:e)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var _=0;_<a;_++){var m,v=0,x=0;if(null!==(m=l?c.geometries[_]:c)){u=m.coordinates;var E=m.type,I=!r||"Polygon"!==E&&"MultiPolygon"!==E?0:1;switch(E){case null:break;case"Point":if(!1===n(u,p,y,v,x))return!1;p++,v++;break;case"LineString":case"MultiPoint":for(i=0;i<u.length;i++){if(!1===n(u[i],p,y,v,x))return!1;p++,"MultiPoint"===E&&v++}"LineString"===E&&v++;break;case"Polygon":case"MultiLineString":for(i=0;i<u.length;i++){for(o=0;o<u[i].length-I;o++){if(!1===n(u[i][o],p,y,v,x))return!1;p++}"MultiLineString"===E&&v++,"Polygon"===E&&x++}"Polygon"===E&&v++;break;case"MultiPolygon":for(i=0;i<u.length;i++){for("MultiPolygon"===E&&(x=0),o=0;o<u[i].length;o++){for(s=0;s<u[i][o].length-I;s++){if(!1===n(u[i][o][s],p,y,v,x))return!1;p++}x++}v++}break;case"GeometryCollection":for(i=0;i<m.geometries.length;i++)if(!1===t(m.geometries[i],n,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}(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},I=n(31);function N(t){var e={type:"Feature"};return Object.keys(t).forEach((function(n){switch(n){case"type":case"properties":case"geometry":return;default:e[n]=t[n]}})),e.properties=function t(e){var n={};return e?(Object.keys(e).forEach((function(r){var i=e[r];"object"==typeof i?null===i?n[r]=null:i.length?n[r]=i.map((function(t){return t})):n[r]=t(i):n[r]=i})),n):n}(t.properties),e.geometry=b(t.geometry),e}function b(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?e.geometries=t.geometries.map(b):e.coordinates=function t(e){return"object"!=typeof e[0]?e.slice():e.map((function(e){return t(e)}))}(t.coordinates),e}function C(t,e,n){if(!function(t){return t&&t.constructor===Object}(n=n||{}))throw new Error("options is invalid");if(n=n.mutate,!t)throw new Error("geojson is required");return Array.isArray(t)&&function(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}(t[0])?t=("mercator"===e?w:S)(t):(!0!==n&&(t=function(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return N(t);case"FeatureCollection":return e=t,n={type:"FeatureCollection"},Object.keys(e).forEach((function(t){switch(t){case"type":case"features":return;default:n[t]=e[t]}})),n.features=e.features.map(N),n;case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return b(t);default:throw new Error("unknown GeoJSON type")}var e,n}(t)),function t(e,n,r){if(null!==e)for(var i,o,s,a,u,c,l,p=0,h=e.type,f="FeatureCollection"===h,g="Feature"===h,d=f?e.features.length:1,y=0;y<d;y++){a=(l=!!(c=f?e.features[y].geometry:g?e.geometry:e)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var _=0;_<a;_++){var m,v=0,x=0;if(null!==(m=l?c.geometries[_]:c)){u=m.coordinates;var E=m.type,I=!r||"Polygon"!==E&&"MultiPolygon"!==E?0:1;switch(E){case null:break;case"Point":if(!1===n(u,p,y,v,x))return!1;p++,v++;break;case"LineString":case"MultiPoint":for(i=0;i<u.length;i++){if(!1===n(u[i],p,y,v,x))return!1;p++,"MultiPoint"===E&&v++}"LineString"===E&&v++;break;case"Polygon":case"MultiLineString":for(i=0;i<u.length;i++){for(o=0;o<u[i].length-I;o++){if(!1===n(u[i][o],p,y,v,x))return!1;p++}"MultiLineString"===E&&v++,"Polygon"===E&&x++}"Polygon"===E&&v++;break;case"MultiPolygon":for(i=0;i<u.length;i++){for("MultiPolygon"===E&&(x=0),o=0;o<u[i].length;o++){for(s=0;s<u[i][o].length-I;s++){if(!1===n(u[i][o][s],p,y,v,x))return!1;p++}x++}v++}break;case"GeometryCollection":for(i=0;i<m.geometries.length;i++)if(!1===t(m.geometries[i],n,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}(t,(function(t){var n=("mercator"===e?w:S)(t);t[0]=n[0],t[1]=n[1]}))),t}function w(t){var e,n=Math.PI/180,r=20037508.342789244;return(n=[6378137*(Math.abs(t[0])<=180?t[0]:t[0]-360*((e=t[0])<0?-1:0<e?1:0))*n,6378137*Math.log(Math.tan(.25*Math.PI+.5*t[1]*n))])[0]>r&&(n[0]=r),n[0]<-r&&(n[0]=-r),n[1]>r&&(n[1]=r),n[1]<-r&&(n[1]=-r),n}function S(t){var e=180/Math.PI;return[t[0]*e/6378137,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/6378137)))*e]}function L(){this.reset()}o=function(){return new L},L.prototype={constructor:L,reset:function(){this.s=this.t=0},add:function(t){O(P,t,this.t),O(this,P.s,this.s),this.s?this.t+=P.t:this.s=P.t},valueOf:function(){return this.s}};var P=new L;function O(t,e,n){var r=(i=t.s=e+n)-e,i=i-r;t.t=e-i+(n-r)}var T=1e-6,R=Math.PI,M=R/2,D=R/4,A=2*R,F=180/R,G=R/180,B=Math.abs,q=Math.atan,k=Math.atan2,V=Math.cos,U=(Math.ceil,Math.exp),j=(Math.floor,Math.log),z=(Math.pow,Math.sin),X=(Math.sign,Math.sqrt),Y=Math.tan;function H(t){return 1<t?0:t<-1?R:Math.acos(t)}function W(t){return 1<t?M:t<-1?-M:Math.asin(t)}function K(){}function J(t,e){t&&Z.hasOwnProperty(t.type)&&Z[t.type](t,e)}var Q={Feature:function(t,e){J(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)J(n[r].geometry,e)}},Z={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,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){$(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)$(n[r],e,0)},Polygon:function(t,e){tt(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)tt(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)J(n[r],e)}};function $(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function tt(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)$(t[n],e,1);e.polygonEnd()}function et(t){return[k(t[1],t[0]),W(t[2])]}function nt(t){var e=t[0],n=t[1];return[(t=V(n))*V(e),t*z(e),z(n)]}function rt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function it(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 ot(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function st(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function at(t){var e=X(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}o(),o(),o();var ut=function(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n};function ct(t,e){return[R<t?t-A:t<-R?t+A:t,e]}function lt(t,e,n){return(t%=A)?e||n?ut(ht(t),ft(e,n)):ht(t):e||n?ft(e,n):ct}function pt(t){return function(e,n){return[R<(e+=t)?e-A:e<-R?e+A:e,n]}}function ht(t){var e=pt(t);return e.invert=pt(-t),e}function ft(t,e){var n=V(t),r=z(t),i=V(e),o=z(e);function s(t,e){var s=V(e),a=V(t)*s;t=z(t)*s,s=z(e);return[k(t*i-(e=s*n+a*r)*o,a*n-s*r),W(e*i+t*o)]}return s.invert=function(t,e){var s=V(e),a=V(t)*s;t=z(t)*s,s=z(e);return[k(t*i+s*o,a*n+(e=s*i-t*o)*r),W(e*n-a*r)]},s}function gt(t,e){return(e=nt(e))[0]-=t,at(e),t=H(-e[1]),((-e[2]<0?-t:t)+A-T)%A}function dt(t,e){return B(t[0]-e[0])<T&&B(t[1]-e[1])<T}ct.invert=ct;var yt=function(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:K,rejoin:function(){1<e.length&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}};function _t(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}var mt=function(t,e,n,r,i){var o,s,a=[],u=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],s=t[e];if(dt(r,s)){for(i.lineStart(),o=0;o<e;++o)i.point((r=t[o])[0],r[1]);i.lineEnd()}else a.push(n=new _t(r,t,null,!0)),u.push(n.o=new _t(r,null,n,!1)),a.push(n=new _t(s,t,null,!1)),u.push(n.o=new _t(s,null,n,!0))}})),a.length){for(u.sort(e),vt(a),vt(u),o=0,s=u.length;o<s;++o)u[o].e=n=!n;for(var c,l,p=a[0];;){for(var h=p,f=!0;h.v;)if((h=h.n)===p)return;c=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(f)for(o=0,s=c.length;o<s;++o)i.point((l=c[o])[0],l[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(f)for(c=h.p.z,o=c.length-1;0<=o;--o)i.point((l=c[o])[0],l[1]);else r(h.x,h.p.x,-1,i);h=h.p}}while(c=(h=h.o).z,f=!f,!h.v);i.lineEnd()}}};function vt(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function xt(t,e){return t<e?-1:e<t?1:e<=t?0:NaN}var Et,It;1===(Et=xt).length&&(It=Et,Et=function(t,e){return xt(It(t),e)}),r=0;(r=Array.prototype).slice,r.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);var Nt=function(t){for(var e,n,r,i=t.length,o=-1,s=0;++o<i;)s+=t[o].length;for(n=new Array(s);0<=--i;)for(e=(r=t[i]).length;0<=--e;)n[--s]=r[e];return n},bt=1e9,Ct=-bt;function wt(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,a,c){var l=0,p=0;if(null==i||(l=s(i,a))!==(p=s(o,a))||u(i,o)<0^0<a)for(;c.point(0===l||3===l?t:n,1<l?r:e),(l=(l+a+4)%4)!==p;);else c.point(o[0],o[1])}function s(r,i){return B(r[0]-t)<T?0<i?0:3:B(r[0]-n)<T?0<i?2:1:B(r[1]-e)<T?0<i?1:0:0<i?3:2}function a(t,e){return u(t.x,e.x)}function u(t,e){var n=s(t,1),r=s(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(s){var u,c,l,p,h,f,g,d,y,_,m,v=s,x=yt(),E={point:I,lineStart:function(){E.point=N,c&&c.push(l=[]),_=!0,y=!1,g=d=NaN},lineEnd:function(){u&&(N(p,h),f&&y&&x.rejoin(),u.push(x.result())),E.point=I,y&&v.lineEnd()},polygonStart:function(){v=x,u=[],c=[],m=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=c.length;n<i;++n)for(var o,s,a=c[n],u=1,l=a.length,p=a[0],h=p[0],f=p[1];u<l;++u)o=h,s=f,h=(p=a[u])[0],f=p[1],s<=r?r<f&&(f-s)*(t-o)<(h-o)*(r-s)&&++e:f<=r&&(h-o)*(r-s)<(f-s)*(t-o)&&--e;return e}(),n=m&&e,i=(u=Nt(u)).length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),i&&mt(u,a,e,o,s),s.polygonEnd()),v=s,u=c=l=null}};function I(t,e){i(t,e)&&v.point(t,e)}function N(o,s){var a,u,x=i(o,s);c&&l.push([o,s]),_?(p=o,h=s,_=!1,(f=x)&&(v.lineStart(),v.point(o,s))):x&&y?v.point(o,s):function(t,e,n,r,i,o){var s=t[0],a=t[1],u=0,c=1,l=e[0]-s,p=e[1]-a;n-=s;if(l||!(0<n)){if(n/=l,l<0){if(n<u)return;n<c&&(c=n)}else if(0<l){if(c<n)return;u<n&&(u=n)}if(n=i-s,l||!(n<0)){if(n/=l,l<0){if(c<n)return;u<n&&(u=n)}else if(0<l){if(n<u)return;n<c&&(c=n)}if(n=r-a,p||!(0<n)){if(n/=p,p<0){if(n<u)return;n<c&&(c=n)}else if(0<p){if(c<n)return;u<n&&(u=n)}if(n=o-a,p||!(n<0)){if(n/=p,p<0){if(c<n)return;u<n&&(u=n)}else if(0<p){if(n<u)return;n<c&&(c=n)}return 0<u&&(t[0]=s+u*l,t[1]=a+u*p),c<1&&(e[0]=s+c*l,e[1]=a+c*p),!0}}}}}(a=[g=Math.max(Ct,Math.min(bt,g)),d=Math.max(Ct,Math.min(bt,d))],u=[o=Math.max(Ct,Math.min(bt,o)),s=Math.max(Ct,Math.min(bt,s))],t,e,n,r)?(y||(v.lineStart(),v.point(a[0],a[1])),v.point(u[0],u[1]),x||v.lineEnd(),m=!1):x&&(v.lineStart(),v.point(o,s),m=!1),g=o,d=s,y=x}return E}}var St=o();o();var Lt=function(t){return t};o(),o();var Pt=1/0,Ot=Pt,Tt=-Pt,Rt=Tt,Mt={point:function(t,e){t<Pt&&(Pt=t),Tt<t&&(Tt=t),e<Ot&&(Ot=e),Rt<e&&(Rt=e)},lineStart:K,lineEnd:K,polygonStart:K,polygonEnd:K,result:function(){var t=[[Pt,Ot],[Tt,Rt]];return Tt=Rt=-(Ot=Pt=1/0),t}};function Dt(t,e,n,r){return function(i,o){var s,a,u,c=e(o),l=i.invert(r[0],r[1]),p=yt(),h=e(p),f=!1,g={point:d,lineStart:_,lineEnd:m,polygonStart:function(){g.point=v,g.lineStart=x,g.lineEnd=E,a=[],s=[]},polygonEnd:function(){g.point=d,g.lineStart=_,g.lineEnd=m,a=Nt(a);var t=function(t,e){var n=e[0],r=e[1],i=[z(n),-V(n),0],o=0,s=0;St.reset();for(var a=0,u=t.length;a<u;++a)if(l=(c=t[a]).length)for(var c,l,p=c[l-1],h=p[0],f=p[1]/2+D,g=z(f),d=V(f),y=0;y<l;++y,h=m,g=x,d=E,p=_){var _=c[y],m=_[0],v=_[1]/2+D,x=z(v),E=V(v),I=m-h,N=0<=I?1:-1,b=N*I,C=R<b;v=g*x;St.add(k(v*N*z(b),d*E+v*V(b))),o+=C?I+N*A:I,C^n<=h^n<=m&&(at(b=it(nt(p),nt(_))),at(N=it(i,b)),((N=(C^0<=I?-1:1)*W(N[2]))<r||r===N&&(b[0]||b[1]))&&(s+=C^0<=I?1:-1))}return(o<-T||o<T&&St<-T)^1&s}(s,l);a.length?(f||(o.polygonStart(),f=!0),mt(a,Ft,t,n,o)):t&&(f||(o.polygonStart(),f=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),f&&(o.polygonEnd(),f=!1),a=s=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function d(e,n){var r=i(e,n);t(e=r[0],n=r[1])&&o.point(e,n)}function y(t,e){e=i(t,e),c.point(e[0],e[1])}function _(){g.point=y,c.lineStart()}function m(){g.point=d,c.lineEnd()}function v(t,e){u.push([t,e]),e=i(t,e),h.point(e[0],e[1])}function x(){h.lineStart(),u=[]}function E(){v(u[0][0],u[0][1]),h.lineEnd();var t,e,n,r,i=h.clean(),c=p.result(),l=c.length;if(u.pop(),s.push(u),u=null,l)if(1&i){if(0<(e=(n=c[0]).length-1)){for(f||(o.polygonStart(),f=!0),o.lineStart(),t=0;t<e;++t)o.point((r=n[t])[0],r[1]);o.lineEnd()}}else 1<l&&2&i&&c.push(c.pop().concat(c.shift())),a.push(c.filter(At))}return g}}function At(t){return 1<t.length}function Ft(t,e){return((t=t.x)[0]<0?t[1]-M-T:M-t[1])-((e=e.x)[0]<0?e[1]-M-T:M-e[1])}o();var Gt=Dt((function(){return 1}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,s){var a,u,c,l,p,h=0<o?R:-R,f=B(o-n);B(f-R)<T?(t.point(n,r=0<(r+s)/2?M:-M),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(h,r),t.point(o,r),e=0):i!==h&&R<=f&&(B(n-i)<T&&(n-=i*T),B(o-h)<T&&(o-=h*T),u=r,l=s,p=z((a=n)-(c=o)),r=B(p)>T?q((z(u)*(f=V(l))*z(c)-z(l)*(c=V(u))*z(a))/(c*f*p)):(u+l)/2,t.point(i,r),t.lineEnd(),t.lineStart(),t.point(h,r),e=0),t.point(n=o,r=s),i=h},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;null==t?(i=n*M,r.point(-R,i),r.point(0,i),r.point(R,i),r.point(R,0),r.point(R,-i),r.point(0,-i),r.point(-R,-i),r.point(-R,0),r.point(-R,i)):B(t[0]-e[0])>T?(i=n*(t=t[0]<e[0]?R:-R)/2,r.point(-t,i),r.point(0,i),r.point(t,i)):r.point(e[0],e[1])}),[-R,-M]),Bt=function(t,e){var n=V(t),r=0<n,i=B(n)>T;function o(t,e){return V(t)*V(e)>n}function s(t,e,r){var i=[1,0,0],o=it(nt(t),nt(e)),s=rt(o,o),a=o[0],u=s-a*a;if(!u)return!r&&t;var c=n*s/u,l=-n*a/u,p=it(i,o),h=st(i,c);if(ot(h,st(o,l)),!((i=(a=rt(h,s=p))*a-(u=rt(s,s))*(rt(h,h)-1))<0)){if(ot(o=st(s,(-a-(c=X(i)))/u),h),o=et(o),!r)return o;var f;l=t[0],p=e[0],i=t[1],r=e[1];if(p<l&&(f=l,l=p,p=f),!(e=B((t=p-l)-R)<T)&&r<i&&(f=i,i=r,r=f),e||t<T?e?0<i+r^o[1]<(B(o[0]-l)<T?i:r):i<=o[1]&&o[1]<=r:R<t^(l<=o[0]&&o[0]<=p))return ot(u=st(s,(-a+c)/u),h),[o,et(u)]}}function a(e,n){var i=r?t:R-t,o=0;return e<-i?o|=1:i<e&&(o|=2),n<-i?o|=4:i<n&&(o|=8),o}return Dt(o,(function(t){var e,n,u,c,l;return{lineStart:function(){c=u=!1,l=1},point:function(p,h){var f,g,d=[p,h],y=o(p,h);h=r?y?0:a(p,h):y?a(p+(p<0?R:-R),h):0;!e&&(c=u=y)&&t.lineStart(),y!==u&&((f=s(e,d))&&!dt(e,f)&&!dt(d,f)||(d[0]+=T,d[1]+=T,y=o(d[0],d[1]))),y!==u?(l=0,y?(t.lineStart(),f=s(d,e),t.point(f[0],f[1])):(f=s(e,d),t.point(f[0],f[1]),t.lineEnd()),e=f):i&&e&&r^y&&(h&n||!(g=s(d,e,!0))||(l=0,r?(t.lineStart(),t.point(g[0][0],g[0][1]),t.point(g[1][0],g[1][1]),t.lineEnd()):(t.point(g[1][0],g[1][1]),t.lineEnd(),t.lineStart(),t.point(g[0][0],g[0][1])))),!y||e&&dt(e,d)||t.point(d[0],d[1]),e=d,u=y,n=h},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return l|(c&&u)<<1}}}),(function(n,r,i,o){!function(t,e,n,r,i,o){if(n){var s=V(e),a=z(e),u=r*n;null==i?(i=e+r*A,o=e-u/2):(i=gt(s,i),o=gt(s,o),(0<r?i<o:o<i)&&(i+=r*A));for(var c,l=i;0<r?o<l:l<o;l-=u)c=et([s,-a*V(l),-a*z(l)]),t.point(c[0],c[1])}}(o,t,e,i,n,r)}),r?[0,-t]:[-R,t-R])};function qt(t){return function(e){var n,r=new kt;for(n in t)r[n]=t[n];return r.stream=e,r}}function kt(){}function Vt(t,e,n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=o&&t.clipExtent(null),function(t,e){t&&Q.hasOwnProperty(t.type)?Q[t.type](t,e):J(t,e)}(n,t.stream(Mt));var s=Mt.result();n=Math.min(r/(s[1][0]-s[0][0]),i/(s[1][1]-s[0][1])),r=+e[0][0]+(r-n*(s[1][0]+s[0][0]))/2,s=+e[0][1]+(i-n*(s[1][1]+s[0][1]))/2;return null!=o&&t.clipExtent(o),t.scale(150*n).translate([r,s])}kt.prototype={constructor:kt,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 Ut=V(30*G),jt=function(t,e){return+e?(r=t,i=e,function(t){var e,n,i,s,a,u,c,l,p,h,f,g,d={point:y,lineStart:_,lineEnd:v,polygonStart:function(){t.polygonStart(),d.lineStart=x},polygonEnd:function(){t.polygonEnd(),d.lineStart=_}};function y(e,n){e=r(e,n),t.point(e[0],e[1])}function _(){l=NaN,d.point=m,t.lineStart()}function m(e,n){var i=nt([e,n]);n=r(e,n);o(l,p,c,h,f,g,l=n[0],p=n[1],c=e,h=i[0],f=i[1],g=i[2],16,t),t.point(l,p)}function v(){d.point=y,t.lineEnd()}function x(){_(),d.point=E,d.lineEnd=I}function E(t,r){m(e=t,r),n=l,i=p,s=h,a=f,u=g,d.point=m}function I(){o(l,p,c,h,f,g,n,i,e,s,a,u,16,t),d.lineEnd=v,v()}return d}):(n=t,qt({point:function(t,e){t=n(t,e),this.stream.point(t[0],t[1])}}));var n,r,i;function o(t,e,n,s,a,u,c,l,p,h,f,g,d,y){var _,m,v,x,E,I,N,b,C,w,S=c-t,L=l-e,P=S*S+L*L;4*i<P&&d--&&(v=u+g,C=W(v/=x=X((_=s+h)*_+(m=a+f)*m+v*v)),E=B(B(v)-1)<T||B(n-p)<T?(n+p)/2:k(m,_),I=(w=r(E,C))[0],N=w[1],(i<(w=L*(b=I-t)-S*(C=N-e))*w/P||.3<B((S*b+L*C)/P-.5)||s*h+a*f+u*g<Ut)&&(o(t,e,n,s,a,u,I,N,E,_/=x,m/=x,v,d,y),y.point(I,N),o(I,N,E,_,m,v,c,l,p,h,f,g,d,y)))}},zt=qt({point:function(t,e){this.stream.point(t*G,e*G)}});function Xt(t){return function(t){var e,n,r,i,o,s,a,u,c,l,p=150,h=480,f=250,g=0,d=0,y=0,_=0,m=0,v=null,x=Gt,E=null,I=Lt,N=.5,b=jt(S,N);function C(t){return[(t=o(t[0]*G,t[1]*G))[0]*p+n,r-t[1]*p]}function w(t){return(t=o.invert((t[0]-n)/p,(r-t[1])/p))&&[t[0]*F,t[1]*F]}function S(t,i){return[(t=e(t,i))[0]*p+n,r-t[1]*p]}function L(){o=ut(i=lt(y,_,m),e);var t=e(g,d);return n=h-t[0]*p,r=f+t[1]*p,P()}function P(){return c=l=null,C}return C.stream=function(t){return c&&l===t?c:c=zt(x(i,b(I(l=t))))},C.clipAngle=function(t){return arguments.length?(x=+t?Bt(v=t*G,6*G):(v=null,Gt),P()):v*F},C.clipExtent=function(t){return arguments.length?(I=null==t?(E=s=a=u=null,Lt):wt(E=+t[0][0],s=+t[0][1],a=+t[1][0],u=+t[1][1]),P()):null==E?null:[[E,s],[a,u]]},C.scale=function(t){return arguments.length?(p=+t,L()):p},C.translate=function(t){return arguments.length?(h=+t[0],f=+t[1],L()):[h,f]},C.center=function(t){return arguments.length?(g=t[0]%360*G,d=t[1]%360*G,L()):[g*F,d*F]},C.rotate=function(t){return arguments.length?(y=t[0]%360*G,_=t[1]%360*G,m=2<t.length?t[2]%360*G:0,L()):[y*F,_*F,m*F]},C.precision=function(t){return arguments.length?(b=jt(S,N=t*t),P()):X(N)},C.fitExtent=function(t,e){return Vt(C,t,e)},C.fitSize=function(t,e){return function(t,e,n){return Vt(t,[[0,0],e],n)}(C,t,e)},function(){return e=t.apply(this,arguments),C.invert=e.invert&&w,L()}}((function(){return t}))()}function Yt(t){return function(e,n){var r=V(e),i=V(n);return[(r=t(r*i))*i*z(e),r*z(n)]}}function Ht(t){return function(e,n){var r=X(e*e+n*n),i=t(r),o=z(i);i=V(i);return[k(e*o,r*i),W(r&&n*o/r)]}}function Wt(t,e){return[t,j(Y((M+e)/2))]}function Kt(t,e){return[j(Y((M+e)/2)),-t]}Yt((function(t){return X(2/(1+t))})).invert=Ht((function(t){return 2*W(t/2)})),Yt((function(t){return(t=H(t))&&t/z(t)})).invert=Ht((function(t){return t})),Wt.invert=function(t,e){return[t,2*q(U(e))-M]},Ht(q),Ht(W),Ht((function(t){return 2*q(t)})),Kt.invert=function(t,e){return[-e,2*q(U(t))-M]};var Jt=function(){var t=function(t){var e,n,r,i=Xt(t),o=i.center,s=i.scale,a=i.translate,u=i.clipExtent,c=null;function l(){var o,a=R*s(),l=i((o=lt((o=i.rotate())[0]*G,o[1]*G,2<o.length?o[2]*G:0),function(t){return(t=o.invert(t[0]*G,t[1]*G))[0]*=F,t[1]*=F,t}([0,0])));return u(null==c?[[l[0]-a,l[1]-a],[l[0]+a,l[1]+a]]:t===Wt?[[Math.max(l[0]-a,c),e],[Math.min(l[0]+a,n),r]]:[[c,Math.max(l[1]-a,e)],[n,Math.min(l[1]+a,r)]])}return i.scale=function(t){return arguments.length?(s(t),l()):s()},i.translate=function(t){return arguments.length?(a(t),l()):a()},i.center=function(t){return arguments.length?(o(t),l()):o()},i.clipExtent=function(t){return arguments.length?(null==t?c=e=n=r=null:(c=+t[0][0],e=+t[0][1],n=+t[1][0],r=+t[1][1]),l()):null==c?null:[[c,e],[n,r]]},l()}(Kt),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],2<t.length?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)};function Qt(t,e,n,r){var i=t.properties||{},o="Feature"===t.type?t.geometry:t;if("GeometryCollection"===o.type){var s=[];return x(t,(function(t){(t=Qt(t,e,n,r))&&s.push(t)})),d(s)}var a=(t=50<(a=E(t))[1]&&50<a[3])?{type:o.type,coordinates:function t(e,n){return"object"!=typeof e[0]?n(e):e.map((function(e){return t(e,n)}))}(o.coordinates,Zt(o))}:C(o,"mercator",u),u=(new I.GeoJSONReader).read(a);a=function(t,e){if(null==t)throw new Error("radians is required");if(e&&"string"!=typeof e)throw new Error("units must be a string");var n=g[e||"kilometers"];if(!n)throw new Error(e+" units is invalid");return t*n}(function(t,e){if(null==t)throw new Error("distance is required");if(e&&"string"!=typeof e)throw new Error("units must be a string");var n=g[e||"kilometers"];if(!n)throw new Error(e+" units is invalid");return t/n}(e,n),"meters"),a=I.BufferOp.bufferOp(u,a);if(!function t(e){return Array.isArray(e[0])?t(e[0]):isNaN(e[0])}((a=(new I.GeoJSONWriter).write(a)).coordinates)){var c=t?{type:a.type,coordinates:function t(e,n){return"object"!=typeof e[0]?n.invert(e):e.map((function(e){return t(e,n)}))}(a.coordinates,Zt(o))}:C(a,"wgs84",c);return c.geometry?c:function(t,e,n){if(!y(n=n||{}))throw new Error("options is invalid");var r=n.bbox,i=n.id;if(void 0===t)throw new Error("geometry is required");if(e&&e.constructor!==Object)throw new Error("properties must be an Object");return r&&_(r),i&&m(i),n={type:"Feature"},i&&(n.id=i),r&&(n.bbox=r),n.properties=e||{},n.geometry=t,n}(c,i)}}function Zt(t){var e=h(t).geometry.coordinates.reverse();t=e.map((function(t){return-t}));return Jt().center(e).rotate(t).scale(f)}var $t=function(t,e,n){var r=(n=n||{}).units,i=n.steps||64;if(!t)throw new Error("geojson is required");if("object"!=typeof n)throw new Error("options must be an object");if("number"!=typeof i)throw new Error("steps must be an number");if(void 0===e)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");i=i||64,r=r||"kilometers";var o=[];switch(t.type){case"GeometryCollection":return x(t,(function(t){(t=Qt(t,e,r,i))&&o.push(t)})),d(o);case"FeatureCollection":return v(t,(function(t){(t=Qt(t,e,r,i))&&v(t,(function(t){t&&o.push(t)}))})),d(o)}return Qt(t,e,r,i)},te=(o=n(76),n.n(o));o=function(t){var e,n,r,o,u,c,l,p,h,f,g,d,y,_,m,v,x,E,I,N,b,C,w,S,L,P,O,T=0<arguments.length&&void 0!==t?t:{},R=!1,M=[],D=1,A=0,F=(t=Object.prototype.hasOwnProperty.call(T,"tools")?T.tools:["click","box","circle","polygon","buffer"],Object.prototype.hasOwnProperty.call(T,"default")?T.default:"click"),G=t.includes("click"),B=t.includes("box"),q=t.includes("circle"),k=t.includes("polygon"),V=t.includes("buffer");function U(t){R=t}function j(){document.getElementById(I.getId()).classList.add("active"),G&&document.getElementById(N.getId()).classList.remove("hidden"),B&&document.getElementById(C.getId()).classList.remove("hidden"),q&&document.getElementById(w.getId()).classList.remove("hidden"),k&&document.getElementById(b.getId()).classList.remove("hidden"),V&&document.getElementById(S.getId()).classList.remove("hidden"),document.getElementById(I.getId()).classList.remove("tooltip"),U(!0),n=new a.a.ol.interaction.Pointer({handleEvent:Y}),r=new a.a.ol.interaction.Draw({source:e,type:"Circle",geometryFunction:a.a.ol.interaction.Draw.createBox()}),o=new a.a.ol.interaction.Draw({source:e,type:"Circle"}),u=new a.a.ol.interaction.Draw({source:e,type:"Polygon"}),c=new a.a.ol.interaction.Pointer({handleEvent:J}),_.addInteraction(n),_.addInteraction(r),_.addInteraction(o),_.addInteraction(u),_.addInteraction(c),r.on("drawend",H),o.on("drawstart",(function(t){l=t.feature.getGeometry(),g&&g.parentNode.removeChild(g),(g=document.createElement("div")).className="o-tooltip o-tooltip-measure",f=new a.a.ol.Overlay({element:g,offset:[0,0],positioning:"bottom-center",stopEvent:!1}),_.addOverlay(f)})),o.on("drawend",W),u.on("drawstart",(function(t){})),u.on("drawend",K),document.getElementById(v.getId()).click()}function z(){m&&document.getElementById(m.getId()).classList.remove("active"),document.getElementById(I.getId()).classList.remove("active"),G&&document.getElementById(N.getId()).classList.add("hidden"),B&&document.getElementById(C.getId()).classList.add("hidden"),q&&document.getElementById(w.getId()).classList.add("hidden"),k&&document.getElementById(b.getId()).classList.add("hidden"),V&&document.getElementById(S.getId()).classList.add("hidden"),document.getElementById(I.getId()).classList.add("tooltip"),_.removeInteraction(n),_.removeInteraction(r),_.removeInteraction(o),_.removeInteraction(u),_.removeInteraction(c),$(),y.clear(),O.clearSelection(),U(!1)}function X(t){m&&document.getElementById(m.getId()).classList.remove("active"),document.getElementById(t.getId()).classList.add("active"),m=t,"click"===x?(n.setActive(!0),r.setActive(!1),o.setActive(!1),u.setActive(!1),c.setActive(!1),_.un("pointermove",tt)):"box"===x?(n.setActive(!1),r.setActive(!0),o.setActive(!1),u.setActive(!1),c.setActive(!1),_.un("pointermove",tt)):"circle"===x?(n.setActive(!1),r.setActive(!1),o.setActive(!0),u.setActive(!1),c.setActive(!1),_.on("pointermove",tt)):"polygon"===x?(n.setActive(!1),r.setActive(!1),o.setActive(!1),u.setActive(!0),c.setActive(!1),_.un("pointermove",tt)):"buffer"===x&&(n.setActive(!1),r.setActive(!1),o.setActive(!1),u.setActive(!1),c.setActive(!0),_.un("pointermove",tt))}function Y(t){if("singleclick"!==t.type)return!0;var e=t.originalEvent.ctrlKey,n=t.pixel,r=t.coordinate,i=(t=E.getQueryableLayers(),a.a.getFeatureInfo.getFeaturesAtPixel({coordinate:r,map:_,pixel:n,clusterFeatureinfoLevel:D,hitTolerance:A},E));return!1!==i&&a.a.getFeatureInfo.getFeaturesFromRemote({coordinate:r,layers:t,map:_,pixel:n},E).done((function(t){t=(t||[]).concat(i),e?0<t.length&&O.removeItems(t):1===t.length?O.addOrHighlightItem(t[0]):1<t.length&&O.addItems(t)})),!1}function H(t){var e,n=t.feature.getGeometry().getExtent();(t=E.getQueryableLayers()).length<1||(e=[],n=Q(t,n),e=e.concat(n.selectedClientItems),s.a.all(n.selectedRemoteItemsPromises).then((function(t){t.forEach((function(t){return e=e.concat(t)})),1===e.length?O.addOrHighlightItem(e[0]):1<e.length&&O.addItems(e)})).catch((function(t){return console.error(t)})))}function W(t){l=null,$();var e=t.feature.getGeometry(),n=e.getExtent(),r=(t=E.getQueryableLayers(),[]);n=Q(t,n),r=r.concat(Z(n.selectedClientItems,e));s.a.all(n.selectedRemoteItemsPromises).then((function(t){t.forEach((function(t){return r=r.concat(Z(t,e))})),1===r.length?O.addOrHighlightItem(r[0]):1<r.length&&O.addItems(r)}))}function K(t){var e=t.feature.getGeometry(),n=e.getExtent(),r=(t=E.getQueryableLayers(),[]);n=Q(t,n),r=r.concat(Z(n.selectedClientItems,e));s.a.all(n.selectedRemoteItemsPromises).then((function(t){t.forEach((function(t){return r=r.concat(Z(t,e))})),1===r.length?O.addOrHighlightItem(r[0]):1<r.length&&O.addItems(r)}))}function J(t){if("singleclick"!==t.type)return!0;var e=t.pixel,n=t.coordinate,r=(t=E.getQueryableLayers(),a.a.getFeatureInfo.getFeaturesAtPixel({coordinate:n,map:_,pixel:e,clusterFeatureinfoLevel:D,hitTolerance:A},E));return!1!==r&&a.a.getFeatureInfo.getFeaturesFromRemote({coordinate:n,layers:t,map:_,pixel:e},E).done((function(t){var e,n,o;0<(t=(t||[]).concat(r)).length&&(1===t.length?(d=t[0].getFeature().clone(),e=s.a.resolve()):1<t.length&&(n=(t=t).map((function(t){return t.getFeature()})),o=t.map((function(t){var e=(n=t.getLayer().get("attributes"))&&n[0].name||void 0,n=t.getLayer().get("title");e=(t=t.getFeature()).get(e)||t.get("namn")||t.getId(),e=n?"<span><b>".concat(e,"</b> (").concat(n,")</span>"):"<span>".concat(e,"</span>");return'<div class="featureSelectorItem" id="'.concat(t.getId(),'"> ').concat(e," </div>")})),e=new s.a((function(t){for(var e='<div id="featureSelector">\n                        '.concat(o.join(""),"\n                      </div>"),r=E.getId(),i=a.a.ui.Modal({title:"Du har valt flera objekt:",content:e,target:r}),s=document.getElementsByClassName("featureSelectorItem"),u=0;u<s.length;u++)s[u].addEventListener("click",(function(e){var r=this;d=n.find((function(t){return t.getId().toString()===r.id})).clone(),i.closeModal(),t(),e.stopPropagation()}))}))),e.then((function(){return t=E.getId(),e=a.a.ui.Modal({title:"Ange buffert i meter (ex 10,4):",content:'<div>\n                      <input type="number" id="bufferradius">\n                      <button id="bufferradiusBtn">OK</button>\n                    </div>',target:t}),n=document.getElementById("bufferradius"),void document.getElementById("bufferradiusBtn").addEventListener("click",(function(t){var r,o,u=n.value;if(!(u=i()(u))&&0!==u||u<=0&&(d.getGeometry().getType()===GeometryType.POINT||d.getGeometry().getType()===GeometryType.MULTI_POINT||d.getGeometry().getType()===GeometryType.MULTI_LINE_STRING||d.getGeometry().getType()===GeometryType.LINE_STRING))return n.classList.add("unvalidValue"),void t.stopPropagation();t.stopPropagation(),e.closeModal(),t=u,r=function(t,e){var n,r=new a.a.ol.format.GeoJSON,i=_.getView().getProjection();return console.log(t),t="Circle"===t.getType()?((n=a.a.ol.geom.Polygon.fromCircle(t)).transform(i,"EPSG:4326"),r.writeGeometryObject(n)):(t.transform(i,"EPSG:4326"),r.writeGeometryObject(t)),e=$t(t,e/1e3,{units:"kilometers"}),(e=r.readFeature(e)).getGeometry().transform("EPSG:4326",i),i=e.clone(),y.addFeature(i),e.clone()}(d.getGeometry(),t).getGeometry(),u=r.getExtent(),t=E.getQueryableLayers(),o=[],u=Q(t,u),o=o.concat(Z(u.selectedClientItems,r)),s.a.all(u.selectedRemoteItemsPromises).then((function(t){t.forEach((function(t){return o=o.concat(Z(t,r))})),1===o.length?O.addOrHighlightItem(o[0]):1<o.length&&O.addItems(o)}))}));var t,e,n})))})),!1}function Q(t,e){var n=[],r=[];function i(t,i){var o,u,c,l,p,h=i?(o=i.get("name"),i.get("title")):(o=t.get("name"),t.get("title"));!function(t){if(!t.get("queryable"))return!0;var e=_.getView().getResolution();return e>t.getMaxResolution()||e<t.getMinResolution()}(t)&&(t.getSource().forEachFeatureIntersectingExtent?t.getSource().forEachFeatureIntersectingExtent(e,(function(e){e=new a.a.SelectedItem(e,t,_,o,h),n.push(e)})):r.push((u=t,c=e,l=o,p=h,new s.a((function(t){a.a.getFeature(null,u,E.getMapSource(),E.getProjectionCode(),E.getProjection(),c).then((function(e){e=e.map((function(t){return new a.a.SelectedItem(t,u,_,l,p)})),t(e)})).catch((function(t){return console.error(t)}))})))))}return t.forEach((function(t){"GROUP"===t.get("type")?t.getLayers().forEach((function(e){"GROUP"===e.get("type")?console.log("LayersGroups deeper than one level are not handled!"):i(e,t)})):i(t)})),{selectedClientItems:n,selectedRemoteItemsPromises:r}}function Z(t,e){var n=e.clone(),r=new a.a.ol.format.GeoJSON,i=_.getView().getProjection(),o="Circle"===n.getType()?((e=a.a.ol.geom.Polygon.fromCircle(n)).transform(i,"EPSG:4326"),r.writeGeometryObject(e)):(n.transform(i,"EPSG:4326"),r.writeGeometryObject(n)),s=[];return t.forEach((function(t){var e=t.getFeature();e.getGeometry().transform(i,"EPSG:4326");var n=r.writeFeatureObject(e);te()(n,o)||s.push(t),e.getGeometry().transform("EPSG:4326",i)})),s}function $(){_.removeOverlay(f)}function tt(t){l&&(h=l.getRadius(),g.innerHTML="".concat(h.toFixed()," m"),p=(t.coordinate[0]+l.getCenter()[0])/2,h=(t.coordinate[1]+l.getCenter()[1])/2,f.setPosition([p,h]))}return a.a.ui.Component({name:"multiselection",onInit:function(){(G||B||q||k||V)&&(P=a.a.ui.Element({tagName:"div",cls:"flex column"}),I=a.a.ui.Button({cls:"o-multiselect padding-small margin-bottom-smaller icon-smaller round light box-shadow",click:function(){var t;t={name:"multiselection",active:!R},E.dispatch("toggleClickInteraction",t)},icon:"#baseline-select-all-24px",tooltipText:"Markera i kartan",tooltipPlacement:"east"}),M.push(I),G&&(N=a.a.ui.Button({cls:"o-multiselect-click padding-small margin-bottom-smaller icon-smaller round light box-shadow hidden",click:function(){x="click",X(this)},icon:"#fa-mouse-pointer",tooltipText:"Klick",tooltipPlacement:"east"}),M.push(N),v=N),B&&(C=a.a.ui.Button({cls:"o-multiselect-box padding-small margin-bottom-smaller icon-smaller round light box-shadow hidden",click:function(){x="box",X(this)},icon:"#fa-square-o",tooltipText:"Ruta",tooltipPlacement:"east"}),M.push(C)),q&&(w=a.a.ui.Button({cls:"o-multiselect-circle padding-small margin-bottom-smaller icon-smaller round light box-shadow hidden",click:function(){x="circle",X(this)},icon:"#fa-circle-o",tooltipText:"Cirkel",tooltipPlacement:"east"}),M.push(w)),k&&(b=a.a.ui.Button({cls:"o-multiselect-polygon padding-small margin-bottom-smaller icon-smaller round light box-shadow hidden",click:function(){x="polygon",X(this)},icon:"#fa-draw-polygon-o",tooltipText:"Polygon",tooltipPlacement:"east"}),M.push(b)),V&&(S=a.a.ui.Button({cls:"o-multiselect-buffer padding-small margin-bottom-smaller icon-smaller round light box-shadow hidden",click:function(){x="buffer",X(this)},icon:"#fa-bullseye",tooltipText:"Buffer",tooltipPlacement:"east"}),M.push(S)),"click"===F?v=N:"box"===F?v=C:"circle"===F?v=w:"polygon"===F?v=b:"buffer"===F&&(v=S))},onAdd:function(t){E=t.target,L="".concat(E.getMain().getMapTools().getId()),_=E.getMap(),O=E.getSelectionManager(),e=new a.a.ol.source.Vector,t=[new(t=a.a.ol.style).Style({stroke:new t.Stroke({color:"rgba(255, 0, 0, 0.5)",width:1}),fill:new t.Fill({color:"rgba(0, 0, 255, 0)"})}),new t.Style({image:new t.Circle({radius:5,fill:new t.Fill({color:"red"})})})],(y=a.a.featurelayer(null,_)).setStyle(t),this.addComponents(M),this.render(),E.on("toggleClickInteraction",(function(t){("multiselection"===t.name&&t.active?j:z)()}))},render:function(){var t="".concat(P.render()),e=a.a.ui.dom,n=e.html(t);document.getElementById(L).appendChild(n),t=I.render(),n=e.html(t),document.getElementById(P.getId()).appendChild(n),G&&(t=N.render(),n=e.html(t),document.getElementById(P.getId()).appendChild(n)),B&&(t=C.render(),n=e.html(t),document.getElementById(P.getId()).appendChild(n)),q&&(t=w.render(),n=e.html(t),document.getElementById(P.getId()).appendChild(n)),k&&(t=b.render(),n=e.html(t),document.getElementById(P.getId()).appendChild(n)),V&&(t=S.render(),n=e.html(t),document.getElementById(P.getId()).appendChild(n)),this.dispatch("render")}})};e.default=o}]).default;